Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54180
in iOS 26, the tintColor prop is not applied by default to the action sheets buttons.
This change fixes it by restoring the same behavior we had before iOS 26.
## Changelog:
[iOS][Fixed] - Apply tint color to Actions sheets buttons
Reviewed By: cortinico
Differential Revision: D84844319
fbshipit-source-id: e211d0a735ea2da35f825c3568d66ba83e4ad832
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54179
iOS 26 changed how the `popoverPresentationController.sourceView`and the `popoverPresentationController.sourceRect` are handled by iOS.
Before iOS 26, those two properties were ignored by iPhones but used by iPads.
After iOS 26, those two properties are used by both iPhones and iPads.
This introduced an issue where users presenting an action sheet were actually able to interact with the back button on iPhone even ehwn they were not supposed to.
This change adds a condition over the idiom used (iPhone/iPad) to make sure that we use the anchors only with the iPad idions as it used to be before.
## Changelog:
[iOS][Fixed] - Revert action sheet behavior not to break apps on iOS 26
Reviewed By: RSNara
Differential Revision: D84842625
fbshipit-source-id: 347dfc21ee478abd02ba26078cb27d05e9cb64c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54184
In Expo, someone reported (https://github.com/expo/expo/issues/40158) that `expo-image-manipulator` causes memory crashes when processing large images (> 30MB).
Image manipulator uses `RCTImageLoader` to load and decode images. As opposed to the Image component, it always requests for images in full size. For large images it may crash at `CGImageSourceCreateThumbnailAtIndex` which in the provided repro slowly increases memory usage until it finally crashes after a few seconds of running.
I figured out that not including the `kCGImageSourceThumbnailMaxPixelSize` option works much better, but using `CGImageSourceCreateImageAtIndex` instead of `CGImageSourceCreateThumbnailAtIndex` works even better – it's faster and consumes less memory during decoding. This is more or less what `SDWebImage` library does, see [`SDImageIOAnimatedCoder`](https://github.com/SDWebImage/SDWebImage/blob/master/SDWebImage/Core/SDImageIOAnimatedCoder.m#L488-L509).
With the proposed changes, it's still crashing but only for the largest image (64MB), other images (40MB and 50MB) are now working fine. Obviously, it cannot be fixed entirely and it's not recommended to load such big images without downscaling them.
## Changelog:
[IOS] [CHANGED] - Use `CGImageSourceCreateImageAtIndex` instead of `CGImageSourceCreateThumbnailAtIndex` to decode full-sized images
Pull Request resolved: https://github.com/facebook/react-native/pull/54127
Test Plan: I've tested the examples of the `Image` component in RNTester as well as the repro provided in https://github.com/expo/expo/issues/40158
Reviewed By: javache
Differential Revision: D84835416
Pulled By: cipolleschi
fbshipit-source-id: a182dd00f00194f0463ad4f583cc695647414fca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54175
Changelog: [Internal] - Fix a bug with IntersectionObserver where we weren't considering edge-adjacent intersections.
So it is valid for `intersectionRatio` to be 0, but still be intersecting.
Reviewed By: mdvacca
Differential Revision: D84787414
fbshipit-source-id: ef6ab35be594f5b734c8c25d2475ee2a6dba1fe5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54177
Changelog: [Internal] - Rename the term "custom root" to "explicit root" to align with w3c spec. And "implicit root" for the document root.
Reviewed By: mdvacca
Differential Revision: D84795887
fbshipit-source-id: afec23f6763af56c6de1d3fce2f9501187559fb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54170
This diff extracts the `toString(double, char)` function used to format percent values from `ValueUnit` into a separate `DoubleConversions` file.
This was added to graphics directly instead of moving it to core to avoid introducting cyclic dependencies since core depends on graphics.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D84714535
fbshipit-source-id: e41be90d211c28dba12e0920293698b3e1d3a1c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54178
The `resizeMethod` prop was reading from `internal_analyticTag` and not setting on the backing image, this change remaps it
Changelog: [General][Fixed] resizeMethod was not propagated correctly on Android with Props 2.0
Reviewed By: javache
Differential Revision: D84716400
fbshipit-source-id: 320aded79cba787585d875fc46111bca34c0c30c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54143
This will become the default in AGP 9.x so let's update it inside RNTester as well.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D84548388
fbshipit-source-id: 755344b93204f074926e47ef2a5c980b60e9121b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54164
Adding `fadingEdgeLength` prop to the Android scroll view props together with prop diffing support for Props 2.0.
Changelog: [Internal]
Differential Revision: D84788963
fbshipit-source-id: 6cf8011816311797fe0d805f68ccb026e32d7bff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54158
Changelog: [Internal]
Animated was capturing `self` directly in C++ std::function contexts. When capturing Objective-C objects in C++ lambdas, they aren't automatically retained. When these lambdas were invoked later (potentially after `self` was deallocated), accessing `_onRender` and other instance variables caused the crash.
Reviewed By: zeyap
Differential Revision: D84638972
fbshipit-source-id: 38f8630cf4f677e29afff07348c2d5dbb1f5cd08
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54154
Adds a prominent vertical "Fast Refresh ⚛︎" marker entry in the performance timeline when a Fast Refresh update is complete.
This is available in apps with `performance.mark()` enabled (Canary feature).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D84624705
fbshipit-source-id: 6c0ae0b8ae0acaaaba559a1854f64218bf5feabb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54126
The binary size for RN builds increased by ~180KiB due to the implementation of the `experimental_backgroundImage` property diffing.
This diff removes default inlining for the `toDynamic` serialization functions of the structs used by the linear and radial gradient styles.
Combined with the binary size improvements done previously for `ColorStop` and `ValueUnit`, the binary size has been reduced by 176.0KiB
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D84214151
fbshipit-source-id: 58b045eee839beb4f944689e752096df8f310e77
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54125
With ColorStop and ValueUnit being used at multiple locations, inlining the `toDynamic` conversion used for RN Android and using `std::format` to convert floating point values to string increased the binary size of RN Android by ~180KiB. This diff declares the functions outside the header to avoid inlining the functions and removes the dependency on `std::format` for the percent value string formatting.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D84349391
fbshipit-source-id: 2aab6f057f8b69d0af3779f6edabdd42705d0445
Summary:
Fixes: https://github.com/facebook/react-native/issues/53887
Fixes: https://github.com/expo/expo/issues/39480
In the latest Android 16 update, requesting permissions does not always change the app's state (the `onPause` and `onResume` functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside the `ReactActivityDelegate` assumes that Android will call `onResume` after receiving permission state information from the system, which is no longer the case.
Probably connected with [this commit](https://android.googlesource.com/platform/packages/modules/Permission/%2B/5dca0ccb26f2b99d706a1d3e9402f851e849c913)
## Changelog:
[ANDROID] [FIXED] - Fix request permission not always resolving in Android 16
Pull Request resolved: https://github.com/facebook/react-native/pull/53898
Test Plan:
- I've tested it in the RNTester by denying the camera permission three times.
- I've also checked if the patch works with the Expo permissions code.
Reviewed By: javache
Differential Revision: D83059478
Pulled By: cortinico
fbshipit-source-id: 7bf33b379a1b6606ad2da2f75d337bf951e3986b
Summary:
Instead of copying the `std::function` into `invokeAsync`, we now move it.
## Changelog:
[GENERAL] [CHANGED] - Move `std::function` into `CallInvoker::invokeAsync` instead of copying it
<!-- 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/54141
Test Plan: Build, run. A lot of code still uses the old `invokeAsync` function.
Reviewed By: christophpurrer
Differential Revision: D84563949
Pulled By: javache
fbshipit-source-id: 283be3d12f1ac1c7f3da528c6b50b36cc81cd82a
Summary:
Avoid data loss during conversion which fixes https://github.com/microsoft/react-native-windows/issues/14698
## Changelog:
Added a one-line fix to static_cast to a float
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Avoid data loss during conversion
Pull Request resolved: https://github.com/facebook/react-native/pull/54132
Test Plan: Working in react native windows
Reviewed By: javache
Differential Revision: D84510049
Pulled By: cortinico
fbshipit-source-id: 37691a9169bf143d19d438e2ce2bbea67f711b3a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53778
I've been looking into the next major bump of AGP to 9:
https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin
This change adapts our project so that it keeps on buildign with AGP 8
(as the bump to 9 would be a breaking change), but it addresses some of the build
failures we'll be having with AGP 9:
- Set `resValues` build option to true (default was changed true -> false in AGP 9)
- Opts out our project from `android.builtInKotlin` and `android.newDsl` for the time being.
Changelog:
[Android] [Fixed] - Fix build failures with RNGP due to AGP 9.0.0-alpha05
Reviewed By: alanleedev
Differential Revision: D82452555
fbshipit-source-id: 99561f039bf943f5ce99008ce073ca86431cfaed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53677
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that runs `prepareHeaders` that configures the headers for React Native and Codegen targets.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778440
fbshipit-source-id: 26b973c07e82f30663e51c4a8e0e72f54765115e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53676
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that generates codegen artifacts. Those are required by React Native and by the app to build properly.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778439
fbshipit-source-id: 7fe5cc0b612d2d9324d68fe04ec556e986ec14af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53675
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that create hardlinks for React Native so it can build from source
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778454
fbshipit-source-id: 702a603629e4fad154b5d79dea6d96fcd80235b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53674
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function updates the PAckage.swift file to set BUILD_FROM_SOURCE to true
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778460
fbshipit-source-id: b06ebc546aa8e87acdb15706a0559e9046173784
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53673
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that configure React Native to be swift compatible by creating the React-umbrella and modulemap
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778437
fbshipit-source-id: 8bfd0df3abed813a221e5ef7972f4b7a6e292e76
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53667
This change updates the Package.swift file to enable building RNTester and HelloWorld from source.
The set of changes is the following:
- add a BUILD_FROM_SOURCE flag to toggle between building for creating prebuilds and building an app from source
- configure the proper header search path based on whether we want to build an app from source or not
- split the ReactFabricComponents target in multiple subtargets. This is required because when building from source we can't have targets whose Source folder is overlapping.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778452
fbshipit-source-id: 00553a9966e7d96177e70d45179e712536c23124
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53671
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that prepares the prebuilds for ios so we can leverage them when building from source
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778467
fbshipit-source-id: bacfcfd3d646bfa27dcd800417e4787308a51a86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53706
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that runs `pod deintegrate` to remove remainings of cocoapods
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778468
fbshipit-source-id: 20e1cfefcef8318d63d4a6ff92050ced0f91ef53
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53669
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that given the root of the app and the name of the xcodeproject file, can return the path to the Xcode project file
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778456
fbshipit-source-id: f7050bcb049d75a5b1cabf340a5b98f4736e60b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54084
Android port of D83754145.
1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83981793
fbshipit-source-id: b4b8828433881c15e44a0468275a5cf398e7d050
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54114
This setup script will be published in the react-native package.
Other people might not have prettier installed, so it will crash the mock below.
Therefore, we wrap this mock in a try-catch.
Changelog: [General][Fixed] Fixed https://github.com/facebook/react-native/issues/54102
Reviewed By: cortinico
Differential Revision: D84292458
fbshipit-source-id: e884b02eec6abb7a964e01dd01f72f6e2ee31dab
Summary:
Update the copyright header in packages/react-native/ReactCommon/yoga/cmake/yoga-config.cmake.in from
```
# Copyright (c) Facebook, Inc. and its affiliates.
```
to
```
# Copyright (c) Meta Platforms, Inc. and affiliates.
```
for consistency with the rest of the codebase. This change does not affect functionality.
close https://github.com/facebook/react-native/issues/54086
## Changelog:
[GENERAL] [CHANGED] - Updated copyright header in Yoga CMake file from Facebook to Meta.
Pull Request resolved: https://github.com/facebook/react-native/pull/54087
Test Plan: Tests Required: No
Reviewed By: robhogan
Differential Revision: D84101874
Pulled By: cortinico
fbshipit-source-id: 534fb700dcbb14d0e91c8c287e8a9af251cba4f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54101
Changelog:
[Android][Deprecated] Mark `NetworkingModule.sendRequestInternal` as deprecated
The `NetworkingModule.sendRequestInternal` method is an implementation detail of the `sendRequest` method and does not need to be public. In this diff, we mark it as deprecated ahead of removing it from the public API in a future release of React Native.
Reviewed By: javache
Differential Revision: D84250142
fbshipit-source-id: fad62eeae4f9bf06e00578b3cfb6c2c077c08e5c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54115
Horizontal scroll view extensions should be able to customize the scrolling behavior for state restores. This adds the `restoreScrollTo` function that will be called to restore the scroll position to the location provided by the shadow node state.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D84310601
fbshipit-source-id: 007caa3d0922a5430ffc6f970eebb180a112f894
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54113
With `Trait::hidden` unmounting and remounting views for shadow nodes holding scroll state, we have to restore the scroll position from the shadow node state when the scroll view is being remounted
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84291899
fbshipit-source-id: 596839f56757dbdf9485e82380af31a71865e1df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54112
This diff adds the possibility to control the use of `Trait::Hidden` on Android platforms through feature flags. The feature flag is Android specific and only accessed on Android platforms.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84289662
fbshipit-source-id: 0ee1d0702aa36df25c842017673176a9c7984b23
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54091
## Changelog:
[Internal] [Changed] - use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep
So it's only enabled for catalyst and fantom when building with BUCK while gated from other meta apps, and enabled by default in oss version
Reviewed By: sammy-SC
Differential Revision: D84157729
fbshipit-source-id: e822f11c4b64b77b17a698bf3b60b5c5a4faf4f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54096
Exporting this since we have some incoming changes to Animated which okwasniewski wants to make and should be applied to CxxAnimated too.
This is not hooked up to any OSS apps yet.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84200113
fbshipit-source-id: 7a278ebf3f9c2b0779971591804d3fbd89ce4723
Summary:
LayoutDirectionUtil is part of legacy architecutre, in this diff I'm deleting it from fbsource
changelog: [internal] internal
Reviewed By: shwanton, cortinico
Differential Revision: D83984648
fbshipit-source-id: 161e4347ccab160fb1be66cba05f9474c0ad3b72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54007
## Changelog:
[Android] [Changed] - Defer to responder system to terminate on scroll
when FeatureFlag responderTerminateOnScrollAndroid is turned on
on ios, we don't dispatch TouchCancel at scroll to terminate scrollview's children, instead, responder system handles responder termination when it receives onScroll event
Currently, TouchCancel native event at scroll will stop any ongoing touch events dispatched from native, and will unexpectedly terminate responder even if responder has transferred from child of scrollView to parent view, because of race condition. Fixing this will require revisiting a large part of the native touch system on android.
Reviewed By: sammy-SC
Differential Revision: D83584281
fbshipit-source-id: 10b3c98c30037b50f1705e11aa9ca016a6c3d974
Summary:
In this change, we are allowing users to install cocoapods with the RCT_REMOVE_LEGACY_ARCH flag enabled to compile out the legacy architecture.
For it to work, we had to adjust some part of the framework that we forgot about when working on the internal side of this feature.
bypass-github-export-checks
## Changelog:
[iOS][Added] - Added way to set the RCT_REMOVE_LEGACY_ARCH flag from Cocoapods to compile ou the legacy arch
Pull Request resolved: https://github.com/facebook/react-native/pull/53975
Test Plan:
Tested locally with RNTester and HelloWorld:
```
cd packages/rn-tester
RCT_REMOVE_LEGACY_ARCH=1 bundle exec pod install
open RNTesterPods.xcworkspace
```
Then build and run and verify that the app keeps running.
Same check with Hello World.
Reviewed By: cortinico
Differential Revision: D83471112
Pulled By: cipolleschi
fbshipit-source-id: e5c8fe4eccb3c25510228f20e9e6da3980b0bf0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54074
Currently, we dispatch view commands eagerly at the beginning of a batch. This behavior originated with https://github.com/facebook/react-native/commit/b54257c628b1a174a2c41960e7fc4d2d719ad731.
However, this can make it difficult to allow developers to control mount item execution order. For example, someone may want to make sure a view command is processed *after* a particular mount item, and not exclusively rely on retryable command exceptions.
This change sets up a feature flag to enable in-order execution of view command mount items.
## Changelog
[Internal]
Reviewed By: mdvacca, sammy-SC
Differential Revision: D84061054
fbshipit-source-id: 7cb68c43823ed67f541f4e8f2d7471629609a905
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54083
Changelog: [Internal]
Fixes a bug in `__DEBUGGER_SESSION_OBSERVER__` where the wrong state could be reported if more than one session existed. Now we reuse the accurate domain status tracking mechanism added in D83847356.
Reviewed By: hoxyq
Differential Revision: D84007326
fbshipit-source-id: e7f2c33286aa69c3bd9d5662d35dad579ca3c770
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54069
Changelog: [Internal]
D83238216 added a `tryExecuteSync` function for use with `EnableExecutorFromThis` objects - concretely, for calling functions on a `weak_ptr<RuntimeTarget>` from the JS thread while ensuring the `RuntimeTarget` is always destroyed on the inspector thread.
`tryExecuteSync` is a generalisation of the lambda-based `delegateExecutorSync` helper from `RuntimeTargetConsole`, so in this diff we refactor the latter to use the more general and better-documented function.
Reviewed By: huntie
Differential Revision: D83838062
fbshipit-source-id: 85fd5a43e204cc634b573e2a3bda47a9ec523fca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54052
1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83754145
fbshipit-source-id: ee08f419d2a7013bbc915ee40b1428d7810e6c42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54082
Changelog: [Internal]
Followup from D83238216.
Adds bookkeeping in `RuntimeTarget` to allow checking from the JS thread whether there is a session with the `Network` CDP enabled. We then use this in the implementation of `__NETWORK_REPORTER__.createDevToolsRequestId` as a more precise alternative to checking the `NetworkHandler` singleton's state.
This is a first step towards breaking up the `NetworkHandler` singleton, subsuming its responsibilities into the Target/Agent architecture of `jsinspector-modern` and fixing a variety of bugs in the process.
NOTE: The additions to `RuntimeTarget` are more general than just tracking the `Network` domain - I'll use them in an upcoming diff to fix a concrete bug related to concurrent session support in `DebuggerSessionObserver`.
Reviewed By: huntie
Differential Revision: D83847356
fbshipit-source-id: 3384e3feb44adbd9ed4d54a20875669d63ae8764
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54051
Adds the private, experimental `__NETWORK_REPORTER__.createDevToolsRequestId()` JavaScript method behind the Fusebox network inspection feature flag.
`createDevToolsRequestId()` returns a unique string ID for a network request, and records the current call stack as the request's [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator). If the native networking layer passes the same request ID into the C++ `NetworkReporter::reportRequestStart` method, the corresponding CDP [`requestWillBeSent`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#event-requestWillBeSent) event will contain the stack trace.
Changelog: [Internal]
Reviewed By: robhogan, huntie
Differential Revision: D83238216
fbshipit-source-id: 5076d887254cd9711f86f72792e791eabc43f297
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54089
Changelog: [Internal]
Adds a minimal standards-compliant UUID v4 generator to `react/utils` for use elsewhere in React Native. We don't need UUID parsing, support for UUID versions other than 4, a UUID value type, or extremely high performance - which makes inlining this simple, portable implementation directly in our codebase acceptable.
Reviewed By: robhogan
Differential Revision: D84149720
fbshipit-source-id: 399d88f4adaff3be4fef5dd1abab3c8552ca1a75
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54092
The `transformOrigin` conversion didn't call into the `toDynamic` conversion for the underlying `ValueUnit` instances for the x and y coordinates. This diff fixes the conversion so that percentages would be correctly converted.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D84165034
fbshipit-source-id: 40bf32a45770cd43fc67103f4c2e9785abffb033
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54093
Changelog: [Internal]
adding a private! api so we can parse text payloads
Reviewed By: mdvacca
Differential Revision: D83939903
fbshipit-source-id: 8f348648f16d53f2bd86046fb0c3689d7bae3d93
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54058
## Changelog:
[Internal] [Changed] - create UIManagerAnimationBackend to replace forward declare `class AnimationBackend`
for other delegates in UIManager, we usually explicitly create an interface in UIManager package with the public APIs we want to expose, we can follow that pattern here, so we avoid the forward declaration without definition situation, and decoupling UIManager with AnimationBackend
also this way, in the future, animation runtimes that consume AnimationBackend can just include `UIManagerAnimationBackend` (where we expose all of public APIs of AnimationBackend) and remain somewhat decoupled too
Reviewed By: sammy-SC
Differential Revision: D83679693
fbshipit-source-id: e58d180b7d36a3f0e766c2914b16128346abe070
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54050
Changelog: [Internal]
A naive approach to keeping track of request initiators inside the `NetworkHandler` singleton for CDP reporting purposes:
1. Expose a new `recordRequestInitiatorStack` method.
2. Keep the CDP-formatted stack trace (as a `folly::dynamic`) in a map keyed by request ID.
3. Destructively consume the stack trace during `onRequestWillBeSent`.
Reviewed By: huntie
Differential Revision: D83754143
fbshipit-source-id: 4f5a335f2eed66a168f9d39a66c8af6ccee23d6f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54076
Changelog: [Internal]
Add PlatformColor caching so we do not need to make as many JNI calls which helps with perf.
Reviewed By: javache
Differential Revision: D83050864
fbshipit-source-id: 56a53a5facccdbbb3ff18a66df9e07d794bb074c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54048
Changelog: [Internal]
Adds an engine-agnostic mechanism for serialising a previously captured stack trace as a CDP [`Runtime.StackTrace`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#type-StackTrace). This complements the existing `RuntimeTargetDelegate::captureStackTrace` method, which returns an opaque, engine-specific representation of a stack trace.
This can be used as a building block for implementing higher-level CDP message types like [`Network.Initiator`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) within React Native, while keeping the underlying stack trace representation private to each engine.
NOTE: This diff includes an implementation for Hermes that duplicates logic from the Hermes codebase. Further up the stack, I have diffs to replace this with a new API to be provided by Hermes.
Reviewed By: huntie
Differential Revision: D83754142
fbshipit-source-id: 1439ea446665562e5f92c7b1dcb6ab65af1324cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54001
This diff adds support for state restore to the horizontal scroll view. The same logic was applied as for the vertical scroll view. The only difference being that the shadow node for the horizontal scroll view needed to be updated to add `ScrollState`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D83247017
fbshipit-source-id: 7c26901df4c43ed70addc7b6d8afb9a6d3e549a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54000
Update the scroll view manager to load the fabric state and restore the scroll position and scroll away top padding on mount. Restoring the scroll view happens in the react scroll view state setter, which gets called by the `ReactScrollViewHelper` with the deserialized state provided on mount.
The state loading will happen only until the scroll view itself submits a new state to Fabric (due to scrolling). This guarantees that we only restore the initial state on mount.
This diff also updates the scroll away top padding setter to support setting a new value without triggering a fabric state update.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D83247016
fbshipit-source-id: 7ae44b9f69c58da9e5163574073767aea2713b62
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53999
Update the `ScrollViewHelper` class to support reading the scroll state from the provided `stateWrapper` and assigning it to the view implementing the `HasScrollState` interface.
This will be used in a future diff to implement scroll state loading on the scroll view component in the scroll state setter function. This enables having one implementation of the state loading for all variants of the scroll view (vertical and horizontal scroll views).
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D83247018
fbshipit-source-id: 44f10edab2341981b85d6ab8b83c7bea96c1e09d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54077
## Changelog:
[Internal] [Changed] - Extract helper function from AnimatedColor.js to process input color value
Reviewed By: rozele
Differential Revision: D84062952
fbshipit-source-id: 2005dc33d7fd6928ba2638d0d99a2e5faa8448d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54057
## Changelog:
[General] [Changed] - Move using declarations into AnimationBackend class
names like `facebook::react::Callback` is a bit too generic and it'll be included in the scope whenever AnimationBackend.h is included in; `StartOnRenderCallback` already exists in c++ native animated (there we also nest the `using`s under class)
Reviewed By: sammy-SC
Differential Revision: D83867098
fbshipit-source-id: a50144bbbd1b441e3ef7b2884a19b091c3190c44
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53862
Recently, we observed a `use-after-free race condition` where the ImageFetcher object was destroyed while it was still registered as a UIManagerCommitHook.
The crash occurred in `std::vector::size()` at line 635 when accessing corrupted memory.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D82846245
fbshipit-source-id: fe0d9156ec6bc004339ed987bb5937699ebdf23b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54068
Changelog: [Internal]
Adds a `SessionState::isNetworkDomainEnabled` bit, managed in `HostAgent`, to align with other domains. Network support is still gated behind feature flags as before.
Reviewed By: hoxyq
Differential Revision: D83847357
fbshipit-source-id: 8f94c803d04256a7e41503f2a690e97b91e3ed5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54062
Renaming every V2 tracing macro so that it no longer has `_V2` suffixed. This diff completes the migration of the hz_tracing V1->V2 API.
This is a very large diff but is comprised of mostly mechanical changes. Most of these files were edited using `find` and `sed`, specifically:
`find . -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/HZT_\(.*\)_V2/HZT_\1/g' {} +`.
Since this is just a rename, no difference in functionality is expected.
Changelog: [Internal]
Differential Revision: D83808657
fbshipit-source-id: 64effdf701b1ff600185abfb737f9c0fa2250ddf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53908
Changelog: [Internal]
Add an example to show how Platform Color can react to changes in appearance.
This currently works on iOS for all colors, but for Android we need to "reset" desired tree with `key`.
Reviewed By: zeyap
Differential Revision: D82751014
fbshipit-source-id: 3e4b2b3ddff8c003ca835d6f26dbf9f7e82d413d
Summary:
Follow up of https://github.com/facebook/react-native/pull/52999 so that users can import `NativeComponentRegistry` from react-native when using typescript
On 0.82 when users try to import `NativeComponentRegistry` without using the Strict TypeScript API they get:
```
Module '"react-native"' has no exported member 'NativeComponentRegistry'.ts(2305)
```
## Changelog:
[GENERAL] [ADDED] - Expose NativeComponentRegistry API to index.d.ts
Pull Request resolved: https://github.com/facebook/react-native/pull/54043
Test Plan: CI should be green
Reviewed By: christophpurrer
Differential Revision: D83830024
Pulled By: huntie
fbshipit-source-id: e63258b30aed4b33b2881656df0ad88a4a7d670a
Summary:
When using gnu coreutils, installation of ReactNativeDependenices on iOS fails at compile time with errors like in the following issue (in the Expo repo):
https://github.com/expo/expo/issues/38992
This is caused by a missing `.` in the end of the path name that the built-in MacOS cp command handles well, but that will create an extra Headers folder when using cp from gnu coreutils.
This commit fixes this by adding the missing `.`
## Changelog:
[IOS] [FIXED] - Fixed issue when using gnu coreutils cp command when using precompiled binaries causing compilation error
Pull Request resolved: https://github.com/facebook/react-native/pull/54063
Test Plan:
- Verify that you're running gnu coreutils (`cp --version`)
- Create new expo app `npx create-expo-app`
- Build on iOS - should error without this fix, should work with the fix.
Reviewed By: christophpurrer
Differential Revision: D83964083
Pulled By: javache
fbshipit-source-id: 46dc074ca9b7fc97fa5a37ef48d68a895e3310ff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54033
This commit adds support for symbolication of the XCFrameworks on request.
Symbol files are big and only needed if you need to debug React Native itself - f.ex. if you are a framework developer like Expo.
Symbolication can be performed by setting the `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1` environment variable. This will cause the `ReactNativeCoreUtils` class to download symbol files and symbolicate the XFrameworks by doing the following:
- After downloading the requested React.XCFramework the symbols will also be downloaded and places in the artifacts folder.
- The XCFrameworks will be expanded and the folders in the symbol archive will be extracted into the XCFramework before it is zipped up again.
<img width="400" alt="image" src="https://github.com/user-attachments/assets/ec8dd2e1-c7f8-4d5f-a3b6-b8ffbb678c95" />
## Changelog:
[IOS] [FIXED] - Added support for symbolication of precompiled React.xcframework
Test Plan:
```
RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```
Remember to clean (remove the Pods directory) before turning on/off.
Reviewed By: christophpurrer
Differential Revision: D83753187
Pulled By: cipolleschi
fbshipit-source-id: f1522e1befdea99fb8c65695322ea3ed68e6caed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54032
This commit adds building blocks to support the symbolication of the XCFrameworks on request.
Symbol files are big and only needed if you need to debug React Native itself - f.ex. if you are a framework developer like Expo.
This change introduces some helper function that are needed to handle the dSYMS:
- `processDSYMs` the main function that unzip the symbols and prepare the framework for them
- `remap_sourcemaps_for_symbols` a support function that creates a mapping symbol -> file so that the debug can interpret them properly
- `generate_plist_content` a support function that generates the plist with all the mappings
These functions are used in the next commit of the stack.
## Changelog:
[Internal] - Added building blocks to support symbolication
Test Plan:
These functions are used in the next commit.
We split the commit to simplify the review. See the Test plan of the next commit to test them.
Reviewed By: cortinico
Differential Revision: D83753189
Pulled By: cipolleschi
fbshipit-source-id: 5d8027f5393a4e5a11f1b736c9901d40e7c5139b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54031
This commit updates the cocoapods source for RNDependencies so that the source for the package is the locally downloaded file so we don't download twice!
## Changelog:
[IOS] [FIXED] - Update the `source`property to avoid multiple downloads
Test Plan:
Run:
```
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```
Multiple times and observe that the dependencies are not downloaded multiple times.
Reviewed By: christophpurrer
Differential Revision: D83753188
Pulled By: cipolleschi
fbshipit-source-id: e3fedca921b0ff9ba10ec3e5a7ba18dfbdffc3ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54036
We are migrating away from the older V1 macros to the V2 macros, which have better code-stripped functionality and less business logic embedded in the API.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D83760301
fbshipit-source-id: b6c9ea155ebe22d6d4ce023a1dbb2cfd52fb8394
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54049
Changelog: [Internal]
Adds `JsiIntegrationTest`-based tests for the C++ layer responsible for handling the CDP `Network` domain. The tests use `NetworkReporter` to mimic the behaviour of a React Native platform that is generating network events.
NOTE: There are **significant problems** with the `NetworkReporter` / `NetworkHandler` singleton design: cross-Host and cross-Instance data pollution/corruption, inability to inspect multiple Hosts at once, inconsistency between the singleton's state and the CDP session's state, etc. The singletons similarly lack any kind of mechanism for test isolation (e.g. methods for clearing state between tests). As we iteratively fix these problems, the tests will require updating (and we'll be able to write stricter tests to cover the fixes).
Reviewed By: huntie
Differential Revision: D83746505
fbshipit-source-id: 7ee3c68e67f0d29587cbfafa98cf107d27065ffc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54042
Update the View component props to diff the `backgroundImage` property and assign the value to `experimental_backgroundImage` which maps to the `backgroundImage` property on the Android `ReactViewManager`.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D83788008
fbshipit-source-id: 5f9d93403af483c9494d2782aedad604cbb7cbbc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54039
Adding toDynamic conversion to `ColorStop` and `ValueUnit` structs which are being used by the linear and radial gradient data structures.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D83788006
fbshipit-source-id: 1ec0300ac4f17b65b6896d4d2c131eb05a059a22
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54044
In rare cases, there may be a vertical ScrollView nested inside another vertical ScrollView. In these cases, when the requestChildFocus method is called, we may attempt to bring the entire focused child into view. However, we really only want to bring the entire nested ScrollView into view.
## Changelog
[Android][Fixed] Focused scroll into view behaviors for nested vertical scroll views
Reviewed By: bvanderhoof
Differential Revision: D83804043
fbshipit-source-id: 8df8f637e7f908cc283f55c0d78ee03ed3bb9117
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54038
This diff adds a Log error to discourage usages of getJSModule(RCTEventEmitter) in new architecture, recommending migration to new API
changelog: [Android][Changed] Add Log error to discourage usages of getJSModule(RCTEventEmitter) API
Reviewed By: shwanton
Differential Revision: D83523928
fbshipit-source-id: d967456087a59366a3bca9590cb4d6d1fdd5b60d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54023
Android 12 introduced a new AlertDialog that better fits a longer list of content.
Android 11 and earlier have an AlertDialog that has a very small list view, requiring users to scroll through to find what they need. This change also fixes Android 12+ enable/disable states on menu items, as it no longer uses `isEnabled` for styling.
Before:
{F1982416953}
After:
{F1982416486}
Android 12:
{F1982430956}
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D83688775
fbshipit-source-id: a96120142f648e849be670bde5897c884f1f5f52
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54022
Perf monitor shows in a broken state if metro is started while the app is running. This change improves the tracing and monitor lifecycle around the metro connection events.
Before:
{F1982430185}
After:
{F1982430062}
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D83714223
fbshipit-source-id: 76826122924baa1a80c04dcc5ff18bc756a8e816
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54029
Changelog: [Android][Fixed] Fixed `SoLoader` race condition in `InspectorNetworkRequestListener`
When enabling `LoadNetworkResrouce` with flag `nativeSourceCodeFetching` in `InspectorInterfaces.h`, running the app, and opening the debugger, the app was crashing with
```
No implementation found for void com.facebook.react.devsupport.inspector.InspectorNetworkRequestListener.onHeaders(int, java.util.Map)
(
tried
Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders
and
Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders__ILjava_util_Map_2
) - is the library loaded, e.g. System.loadLibrary?
```
Reviewed By: huntie
Differential Revision: D83741114
fbshipit-source-id: b878fb4680e6a51f9403e8dea2872da85254e024
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54019
Currently the performance monitor flickers on boot if there's no metro connection. This change checks first if we have a packager before enabling the monitor.
No metro connection:
{F1982423105}
Metro connection:
{F1982423112}
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D83701372
fbshipit-source-id: d099880d3ab509942a937a6bde11ebdde13450cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54010
Bump Metro minimum to 0.83.3
This release fixes a regression in loading config files that export promises.
Full changelog: https://github.com/facebook/metro/releases/tag/v0.83.3
Changelog:
[General][Changed] Metro bump to ^0.83.3
Reviewed By: vzaidman
Differential Revision: D83655569
fbshipit-source-id: 106a957620e4591ef3cce21d327886354913560b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54011
Gets the `jsinspector-modern` (CDP backend) integration tests in React Native to pass when run against all relevant versions of Hermes: Legacy Hermes (`xplat/hermes`), Static Hermes stable (`xplat/shermes/stable`), and Static Hermes trunk (`xplat/static_h`).
This involves disabling the two types of failing test:
1. Tests that should be legitimately disabled because Static Hermes omits the legacy, pre-Fusebox debugger infra (see changes to `ReactInstanceIntegrationTest.cpp`)
2. Tests that should be passing but expose a current bug in Static Hermes (see changes to `JsiIntegrationTest.cpp`)
This provides a useful baseline for upcoming work in CDPDebugAPI (etc) across the different versions of Hermes.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83564896
fbshipit-source-id: c27f02266d63d58983c660ba0e4be5c44f02c9b6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53787
CoreModulesPackage is part of legacy architecture and unused on new architecture, let's delete it
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D82235543
fbshipit-source-id: bd18a1e26929c1f4533175d7567c552e142fbebb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54009
Packages haven't been bumped on main ahead of 0.83. This takes care of it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi, huntie
Differential Revision: D83580515
fbshipit-source-id: 7471e77f74e3fb3b4ee6538a49369b5df1393098
Summary:
This diff adds AnimatedProps class that allows prop diffs to be passed to the backend. Currently it is implemented through subclassing, but the implementation details are subject to change. To simplify integration with animation frameworks AnimatedPropsBuilder class was created - frameworks can use it to prepare their diffs.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [ADDED] - AnimatedProps.h AnimatedPropsBuilder.h
[GENERAL] [CHANGED] - AnimationBackend initialisation and style updates
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/53526
Test Plan:
js1 fantom AnimatedBackend-itest.js
js1 fantom Animated-itest.js
Reviewed By: zeyap
Differential Revision: D81309558
Pulled By: bartlomiejbloniarz
fbshipit-source-id: 92476568b6498d7ee64203f70a17c3e578de7ac1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53995
### Summary
Exposes the animation backend via UIManager by introducing two new methods: `unstable_setAnimationBackend` and `unstable_getAnimationBackend`. The `NativeAnimatedNodesManagerProvider` is updated to initialize the animation backend using the `useSharedAnimatedBackend` feature flag.
## Changelog:
[GENERAL] [ADDED] - unstable_setAnimationBackend, unstable_getAnimationBackend in UIManager
[GENRAL] [CHANGED] - call unstable_setAnimationBackend in NativeAnimatedNodesManager
Reviewed By: zeyap
Differential Revision: D81137954
fbshipit-source-id: b9a45b1d1e694e28865c27181bcbd578c1b7b9a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53996
## Summary
This diff makes changes to the `NativeAnimatedNodesManager` and `AnimationBackend` to initialize the backend closer to the `UIManager`.
## Changelog:
[GENERAL] [CHANGED] - initialize the backend in NativeAnimatedNodesManagerProvider
Reviewed By: sammy-SC
Differential Revision: D81138133
fbshipit-source-id: 5be0c8d5f5e3593bcd8111bbd1d0e90502a53a0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53994
# Summary
This diff introduces the Shared Animation Backend - a class that can be used by animation frameworks to schedule and run animation updates.
## Changelog:
[GENERAL] [ADDED] - AnimationBackend-itest.js AnimationBackend BUCK/CmakeLists
[GENERAL] [ADDED] - useSharedAnimationBackend feature flag
[GENERAL] [CHANGED] - make AnimatedNodesManager use the backend behind the flag
Reviewed By: zeyap, sammy-SC
Differential Revision: D80809364
fbshipit-source-id: dbfe273362410cdf2f9fc37d78adac7faf4cd118
Summary:
Following the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/925), this PR adds new `RCTDevMenu` configuration and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`. The `RCTDevMenuConfiguration` includes:
- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled
## Changelog:
[IOS][ADDED] - Add new configuration for `RCTDevMenu`
<!-- 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/53505
Test Plan:
Tested with different configurations on `RCTDevMenuConfiguration`:
<details>
<summary>Click to view code</summary>
```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];
#if USE_OSS_CODEGEN
self.dependencyProvider = [RCTAppDependencyProvider new];
#endif
RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false];
[self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp"
inWindow:self.window
initialProperties:[self prepareInitialProps]
launchOptions:launchOptions];
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
return YES;
}
```
</details>
Run helloworld:
<img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300">
Reviewed By: cipolleschi
Differential Revision: D81684275
Pulled By: coado
fbshipit-source-id: 500e170c93df25949de433970442d20c442be7f2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53998
As the previous few diffs, JSI `isArray` API should follow
`Array.isArray` from the JS spec.
The current implementation does not consider Proxy objects, only Array
exotic objects.
Changelog: [Internal]
Reviewed By: lavenzg
Differential Revision: D83391784
fbshipit-source-id: 6db8e5a48458a1aa57006fb0747f62ec78efa675
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53991
As part of D83474751 to migrate Store from arvr to xplat we discovered that ktx images are not setup correctly in xplat. Adding support for it in flow and jest
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D83562581
fbshipit-source-id: 8c7205417dc24ca2d48a2e2fa1ca7dea40504c18
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53984
Changelog: [ANDROID][CHANGED] - Request layout on configuration change only when the font scale has changed
Wraps call to `requestLayout` in a condition to only run layout when the font scale has changed to prevent it from executing in response to other configuration changes.
Reviewed By: Abbondanzo
Differential Revision: D83546632
fbshipit-source-id: 41a5199dd2ef72b8f6257637c1d35d4a790ea006
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53982
This diffs adds specific `toDynamic` conversions for props defined as arrays holding primitive types. This fixes the serialization of `std::vector<Float>` that was failing to correctly convert to a `folly::dynamic` type when using Props 2.0.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D83520605
fbshipit-source-id: 80a6ce2b3a265601f945ff3b76840c04e46aacdc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53979
This reverts a previous change that modified how focus behavior is handled in JavaScript. That change caused hierarchy rows to no longer be focusable, either manually or programmatically as they were before, which in turn broke arrow key navigation in entity lists. Reverting the change restores the expected focus behavior and re-enables proper arrow key functionality within entity lists.
Changelog: [Internal]
Differential Revision: D83390685
fbshipit-source-id: 165567eceedce5d0a2e664a9ef3070d5a2bf9b67
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53978
Inconsistency between the previous and old version of `processTransform` - if frameSize is 0, the transform was being ignored, which is not correct when considering a fixed transform origin and a rotation animation for example. Instead, always apply the transform origin if it's set.
Changelog: [Android][Fixed] Fixed representation of transforms when view is originally zero-sized
Reviewed By: mdvacca
Differential Revision: D83469083
fbshipit-source-id: e9ae1500f64c700708edb00b2d5871e3f224fb07
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53968
This diff reverts D82781491
(The context such as a Sandcastle job, Task, SEV, etc. was not provided.)
Depends on D82781491
Changelog: [internal]
Reviewed By: SamChou19815
Differential Revision: D83442434
fbshipit-source-id: bd570564ee22d57bd7a3ca7f6990230de3e5ac4e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53845
Adding a feature flag controlling the outset ratio set on the culling context frame. This feature flag value will add an outset on the width and height calculated by multiplying these with the provided ratio value. This will offset each side of the frame, maintaining the center of the frame at the same location.
This outset ratio helps mitigate async scroll blanking and focus handling on host platforms.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D82684027
fbshipit-source-id: 3d1aaf680c5896fd4bb992b272b650ab2c097905
Summary:
# What
Moving Store from `arvr/js` to `xplat/js`.
This will enable Store to use xplat modern infra. Being on arvr/js legacy infra has created many problems [over the years](https://fb.workplace.com/groups/storecore/posts/2344707442611890/?comment_id=2345657702516864). Examples:
**2025**: https://fb.workplace.com/groups/storecore/permalink/2344707442611890/
**2024**: https://fb.workplace.com/groups/oculusjs/permalink/3366314690341563/
**2023**: https://fb.workplace.com/groups/xplatreact.engineering/permalink/730125568732098/
# How
## Previous Diff
* Remove usage of the legacy `react-router-3`. We don't want to carry this as a dependency to xplat/js.
## This Diff
This diff is the combination of several diffs (created to facilitate reviewing):
1. - D82581768 - Just move files from arvr/js/apps/Store to xplat/js/RKJSModules/public/HzStoreVR (Except for the index file and some mockUtils)
2. - D82581767 - Setup getConfig.js to generate a single BUCK for HzStoreVR and remove circular dependencies
3. - D82581769 - Fix location/import of assets
4. - D82581766 - Fix relay imports that were not using Haste
5. - D82664586 - Remove usage of old url module
6. - D83156829 - Fix buck: run js1 build buckfiles and build_and_run.sh
7. - D82844768 - Make arvr/js tests run with xplat Store
8. - D83005059 - Fix Flow errors
9. - D83259512 - Delete duplicated test files to make flow happy
10. - D83005098 - Fix Relay config for new Store VR location in xplat
11. - D83005073 - Enable React Forget on new HzStoreVR directory
12. - D83345573 - Fix arc lint -a
13. - D83403188 - Fix relay prefetch queries
## Next diffs
* Migrate tests to xplat jest config (renaming from *-rntest.js to *-test.js)
* Migrate other source code like arvr/js/libraries/store
## Open Source PR
For the change to RN open source .flowconfig to add .ktx image support: https://github.com/facebook/react-native/pull/53964
Changelog: [Internal]
Reviewed By: Tom910, mullender
Differential Revision: D82781491
fbshipit-source-id: 5ce6433916e5b144965e8906005e2e26fdcfcc95
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53945
ReactVirtualTextViewManager is an internal legacy architecture class that's unused, we are deleting it
changelog: [internal] internal
Reviewed By: alanleedev
Differential Revision: D83186611
fbshipit-source-id: 323c77077ab91ffec35af8e4c12da4bdf13fa233
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53944
YogaNodePool is an internal API used only by LegacyArchitecture of React Native Android, which is unused
This diff deletes YogaNodePool from the codebase
changelog: [internal] internal
Reviewed By: alanleedev, cortinico
Differential Revision: D83184441
fbshipit-source-id: 7c358985d9f19b38c28cca7fb0acf9322e97d87c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53958
Adds a dev menu option to enable/disable the overlay, in case devs want to screenshot/record without disabling it at buildtime.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83293591
fbshipit-source-id: 3564b83a279db296d1cd22a8e8a83876cc705dbd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53957
There are cases where the overlay can get enabled multiple times, creating more than one view. This change no-ops enabling if the overlay is already enabled and just uses enable/disable for showing/hiding the view.
{F1982272836}
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D83275253
fbshipit-source-id: 4b468171a582e134071875f718c66d1659d67782
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53961
Changelog: [Internal]
Fixed a bug in TaskDispatchThread. To understand bug, let me show an example. The task is scheduled to run after several seconds. It reaches loopCv_.wait_until() and waits there. There are 2 bad scenario:
1. wait_until spuriously wakes up and async task runs even before its scheduled time
2. new task is added with runSync(). New task gets added to the queue and loopCv_ is notified. Async task will run before its scheduled time and even worse queue_.pop() will remove sync task. Therefore runSync will be blocked for forever.
To fix this bug, we need to add `continue` after wait_until().
Also I added new test to prevent this bug in future.
Reviewed By: rshest
Differential Revision: D83345047
fbshipit-source-id: 37962613a123a123c0e110426ae782effe5a81c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53867
`react-native/metro-babel-transformer` implements `getCacheKey` for Metro, but does not vary the cache key on changes to `react-native/babel-preset`, one of its dependencies, leading to false positive cache hits (changes not being reflected).
This is particularly a problem in development, although it potentially also leads to issues in the unusual case that `react-native/babel-preset` is updated via npm, but no other package is.
This adds a `getCacheKey` to `react-native/babel-preset` and incorporates it into `react-native/metro-babel-transformer`'s `getCacheKey`. It's based on `package.json#version` in production and a hash of package contents in development (`version.endsWith('-main')`).
Changelog:
[General][Fixed] Invalidate transform cache when `react-native/babel-preset` is updated
Reviewed By: huntie
Differential Revision: D82893894
fbshipit-source-id: 9bbc034eaf68ee0e5b3078fb2fe8f30caa7f11c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53959
These data-types are super common in React Native, and the anonymous inner classes add significantly to the GC workload we see. For ReadableMap this means we can save 6 additional object allocations for each LazySynchronizedImpl and the lambda that's passed in to it. On synthetic benchmarks this seems to improve core operations around ~10%.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D83245864
fbshipit-source-id: 69b314a1f52a32375b5e1f591555f50bfbc31843
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53953
For TurboModule registration, we register custom / app-specific TurboModules before core TurboModules to ensure that app-specific module overrides are preferred over core / default behaviors.
This provides a similar behavior for Fabric component descriptor registration.
## Changelog
[Internal]
Reviewed By: alanleedev
Differential Revision: D83273376
fbshipit-source-id: fd0fb5f10d2bc29839ae554f0e3cfc18d7957848
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53952
In React Native Android, you can technically override core components like ScrollView to add additional props and behaviors, but doing so in the new architecture requires ensuring that these props are tracked in the C++ props object.
This change unseals ScrollViewProps so they can be overridden in (rather rare and generally unsupported) cases where you need to customize ScrollView behaviors for a specific app.
## Changelog
[Internal]
Reviewed By: Abbondanzo
Differential Revision: D83268457
fbshipit-source-id: d1d895e9f060dcf94bf82538a33bf5f2fbb135d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53792
This validation infra served us well, but it's no longer needed.
All the legacy architecture classes have been identified and deprecated. And in the next major release, we will simply remove them.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D82470292
fbshipit-source-id: 44b58e63b7aca4fa22ac6b891275417bf1add8d1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53823
Let's just use the same flag to compile out everything. I don't think we'll need the utility of separate flags.
Reviewed By: fkgozali
Differential Revision: D82476933
fbshipit-source-id: 1b5fbfad7d54e0af7db5459772b3e7a8472c1eb1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53943
Changelog: [Internal]
Thread join should happen only during TaskDispatchThread dtor, otherwise if quit is called on the same thread (thread_), then thread_ will get detached, which can lead to use of already deleted fields (queue_, running_) of TaskDispatchThread.
But we also need to make sure that on quit() call, loop is getting stopped, otherwise in loop, already running task will use already deleted fields of captured object. If quit() is called as task on thread_, then there is no need to wait for future because loop will organically end since running_ is false.
Reviewed By: rshest
Differential Revision: D83044012
fbshipit-source-id: a2da97a89093c47c64b693e3c9e5d6f7297c038e
Summary:
Fixes https://github.com/facebook/react-native/issues/53893
The size should be of type string (large or default) . Typescript says number
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL][FIXED] Fixed Types in Refresh control
Pull Request resolved: https://github.com/facebook/react-native/pull/53907
Test Plan: N/A
Reviewed By: javache
Differential Revision: D83161286
Pulled By: arushikesarwani94
fbshipit-source-id: 4e557bc3780f297551b913c5c763c369cf3e374c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53937
Changelog: [General][Fixed] only remove the Fast Refresh "Refreshing..." toast when all bundles being loaded finished loading.
Reviewed By: huntie
Differential Revision: D83246895
fbshipit-source-id: f02fac9fe16b307ae4b36f09bc88f5261c590b15
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53936
Align with other mount items and make it easier to identify in memory traces.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D83241794
fbshipit-source-id: 9df1523e265e560c15f93bad8cd91a651bc5a4e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53923
Motivated by feedback on D83070252. This prevents us from including decodable information about debug targets in these values.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D83139401
fbshipit-source-id: 01b01d23e4dfb06e400729b8cedf1fe2e098b209
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53921
Changelog: [Internal] `devMiddleware` removed the unused option `projectRoot`
This option was used only in a dead branch of the code inside `InspectorProxy`.
The scenario where it appeared was enabling resolving script sources (`Debugger.getScriptSource`) starting with `file://` which were coming from the file system. However, we don't seem to ever point scripts at the filesystem this way.
Reviewed By: huntie
Differential Revision: D82739662
fbshipit-source-id: 9a130eaa83cb94ae0e36a5a1102c56ff8a36cffc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53914
Pulls hysteresis window computation out of for loop. Simplify the remaining code.
Changelog: [Internal] - Same as general summary.
Reviewed By: lunaleaps
Differential Revision: D83005735
fbshipit-source-id: 824863c649406a750d44b31ac92878505ab61596
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53900
# Changelog:
[Internal] -
There is a crash reported, which looks like it may be potentially caused by some scenarios when we are trying to execute a scheduled task after the TaskDispatchThread instance had been quit.
This adds a missing extra check in the corresponding code to avoid such scenarios.
Reviewed By: christophpurrer, lenaic
Differential Revision: D83050169
fbshipit-source-id: 0ee0fa5848b070c2dc3dd92dbad4e6d5996734b3
Summary:
Since the view recycling is optional on iOS [since 0.74](https://github.com/facebook/react-native/commit/613a5a75977d84333df7cbd5701e01a7ab5a3385) when a view (with disabled view recycling) is unmounted / destroyed there is no lifecycle callback for a component view to notify it of such event. Currently we (`react-native-screens`) are forced to scan mutation list of every mounting transaction in every of ours container components. Components with view recycling turned on, get `prepareForRecycle` callback on Fabric & on old architecture, there was `invalidate` message sent (`RCTInvalidating` protocol). It would be nice & useful to have something like this for components with view recycling disabled, or enabled but not recycled due to pool being full.
In particular in `react-native-screens` we need an information that the component is being destroyed to release retained resources (view controllers & others).
I have concern regarding naming of this method, as it could collide / be mistaken with `invalidate` method of `RCTInvalidating` protocol, but naming is hard & I don't see a name that fits better 😄 Open for suggestions!
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [ADDED] - Add invalidation callback for non-recycled component instances
Pull Request resolved: https://github.com/facebook/react-native/pull/53708
Test Plan:
Apply this patch to `RNTMyNativeViewComponentView.mm`:
```objective-c
diff --git a/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm b/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
index 2eb7bff28e..8464da603b 100644
--- a/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
+++ b/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
@@ -123,6 +123,16 @@ using namespace facebook::react;
[_view removeOverlays];
}
+- (void)invalidate
+{
+ NSLog(@"RCTComponentViewProtocol invalidate called");
+}
+
++ (BOOL)shouldBeRecycled
+{
+ return NO;
+}
+
- (void)fireLagacyStyleEvent
{
RNTMyNativeViewEventEmitter::OnLegacyStyleEvent value = {"Legacy Style Event Fired."};
```
& render `MyNativeView` in any of the RNTester screens / examples. Unmount the view & observe the log in XCode.
https://github.com/user-attachments/assets/be3f67bb-73e0-4af2-9ca1-f2eb9f3347bb
(called twice, because there are two components rendered at a time)
Reviewed By: javache
Differential Revision: D83139361
Pulled By: cipolleschi
fbshipit-source-id: 17ef964648ac44b583503b6b00fc5dd457887061
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53911
This change mimics what we implemented on Android to crash the app.
This is in general never going t be triggered. It will be triggered only if users are actually going through the old way to initialize React Native, i.e. by using the RCTRootView class which creates thebridge, or if they are creating the bridge themselves.
## Changelog:
[iOS][Added] - Crash the app if they force the legacy architecture.
Reviewed By: RSNara, cortinico
Differential Revision: D83066377
fbshipit-source-id: 0907effceb9a3655ec8d6bde8e0986f50f1ab663
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53878
Changelog: [Internal]
Adds the `prebuiltBinaryPath` option to `unstable_spawnDebuggerShellWithArgs` and `unstable_prepareDebuggerShell`, for advanced integrations that need to change how the React Native DevTools prebuilt binary is distributed.
Reviewed By: huntie
Differential Revision: D82956699
fbshipit-source-id: 30f9c461c7d8f22a553f278bbe42b86742c98da7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53890
Changelog: [Internal] - Adds support for VirtualView v2 in Android HorizontalScrollView native component by implementing VirtualViewContainer interface. Only on Android because iOS equivalent native components are already set up to support virtualview v2 on horizontal scrollviews.
## Changes in Detail
Adds necessary changes to Android `HorizontalScrollView` native component to support the experimental version of VirtualView.
Reviewed By: lunaleaps
Differential Revision: D82783403
fbshipit-source-id: 1e55eb054ab098af5ca8dd526b27c574025943c4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53829
Forwards along focus and blur calls to their respective native commands, leaving the TextInput path intact for now.
There are a few ways places to implement this, all with different trade offs. I decided to leave TextInputState.js intact and instead only go down the original path if the focused/blurred element is a TextInput by using the registered inputs in TextInputState. This revealed a subtle issue where the TextInputs aren't registered in time for the ref callback, meaning you can't focus them there if you rely on the registered list.
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D82676628
fbshipit-source-id: d39c92dfc99ec4b5e100203bb43c8a4f9c80a649
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53912
Changelog: [Internal]
Add new fantom flag `fantom_disable_coverage` to be used in tests that are sensitive to things like memory allocation.
Also disable coverage for any benchmark test.
Reviewed By: arushikesarwani94
Differential Revision: D83070065
fbshipit-source-id: a885e79e3d0c88cfb7adef30cb60ab46a617edac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53904
Adds more transparency to the background of the perf overlay, we got some feedback about it visually obscuring elements behind it.
{F1982191377}
{F1982191388}
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D83037721
fbshipit-source-id: e70c799ea7942c6aea886e9a3580e324c4238048
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53905
Updates `PerfMonitorOverlayManager` so that it is minimally and correctly integrated in the `DevSupportManagerBase` reload cycle — attempting to fix a bug where the background profiling state on startup / subsequent packager connections would be out of sync.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D83058519
fbshipit-source-id: 9a9bb32d3215ccf722aa39ca0ca943449f7ae62e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53885
Changelog: [General][Added] DevServer banners can now be closed on tap. On iOS, don't close them after 15s anymore.
Banners, on iOS, but not Android, are currently closed after 15s since {D47478373} where it was introduced to deal with the banner telling users they need to connect to Metro stuck forever.
Instead of closing it after 15 seconds, allow the users on both Android and iOS to close it via a touch.
Reviewed By: huntie
Differential Revision: D82727997
fbshipit-source-id: 5aa2af78a4dbcd95b69423d52421900d4ab35244
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53784
LayoutAnimation is part of legacy architecture, I'm deleting the code used from its non supported public APIs
changelog: [internal] internal
Reviewed By: shwanton
Differential Revision: D82235545
fbshipit-source-id: 9665c57b68eba9d958d3f8b9dd4224558cc8e9f6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53884
Changelog: [Internal]
Now that there's a clear display for when HMR is disconnected, we don't want to show messages regardless devices connection and disconnection to the DevServer because they are too partial.
Reviewed By: huntie
Differential Revision: D82727105
fbshipit-source-id: 32dd077f85d2044f89ae2d8d60a37c0ec6cccbbf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53883
Changelog: [General][Added] - new banner added to indicate that Fast Refresh has lost connection, and that the app needs to be restarted to reconnect
When HMR were getting disconnected, we were not giving any indication for the user.
This lead to situations were the connection is re-established, but HMR is still disconnected, which is unexpected for users.
Instead, raise a banner hinting the user to reload the app to reconnect.
Reviewed By: huntie
Differential Revision: D82726853
fbshipit-source-id: d5f264547b2af89e9dc2a9046d063efe1145d690
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53846
Changelog: [Android][Added] - hot reload banner is now displayed in blue background like on iOS
iOS has a colorful "Refreshing..." banner:
{F1982086204}
While android doesn't respect the color HMR asks it to set up for the banner:
{F1982086218}
Reviewed By: cortinico
Differential Revision: D82726743
fbshipit-source-id: 4042851f5a8fd7d4f238f25e2d83f77144742de9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53881
Changelog: [Internal]
To make sure that coverage is insertect correctly when run in different metro setup where patterns do not match perfectly, we need to add glob prefix
Reviewed By: sammy-SC
Differential Revision: D82968565
fbshipit-source-id: c2676ef4c774411938039fc5b98a3b953f6ec916
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53642
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding a function that is used to orchestrate the helpers function defined in previous changes.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778457
fbshipit-source-id: b4ab8c902d6d7e6ca4b89ccbab75c1b5d84ce00a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53640
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding an helper function to create hard links to Codegen Headers so that other libraries can access them.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778450
fbshipit-source-id: e9f62f1c81ce8a635cc880007f495de342342a25
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53638
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding an helper function that creates links for the ThirdPartyDependencies that React native and libraries might need to access.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778459
fbshipit-source-id: b8f9f207a0fbe2265e2861bf508516946905b472
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53635
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we did two things:
1. we move the helper functions to a headers-utils.js file (and the tests to the `headers-utils-test.js` file)
2. we added a function that coordinates the creation of the header links *and added tests for it)
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778464
fbshipit-source-id: fd8eb5a7af55db0a08c4d299c5470058d5424768
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53631
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding an helper function that creates links for the ReactCommon folder that has a complex structure and complex mapping requirements
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778470
fbshipit-source-id: e0f4001048fcde0e988fc3a05b53efb1de70460b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53629
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding a function to properly create the header structure for the headers in ReactApple that requires a special case.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778471
fbshipit-source-id: 095d901dce139cf8221251f952f474be943a5ab3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53620
## Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).
To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
## Changed
In this change we are adding an helper function that creates links between a source folder and a destination folder.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778469
fbshipit-source-id: 3954bc219f32ea53744393a83f3179beeaca95b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53737
This change add a utility function to extract headers (both .h and .hpp) from a folder. It also allow to exclude some specific folders (e.g.: `tests`, non supported platforms, ...)
## Context
SwiftPM is very picky in how the header structure must be.
In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks.
In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D82205692
fbshipit-source-id: 4fa6dee2ae4790c583beb96a959b0c3045c7b50a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53736
This change adds a simple function that manages symlinks. This is used through the stack of changes to avoid code repetition.
## Context
SwiftPM is very picky in how the header structure must be.
In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks.
In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D82202860
fbshipit-source-id: 0baa348c84f966a2e1eeb85b008f8e653bffe96c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53876
This is just a couple of small nits after D82836192
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D82953710
fbshipit-source-id: 1a98c54a110ee1a72225de331bfe2efa4e4225c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53872
This diff fixes the mismatch between the overflow initial value between the horizontal scroll view component initialization and the React core props instance initial value by applying the same correction as for the vertical scroll view component.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D82919365
fbshipit-source-id: 70e40f56ffa3ea87fa74035c885608f633890610
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53871
The props defined in `YogaStylableProps` define the overflow to be set to `Overflow::Visible` by default.
The scroll view initialized the overflow setting to `Overflow.SCROLL`. This meant that Props 2.0 would only set the overflow prop if it was different from Visible, leading to the scroll view not being configured correctly when asking for the overflow to be visible.
This diff assigns the correct initial value to the scrollview overflow setting only when enabling Props 2.0 to avoid any unexpected behavior changes when not using Props 2.0.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D82919286
fbshipit-source-id: d5368500cc4504164d6fdf7cf60042a9d5792853
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53860
Fixes https://github.com/facebook/react-native/issues/53639
I've realized that our docs and validation logic states that we do support
3x3 matrixes (for 2d transforms). However they're not properly processed
as the values are just copied into a 4x4 matrix.
This can be verified by applying the 3x3 identity matrix on any transform.
I'm fixing it by correctly populating the 4x4 matrix getting the values from the 3x3 matrix in input.
Changelog:
[General] [Fixed] - 9-element (2d) transform matrix are not correctly working
Reviewed By: christophpurrer
Differential Revision: D82836192
fbshipit-source-id: 12029b37ffd8375fff48ea7f9386b849dfe96a62
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53868
This is a prep step to enable better Flow support for react 19 ref-as-prop. While it causes changes in the ReactNativeApi.d.ts snapshot, this diff simply inlines what these `React.ElementRef` evaluates into.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D82915646
fbshipit-source-id: 64179eac7dde91381361fb9f1053d58100d864c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53844
Small UI tweaks that help when scanning more visually spread out alert actions on iOS 26.
- Use bold (iOS 26 style) alert title.
- Differentiate "Cancel" actions with red system style.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D82731784
fbshipit-source-id: 0a0215fc75a4832e742e22328d5e21eee3808972
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53861
Changelog: [Internal]
The issue is a race condition in the React Native Fabric mounting system where `experimental_prefetchResources` is called on a `SurfaceMountingManager` after the surface has been stopped.
1.) `experimental_prefetchResources` is called
2.) Concurrently, `stopSurface()` *can be* called, which sets `mThemedReactContext = null`
3.) `experimental_prefetchResources` then tries to access `mThemedReactContext` via `Assertions.assertNotNull(mThemedReactContext)`
4.) Since `mThemedReactContext` is now `null`, the assertion fails and throws an AssertionError
The fix involves adding a guard to check if the surface is stopped before accessing `mThemedReactContext`
Follows existing patterns used by other methods in the same class
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L201-L213
Reviewed By: lenaic
Differential Revision: D82842572
fbshipit-source-id: 723bad24a075efa219766b0e148080dd42d59fba
Summary:
Extending a tsconfig seems simpler than adding `compilerOptions` with `customConditions`.
### Before
```jsonc
{
"extends": "react-native/typescript-config",
"compilerOptions": {
// ...
"customConditions": ["react-native-strict-api", "react-native"]
}
}
```
### After
```jsonc
{
"extends": "react-native/typescript-config/strict"
// ...
}
```
## Changelog:
[GENERAL] [ADDED] - Add `react-native/typescript-config/strict` export enabling the `react-native-strict-api` custom condition.
Pull Request resolved: https://github.com/facebook/react-native/pull/53564
Test Plan:
### `package.json`
```
{
"name": "react-native-ts-test",
"private": true,
"version": "0.1.0",
"scripts": {
"build": "tsc --noEmit"
},
"devDependencies": {
"react-native/typescript-config": "^0.81.1",
"typescript": "^5.9.2",
"jest": "^30.1.2"
},
"dependencies": {
"react-native": "^0.81.1"
}
}
```
### `tsconfig.json`
```
{
"extends": "react-native/typescript-config/strict",
"include": ["src/index.ts"]
}
```
### `src/index.ts`
```
import { View } from "react-native";
```
Run `npx resolution-explorer` and select "react-native from src/index.ts to node_modules/react-native/types_generated/index.d.ts" to verify the types are resolved correctly.
```
Explicitly specified module resolution kind: 'Bundler'.
Resolving in CJS mode with conditions 'import', 'types', 'react-native-strict-api'.
File '/Users/kraen.hansen/Repositories/react-native-ts-test/src/package.json' does not exist.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/package.json'.
Loading module 'react-native' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
Directory '/Users/kraen.hansen/Repositories/react-native-ts-test/src/node_modules' does not exist, skipping all lookups in it.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/package.json'.
Entering conditional exports.
Matched 'exports' condition 'react-native-strict-api'.
Using 'exports' subpath '.' with target './types_generated/index.d.ts'.
File '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts' exists - use it as a name resolution result.
'package.json' has a 'peerDependencies' field.
Resolving real path for '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native', result
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native'.
Failed to find peerDependency 'types/react'.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react/package.json'.
Found peerDependency 'react' with '19.1.1' version.
Resolved under condition 'react-native-strict-api'.
Exiting conditional exports.
Resolving real path for '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts', result
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts'.
======== Module name 'react-native' was successfully resolved to
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts' with Package ID
'react-native/types_generated/index.d.ts@0.81.1+react@19.1.1'. ========
```
Reviewed By: robhogan
Differential Revision: D82791201
Pulled By: philIip
fbshipit-source-id: f58d3b8fcf3d7f18dd29eef18a3c8c0cb57d1d78
Summary:
Address invalid C++ in-code docs comments to silence few warnings. Ref:
* https://www.doxygen.nl/manual/commands.html#cmdtparam
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL][FIXED] - Address invalid C++ in-code docs comments to silence the warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/53835
Test Plan: Building RNTester app locally does not output the warnings related to in-code docs comments.
Reviewed By: cortinico
Differential Revision: D82791099
Pulled By: philIip
fbshipit-source-id: 2f93bfd4cd303471b2c52fcdf74871e5dee8c06a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53791
I'm removing parameter to configure new architecture in ReactNativeNewArchitectureFeatureFlagsDefaults because the new architecture is enabled by default everywhere.
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D82241552
fbshipit-source-id: 9c5cee4befc914d95b84b01325485923e17ff6da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53790
New architecture should we enabled by default everywhere, Stable releases should use new arch now
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D82241551
fbshipit-source-id: 2a1bf14f2f1da6e441a58b083ca5a55618eec256
Summary:
In Flow 0.284, we will have a stricter version of `Array<T>.includes`. Instead of accepting `mixed`, we will only accept `T` to help catch logical errors. We did the same for `Array.indexOf` and `Array.lastIndexOf` as well.
This diff pre-suppresses newly discovered errors in part of the codebase.
Changelog: [Internal]
Reviewed By: marcoww6
Differential Revision: D82784398
fbshipit-source-id: 6cb11809844f964e0604d33b9f7a3989074cd1cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53832
Deprecates `InteractionManager` by adding a warning when it is imported.
Changelog:
[General][Changed] - InteractionManager has been deprecated and no longer respects interaction handles. Instead, it is now recommended to avoid executing long-running JavaScript tasks by breaking them up into smaller tasks and scheduling them using `requestIdleCallback()`.
Reviewed By: javache
Differential Revision: D82704809
fbshipit-source-id: 99474cd7949abfe323c366b9ab8d8fc195578395
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53830
Now that `InteractionManager` is deprecated (and no-ops), this removes all remaining references to it — in `Animated` and `PanResponder` — from the React Native repository.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D82690242
fbshipit-source-id: d101d47d1f8640f70e2d199492d4345b63663251
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53816
Changelog: [Internal]
D82236159 introduced the first `node_modules` dependency in the Electron part of `react-native/debugger-shell`. This is not currently handled correctly by the build script, so this resulted in an instacrashing binary.
I'm temporarily backing out D82236159 until we have a proper fix for the build script.
Reviewed By: robhogan
Differential Revision: D82632937
fbshipit-source-id: 6c7c182e2a7c89e6ea2761096dcc426dbf2ae5cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53840
After this diff, successful network events are displayed as fully hydrated timespans in the Performance panel network track, with all metadata needed to usefully populate the UI.
**Changes**
Adds:
- `"ResourceFinish"`: `encodedDataLength`, `decodedBodyLength`
- `"ResourceReceiveResponse"`: Populates `data.timing` members, which enables *"Request sent and waiting"* to be rendered correctly in the timeline.
Removes:
- `"ResourceWillSendRequest"` events — very rarely emitted by Chrome and are extraneous for our use case.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D82636798
fbshipit-source-id: a4b0f0671b97aaadc279ac56d39fee0c95d4ddc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53817
What is currently happening, is that the various commits on the release branches like `0.82-stable` are resetting the version of native artifacts to `1000.0.0-<SHA>`.
The reason is that during the `test-all` workflow, we pass the `dry-run` as release type.
That's to prevent the various tools from calling `npm publish` and so on.
The problem is that on the releases branches, the version was already set at branch cut time.
Therefore, we see the version 1000.0.0 reappearing during Android E2E test in the emulator. Similary this is also affecting iOS prebuilds so I'm attempting to fix it here.
Changelog:
[Internal] [Changed] -
Reviewed By: huntie
Differential Revision: D82553599
fbshipit-source-id: 31a52e7df036e700663b3d3dd677973a7a210a30
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53842
Changelog: [Internal]
There is a conflict between dotslash in node_modules and in OD it does not invoke buck2
Reviewed By: javache
Differential Revision: D82724326
fbshipit-source-id: c90cab58818e0245f8763b729c7e5432735eb05e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53838
The FPS listener is being assigned to all scroll view instances by the scroll view manager. This listener should not be reset when the view is being recycled and should stay assigned at all times.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D82720151
fbshipit-source-id: a2a37bad93efaa6e435725adf16c9ad1b4207ba0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53794
Basically what the title says. This is needed by Expo for experimetation.
Changelog:
[Internal] [Changed] -
Reviewed By: joevilches
Differential Revision: D82530292
fbshipit-source-id: 82ce8b1e8fc8d954cc04ec456ad80f769aedafe7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53795
I've published another docker image that should now work and unblock `run_fantom_tests`
so we don't need to pin the version to `v18.0` anymore:
https://github.com/react-native-community/docker-android
Changelog:
[Internal] [Changed] -
Reviewed By: huntie
Differential Revision: D82532516
fbshipit-source-id: 980c2feb053f9d096e70f37bb690e18cc8b87dc0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53776
Refactor and improve how we emit CDP trace events for network requests.
Key changes:
- Split up `PerformanceTracer` methods into discrete trace events.
- Move event calls out of `PerformanceEntryReporter` (upwards) into `NetworkReporter`. This now:
- Aligns better with the matching source `NetworkReporter` events.
- Removes metadata pieces from `PerformanceEntryReporter` that weren't part of the Web `PerformanceResourceTiming` API.
- Populate additional fields on `ResourceReceiveResponse`.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D82433225
fbshipit-source-id: 4fce219f0c86a7257b8df250ef9f2b4ec8bd8de3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53807
We need to read the values off feature flags before checking them.
## Changelog
[Internal]
Reviewed By: javache
Differential Revision: D82572898
fbshipit-source-id: 09fbc09570c78b41d9c25fb03c5557e390da7cae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53780
This is a commit we're going to pick in 0.82 as we want to make sure users cannot invoke `load()`
from `DefaultNewArchitectureEntryPoint` with flags that are not true,true,true.
Changelog:
[Android] [Changed] - Runtime check that NewArchitecture is enabled in DefaultNewArchitectureEntryPoint
Reviewed By: mdvacca
Differential Revision: D82456975
fbshipit-source-id: 749996a3491913cfe400173608218077c3ffbc10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53735
This class should have been marked as LegacyArchitecture back then but was forgotten.
I'm doing it now.
Changelog:
[Internal] -
Reviewed By: javache
Differential Revision: D82219780
fbshipit-source-id: 5119b7469733d5d2d4b16e976b09231ad5f71f5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53775
A refactor to align our C++ code style within `jsinpector-modern`.
We prefer `std::string` and `const std::string&` everywhere (see [C++ Core Guidelines F.15](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-conventional)), except for when we are handing potentially very large strings — in which case we must use `string_view` all the way down.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D82446939
fbshipit-source-id: 4b1c43068d1339f4b4a4c7eb06b392d0b0f624e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53788
Fix thread safety issue due to member variable in `NetworkHandler` singleton without mutex.
Also intend to un-singleton this class in the imminent future.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D82460574
fbshipit-source-id: c0c614f8f1bb5ffba22872ae5717fbd2ca01f2e9
Summary:
The `--otp` flag is completely unused now, therefore it can be removed.
We don't pass the `NPM_CONFIG_OTP` env variable either as this was done back in the days of CircleCI so I'm cleaning this up.
## Changelog:
[INTERNAL] - Remove unused --otp property from release infrastructure
Pull Request resolved: https://github.com/facebook/react-native/pull/53779
Test Plan: CI
Reviewed By: lunaleaps
Differential Revision: D82453539
Pulled By: cortinico
fbshipit-source-id: 84a6b82a037c754165c21e17976dc534d9a7ba4c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53793
## Changelog:
[Android] [Deprecated] - Clean up batchingControlledByJS in NativeAnimated kotlin
`start/finishOperationBatch` will no longer be called on kotlin NativeAnimated since D78005971 (https://github.com/facebook/react-native/pull/52521), so `batchingControlledByJS` will remain false. Cleaning up some logic and TODO comments there
this feature was added in D23010844
Reviewed By: christophpurrer
Differential Revision: D82461457
fbshipit-source-id: a1208720b83e614c2a5f994ec1a5005189c5f197
Summary:
As per the discussion on the previous [PR thread](https://github.com/facebook/react-native/pull/52028#issuecomment-2979481948), this PR uses `SwiftUI` to implement blur filter on iOS.
## Approach:
To implement blur filter on iOS, we have two options:
1. Use `CAFilter` (private API, app can get rejected/API can break). Earlier [PR](https://github.com/facebook/react-native/pull/52028) was using that approach. Thanks to Nick for suggesting SwiftUI API.
2. Use `SwiftUI`. Wrap the view in a SwiftUI view and apply [blur](https://developer.apple.com/documentation/swiftui/view/blur(radius:opaque:)). This PR builds on top of that approach. This also enables a way to add `SwiftUI` only features like this one. Additional filters (grayscale, saturate, contrast, hueRotate) can also be added.
There are a few ways we can implement the SwiftUI approach:
1. Create a new `RCTSwiftUIComponentView` -> do style flattening in View -> check if `filter` is present and conditionally render the `RCTSwiftUIComponentView` on iOS, wrap children with a `SwiftUI` view. Tradeoff with this approach is that it adds `StyleSheet.flatten` overhead on JS side.
2. Add a `SwiftUI` container view inside of `RCTViewComponentView`. Tradeoff with this approach is that it complicates `RCTViewComponentView` a bit.
I decided to go with **2** to avoid the flattening tradeoff and try to minimize complicating `RCTViewComponentView`. it only adds the wrapper if it's required and removes if not (in this PR, blur filter style will add the wrapper, it will get removed if blur filter styling gets removed). It uses the existing container view pattern.
## Changelog:
[IOS][ADDED] - Filter blur
<!-- 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/52495
Test Plan:
Test filter blur example on iOS. SwiftUI view should be added to the hierarchy.
<img src="https://github.com/user-attachments/assets/742539f4-a96d-45f4-94ba-5eb588d0ad5a" width="300px" />
## Aside:
- This PR also adds a new swift podspec. Creating a new podspec felt the right approach as adding swift in existing ones were adding some complexity. But open for changes here. Also, need some eyes on the podspec configs. cc - chrfalch 🙏 this might also affect the SPM migration.
- Unrelated: Existing brightness filter has some inconsistency compared to android and web, it uses [self.layer.opacity](https://github.com/facebook/react-native/blob/6892dde36373bbef2d0afe535ae818b1a7164f08/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L1008) so transparent background color do not blend well unless the view has an opacity. One solution would be to calculate true background color by using brightness or else use the `SwiftUI`'s [brightness](https://developer.apple.com/documentation/swiftui/view/brightness(_:)), which would be cleaner imo (tested and it works).
Reviewed By: cipolleschi
Differential Revision: D79666764
Pulled By: joevilches
fbshipit-source-id: 05e43d75ce7b6f25b67b4eed632524a559ea1c2e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53771
# Changelog: [Internal]
Instead of opening DevTools every time we emit a background trace, we are going to check if there is an active session with Fusebox client and will send it to the first one registered.
Reviewed By: huntie
Differential Revision: D82321146
fbshipit-source-id: 46b4d090ae9a6f8b4fc98181b303ff552c561eb8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53760
# Changelog: [Internal]
This is a different approach from the one that I've introduced initially in [1].
This saves us from the scenario, where any local session could snatch the stashed trace recording. For example, if some session was created for a Runtime binding right after we've stashed the trace and before initializing real CDP session with the Frontend.
Reviewed By: huntie
Differential Revision: D82316584
fbshipit-source-id: 806a0f6dbdb4e4e928ce33af228cae86d43772e9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53755
Changelog: [iOS][Fixed] Make `RCTSetDefaultFontHandler` compatible with the new arch, and add a more powerful version as `RCTSetDefaultFontResolver`
Reviewed By: fkgozali
Differential Revision: D82207676
fbshipit-source-id: eeeaf708491de9156ef4f1e045864e4322213902
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53777
Expose `unstable_NativeText` and `unstable_NativeView` components as root exports of the `react-native` package.
These are exposed as `unstable_` APIs which have no semver guarantee.
**Motivation**
There is significant community interest / dependance on the currently private `TextNativeComponent` and `ViewNativeComponent` deep imports, to access the faster-performing inner versions of these UI components.
Using `<Text>` and `<View>`, while recommended and stable, has led to measurable performance overhead in some apps when compared with these `<Native*>` counterparts.
Notably, these APIs are also referenced by low-level libraries such as React Strict DOM.
I am proposing this change in order to:
- Unblock libraries which safely use these.
- Meet users where they are at.
- Unblock us from enabling the Strict TypeScript API (no deep imports).
References:
- https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13452047
- https://javascript.plainenglish.io/optimizing-text-component-rendering-in-react-native-b9d3565659d9
- https://github.com/search?type=code&q=react-native%2FLibraries%2FText%2FTextNativeComponent
**Ideal future state**
We are exposing these as unstable APIs because they should not be part of React Native's final API. The ideal end state is we improve the regular `<Text>` and `<View>` components to eliminate performance overhead and the need to access any lower level API.
Changelog:
[General][Added] - `unstable_NativeText` and `unstable_NativeView` are now exported from the `react-native` package
Reviewed By: javache
Differential Revision: D81588145
fbshipit-source-id: 2ea9b7f822286de85f49607944c6a484d1fcf242
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53761
Updates `NetworkReporter` and `PerformanceEntryReporter` to populate (minimal) `"ResourceSendRequest"` and `"ResourceFinished"` events when a CDP performance trace is active. This allows the Chrome DevTools Performance panel to display the "Network" track.
**Notes**
- The trace events that Chrome requires need extra fields which aren't present on `PerformanceResourceTiming`, hence the new + optional `devtoolsRequestId`, `requestMethod`, `resourceType` params. We only populate these in debug builds.
**Limitations**
- We emit a *complete trace event set* within `reportResourceTiming`, implementing basic initial support in the Performance panel Network track. This means 1/ either all/no events are sent for a given request (rather than incrementally), 2/ we aren't yet handling failed/cancelled requests in this pipeline.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D82212362
fbshipit-source-id: 4c6d5d2510cc98ddc819a2778222b835411295c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53746
ScreenshotTestsManagerModule and ReactAppScreenshotTestActivity are not in use anymore, let's delete them
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D82249453
fbshipit-source-id: 73b0f2ef2e9a5370057c07c3bee03f9c0793d61a
Summary:
This pull request fixes a small error in the deprecation message for `ReactContextBaseJavaModule#getCurrentActivity()`, where the reference to `getReactApplicationContext().getCurrentActivity()` contained a syntax error.
## Changelog:
[ANDROID] [FIXED] - Correct deprecation message for `ReactContextBaseJavaModule#getCurrentActivity()`
Pull Request resolved: https://github.com/facebook/react-native/pull/53751
Reviewed By: javache
Differential Revision: D82302032
Pulled By: cortinico
fbshipit-source-id: 130991ef514663223165c30fccb920ce87403148
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53752
Currently we `Objects.requireNotNull` on the `SurfaceMountingManager` inside the `getEncodedScreenSizeWithoutVerticalInsets`
function. However the `SurfaceMountingManager` could be null.
In that scenario, I'm returning 0 here (that will restore the old broken behavior, with the modal rendering on the top left corner for the first frame), instead of letting the app crash.
Changelog:
[Android] [Fixed] - Do not crash inside getEncodedScreenSizeWithoutVerticalInsets if SurfaceMountingManager is null
Reviewed By: javache
Differential Revision: D82225855
fbshipit-source-id: df84db612e77b6b981bc28afc0d293867b5d3b2e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53326
Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).
The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.
## Changelog:
[iOS][Fixed] - Fix Switch layout to work with iOS26
Reviewed By: sammy-SC
Differential Revision: D80454350
fbshipit-source-id: 1d468910276f7fde4559d2ae87cf60c8494caceb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53741
Adds a couple of web link options to populate the "Help" menu in the RNDT desktop app. The default menu is otherwise unchanged.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D82231524
fbshipit-source-id: 9a57e6067854716691dc35938d6f27735b8c8448
Summary:
While working on a somewhat non-standard library setup I ran into:
`[Codegen] TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined`
which was caused by `xcodeproj` file not found. The issue was on the project side rather than codegen, but the error message was rather unhelpful, so this improves it.
## Changelog:
[General][Changed] - improve codegen error when ios native project not found
Pull Request resolved: https://github.com/facebook/react-native/pull/53726
Test Plan:
tested locally, received the improved error message:
`[Codegen] Error: Cannot find .xcodeproj file inside /Users/some_project. This is required to determine codegen spec paths relative to native project.`
Reviewed By: cortinico
Differential Revision: D82226931
Pulled By: cipolleschi
fbshipit-source-id: dd851205655048fc35ed9f5266cefdbfb067d211
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53734
## Changelog:
[Internal] [Changed] - ensure animatedNodes collection is only accessed on render thread
now `createAnimatedNode` can be called async from js thread (since https://github.com/facebook/react-native/pull/53476), `animatedNodes_` will be written on both threads, there was no proper locking mechanism for read
we can simply add locks wherever we read/write animatedNodes_; but there's way to use fewer locking - since AnimatedNode is created async, but will not be R/W async anywhere else, we can add a new collection to temporarily hold nodes created async and flush it on render thread
Reviewed By: lenaic
Differential Revision: D82119554
fbshipit-source-id: 7f29e9e046cdf2e233c548442d70f1ff5b931cdd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53651
## Stack
We aim to remove +load methods from the codebase to reduce pre-main startup time and to unblock enabling startup optimizations
## Diff
Diff removes `+load` API from `RCT_EXPORT_MODULE` macro.
It introduces new parameter for `react_native_module_provider` function `eager`, which adds legacy RN modules to newly created socket `REACT_MODULE_EAGER_REGISTRATION_SOCKET`. This socket is invoked right before the RCTBridge is being initialized.
Impact: 137 static loaders are removed from the startup path
## RN
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D81727845
fbshipit-source-id: 4904499f2e8587717b26579364ed48ffed934774
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53688
Support for the `removeIf` method was [added to CopyOnWriteArrayList with AOSP in API 26](https://android-review.googlesource.com/c/platform/libcore/+/304056). On devices with API 24 and 25, invocations of either `ReactScrollViewHelper#removeScrollListener` or `ReactScrollViewHelper#removeLayoutChangeListener` would cause a crash. Rather than bump the required API version and lock out apps targeting API 24/25, this adds a separate code path to bulk remove items from the array list.
Changelog: [Internal]
Differential Revision: D82039300
fbshipit-source-id: 6509dc637534b8e546f84447dbcdce1c5bca42f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53692
With some custom typefaces, font hinting causes "jittery" artifacts upon scaling the text. We already set the subpixel text flag for views with custom or modified typefaces and this change also sets the linear text flag. Per [Android documentation](https://developer.android.com/reference/android/graphics/Paint#SUBPIXEL_TEXT_FLAG), it's recommended that both of these flags are set together to avoid this exact artifacting. This change is being gated behind a feature flag to evaluate the performance impact of disabling glyph caches for all text, and may drive the need to introduce a prop that controls this setting in the future.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D82050029
fbshipit-source-id: 9e6e023ff723641f663935b6cd7aae07045834bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53718
I've just realized we ended up invoking `project.` inside the execution of `BundleHermesCTask`.
This is an anti-pattern and is breaking Gradle Configuration caching.
Instead we should be checking if hermesV1Enabled is set during the Task registration and pass over this information
to the task.
Changelog:
[Internal] [Changed] -
Reviewed By: j-piasecki
Differential Revision: D82130643
fbshipit-source-id: d2026711666867b3767824381cc5be0af3b476cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53725
Changelog: [GENERAL][CHANGED] - Changed the coordinates of hermes artifacts when using Hermes V1
Adds a new `version.properties` file to keep which hermes versions should be consumed from Maven once the versions of Hermes and React Native are decoupled. This diff only implements changes necessary for consuming Hermes V1, as we don't want to migrate everything quite yet (0.82).
Reviewed By: cortinico
Differential Revision: D82204203
fbshipit-source-id: d712257a73f7ba54612a55c1b312416376f28b56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53712
Changelog: [internal]
This enables the new Web Performance APIs in the canary channel.
Reviewed By: cortinico
Differential Revision: D82117694
fbshipit-source-id: 370b8397eeec350be8434728ab9d8ce1f5926117
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53711
Changelog: [internal]
This removes some fields that contain the same time as `endTime`, which is confusing when documenting them.
Reviewed By: christophpurrer
Differential Revision: D82112473
fbshipit-source-id: 461e2b4b495ae641dcb3233874360a4f7b90dabf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53710
Changelog: [internal]
This should be a getter according to the spec.
Reviewed By: hoxyq
Differential Revision: D82111779
fbshipit-source-id: 614bb4848907bacd80ef228aa747ae685cf2c1f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53619
With this change, we are making Codegen generate a Package.swift file so that we can integrate the `ReactCodegen` and the `ReactAppDependencyProvider` in apps only using SwiftPM
## Changelog
[iOS][Added] - Make codegen generate PAckage.swift file for the codegen targets
Reviewed By: cortinico
Differential Revision: D81769543
fbshipit-source-id: 1f1a1b9f41126e142931d5eda6e75109a69f828c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53618
This change makes sure that we generate the codegen files in the ReactCodegen and ReactAppDependencyProvider folder.
This is necessary as Swift PM needs the source code of packages to be grouped in folders that are children of where the Package.swift is located.
This is not a breaking change, because Cocoapods has been updated accordingly, import/include paths are not changed and the folder layout should not be accessed by anybody directly
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81769522
fbshipit-source-id: 7c70f96a9aa503c4faaf173b94c8ee0e326094a1
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53503 for a regression
When no React Native module is present this bail condition stops us from generating the artifacts podspec that's needed to complete build.
## Changelog:
[IOS] [FIXED] - Fix regression that skips artifacts code generation
Pull Request resolved: https://github.com/facebook/react-native/pull/53690
Test Plan:
- Create an app **without** any React Native modules, run `pod install`; without this fix the podspec will be missing and the build will fail
- With expo this can be reproduced using `create-expo-app --template blank-typescript@next` on `react-native@0.81.2`
- With the community CLI this can be reproduced using `npx react-native-community/cli@latest init test --skip-install --version 0.81.2` and uninstalling `react-native-safe-area-context`
Reviewed By: javache
Differential Revision: D82103491
Pulled By: cipolleschi
fbshipit-source-id: 3d9619b5a935ca920220824b3963a9a107f926ca
Summary:
We had reports from the Community of the RN CI running on forks and causing high costs and bills for them
This change should make sure that the most impactful jobs only runs on the React Native CI and not on forks.
## Changelog:
[Internal] -
Pull Request resolved: https://github.com/facebook/react-native/pull/53707
Test Plan: GHA
Reviewed By: cortinico
Differential Revision: D82107313
Pulled By: cipolleschi
fbshipit-source-id: ff7f418344975e7bb8306a6356d774c26bea3db1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53660
Changelog: [internal]
(This is internal because these APIs aren't enabled in OSS yet)
Implements `performance.timeOrigin` to allow converting timestamps from `performance.now()` to be based on the Unix epoch.
This implementation isn't fully spec-compliant to align with the current implementation of `performance.now()`, where the base of the clock is system boot time instead of app startup / navigation time.
Reviewed By: huntie
Differential Revision: D82016724
fbshipit-source-id: e3a066721cecf41e2fd963beb94a0a2f1c5d6493
Summary:
This PR adds additional checks to run nightly jobs only on the main repo.
I noticed pretty heavy usage on my fork of React Native:
<img width="951" height="179" alt="Screenshot 2025-09-10 at 11 47 29" src="https://github.com/user-attachments/assets/91cb9e4a-8658-42bd-bbfe-ffba01b0b3b3" />
I also noticed a typo in this file with output instead of outputs
## Changelog:
[INTERNAL] [FIXED] - add conditional checks for facebook/react-native repo for nightly workflow
Pull Request resolved: https://github.com/facebook/react-native/pull/53700
Test Plan: Check if the syntax is correct.
Reviewed By: cortinico
Differential Revision: D82104958
Pulled By: cipolleschi
fbshipit-source-id: fc2e6e0299345ebd115c7a574a5a8161f2b0ca5c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53665
Changelog: [ANDROID][FIXED] - Read the Hermes V1 opt-in flag from the apps properties when building from source
Reviewed By: cortinico
Differential Revision: D82018545
fbshipit-source-id: f3c6fdbac190f47b6bf6836105d9e0909d8b86ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53689
## Changelog:
[General] [Fixed] - fix array type parsing in DynamicEventPayload::extractValue
When unwrapping event mapping like `e.nativeEvent.touches[0].locationX` e.g. for Animated.event like below,
```
onTouchMove={Animated.event(
[
{
nativeEvent: {
touches: {
0: {locationX: animatedValue},
},
},
},
],
{useNativeDriver: true},
)}
```
here it'll throw exception `terminating due to uncaught exception of type folly::TypeError: TypeError: expected dynamic type 'object', but had type 'array'` when getting into folly dynamic array, because array index in the event path is string instead of integer
Reviewed By: rozele
Differential Revision: D82050538
fbshipit-source-id: ed25c8917b90190c995d1fcd6d60af207e72e270
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53547
Changelog: [internal]
This creates a new feature flag to enable the modern Web performance APIs in RN by default. It's disabled by default so it shouldn't have any effect at the moment.
Reviewed By: rshest
Differential Revision: D80811430
fbshipit-source-id: 47d5fd12ac8809aa3c5ad37cdd31c0d9e3ed5912
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
Fixes a crash in `RCTDeviceInfo.interfaceOrientationDidChange` when `application.delegate.window` is nil. This crash affects multiple modern iOS app architectures where the traditional window property may not be set:
- **SwiftUI apps using `main`** instead of traditional AppDelegate
- **Brownfield React Native integrations** where the host app manages windows
- **Scene-based lifecycle apps** (iOS 13+) using SceneDelegate
- **Custom window management** setups
**The Problem:**
```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[MyApp.AppDelegate window]: unrecognized selector sent to instance'
```
This occurs when trying to access `.frame` on a nil window object during orientation changes. Modern iOS development patterns don't always require setting `application.delegate.window`, but React Native's RCTDeviceInfo assumes this property exists.
**The Solution:**
Replace direct `application.delegate.window` access with `RCTKeyWindow()` and add nil-safe fallback:
```objc
// Before (crashes in modern apps)
BOOL isRunningInFullScreen =
CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);
// After (safe for all app configurations)
UIWindow *delegateWindow = RCTKeyWindow();
BOOL isRunningInFullScreen = delegateWindow ?
CGRectEqualToRect(delegateWindow.frame, delegateWindow.screen.bounds) : YES;
```
This approach:
- Uses `RCTKeyWindow()` pattern already established elsewhere in RCTDeviceInfo
- Provides safe fallback defaulting to fullscreen when window state is unknown
- Maintains existing multitasking detection behavior (Split View, Slide Over)
- Is backward compatible with traditional React Native apps
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS][FIXED] - Fix RCTDeviceInfo crash when application.delegate.window is nil in modern iOS app architectures
Pull Request resolved: https://github.com/facebook/react-native/pull/53645
Test Plan:
### Manual Testing
**1. SwiftUI main App Test:**
```bash
# Created SwiftUI app with main lifecycle
# Integrated React Native component
# Result: No crash during orientation changes, fullscreen detection works
✅ PASS: Orientation changes handled safely
✅ PASS: Multitasking detection stable
```
**2. Traditional React Native App:**
```bash
# Tested with standard RN template app
# Verified existing behavior unchanged
✅ PASS: Existing functionality preserved
✅ PASS: No regressions in dimension reporting
```
**3. Brownfield Integration:**
```bash
# Integrated RN in existing iOS app without window property
# Triggered orientation changes and multitasking transitions
✅ PASS: No crashes during orientation events
✅ PASS: Split View and Slide Over work correctly
```
**4. Scene-based Lifecycle App:**
```bash
# Created app using SceneDelegate for window management
# Tested orientation and multitasking scenarios
✅ PASS: Proper handling when SceneDelegate manages windows
✅ PASS: No crashes during app lifecycle transitions
```
### Edge Case Testing
**RCTKeyWindow() Returns Nil:**
- Confirmed defaults to `YES` (fullscreen)
- No crashes when no key window available
- Multitasking detection remains stable
**Multiple Window Scenarios:**
- Tested with iPad multiple windows
- Uses correct key window for measurements
- Proper behavior in complex window hierarchies
**Orientation During Transitions:**
- App backgrounding/foregrounding during orientation
- Multitasking mode changes during rotation
- No crashes or inconsistent states
### Automated Testing
```bash
# All existing tests pass
yarn test
✅ RCTDeviceInfoTests pass
# Code style compliance
yarn lint
✅ Follows React Native Objective-C guidelines
```
### Impact Verification
**Before Fix:**
- Crash in SwiftUI apps using main
- Crash in Scene-based lifecycle apps
- Crash in brownfield integrations
**After Fix:**
- All app architectures work safely
- Multitasking detection preserved
- Backward compatibility maintained
- No performance impact
Rollback Plan:
Reviewed By: javache
Differential Revision: D81931754
Pulled By: cipolleschi
fbshipit-source-id: c3ea1a2922b1d48ca6bc1fc32861b490322fd254
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53484
Refactor to better organise network event reporting features.
- Introduce new `ReactCommon/react/networking` package, containing `NetworkReporter` class (outer-most interface with each platform).
- Move `ReactCommon/performance/timeline` dependency to this level, removing jsinspector→performance dependency.
- Simplifies the remaining `NetworkHandler` in `jsinspector-modern/network` — which now is only focused on CDP network reporting.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D81129562
fbshipit-source-id: 6c36045e872b0fd9510d0fa3e98acb0969e74d72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53617
In the RCTAppDelegate.h file there are a couple of headers that are not used and that can be either removed or moved to the .mm file.
This reduce the coupling between the AppDelegate library and React Core and allow us to reduce the size of the exported headers in the umbrella header.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81769485
fbshipit-source-id: b811dde0331e8a668618e0c8eb250fd81bf48545
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53641
This extra quote is causing the build on the 0.82-stable to fail. The reason is that the Path for the `.hermesversion` file is composed wrongly so we attempt to build hermes from the `main` branch.
Changelog:
[Internal] [Changed] -
Created from CodeHub with https://fburl.com/edit-in-codehub
Reviewed By: j-piasecki, vzaidman
Differential Revision: D81925624
fbshipit-source-id: 700f9d44b6c7efdb845232dad8ca7c2e3136385d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53637
Changelog: [ANDROID][FIXED] - Check for the value of the HERMES_V1_ENABLED flag instead of whether it's defined
Reviewed By: cortinico
Differential Revision: D81920483
fbshipit-source-id: 550ae9fd27f666affe102b1c5c3f51bde7b5923e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53628
Bump the `memfs` dependency used in tests to the latest minor - there have been a considerable number of updates since 4.7 including support for various newer (and some old) Node fs APIs: https://github.com/streamich/memfs/blob/master/CHANGELOG.md
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D81879137
fbshipit-source-id: e75946dac100809cb39c88971fd6ed397dc9f49e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53630
These JavaScript apis were a part of react native's legacy architecture. Let's deprecate them, so that we can eventually remove them in the future.
Changelog: [General][Deprecated] - Deprecate legacy javascript react native apis
Reviewed By: cortinico
Differential Revision: D81795732
fbshipit-source-id: 0a2bd142fa7e08c1f3daaa437ee127a2156e045b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53622
Reverting to avoid lossy conversion on hosts expecting signed int values for color conversion.
Changelog: [Internal]
Reviewed By: rozele, javache
Differential Revision: D81785268
fbshipit-source-id: 4a8d099e378fa55e76a58c2ab0356d88e344de2c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53589
## Changelog:
[Android] [Changed] - [c++ animated] Course correct props at SurfaceMountingManager.updateProps()
Sometimes a React update will try to commit to the same view that native animated modified before via direct manipulation, and after the update host view will use the prop value currently in Fabric. In `AnimatedMountingOverrideDelegate` there's logic to course correct at ShadowTree mount, but if this update is from JS thread, it takes some time to reach mounting layer, at the same time UI thread can still be doing more direct animation updates, and once the corrected change gets there it's already stale.
In this diff I added mechanism to keep track of direct manipulation props (or "synchronous mount props" to match the naming of java function `synchronouslyUpdateView...`) and use it to correct what reaches host view. `SurfaceMountingManager.updateProps()` is called by both regular mount and direct manipulation and it's always called on UI thread, so it could be a good candidate to synchronize these 2 scenarios
Reviewed By: sammy-SC
Differential Revision: D81611823
fbshipit-source-id: 638a59bcd94b3d7e8bab68defd472b2b482dc92f
Summary:
## Changelog:
[Internal] -
Noticed that the default value for this one is inconsistent with all the other similar ones, which can cause confusion during setting up the experiment, fixing it.
Note that top level view recycling is still controlled via `enableViewRecycling`, which will also disable all the other ones when false (which it is by default).
bypass-github-export-checks
Reviewed By: lenaic
Differential Revision: D81766029
fbshipit-source-id: df4a260b9bde20d1c85b7786df00fa91298a27b7
Summary:
bypass-github-export-checks
OSS release infrastructure for the (experimental) React Native DevTools standalone shell.
Currently, binaries are built continuously on Meta infra and served from the Meta CDN using fbcdn.net URLs checked into a DotSlash file in the repo, e.g.:
https://github.com/facebook/react-native/blob/15373218ec572c0e43325845b80a849ad5174cc3/packages/debugger-shell/bin/react-native-devtools#L9-L18
For open source releases we want to primarily distribute the binaries as GitHub release assets, while keeping the Meta CDN URLs as a secondary option. This PR makes the necessary changes to the release workflows to support this:
* `workflows/create-release.yml` (modified): As part of the release commit, rewrite the DotSlash file to include the release asset URLs.
* **NOTE:** After this commit, **the new URLs don't work yet**, because they refer to a release that hasn't been published. Despite this, the DotSlash file remains valid and usable (because DotSlash will happily fall back to the Meta CDN URLs, which are still in the file).
* `workflows/create-draft-release.yml` (modified): After creating a draft release, fetch the binaries from the Meta CDN and reupload them to GitHub as release assets. This is based on the contents of the DotSlash file rewritten by `create-release.yml`.
* `workflows/validate-dotslash-artifacts.yml` (new): After the release is published, all URLs referenced by the DotSlash (both Meta CDN URL and GH release asset URLs) should be valid and refer to the same artifacts. This workflow checks that this is the case.
* If this workflow fails on a published release, the release may need to be burned or a hotfix release may be necessary - as the release will stop working correctly once the Meta CDN stops serving the assets.
* This workflow will also be running continuously on `main`. If it fails on a commit in `main`, there might be a connectivity issue between the GHA runner and the Meta CDN, or there might be an issue on the Meta side.
NOTE: These changes to the release pipeline are generic and reusable; if we later add another DotSlash-based tool whose binaries need to be mirrored as GitHub release assets, we just need to add it to the `FIRST_PARTY_DOTSLASH_FILES` array.
## Changelog:
[Internal] Mirror React Native DevTools binaries in GitHub Releases
Pull Request resolved: https://github.com/facebook/react-native/pull/52930
Test Plan:
### Step 0: Unit tests
I've added unit tests for `dotslash-utils`, `curl-utils`, and for the majority of the logic that makes up the new release scripts (`write-dotslash-release-assets-urls`, `upload-release-assets-for-dotslash`, `validate-dotslash-artifacts`).
### Step 1: Test release commit
Created a test branch and draft PR: https://github.com/facebook/react-native/pull/53147.
Locally created a release commit, simulating the create-release GH workflow:
```
node scripts/releases/create-release-commit.js --reactNativeVersion 0.82.0-20250903-0830 --no-dry-run
```
This updated the DotSlash file in the branch: https://github.com/facebook/react-native/pull/53147/commits/2deeb7e70376ee80b99f27bea4825789f22a89a3#diff-205a9ff6005e30be061eaa64b9cb50b15b0e909dd188e0866189e952655a3483
NOTE: I've also ensured that the `create-release-commit` script correctly updates the DotSlash file when running from a branch that already has a release commit - see screenshot:
<img width="1483" height="587" alt="image" src="https://github.com/user-attachments/assets/1ffd859b-e02b-483d-8067-9cc9116829a4" />
### Step 2: Test draft release
Enabled testing the create-draft-release GH workflow in the test branch using these temporary hacks:
* https://github.com/facebook/react-native/pull/53147/commits/81f334eac5147d4dbf5f6d7d627ddfa52cd197be
* https://github.com/facebook/react-native/pull/53147/commits/6d8851657629de7e0b710ed8f5dd7d0f7b9847cc
* https://github.com/facebook/react-native/pull/53147/commits/1428a8da8b9fb29c45fc33d79f311dd1fe273433
Workflow run: https://github.com/facebook/react-native/actions/runs/17426711373/job/49475327346
Draft release: https://github.com/facebook/react-native/releases/tag/untagged-c6a62a58e5baa37936e1
Draft release screenshot for posterity (since we'll likely delete the draft release after landing this):
<img width="1024" height="814" alt="image" src="https://github.com/user-attachments/assets/1900da15-48f6-4274-b29c-0ac2019d92c0" />
### Step 3: Test post-release validation script
For obvious reasons, I've avoided actually publishing the above draft release. But I have run the `validate-dotslash-artifacts` workflow on the *current* branch to ensure that the logic is correct: https://github.com/motiz88/react-native/actions/runs/17426885205/job/49475888486
Running `node scripts/releases/validate-dotslash-artifacts.js` in the release branch (without publishing the release first) fails, as expected:
<img width="1105" height="748" alt="image" src="https://github.com/user-attachments/assets/ed23a2e2-7a31-42eb-a324-f1d50eafe2fb" />
## Next steps
This PR is all the infra needed ahead of the 0.82 ~~branch cut~~ infra freeze to support the React Native DevTools standalone shell, at least on the GitHub side. ~~Some minor infra work remains on the Meta side, plus some product/logic changes to the React Native DevTools standalone shell that I'm intending to finish in time for 0.82 (for an experimental rollout).~~ EDIT: All the planned work has landed; the feature is code-complete on `main` as well as in `0.82-stable` (apart from this infra change).
As a one-off, once we've actually published 0.82.0-rc.1, we'll want to have a human look at the published artifacts and CI workflow logs to ensure everything is in order. (I'll make sure to communicate this to the 0.82 release crew.) Afterwards, the automation added in this PR should be sufficient.
Reviewed By: huntie
Differential Revision: D81578704
Pulled By: motiz88
fbshipit-source-id: 6a4a48c3713221a89dd5fc88851674c1ddc6bb10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53558
Changelog: [Internal]
Got confused regarding why "reconnect" does not actually trigger a reconnect. It turns out, it only triggers a reconnect if the URL has changed.
Reviewed By: cipolleschi, huntie
Differential Revision: D80629308
fbshipit-source-id: 098ef5e91f3748deb9bc707b79bc0395d2442ca4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53600
# Changelog:
[Internal] -
Adds the corresponding feature flag, similarly as it's done for other component types.
The flag is used in the next diff.
Reviewed By: mdvacca
Differential Revision: D81681404
fbshipit-source-id: f9f155379034695f5df6cc4f0d3787ff4c69df7f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53578
Changelog: [Internal]
Adds a new preprocessor directive which should be set when the new Hermes is being used. This directive will disable the legacy debugger which isn't supported by it.
Reviewed By: cipolleschi, cortinico
Differential Revision: D81035112
fbshipit-source-id: b30ae348b3419ec2d064dfe7f91c9d664a66f5cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53410
Changelog: [Internal]
Adding babel-istanbul-plugin to instrument bundle code with coverage reporting.
Metro will transform source code only when coverage flag is set up globally in jest.
Coverage map is then provided by runner as part of test result.
Reviewed By: sammy-SC
Differential Revision: D80716433
fbshipit-source-id: 3831f227f8793f874f0d2366759bb6916e747c72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53475
This is cleanup of IHermesExtra. Move the last method in IHermesExtra,
dumpOpcodeStats(), to jsi::Instrumentation, since other profile stats
dumping methods live in that interface as well.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D81087047
fbshipit-source-id: e145aafea7459a161fca04ffc30f0838ee6c03c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53473
This is a cleanup of IHermesExtra:
1. Move dumpSampledTraceToProfile() and debugJavasScript() to IHermes.
I'm still keeping the empty DebugFlags, since changing that requires
more changes. It's also possible that we may need it in the future.
2. Remove `dumpBasicBlockProfileTrace`. Use
writeBasicBlockProfileTraceToFile` if users need to dump the profile.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D81075460
fbshipit-source-id: b81005e531809cfd870fd9bdb5c0e17864ed92fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53419
By default, this function returns nullptr. User can pass a preprocessor
definition "-DHERMES_SH_UNIT_FN=sh_export_<unit_name>" (where
<unit_name> is the name passed to shermesc when compiling the JS
input), so that this function returns the function pointer, which can
be passed to `evaluateSHUnit` for evaluation.
Changelog: [Internal]
Reviewed By: avp
Differential Revision: D80747463
fbshipit-source-id: a798a7a572679444fca111c34674fd7ced9311f3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53418
Expose these methods so that we can access from RN code. To minimize
the change, a few methods that depend on other headers or preprocessor
flags are wrapped into IHermesExtra in hermes/API/hermes.h.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D80740969
fbshipit-source-id: 79565d851bc1b0833931f4fe7fb62d89d3d669ef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53577
Simplify the API to keep all formatting inside of ReactHostStateTracker and remove the `bridgeless` part of the name. Bit more efficient binary-size wise.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D81445833
fbshipit-source-id: 5bc8bc9e3de326f23e95e01e889b4e2806438c06
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53588
# Changelog: [Internal]
Since the `name` was already moved for the begin event, there is nothing to be moved for `end` event. Instead, we will be creating a copy for the `begin` event.
This was actually affecting some entries on a timeline, like component triggers (yellow ones).
Reviewed By: vzaidman
Differential Revision: D81589847
fbshipit-source-id: 3b7d801d3429217ce279ed7de41c40c3838a5f37
Summary:
This PR fixes swipe dismissal to work each time the modal is shown. Previously modalInPresentation was set on the view controller which gets destroyed every time user dismisses the modal. This makes sure that modal in presentation is correctly preserved when showing multiple modals.
https://github.com/user-attachments/assets/c7f140e5-1c4f-4809-8453-148d4becc9eb
## Changelog:
[IOS] [FIXED] - modal swipe dismissal works only for the first time
Pull Request resolved: https://github.com/facebook/react-native/pull/53499
Test Plan:
1. Open RN Tester
2. Check allow swipe dismissal
3. Check closing it multiple times
Reviewed By: javache
Differential Revision: D81312918
Pulled By: cipolleschi
fbshipit-source-id: 4f7cc60762660e5d5310f4973fe8df340c1ba52b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53367
We are missing a dependency in the React-jsinspector podspec that prevents React Native from building with dynamic frameworks.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D80619664
fbshipit-source-id: 1c87ef4d3614ceea3a23196831479ecae0a5acc8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53570
Idle callbacks are implemented as a C++ module in the new architecture, this code should not be used.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D81485912
fbshipit-source-id: 18103bb96441880ff3de423aa6c03a176f6ff5de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53569
Simplify construction to save a JNI call, slightly more efficient on binary size too (1KiB hah)
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D81445834
fbshipit-source-id: b0ec84d5e04d364e34eef4c3b712c62f878325cf
Summary:
Resolves https://github.com/facebook/react-native/issues/53501
This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.
The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.
Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.
This doesn't affect Android/Gradle, which are implemented correctly.
## Changelog:
[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source
Pull Request resolved: https://github.com/facebook/react-native/pull/53503
Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
- Note: Contains this PR's changes as a patch
- `bun install`
- `bun expo run:ios`
Reviewed By: cortinico
Differential Revision: D81490755
Pulled By: cipolleschi
fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53560
Since Gradle 9.0, all the projects in the path must have an existing folder.
As we build :packages:react-native:ReactAndroid, we need to declare the folders
for :packages and :packages:react-native as well as otherwise the build from
source will fail with a missing folder exception.
Changelog:
[Android] [Fixed] - Fix build from source due to missing folder error on Gradle 9.0
Reviewed By: fabriziocucci
Differential Revision: D81482789
fbshipit-source-id: 609b503755486e10060a0f321bd0a38bd71864a1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53566
TLDR; we never advertised this and it's not in use. We have an updated incoming plan for exposing internal private code to Expo / other frameworks.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D81490655
fbshipit-source-id: f3d64582f5e6092e4928865d868ea26867ee7e47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53571
Changes `VirtualView` so that its layout when hidden can be configured by call sites.
Previously, it was hardcoded to only retain the last known height. However, this logic only works for `VirtualView` children oriented in a column layout.
This change enables the use of `VirtualView` in more flexible abstractions that require different hidden styles (e.g. row or grid orientations).
Also, this changes the default behavior to set `minWidth` and `minHeight`, so that the default behavior is more general and more likely to work in a reasonable manner in more use cases.
NOTE: Ideally, we would be able to default to using `flexBasis` instead. However, the `hiddenStyle` function receives a `Rect` and does not know whether the parent's flex direction is row or column to influence whether to use `targetRect.width` or `targetRect.height`. This is an opportunity for future improvement.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81344126
fbshipit-source-id: 33d9e81601b671059f97b4590816243cbd24734a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53533
Creates a new `enableVirtualViewExperimental` feature flag that determines whether `VirtualView` uses the old or new implementation.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81340963
fbshipit-source-id: f550fe4e4573e080eb8668077d0ad3ca53cd4d33
Summary:
This PR falls back to UIScreen when windowScene is not available.
<img width="500" alt="CleanShot 2025-08-28 at 14 30 59@2x" src="https://github.com/user-attachments/assets/9dda3153-dfe7-48a5-9d0e-5416c2e34c64" />
## Changelog:
[IOS] [FIXED] - Simplify RCTAlertController, don't create additional UIWindow
Pull Request resolved: https://github.com/facebook/react-native/pull/53500
Test Plan:
Open the alert multiple times to check if everything works as expected.
Rollback Plan:
Reviewed By: javache
Differential Revision: D81410450
Pulled By: cipolleschi
fbshipit-source-id: c27ea98d9e811c2f259f0ff3c6689482d116c418
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53534
BackgroundDrawable and BorderDrawable have already substituted CSSBackgroundDrawable en every Android surface.
- Deleting CSSBackgroundDrawable.java and its callsites
- Deleting enableNewBackgroundAndDrawable featureflag
Just cleaning up what at this point is just dead code.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D81330969
fbshipit-source-id: bcf66ec8d3225802432ae1d93a2b26ea65cfcda0
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53194
This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds.
When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes.
That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically.
## Changelog:
[IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces
Pull Request resolved: https://github.com/facebook/react-native/pull/53540
Test Plan: - Create a project in a folder `with spaces` and build a release build
Reviewed By: cipolleschi, cortinico
Differential Revision: D81406841
Pulled By: robhogan
fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53431
Changelog: [internal]
This renames `setUpPerformanceObserver` as `setUpPerformanceModern` and removes the need to call it manually. If the native module is defined, we define the whole new API.
Reviewed By: javache
Differential Revision: D80803626
fbshipit-source-id: ef41cb9aa959ee898d32724c102d7597e6bee84e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53430
Changelog: [internal]
This fixes the spec-compliance of several classes in the Performance API by not allowing userland code to instantiate them directly.
This also exposes some missing interfaces from the Performance API in the global scope.
Reviewed By: rshest
Differential Revision: D80800076
fbshipit-source-id: f6439b9c7914817ef552e78fd61646ccab1e1de2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53429
Changelog: [internal]
This is a refactor of the types in `PerformanceEntry` and subclasses to accept interfaces instead of objects. This allows us to pass down the init object from subclasses to the superclass without having to create intermediate objects.
Additionally, this is also more semantically correct, as existing APIs don't need those options to be own properties of the init object.
Existing benchmark for Performance doesn't show any significant impact.
Reviewed By: rshest
Differential Revision: D80800075
fbshipit-source-id: ab439d70f4db9ce60e3089d89ccb105a91e7ef48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53428
Changelog: [internal]
This is the last method in `PerformanceObserver` to implement. For some reason we never added it, even though it was trivial.
Reviewed By: rshest
Differential Revision: D80717237
fbshipit-source-id: ae3bd243d0f3f0fe4f0705437d78d14c532515f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53427
Changelog: [internal]
Migrate the imported types to the globally defined ones, so we follow the good practice of only accessing the public API in Fantom tests.
Reviewed By: rshest
Differential Revision: D80807160
fbshipit-source-id: 77d792b56b53c8da8409dd9133cd111afb8084f1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53433
Changelog: [internal]
This adds the definitions for the Web Performance APIs in the global scope.
Reviewed By: zeyap
Differential Revision: D80811659
fbshipit-source-id: a81117a27a480ba03f8feb2e813a3a66a10307f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53536
# Changelog: [Internal]
For every chunk, we already have a threshold for the number of samples captured in this chunk.
There could be really tall call stacks, where we could record hundreds of unique nodes, which makes the chunk already big enough for a CDP traffic on android.
We are adding a threshold for a number of unique nodes in a single chunk. If the chunk has a greater number of nodes recorded, it will be dispatched over CDP.
Reviewed By: huntie
Differential Revision: D81339677
fbshipit-source-id: 388d14c64c4c3f60918a8526025f79d19d397cb4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53535
# Changelog: [Internal]
This primarily addressed the case when we have captured a Runtime Profile during the app startup. The Hermes Runtime is created on the main thread, so the first few samples will be recorded there, but then it will be moved to JavaScript thread.
Reviewed By: huntie
Differential Revision: D81339676
fbshipit-source-id: 8202ca03df54134330aa921a9a0a97816c51cea5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53548
Add tests to View similar to D81043503, and clarify why `accessibilityElementsHidden` does not show up in the rendered component tree (because Fantom uses the Android platform for bundling, and Android does not have accessibilityElementsHidden in its BaseViewConfig.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D81437063
fbshipit-source-id: aa10573aee686d1d650b152365607877f34f8508
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53530
Deprecate the `StyleSheet.absoluteFillObject` API in favour of `StyleSheet.absoluteFill` (functionally identical).
Secondly, refine the type definitions in our source code (and Strict TS API) from `any` → `AbsoluteFillStyle` — resolves https://github.com/facebook/react-native/issues/53470.
This will be followed with updates to our docs.
Changelog:
[General][Deprecated] - `StyleSheet.absoluteFillObject` is deprecated in favor of `StyleSheet.absoluteFill` (equivalent).
Reviewed By: yungsters
Differential Revision: D81327548
fbshipit-source-id: 2bcf14694dc1bd959419629ce717760086b80ec3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53454
Let's deprecate all the classes that aren't used by interop or the new architecture.
Changelog: [General][Deprecated] - Deprecate all the c++ classes not used by interop, or the new architecture.
Reviewed By: arushikesarwani94
Differential Revision: D80575767
fbshipit-source-id: 1d485300cbe24260d77bbeac75fe5b839121b6c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53521
Make `jsi::Object` constructor explicit, so its creation is explicit and
intentional. This prevents any sad foot-gun of constructing an Object
implicitly from a Runtime, which is certainly not a JS object.
Changelog: [Internal]
Reviewed By: avp
Differential Revision: D81274439
fbshipit-source-id: 5a9d9907f9deff7625dcff9c1072eb135ab7840e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53523
update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.
Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.
Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`
---
Reviewed By: mlord93
Differential Revision: D81270196
fbshipit-source-id: 5b392d67449ddceebbc0fe81db15fa61ae44108f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53397
This is a runtime behaviour fix and an API change to `Appearance.setColorScheme`, motivated by a user report where providing `'unspecified'` (valid) to this function would trigger an incorrect invariant throw. Furthermore, there is already a [first party use](https://github.com/facebook/react-native/blob/aec35b896053d9372ccdaf67c939b2eb216d3455/packages/react-native/Libraries/Utilities/Appearance.js#L101) where we call `Appearance.setColorScheme('unspecified')`.
**Changes**
- `Appearance.d.ts` (current public API, manual types): Fix `ColorSchemeName` type to include `'unspecified'` value, and narrow to remove nullability — aligning with existing Flow source for this type in `NativeAppearance`.
- `Appearance.js` (implementation): Fix the invariant throw by **removing it**, and instead narrowing the input type to non-nullable. Redundant work in `getState` and `getColorScheme` is removed.
Changelog: [General][Breaking] `Appearance.setColorScheme` no longer accepts a nullable value
Reviewed By: andrewdacenko
Differential Revision: D80705652
fbshipit-source-id: cf221a33447606653050d471ca2d0347ab30db81
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53514
Changelog: [Internal]
Add a way to ignore unusually early timestamps, in our example those are artificial marks to create web tracks in correct order, coming from console.timeStamp via React. These markers are ignore in RNDT on Chrome, but not excluded in perfetto.
Reviewed By: hoxyq
Differential Revision: D81246527
fbshipit-source-id: d3342036698d1607c98e5bb4273ea1a3716fcb03
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53492
Changelog: [Internal]
Goal is to simplify code and to lower the JNI payload
- Send values as `int` instead of `Double` if they are converted to `int` on the Java side
- We only have 2 optional values - all others are mandatory
Reviewed By: lenaic
Differential Revision: D81202196
fbshipit-source-id: df8b7d9e6a98e7c919de9be6a277876684f0383c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53328
Disables the legacy performance overlay toggle from the Android DevMenu to make way for V2.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D79791703
fbshipit-source-id: c99ac95e2907ce978ef0c2711ad304c9a3f278ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53334
Adds background performance tracing options to the DevMenu based on the current background tracing state. Analyzing a trace will automatically open dev tools, navigate to the performance tab, and show the last 20 seconds of recorded performance data.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D79714164
fbshipit-source-id: 72ad4be4604c5f4e304b49877b2699be36562655
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53508
Simplify the expressions for checking a type of a container by always returning instead of falling through and returning.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81230049
fbshipit-source-id: 02fd827462c9acf05a83bf88ed6bd0e6db55ebc8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53507
We need this to be an unsigned value everywhere but all the API's and interfaces described this a signed number. While this doesn't make a difference in practice, it's better to explicit.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81230050
fbshipit-source-id: 1eb914a79b9b94654cfa54c20a81ce689f79dcb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53490
Changelog: [Internal]
Sending individual image prefetch request on Android over JNI is causing measurable performance regression. The idea here is batch all image prefetch request for a given shadowNodeTree and then flush it all at once - **DONE** in the next change.
Another optimization we should consider is to execute the batch on `n imagePrefetchRequest` off the JavaScript thread `mqt_v_js` and instead on e.g. the UiThread (on which currently Android Image UI initiates image resource downloads)
Reviewed By: lenaic
Differential Revision: D81186916
fbshipit-source-id: f8b24e70f2ded237be96bdb973b72acbbb8b1c20
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52910
For `get/has/setProperty`, we should also be able to take in a generic
JS Value as the property key. This change adds the Value overload for
these APIs.
The default implementation will use `Reflect.get`, `Reflect.has`, and
`Reflect.set`.
Changelog: [Internal]
Reviewed By: lavenzg
Differential Revision: D79120823
fbshipit-source-id: 7e2e5ff1ca93397c549e7dd922797fe77aa97940
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53513
D62853299 introduced the `defaultValue` argument to feature flag override functions, with the intent of enabling override functions to do something like this:
```
myFeatureFlag: (defaultValueForFlag) => someCondition ? value : defaultValueForFlag
```
However, there are no current use cases for this. This particular use case can also be solved by expanding support for override functions to return `null` or `undefined` which falls back to using the default value.
Furthermore, the type system has a difficult time representing the constraints when there are non-boolean JavaScript-only overrides (which was introduced recently).
This diff removes the argument and adds support for override functions to return `null` or `undefined`.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81163557
fbshipit-source-id: 38876c83d51d857dbea889928248410041c5d6d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53519
Changelog: [Internal] - Remove empty checks on the target rects and early return for empty ScrollView rects -- aligning the implementation with v1 of VirtualView
Reviewed By: yungsters
Differential Revision: D81247994
fbshipit-source-id: 4fda9f90e18d736944fe4236a4b79f0681e1564c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53518
Changelog: [Internal] - Listen to `onSizeChanged` for VirtualViewExperimental and VirtualViewContainer (ScrollView) and add more debug logs and format the virtualViewID consistently for easier grepping
Reviewed By: yungsters
Differential Revision: D81184013
fbshipit-source-id: a4314ab0f94a87e97a7d9b74696726803525c698
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53512
Noticed a lint for this so decided to change
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D81159958
fbshipit-source-id: c0b4b73055de26ea089e3cdb4edb7f073bd751d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53502
Follows D81138169.
- This simplifies the total changes needed on implementing DevSupport classes.
- Widen outer API to accept any `String` panel name (futureproofing).
- Also add a complete set of supported values `DebuggerFrontendPanelName`.
Changelog:
[Android][Changed] - DevSupport `openDebugger()` methods now accept a `panel: String?` param. Frameworks directly implementing `DevSupportManager` will need to adjust call signatures.
Reviewed By: hoxyq, cortinico
Differential Revision: D81227870
fbshipit-source-id: 57b73703557971332e05076fb4ccac218079652a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53455
All these components have fabric replacements.
Let's deprecate them, so we can remove them eventually.
Changelog: [iOS][Deprecated] Deprecate all the legacy core components that have replacement implementations in fabric.
Reviewed By: cipolleschi
Differential Revision: D80973216
fbshipit-source-id: 2b20da0800f099244b4813abf9d8af175627a445
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53453
Let's deprecate all the classes that aren't used by interop, or the new architecture.
Changelog: [iOS][Deprecated] Deprecate all the objc classes not used by interop, or the new architecture.
Reviewed By: javache
Differential Revision: D80575768
fbshipit-source-id: ad12e4b639c21d608636eedbc7cd502fa9d7f461
Summary:
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/53489
For error
```
Identity-sensitive operation on an instance of value type 'Int?' may cause unexpected behavior or errors.
```
due to https://youtrack.jetbrains.com/issue/KT-78352/
Reviewed By: cortinico
Differential Revision: D81174630
fbshipit-source-id: c68e3a348e75b7bceb183b77a45b2729f1e70bcd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53510
Changelog: [Internal]
Electron imposes a [strange undocumented limitation](https://github.com/electron/electron/pull/13039) on the format of command-line arguments, which for some reason only affects Windows. Basically, the command line is truncated after the first argument that looks like a URL.
Electron's recommendation for avoiding this is to prefix the argument list with `--`, but I prefer switching to a different arg format (`--x=y` instead of `--x y`) that will prevent us from ever running into this issue.
NOTE: I will follow up with a diff to harden arg parsing in our Electron code so that it only accepts the `--x=y` format.
Reviewed By: huntie
Differential Revision: D81237713
fbshipit-source-id: a255dc63b6486b96d9f7ccf780d1b09bc4ddf7e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53504
Casting directly from double to int loses precision. Instead, match the (accidental) behaviour of the folly version, which always access the value as an int64_t first.
```
double value = 4294967040
(int)value = 2147483647 (overflow)
(int)(int64_t)value = -256 (signed version of 4294967040)
```
Changelog: [General][Fixed] Casting rawValue to int was incorrectly truncating
Reviewed By: zeyap, sammy-SC
Differential Revision: D81228983
fbshipit-source-id: d68d4e63d7c7bc9a9226592756a1e53666d58978
Summary:
When aligning Jest versions recently I have spotted that some old Jest (v24) dependencies are still fetched. After looking at lock the traces lead to outdated `jest-junit` dependency.
This PR updates the `jest-junit` package to get rid of those old Jest dependencies. I have went through [the release changelogs](https://github.com/jest-community/jest-junit/releases) to make sure there are no breaking changes with the current setup.
## Changelog:
[INTERNAL][CHANGED] - upgrade `jest-junit` to remove old Jest dependencies from the workspace
Pull Request resolved: https://github.com/facebook/react-native/pull/53444
Test Plan: I have made sure that `test-ci` tests are passing, and correct `junit.xml` is generated locally after the run.
Reviewed By: cortinico, christophpurrer
Differential Revision: D80904710
Pulled By: robhogan
fbshipit-source-id: 9b4c65e2fd370bbdb429fb628f79f94698e9c4c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52672
This was used internally to work around some limitations of the bridge lifecycle. Given that we now have C++ TurboModules which are much more versatile, let's remove unnecessary concepts externally, as we move towards deprecating legacy C++ modules entirely.
Changelog: [General][Breaking] Removed CxxSharedModuleWrapper
Reviewed By: rshest
Differential Revision: D78484221
fbshipit-source-id: 95ed46b597dac55d823b70abe196264ce5b326ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53488
Creates a new feature flag to experiment with `Activity` in `VirtualView`.
The feature flag enables the following treatments:
- `no-activity` is the same as what we currently do — no `Activity` and we render `null` for hidden elements.
- `activity-without-mode` wraps the children in `Activity` but does not set `mode` and still renders `null` for hidden elements.
- `activity-with-hidden-mode` wraps the children in `Activity` and sets `mode="hidden"` and continues providing `children` (not `null`) for hidden elements.
Changelog:
[Internal]
Reviewed By: rickhanlonii
Differential Revision: D81149561
fbshipit-source-id: ea2c319139962de30836d80a2492d8147cbe82ba
Summary:
On iOS, if the default locale is not supported in the app, it will fall back to the first available locale to decide if RTL layout should be enabled or not; however on Android, we use the default locale. So if the first locale is a RTL locale and not supported by the app on Android, the app will fall back to the first available locale which might not be RTL, but the layout would be decided as RTL according to the default locale.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`
Pull Request resolved: https://github.com/facebook/react-native/pull/53417
Test Plan:
I set my phone's locale to this order: Hebrew, English and enabled RTL layout:
```
import { I18nManager } from 'react-native';
I18nManager.allowRTL(true);
I18nManager.swapLeftAndRightInRTL(true);
```
Prior to my PR, the app would use RTL layout with English on Android which doesn't make much sense (iOS is LTR + English). With my PR Android app will behave exactly the same as the iOS app.
Reviewed By: rshest
Differential Revision: D80821903
Pulled By: zeyap
fbshipit-source-id: c1bd9b45341c344833a8fdfacc2c786ee8437415
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53480
Changelog: [Internal]
Improves the way `--version` and the User-Agent header work in `debugger-shell`.
* The same app name and version string format will be used across the `dev` and `prebuilt` flavours. Previously, `dev` would report itself as being `Electron v37.2.6` while `prebuilt` would report `react-native/debugger-shell v0.82.0-main`.
* `prebuilt` now also reports the original Meta-internal commit hash as a suffix `-rFBS..........` added to the semver string taken from `package.json`, while `dev` will have a `-dev` suffix in the same place.
* We do **not** modify the version in `package.json` during the build, nor do we pass the commit hash to `electron/packager`, because this would impose inconvenient platform-specific restrictions on the version string's format.
Reviewed By: huntie
Differential Revision: D81120181
fbshipit-source-id: e730dd35da78dfbb8de326f9a3ab76b747fdb0b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53481
Small fix to this RNTester example to clean up hanging `setInterval` side effect making repeat network fetches.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D81127809
fbshipit-source-id: 6036dd254888eb6160d2b1e116bbce63e5fd9328
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53368
This change introduces deprecation messages for several APIs used by the legacy arch in the RCTAppDelegate Library
## Changelog:
[iOS][Added] - Add deprecation message for RCTAppdelegate APIs
Reviewed By: cortinico
Differential Revision: D80618102
fbshipit-source-id: db77f8602a521557ed26822f27d54c6fc70c49bf
Summary:
To be able to handle cocoapods USE_FRAMEWORKS with both dynamic/static linkage and precompiled we needed a common way to resolve this.
The issue was that when using precompiled and USE_FRAMEWORKS our precompiled framework caused the resulting Pods project to only include header files - hence there where no need to change the header_mappings_dir which a lot of the podspecs did.
When using precompiled and building with frameworks (USE_FRAMEWORKS) we need to explicitly add the correct path to ReactCodegen when calling `create_header_search_path_for_frameworks` to ensure libraries can access their codegen files.
- Added method that handles this in a generic way
- Replaced logic for resolving header mappings and module name using the new method `resolve_use_frameworks` in all podspecs.
- Add an explicit check to make sure we add the correct path when using frameworks and the pod is ReactCodegen.
- Added includes in the NativeCXXModuleExample.cpp file to test this.
## Changelog:
[IOS] [FIXED] - Fixed using USE_FRAMEWORKS (static/dynamic) with precompiled binaries
Pull Request resolved: https://github.com/facebook/react-native/pull/53432
Test Plan:
Build RN-Tester with USE_FRAMEWORKS static and dynamic
### Tests ran:
✅ Build with source and no USE_FRAMEWORKS
✅ Build with source and USE_FRAMEWORKS = static
🔴 Build with source and USE_FRAMEWORKS = dynamic
Undefined symbols for architecture arm64:
"facebook::react::oscompat::getCurrentProcessId()", referenced from:
Reviewed By: motiz88
Differential Revision: D81127796
Pulled By: cipolleschi
fbshipit-source-id: 1f55bf31240ac93cb8b93751b3e37ff6d517f49b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53476
## Changelog:
[General] [Added] - allow calling createAnimatedNode without batching
Enable setting `nativeCreateUnbatched` config on an AnimatedNode, when it's true, the call to Animated nativeModule's createAnimatedNode will skip signal batching (will call over JSI before React rendering is finished) and batching in c++, and the creation will be executed at next UI thread render.
This will only make AnimatedNodes creation happen early, but node/view connections, node deletion or event drivers will still be batched like before
Reviewed By: yungsters
Differential Revision: D80968512
fbshipit-source-id: afb607410a174fb85107ef270b9d6f3d61617daf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53472
changelog: [internal]
I am looking into stalls when View Culling is turned on together with immediate state updates. This is one of the places where stalls are concentrated and this seems like a possible culprit:
When view is moved outside of the viewport, it is immediately reused. Therefore, we must check view's identity to make sure it is the same view before and after transaction.
Reviewed By: lenaic
Differential Revision: D81044328
fbshipit-source-id: 796b71219e5fc94c1f98319b73f4655b9c13000f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53464
Changelog: [Internal]
Minor followup from D78351937 - the Fusebox console notice still mentions that RNDT requires Chrome or Edge. Let's remove this mention for users opted into the standalone shell experiment.
Reviewed By: huntie
Differential Revision: D81040965
fbshipit-source-id: a290d3164261f8a1087229edfe3f69a2a9b49960
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53435
Changelog: [Internal] Support setting `enableStandaloneFuseboxShell: true` in OSS with no custom `BrowserLauncher`
Makes it possible for frameworks to enable the React Native DevTools standalone shell in open source by passing `unstable_experiments: {enableStandaloneFuseboxShell: true}` to `createDevMiddleware()`.
When this experiment is enabled:
* The RNDT shell binary will be prefetched in the background as soon as the dev server starts (into a local cache managed by [DotSlash](https://dotslash-cli.com/)).
* If prefetching is successful, then "Open DevTools" actions will be handled by launching the RNDT frontend in the standalone shell, instead of in Chrome/Edge.
* If prefetching is not successful, then we'll notify the user about the error, and "Open DevTools" will continue to be handled by Chrome/Edge, as before.
* If the user attempts to open DevTools more than once for the same app, the standalone shell will reuse the existing window (as opposed to the current behaviour of always creating a new Chrome/Edge window).
* The appropriate DevTools window will automatically foreground itself upon pausing on a breakpoint.
Reviewed By: huntie
Differential Revision: D78351937
fbshipit-source-id: 6d5baa8fa866760f1d527108cd3c42bcab68cf57
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53438
Changelog: [Internal]
Makes `flavor: 'prebuilt'` the default mode of launching the RNDT standalone shell, and the *only* mode supported in the published version of the package. See D78351931 for more context.
With this, we can demote `electron` from `dependencies` to `devDependencies`. This makes it possible to make `debugger-shell` a dependency of `dev-middleware` (and thus of all major frameworks) without significantly impacting `npm install` times. We'll add this dependency on `debugger-shell` in an upcoming diff (D78351937).
We also stop publishing the `dist/electron` subdirectory (and `src/electron` for good measure) since the corresponding code will always be bundled into the prebuilt binary instead.
Reviewed By: huntie
Differential Revision: D78351934
fbshipit-source-id: 2a4b03e852c4d0330250567c41dca09d1c4f3abd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53437
Changelog: [Internal]
The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff adds support in dev-middleware for a new `BrowserLauncher.unstable_prepareFuseboxShell` method that integrations can use to kick off the download early. Integrations are expected to implement this by calling the `unstable_prepareDebuggerShell` function (added to the `debugger-shell` package in D78413091).
If `BrowserLauncher.unstable_prepareFuseboxShell` returns an error, dev-middleware will fall back to the browser-based launch flow, even for users opted into the `enableStandaloneFuseboxShell` experiment.
Reviewed By: huntie
Differential Revision: D78413092
fbshipit-source-id: 6868bf07e16353fcd83337ae54c87c5a641a0f99
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53434
Changelog: [Internal]
The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff gives integrations a mechanism for kicking off the download early (but without slowing down `npm install react-native`). This will be integrated into dev-middleware in an upcoming diff.
Reviewed By: huntie
Differential Revision: D78413091
fbshipit-source-id: caf2010edd1bcdd139d37d7849212cd1cbb64f46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53436
Changelog: [Internal]
Adds a `flavor` option to `unstable_spawnDebuggerShellWithArgs` to select between two modes:
1. `flavor: 'dev'` (current behaviour) - launching a stock Electron binary (from the `electron` package) and pointing it directly at the shell code from the `src/electron` directory.
2. `flavor: 'prebuilt'` (new in this diff) - launching the prebuilt React Native DevTools binary included in the package (built continuously at Meta and committed as a DotSlash file in automated diffs e.g. D79836825). Note that this binary includes Electron *and* a frozen version of the shell code from `src/electron`.
Going forward, `'dev'` will only be used when developing the package (e.g. in D78351934 we will move `electron` to `devDependencies`). The published version of the package is only intended to work with `flavor: 'prebuilt'`.
Reviewed By: huntie
Differential Revision: D78351931
fbshipit-source-id: d0e66b54c142dc2910619ba3d6d149d88324c872
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53468
# Changelog: [Internal]
I've just discovered today that Chrome DevTools has a native support for `panel` query parameter, we don't need a custom one.
Reviewed By: alanleedev
Differential Revision: D81052828
fbshipit-source-id: 6f8ef5b576dbff70cabd6ab792bc0f6e615928e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53465
changelog: [internal]
I am debugging an issue with Fabric View Culling + immediate state update.
The problem appears to be in logic handling `maintainVisibleContentPosition`. I want to try to disable the prop to see if the problem goes away.
Reviewed By: rshest
Differential Revision: D81030436
fbshipit-source-id: 8efeb1151ad3e12b812cafd073348502510ef01d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53466
This is a follow-up on D80631997. When enabling View Culling on Android, wrapped Text components would lead to event handlers set by the inner Text component not being set on the attributed string.
```
<Paragraph>
<Text onPress={myHandler}> <- This handler is not set
<RawText/>
</Text>
</Paragraph>
```
This was due to the inner Text component having no size and hence being culled by the View Culling algorithm.
This diff disables view culling for views having no size, since no layout means no valid decision can be made as to the visibility of the component within the viewport.
It also removes the change made by D80631997. This means Text views with a layout size set can be culled again.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81044841
fbshipit-source-id: e9b01dcb8030b271876329b9b2c5bda36ba2b87a
Summary:
XCode 26 introduces building explicit swift modules turned on (SWIFT_ENABLE_EXPLICIT_MODULES). This breaks building with precompiled binaries.
This commit fixes this by adding a step when not building from source where we explicitly set the `SWIFT_ENABLE_EXPLICIT_MODULES` flag to `NO`.
## Changelog:
[IOS] [FIXED] - Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26
Pull Request resolved: https://github.com/facebook/react-native/pull/53457
Test Plan:
```bash
npx react-native-community/cli init MyApp --version nightly --skip-install
cd MyApp
yarn
cd ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```
Build above app with Xcode 26 and verify that it no longer fails
Reviewed By: motiz88
Differential Revision: D81025367
Pulled By: cipolleschi
fbshipit-source-id: 1db7c4d7de07d62f43b355aa784d7d9de478023c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53345
Changelog: [Internal] - Introduce hysteresis window that is nested between the prerender and hidden window sizes. Currently set to enlargening the prerender window by hysteresis ratio
When a VirtualView intersects with the hysteresis window, it mode remains unchanged.
This prevents us dispatch mode changes for things like overscroll.
I put the hysteresis between prerender and hidden because we already avoid dispatching mode changes from visible -> prerender. For prerender -> visible, we use renderState
Reviewed By: yungsters
Differential Revision: D80511627
fbshipit-source-id: cd14256abc898e7120705e277147d52a06c865a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53424
Use the namespaced version of these macros to avoid symbol conflicts when multiple instances of `PERFETTO_DEFINE_CATEGORIES` are in the same binary.
The current macro is effectively deprecated: https://github.com/a6f/perfetto_protos/blob/master/CHANGELOG#L691-L696
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D80697205
fbshipit-source-id: 713fec4d41137ddd2f025c7e7130dc44c5a3a656
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53426
Experiment review for this was completed internally, and we can now change the default behaviour to no longer allocate an intermediate folly::dynamic when parsing props.
RawValue will continue supporting a folly::dynamic constructor as some paths go through code path (eg animations)
There should be no user-visible difference in parsing behaviour.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D80799833
fbshipit-source-id: 8eeae656157757eb38f69a2af14409da23b510c8
Summary:
The `react-native/metro-config` peer was added in https://github.com/facebook/react-native/commit/fe2bcbf4ba7ce983fac0cd09727c165517b6337f / https://github.com/facebook/react-native/issues/51836 by robhogan
Side-note: It's pulled in via `react-native/community-cli-plugin` which is a direct dependency of `react-native` for the `scripts/bundle.js` script. While, for expo, we'd love to find a way to make this an optional dependency (to avoid excessive deps that `expo` replaces otherwise), for now, it's a direct dependency.
The problem here is that this isn't optional, which means:
- with auto-installing peer dependencies it is directly fulfilled (while `react-native-community/cli` is already marked as optional and skipped)
- with legacy/non-auto peer-dependencies it is flagged as missing, but in an Expo project it wouldn't make sense to install directly
This causes a **package manager regression in the form of either a peer dependency warning**, that shouldn't be fulfilled in an Expo project, or (in the best case scenario) pulls in dependencies [that a user does not need](https://npmgraph.js.org/?q=%40react-native%2Fmetro-config#zoom=w&select=exact%3A%40react-native%2Fmetro-config%400.81.0).
An error message is already in place to inform the user of this being missing when it's not installed, so marking it as optional seems appropriate.
## Changelog:
[INTERNAL] [FIXED] Mark added `react-native/metro-config` peer dependency as optional
<!-- 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/53314
Test Plan:
Warnings like the following won't occur in fresh Expo (54/preview/`next`) projects
```
warning "workspace-aggregator-484d9ec3-587b-43cb-97de-4dcce3876578 > microfoam-mobile > react-native > react-native/community-cli-plugin@0.81.0" has unmet peer dependency "react-native/metro-config@*".
```
Reviewed By: cortinico
Differential Revision: D80450287
Pulled By: robhogan
fbshipit-source-id: c622fd4c24025676c0ec74de826f863f1e291669
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53395
# Changelog
[Internal] -
This enables view recycling for both ScrollView and HorizontalScrollView on Android.
The feature is gated by the corresponding RN feature flag, `enableViewRecyclingForScrollView` (which is false by default for now, will be enabled in an experiment).
Reviewed By: lenaic
Differential Revision: D80611087
fbshipit-source-id: b3026affc0ea61bc7739126d6529c83f2a653183
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53403
This code is Legacy and totally unused. It should be safe to remove it altogether.
This class is public but no one is using it in OSS + no one should be using it, so I don't think we'll need the full deprecation cycle for it.
Changelog:
[Android] [Removed] - Removed unused `Inspector` public class from React Android
Reviewed By: cipolleschi
Differential Revision: D80711515
fbshipit-source-id: 83134851877fcbccd50f7a5b75b2ab8906b3416a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53420
# Changelog: [Internal]
HostRuntimeBinding owns a connection, which is stored as a session on HostTarget, so we need to release it first in order to satifsy the assertion in the destructor.
Reviewed By: huntie
Differential Revision: D80778273
fbshipit-source-id: be7bf085fadd8808fd5e5c621c3990a5e7e0186d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53416
# Changelog: [Internal]
Creates methods on Bridgeless Android Host for starting / stopping tracing and implements logic for storing the recording that will be transferred to `jsinspector-modern` stack via HostTargetDelegate when CDP session is created.
Reviewed By: sbuggay
Differential Revision: D79725161
fbshipit-source-id: f3e3b39f6d94a6548cf227394f7328f6913c33e4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53078
# Changelog: [Internal]
When CDP session is created via `HostTarget::connect`, it will ask `HostTargetDelegate` is there is a previously recorded trace that Host wants to display in the Frontend.
`TracingAgent` will serialize and send the recording at the initialization time in constructor.
Reviewed By: huntie
Differential Revision: D79672597
fbshipit-source-id: 241c9d367ab65ef1e95c62d5025b3bc14bf42608
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53407
Changelog: [Internal]
## Context
Upon receiving a launch command, the RNDT shell either:
1. Creates a new window and navigates to the requested frontend URL.
2. Brings an existing window to the foreground *with no further navigation*.
In the happy path, (2) is a pretty nice experience: it preserves all prior UI state in the frontend and leaves the user with an instantly responsive debugger - this can be quite a bit faster than (1) because of the overhead of loading and parsing source maps for example. However, this breaks down if the frontend is not in a usable state to begin with. This is, sadly, a frequent-enough occurrence that we must account for it: the CDP connection may have been lost, the frontend app itself might have failed to load the last time, etc.
Preserving everything that's nice about (2) while also making it fully reliable - incrementally bringing the frontend to the state specified by a new URL - would require delicate engineering across the shell and frontend codebases, which is an amount of complexity I would like to sidestep for now.
NOTE: The more complex solution **is 100% worth implementing in the long term,** as it has tangible benefits for the user, and matches Chrome best.
## This diff
Here we take a much cheaper approach than the one described above: the shell will *always* initiate navigation to the new frontend URL, regardless of whether it does so in a new window or a previously opened one. This will consistently bring the user to a state where the frontend is open and working (although it will reset any ephemeral UI state in the process, and typically take a noticeable amount of time to load).
Even with this simplified approach, the standalone shell still offers a better experience than launching in a browser (if only because it is zero-install and avoids the "dead tab spam" problem).
Reviewed By: huntie
Differential Revision: D80711185
fbshipit-source-id: 8f376ccf1717c48a1742c798da3171ac6d2f8af0
Summary:
Symbol files wasn't copied correctly when building - as with bundles we did overwrite the files and ended up with only the last symbol file.
This commit fixes this by mapping the framework build folder architecture type to the xcframework slices creating the correct file structure under the Symbols folder.
- Each slice gets a folder with the architecture name under Symbols containing the dSym folder for that slice
- Refactored getting correct architecture folder into a separate function.
- Refactored target folder lookup in copyBundles
- Removed unused async modifier on function
## Changelog:
[IOS] [FIXED] - Fixed how we copy and build the Symbols folder when precompiling ReactNativeDependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/53353
Test Plan: Run nightlies and verify that ReactNativeDependencies.framework.dSym files contains symbol files for all architectures.
Reviewed By: cortinico
Differential Revision: D80692019
Pulled By: cipolleschi
fbshipit-source-id: 77983bc29d1965edf3bc0fcbd9cb3177071991d3
Summary:
After fixing an isssue with ReactnativeDependencies and how it built symbols (https://github.com/facebook/react-native/issues/53353) this commit will align the output of the Symbols folder for the two frameworks.
Previously we had an output in the Symbols folder that looked like this (from a local build on my machine)
- catalyst
- iphone
- iphonesimulator
After this we now have the more correct arcitecture names on these folders:
- ios-arm64
- ios-arm64_x86_64-simulator
- ios-arm64_x86_64-maccatalyst
This is in line with how the ReactNativeDependencies Symbol folder is set up.
## Changelog:
[IOS] [FIXED] - Aligned Symbols folder in React.xcframework symbols with ReactNativeDependencies.xcframework symbols.
Pull Request resolved: https://github.com/facebook/react-native/pull/53354
Test Plan: Nightlies
Reviewed By: cortinico
Differential Revision: D80692098
Pulled By: cipolleschi
fbshipit-source-id: e952b087d5dbdeb929b45d9e6d3d7e077c9d05cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53400
In D79329081, we accidentally hardcoded the `landingView` parameter in the default Dev Menu handler to open React Native DevTools. Reset this.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D80710487
fbshipit-source-id: 9066ffafcb17a6ff46650f7081d9a662f186d995
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53394
# Changelog:
[Internal] -
This just fixes a linter warning I noticed when working on related code.
Reviewed By: cortinico
Differential Revision: D80702545
fbshipit-source-id: fecfed9e9946b971864706306b03b57cd3111aee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52911
Add a new `deleteProperty` API to JSI. As the name implies, allows users
to delete properties from Objects through JSI.
The default implementation uses `Reflect.deleteProperty.` For the
`PropNameID` overload, convert the propNameID to a String and pass into
the `deleteProperty` function.
Changelog: [Internal]
Reviewed By: dannysu
Differential Revision: D79120814
fbshipit-source-id: e30f383247d94bb5971e4909f004c75e8165adda
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53412
Changelog:
[General][Internal] - Encapsulated internal class into anonymous namespace to ensure no collisions with public symbols.
Differential Revision: D80689084
fbshipit-source-id: 53ebd8a16a3c217efead0bfe91f66bd50bb6dd2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53411
# Changelog: [Internal]
This regressed after D80263154, when we introduced a local struct for PerforamanceTracerEvent.
We should use id of the thread where event was captured (registered), not where the transform to TraceEvent happened.
This makes sure that events like Event Loop tick or Microtasks phase tick are correctly point to JavaScript thread, not the thread where the transform could've taken place.
Reviewed By: sbuggay
Differential Revision: D80728931
fbshipit-source-id: d3af16e68adece9ebc37368fec2b8a17c1293b4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53409
This interface is public and is part of Legacy Architecture.
Having this interface as `public` was a mistake, as users can't really do much with it.
There is only one old library that is going to be affected by this change:
https://github.com/spoke-ph/react-native-threads
The library appears unmaintained since RN 0.69 + no NewArch support so I won't consider this a breaking change
given this will land in 0.82.
I'm making it internal so we can remove it more easily later.
Changelog:
[Android] [Changed] - Make OnBatchCompleteListener interface internal
Differential Revision: D80715625
fbshipit-source-id: 94fe80eeba95222deab7ca89c5fcafca8fcee0b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53404
This interface is part of Legacy Architecture. No one is using it either internally or externally,
so it's safe to remove now. Interface was also `internal` so this is not a breaking change.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80714721
fbshipit-source-id: 82cc6152af7d7980119d2eda704ae50d8e81fd2b
Summary:
Changelog: [GENERAL] [FIXED] - Fixed babel plugin validation error when coverage instrumentation is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/53381
### Problem
[Workplace post](https://fb.workplace.com/groups/235694244595999/permalink/1278937163605030/)
React Native tests were failing **only when coverage collection was enabled** with the error:
`'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.`
### Root Cause
The React Native Babel plugin's `codegenNativeCommands` validation logic only handled direct `CallExpression` AST nodes. When coverage instrumentation was enabled, it transformed:
**Normal code:**
`export const Commands = codegenNativeCommands<NativeCommands>({...})`
**With coverage:**
`export const Commands = (cov_xxx().s[0]++, codegenNativeCommands<NativeCommands>({...}))`
The plugin failed to recognize the valid `codegenNativeCommands` call wrapped in a `SequenceExpression` by coverage instrumentation.
### **Solution**
Added `isCodegenNativeCommandsDeclaration` function to handle:
1. **Coverage instrumentation**: `SequenceExpression` nodes containing the function call
2. **Flow type casts**: `TypeCastExpression` and `AsExpression`
3. **TypeScript assertions**: `TSAsExpression`
4. **Direct calls**: Original `CallExpression` (backward compatibility)
Reviewed By: andrewdacenko
Differential Revision: D80572666
fbshipit-source-id: 465f4312a0229d8a92e495c685f46b607ce326e4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53399
We currently create application template that are still using `ReactNativeHost`.
As this is a legacy arch class, we should remove it from the template ASAP so that
users can organically migrate away from it.
I will also update https://github.com/react-native-community/template with
the same changes I'm applying here.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80708461
fbshipit-source-id: e0d4a1f817e6fdddd93405decf77fd115956ec51
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53398
ReactNativeHost is a legacy architecture class.
This migrates the app away from it and converts it to use DefaultReactHost instead.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80708460
fbshipit-source-id: 7d88c440414c979a2968fc9c910e828f5851195c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53396
This overload for `getDefaultReactHost` is missing the last 2 parameters
and provides the same default as the full method.
In OSS is unused as we used the one with `ReactNativeHost`.
I'm removing it as it's causing an overload resolution failure internally.
This won't be a breaking change for Kotlin users are the signatures are compatibles,
but it will be breaking for Java users. I've verified that there are no OSS users.
Developers should use Kotlin default parameters + the method `getDefaultReactHost()`
with all the params + defaults for ease of use of this API.
Changelog:
[Android] [Removed] - Delete unused `DefaultReactHost.getDefaultReactHost()` overload
Reviewed By: mdvacca
Differential Revision: D80704987
fbshipit-source-id: 0b3a61aad3f18cde77bac78e3ba413d7f9166ede
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53406
The `ReactNativeJNISoLoader` class (previously called BridgeSoLoader)
is actually a Legacy Architecture class.
However is used by `CxxModuleWrapperBase` which is needed by interop, so we need to keep it around.
I'm adding the annotation so we won't forget about it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80710951
fbshipit-source-id: ed353e2b14c742b25962f0b81beba6dc90157709
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53408
This class is internal + legacy arch so can safely be removed now.
I've replaced the throw/catch site with the superclass of this exception.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80710950
fbshipit-source-id: 96615835588ce409de40d31ee83b82c88d3a07a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53372
We verified that those feature flags are not regressing the experience + we got confirmation from Software Mansion that the fix
is effectively mitigating the regression on Android mounting.
Hence we can ship this to production.
Fixes: https://github.com/facebook/react-native/issues/51869
Changelog:
[Android] [Fixed] - Fix mounting is very slow on Android by shipping native transform optimizations
Reviewed By: javache
Differential Revision: D80624739
fbshipit-source-id: 2e185434f08b5ea0339d59a6ea006017e5abeff2
Summary:
This is a reland of D80622058 + D80623826 + fixes for all the apps.
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.
bypass-github-export-checks
Changelog:
[Internal] - Skipping changelog as main already contains a changelog entry
Reviewed By: javache
Differential Revision: D80704320
fbshipit-source-id: c9aa26b83dbd9f4bf97d0a9e9c6dcaa6eb0afdca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53391
Changelog: [internal]
Some mount items dispatched to Fabric don't have an associated surface ID (they use -1), which causes some log spam when we try to validate that the surface ID exist when we report mount for those surfaces.
This checks if the surface ID has a valid surface ID before adding it to the list of surfaces to report mount.
Reviewed By: rshest
Differential Revision: D80698363
fbshipit-source-id: 63dc13d53b8bbc2742171b1f444c80ce867e2351
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53387
This interface was internal and legacy arch only, so it can safely be removed.
I've also removed the logic inside `ReactInstanceManager` that was using it as no longer necessary.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80626639
fbshipit-source-id: b173e71b92e29cebbfc5ed589e01ac295eda2bf0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53388
This method is deprecated and should not be invoked in NewArch, therefore I'm deprecating it now.
Changelog:
[Android] [Deprecated] - Deprecate `BridgelessReactContext.getCatalystInstance()` method
Reviewed By: cipolleschi
Differential Revision: D80626638
fbshipit-source-id: d4ed26021c376f54c732154c153bf60fea2bf5e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53384
Occasionally, the `preparePrefab` task might run before other tasks that
are responsible of populating the 3p headers, such as `prepareNative3pDependencies`.
This was evident in the latest nightly which is missing the fast_float headers in the
Android prefab.
Adding a dependsOn fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80695212
fbshipit-source-id: 6e0dd17e5cf8c33d14812e5cb8fdc8b800897816
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53374
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated getDefaultReactHost() method.
Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2
Reviewed By: mdvacca
Differential Revision: D80623826
fbshipit-source-id: f201e99f7cd437a47919c36eced5637481151822
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53371
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.
Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1
Reviewed By: mdvacca
Differential Revision: D80622058
fbshipit-source-id: 4667683be151bc7ef1926a21306e088185695369
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53349
Follows feedback on D78904767, refactoring how we pass data to `PerfMonitorOverlayViewManager` to avoid API additions on `DevSupport`.
New interfaces under `com.facebook.react.devsupport.perfmonitor`:
- `PerfMonitorUpdateListener` is implemented by the view class to receive updates from the C++ `HostTargetDelegate`.
- `PerfMonitorInspectorTargetBinding` exposes an API on `ReactHostInspectorTarget` to send CDP actions down to C++ (stub for now).
- `PerfMonitorDevHelper` allows us to use the internal `ReactHostImplDevHelper` to expose the `ReactHostInspectorTarget` instance from the runtime.
Changelog: [Internal]
Reviewed By: cortinico, rshest
Differential Revision: D80464093
fbshipit-source-id: b88e270c0211e4adf52c015ac700df7f44945a5a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53297
Pivots our display metric for the V2 Perf Monitor experiment by switching to Long Tasks.
- Implements a new "__ReactNative__LongTask" metrics event (note: prefixed, since this sits outside the Web Vitals spec).
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79556595
fbshipit-source-id: 239cf44884f67bf62295b92e2262ae1811d17e4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53376
When encountering embedded <Text> components, with the parent <Text> component setting event handlers, culling away the child <Text> components will break the assignment of the event handlers to the text spans on Android.
This diff disables view culling on <Text> components so that event handlers would be correctly assigned to the text fragments once rendered.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D80631997
fbshipit-source-id: f835a249fef1b448b884999ccd75ee06041eca70
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53375
We have seen sufficient internal signal to be confident that we can move this to the experimental release channel. Soon I will publish some experimental documentation and let folks in OSS know about this.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D80560366
fbshipit-source-id: 6a8cce39f823dfa313c8c51090eb88c31f1f9fd3
Summary:
E2E tests on iOS started failing yesterday because of some permission model that has changed in Github.
When creating a new app from the template, we initialize a git repository. The initialization started failing with the error:
```
debug Could not create an empty Git repository, error: , Error: Command failed with exit code 128: git commit -m Initial commit
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'runner@sat12-jr314_3f88162a-0f3d-4d26-80dc-58f431cca4c6-9A2607311B51.(none)')
```
This change fixes it by setting a default identity for git in the CI jobs that requires it.
## Changelog:
[Internal] -
Pull Request resolved: https://github.com/facebook/react-native/pull/53357
Test Plan: GHA
Reviewed By: cortinico
Differential Revision: D80612345
Pulled By: cipolleschi
fbshipit-source-id: 85816057d910ed3619c5f683fdad724c3df8046b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53362
Changelog: [internal]
This just replaces the polyfills for `Event` and `EventTarget` that we're defining inline in Fantom with the implementations that already exist in RN.
Reviewed By: javache
Differential Revision: D80612067
fbshipit-source-id: 047c8f12cbb1f4afea2d05a5a1235d9dff2e25f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53359
A new version of ktfmt broke the OSS CI build for React Native.
That's due to us running still on the older version of ktfmt, as the newer version hasn't been released yet.
I'm temporarly disabling the `ktfmtCheck` jobs because we primarly check formatting from within fbsource.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80610450
fbshipit-source-id: 846249780f979788356404205d8b8e37fc54a255
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53150
ReactInstanceManager and ReactInstanceManagerBuilder are legacy architecture classes that will be deleted in the future, in this diff we are deprecating them
changelog: [Android][Changed] Deprecate legacy architecture classes ReactInstanceManager and ReactInstanceManagerBuilder, these classes will be deleted in a future release
Reviewed By: mlord93
Differential Revision: D79677828
fbshipit-source-id: 2d79736d94a55e44dd24056985f358e3650ddf6c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53331
Changelog: [internal]
This change was shipped 3 months ago so we can assume the native method will always have this method and don't need to keep backwards compatibility.
Reviewed By: rshest
Differential Revision: D80449031
fbshipit-source-id: 4ff11b81478701ad712b4e097625e569829f6480
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53330
Changelog: [internal]
These methods have been defined for a month, so it's safe to make then non-nullable already.
Reviewed By: GijsWeterings
Differential Revision: D80453413
fbshipit-source-id: 3fde076622dc9d510bad144300364401f2319507
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53318
Changelog: [internal]
This prepares the codebase for an eventual migration of `HostInstance` to `ReactNativeElement`, so the actual migration doesn't need to adjust so much existing code.
Reviewed By: rshest
Differential Revision: D80399739
fbshipit-source-id: 441d3e92ef6dff253343d1058b2027698e8ecb22
Summary:
When copying bundle files from the platform folders in the .build output, the script had a bug where all bundles were copied - meaning that only the last one would be in the resulting xcframework output.
This caused an issue when we tried to publish an app built with precompiled binaries to AppStore where the field `CFBundleSupportedPlatforms` was wrong and caused the submission to be rejected. This was caused by the script copying the wrong bundle file into the final xcframework outputs.
This issue is described here:
https://github.com/react-native-community/discussions-and-proposals/discussions/923#discussioncomment-14089245
This commit fixes the above error by using the iOS 15 `vtool` to show the actual platform for a given framework and then making sure we don't copy bundles in the wrong way.
Testing this on my local machine for iOS/iOS-simulator/MacOS/catalyst yields the following results (before/after this fix):
**Before:**
```bash
Copying bundles to the framework...
../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64
../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64
../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64
../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
```
**After:**
```bash
Copying bundles to the framework...
../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
```
## Changelog:
[IOS] [FIXED] - Fixed copying bundles correctly to xcframeworks when precompiling ReactNativeDependencies.xcframework
Pull Request resolved: https://github.com/facebook/react-native/pull/53325
Test Plan: Ensure that the info.plist files in the nightlies for the ReactNativeDepdendencies.xcframework has the correct bundles for its targets.
Reviewed By: andrewdacenko
Differential Revision: D80457335
Pulled By: cipolleschi
fbshipit-source-id: aeb4166f66218f72bdd29b6fc579fcc7b6d12844
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53304
The headers from `react_performance_cdpmetrics` are currently missing in the libreactnative.so prefab.
They're actually references from `Scheduler.h` and this is causing `react-native-screens` to fail compiling
with:
```
In file included from /tmp/RNApp/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:3:
/home/runner/.gradle/caches/8.14.3/transforms/97716233b9aa00728d9cac038eecaf3d/transformed/react-android-0.82.0-nightly-20250815-41029d8e9-SNAPSHOT-debug/prefab/modules/reactnative/include/react/renderer/scheduler/Scheduler.h:13:10: fatal error: 'react/performance/cdpmetrics/CdpMetricsReporter.h' file not found
13 | #include <react/performance/cdpmetrics/CdpMetricsReporter.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[4/6] Building CXX object CMakeFiles/rnscreens.dir/tmp/RNApp/node_modules/react-native-screens/cpp/RNSScreenRemovalListener.cpp.o
[5/6] Building CXX object CMakeFiles/rnscreens.dir/src/main/cpp/OnLoad.cpp.o
```
See here https://github.com/react-native-community/nightly-tests/actions/runs/16991637594/job/48172255960
I saw this was added on D78904748
Here I'm exposing the headers from `react_performance_cdpmetrics` to the prefab API so users in OSS can
access those headers as well.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80344762
fbshipit-source-id: 29b09b94370b71a16ecf12d4cca9cd571c588e5c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53339
Changelog: [Internal] - onSizeChanged can be called independent of onLayoutChange. Right now this hasn't affeced anything because VirtualViews are visible by default.
Reviewed By: yungsters
Differential Revision: D80357397
fbshipit-source-id: 06b174791dec0d19da6bbe1a8144d35b93b8f6c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53189
In addition to the menu button and long pressing fast forward option, adds long pressing back as an option to open DevTools for devices like the Chromecast remote.
Changelog:
[Android][Added] - Add long-press back as an option to open the DevMenu for devices that lack menu & fast-forward.
{F1981060943}
Reviewed By: alanleedev
Differential Revision: D79923779
fbshipit-source-id: b758d591ebe3b8e601dbf704212123451e3c32e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53336
No longer needed as bridgeless is enabled everywhere.
Changelog:
[iOS][Deprecated] Remove bridge mode title and description from React Native Dev Menu title
Reviewed By: christophpurrer
Differential Revision: D80457504
fbshipit-source-id: bf21e44ed925f4777d0190313c6e4aad774abe42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53335
No longer needed as bridgeless is enabled everywhere.
Changelog:
[Android][Deprecated] Remove bridge mode string from React Native Dev Menu title
Reviewed By: christophpurrer
Differential Revision: D80457625
fbshipit-source-id: 4cf602a90f29d5495a5e8a4ccaf49abb96e85f94
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52947
Wires up a `landingView` parameter to be passed to rn_fusebox.html that we can use to focus an arbitrary view on launch. Used from the new perf analyze scenario to open devtools on the performance panel.
Changelog:
[Android][Added] - Adds a landing view parameter to opening RNDT, enabling arbitrary view focus on launch.
Reviewed By: hoxyq
Differential Revision: D79329081
fbshipit-source-id: b1513a803f4add803100cebd08f53e59a08e64d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53319
Changelog: [internal]
We have a microbenchmark for `ReactFabricHostComponent` vs. `ReactNativeElement` but the test code itself is so fast that a big part of its duration is just calling the test function (a noop is 300-500ns, while the duration of these benchmarks is between 800 and 1400ns).
Note that this affects all tests the same way, so the absolute difference in execution time in both tests was still accurate.
This changes how we execute the benchmarks so the test function runs the code under test multiple times and we then report the average of all the runs using the new `overriddenDuration` option.
Before:
| (index) | Task name | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0 | 'noop' | '353.83 ± 0.03%' | '350.00 ± 10.00' | '2856842 ± 0.01%' | '2857143 ± 84034' | 2826221 |
| 1 | 'ReactNativeElement' | '1393.8 ± 1.15%' | '1332.0 ± 20.00' | '745853 ± 0.01%' | '750751 ± 11444' | 717480 |
| 2 | 'ReactFabricHostComponent' | '884.92 ± 0.59%' | '871.00 ± 21.00' | '1144283 ± 0.01%' | '1148106 ± 27029' | 1130046 |
After:
| (index) | Task name | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0 | 'noop' | '400.11 ± 0.30%' | '391.00 ± 10.00' | '2532882 ± 0.07%' | '2557545 ± 67127' | 50000 |
| 1 | 'ReactNativeElement' | '868.04 ± 0.04%' | '859.39 ± 4.41' | '1153974 ± 0.03%' | '1163616 ± 6002' | 50000 |
| 2 | 'ReactFabricHostComponent' | '388.79 ± 0.08%' | '384.18 ± 1.91' | '2579763 ± 0.03%' | '2602947 ± 13006' | 50000 |
Reviewed By: rshest
Differential Revision: D80404122
fbshipit-source-id: 7dc6ad34b2e8aa3cb6d62008f97d1c44e325ab27
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53320
Changelog: [internal]
This improves the defaults the options related to minimum number of iterations and test duration in benchmarks.
If you indicate a minimum duration, we set the minimum number of iterations so the duration is honored. We do the same if what's specified is the number of iterations.
This is useful when you want to make sure all the tests in a benchmark suite use the same number of iterations without having to explicitly set the time to 0 in all of them.
It also changes the default for warmup iterations to be just 1 (that's enough to load all modules and all the code into memory).
Reviewed By: rshest
Differential Revision: D80405287
fbshipit-source-id: 41a61c4d1979db6a25dd30f0c84b5de319416885
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53321
Changelog: [internal]
Just a rename to make it easier to understand.
Reviewed By: rshest
Differential Revision: D80404378
fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53322
Changelog: [internal]
This changes the types for benchmark functions to improve safety:
1. It makes the return object be an object instead of an interface, to catch when `overriddenDuration` is misspelled.
2. It makes the function always synchronous, as asynchronous tests aren't supported in Fantom (even though they are in `tinybench`).
Reviewed By: rshest
Differential Revision: D80404121
fbshipit-source-id: c0e2fb9f67174432f50e31c399f5b10cfe098ae6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53323
Changelog: [internal]
This just makes it easier to understand when the benchmark itself has started running and how long the benchmark itself took to run.
Reviewed By: rshest
Differential Revision: D80400268
fbshipit-source-id: b447c4c389d563f7b2b1cbe82822d5d3a93272da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53333
As per title, the recordings of iOS E2E tests are broken because we are creating a file that contains the js engine in the name, but we are trying to store a file without the js engine in the name.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D80454067
fbshipit-source-id: e4eee86793eb36f9ec9643cba7b65de75e30cbe7
Summary:
Run `update-lock` script to use `yarn-deduplicate` tool to collocate and reduce the amount of dependencies fetched when working with a workspace.
## Changelog:
[INTERNAL] Deduplicate workspace lock after recent bumps
Pull Request resolved: https://github.com/facebook/react-native/pull/53244
Test Plan: Running `yarn build`, `yarn prettier`, `yarn lint-ci`, `yarn test-ci` and `yarn flow-check` does not yield any errors.
Reviewed By: rshest, cortinico
Differential Revision: D80170594
Pulled By: robhogan
fbshipit-source-id: 5cbbde832539e89cb3b9937eacf03215942bc237
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53269
Changelog: [internal]
Just a small refactor of the tests for LogBox to take advantage of the new `document.getElementById` API in RN.
Reviewed By: rshest
Differential Revision: D69528892
fbshipit-source-id: 807f03364e260baa9c3a94cfb1831b7eb24e0d26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53270
Changelog: [internal]
(Marked as internal because the DOM APIs haven't been released yet).
This implements `getElementById` in the DOM document API.
Reviewed By: rshest
Differential Revision: D69307133
fbshipit-source-id: 0c1454ae42fad92cddc705877b26052e887185bd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53272
Changelog: [internal]
`VirtualView` has been exposed as an unstable API in the `react-native` package but its public API is referencing the DOM APIs, which forces their definitions to also be public (but shouldn't because they haven't been released yet).
This replaces the reference with a reference to `HostInstance`, which will be updated to reference the DOM APIs when ready.
Reviewed By: yungsters
Differential Revision: D80254442
fbshipit-source-id: 254779c97c116ba08b6cc0c185906617ffd1269f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53294
Changelog: [internal]
Just adding a benchmark for `console.timeStamp`, which in normal circumstances will just measure a no-op. We can force installing the inspector and simulate that we're profiling in Fantom to force `console.timeStamp` to go through the tracing paths for the benchmark.
Reviewed By: rshest
Differential Revision: D80272873
fbshipit-source-id: 1e404525bb3390b96fae982c543478a26535a393
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53278
changelog: [internal]
C++ Animated should be in ReactCommon, it is code shared across all platforms.
Reviewed By: christophpurrer, zeyap
Differential Revision: D80261447
fbshipit-source-id: 8ad5d0bb65c9b499b1d9f60fc8babef8d4d90078
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53296
Following D79894702, update `__chromium_devtools_metrics_reporter` to correctly differentiate `InteractionEntry` and `INP` metrics, based on synchronisation with start of paint.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D79898177
fbshipit-source-id: 92e805fc15b6c8bf3342f62914cca1b377b58397
Summary:
Fixed a typo in Performance.js where `measureName === 'string'` should be `typeof measureName === 'string'` for proper type checking.
## Changelog:
[GENERAL] [FIXED] - Fix typo in Performance.js type checking condition
Pull Request resolved: https://github.com/facebook/react-native/pull/53311
Test Plan: The change fixes a logical error where the condition was comparing the variable value to the string 'string' instead of checking its type. This ensures proper type checking for `measureName` parameter.
Reviewed By: rshest
Differential Revision: D80403225
Pulled By: rubennorte
fbshipit-source-id: 134920b2f95e997007d41451a8f8ad5fb8592d73
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53292
# Changelog:
[Internal] -
Adds a `testID` test for the Text component, by means of extracting and reusing already existing one for Image.
Reviewed By: andrewdacenko
Differential Revision: D80332473
fbshipit-source-id: 8e8bc2eae12f5f340817f3788f320aad3a6fff45
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53222
# Changelog:
[Internal] -
This factors out bits of the previously existing "Text.role" prop testing into the general accessibility props tests, so those can be reused, also making sure that we use correct types for both `.role` prop (`Role` type) and `.accessibilityRole prop (`AccessibilityRole`, correspondingly).
Note that the test suite for the `role` prop is a separate one, as `role` is only defined on the native side for certain component types (including `Text`), but not all.
Also, in the existing suite we weren't really testing `role`, but instead running the same test twice for `accessibilityRole`, that is corrected as well.
Reviewed By: andrewdacenko
Differential Revision: D80084731
fbshipit-source-id: 545f01c00e9ea5ca53f664888b9bb7b24ded315e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53300
# Changelog:
[Internal] -
This adds two new modes to Fantom, allowing to run the native (C++) side with enabling either:
* Address sanitizer, which would detect memory overwrites
* Thread sanitizer, which can detect potential threading issues, such as race conditions
This are opt-in for now.
Currently, both modes already detect different errors, which have a high chance to be real issues and have to be fixed.
Reviewed By: lenaic
Differential Revision: D80339524
fbshipit-source-id: 784ddb9f0af79a04b074e107e4955724d54d5685
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52971
Wires up the initial pass of the experimental V2 Perf Monitor UI.
Limitations:
- Does not yet clear last interaction.
- Only lightly tested.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D78904767
fbshipit-source-id: c51c5f51d9267ec971c17dce465775a2a3e6cb2c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53288
This diff aligns the APIs ReactSurfaceImpl.view and ReactSurfaceImpl.attachView() to make sure they receive and return the same type
changelog: [Android][Changed] Changed return type of ReactSurfaceImpl.view to ReactSurfaceView to align with parameter recived by ReactSurfaceImpl.attachView()
Reviewed By: sammy-SC
Differential Revision: D80289764
fbshipit-source-id: cfd598a42298f56b6b8871611662fbfa5599a3d3
Summary:
Warning logs with correct spelling and formatting improve the developer experience.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Spelling and formatting of warning log related to Objective-C methods and their signatures.
Pull Request resolved: https://github.com/facebook/react-native/pull/53283
Test Plan: Change is messaging (text) only.
Reviewed By: jorge-cab
Differential Revision: D80267373
Pulled By: rshest
fbshipit-source-id: a07a6f685f14507578ced00d45f7ef0a3c69f23d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53281
This is still a of bumping Gradle to the latest Major (9.0)
Full list of changes is here: https://gradle.org/whats-new/gradle-9/
I don't expect any breaking changes for React Native users.
Changelog:
[Android] [Breaking] - **deps:** Gradle to 9.0
Reviewed By: cipolleschi
Differential Revision: D79445941
fbshipit-source-id: 0af495a2cc6bb4cca1e37d5f0693b77e42010df2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53280
I've moved a lot of the nightly testing infrastructure on a RNC repo here:
https://github.com/react-native-community/nightly-tests/
This allows us to iterate faster without having to wait for diffs to be
imported and test inside fbsource.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80262856
fbshipit-source-id: dc2dfe75901ac78ec9f6e940540102276d34acdf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53273
In [c5956da8c0](https://github.com/facebook/react-native/commit/c5956da8c0b735d47761af51019ed25b49001c00) we landed a change of the default value of `maxLength`.
While doing that, we missed the case where the app is explicitly passing `null` for a value for `maxLength`. When this happens, the props parsing was initializing the `maxLength` to 0, making not possible to input any value.
This change fixes the issue by ensuring that the default value set when `null` is consistent with the default value when nothing is passed.
## Changelog:
[iOS][Fixed] - Fixed TextInput behavior when `maxLength={null}` is passed
Reviewed By: GijsWeterings
Differential Revision: D80255637
fbshipit-source-id: a0d1956e1d51dbfedd27dafabf60ffa9344358d3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53225
# Changelog:
[Internal] -
Similarly to how it was done for View and Text components ( https://github.com/facebook/react-native/pull/53059), this adds an option to only populate non-default props for Image component.
**This gives up to 50% performance improvement on the benchmark test**, so looks promising.
Reviewed By: rubennorte
Differential Revision: D80090241
fbshipit-source-id: 7dfa6573408794535555e43580e32952fb1d1990
Summary:
When building the xcframeworks on iOS we're including the file `jsi/jsi.cpp` in the Swift Package. This file is also included in Hermes and React Native should use the hermes version of these symbols. This is even described (but overlooked) in the React-jsi podspec file.
This causes the error seen in the bug addressed by this commit.
The fix is to exclude the `jsi/jsi.cpp` file from the jsi target in our swift package.
Fixes https://github.com/facebook/react-native/issues/53257
## Changelog:
[IOS] [FIXED] - Fixed wrong jsi symbols in use when using React.xcframework
Pull Request resolved: https://github.com/facebook/react-native/pull/53266
Test Plan: Tested using a precompiled xcframework in the reproduction repository.
Reviewed By: rshest
Differential Revision: D80252131
Pulled By: cipolleschi
fbshipit-source-id: 915e94a1d80c2f45575e58d8054239484e861285
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53267
Changelog: [internal]
Test files that verify the behavior of the global setup can only have a single test, as we can't really reset it across tests. Because of that, I'm renaming the current one to make the behavior under test more explicit.
Reviewed By: rshest
Differential Revision: D80177333
fbshipit-source-id: df9eeba15906bc6071940824dad9e576a267f499
Summary:
This command doesn't exist anymore.
Remove reference to `react-native upgrade` as the command doesn't exist anymore.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [CHANGED] - Removed reference to removed `react native upgrade` in `Libraries/Renderer/README.md`
Pull Request resolved: https://github.com/facebook/react-native/pull/53265
Test Plan: N/A
Reviewed By: cipolleschi
Differential Revision: D80251577
Pulled By: cortinico
fbshipit-source-id: 9eab037af6769f0d1f78f65bc795d285dc3d8320
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53259
delegate.window is not supported in Mac Catalyst, causing a crash in various scenarios such as Metro refresh.
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D80189486
fbshipit-source-id: d0e8156f8f95769c114b497f53731876478fb1f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53255
Avoid updates to VirtualViewContainer if the rect dimensions haven't changed.
This is an attempt to simulate what ReactVirtualView does with `checkRectChange`.
Changelog:
[Internal]
Reviewed By: yungsters
Differential Revision: D80182750
fbshipit-source-id: f0f45ac508c1f93e6dbb64ea11c0b44b80d6c3b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53250
Changelog: [internal]
This updates the types for Fantom benchmarks to support the new `overriddenDuration` option from `tinybench`.
It also exposes a new method in the benchmark namespace to access the same timestamp used in benchmarks.
Reviewed By: rshest
Differential Revision: D80169515
fbshipit-source-id: 59af197eababbf5b8544ee9f1862b206756dc87d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53249
Changelog: [internal]
This just upgrades tinybench (used in Fantom benchmarks) to v4.1.0, which contains a feature we need to customize test durations.
Reviewed By: rshest
Differential Revision: D80169516
fbshipit-source-id: 5813b3050843b52d604619a44a5e097e26f54432
Summary:
While verifying the lock deduplication changes, I have spotted that `eslint-plugin-jest` package does not match Jest version used within the workspace.
## Changelog:
[INTERNAL][CHANGED] - update `eslint-plugin-jest` package in workspace to align with Jest version used
Pull Request resolved: https://github.com/facebook/react-native/pull/53246
Test Plan: Running `yarn test`, `yarn lint-ci` and `test-typescript` checks does not yield any errors.
Reviewed By: rshest, cortinico
Differential Revision: D80170591
Pulled By: robhogan
fbshipit-source-id: f3ac58bc26cf2d3a34899f8558f872b3df85942d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53223
changelog: [internal]
remove dependency on perfetto and use TraceSection like we do elsewhere.
Reviewed By: zeyap, rubennorte
Differential Revision: D80087082
fbshipit-source-id: 08d3434985443db9a83189a4dfabc65d6eda8166
Summary:
fix: https://github.com/facebook/react-native/issues/52279
## Changelog:
[iOS] [FIXED] - non-UTF8 crashes Info.plist local frameworks
Pull Request resolved: https://github.com/facebook/react-native/pull/52336
Test Plan:
after this change pods install and are working with the new warning:
[!] Failed to read Info.plist at /Users/user/apps/test/ios/promiflash/Frameworks/YouTubeEmbeddedPlayerFramework.framework/Info.plist: invalid byte sequence in UTF-8
Reviewed By: cortinico
Differential Revision: D80096932
Pulled By: cipolleschi
fbshipit-source-id: f60cd67cb99a581d6fbab92422c1adf7b50066eb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53214
Changelog: [General] [Fixed] Enforce void return type for void return type in JS C++ TM spec
Example if you have this spec
```
export interface Spec extends TurboModule {
+foo: (bar: string) => void;
}
```
We must enforce in C++ that the return type is `void` as e.g.
```
void foo(jsi::Runtime& rt, const std::string& bar);
```
Right now you can return any type in C++ such as `std::string` which does not make sense
Reviewed By: lenaic
Differential Revision: D79980538
fbshipit-source-id: 9b99ea6b1ac97d1e46cdb9952e83c445ec5503b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53208
changelog: [internal]
When Fabric View Culling is enabled together with immediate state update, it may lead to a crash inside of `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]`.
When doing immediate state update, we can avoid calling `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]` altogether to avoid the crash.
Reviewed By: lenaic
Differential Revision: D80000362
fbshipit-source-id: 123b70aa31edb14a99bb968648eb8b8aac84afb6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53226
Changelog: [internal]
This adds documentation about how to take JS memory heap snapshots in Fantom.
Reviewed By: lenaic
Differential Revision: D80090283
fbshipit-source-id: 04f66a62aa756d1020b8d8ef6fc0ea7e68341710
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53228
Changelog: [internal]
This adds some documentation about how to debug Fantom tests (C++ and JS).
Reviewed By: lenaic
Differential Revision: D80090286
fbshipit-source-id: 435d2079abfe72e93de0c297347b15dc39b25a89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53231
The RCTPullToRefreshViewComponentView props are not initialized when the component view is created. this could lead to undefined behaviors and crashes.
This change fixes it.
## Changelog:
[iOS][Fixed] - Properly initialize the RCTPullToRefreshViewComponentView
Reviewed By: sammy-SC
Differential Revision: D80093141
fbshipit-source-id: dac98d56c749b9f5d85338279c8da2a7e5ddb4a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53221
# Changelog:
[Internal] -
This changes the benchmark test results comparison print the results slightly differently, in particular it now uses the slowest result as a baseline and prints how much faster the other ones are (as opposed to printing "slower" previously).
This arguably brings a more positive vibe when looking into the benchmark results :)
Reviewed By: andrewdacenko
Differential Revision: D80082134
fbshipit-source-id: 7dc9c7c520afe08270d4f5da9031db02261690ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53095
This change simplifies the RNTesterApplication so that it's looking closer to the template MainApplication file.
In order to do so, I had to create 2 files inside the `metainternal/` folder as those files are
generated as part of the CLI Autolinking
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79722917
fbshipit-source-id: 06852c72ae1e1abed9952b1637515123977bc7b4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53215
Changelog: [internal]
This adds a new environment variable to Fantom that allows debugging the JS code in tests.
Usage:
```
FANTOM_DEBUG_JS=1 yarn fantom <test>
```
**Does NOT work in OSS yet**. We need to include a third-party library to send HTTP and WebSocket requests and implement a wrapper on top of it.
Reviewed By: christophpurrer
Differential Revision: D79883372
fbshipit-source-id: d077c373a036033344e61d58274d5cd14028bda4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53205
Changelog: [internal]
This injects a custom Babel transform for Fantom tests that automatically injects `debugger` statements in the generated code. This simplifies debugging by providing a default interruption point in the test setup for the test author to decide what to debug.
This has no effect unless the debugger is opened, which isn't happening yet.
Reviewed By: rshest
Differential Revision: D79996000
fbshipit-source-id: 6153587264d293a067e359edba4f64f41898c506
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53200
Changelog: [internal]
TSIA. This is necessary for Fantom to use real HTTP and WebSocket connections for DevTools, while still providing stubs for the runtime (the networking and websockets native modules provided to clients).
If there are no specific factories for DevTools provided, we fall back to regular ones (keeping backwards compatibility).
Reviewed By: rshest
Differential Revision: D79806934
fbshipit-source-id: 6d16fa44e11f3c8e304c3c3d31fe952d0ba5811a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53201
Changelog: [internal]
This splits the `ReactHost` option `enableDebugging` into more granular options:
- `enableInspector` which enables the connection with the inspector/debugger.
- `enableDevMode` which enables the use of bundles from Metro, reloads, etc.
This allows us to enable the inspector in Fantom without consuming bundles from Metro.
This should be backwards compatible with existing apps.
In the future, we should be able to inject custom `DevSupportManager` instances into the `ReactHost` so we can customize all options with any level of granularity (the same way we do on Android, for example).
Reviewed By: rshest
Differential Revision: D79804006
fbshipit-source-id: c28e788e5006cdbeb1a373d44b4e5aec1acec702
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53203
Changelog: [internal]
This makes ReactHost connect the inspector immediately after creating the instance, aligned with how we do it on Android, instead of doing it as part of loading a bundle.
Reviewed By: rshest
Differential Revision: D79804004
fbshipit-source-id: b165520b0feb089fdfaa323413d697939c7ac794
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53202
Changelog: [internal]
Just a minor refactor to follow the convention of prefixing Fantom-related globals and environment variables.
Reviewed By: rshest
Differential Revision: D79804007
fbshipit-source-id: 0c9a57c1b08ae18ae03cd66d1a6ef9690e0dea42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53204
Changelog: [internal]
This changes the logic to find an available port for Metro on Fantom to do this outside Metro. Before, we'd set `0` as the port for Metro to find an available port, but in a following change we'll need to know the port before calling into Metro. This allows that.
Reviewed By: rshest
Differential Revision: D79804005
fbshipit-source-id: 5c2e2f4acbba3a79771586799b65653d46b8fe72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53220
This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)
Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
"exports": {
".": {
"import": {
"types": "./lib/typescript/module/index.d.ts",
"default": "./lib/module/index.js"
},
"require": {
"types": "./lib/typescript/commonjs/index.d.ts",
"default": "./lib/commonjs/index.js"
}
},
"./package.json": "./package.json" <-- here some libraries missed this
},
"codegenConfig": {}
}
```
Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/53195
Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths
You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D80080243
Pulled By: cipolleschi
fbshipit-source-id: d33bf9eeb385ccf0c076e4d800a0d2840bd91b68
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53218
# Changelog:
[Internal] -
Uses the existing generalized accessibility props test suite, recently created by andrewdacenko, to test the corresponding props in the <Text/> component.
Reviewed By: andrewdacenko
Differential Revision: D80000693
fbshipit-source-id: ebbceef8db7b56dc5e4ba1ac7c027a5952b680a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53217
Changelog: [Internal]
Fix rn-tester jobs
This diff reverts D79993649
(The context such as a Sandcastle job, Task, SEV, etc. was not provided.)
Depends on D79993649
Reviewed By: cortinico
Differential Revision: D80030502
fbshipit-source-id: 1feee2e2ae6a1edbeb755687aecb2a25d9759a90
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53196
In the FabricUIManager, the runnable created for scheduled mounts is only used if currently running on the UI thread.
With this diff the runnable only gets created when needed.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D79969412
fbshipit-source-id: ee78890322af8580357389aad8357f7c0d18490f
Summary:
This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)
Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
"exports": {
".": {
"import": {
"types": "./lib/typescript/module/index.d.ts",
"default": "./lib/module/index.js"
},
"require": {
"types": "./lib/typescript/commonjs/index.d.ts",
"default": "./lib/commonjs/index.js"
}
},
"./package.json": "./package.json" <-- here some libraries missed this
},
"codegenConfig": {}
}
```
Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/53195
Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths
You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D79993649
Pulled By: cipolleschi
fbshipit-source-id: fa2bbd6178f5e5fef19a14e67f09ee8a727d01de
Summary:
Bump CLI to stable v20 for RNTester
## Changelog:
[INTERNAL] [CHANGED] - Update RNC CLI in RNTester to v20.0.0
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/53206
Reviewed By: cortinico
Differential Revision: D79997077
Pulled By: rshest
fbshipit-source-id: 7264d942967fbfbc7fa5704f1089c0e7dbd3eb4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53213
`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.
This:
```
try {
...
} catch (exception& e) {
// no use of e
}
```
should instead be written as
```
} catch (exception&) {
```
If the code compiles, this is safe to land.
Reviewed By: dtolnay
Differential Revision: D79968851
fbshipit-source-id: 18f2e6861f099915b1aad6aba58217ba94eb10c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53207
When restructuring the RCTReactNativeFactory, we forgot to add a couple of methods to check whether the delegate was implementing the RCTTurboModuleManager delegate methods.
This has been reported [here](https://github.com/react-native-community/discussions-and-proposals/issues/916)
This change fixes it.
## Changelog:
[iOS][Fixed] - Ask the delegate for `getModuleForClass` and `getModuleInstanceFromClass`
Reviewed By: cortinico
Differential Revision: D79998104
fbshipit-source-id: 68069a9f93182d4fa416b5799bf4eec4d107552b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53134
This change sets up the Fanto test for the Switch component
## Changelog:
[Internal] -
Reviewed By: rubennorte
Differential Revision: D79719683
fbshipit-source-id: d8a5d127296e3448faf5f841baa98bc34f4f43cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53177
This action is used only when running tests for RNTester. Now that we are using prebuilds, this is a liability, because Cocoapods and Xcode would not update the binary if a new one is provided.
With prebuild, this caching does not provide a lot of benefits, so we can remove it.
## Changelog
[Internal] -
Reviewed By: cortinico
Differential Revision: D79893870
fbshipit-source-id: 0773f910f418cf9ebd5d557d563160993084e83a
Summary:
When running `RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 pod install` I'm getting an error: `cp: framework/packages/react-native/..: File exists`
This is not seen consistently by everyone but I've seen in reported one more time at Expo. Could be related to running MacOS 26.
Somehow, apparently, the `..` is being treated as a literal directory name and cp is trying to create a directory named `..` inside `framework/packages/react-native/` which is not what we want. Using `/.` avoids that.
---
What also seemed to work(around) was to change `mkdir -p framework/packages/react-native` to `mkdir -p framework/packages/` and then `cp` can create the `framework/packages/react-native/..` folder. But this is definitely more confusing.
## Changelog:
Pick one each for the category and type tags:
[IOS] [FIXED] - fix "file exists" error in `ReactNativeDependencies.podspec`
Pull Request resolved: https://github.com/facebook/react-native/pull/53136
Test Plan: tested locally, and in CI on older macOS: https://github.com/expo/expo/pull/38631 (the ios build succeeds)
Reviewed By: rshest
Differential Revision: D79990895
Pulled By: cipolleschi
fbshipit-source-id: 44ff9034800d3acd4e55ec39aabfb326382372cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53199
Changelog: [internal]
This adds a new `taskEndTime` field in the internal C++ representation of `PerformanceEventTiming` so we can distinguish events that waited for mount (because they triggered changes) and events that didn't, so report INP correctly.
Reviewed By: rshest
Differential Revision: D79894702
fbshipit-source-id: f7472bfaecaa69f2126719d0dc3d3b251e3a8f68
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with`
This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.
## Changelog:
[IOS] [FIXED] - fix scripts for paths containing whitespaces
Pull Request resolved: https://github.com/facebook/react-native/pull/53194
Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too)
Reviewed By: robhogan
Differential Revision: D79993537
Pulled By: cipolleschi
fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53104
Deprecate com/facebook/react Legacy Architecture classes
changelog: [Android][Changed] Depreacate CoreModulesPackage and NativeModuleRegistryBuilder legacy architecture classes, these classes unused in the new architecture and will be deleted in the future
Reviewed By: shwanton
Differential Revision: D79676942
fbshipit-source-id: a2c447bee251fdac79d3dc81a17851eaf5271413
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53107
Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future
changelog: [Android][Changed] Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future
Reviewed By: shwanton
Differential Revision: D79676585
fbshipit-source-id: 72cb6fe0bbe666cfa317cf28d6aec475f1c38c35
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53192
In this diff I'm deprecating ShadowNode classes included in React Native library
These classes are part of the legacy architecture and will be deleted in the future
changelog: [Android][Changed] Deprecate LegacyArchitecture ShadowNode classes included in React Native
Reviewed By: mlord93
Differential Revision: D79676584
fbshipit-source-id: a39267e6e430fcf4f6a73c96cd28d02eafc88a32
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53152
When a redundant reject is called, show the rejection message in the redbox. This can help us pin down the error we need to elminiate in production.
Changelog: [Internal]
Reviewed By: sanjay-io
Differential Revision: D79837541
fbshipit-source-id: 879b5dc42980867051cfab6ccb575304a4a9c4c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53151
If the native module calls the resolve/reject, resolve/resolve, reject/resolve, reject/reject concurrently, the turbomodule infra could run into a null pointer exception. This diff mitigates that problem.
Changelog: [iOS][Fixed] - Fix concurrent calls into resolve/reject inside native modules
Reviewed By: sanjay-io
Differential Revision: D79824319
fbshipit-source-id: 675264781f303d12fc1eb9649ecdc78601b7720b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53181
Adds basic Fantom tests for the <Pressable> React Native component.
Following T233710053, adds tests for some of the listed props and refs.
Covered props:
* children
* disabled
* onPress
* style
Ref:
* Pressable is a Native Component and has the correct tag
I did not cover the rest of the listed props due to Fantom not having suitable events to trigger to test them and/or inease of implementing functionality to do so.
## Changelog:
[Internal]
Reviewed By: andrewdacenko
Differential Revision: D79745215
fbshipit-source-id: 26caaabf72ea7ffff3e652616dfd9f0cf7fc2020
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52852
Changelog: [Internal] - Implementation of ScrollView-managed VirtualViews for iOS
In previous diffs we've introduced a "VirtualViewExperimental" which is a clone of VirtualView. This diff updates the experimental version to move interection logic (whether something is visible, in prerender-space, etc.) to the ScrollView so there are less listeners. We now use 1 scroll listener vs. N
Reviewed By: philIip
Differential Revision: D78825701
fbshipit-source-id: d515e3cb2dae53d779b5d3f4c317a2c7a6b25857
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53112
## Changelog:
[Internal] [Changed] - Cache result when RenderOutput::render() is called
Rreviously, root.getRenderedOutput in fantom doesn't really reflect the result of direct manipulation from native animated (see the test case added here). This stack is enabling it.
* make RenderOutput an instance owned by TestMountingManager that can cache render result
* why is this needed - native animation's direct manipulation should modify the render result (analog to directly manipulating host views on a platform) instead of props on a StubView
* here i also make sure that `RenderOutput::render()` will only re calculate the render result for a tree after StubViewTree::mutate is called
Reviewed By: andrewdacenko
Differential Revision: D79737991
fbshipit-source-id: ee2193b708e319c1519b06bc672054c4f7105da1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53165
This is a re-land of D78981753
Those tests were OOM-ing because we were using a old version of robolectric.
I've bumped it and this should fix it.
Changelog:
[Internal] [Changed] -
Reviewed By: lenaic
Differential Revision: D79883742
fbshipit-source-id: 4c2c640d6b601ec07d0a4a12cd7b86a879740a41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53163
# Changelog:
[Internal] -
Adds a Fantom test that tests the `Text.ellipsizeMode` prop.
It also adds a test for the `<Text/>` component without any props
Reviewed By: andrewdacenko
Differential Revision: D79882336
fbshipit-source-id: f938c85092325374f562d610432781e2d412b88e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53140
As per title, this change adds the boilerplate code for a Fantom test on Modal
## Changelog:
[Internal] -
Reviewed By: andrewdacenko
Differential Revision: D79805808
fbshipit-source-id: c8c77e576a09b346cf29b290d68c75e540d5f146
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53135
Our Codegenerated components are not generating code for `getDebugProps`. This change modifies Codegen to add those functions for all the codegen components.
## Changelog:
[General][Added] - Added getDebugProps to codegen
## Facebook:
`getDebugProps` are required by Fantom to write tests. However, we can't generate these function for third party components, because codegen can generate arbitrary structs and we don't have a generic `toString()` method that can be used or automatically generated by C++.
By generating this function only for Core Components, we can ensure that we can write Fantom tests without breaking all the users of React Native.
Reviewed By: rubennorte
Differential Revision: D79805145
fbshipit-source-id: 0e41c65fc30eaa886a05557ca233fb0a9cb18a71
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53161
Changelog: [internal]
This fixes a bug in the retry logic in Fantom when requesting bundles from Metro, where we cache the error from a previous attempt and use it to determine we didn't succeed after the attemps.
Reviewed By: rshest
Differential Revision: D79881488
fbshipit-source-id: 566b2d700db2f9653b9ea9acd577d7eb03770b76
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53144
Changelog: [Internal]
This is a fix to "unset" prop value for Image.
In my previous diff D79600137 I have changed this behaviour to have Cover as a default, but it is not "default" value, but rather "unset" value.
Reviewed By: rshest
Differential Revision: D79813759
fbshipit-source-id: cc6d43742e51fb2087d6023bd0ff50a3d54eed49
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53138
Without this patch, library could break if the user removes the `newArchEnabled=`
property from the `gradle.properties` file.
With this patch instead we hardcode the property to true, so all the libraries can consume
it if they wish.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79805857
fbshipit-source-id: 88dda707a0d80ac79e96c955ded2ef0823f3d3ff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53153
In this diff I'm renaming BridgeSoLoader -> ReactNativeJNISoLoader and removing LegacyArchitecture becuase this class loads jni classes that are required in new architecture
changelog: [internal] internal
Reviewed By: RSNara
Differential Revision: D79827295
fbshipit-source-id: 2d02fa1de49b2e4ee838f14e976ae3ab2ca98aef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52946
This just add a set of unit tests for `DisplayMetricsHolder` as I'm working on this class recently.
Changelog:
[Internal] [Changed] -
Reviewed By: rshest, mdvacca
Differential Revision: D78981753
fbshipit-source-id: 5800d44d3131a58770a0049eb2d08306874b7183
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.
Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.
## Changelog:
[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch
Pull Request resolved: https://github.com/facebook/react-native/pull/52835
Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:
https://pxl.cl/7NjtJ
Reviewed By: mdvacca
Differential Revision: D78975126
Pulled By: cortinico
fbshipit-source-id: d7afb4fa5d2f43a7e33da3860432fa6dfe0dc8d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53143
# Changelog:
[Internal] -
This refactors the way Fantom benchmark test results are passed to the top level, making it type safe and more maintainable.
Reviewed By: andrewdacenko
Differential Revision: D79812707
fbshipit-source-id: d8bfef7e1b0c11b277a08f5e4c810f8c1efd7f89
Summary:
This test was still using the old `BridgeReactContext`, I'm migrating it to `BridgelessReactContext`.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/53131
Test Plan: CI
Reviewed By: mdvacca
Differential Revision: D79801564
Pulled By: cortinico
fbshipit-source-id: 9bb96185505703a773597aeadfeeaeeb194532de
Summary:
`#include <ReactCommon/RuntimeExecutor.h>` stopped working in react-native 0.81 when using frameworks because it is not part of ReactCommon anymore when the split happened for iOS.
to fix this I am including RuntimeExecutor in search headers same way we include ReactCommon.
## Changelog:
[IOS] [FIXED] - Fix import RuntimeExecutor.h with USE_FRAMEWORKS
Pull Request resolved: https://github.com/facebook/react-native/pull/53099
Test Plan:
You can enable USE_FRAMEWORKS and do `#include <react/renderer/uimanager/UIManager.h>` (which react-native-reanimated is doing).
Build will fail complaining that it can't find ReactCommon/RuntimeExecutor.h which is included in UIManager.h
Add my patch, it will work and build successfully
Reviewed By: cortinico
Differential Revision: D79796637
Pulled By: cipolleschi
fbshipit-source-id: f8bb669cfb9f4414653655ed98d2cc6bb431a3e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52978
This field is never written anywhere (neither in the internal codebase, nor in OSS).
I'm cleaning this us and simplifying the logic:
- Deprecating `effectiveLineHeight`
- Replacing all the usage of `effectiveLineHeight` with just `lineHeight`
Changelog:
[Android] [Changed] - Deprecate the field `TextAttributeProps.effectiveLineHeight`. This field was public but never used in OSS.
Reviewed By: mdvacca
Differential Revision: D79442393
fbshipit-source-id: c424a6def0257264cd160a2d7be48c2d0f47135e
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!
<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
diff-train-source-id: 7da6014535999d256d2846aadbb7fc1373d76253
Generated by: https://www.internalfb.com/intern/sandcastle/job/18014400563434324/
GitHub Repo: facebook/react
Changelog: [Internal]
Reviewed By: jackpope
Differential Revision: D79754431
fbshipit-source-id: 027428142f36683b07cb66112335f75ecfb5dd12
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53137
One of those 2 methods can be deprecated as it was used only for old architecture.
We'll be removing it at some point in the future.
Changelog:
[Android] [Deprecated] - DefaultDevSupportManagerFactory.create() method used for Old Arch
Reviewed By: rshest
Differential Revision: D79806116
fbshipit-source-id: ad2d5515f93bb85e3b7c495b369078f4c66d143b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53133
# Changelog:
[Internal] -
As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga.
- Added initial basic Kotlin configuration to the project.
- Migrated `YogaConstants` as an initial file to try out the first migration steps.
X-link: https://github.com/facebook/yoga/pull/1829
Test Plan:
- Tested the migrated class directly against facebook/react-native, see the PR [here](https://github.com/facebook/react-native/pull/52998).
- Run: `./gradlew :yoga:assembleDebug` & `./gradlew :yoga:compileDebugSources`
I am not able to run the Java tests in this repo (even before the initial Kotlin setup) – not sure if I am missing something there but any pointers are welcome – it seems like there is some missing configuration. Currently trying with `./gradlew :yoga:test`
Reviewed By: cortinico
Differential Revision: D79545992
Pulled By: rshest
fbshipit-source-id: 8257ff53e6b6f2436980be98b6c94e1ac526b207
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53097
# Changelog:
[Internal] -
This makes the benchmark results comparison printout, added in https://github.com/facebook/react-native/pull/52925, be done in a tabular form, so it's easier to read and copy/paste around.
Reviewed By: lenaic
Differential Revision: D79728695
fbshipit-source-id: 4dfc999ad4a9a8c2d67efdfce11aff75383cf645
Summary:
- Switches fmt_config to fast_float_config so it matches what is used in the method
When trying to use a forked version of the Pod it is not possible to set a new repo for Fast Float. This was caused by a typo in the method used to update the configuration of where to find the Pod.
## Changelog:
[IOS] [FIXED] - Fixed variable naming error in set_fast_float_config method in react_native_pods.rb
Pull Request resolved: https://github.com/facebook/react-native/pull/53129
Test Plan: Add the line `set_fast_float_config({:git => 'some-git-repo'})` to an application's Podfile
Reviewed By: cortinico
Differential Revision: D79805939
Pulled By: cipolleschi
fbshipit-source-id: 9705e1f63e21b788362ca94b74e32bce0177a729
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53132
This will prevent the Firebase script from running at all. I'm removing it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79801691
fbshipit-source-id: 2705dff93fc9dbbcfaf97a1ba29b69d4d0a8143c
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.
Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):
<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />
Using `WindowMetricsCalculator` from AndroidX:
<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />
Fixes https://github.com/facebook/react-native/issues/47080
## Changelog:
[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/52738
Test Plan:
Run the example app on an Android < 15 device.
Rollback Plan:
Reviewed By: cipolleschi, Abbondanzo
Differential Revision: D78738516
Pulled By: alanleedev
fbshipit-source-id: fdb22f3cc76b0bda987db426cb015124bcacdc84
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53041
update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.
Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.
Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`
Reviewed By: mlord93
Differential Revision: D79571226
fbshipit-source-id: d90fca36c119318e7a2dfa6953fc2148b35e83d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53117
Sending the mode is no longer needed as you can't opt out of legacy arch any longer, and was only used for printing a (NOBRIDGE) prefix.
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D79762592
fbshipit-source-id: 845aabf2a8365c88808990ea481503b23597a8a0
Summary:
Refactors the window focus detection feature flag logic in `VirtualView` (Android) to eliminate one instance property and instead utilize the existence of the focus listener to determine whether window focus detection is enabled.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D79743782
fbshipit-source-id: d12e70d8e52b72d546ff097c3b1bcfbd29fb9129
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52838
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Wires up a client/subscriber for the `"__chromium_devtools_metrics_reporter"` runtime binding (to which we emit live metrics events since D78904748). This will be used to unpack these performance updates to send to the host platform.
- Creates a new `HostRuntimeBinding` helper, which establishes a local/private CDP session.
- Conditionally installs our perf metrics runtime binding in `HostTarget` when `perfMonitorV2Enabled` is set.
- Wires up a new `onPerfMonitorUpdate` event on `HostTargetDelegate` (unimplemented until the next diff).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D78904766
fbshipit-source-id: 991f17a4cc69f574917750053a5da31bbc6dc0d5
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.
This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - a11y: fix `aria-label` on `TextInput`
Pull Request resolved: https://github.com/facebook/react-native/pull/53051
Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.
iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c
iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d
Reviewed By: andrewdacenko
Differential Revision: D79635413
Pulled By: rshest
fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.
Resolves https://github.com/facebook/react-native/issues/52883
## Changelog:
[GENERAL] [FIXED] - Add missing Babel dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/52884
Test Plan: See https://github.com/facebook/react-native/issues/52883
Reviewed By: cortinico, christophpurrer
Differential Revision: D79103092
Pulled By: robhogan
fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53055
Moves the C++ part of `InspectorNetworkReporter.kt` into the `react_devsupportjni` JNI library, and adds missing `SoLoader.loadLibrary` call.
Replaces D79568759 / https://github.com/facebook/react-native/pull/53036.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D79638331
fbshipit-source-id: 5df450ad80e4532d6ada1e4dab51a1de6418a4e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53059
# Changelog:
[Internal] -
This is a re-submit of the partially reverted https://github.com/facebook/react-native/pull/52905, which should work fine now on top of the changes stack that support the RN feature flags being safely used on the modules' top level.
Reviewed By: rubennorte
Differential Revision: D79640965
fbshipit-source-id: d8bda0dba662930d1343ea9d5155791a686b653b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53080
# Changelog: [Internal]
We were accidentally resetting this before calculating the timestampf for the TracingStartedInPage event, which is the left boundary for the timeline window.
Reviewed By: sbuggay
Differential Revision: D79670865
fbshipit-source-id: c6b5f869e185d6d3c80cb7153891c72283c82418
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53077
# Changelog: [Internal]
Stores the tracing::Mode on a TraceRecordingState and updates the logic for:
- InstanceTracingAgent to enable PerformanceTracer with a specified window size
- RuntimeTracingAgent to only enable sampling profiler for CDP-initiated sessions
Reviewed By: sbuggay
Differential Revision: D79670864
fbshipit-source-id: 2c4eacb29666b59acbc508848a0a3d859f21a403
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53039
# Changelog: [Internal]
We can now distinguish these 2 different modes.
Reviewed By: sbuggay
Differential Revision: D79565934
fbshipit-source-id: 780678d1f50d4c1d73d55ebc95da0ea328fa2cb3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53035
# Changelog: [Internal]
This adds an ability to distinguish different trace recordings, based on mode
Reviewed By: sbuggay
Differential Revision: D79557790
fbshipit-source-id: cbb216df86fa1a4692e1b82c8a14a6049b5c45ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52960
# Changelog: [Internal]
We never call `stopTracing()` on a HostTarget, if the Agent was destroyed.
This could only happen if the session was destroyed. There could me multiple sessions, so we have to keep the source of truth for recording status in a session state.
Reviewed By: sbuggay
Differential Revision: D79435494
fbshipit-source-id: db72ffdf6856974e980afa78d59dec4bf45df289
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52961
# Changelog: [Internal]
Now that we've implemented all required serializers and TraceRecordedState has everything needed, we can migrate TracingAgent to use this new infra.
Reviewed By: sbuggay
Differential Revision: D79433497
fbshipit-source-id: 8c63f0faa50844786b7af8860c22fc006dd38414
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52964
# Changelog: [Internal]
Now TraceRecordingState should capture everything we need in order to display a trace on a timeline.
We just need to serialize it properly into collection of serialized Trace Events that would be sent via `Tracing.dataCollected` CDP events.
This is what this serializer is doing.
Reviewed By: sbuggay
Differential Revision: D79434655
fbshipit-source-id: 6b6858db23077eb7305781b9b0d98af8dedd68ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52967
# Changelog: [Internal]
We would need this to correctly serialize Runtime Sampling Profiles.
In case of recording the trace in the background, this might not be the value we would want to use, we would probably add another field or calculate it dynamically, depending on the tracing mode.
This is not the case for now, will be solved separately on top of the stack.
Reviewed By: sbuggay
Differential Revision: D79433502
fbshipit-source-id: 172ff19985d325585590794fb2523a24a6860221
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52963
# Changelog: [Internal]
We are deprecating previous `InstanceTarcingProfile` struct, but not removing yet, since this is still used and we will migrate in one of the diffs at the top of the stack.
The `InstanceTracingProfile` will consist only of Trace Events that were captured by PerformanceTracer, and will not store Runtime Sampling Profiles.
There are multiple reasons for this:
1. As of right now, Runtime Sampling Profiles are completely independant from Instance Profiles and do not require anythings from Instance as a Target to be represented on a timeline.
2. Although PerformanceTracer is a singleton, it should be this way. It captures events for something that can only be dispatched if there is an allocated React Instance, so in the future PerformanceTracer could become a data-member of InstanceTarget.
Reviewed By: sbuggay
Differential Revision: D79433498
fbshipit-source-id: 0fdf09517488bc5c6c8eb604aee66535cdc19ffb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52968
# Changelog: [Internal]
Now that we've defined all actors and relationship between Agents, we can start recording profiles and store them on a recording state.
Reviewed By: sbuggay
Differential Revision: D79415396
fbshipit-source-id: 9639e59d619268d970b895da2e19dfd92c963a32
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52966
# Changelog: [Internal]
The current design for Tracing is flawed. Right now the logic is mostly scattered around CDP Agents, lifetime of which is tied to CDP session.
This diff introduces a new approach:
- The HostTarget will be the only Target that has public entrypoints to startTracing as part of the jsinspector backend.
- It will create and own TraceRecording that acts as a local session. We won't use wording session here, because it is already reserved for CDP case.
- Every Target will implement TracingAgent, lifetime of which will be limited by lifetime of either Target or TraceRecording.
- All these TracingAgent will have a reference to TraceRecordingState, which they can mutate
This approach unblocks:
- Recording traces without active CDP sessions, for example in a background.
- Recording full instance reloads and multiple profiles for Instances and Runtimes.
{F1980838032}
Reviewed By: sbuggay
Differential Revision: D79371359
fbshipit-source-id: 034e984fd7e977457bd41a980e5feb049db3339d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53072
Changelog: [internal]
This creates a test to make sure there are no changes in React Native dramatically increasing memory usage in simple scenarios.
Reviewed By: rshest
Differential Revision: D79646758
fbshipit-source-id: d7a863468adabb75de7ceb123d96131564bd0959
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53071
Changelog: [internal]
The current API to take JS heap snapshots has some problems:
1. Ergonomics: it requires you to input the filepath where you want to store the snapshot. This isn't aligned with the behavior we have for JS traces where the output path is provided to you.
2. It doesn't work in optimized builds, as it requires a specific option in Hermes.
For 1), this replaces `Fantom.saveJSMemoryHeapSnapshot(filePath)` with `Fantom.takeJSMemoryHeapSnapshot()` that outputs the snapshot in a predefined path and prints it to the console.
For 2), this adds a new environment variable to force building Hermes with memory instrumentation (`FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION`). This is exposed as an option and not set by default because it has a performance overhead at runtime that we don't want to pay (especially in benchmarks).
This option only works when using Buck in development, because we want to generate this new binary type on demand when necessary, instead of making it part of the prebuilts we do before running tests in OSS and CI.
Reviewed By: lenaic
Differential Revision: D79642314
fbshipit-source-id: a2980616a495bd6dca29c0709a9581db6fb3f2cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53069
Changelog: [internal]
This changes the names of the JS traces from Fantom from using a unix timestamp in the file name to using the ISO date:
- From: `View-itest.js-1754406329686.cpuprofile`
- To: `View-itest.js-2025-08-05T15:05:29.686Z.cpuprofile`
Reviewed By: rshest
Differential Revision: D79646760
fbshipit-source-id: d8a654724c1abc2d3e285ee658c2d390d3241d82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53091
# Changelog:
[Internal] -
This fixes some excessive printing from the benchmarking results, which happened even if there was no benchmarks ran.
Reviewed By: rubennorte
Differential Revision: D79719026
fbshipit-source-id: 0e75d97ae9c762cab25007bfab5ca8a6dc43e148
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53070
As per title, this change adds a warning if you call `pod install` with `RCT_NEW_ARCH_ENABLED` set to 0.
## Changelog:
[iOS][Added] - Add warning if RCT_NEW_ARCH_ENABLED is set to 0
Reviewed By: mdvacca
Differential Revision: D79655716
fbshipit-source-id: 516cc02f9b2dbddaae99c2d74bba249970641d1d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53065
Instead of checking results from the previous day, allow to go back up to 7
days in the past to check for previous runs.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79568067
fbshipit-source-id: 5d6fac6a06b4e26e52de6fbf6187ec8f8e44e10e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53066
This diff introduces the mechanism for us to store the result of nightly 3p
library integration on Firebase.
Having the result store, we can now query the result from the previous day and
report if the build is newly broken or recovered overnight.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79565536
fbshipit-source-id: ba839b2950462a7ca6186a163f93f062719304fb
Summary:
Pure cocoapods build with dyn frameworks was broken due to some missing dependencies with the new performance metrics of cdp
## Changelog:
[iOS][Fixed] - Fix pure cocoapods dynamic framework build
Pull Request resolved: https://github.com/facebook/react-native/pull/53075
Test Plan:
Tested locally in RNTester with
```
USE_FRAMEWORKS=dynamic bundle exec pod install
```
and then building from Xcode
Reviewed By: cortinico
Differential Revision: D79676186
Pulled By: cipolleschi
fbshipit-source-id: ae6b81138fcae66c67bedadb1e1ad9cd6c4b6c35
Summary:
Add filter to native animated allowlist.
## Changelog:
[GENERAL] [ADDED] - Allow filter usage with native animated driver.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52920
Test Plan: Tested on RNTester
Reviewed By: joevilches
Differential Revision: D79473929
Pulled By: lunaleaps
fbshipit-source-id: de6fcc0f18a1d656688dce513d2cf48a3c9d4f09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53057
Changelog: [internal]
This adds a Fantom test to ensure that `setUpDefaultReactNativeEnvironment` doesn't read any feature flags. This prevents catching this as a runtime issue when the feature flag system complains that feature flags were accessed before being overridden, which always would happen if this module read any flags (as it runs before any product code that sets overrides).
Reviewed By: rshest
Differential Revision: D79639890
fbshipit-source-id: 6997609b7bf84947a6da53b58e68f9edd5654912
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53056
Changelog: [internal]
This exposes a utility method in `ReactNativeFeatureFlagsBase` to reset its internal state for testing purposes.
This is intentionally not exposed through `ReactNativeFeatureFlags` to avoid it being used at runtime.
Reviewed By: rshest
Differential Revision: D79639889
fbshipit-source-id: adfb6125d991994c9706d5952d309915fec8f815
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53026
This change prevents users from opting out of the New Architecure.
The change is non breaking with respect to building an app: all the functions are still there, even if they are unreachable, in case users will still call them explicitly.
We hardcoded all the values to enable the New Architecture, so there is no way to disable it.
This is a behavioral breaking change, though.
## Changelog:
[iOS][Removed] - Removed the opt-out from the New Architecture.
Reviewed By: cortinico
Differential Revision: D79090048
fbshipit-source-id: 9779bfedf50748d7adbef5f7ef038f469e30efc2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53063
Update `IO.read` CDP method handler to validate the received `size` parameter.
This now accepts a max value of 10MB — adding a layer of safety in front of our current Android implementation, which fails at around ~15MB due to OkHttp limits.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D79646155
fbshipit-source-id: c777802105dc31cdcc7e9e960c880e689540fddd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003
The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79258727
fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52925
# Changelog:
[Internal] -
This adds an extra "ranking" report when running Fantom benchmark vs different React Feature flag configurations.
It can be very useful when implementing some particular optimization, to streamline the before/after comparison wit this optimization enabled/disabled.
Reviewed By: andrewdacenko
Differential Revision: D79269601
fbshipit-source-id: f29e761e313d6857e5b3ac65faf2a387a84be9df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53053
Changelog: [internal]
This adds a Fantom test to ensure that setting up the RN environment doesn't trigger the initialization for React components like View and Text, which should be lazy loaded when necessary.
Reviewed By: rshest
Differential Revision: D79636160
fbshipit-source-id: ef1fbd6cd531eb7082dce000ba74a5eed451e259
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53054
Changelog: [internal]
We eagerly require `AppRegistry` from environment initialization (`InitializeCore`) because it has some side-effects that are necessary for error reporting (see https://github.com/facebook/react-native/issues/34649 and https://github.com/facebook/react-native/pull/34650), but this change makes a lot of modules to be eagerly initialized.
This reduces that to avoid loading modules that not necessary for environment setup, which allows us to do things like setting up feature flags before modules like `View` and `Text` have been initialized.
Reviewed By: rshest
Differential Revision: D79636159
fbshipit-source-id: a3f1e0db3dd69112ceef3ea339167694e2457454
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52827
Changelog: [internal]
This adds **support for creating Hermes/JS sampling profiler traces in Fantom**, which is especially useful when running benchmarks.
Usage:
```
FANTOM_PROFILE_JS=1 yarn fantom Animated-benchmark
```
Output:
{F1980642216}
After this, the trace is fully symbolicated.
Can be opened directly in Google Chrome:
{F1980642229}
Or in the built-in viewer in VSCode:
{F1980642242} {F1980642240} {F1980642241}
When collapsing frames in the Flame Chart viewer in VSCode, we can quickly identify opportunities for optimizations.
This also supports multi-config environments. In that case, trace file names are created using a short representation of the configuration.
User guide for benchmarks in Fantom, including how to use this, will be done in a future diff.
NOTE: This still doesn't work in OSS because we don't support optimized mode there. In dev mode, there's a segmentation fault coming from this line: `hermesRuntime->sampledTraceToStreamInDevToolsFormat(fileStream)`
Reviewed By: sammy-SC
Differential Revision: D78905646
fbshipit-source-id: 382ddd5034db601309bd118cedde2fe0d57fde98
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53034
Changelog: [internal]
This is just a refactor to make sure that the constants we pass from the Fantom runner to its runtime are correct by using Flow to typecheck it.
Reviewed By: andrewdacenko
Differential Revision: D79565574
fbshipit-source-id: cbbab9cdec5ef5b3c82b929b8939c76c0ef41823
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52985
This class is essentially a wrapper of LayoutShadowNode with no extra logic added.
Let's remove it.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D79450688
fbshipit-source-id: 943e10e602cb9a5b77fca81e11d2333828b27813
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025
It's now time to say goodbye to the Legacy Architecture :')
This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.
Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82
Reviewed By: cipolleschi
Differential Revision: D78560296
fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53030
Changelog: [internal]
Removes `PerformanceEntryReporter::getCurrentTimeStamp` in favor of `HighResTimeStamp::now`, to make the source of truth more explicit.
Reviewed By: hoxyq
Differential Revision: D79560370
fbshipit-source-id: 0ccf2bf511781d3c47c6ddb4dd7f2061aab152b5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53028
Changelog: [internal]
Now that we have mocking at a more fundamental level (`HighResTimeStamp` API) we can replace other timing mocks with that one.
This does it for `PerformanceEntryReporter` and the `NativePerformance` module.
Reviewed By: hoxyq
Differential Revision: D79557640
fbshipit-source-id: 86579b8bb586190ab7cc8721f30e60b3ef789798
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53018
Changelog: [internal]
This makes the test for LongTasks API use the new API for mocking timers in Fantom to make it deterministic, and re-enables it on Github.
Reviewed By: rshest
Differential Revision: D79554724
fbshipit-source-id: 984c66ecd7c20eb972ba1e6b19944532acb82246
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53019
Changelog: [internal]
This adds support for mocking `HighResTimeStamp` values in Fantom tests via a new `Fantom.installHighResTimeStampMock` function.
See new tests for more details on how it works.
Reviewed By: rshest
Differential Revision: D79554723
fbshipit-source-id: 8b0fb292948be118c7616fde1a8a84014af82de8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53020
Changelog: [internal]
This adds a new feature to `HighResTimeStamp` to set a custom timestamp provider for "now" that can be useful for testing, only in debug builds to avoid potentially regressing performance.
Reviewed By: hoxyq, rshest
Differential Revision: D79554725
fbshipit-source-id: c325d05999b9e2d69f769b61f15c763446777a0a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53021
Changelog: [internal]
Moving the logic to set the default value for `HighResTimeStamp` to a shared function, to simplify further changes.
Reviewed By: rshest
Differential Revision: D79554726
fbshipit-source-id: cd0d4567ef63d386d28e0325203169323e97b207
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53033
This diff replaces the logic introduced in D72078450 to prevent `onPointerEnter`/`onPointerLeave` from firing when a button is pressed. The new approach trades off some complexity for reliability: instead of deferring `ACTION_HOVER_EXIT` handling to the next frame, we now suppress it immediately if any button is pressed (`buttonState != 0`). This simpler logic appears to work reliably on Quest devices, though it may behave differently on the Android emulator (something we’ll monitor).
The main reason for this change is that deferring ACTION_HOVER_EXIT introduces problems in newer Spatial React use cases, particularly when a single component hierarchy spans multiple roots. For example, when hovering between ReactSurfaceRoot and another root like VolumetricWindow, deferring ACTION_HOVER_EXIT can lead to incorrect enter/exit ordering:
* Cursor starts hovering over `ReactSurfaceRoot`
* Cursor moves to `VolumetricWindow`
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — deferred
* `ACTION_HOVER_ENTER` (`VolumetricWindow`) — processed
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — processed (too late)
This results in inconsistent hover state updates across roots, which this diff resolves by handling `ACTION_HOVER_EXIT` immediately when appropriate.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D79504775
fbshipit-source-id: ea97bff48ddf4d3d09caf56ca29057c202b12409
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53027
Tweaks MIME type parsing in CDP Network messages, now matching Chrome.
This fixes response preview behaviour by the frontend for text response previews that are `base64Encoded` 🙌🏻 (we were observing these for JSON `fetch` calls on iOS).
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D79559495
fbshipit-source-id: 2565af7587fc6fbdd3ef6fcbb10c558341ddfbdc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53022
Following D77799617, D77927896, updates `InspectorNetworkReporter.kt` to check `isDebuggingEnabled` internally and avoid work/communication over the JNI layer — to minimise impact on the Android Network stack.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D78004462
fbshipit-source-id: 2bea2ee0592d68d1cb330ac82e8b3b227b54a675
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53031
# Changelog:
[Internal] -
This partially reverts https://github.com/facebook/react-native/pull/52905, as in some configurations we don't appear to be able to use RN feature flags on the module level.
The usage is removed for now to unbreak the builds, with a follow up to resolve it in an adequate manner.
Reviewed By: hoxyq
Differential Revision: D79562056
fbshipit-source-id: 45bd896d572ff926a4c2dfa98334bf998718d86b
Summary:
This Diff simply adds some docs on how the secret must be formatted, and removes a print that would expose the triager IDs is anyone would look at the logs (not a big deal given that the ids are public on Discord, though).
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D79556988
fbshipit-source-id: 23d6e72141dff4e91242cc1d9f5b95ebaf5ca858
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52989
Adds a call to `NativeAnimatedModule`'s `userDrivenScrollEnded` method whenever a scroll event completes a smooth scroll animation. This is necessary in cases where Animated events control any layout properties of children and we need to force the shadow tree to resync with the native tree. For example, if a scroll view's child transforms its scale based on the scrollX or scrollY properties and the user triggers a `scrollToOffset` or `scrollToIndex` call, we don't update the layout of that child until the next state change.
Changelog: [Android][Fixed] - Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event
Reviewed By: sammy-SC
Differential Revision: D79464176
fbshipit-source-id: fee5f1c522714dbcddf8836de291c05d10e6e90e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53024
This class is Legacy Arch and is not used in OSS. Let's make it internal.
Changelog:
[Internal] [Changed] -
Reviewed By: RSNara
Differential Revision: D79556615
fbshipit-source-id: d157fe8f04784038d64657c6d240b0c51e41d82d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53014
# Changelog: [Internal]
This doesn't make sense, I've probably overlooked it while applying this to other methods.
Reviewed By: rubennorte
Differential Revision: D79552990
fbshipit-source-id: a7dc428dfcc86a08a9e52655f9878795b8e58c1c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52829
Changelog: [internal]
Just a small refactor to move the definitions of output paths to a specific module. We'll add more to this in a latter diff.
Reviewed By: sammy-SC
Differential Revision: D78905645
fbshipit-source-id: 011e6cec13396301dad8e76400b6f2b9e13568f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52786
Changelog: [internal]
It takes around 300ms to generate each source map file, and we really only need them if tests throw errors. Requesting source maps also increases contention to access the Metro server from each test worker.
This refactors the code so we only generate them in that case, which could save up to 20s in test execution time.
Reviewed By: rshest
Differential Revision: D78807672
fbshipit-source-id: af9f0f0377ddcf05014b5aca0b28db938dfb4ce2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52777
Changelog: [internal]
This significantly speeds up test execution in Fantom (around 2x in OSS and 6x at Meta) by starting a Metro server before all tests runs and reusing it across all tests to build test bundles, instead of spinning up a new Metro instance every time we run each test.
The architecture change (also considering the previous change in buck prebuilds) looks like this:
{F1980689532}
This is how is impacts execution times (compared to the baseline):
* OSS
* Before: 62s {F1980564286}
* After: 30s (**2x faster**) {F1980564265}
Reviewed By: andrewdacenko
Differential Revision: D78741903
fbshipit-source-id: b209f88925e49cc2a2067e8df9b7fa9a29b4c8d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52758
Changelog: [internal]
This is a change to how Fantom tests run in Meta infra via Buck.
After this, the biggest opportunity will be optimizing how we generate bundles with Metro.
Reviewed By: christophpurrer
Differential Revision: D78672863
fbshipit-source-id: 1152907f3ba60e7d2e48bcc588f3c07aef7bb393
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52905
Similarly to [this PR](https://github.com/facebook/react-native/pull/51225), we do it for the Text component now: we don't set any non-default value props (most prominently, the accessibility ones) before passing this to native.
This saves bandwidth and potentially improves the prop parsing time, which existing Fantom benchmarks do confirm.
This is implemented behind a feature flag, which is false by default (will use it to run an experiment before rolling out).
**NOTE:** This implementation forks the whole text component, as suggested by rubennorte, in order to isolate the changes and with the ultimate goal of removing the old version once the experiment is concluded.
## Changelog:
[Internal] - Text no longer sets any default accessibility props, which should not result in visible changes in behaviour but may affect snapshot tests.
Reviewed By: rubennorte
Differential Revision: D79177652
fbshipit-source-id: a39430464fd5edec953b4c91be7ef9620ebd75ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52987
This class is unnecessary. Is also public for no real reason.
Instead we should use `ReactNoCrashSoftException` directly.
I'm not marking this as breaking as users hsould not be catching this class.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79451567
fbshipit-source-id: 4d6f45b3006c79969fcf141002d34a72bf88901a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53009
Changelog: [internal]
This disables the test for LongTasks API on Github CI as the execution speed there is unreliable and makes the current tests flaky.
This happens because the test is timing dependent, but the alternative would be to mock some core behaviors that I think might be even worse.
Reviewed By: cortinico
Differential Revision: D79510480
fbshipit-source-id: 277e42e36aa6dfebf4745d094541a667f58a0996
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53010
Changelog: [internal]
Exposing this value so we can disable some tests in some scenarios in a following this.
Reviewed By: cipolleschi
Differential Revision: D79510481
fbshipit-source-id: 632d9a008943ed40c24878b5561065b6ede1d689
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52988
This class should be marked as `LegacyArchitecture` while it was not.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79451041
fbshipit-source-id: 62c5d35821e354ea851eaccac909bf6bd9157f09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53013
Quick fix to restore CI on `main`. `actions/setup-node` is now pulling Node.js `24.5.0`, which introduces a bug affecting `packages/dev-middleware/src/__tests__/` Jest tests.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D79551277
fbshipit-source-id: 51951ad8ffe376a478da268b50aa54ac2d9bba03
Summary:
This label was renamed at some point and it broke the issue template. This fixes it.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/52981
Test Plan: N/A
Reviewed By: mdvacca
Differential Revision: D79448155
Pulled By: cortinico
fbshipit-source-id: 2312fc5a0a82a65ca908af58dc74348141c16ca2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52995
Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.
This is change adds a new condition to check if `JSTouchDispatcher` should sweep active touches when a child native gesture is started, and only applies the check to `ReactSurfaceView` to start. The check is also only enabled if the `sweepActiveTouchOnChildNativeGesturesAndroid` flag is set.
Changelog: [Internal]
Reviewed By: jehartzog
Differential Revision: D79230277
fbshipit-source-id: c15b888ec932319f1bda05b8ef5eec39e5d08710
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52972
Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.
This is the first of a few changes to add a new feature flag `sweepActiveTouchOnChildNativeGesturesAndroid` to allow the `JSTouchDispatcher` to sweep active touches when a child native gesture is started. Running experiments internally to confirm that there are no unintended side effects from flushing the active touch.
Changelog: [Internal]
Reviewed By: jehartzog
Differential Revision: D79257465
fbshipit-source-id: 1ca79e77b21d8086c4df6753b16b1d8d922cd8d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52992
changelog: [internal]
do not log on every frame to make logs more readable. The callbacks are only set during construction and there is no value in logging on every commit props.
Reviewed By: rshest
Differential Revision: D79436988
fbshipit-source-id: 26c6cbadd5ae0efa8575c7f85e4c0d90e2ef6215
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52982
Changelog: [internal]
Just adding a few tests for `View` refs, to show as an example of what a test for a public component should have.
Reviewed By: rshest
Differential Revision: D79447449
fbshipit-source-id: 75b9dbb45824d927bcf63472da25c7c5a52c7eb6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52983
Changelog: [internal]
Just moving some tests that were defined under `<View>` that were related to styles, to under `<View> > props > style`.
Reviewed By: rshest
Differential Revision: D79447450
fbshipit-source-id: e97cc4e058ffc8170b7fa74176cc8dc27e26cfde
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52974
Changelog: [internal]
The test for LongTasks is flaky on Github and I made a change to figure out why (D79366370 / https://github.com/facebook/react-native/pull/52948). It seems that the long task happens before the artificial task we're using for testing, so we can update the test to filter those out.
Reviewed By: cortinico
Differential Revision: D79441987
fbshipit-source-id: 99296d704cfec2e61ca29d06878df171231f4e78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52944
changelog: [internal]
this should be in ReactCommon, not in cxx platform as it is not platform specific.
Reviewed By: rubennorte, christophpurrer
Differential Revision: D79184118
fbshipit-source-id: 141f0ce7b993d229c5d832d22c54471d32681173
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52949
## Changelog:
[Internal] [Changed] - cleanup TODOs in fantom tests around cxxNativeAnimatedRemoveJsSync
Previous attempt to remove js sync so far is working expectedly since https://github.com/facebook/react-native/pull/52904 / D79080739
Reviewed By: sammy-SC
Differential Revision: D79373130
fbshipit-source-id: e310b9250ba5da2e55435468f46b75977e46f111
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52935
Changelog: [internal]
This implements a new option for `PerformanceTracer::startTracing` to specify a maximum duration for the recording, keeping only the last record events.
This will allow us to implement an "always-on" profiling mode for RN with a low overhead. In the future, we can extend this with a `maxBufferSize` option.
See the comment in `PerformanceTracer.cpp` for implementation details.
Reviewed By: hoxyq
Differential Revision: D79340014
fbshipit-source-id: 3260724a775a574fe5e52d47358a3a5abd0d2ee7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52938
Changelog: [internal]
Minor refactor to simplify changing the logic for how events are buffered.
Reviewed By: hoxyq
Differential Revision: D79340013
fbshipit-source-id: efd295b1583929580fbe7441ec7eb06e828ca514
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52937
Changelog: [internal]
Minor refactor to log the synthetic events for trace start when the trace finishes. This is to simplify future work to implement a sliding window for trace events.
Reviewed By: hoxyq
Differential Revision: D79271692
fbshipit-source-id: 9e923ac36fff850a3aeede7304fb2d721bb9f16c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52934
Changelog: [internal]
Right now, the `PerformanceTracer` API has a method to stop the trace and a separate one to collect serialized events. This refactors the API to return the collected events when calling `stopTracing` instead.
The caller (in this case `TracingAgent`) is responsible for serializing and sending the events in chunks through CDP.
Reviewed By: hoxyq
Differential Revision: D79271690
fbshipit-source-id: bdb48c80be4fd07d96e381e6bb4d099cae91f8de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52936
Changelog: [internal]
This method is unused and we're no longer planning to use it.
Reviewed By: hoxyq
Differential Revision: D79271691
fbshipit-source-id: 1a0be464928a199cfe4a57cb5c44255b127264c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52948
Changelog: [internal]
Not sure why this test is flaky, but this tries to add some more assertions to see where the problem comes from.
Reviewed By: hoxyq
Differential Revision: D79366370
fbshipit-source-id: d66b30e502dbc80d3e972ed93a91bb7f703de9c4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52942
# Changelog:
[Internal] -
Adds another test clause to the Text benchmark test, to test the case when the component doesn't have any props altogether, which can be useful to establish a baseline.
Reviewed By: rubennorte
Differential Revision: D79352849
fbshipit-source-id: fbfeb53d3ede59631548eb2fe76a4debd5927900
Summary:
This pull request resolves a critical accessibility bug on Android where custom `accessibilityActions` fail to execute when activated via TalkBack's swipe gestures.
**The Problem:**
- When a user focuses a component with custom `accessibilityActions` (like a `TouchableOpacity`), TalkBack correctly announces the action labels as the user swipes up or down.
- However, when the user double-taps to activate the selected action, TalkBack reports an "incompatible action," and the `onAccessibilityAction` event is never triggered.
**The Root Cause:**
The investigation revealed that the `ReactAccessibilityDelegate` was generating **new, unstable IDs** for custom actions on every UI update. This instability prevents the Android accessibility service from reliably tracking and invoking the selected action.
**The Solution:**
This change introduces a static, thread-safe cache (`ConcurrentHashMap`) within `ReactAccessibilityDelegate`. This ensures that each unique action name is mapped to a single, stable ID for the entire lifecycle of the application. This provides the consistency required by TalkBack to function correctly.
This addresses the issue described in https://github.com/facebook/react-native/issues/47268.
---
## Changelog:
[Android] [Fixed] - Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack.
---
Pull Request resolved: https://github.com/facebook/react-native/pull/52724
Test Plan:
The fix was validated extensively using the RNTester app on a physical Android device and an Android emulator.
### Steps to Reproduce (Before Fix)
1. Enable TalkBack on an Android device.
2. Navigate to a `TouchableOpacity` component with several custom `accessibilityActions`.
3. Swipe up or down to cycle through the actions. TalkBack correctly announces them (e.g., "add to cart").
4. Double-tap to execute the selected action.
5. **Result (Bug):** TalkBack announces *"incompatible action"*, and the `onAccessibilityAction` event is not triggered.
### Validation Steps (After Fix)
1. Follow the same steps as above on the patched version.
2. **Result (Fixed):** After double-tapping, the `onAccessibilityAction` event is **correctly triggered** with the appropriate action name. The "incompatible action" issue is fully resolved.
*A screen recording demonstrating the successful fix can be provided if needed.*
Uploading fixed bugs view problems (1).mp4…
Fixes https://github.com/facebook/react-native/issues/47268
Reviewed By: jorge-cab
Differential Revision: D78737471
Pulled By: cipolleschi
fbshipit-source-id: 877b196597472ac6a4f6df81a05a43956fb34629
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52940
# Changelog: [Internal]
This is required for storing these Trace Events somewhere outside of PerformanceTracer, in case these events will be dispatched later.
Reviewed By: rubennorte
Differential Revision: D78741192
fbshipit-source-id: 3cc2eacd922855231fafb93c32d326b150b3c19b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52916
# Changelog: [Internal]
Align with other serializers in `jsinspector-modern` to have just static public method.
Reviewed By: rubennorte
Differential Revision: D79131985
fbshipit-source-id: 3f1f08641bb96a9fbd067992b8ce294af9d27688
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52915
# Changelog: [Internal]
This removes the use of `PerformanceTracer` instance in a serialization logic.
Reviewed By: rubennorte
Differential Revision: D78919220
fbshipit-source-id: 5c663ea77eb36eb7664623c1595308a9450f7825
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52917
# Changelog: [Internal]
Just an aliases for referencing these ids, instead of raw uint64_t.
Reviewed By: rubennorte
Differential Revision: D78741191
fbshipit-source-id: 1ee403ff19ed95361366c76c1fb52e70ec67f16e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52914
# Changelog: [Internal]
We can't rely on RuntimeExecutor to actually tell us what JavaScript thread number is. Although this would work correct in most of the cases, this is not the solution we should go with.
Instead, we should fetch a map <id, name> of threads from the Host. This is what we will lazily call at the start of the Trace. I will add later on top of the stack.
Reviewed By: rubennorte
Differential Revision: D78990872
fbshipit-source-id: e41ebd35273c6741ebbc3fe3b851018c9f3275dc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52894
Adds the following boolean pragma modes for more granular control:
```
fantom_native_opt true|false
fantom_js_opt true|false
fantom_js_bytecode true|false
```
Previously these were all set together with `fantom_mode`. These modes are mutually exclusive with `fantom_mode`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D79151687
fbshipit-source-id: 59c3f20bccb570c0293ffd037609946a1a9bbb8f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52821
Hardens RN to running in mismatched opt/dev modes.
While adding an opt native/dev js mode to fantom, LogBox was trying to load NativeDevSettings when it didn't exist because of mode mismatch.
This is the only location it's happening, so this just moves the NativeDevSettings load into the one function that needs it.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D78952284
fbshipit-source-id: e68667cb28fae7cb6f985305e8885f271ef5d3af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52923
Follow-up to D78904748, where CI was broken on `main` for the `run_fantom_tests` job. It turns out this Android build uniquely included the new `react_performance_cdpmetrics` dependency, and this had an incorrect dep.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D79263124
fbshipit-source-id: 3e38e0cebe53520ea50e6d11a571e01c52e34874
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52840
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Completes populating a full `InteractionEntry` Live Event payload by implementing remaining fields sufficient to be rendered by Chrome DevTools.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D78904747
fbshipit-source-id: 7473602f6f1efe3ac71e07a2b88e6ad7020dcbbf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.
**Notes**
- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D78904748
fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52912
This diff throws an Exception if ReactApplication.reactNativeHost is not overriden. This field is deprecated and it will be deleted in the near future.
The goal of this diff is to be able to remove usages of reactNativeHost for classes that implement ReactApplication
changelog: [Android][Breaking] Throw Exception if ReactApplication.reactNativeHost is not overriden
Reviewed By: mlord93
Differential Revision: D79186336
fbshipit-source-id: 9f8f34739c0f04056ff3d795bda45bc0dbca7624
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52904
changelog: [internal]
There is a race condition in `FabricUIManagerBinding::schedulerDidFinishTransaction`. Until it is addressed properly, let's do synchronisation Fabric commits through JavaScript thread.
It can have pretty serious consequences: a crash in better case and undefined behaviour in worse case.
The race is between acquiring two mutexes:
1. One inside of `MountingCoordinator::pullTransaction`
2. Second one inside of `FabricMountingManager::executeMount`
The logic inside of `FabricUIManagerBinding::schedulerDidFinishTransaction` depends on the fact that whichever thread acquires mutex number 1, will acquire mutex number 2 without interruption. But that is not always the case as threads may be interrupted.
Reviewed By: zeyap
Differential Revision: D79080739
fbshipit-source-id: c86885aba25825030dc44b60144beb3e3ba18306
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52903
changelog: [internal]
disable subview clipping traversal when view culling is enabled.
Subview clipping is already disabled by preventing prop from being set to true: https://fburl.com/code/bynvtwfs but we found a crash where the traversal leads to memory corruption with view culling enabled.
Reviewed By: lenaic
Differential Revision: D79168116
fbshipit-source-id: 9dcb624ca12bc2d94b265681795604ee0ac3fe00
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52902
changelog: [internal]
These values must not change during view's life cycle.
Reviewed By: rshest
Differential Revision: D79165823
fbshipit-source-id: dff85d369e4f79ba88740b0f3a23b71af5ec0c5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52901
I'm removing this class as we should not expose it publicly.
It's not used at all inside react-native and can potentally be moved internally.
The only usage I've found in OSS is patched with this PR:
- https://github.com/fabOnReact/react-native-wear-connectivity/pull/46
Changelog:
[Android] [Removed] - Remove the `com.facebook.react.bridge.JSONArguments` class
Reviewed By: javache, mdvacca
Differential Revision: D78265165
fbshipit-source-id: 704575e7b9cfd6d40980511d6064d39991b3eb48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52887
Syncs Reac 19.1.1 into React Native.
This commit should contains the fix for:
- React owner stack in React Native
- An issue with React holding shadow node for longer than it needed
- An issue that made `startTransition` not working with React Native.
## Changelog:
[General][Changed] - Bumped React to 19.1.1
bypass-github-export-checks
Reviewed By: cortinico
Differential Revision: D79096406
fbshipit-source-id: cbb2f846b1f08ba5ff482cfed5aaddc16df075cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52898
Changelog: [internal]
This test is flaky on Github and I haven't been able to reproduce it locally to debug exactly why, but I think it might be because there might be cross-tests pollution.
This tries to reduce that making sure we clean up everything between tests.
Reviewed By: cortinico
Differential Revision: D79163809
fbshipit-source-id: fe59315373ab74ccedd7e031816a84f0566b4aa0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52885
Since we recently touched the `MatrixMathHelper` class, as we're looking into moving more matrix operations from Kotlin to C++,
I'm going to add more tests to make sure that those matrix math function are behaving correctly.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79094323
fbshipit-source-id: 34967b42dc92338724dd20fb7f70a68734f6db28
Summary:
- The changelog docs has broken links for the pre v0.80 markdowns due to missing extension
- There are links without corresponding changelogs
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] - fix changelog links and remove versions without corresponding changelogs
Pull Request resolved: https://github.com/facebook/react-native/pull/52849
Test Plan: Click on each link to see if it opens the corresponding page at the specific section
Reviewed By: christophpurrer, cortinico
Differential Revision: D79097825
Pulled By: cipolleschi
fbshipit-source-id: a92e709ccbb45a042175bd198326132bfbf37c65
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52876
Our tooling detected a couple of vulnerabilities in our package.json.
- undici
- on-headers
This change fixes these vulnerabilities.
For the on-headers vulnerabilitiy specifically, it comes from the following dependency chain:
- rn-tester > react-native-community/cli > compression > on-headers.
To fix it, we have to force the resolution to both on-headers and compression.
## Changelog:
[General][Fixed] - Fixed vulnerability on undici and on-headers
Reviewed By: cortinico
Differential Revision: D79086335
fbshipit-source-id: 44f14403196165f5f823030304102dbd0facd0ce
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52651
Changelog: [Internal]
Last year the `hermes-canary` profile was used to enable certain apps to use Static Hermes by enabling regenerator because debugger support for generator wasn't finished yet. However, we actually could have just keyed off of `options.dev` and still kept using `hermes-stable`.
The `hermes-canary` profile is actually meant to be used to run experiments. We should free up this profile to return it to the original intended purpose.
This diff makes all hermes profiles' dev mode use regenerator. Existing SH apps using `hermes-canary` should be unaffected. And apps using Hermes will change to use regenerator in dev mode, but that should be ok.
Reviewed By: robhogan
Differential Revision: D78450695
fbshipit-source-id: eb6a87fbc1f0e08d490fd0d1baa3611248f95764
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52891
Right now these are tightly coupled for no reason. The device helper just asks the root view to send the event out, which it uses ReactContext for. We can just have that be passed in and accomplish the same task.
Changelog: [Internal]
Reviewed By: Abbondanzo, rozele
Differential Revision: D79007328
fbshipit-source-id: ef0a5ac4ec0acb52fc7c2a26010811767e3c1e67
Summary:
The `EXPECT_EQ` was leading to potentially ambiguous use of `<<` when
gtest tries to print information.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D78823354
fbshipit-source-id: d26de07f02eb8bb53a4dec34b5fb302681bfbef8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52889
This brings back ContextContainer::Shared (but marks it as deprecated which was removed in https://github.com/facebook/react-native/pull/52750
Changelog: [General][Fixed] Bring back ContextContainer::Shared = std::shared_ptr<const ContextContainer> alias
Reviewed By: lenaic
Differential Revision: D79112609
fbshipit-source-id: 1cb9114b98d745b846d5ddc56a01786527049e50
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52886
RNTester was using just a plain `by lazy{}` which gets flagged by our internal linter over and over.
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D79094496
fbshipit-source-id: 856864bf8b5e4ec1254d1793dba9e97377696408
Summary:
Update `RCTTextInputComponentView` to recycle and properly clean its `inputAccessoryView` dependency. Currently, `RCTTextInputComponentView` does not clean up this dependency during recycling, which can result in the `inputAccessoryView` being incorrectly applied to `TextInput` components that do not use an accessory view."
Related issue: https://github.com/facebook/react-native/issues/52824
Snack of the issue: https://snack.expo.dev/arturkalach/privileged-blue-sodahttps://github.com/user-attachments/assets/46a1f172-a75c-4e88-beee-059d4d2e1d0c
## Changelog:
[IOS][FIXED] Update recycling logic to clean up the `inputAccessoryView` dependency.
<!-- 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/52825
Test Plan:
```
1. Render more than eight TextInput components on the screen, each with an AccessoryView.
2. Unmount the TextInput components using conditional rendering.
3. Open a Modal that contains a KeyboardAvoidingView and a TextInput.
4. Focus on the TextInput inside the Modal.
```
https://github.com/user-attachments/assets/8be1fdef-e8ab-4030-a2c5-e952c22ef743
Reviewed By: christophpurrer
Differential Revision: D78966221
Pulled By: cipolleschi
fbshipit-source-id: 35b6748cc44c41056051b2eecd626d61c4641cdf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52877
We moved the HelloWorld package from `packages`to `private` but we didn't update the path to React Native that is consumed by metro.
This change fixes this.
## Changelog:
[Internal] -
Reviewed By: huntie
Differential Revision: D78493478
fbshipit-source-id: 8795c2963dec036693a73a16c18be381f19e11c4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52870
# Changelog: [Internal]
Defines a set of static serializers for parts of the "Profile" and "ProfileChunk" Trace Events.
Mainly for 2 reasons:
1. To follow the same pattern of static serializers for Tracing.
2. To save on string copying, since ProfileChunk could contain hundreds of unique frames, all of them could have unique function names. The previous approach would copy the strings and populate a new `folly::dynamic` object.
Reviewed By: huntie
Differential Revision: D78919218
fbshipit-source-id: 303a4fc259d6b1720ce982e144037ee56cd47e9b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52869
# Changelog: [Internal]
We are exctracting a logic for serialization of TraceEvent into a dedicated serializer class.
Conceptually:
- PerformanceTracer would be a local TraceEvent engine that is responsible for constructing and buffering TraceEvents.
- TraceEventSerializer will have a single responsibility: transforming from local structs to serialized json objects that are ready to be dispatched over CDP Tracing domain.
This would help avoid scenarios, where we are passing around `folly:dynamic` between internal subsystems: serialization should only happen right before emtting a CDP message.
Reviewed By: huntie
Differential Revision: D78738370
fbshipit-source-id: a8e33e857192a02dc048d504abe072679ef8ce82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52868
# Changelog: [Internal]
Mainly, 2 changes:
- Callback that emits `Tracing.dataCollected` events will receive chunks as rvalues refs (`&&`), instead of `const &`.
- The RuntimeSamplingProfile will be passed to the serializer as rvalue ref.
Reviewed By: huntie
Differential Revision: D78919223
fbshipit-source-id: 7f65e0627c8839d507e6b2d088fdb0b560906b6a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52867
# Changelog: [Internal]
There are currently no reasons for these struct not to be plain, plus this would allow us avoiding potentially expensive copying, when returning `const &`.
Reviewed By: huntie
Differential Revision: D78919222
fbshipit-source-id: 7b39d754c05b25915f07202d7e4839b10a08a47c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52866
# Changelog: [Internal]
There are currently no reasons for these struct not to be plain, plus this would allow us avoiding potentially expensive copying, when returning `const &`.
Reviewed By: huntie
Differential Revision: D78919221
fbshipit-source-id: 7d3628bb213fdecadbdafa9b2b5c42472ebd77be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52865
# Changelog: [Internal]
These doesn't have any custom internal logic, so can be flattened for simplicity.
Reviewed By: huntie
Differential Revision: D76986727
fbshipit-source-id: cf23adf43eefda92674a46217a7269399cf81f0a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52878
Now that Metro is bumped to also support node >= 20.19.4
we should be able to run test_js on `main` against 20.19.4
Changelog:
[Internal] [Changed] -
Reviewed By: robhogan, motiz88
Differential Revision: D79087608
fbshipit-source-id: 2161a893ab2fd88dc7eb1b35aa385704962018e8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52871
## Changelog:
[Internal] -
As in the title, this adds a basic Fantom benchmark test for the Image component.
Reviewed By: rubennorte
Differential Revision: D79085957
fbshipit-source-id: 4098415353c8a04992c39e39d9a1dd20270f20d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52861
Changelog: [internal]
We added this mode recently to support all local Hermes variants, but this doubles the number of build type combinations which regresses test execution time and give us little benefit, so we're removing it.
Reviewed By: rshest
Differential Revision: D79080370
fbshipit-source-id: e1b536427acb98ec01edfd44829e2fef9be9b18d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52863
Changelog: [internal]
We're seeing some issues in stress runs for Fantom tests in optimized mode, failing when compiling the bytecode with Hermes. The specific error in the Hermes compiler isn't clear, but this started failing when we changed the folders for output. It's possible that it's due to race conditions in stress runs, where multiple workers are attempting to compile in the same locations.
This forces every output in every runner to be in a different file to prevent these possible collisions.
Reviewed By: rshest
Differential Revision: D79084242
fbshipit-source-id: b4540e2e6c5378c7fc8630ac2fea674e0ef78a14
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52848
This diff declares the `DataDetectorType` enum and defined the `dataDetectorType` property on the Android Paragraph props.
The conversions.h file holding the state conversion to MapBuffer was renamed to stateConversions.h so that it wouldn't clash with the Android conversions.h file.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79025294
fbshipit-source-id: 52dc519ea51191f28745d91fe31e36eaba29a731
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52847
Adding the missing Android Text selectionColor prop to the `ParagraphProps` to correctly support the prop with Props 2.0
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79023868
fbshipit-source-id: 10e04d438d9d118e6b80e8d8854e0bbb76b430ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52846
Adding the Paragraph `disabled` property for RN Android.
This diff also adds a new Text example to RNTester for disabled text.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D78990840
fbshipit-source-id: dd25b890597bc9f728f929b38c2f680631b7f476
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52845
With Android having its own props for the Paragraph component, we need to create a Host Platform specific version for the `ParagraphProps` to hold those platform specific properties.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D78990838
fbshipit-source-id: 722777a338f960fcc54846d8e8f106f51cac162c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52837
# Changelog
[Internal] -
This feature has been enabled by default for a while, and has been proven to both not cause correctness issues, and also provide tangible performance improvements.
We can remove the corresponding feature flag to improve code maintainability.
Reviewed By: rubennorte
Differential Revision: D78978302
fbshipit-source-id: 45cb865321f6e0eb449427845772fc522221514a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52225
## Changelog:
[Internal] - Fantom in RN CLI
This diff prepares the RN CI to build and run Fantom Tests
Reviewed By: cortinico
Differential Revision: D70097944
fbshipit-source-id: 163cb3f5204f7e5491f94f2fbebe11b514919cdf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52842
## Changelog:
[Internal] [Fixed] - keep track of last direct manipulation props
* so that at next time there's a ShadowTree commit (regardless of which thread), they're merged into the update mutation
* the props will stay until the view is disconnected from props node via Animated API or the view is removed/deleted. This should be expected behavior, because in RN we expect that once Animated changes a prop, subsequent react commits should not change the value.
Reviewed By: sammy-SC
Differential Revision: D78702843
fbshipit-source-id: b5e6e01a7a4f6caeea4cc1eeafaef9c3c7e51691
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52809
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Add two new feature flags:
- `fuseboxInteractionMetricsEnabled` — Will configure sending of interaction live metrics to CDP clients, independent of an active performance profiling session.
- `perfMonitorV2Enabled` — Will enable the backend + UI for the V2 Perf Monitor.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D78894857
fbshipit-source-id: 7605357b3cc9255d76f66bde605f9e520dda9750
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52836
# Changelog
[Internal] -
This adds a basic benchmarking test for `Text` component creation, similarly to the one we already have for the e.g. `View`.
Reviewed By: rubennorte
Differential Revision: D78975332
fbshipit-source-id: e1b54e59a54e8c7f8f19738f2ffeaa02ca5c09ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52832
# Changelog
[Internal] -
Make use of `Fantom.unstable_benchmark.testArg` API added in D78970312 for the existing View benchmark test - this makes it more succinct/maintainable.
Reviewed By: rubennorte
Differential Revision: D78970311
fbshipit-source-id: 2db35cb2edfa366311d62c4b1d141c3813a31e53
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52831
# Changelog
[Internal] -
The corresponding `testWithArg` API is similar to the existing `test` one for the Fantom benchmarks, except it would allow to run the same test several times in a parametrized manner, with the set of parameters specified as an array (for now, of numbers).
This allows to easily implement testing patterns such as we have in a View benchmark test, whereas we have a mostly duplicated test body doing a similar thing with 100, 1000, 1500 view component instances etc.
Reviewed By: rubennorte
Differential Revision: D78970312
fbshipit-source-id: 504b7aada648c7213ce698f088ac71d9fde8884b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52813
Changelog: [General][Changed] CDP backend now accepts addBinding and removeBinding methods earlier, before a Runtime exists.
Allows managing CDP binding subscriptions at any point in time, including at the very beginning of a session when a `RuntimeAgent` doesn't yet exist (due to `registerRuntime` not having been called yet).
"Adding" a binding with the `Runtime.addBinding` method is actually two actions in one:
1. Subscribing the current session to events from a particular binding name, from one or more Runtime(s) that may exist now or in the future (optionally targetable by execution context ID/name).
2. Installing a JSI function with the given `name` on the global object of the targeted Runtime(s), if they exist at the time of the method call.
NOTE: "Removing" a binding only involves managing the subscription and never causes the corresponding JSI function to be uninstalled - presumably because it may have been captured by user code anyway.
We currently do both (1) and (2) in `RuntimeAgent`, but this means subscriptions can't be managed before a `RuntimeTarget` has been created, which can cause problems if we want to set up certain bindings programmatically during React Native's initialisation. As this is an unnecessary restriction, here we move (1) to `HostAgent` and keep only (2) in `RuntimeAgent`.
Reviewed By: huntie
Differential Revision: D78739067
fbshipit-source-id: 9a39f4503d1b5e7c7a6e4c80dfbaabdd2549fb8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52807
changelog: [internal]
Fixes a crash that occurs when event driven animation is attached to a view that is unmounted.
Reviewed By: zeyap
Differential Revision: D78889689
fbshipit-source-id: 6bc534c3d80a7ed2fc5e0ac378e58343fef45430
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52834
changelog: [internal]
we have seen some problems with the fabric commit and believe there is a race condition in the implementation.
Here, we introduce an option to disable it.
Reviewed By: rozele
Differential Revision: D78972655
fbshipit-source-id: 99005c77dbe4dde3816b9e6a692f170cf287f7cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52828
Changelog: [internal]
Just a small quality of life improvement. It forces the test functions in benchmarks to have the name of the test case if it's an anonymous function, so it shows better in stack traces.
Reviewed By: sammy-SC
Differential Revision: D78924769
fbshipit-source-id: 9b44a49feaae93ccfa90cc726274f0ea013654b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52826
Changelog: [internal]
This is just an intermediate change to simplify how we format Fantom configs, so we can extend it to use other formatting formats (e.g.: short format to use in file names).
Reviewed By: lenaic
Differential Revision: D78924771
fbshipit-source-id: 4886a800a6836dc6a66539b1df079adb6c9c52e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52788
Changelog: [internal]
Minor change to just create a single output directory for generated JS code in Fantom per Jest run.
Reviewed By: lenaic
Differential Revision: D78808564
fbshipit-source-id: 70e1a60dfcdcc3fc6ee5f08ced1e9c8f8cab2782
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52817
X-link: https://github.com/facebook/yoga/pull/1828
X-link: https://github.com/facebook/litho/pull/1070
This diff makes the Yoga/Yoga.h header an umbrella header, which means that it includes all of Yoga's public headers. The code changes in each file include adding the IWYU pragma export to each header file, which is a way to tell the compiler to export the header file's symbols to other files that include it. This is necessary for the header file to be used as an umbrella header.
Changelog:
[General][Added] - Code quality fixes
Reviewed By: corporateshark
Differential Revision: D78692457
fbshipit-source-id: 7fcd53d2a6f268fa4377dbd5bd6ba6eebc94b5f8
Summary:
Hello, I work on [Radon IDE](ide.swmansion.com) I encountered an issue while adding support for react native 81, this PR solves it:
In https://github.com/facebook/react-native/issues/51023 EvanBacon removed `displayName` filed from `View` component adding the following comment:
>Remove displayName in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to react/display-name eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
Unfortunately the Fabric renderer uses the `displayName` property to generate the name of the component for the inspector functionality and in absence of it generates a name that might be confusing to the end user:
<img width="351" height="283" alt="Screenshot 2025-07-17 at 21 27 37" src="https://github.com/user-attachments/assets/852246aa-6586-4684-b80e-5d70b9678c6e" />
Problem is not specific to Radon and happens in chrome devtools as well:
<img width="501" height="130" alt="Screenshot 2025-07-17 at 22 16 52" src="https://github.com/user-attachments/assets/3514dd02-59f7-473a-87b1-6ed325d2034c" />
This PR brings back the `displayName` property to fix that.
## Changelog:
[INTERNAL] [FIXED] - Bring back the displayName property to the View component
Pull Request resolved: https://github.com/facebook/react-native/pull/52688
Test Plan:
- Run the application
- open chrome devtools and navigate to "components" tab
- before changes the View components would show up as `View_withRef` after they are named `View`
Rollback Plan:
Reviewed By: lunaleaps, cortinico
Differential Revision: D78512254
Pulled By: alanleedev
fbshipit-source-id: 46e4a224b09fe3fb938c055a675f687c86d7ddcb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52814
Changelog: [Internal]
The handling of `Tracing.start` was needlessly split between `HostAgent` and `TracingAgent` because `TracingAgent` did not have a reference to the session state (which, being an Agent, it's allowed to have). This diff cleans that up.
Reviewed By: huntie
Differential Revision: D78799899
fbshipit-source-id: b05e6dae2e9b287b8708debe756b19f81d5dae06
Summary:
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.83.1
The only public-facing change is a lowering of the minimum Node.js version from 22.14 to 20.19.
This will need picking to RN `0.81-stable`
Changelog: [General][Changed] Metro to ^0.83.1
Reviewed By: huntie
Differential Revision: D78895160
fbshipit-source-id: b9ccffe972249b73897f51c14873861e57a97161
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52815
Changelog: [Internal]
Refactors `HostAgent::handleRequest` to make the control flow more explicit and the state (`isFinishedHandlingRequest`, `shouldSendOKResponse`) immutable.
Reviewed By: huntie
Differential Revision: D78799898
fbshipit-source-id: 0bcf6c364466a91ad3075b67e4f2ac9a4e7a69a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52812
1. Fix forward from D76486572 (cc christophpurrer) - `#include <format>` is, for whatever reason, not available in fbcode (?) but `fmt` is an adequate, working substitute that is also used elsewhere RN (specifically in ReactCxxPlatform). Also removed the `folly/Format` include that had erroneously been left in, and the `fbobjc_ios_propagated_target_sdk_version` setting that was added purely to support `<format>`.
2. Fixes a dangling reference to an immediately-destroyed `MockHostTargetDelegate` in `ReactInstanceIntegrationTest`, caught by ASAN.
3. Adds a missing `#include <stdexcept>` to `Utf8.h`.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D78756286
fbshipit-source-id: d9428c54fc512f5ab33d31300aba9bf5c3e619b2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52767
Changelog: [Internal]
Currently tests that depend on hermes dev bytecode will fail because in OSS this case was not handled. We need to skip them for now before we integrate hermes compiler properly.
Reviewed By: christophpurrer, rubennorte
Differential Revision: D78750791
fbshipit-source-id: 5b55bc9acbd6ee5aad874ad57607325cb1373c2e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52803
I've just realized that our build suffer from a race condition. Specifically
libraries codegen needs to be executed before the app starts the evaluating CMake files.
Otherwise this could lead to a lot of missing files or folders.
Changelog:
[Android] [Fixed] - **rngp:** Fix a race condition with codegen libraries missing sources
Reviewed By: huntie
Differential Revision: D78886347
fbshipit-source-id: f59c201d2eab651bc4a08cf5a795acd379d18186
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52743
We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.
With this we just manually build a tree that contains the elements we care about in the order we want.
We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]
EDITS: After backout, fixed the issue where we were incorrectly setting the `accessibility_order_parent` tag the ReactAxOrderHelper class instead of the actual view. Also, made the cast safe to prevent any unexpected issues.
Also refactored the ReactAxOrderHelper functions to not have the block scoped `traverse` functions in favor of just looping through the children of a view when calling them
Reviewed By: joevilches
Differential Revision: D78669715
fbshipit-source-id: e714367c28e722ce42895531cf18e6f2dc926556
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52791
Changelog: [internal]
This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.
Reviewed By: sammy-SC
Differential Revision: D78815892
fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52792
With view recyling enabled only on a subset of the components, a recyclabe view could still be attached to its parent if that parent is not recyclable. This diff removes any recycled view from its parent. This will allow the view to be attached to a new parent on mount.
This diff removes the assert checking for parents still set on views pushed on the recycle stack.
Changelog: [Internal]
Reviewed By: mdvacca, sammy-SC
Differential Revision: D78814943
fbshipit-source-id: bb754ce5f526acbf263f23646335228447278562
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52763
The ui manager proxy shouldn't depend on the legacy ui manager.
We plan to compile out the legacy ui manager soon. But, the ui manager proxy is supposed to linger around for longer.
Changelog: [internal]
Reviewed By: cipolleschi
Differential Revision: D78697148
fbshipit-source-id: 249c63aae63daf653627e3e449b442b5ddaa5afe
Summary:
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/52783
This change reverts D78158734 which was a patch to make the dynamic frameworks work properly because we were not exporting the FBReactNativeSpec headers in prebuilds correctly.
This change fixes this, by exposritng those headers correctly.
## Changelog:
[Internal] -
bypass-github-export-checks
Reviewed By: cortinico
Differential Revision: D78803425
fbshipit-source-id: 5613ed0c790455ea86668eeb436f7b78a0c80918
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52789
I'm adding those 2 feature flags as enabled for the experimental channel of React Native so that partners
can report back to us and let us know if there are significant regressions.
Changelog:
[Internal] [Changed] -
Reviewed By: rshest
Differential Revision: D78810737
fbshipit-source-id: dc51106e2167aa92d4a275be78abb2c6984b7ffb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52771
Changelog: [Internal]
It seems we can simply use a std::shared_ptr here
(This was some initial over-engineering which isn't needed as it turns out)
Reviewed By: cipolleschi
Differential Revision: D78771904
fbshipit-source-id: 2925c424d2061ca727636c683ec783ed56e3f0c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52779
Changelog: [internal]
Adds validation for Fantom environment variables at runtime, to catch typos or variables that no longer have an effect.
Reviewed By: rshest
Differential Revision: D78803045
fbshipit-source-id: efb28a4f3fd6a4be35fb525d91fb093a1e88f7e4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52766
Changelog: [internal]
Just a minor refactor so adding more logic that should work both at Meta and in OSS is easier in the next diff
Reviewed By: christophpurrer
Differential Revision: D78741904
fbshipit-source-id: 3abda5d5b7be157bf381e26dad2fd4b064a0f556
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52778
Changelog: [internal]
Jest has an option to select a specific project when running tests:
```
jest --selectProjects fantom
```
But for this to work, a `displayName` option needs to be set in the project configuration. This adds that for Fantom tests (using `fantom`).
Reviewed By: rshest
Differential Revision: D78802516
fbshipit-source-id: 483e7c1450b1f97961e4e43c963fac3ce82cee58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52776
Changelog: [internal]
`FANTOM_FORCE_CI_MODE` is just an explicit way to indicate that we're on CI, so we'd run benchmarks in test mode, for example.
`FANTOM_DEBUG_CPP` is just an alias for `FANTOM_ENABLE_CPP_DEBUGGING` which is unnecessarily long.
Reviewed By: rshest
Differential Revision: D78801918
fbshipit-source-id: 8e60bdd911067c6b0b92be7e90553fd5209c9ca9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52759
Changelog: [internal]
This introduces a new environment variable for Fantom to disable benchmarks (`FANTOM_FORCE_TEST_MODE`), without having to run in CI mode.
Reviewed By: rshest
Differential Revision: D78672864
fbshipit-source-id: ef445bd8b36703594658529da2436c75d5b87179
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52765
Changelog: [internal]
Reported locations for errors in Fantom is wrong, because it seems it's not ignoring "infra" frames.
This was caused by the `stack` property in `ErrorWithCustomBlame` being set on the error objects and shadowing the getter that removes the necessary frames. This fixes that by forcing that property to be deleted.
Reviewed By: christophpurrer
Differential Revision: D78747119
fbshipit-source-id: 81d6ce74041382d7582e2066409e839d28d91052
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52610
This diff removes `ReactNativeFeatureFlags` from `react-native/Libraries/ReactNative` and migrates
`shouldPressibilityUseW3CPointerEventsForHover` to common `ReactNativeFeatureFlags` in `src/private/featureflags`. The `shouldEmitW3CPointerEvents is removed as it is used in `rn-tester` to hide some examples.
Changelog:
[General][Breaking] - Migrate `shouldPressibilityUseW3CPointerEventsForHover` to common private feature flags and remove `shouldEmitW3CPointerEvents` flag.
Reviewed By: robhogan
Differential Revision: D75448698
fbshipit-source-id: 03942c9504b855f2054c9a5948c0521ce17365b5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52772
ReactYogaConfigProvider is an internal legacy unused class, I'm just deleting it
There are no usages of this class
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D78516728
fbshipit-source-id: f694e9cd66ebe6cf97b343ce971b61fbd42f956f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52716
ReactPackageLogger is not supported in the new architecture
changelog: [Android][Changed] ReactPackageLogger is not supported in the new architecture and being deprecated
Differential Revision: D78501563
fbshipit-source-id: 3fef9dc80b8fce4d5a2067cfe171abb8ea6e1aca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52770
Prettier v3 has an async API. This diff adds in async and await ahead of the upgrade to prepare for the API change.
Changelog: [Internal]
Reviewed By: pieterv
Differential Revision: D78752906
fbshipit-source-id: 2deeecfc283be30fd0840b2a089604f4e6804af5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52768
Prettier v3 has an async API. This diff adds in await ahead of the upgrade to prepare for the API change.
Changelog: [Internal]
Reviewed By: pieterv
Differential Revision: D78752354
fbshipit-source-id: c0d27a6c863747b71852e72a22687d1fe1d9f76f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52734
# Changelog: [Internal]
We are going to need it at the top of the stack, once we will capture the Trace Events as part of the Tracing Profile for the whole Host.
This is also would be used for always-on tracing.
Reviewed By: sbuggay
Differential Revision: D78660071
fbshipit-source-id: 4f876bed992b8a794e561940ad12405fef88cb62
Summary:
There are some duplicated function calls in `PerformanceEntryReporter::reportMark()` . I know this is a micro optimization but I feel this way the code is cleaner.
This is called through `performance.mark` so there is potentially a tiny little performance improvement here?
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] - Removed redundant checks in `PerformanceEntryReporter::reportMark()`
Pull Request resolved: https://github.com/facebook/react-native/pull/52756
Test Plan: The existing testing infrastructure should cover these callsites i believe
Reviewed By: rubennorte
Differential Revision: D78731441
Pulled By: cortinico
fbshipit-source-id: e0de12c3c6f55e12eb454ea4b7081f3d6003126c
Summary:
`new_architecture.rb` script looks for `Info.plist` files in IOS directory, and adds RCTNewArchEnabled field to each one, except for those explicitly excluded. Framework files should remain unchanged, so I've extended the excluded_info_plist dict.
Modifying framework's Info.plist can break pod installation with errors like:
```
[!] An error occurred while processing the post-install hook of the Podfile.
invalid byte sequence in UTF-8
```
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] Fix overriding (xc)framework Info.plist files with RCTNewArchEnabled field
Pull Request resolved: https://github.com/facebook/react-native/pull/52520
Test Plan: Add any .framework or .xcframework to the iOS directory, install pods. If *.(xc)framework/Info.plist remains unchanged it works as intended.
Reviewed By: cortinico
Differential Revision: D78731439
Pulled By: cipolleschi
fbshipit-source-id: a04dfc0e282294e3e16d8292281f2c3369008551
Summary:
This module is currently unused, so we can clean it up.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/52705
Test Plan: CI
Reviewed By: cipolleschi
Differential Revision: D78555763
Pulled By: cortinico
fbshipit-source-id: 0a6152ab3d357cac0c6d7669f292680af7b87074
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52746
The config is needed for build, so I renamed it. In this way, the formatting of js code in react-native repo will be consistently controlled by the prettier config in the root. This change will make prettier v3 upgrade easier.
Changelog: [Internal]
Reviewed By: pieterv
Differential Revision: D78700564
fbshipit-source-id: 392ed490bf814870f285c8372ff68b454e228802
Summary:
There are symbolic link issues with ktfmt after building the rn-tester. Putting back this patch to address that issue.
## Changelog:
[INTERNAL] - Fix ktfmt symbolic links issues
Pull Request resolved: https://github.com/facebook/react-native/pull/52721
Test Plan:
1. Build the rn-tester:
```sh
yarn android
```
2. Unformat a file manually and then:
```sh
yarn lint-kotlin-check
yarn lint-kotlin
```
Reviewed By: cipolleschi
Differential Revision: D78647797
Pulled By: cortinico
fbshipit-source-id: b2f230741466be0a95c21a9b98f3d15b865c2b83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52711
The ccache cache is not really working. That's because we don't have a way to
properly compute the cache.
I'm adding has `hashFiles` to collect all the C++ and CMake files that are used
by ccache to fix this.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D78560946
fbshipit-source-id: 8d521d01386b62d3cfbd485f8e6fcf5f66eba71b
Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).
This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/52737
Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up
Reviewed By: cipolleschi
Differential Revision: D78664671
Pulled By: cortinico
fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52197
This Diff enables E2E tests to run on every PR.
We estimated that, now that we removed JSC and the legacy arch, the cost of running E2E tests on each PR should not be that high.
## Changelog:
[Internal] - Run E2E tests on each PR
Reviewed By: cortinico
Differential Revision: D77148473
fbshipit-source-id: 68191ff81c197d4c4ff9d6e71a41b7253971ddfb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52729
The Modal view creation contains initial properties when using Props 2.0. This diff adds support for Modal view creations having initial properties by allowing the `updateProperties` fast path only if the dialog is already initialized.
Without the change, the fast path gets called before the dialog could be initialized which leads to throwing an exception when the dialog is being checked to see if it is initialized.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D78638902
fbshipit-source-id: 61ad007b82867fa8b35648e3d8c930ee0e86c80d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52704
Stack traces for console calls are passed to the debugger when they are relative to device. (e.g. 10.0.2.2 for Android emulator)
Changelog: [android][fixed] fix stack trace linkifying failing when using Android emulator and other situations where the device and debugger have different bundle urls
Reviewed By: motiz88
Differential Revision: D78553183
fbshipit-source-id: 91d7e7ccc99d12ec7d06f4201237ecf557a46c4f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52702
Quick pass over some of the main files in `jsinspector-modern` now that C++ lint warnings have become more prevalent / auto-fixable.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D78490415
fbshipit-source-id: 32debcf5f217e847d326498709d50f695902bb5c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52653
Changelog: [Internal]
This adds an example of Unit Testing a C++ Turbo Module with Google GTest and also adds necessary and useful utility classes for testings
This is GTEST / C++ version of the same tests added in https://github.com/facebook/react-native/pull/52477
Reviewed By: alanleedev
Differential Revision: D78250302
fbshipit-source-id: 278655779dd17550be9c579d84cc1f7b6e45230d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52719
This is really a nit. We don't need to list all the variants here,
we can instead use `allVariants()` which we also use for hermes-engine,
to publish every buildVariant from React Android.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D78561729
fbshipit-source-id: 35989051ce966ea07caf26a218eb43c1a2bcac2d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52714
If we also have prepared text layout enabled, this cache will fill up with the last 1000 TextInput AttributedString, which isn't very useful. Let's assume we want to get rid of this cache, when we have the prepared layout cache as well.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D78534088
fbshipit-source-id: e9020ebfb7e1210f19e0b31f7423e7a9a90a89d1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52692
D77341994 added a global cache for Facsimile layouts, where we will reuse an existing `android.text.Layout`, and `Spannable`, if one already existed for a same AttributedString, under same layout constraints. An error here, is that we consider a layout reusable, even when shadow views are different, which means there may be different react tags in the underlying AttributedString.
This leaks into the layout itself, and means that if a layout is reused, we can hit test against a stale/incorrect react tag.
The solution to allow reuse here, is to avoid embedding react tag directly into the `android.text.Layout` structure. Instead, we replace references to react tags, with a fragment index, and embed the list of fragment indices in each PreparedLayout. We can hide this "cleverness" within the boundary of `TextLayoutManager`, such that an invalid `PreparedLayout` is never allowed to escape.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D78516079
fbshipit-source-id: 2d9fe9d80f60e6d7e7e40080a0817a08b51c3153
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52709
We want to make user for folks in OSS to try
`preventShadowTreeCommitExhaustionWithLocking`. Therefore I'm updating the OSS
release channel for this flag to experimental.
Changelog:
[Internal] [Changed] - Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental
Reviewed By: rubennorte
Differential Revision: D78558655
fbshipit-source-id: 02a9d216c7b2f8f7bdc1340213f82b70c5692dc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706
This just prepares the repo for the next branch cut.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D78558445
fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52648
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.
Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.
Changelog:
[ANDROID] [ADDED] - Create a debugOptimized buildType for Android
Reviewed By: cipolleschi
Differential Revision: D78425138
fbshipit-source-id: c1e9ea3608e7df10fb871a5584352f0747cf560b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52647
This removes the need to specify 2 Manifests for apps and we can just use the `main` manifes to toggle if `usesCleartextTraffic` should be enabled or not.
This will have to be replicated in the template repository.
Changelog:
[Android] [Added] - Add support to specify a single Manifest rather than 2 (main/debug) by using the `usesCleartextTraffic` manifest placeholder which is autoconfigured by RNGP.
Reviewed By: cipolleschi
Differential Revision: D78425139
fbshipit-source-id: 9173a014b387d5aed5f7087fa69b7bd49c220f2c
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.
Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.
## Changelog:
[ANDROID] [ADDED] - Create a debugOptimized buildType for Android
Pull Request resolved: https://github.com/facebook/react-native/pull/52620
Test Plan:
Tested locally with RNTester by doing:
```
./gradlew installDebugOptimized
```
This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:
<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />
Rollback Plan:
Reviewed By: cipolleschi
Differential Revision: D78351347
Pulled By: cortinico
fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52595
Changelog: [ANDROID][FIXED] Update font scale when recreating `RootView`
At the moment `enableFontScaleChangesUpdatingLayout` flag only works when the activity is configured to handle font scale changes by itself (`configChanges="fontScale"` in the manifest).
When that configuration is missing, the OS handles the font scale changes by recreating the activity, but in this case the path responsible for updating internally kept font size isn't executed.
This diff updates the RootView, so that the display metrics are also updated when it's created. Alternative approach would be to do that on the Activity, but that assumes usage of `ReactActivity`.
Reviewed By: NickGerleman
Differential Revision: D78323174
fbshipit-source-id: e48583091767497b5dfd4f2d938329530de4068d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52668
Changelog: [internal]
These methods have been available for months so no need to consider backwards compatibility with older binaries.
Reviewed By: huntie
Differential Revision: D78412932
fbshipit-source-id: 0f1d541c36c98a4cc8c847d1ee7a08a9d0f4b849
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678
From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.
Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)
Reviewed By: cortinico
Differential Revision: D78494491
fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
Summary:
In this diff, we migrated IntersectionObserver to tokens: D74262804.
So that we wouldn't have to store shadow nodes on the javascript side.
Storing shadow nodes lead to a memory leak in the past.
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D78494075
fbshipit-source-id: 38923ca4b265de6ff81ea20e5649e0bd2e39afc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52691
Unannotated array literals are unsound in Flow right now. This diff adds in annotations and makes a few things readonly, to reduce future errors.
Changelog: [Internal]
Reviewed By: marcoww6
Differential Revision: D78519638
fbshipit-source-id: d98a7668ecf97bcc87dcb3fad25ade736d885d9a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52686
Enables the `enableVirtualViewRenderState` feature flag by default.
Also, fixed classification for this and the `enableVirtualViewWindowFocusDetection` feature flags. (They were incorrect.)
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D78500846
fbshipit-source-id: 099adaa4ed0026c8bb7438df869564d76a999007
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52685
Cleans up the `scheduleAnimatedCleanupInMicrotask ` feature flag and deletes code paths that are now unreachable.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D78498600
fbshipit-source-id: 307562030373742e64968ae4c92d6bfbb48ddc71
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52684
Cleans up the `disableInteractionManager` feature flag and deletes code paths that are now unreachable.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D78498348
fbshipit-source-id: a3128c1e5ca9c5879080df54b7683a3c916cec13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52683
Cleans up the `avoidStateUpdateInAnimatedPropsMemo` feature flag and deletes code paths that are now unreachable.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D78497862
fbshipit-source-id: 26406e713ca5b7b194159638a20dcfca877ba380
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52625
Changes `react-native/babel-preset` so that by default, `hermes-parser` is configured with `reactRuntimeTarget: "19"`. This changes the compiled output of Component Syntax to not use `forwardRef` when a `ref` prop is present.
Additionally, this adds a new preset option property, `hermesParserOptions`. This object allows users of `react-native/babel-preset` to supply overrides for any `hermes-parser` options.
Changelog:
[General][Changed] - Configures `react-native/babel-preset` to target React 19 by default, meaning Component Syntax will not compile to `forwardRef` calls when a `ref` prop is present.
[General][Added] - Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options.
Reviewed By: SamChou19815
Differential Revision: D78383269
fbshipit-source-id: 1e6b66b9bfbeaf8a06fdc39031cb6de7e921765f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52681
Changelog: [internal]
In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made 2 mistakes:
1. Used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.
2. The `attemps` variable wasn't incremented, so we never left the loop in case of exhaustion.
This propagates a flag to `tryCommit` to indicate we've already locked on the commitMutex_ so we don't need to lock again in that case and increases the counter, fixing the issue.
Reviewed By: cortinico
Differential Revision: D78497509
fbshipit-source-id: 546ccd0c84aed5416ce1aef47d79419b4fe06f66
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52680
Changelog: [internal]
Reverting to make the fix easier to pick. Will land again on top.
Original commit changeset: 91d7f5d88a90
Original Phabricator Diff: D78487202
Reviewed By: cortinico
Differential Revision: D78497511
fbshipit-source-id: 58379787786cadcbcbe354feb97bc400a24f9d58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52679
Changelog: [internal]
Reverting to make the fix easier to pick. Will land again on top.
Original commit changeset: c18e967488de
Original Phabricator Diff: D78480136
Reviewed By: cortinico
Differential Revision: D78497510
fbshipit-source-id: 8037276cb70d27ff695c76cd9575b525568c4489
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52592
Changelog: [Internal] - Expose VirtualViewExperimental in JS, use in a test surface
Reviewed By: yungsters
Differential Revision: D78027899
fbshipit-source-id: d3d9808b8ba8e36c5fdb0c831c0855ed318d0a30
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52590
Changelog: [Internal] - Fix a couple of bugs with VirtualViewExperimental
1. `also` side-effect bug where we were accessing `scrollView` before it was assigned
2. Handling empty `rect`. Now, we don't add the virtualView until it has a non-empty rect layout
Reviewed By: yungsters
Differential Revision: D78287690
fbshipit-source-id: 1806b748a0117e51c7a201191396d79db3a8d205
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52673
We should be incrementing the `attempts` variable as otherwise this loop with never stop.
Created from CodeHub with https://fburl.com/edit-in-codehub
Changelog:
[Internal] -
Reviewed By: rubennorte
Differential Revision: D78487202
fbshipit-source-id: 91d7f5d88a90bdfa806195fd35897f2f51c1deb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52633
Changelog: [internal]
Now that we have the correct type definition for `console.timeStamp` we can remove the unnecessary `$FlowFixMe` annotations we had to add to use the new arguments.
Reviewed By: hoxyq
Differential Revision: D78405312
fbshipit-source-id: 29378ee6fa5986e22d0dfdfb85b7e25375361dc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52632
Changelog: [internal]
This improves the type definitions for methods in the global `console` object, most importantly:
- Removes use of `any`.
- Defines correct typing for `console.timeStamp`, including new parameters for the Chrome Extensibility API.
Reviewed By: hoxyq
Differential Revision: D78405314
fbshipit-source-id: 6f31cc3005ff708ef6aa155bcd150d53a845e66c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52631
Changelog: [internal]
Just a small improvement in the type definitions to serve as documentation for the expected arguments for custom tracks in RNDT.
Reviewed By: hoxyq
Differential Revision: D78405313
fbshipit-source-id: 75d250ea27f2e55e172aaf6e72399b85cecd43f4
Summary:
This PR fixes logging of rejections, which stopped working with the transition from using `LogBox` for warnings to directing users to use React Native Debugger, where warnings can be viewed in the `Console` tab.
Rejected promises before this PR used `LogBox.addLog` with the `level: warn` directly without `console.warn`, which notified users to open debugger to view a warning (after rejected promise) without actually printing any warnings to the console.
This PR uses `ExceptionsManager.handleException(error, false /* isFatal */);` for promise rejections that correctly raising an error to the console if needed.
### Rejected Promise in Chrome
Displaying the error as long as it's uncaught in the form:
`Uncaught (in promise) Error`
and if there's a message in that error:
`Uncaught (in promise) Error: ${message}`
once the error is handled, this error disappears:
{F1978806409}
This is done with `Runtime.exceptionThrown`, and `Runtime.exceptionRevoked`:
{F1979815326}
## Changelog:
[General][Breaking] unhandled promises are now handled by ExceptionsManager.handleException, instead of being swallowed as Logbox Warnings.
----
This is a breaking change because we changed the wording for these errors and because some systems (like Sentry) might start monitoring a new set of errors when this code is adopted.
Pull Request resolved: https://github.com/facebook/react-native/pull/51594
Test Plan:
Use `Promise.reject` and observe that the rejection is now shown symbolicated in LogBox and also printed in React Native Debugger Console.
```
<Button
title="Uncaught Promise Rejection"
onPress={() => {
const err = new Error('test error');
err.cause = new Error('cause');
const promise = Promise.resolve().then(() => {
throw err;
// also test with throwing a string / object:
// throw 'aa';
// throw {test: 'object'};
// return Promise.reject();
});
setTimeout(() => {
promise.catch(e => {
console.log('promise error caught', e);
});
}, 4000);
}}
/>
```
### Before
There's no indication whatsoever there's an uncaught promise.
### After
An error is logged:
Error-
{F1979749366}
Text-
{F1979749350}
Object-
{F1979749351}
Promise.reject() or undefined-
{F1979749826}
Reviewed By: hoxyq
Differential Revision: D75442651
Pulled By: vzaidman
fbshipit-source-id: bf6c56e643f03997f5a604b85c543aad62648a29
Summary:
When switching between debug/release we run a small script to make sure to copy the correct version of the RNDeps xcframework.
This script was missing a resolve function that fixed up some path issues that we do when installing in the podspec.
## Changelog:
[IOS] [FIXED] - Fixed issue with RNDeps release/debug switch failing
Pull Request resolved: https://github.com/facebook/react-native/pull/52664
Test Plan:
- Create new RN App
- Install pod with prebuilt deps
- Build (success)
- Switch to release
- Build (success)
Reviewed By: cortinico
Differential Revision: D78481590
Pulled By: cipolleschi
fbshipit-source-id: 2d02b0bc55e8aef6f3fafb4f7aa193c4cf00414e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52662
Changelog: [internal]
In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made a mistake and used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.
This propagates a flag to `tryCommit` to indicate we've already locked on the `commitMutex_` so we don't need to lock again in that case, fixing the issue.
Reviewed By: sammy-SC
Differential Revision: D78480136
fbshipit-source-id: c18e967488de14e73e6abf6f6e82c16bc42a12c6
Summary:
When switching between release/debug we're running a script to copy the correct xcframework. This script for the React-Core prebuilts was not part of the package.json file.
This caused the build to fail after trying to switch from debug -> release.
## Changelog:
[IOS] [FIXED] - Fixed missing script for resolving prebuilt xcframework when switching between release/debug
Pull Request resolved: https://github.com/facebook/react-native/pull/52663
Test Plan:
- Create new RN App
- Install pod with prebuilt deps and core
- Build (success)
- Switch to release
- Build (success)
Reviewed By: cortinico
Differential Revision: D78481302
Pulled By: cipolleschi
fbshipit-source-id: 1c7181e63219098ae140d77ff1cb2c0c9b9642e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52661
The CI is currently red on main due to a missing dependency on `rrc_view`
from the recent TransformHelper.cpp addition.
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D78479785
fbshipit-source-id: 3d2b698d9ce46cf22c15ad43005f621526590145
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52660
The documentation for those methods mention that users should override them to
provide their own implementation.
However those vals are not `open` so users cannot really override them.
This fixes it.
See more context on https://github.com/facebook/react-native/pull/48800#issuecomment-3082665024
So this was practically a breaking change, that I'm attempting to mitigate.
Changelog:
[Android] [Fixed] - Make accessors inside HeadlessJsTaskService open again
Reviewed By: cipolleschi
Differential Revision: D78479162
fbshipit-source-id: eefc7332e2004198cd6bd64b60a66215f137ad4a
Summary:
Changelog: [Internal]
Adds a basic `--version` command line flag to the RNDT shell. This will be used in code paths (including tests) that need to verify that the shell is executable, but do not need to actually display a window or hand over control to the main shell instance.
bypass-github-export-checks
Reviewed By: huntie
Differential Revision: D78351936
fbshipit-source-id: e8982cfea6435da0ac9ea5f50d57c7642a8e2edb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52640
Not having `TransformHelper.cpp` included in CMake is causing the C++ code to fail compiling.
This diff fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi, javache
Differential Revision: D78414015
fbshipit-source-id: 4900427a86eb38bfec10e5e385296d89c73e9051
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52639
Add feature flag in the attempt to address the pile of tasks reporting the following error in panelapps:
> Error: android_crash:java.lang.AssertionError:com.facebook.react.runtime.ReactHostImpl.onHostPause
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D78339196
fbshipit-source-id: 9ef748e7ea85f179d8f8c418a978bd5c99f70601
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52612
changelog: [internal]
View Culling is purely performance optimisation but it must work correctly with accessibility features like VoiceOver and Switch Control.
In this diff, View Culling is lazily disabled whenever use of an accessibility feature is detected to make sure all views are present in the view hierarchy.
Reviewed By: NickGerleman, philIip
Differential Revision: D78336010
fbshipit-source-id: 7a201afc8e2ffd8b586d75ed4de2c03d7966750c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52604
changelog: [internal]
For Fabric View Culling to work correctly, content offset changes must be applied synchronously to avoid UI flicker.
The flicker happens because content offset update happens asynchronously and the OS paints scroll position update before React Native has a chance to adjust view hierarchy for the new scroll position.
Reviewed By: lenaic
Differential Revision: D78334322
fbshipit-source-id: dc1f1b3f9db9f9547e5a588dc184fcf21cca2727
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52603
Processing transforms is expensive in Java, as it requires bridging the entire ReadableNativeArray/Map. Instead, we can use the existing parser logic `resolveTransform` logic to perform this operation in C++.
Ideally, we actually re-use the existing parsed transform from Props, that could be something we revisit after Props 2.0.
As a follow-up, we should consider also moving the matrix decomposition logic from MatrixMathHelper here, and make that the only information we send back to Java.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D78298588
fbshipit-source-id: a698ac8587ccfb2be04665747082398ccdde9294
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52611
We compare the current transform (represented as a ReadableArray) with the incoming one to know whether to invalidate. This can be expensive as it requires to materialize the entire transform data structure over JNI. Instead, we can delegate this comparison to native code, which can compare the underlying folly::dynamic directly.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D78340288
fbshipit-source-id: f44a054e234694c316fb080fe2dbc2017780123a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52613
Changelog: [internal]
This adds first-class support for the `detail` field in `performance.mark` and `performance.measure`.
Now that we have access the JS entry in native, we can access the `detail` field to propagate it to DevTools (and use it to extract track names for Perfetto).
In order to avoid the performance overhead of always having to extract the `detail` field from the entry, this is done lazily only if we're actively profiling with DevTools or Perfetto.
Reviewed By: sbuggay
Differential Revision: D78340911
fbshipit-source-id: 383dd1cb6fcc8a04be9e65038503986f196e23c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52614
Changelog: [internal]
We're adding first-class support for custom tracks, so we can remove the legacy mechanism to specify tracks with the "Tracks:" prefix in the event names.
Reviewed By: sbuggay
Differential Revision: D78340910
fbshipit-source-id: cbbadd519baf7bb50072cb97d8cd1ccc87a8a35c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52588
Changelog: [internal]
This adds tests to show how `performance.measure` isn't spec compliant when `end` and `duration` are used. This will be fixed in the following diff.
Reviewed By: javache
Differential Revision: D78193069
fbshipit-source-id: 30ba4874c4d2b4adb20608fc8d5ed61bfd6d92d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52587
Changelog: [internal]
This just re-organizes the tests for the `Performance` API and `PerformanceObserver` as the previous organization didn't make much sense. Now it's a test for `PerformanceObserver` and another for the User Timing API.
Reviewed By: huntie
Differential Revision: D78193070
fbshipit-source-id: f15524bf07d2dc9edc155214279ce3af705cde67
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52621
In D77261958, I made a typo when implementing the cleanup of window focus detection in `onDetachedFromWindow`. This fixes it.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D78366506
fbshipit-source-id: 2a377cd7e8ec08f0c899dbd9cb3757bec580d30f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52583
Changelog: [Internal]
OSS build is broken atm as there is rn-tester dep in Fantom, needed for Meta only purposes.
Platformizing code to allow for Meta only implementation here and also for OSS only. Using this approach over ifdef.
Reviewed By: christophpurrer
Differential Revision: D78275698
fbshipit-source-id: c3234bb61b4591c0a5045fdb84aa0316f6382ecc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52607
changelog: [internal]
The current design of enableSynchronousStateUpdates is not correct and breaks <Modal /> on Android. let's delete it.
Reviewed By: philIip
Differential Revision: D78332201
fbshipit-source-id: 109909ebc706168372c565e8ff6e0c95d7565b10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52617
The `test-release-local` script was failing to execute the npx rreact-native run-ios command for some issues with cocoapods.
That command tries to reinstall the pods so there might be some issues when testing.
As an alternative, we can avoid duplicated work by dropping the npx react-native command and, instead, build the app with xcodebuild and install it in the simulator with xcrun.
This is a backport of [this PR](https://github.com/facebook/react-native/pull/52609)
## Changelog:
[Internal] -
Reviewed By: vzaidman
Differential Revision: D78344397
fbshipit-source-id: cf2d9c032966a9be05670259e9532789829349f2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52618
In 0.81 we dropped the JSC configuration in CI. That means that the artifacts we generate in CI have a slightly different name. The current e2e script failed to run with the ci flag because it was still using the old artifacts name and it was not finding them.
This change adress the problem by:
- using the right artifact names
- removing the --hermes parameter which controlled the Hermes vs JSC scenario.
It is also a port to main of [this PR](https://github.com/facebook/react-native/pull/52606)
## Changelog:
[Internal] -
Reviewed By: cortinico, vzaidman
Differential Revision: D78344244
fbshipit-source-id: a658ba161b867bbad773fe093df9679ea92579b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52584
The method `_initializeUIRefreshControl` creates a new instance of `UIRefreshControl` which has the default values for things like tint color.
However the props that we are keeping in the component are the `_props` before recycling. The actual state of the newly created UIRefreshControl is out of sync w.r.t the props the component thinks to have.
By introducing a `_recycled` state variable, we can force the first `updateProp` call to apply all the props to the newly created component.
## Changelog:
[iOS][Fixed] - Make sure that the recycled refresh control have the right props setup.
Reviewed By: sammy-SC
Differential Revision: D78278207
fbshipit-source-id: 4be20aa43f96eb87828b44a4deedd33a23d1d17f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52615
The refresh control has some issues that this change addresses.
- Issue with zIndex not propagating to RefreshControl.
- Issue when RefreshControl being mounted as refreshing.
- Issue with color props not applied
## Changelog:
[iOS][Fixed] - Correctly propagate props to RefreshControl
Reviewed By: sammy-SC
Differential Revision: D76668478
fbshipit-source-id: c3a5ff04b1b2654d25c9053973c5cff0002a804a
Summary:
We should use indent size 2 everywhere. While we were using 4 for some old reasons. This is causing editing of .kts files and BUCK files inside OSS Android Studio quite painful.
Changelog:
[Internal] -
Reviewed By: cipolleschi
Differential Revision: D78348532
fbshipit-source-id: 97e0e1f54fdc76c8a9cdc44e1f67684c9e97a08f
Summary:
This PR adds the basic `ktfmt` setup in OSS to lint Kotlin files before they're imported into the Meta codebase, making collaboration with external contributors smoother for Android related PRs.
I tried to put together certain rules that mimic the current code style and it seems to work well as I get no errors for properly formatted files but this still might need some input to have the correct configuration.
Added two scripts to the main package.json:
- To check the files format you can run: `yarn lint-kotlin-check`
- To apply formatting fixes, run: `yarn lint-kotlin`
## Changelog:
[INTERNAL] - Kotlin: Set up ktfmt in OSS
Pull Request resolved: https://github.com/facebook/react-native/pull/52064
Test Plan:
Unformat any random Kotlin file inside ReactAndroid and then run:
```sh
yarn lint-kotlin-check
yarn lint-kotlin
```
Reviewed By: cipolleschi
Differential Revision: D78272876
Pulled By: cortinico
fbshipit-source-id: 0cf6b976968dfc5c6c478e88d17eb21c18961a34
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52602
changelog: [internal]
fixes RTL issue in View Culling where scroll view offset was not correctly adjusted for RTL. The example failing case is described in a test.
Reviewed By: lenaic
Differential Revision: D78322759
fbshipit-source-id: d60d98aa45d4d9b576b133990f64ef941e6618e8
Summary:
for IOS and React native windows we can observe that the macro conversion is incorrect in ParagraphProps particularly for selectable prop.
current conversion
```
case ([]() constexpr -> RawPropsPropNameHash { return facebook::react::fnv1a("isSelectable"); }()): fromRawValue(context, value, isSelectable, defaults.isSelectable); return;
```
issue is that isSelectable is not the raw prop therefore JS to native flow for the prop is not correct .
(Note : this works for Android as ReactProp(name = "selectable"): https://github.com/facebook/react-native/blob/bbc1e121c71d14803d29a931f642bf8ea6ee2023/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.kt#L97-L100 )
fix
```
RAW_SET_PROP_SWITCH_CASE(isSelectable, selectable)
```
Current implementation selectable prop is not working for IOS and React native windows as the macro conversion is incorrect in ParagraphProps particularly for selectable prop.
## Changelog:
Updated ParagraphProps macro conversion for isSelectable , keeping it backward compatible.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [FIXED] - Fix selectable prop not working correctly
[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/52599
Test Plan:
Tested on react native windows playground
Sample code
```
export default class Bootstrap extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.header}>Selectable vs Non-Selectable Text</Text>
<Text selectable={true} style={styles.text}>
✅ This text is selectable. You can long-press and copy it.
</Text>
<Text selectable={false} style={styles.text}>
❌ This text is not selectable. You cannot copy it.
</Text>
</View>
);
}
}
```
before fix debug output , native unaware of selectable prop values from JS
```
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', true'
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', false'
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
```
after fix debug output , native picks up selectable prop values from JS correctly
```
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', true'
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', false'
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 0
[ParagraphComponentView] DrawText - selectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 1
[ParagraphComponentView] DrawText - selectable: 1
[ParagraphComponentView] DrawText - selection logic would be enabled here.
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 0
[ParagraphComponentView] DrawText - selectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
```
Reviewed By: rozele
Differential Revision: D78333906
Pulled By: javache
fbshipit-source-id: 4d2f9ea591e991b1aed126e9fed72fdfe1a49ce9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52598
Defining this as {50%, 50%} mean we do unnecessary work as part of every transform. Instead set it to undefined, which means we'll ignore it when determining the final transform.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D78298587
fbshipit-source-id: 9d3b7375fc3bd9ea04f0a6d7e314fbba0fba6949
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52601
Changelog: [internal]
Fixes a bug in Fantom when throwing a value that's not an instance of `Error` in a test.
Reviewed By: javache
Differential Revision: D78332756
fbshipit-source-id: 350479dcb7bcea399070c6851aca76a1d1cc2629
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52597
Add a Flow lib def for `memfs`, for use in internal and subsequently Metro tests, now that `metro-memory-fs` is deprecated.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D78268713
fbshipit-source-id: f714000f2071f4bf45b4436cbd63fc6d74939f98
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52446
The logic for retrieving metrics from a placeholder character is kind of insane, and has been around since inline views were added built into TextView in Paper.
One of the workarounds, for old versions of Android on Samsung phones (no more info to bound the versions) causes incorrect behavior, at least in the case where we have RTL text in LTR layout.
Another, explicitly mentions `singleLine` with RTL para, a deprecated TextView prop, that doesn't apply to us here (and also could never apply to BoringLayout, since RTL chars are not boring).
We don't have these workarounds anywhere else (though we have some other workarounds for bidi crash in old Android), including other frameworks I could find.
Let's bias to cleaning this old code up.
Changelog:
[Android][Fixed] - Fix incorrect positioning of inline view at the end of string when RTL text in LTR container
Reviewed By: javache
Differential Revision: D77703906
fbshipit-source-id: f25a5e2f05100f0288f3889132b658cdabf26f22
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52574
Changelog: [Internal]
The main change here is to catch *all* exceptions in:
- loadScriptFromDevServer
- loadScriptFromBundlePath
so that we can make the `loadScript(...` method `noexcept`
Other methods which only call into `noexcept` methods have been marked with `noexcept` as well
Reviewed By: lenaic
Differential Revision: D78222989
fbshipit-source-id: 174ac2420e88c913662f857c875fef996959c564
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52582
Continues integration of `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.
NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.
**This diff**
Updates the Android inputs to `NetworkReporter` to support incremental string data HTTP responses (`Transfer-Encoding: chunked`).
Implemented:
- Incremental response case for `Network.getResponseBody` (fetch response previews).
- `Network.dataReceived` (incremental response update event).
This means that incremental responses, such as Metro bundle requests, can be displayed as previews in React Native DevTools.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77927896
fbshipit-source-id: 6eff2e7b94d3f784bbc33b1fecdc20242f98b39f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52487
Continues integration of `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.
NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.
**This diff**
Integrates `Network.storeRequestBody` on Android (CDP: [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event) to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.
This is integrated with `NetworkingModule.kt` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77927896.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77799617
fbshipit-source-id: 495baebbb3b447d1ea86705c1680578eed796d78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52566
This bumps the plugin we use to publish to Maven Central from 1.3.0 to 2.0.0
as it has better support for the latest Gradle feature.
We're not affected by the breaking changes so we should be good to go (nightlies will tell).
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D78161579
fbshipit-source-id: de5178b2cc17885636f17eabdb0eea4e5b1515dd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51493
Changelog: [IOS][FIXED] Don't retain cached images in state after `RCTImageComponentView` gets recycled
Fixes https://github.com/facebook/react-native/issues/51198
Crosspost from the task comment:
From what I've been able to figure out, it seems like the image shadow nodes (keeping the loaded image in state) are being kept in memory by shadow node reference wrappers. It doesn't seem strictly like a memory leak - manually triggering garbage collection causes those nodes to be deallocated, but since Hermes isn't aware of the memory they are retaining, I think, it doesn't trigger it automatically.
This diff releases the image data when the observers are notified and adds a new (`Consumed`) status to signify that.
Reviewed By: sammy-SC
Differential Revision: D75137263
fbshipit-source-id: 97eda7e6d1ef5cd633c4a5a4c37babc5e08968fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52545
Pull Request resolved: https://github.com/facebook/react-native/pull/51735
This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,
As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs
## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)
Reviewed By: cortinico
Differential Revision: D78118738
fbshipit-source-id: cdd9e660e55397bd0936efce1c5aaf90c2946b7a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52571
This diff fixes the following warning:
```
The corresponding parameter in the supertype 'XYZViewManager' is named 'value'. This may cause problems when calling this function with named arguments.
```
changelog: [Android][Changed] Changed method arguments names for Core ViewManagers to match the names of ViewManagerInterfaces
Reviewed By: cortinico
Differential Revision: D78170316
fbshipit-source-id: 29a2611eabb4e260bd6126aeca95516912ea4b4d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52485
Begins integrating `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.
Since the larger lift of initial setup and the C++ subsystem has been done for iOS, this will be a lighter stack of changes solely setting up necessary integration points in the Android Networking stack.
NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.
**This diff**
Initially integrates the `NetworkReporter` methods corresponding to the `Network.requestWillBeSent`, `Network.requestWillBeSentExtraInfo`, `Network.responseReceived`, `Network.loadingFinished` CDP events, which are sufficient for populating a minimally rendered Network request list.
- Create JNI `InspectorNetworkReporter` helper class (may also become the later public API for 3P reporting into the `Network` domain).
- Renames `ResponseUtil.kt` as `NetworkEventUtil.kt`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D71897099
fbshipit-source-id: 90972a5bfa34a095252b7e745e5f4afeb53b0ebe
Summary:
Bump Metro to 0.83.0.
This release contains some breaking changes for integrators, and a minimum Node.js version of 22.14.
Full release notes: https://github.com/facebook/metro/releases/tag/v0.83.0
Changelog: [General][Changed] Bump Metro to ^0.83.0
Test Plan:
Imported from GitHub, without a `Test Plan:` line.
Rollback Plan:
Differential Revision: D78171925
Pulled By: robhogan
fbshipit-source-id: 7ea5e04d285632a14dd71ba00da872d60f283840
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52572
We'd like to stop supporting `metro-memory-fs` - there are better alternatives out there.
This replaces the one usage of `metro-memory-fs` in `react-native` with `memfs`, and swaps the dependency.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D78161921
fbshipit-source-id: 139233adac413a4f47a0d56d9e08ec841abaf47c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52543
Prefixing "eager" to the name makes it less confusing. React native already has main queue modules: they're just lazy.
Changelog: [Internal]
Reviewed By: lunaleaps
Differential Revision: D78109287
fbshipit-source-id: 5fa6095d2dd8fcf74fdda64e05483eb487bc8f56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52544
Let's remove these runtime errors for now. We can re-introduce this later, if needed.
Main queue coordinator will make "unsafe execute on main queue sync" not deadlock.
Changelog: [Internal]
Reviewed By: lunaleaps
Differential Revision: D78109286
fbshipit-source-id: 7c3acc2e560e341889d8ede4665bc70fefc2f058
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52570
JSONArguments is a set of utility methods that are not part of the legacy architecture, removing the annotation.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D78168536
fbshipit-source-id: 25fcc41441df6c71f9a96ec0ba82c42e8f6af80c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52564
Currently, `metro-babel-register` has a function as its default export, to which we've tagged on various properties.
This tidies that up to a more idiomatic object of named exports, with `register` as a new one of them.
This also serves to make it more compatible with automatic TypeScript generation.
This is semver breaking, but `metro-babel-register` has very little usage outside Meta projects so isn't expected to be disruptive.
Changelog: [Internal]
Metro changelog:
```
- **[Breaking]**: Move metro-babel-register's main function to a named export `register`
```
Reviewed By: huntie
Differential Revision: D78157559
fbshipit-source-id: c59c9820e9895007345561fed9ccec2273b925c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52561
The removed code comment is pretty clear that this workaround is in place for a specific bug, which was closed in a Node.js 8.x minor: https://github.com/nodejs/node/issues/13391
A related issue descibed a problem that still existed in Node 10:
https://github.com/nodejs/node/issues/27363
Subsequent comments reporting problems with newer Node.js versions all seem to relate to mismatched configuration with load balancers, not directly relevant to Metro.
Reproducers for the original bugs no longer repro on new Node.js (tested with 22.14), so I think it's safe to conclude this is fixed.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D78158427
fbshipit-source-id: 0be5dbc4334ac7b0bbccde44a840caac43deb4df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52548
Changelog: [Internal]
While this does not cause real crashes as the code is already gated via
```
bool haveRHS = j < rhs.operations.size();
```
it still represents a bug in the logic
Reviewed By: rshest
Differential Revision: D78133364
fbshipit-source-id: 80efc97b5174e3d0d7efe33604255a96bc856e87
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52565
When we implemented caching in prebuilds for RN core for iOS, we were naïve in choosing the cache key. The current cache key does not consider the source code that is built and this can be problematic.
Imagine a contributor that changes a file in a React folder in their PR, but CI reuses a binary created from `main` and so everything will work well in CI even if the change contains an error.
This change globs over the header and implementation files in the React, ReactCommon and Libraries folder to ensure that we rebuild the code when iOS code changes.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D78161427
fbshipit-source-id: e612b76232308835eb88c3776122bebd1316f751
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52560
Changelog: [internal]
This migrates the profiling logic for `XMLHttpRequest` from `performance.measure` to `console.timeStamp` with built-in support for tracks.
Reviewed By: hoxyq
Differential Revision: D78157407
fbshipit-source-id: 0ef060557a00e7973ef7f0478b26b81471d38226
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52542
Changelog: [internal]
This adds support to propagate performance entries logged to `console.timeStamp` to Perfetto, if enabled. It also modifies the Perfetto integration to support track groups, in addition to track names.
Reviewed By: hoxyq
Differential Revision: D78092596
fbshipit-source-id: 76b0fe2738d856fd75ee941de223d6a6a73d8e1c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52535
Those constructors are no longer necessary. They're deprecated + the class is internal so they're not breaking changes.
I'm just cleaning them up as they're not needed anymore.
Changelog:
[Internal] [Changed] - Remove deprecated constructors for TextInput *Event classes
Reviewed By: javache
Differential Revision: D78095748
fbshipit-source-id: 2dc6c750f8470a88918d8a69b68364f38251d79e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52562
This change use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D78159367
fbshipit-source-id: 64486c99fdbc54487dbcff786209cacac304b9b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52563
The test_ios_rntester_dynamic_frameworks is identical to the test_ios_rntester but for the framework parameter.
This change unifies the two, using a matrix to test all the configurations:
- Debug / Static Libraries
- Release / Static Libraries
- Debug / Dynamic Frameworks
- Release / Dynamic Frameworks
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D78159366
fbshipit-source-id: b321f295477fe3ae6e43c7518d47afb0714bddb8
Summary:
This change tries to use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI
bypass-github-export-checks
## Changelog:
[Internal] -
Pull Request resolved: https://github.com/facebook/react-native/pull/52531
Test Plan:
Build rntester using prebuilds:
```
# after downloading the prebuilds from CI and unzipping them
export HERMES_ENGINE_TARBALL_PATH=~/Downloads/hermes-ios-Debug.tar.gz
export RCT_USE_LOCAL_RN_DEP=~/Downloads/reactnative-dependencies-debug.tar.gz
export RCT_TESTONLY_RNCORE_TARBALL_PATH=~/Downloads/React.xcframework.tar.gz
USE_FRAMEWORKS=dynamic bundle exec pod install
open RNTesterPods.xcworkspace
```
And then build from Xcode.
Reviewed By: rshest
Differential Revision: D78158734
Pulled By: cipolleschi
fbshipit-source-id: 43cbb66bd44fa621292b69de0dadde5ed20c4574
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52549
Changelog: [Internal]
- The #includes are not used
- `enum class` is C++, (enum is C)
Reviewed By: rshest
Differential Revision: D78135339
fbshipit-source-id: 1a35301ea063ce17c195be7dc373132d342f111a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52556
Changelog: [internal]
This adds a new benchmark for `performance.measure` to measure the performance of calling it without arguments.
Reviewed By: hoxyq
Differential Revision: D78013563
fbshipit-source-id: 84e2151d9d91cfc2e85d310f42010483e7304648
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52557
Changelog: [internal]
`PerformanceEntry.detail` should be `null` if not defined, not undefined as it is currently. This fixes that.
Reviewed By: hoxyq
Differential Revision: D78013568
fbshipit-source-id: b22dfdd8d582594fc1e5199264e8af92c26bb0ea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52558
Changelog: [internal]
Small refactors for `$ReadOnly`, move `getCurrentTimeStamp` to utils so it can be reused, etc.
Reviewed By: hoxyq
Differential Revision: D78013570
fbshipit-source-id: f73d119f22dd4dc9aaa5efef76a1156821ecd8de
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14797
We were facing a type conversion error in the DynamicEventPayload::extractValue() method. The function signature declares a return type of std::optional<double>, but when handling INT64 values, but when handling `INT64` values, the code was directly returning `dynamic.asInt()` without proper type conversion
We faced the issue while integrating https://github.com/microsoft/react-native-windows/pull/14791
## Changelog:
[General][Fixed]
Pull Request resolved: https://github.com/facebook/react-native/pull/52525
Test Plan:
The fix involved wrapping the dynamic.asInt() call with static_cast<double>(), creating the corrected line: return static_cast<double>(dynamic.asInt())
Tested E2E in RNW
Reviewed By: andrewdacenko
Differential Revision: D78083842
Pulled By: rshest
fbshipit-source-id: 8dbedd67fa7c21e89b863d8b1bc7b9e0d7978b9f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52530
This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.
Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner
X-link: https://github.com/facebook/yoga/pull/1826
Reviewed By: adityasharat, NickGerleman
Differential Revision: D78084270
Pulled By: j-piasecki
fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52532
Since we updated TypeScript in https://github.com/facebook/react-native/pull/51831, ESLint has printed a warning that `typescript/eslint` doesn't support our TS version.
This updates it to fix the warning.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D77833826
fbshipit-source-id: 29a5179c4f223a8cc0ab2c8071f0a5efa09e5edc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52533
This method is deprecated in the JavaDoc but not correctly annotated as Deprecated, let's fix it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D78092468
fbshipit-source-id: 31e4cb958a51b20f5105a4bec3366d67402e5419
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528
This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.
Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`
Original commit changeset: 869e81f0ae00
Original Phabricator Diff: D75324251
Reviewed By: huntie
Differential Revision: D78085848
fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
Summary:
This PR fixes the following build error while trying to build `react-native@0.81.0-rc.0` app with `react-native-screens@4.10.0` installed using react-native prebuilds (AAR) due to a missing `react/renderer/bridging/bridging.h` file in `prefab/modules/` inside `react-android-0.81.0-rc.0-debug.aar`.
```
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:12:
In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/FabricUIManagerBinding.h:22:
/Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/uimanager/primitives.h:14:10: fatal error: 'react/renderer/bridging/bridging.h' file not found
14 | #include <react/renderer/bridging/bridging.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
```
## Changelog:
[ANDROID] [CHANGED] - Expose `react_renderer_bridging` headers via prefab
Pull Request resolved: https://github.com/facebook/react-native/pull/52529
Reviewed By: cipolleschi
Differential Revision: D78092428
Pulled By: cortinico
fbshipit-source-id: de8208ae7545201f600c277a0c8907575c310c58
Summary:
Fixes #T228219721
This commit adds the debug/release switch script like we have for rn deps and hermes for react-core prebuilt:
- Added script: replace-rncore-version-js
- Inserted script into React-Core-prebuilt podspec
- Updated rncore.rb with correct filenames
bypass-github-export-checks
## Changelog:
[IOS] [ADDED] - add release/debug switch script for React-Core-prebuilt
Pull Request resolved: https://github.com/facebook/react-native/pull/52498
Test Plan: Run in RNTester and switch between release/debug
Reviewed By: rshest
Differential Revision: D78012917
Pulled By: cipolleschi
fbshipit-source-id: 71cad23cd41484a8253fc89d5dce8653649657a0
Summary:
Instead of returning when creating the list of header files from our podspecs, we now call `continue`. This is a bug that causes all subsequent globs in the header file list to be omitted after the first omitted glob.
bypass-github-export-checks
## Changelog:
[IOS] [FIXED] - Fixed premature return in header file generation from podspec globs
Pull Request resolved: https://github.com/facebook/react-native/pull/52490
Test Plan: Run prebuild scripts and verify that React-Fabric podspec headers are included in the resulting xcframework.
Reviewed By: mdvacca
Differential Revision: D78012399
Pulled By: cipolleschi
fbshipit-source-id: 2d334f4f7ff966ea4c778786a7056e13a255a708
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.
This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.
In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.
bypass-github-export-checks
## Changelog:
[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core
Pull Request resolved: https://github.com/facebook/react-native/pull/52489
Test Plan:
RNTester:
- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.
Reviewed By: mdvacca
Differential Revision: D78012332
Pulled By: cipolleschi
fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52519
Changelog: [Internal] - Experiment with intersection logic for VirtualViews in scrollView. Currently only on Android
### Changes in detail
`VirtualViewContainer` is held by the ScrollView and is lazily instantiated once a VirtualView tries to access.
Upon initial layout, a VirtualView will add itself to the container and report its updated `rect`. `VirtualViewContainer` holds a sorted list of VirtualViews and iterates through them to update mode
Reviewed By: yungsters
Differential Revision: D77313890
fbshipit-source-id: 30843143bf1828dcac9091479964e83934bf330c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52521
Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing.
## Changelog
[Internal]
Reviewed By: christophpurrer
Differential Revision: D78005971
fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
Summary:
accessibilityRole is not getting the default value from sourceProps.
This change will fix https://github.com/facebook/react-native/issues/52396
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Fixed accessibilityRole parsing.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Added fix for setting the default value for accessibility props
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52397
Test Plan: After this change accessibilityRole will get the default value from sourceProps.
Reviewed By: joevilches
Differential Revision: D77879025
Pulled By: NickGerleman
fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52474
1. Enables the feature flags for fragment refs on fbsource
2. Adds a test with Fantom for usage of `FragmentInstance#observeUsing` and `FragmentInstance#unobserveUsing`.
3. Exposes the `ReactFragmentInstance` type with the common methods that are used on native. We can override the DOM only methods in www libdefs.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D74326262
fbshipit-source-id: e35ee45b23179ad3ba5527763567c9b04c127eff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52514
As per title, this change add the `ENTERPRISE_REPOSITORY` env variable so that users can use their owm maven mirror to consume artifacts rather than the official url.
This is helpful as:
- we can reduce the traffic toward maven central
- companies can speed up their builds by relying on local/closer replicas
## Changelog:
[iOS][Added] - Add the `ENTERPRISE_REPOSITORY` env variable to cocopaods infra
Reviewed By: cortinico
Differential Revision: D78011424
fbshipit-source-id: 24b83b4866095d7fe3318362afc5075b99b146e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52511
# Changelog: [Internal]
This is actually used in React for logging triggers, like Mount / Unmount / Reconnect / Disconnect.
Reviewed By: huntie
Differential Revision: D78008351
fbshipit-source-id: 9d39d45da499ce78172531c00cc7465b985c2646
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52494
Changelog: [Internal]
- Use C++ private namespace instead of C static methods
- Strongly type C++ TM functions via AsyncCallback
Reviewed By: javache
Differential Revision: D77978354
fbshipit-source-id: 2274b95cfc5b65392fc3c808bbdf54ec4ab3a37e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52512
The way Maven works is that the artifacts are uploaded and available way before the browsing UI will allow us to browse them.
By trying to download the `.pom` file instead of checking for the browsing website to be visible, we can shave some minutes during the release
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D78008635
fbshipit-source-id: 96516163628d6d25db385d996a11b4af78db764a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52513
We bumped the requirement for cocoapods to use Xcode 16.1 or greater.
This job was not update and therefore it failed when releasing 0.81.0-rc.0.
This change should fix it and it should be cherry picked in the release branch too.
By default, the macos executor in github actions are using Xcode 15.2
## Changelog
[Internal] -
Reviewed By: cortinico, fabriziocucci
Differential Revision: D78008316
fbshipit-source-id: 4d05233ca3b936cf128400030328124c453963ea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52509
When building the CI Workflow to build React Native prebuilds, we were reading the react-native's version from the root package.json. This package.json is not updated by the release script, so the version is always 1000.
This makes the build process fail for stable releases.
With this change, we read the version from the right package.json file
## Changelog:
[Internal] - Read React Native version from the right package.json file
Reviewed By: cortinico
Differential Revision: D78007906
fbshipit-source-id: 35f868a1c203245fdcf518ee81957352e3ab1de7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52505
changelog: [internal]
there is a race condition where `startRenderCallbackIfNeeded` may be called from JS thread and the main thread at the same time, leading to a crash. To address this, this diff adds uses a boolean to make sure `startOnRenderCallback_` is only called once and `stopOnRenderCallback_` is only called after start was called.
Reviewed By: javache
Differential Revision: D77871230
fbshipit-source-id: 6d7fba596e7146adaff6f8dbe1f436ddd59950c6
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14666
We faced this issue while integrating [0.79.0-nightly-20250220-41b597c73](https://github.com/microsoft/react-native-windows/pull/14662/files#top)
This warning is treated as error and should be fixed here as well.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52496
Test Plan:
Fixed error:
##[error]node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): Error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data
2>D:\a_work\1\s\node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data [D:\a_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
(compiling source file '../../node_modules/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp')
Tested E2E in RNW
Reviewed By: javache
Differential Revision: D78000818
Pulled By: rshest
fbshipit-source-id: 5caafc5e92540f722b009480f030276e526355af
Summary:
This is a backport of a fix we applied to the 0.81 branch.
Changelog:
[Internal] [Changed] -
bypass-github-export-checks
Reviewed By: vzaidman
Differential Revision: D78000573
fbshipit-source-id: 64a4e90632158c1f52c45f9fbc3452e848271e94
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473
Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D77873875
fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52441
When an error is thrown using `handleHostException` from within the (immediate) execution of a `Task`, the `Task` will capture the error. If those errors are never consumed, the error is just silently swallowed. Instead we should make sure that this is raised outside of the context of a `Task` so the error correctly bubbles up and crashes the app (in release).
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D77798248
fbshipit-source-id: 41803aba0cace0e364a235501cf34bb946e7ff51
Summary:
This came out of https://github.com/facebook/react-native/issues/52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.
## Changelog:
[INTERNAL] - Clean up unnecessary test setup for Android tests
Pull Request resolved: https://github.com/facebook/react-native/pull/52471
Test Plan:
```sh
yarn test-android
```
Reviewed By: cortinico
Differential Revision: D77926887
Pulled By: javache
fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52483
Changelog: [internal]
This is a small refinement for `performance.mark` and `performance.measure` to use `structuredClone` to copy the value of the `detail` field, instead of assigning it by reference.
This still doesn't completely fix the semantics of `performance.mark` and `performance.measure`, as the entries returned by those methods aren't referentially equal to the entries reported by `PerformanceObserver` (and the latter don't have the `detail` field yet).
Reviewed By: huntie
Differential Revision: D77863037
fbshipit-source-id: 54d959612ecd560250e49bb0887bb12112a0142f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52476
Changelog: [Internal] - Refactor package structure on Android to prepare for experimental VirtualView so that non-view related objects go under `virtual` and the native view goes under `view`.
This breaks dependency circles for experimental VirtualView in upcoming change.
Reviewed By: yungsters
Differential Revision: D77335426
fbshipit-source-id: 3b978e9cc5ad376c71aebc039cfc74d2515d2cfa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52470
These metrics are not actively consumed and are highly noisy.
Changelog: [Android][Removed] Deprecated MessageQueueThreadPerfStats API and replaced with stub.
Reviewed By: cortinico
Differential Revision: D77867087
fbshipit-source-id: 8bf7423ad60cb3bb21a5dbe94771d5a71832633d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399
I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.
Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes
Reviewed By: mdvacca
Differential Revision: D77736713
fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
It is not included in any RNTester app at this time
Reviewed By: cortinico
Differential Revision: D77771111
fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401
changelog: [internal]
- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias
This change continues the effort to remove type aliases in favor of explicit standard library types for better code clarity and maintainability.
Reviewed By: christophpurrer
Differential Revision: D77652083
fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52465
Changelog: [internal]
Now that we have enough coverage for the Performance API in Fantom, Jest tests where most of the API is mocked are redundant and useless, so this removes them (and the mock).
Reviewed By: huntie
Differential Revision: D77860888
fbshipit-source-id: 7dbd1a8a43b056a3b34e4e37d578be9ccb521824
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52462
Changelog: [internal]
This adds a few more tests for `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType`.
Reviewed By: huntie
Differential Revision: D77801746
fbshipit-source-id: 42f80c4e2b787c455b149ee38d071511181532b0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52431
Changelog: [internal]
`performance.measure` supports passing mark names as `start` and `end` options, so this fixes the Flow type before fixing the actual implementation.
It also makes it so you can't specify both `end` and `duration`, enforced by the type system.
Reviewed By: huntie
Differential Revision: D77795991
fbshipit-source-id: e89f509c7efc2fa49d17d79bc19bc1d14e007871
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432
Changelog: [internal]
This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.
Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.
Reviewed By: huntie
Differential Revision: D77795989
fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402
changelog: [internal]
Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.
Reviewed By: christophpurrer
Differential Revision: D77651676
fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
It is not included in any RNTester app at this time
Reviewed By: cortinico
Differential Revision: D77770455
fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
Reviewed By: javache
Differential Revision: D77765443
fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52388
Changelog: [Internal]
Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>`
Reviewed By: rbergerjr
Differential Revision: D77712020
fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52456
Remove the last use of a Metro deep import in preparation for making all deep imports semver-private.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D77450110
fbshipit-source-id: de7aa9c1f6b0d281fe8a6c3bd95e721c5bb58c63
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52438
Motivation: After some investigation, these make sense as private APIs, and we intend to modify `UriHandler` slightly in order to report blob response body payloads via CDP for Network debugging.
Changelog:
[Android][Removed] - Internalize `NetworkingModule`'s `UriHandler`, `RequestBodyHandler`, and `ResponseHandler` APIs
Reviewed By: cortinico
Differential Revision: D77799144
fbshipit-source-id: 20c36f52a900830091a253ab9917832c30b31d31
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52436
Reordered the different property types in the switch/case to group similar outputs together.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D77799101
fbshipit-source-id: 5b7c6d188e9ffa0f1e41f44f82f438afeda04d74
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52439
Users should not be passing true/false values for the 3 params in the `load()` method. The app template already uses the no param overload.
I'm deprecating it so it can go in 0.81.
Changelog:
[Android] [Changed] - Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean)
Reviewed By: rubennorte
Differential Revision: D77739268
fbshipit-source-id: c901d1ed2e9623b0fa39f4e2d79f25404c284b8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52427
Adds and wires up a minimal implementation of `PerformanceResourceTiming` on the JS side. This materialises D74245441 in user space.
When all feature flags are enabled, network requests can now be observed from JS via `PerformanceObserver`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D75062713
fbshipit-source-id: 06523e70f57feaaa53432ef21fa92676d1e90360
Summary:
reverting Refactor ViewManagerInterfaces codegen to generate kotlin classes because of warning in OSS, we will reland after 0.81 cut
Changelog: [Android][Breaking] - Revert of Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)
Reviewed By: lenaic, mlord93
Differential Revision: D77759777
fbshipit-source-id: c24b216b231cdc53296d8c9fca8d789d80daa596
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52393
## Changelog:
[General][Deprecated] - ShadowNode::Shared is now deprecated. Use `std::shared_ptr<const ShadowNode>` instead.
- Mark ShadowNode::Shared as deprecated in ShadowNode.h
- Replace all uses of ShadowNode::Shared with std::shared_ptr<const ShadowNode>.
This continues the systematic effort to remove ShadowNode type aliases in favor of explicit standard library types for improved code clarity and maintainability.
Reviewed By: christophpurrer
Differential Revision: D77650696
fbshipit-source-id: b4769e2a1e39f49d14d5927be105487ecf69fa3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52405
This field has been deprecated since RN 0.77, we can safely remove it ahead of the branch cut.
Changelog:
[Android] [Removed] - Remove deprecated `isStartSamplingProfilerOnInit` from `DeveloperSettings`
Reviewed By: mdvacca, javache
Differential Revision: D77734913
fbshipit-source-id: 231ecb360921d48ec941a3a214e73b4b89446c13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52395
This method was exposed as `public` but there is no need for us to expose it in OSS.
So I'm marking it as internal.
Changelog:
[Internal] [Changed] - Make loadWithFeatureFlags correctly internal
Reviewed By: mlord93, mdvacca, javache
Differential Revision: D77734270
fbshipit-source-id: 34e1d7aaa4a5bf3563c78aad570e2310592bcc77
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52382
Changelog: [Internal]
In C++, both `virtual ~CallInvoker() {}` and `virtual ~CallInvoker() = default` can be used to define a virtual destructor. However, they have slightly different implications:
1. `virtual ~CallInvoker() {}`:
* This is the traditional way of defining a virtual destructor.
* It provides an empty implementation for the destructor, which does nothing.
* The compiler will not generate a default implementation, as you've provided one explicitly.
2. `virtual ~CallInvoker() = default`:
* This is a more modern way of defining a virtual destructor (introduced in C++11).
* It tells the compiler to generate a default implementation for the destructor.
* The default implementation will perform the necessary cleanup operations, such as calling the destructors of base classes and member variables.
In general, `= default` is considered better because it:
* Avoids unnecessary code duplication: By letting the compiler generate the default implementation, you avoid duplicating code that's already generated by the compiler.
* Improves maintainability: If the class has member variables or base classes with non-trivial destructors, using `= default` ensures that the correct cleanup operations are performed without requiring manual updates.
* Conveys intent: Using `= default` clearly indicates that the destructor should perform its default behavior, making the code easier to understand.
So, unless you have a specific reason to provide a custom implementation, `virtual ~CallInvoker() = default` is generally the better choice.
Reviewed By: rshest
Differential Revision: D77685932
fbshipit-source-id: 78c81f8e400069ad38d8d7405dafeb0b6db8e67b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52347
We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.
With this we just manually build a tree that contains the elements we care about in the order we want.
We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D77258926
fbshipit-source-id: 767ebc880a2efbf7934b9e7dee3013dd7822e5ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52297
Doing virtual views is the only way of making it possible to add the host view into the order. This however is too complex for very little gain, we are opting to go for a cleaner solution with the trade off of not being able to add the host view.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D77278752
fbshipit-source-id: 709b995f51a9a03f6d07f2e24f8aea21d62d95c4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51735
This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,
As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs
## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)
Reviewed By: javache
Differential Revision: D75719542
fbshipit-source-id: 7e9aa7ccc24e827bd7b6df72b3302e852932e731
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52400
`react-stack-bottom-frame` -> `react_stack_bottom_frame`.
This survives `babel/plugin-transform-function-name`, but now frames
will be displayed as `at Object.react_stack_bottom_frame (...)` in V8.
Checks that were relying on exact function name match were updated to
use either `.indexOf()` or `.includes()`
For backwards compatibility, both React DevTools and Flight Client will
look for both options. I am not so sure about the latter and if React
version is locked.
DiffTrain build for [91d097b2c588a0977a7a10ed12512dc8a34e3a5b](https://github.com/facebook/react/commit/91d097b2c588a0977a7a10ed12512dc8a34e3a5b)
Reviewed By: jackpope
Differential Revision: D77601866
fbshipit-source-id: 24ed8713af4bebbaeb7a612333cd79c51b696565
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.
Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):
<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />
Using `WindowMetricsCalculator` from AndroidX:
<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />
Fixes https://github.com/facebook/react-native/issues/47080
## Changelog:
[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/47554
Test Plan:
Run the example app on an Android < 15 device.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D77547628
Pulled By: alanleedev
fbshipit-source-id: 9d841f642d5b7ef3294dfbf3868137087a672ad6
Summary:
We need to upgrade the targetSdk to 36, which requires ensuring compatibility with the latest Android APIs and addressing any deprecations or behavior changes introduced in this version.
## Changelog:
[Android] [Changed] - Updated targetSdk to 36 in Android.
Pull Request resolved: https://github.com/facebook/react-native/pull/52355
Test Plan:
- Verified that the app builds and runs successfully with targetSdkVersion 36.
- Ran the full suite of unit and instrumentation tests: all tests passed.
- Manually tested key user flows (login, navigation, data sync) on devices running Android 14 (API 34) and emulator with API 36
- Confirmed that there are no runtime crashes or warnings related to `targetSDK` upgrade.
Behavioral guide for migration: https://developer.android.com/about/versions/16/behavior-changes-16
Reviewed By: fabriziocucci
Differential Revision: D77728391
Pulled By: cortinico
fbshipit-source-id: 3f714f900bbeecc56c0cf46c54b4e42c532c8384
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52335
Adds support for `Network.requestWillBeSentExtraInfo` and `Network.dataReceived` CDP events in jsinspector-modern and wires up for iOS.
In particular, `Network.requestWillBeSentExtraInfo` is necessary to populate request headers in the UI.
**End of base Network implementation for iOS**
After this diff, we are spec-complete on all CDP Network methods for our V1, on iOS.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D77489476
fbshipit-source-id: 84aa4da9d9fcbdc61eff236fc6bd2136496910a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52334
Adds support for `Network.loadingFailed` in jsinspector-modern and wires up for iOS.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D77489477
fbshipit-source-id: dc8156979fe49583819019fa4b88b6eb99dea734
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52331
Updates the iOS inputs to `NetworkReporter` to support incremental string data HTTP responses (`Transfer-Encoding: chunked`).
This means that incremental responses, such as Metro bundle requests, can be displayed as previews in React Native DevTools.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D77457109
fbshipit-source-id: 00a622dbac97c38e07c67b5ee3661c8d586f6fe1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52332
Adds support for the [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event in `jsinspector-modern` and configures this for iOS. This enables us to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.
This is integrated with `RCTNetworking.mm` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77457109.
**Implementation notes**
- Adds a new `BoundedRequestBuffer` construct to safely buffer response previews at a max memory size.
- `RCTNetworking` will always call `maybeStoreResponseBody` (when feature flag enabled), but is unaware whether there is an active CDP debugging session with network support or not.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D74319394
fbshipit-source-id: c9dbb44551c15d1b1a7cce56b35bf829f8a99dc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52380
Apps that rely support focus in FlatList rendered items are missing out on a FlatList optimization that defers rendering for offscreen content updates.
For example, on Android, if you focus and smooth scroll an item into view, the onScroll event will fire first. For most sufficiently large virtualization windows, the next render will be delayed by the render batch timeout as most materialization of virtualized views is not treated as a high pri render.
However, this batch / timeout mechanism isn't being used for cell render updates that occur as a result of a focus change.
This change adds the same timeout mechanism used for scroll events. In most cases, the view that is focused is in the viewport, and the extra rendering needed is already scheduled (or executed with high priority if needed) when the onScroll event is processed.
In cases where the focus change occurs outside the viewport, most platforms will want to do some kind of "bring into view" anyway, and the same applies - onScroll will take care of scheduling the cell rendering priority.
## Changelog
[Internal]
Reviewed By: NickGerleman
Differential Revision: D77681274
fbshipit-source-id: 1ade377e513eca21338a380ff9299dd410606aec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52358
Another class going from Java to Kotlin.
This is quite involved due to the amount of Raw generics we were using so I'd appreaciate a couple of further eyes here.
Changelog:
[Android] [Changed] - Convert UIManagerModuleConstantsHelper to Kotlin
Reviewed By: mdvacca, javache
Differential Revision: D77589975
fbshipit-source-id: 477c1e2a8dfd31db60047fd1252f6d47c177f5c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378
This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:
```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```
This will remove all the existing Maven repositories and only use the internal mirror they have.
Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.
Reviewed By: mdvacca
Differential Revision: D77667573
fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52387
I would like to grab this in a subclass but unfortunately can't. It is kinda jank since this is a val obtained via reflection, but I figure this is better than copy and paste. I think that I could also expose a function that uses this scroller the way I want it to. Let me know if there are strong objections here
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D77684599
fbshipit-source-id: 6f02c1da5135c1cf34fa1483542e06bf8f0be75e
Summary:
This change fixes an issue on iOS where gradients that fade to a transparent color-stop appear dark or "muddy." The fix ensures that the color's hue is preserved during the transition, matching the behavior on Android and web.
### The Problem
When creating a gradient on iOS (e.g., linear-gradient(red, transparent)), the transparent keyword is treated as transparent black (rgba(0,0,0,0)). The `CAGradientLayer` on iOS then interpolates all color channels linearly, causing the red, green, and blue components of the start color to fade to 0. This transition through black results in an undesirable dark or "muddy" appearance in the middle of the gradient.
## Changelog:
[IOS][FIXED] - Gradient interpolation for transparent colors
<!-- 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/52249
Test Plan:
Checkout `LinearGradient` example in RNTester, checkout the newly added transparent color transition example, it should render same on android and iOS.
| Before | After |
| --- | --- |
| <img src="https://github.com/user-attachments/assets/c0bb54ad-ed0e-4a80-b37f-0458af0f1f77" width="300"> | <img src="https://github.com/user-attachments/assets/02da921a-bd0e-45c1-881c-cf6460d5ed43" width="300"> |
| `linear-gradient(to right, red, transparent)` transitions to black on iOS, creating a dark effect. | The gradient correctly fades the red color's alpha channel to zero |
Reviewed By: javache
Differential Revision: D77312194
Pulled By: NickGerleman
fbshipit-source-id: 053df8e44f52cd22a3f28fd01f583f7d03c66af5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52386
Enum `values()` function makes a copy of an underlying array on each call. This happens in a hot path, and seems to show up during profiling. Let's cache it.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D77623705
fbshipit-source-id: 5a33425822f477f63fe104ca9e5ed474385a2022
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52385
This replaces `buildSpannableFromFragmentsOptimized()` with a more optimized version. There are a couple main changes.
1. We don't need a complicated structure around ordering, and span priority, that made its way from the Java ShadowNode logic. AttributedString already ensures there are no overlapping attributes per fragment.
2. `SpannableStringBuilder` is a complicated text-editor style data structure, optimized to allow text content to be modified, and spans re-applied. We can use a much lighter `SpannableString`, on top of the ahead-of-time known text content, which is faster, and saves around 500 bytes per string (and prepared layout). If we assign this to an `EditText`, which later gets edited, Android will copy it to a `SpannableStringBuilder`.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D77622848
fbshipit-source-id: 69bbac86e1f0fd4a15dab6bc279cca305f2a53ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52372
This is just a follow-up on top D77025333 to make sure that the links in the blog posts and the GitHub releases keep working.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77654056
fbshipit-source-id: a1c6df44ebee058dd5b59e5b6a60c7c1e060e52c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52370
This is just a patch bump of Gradle ahead of the 0.81 branch cut.
Changelog:
[Android] [Changed] - Bump Gradle to 8.14.2
Reviewed By: fabriziocucci
Differential Revision: D77601121
fbshipit-source-id: b2fdc8b022f2ab43997f412c77e0c924c01f1a5d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52369
Tiny fix where the system status bar elements were no longer visible under Android edge-to-edge.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77653633
fbshipit-source-id: 1275a0de6665a6ef4599166fb205865cd581bb41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359
This is needed ahead of the 81 branch cut.
Changelog:
[Internal] - Bump all packages to 0.81.0-main
Reviewed By: huntie
Differential Revision: D77602196
fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52357
Changelog: [Internal]
Adds a hyper-minimal build script using `electron/packager` that produces custom binaries for the experimental React Native DevTools standalone shell. The main user-facing benefit of this is replacing the Electron name and icon with our own branding.
NOTE: `electron/packager` is designed to include the application code in the resulting binary. This is arguably overkill for us - the current launch model of `electron src/electron/index.js` is actually wholly sufficient for what we need - but I decided to go with the grain of the available tooling for simplicity.
Icon design courtesy of huntie. 🙏
Reviewed By: huntie
Differential Revision: D77591742
fbshipit-source-id: a968465df4f54fba54c874b6300788e151600ed7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52365
Adds type imports autofix support and pass `fb_internal` paths in react native deep imports eslint rule. The rule fixes imports with all matched types with static API mapping to prevent splits.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D77445445
fbshipit-source-id: cd5b75b4b3b53792117b8297352dddc4d63dbf70
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52345
changelog: [internal]
I would like to measure impact of D76597973 to get a better understanding of UIKit's rendering.
Reviewed By: yungsters
Differential Revision: D77542666
fbshipit-source-id: 4c2de4f36d2b374d83df934dd3a98d01b24f487f
Summary:
This PR connects breaking change detection with a danger bot. The action takes snapshot from main branch and from the PR as inputs to`diff-api-snapshot` (saved in runner temp directory).
## Changelog:
[Internal]
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52045
Reviewed By: huntie
Differential Revision: D76735630
Pulled By: coado
fbshipit-source-id: 9208117340c1e0bf10d58b67892727717d22e62f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52353
This diff aligns breaking change detection script with new snapshot format. It compares hashes to determine if the API changed for each specifier.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D77377762
fbshipit-source-id: e1c69692ace389fb08ae9470b9f9631e53834206
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52342
This diff deletes `public-api-test` for detecting changes in public API. It is replaced with public API snapshot validation (in D76340729) for better detection and understanding of changes that influence external interfaces.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D77531763
fbshipit-source-id: a8ef2b6f52fa6efb5b312598ea3e4746fc51e4ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52352
This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.
### Motivation
Detect react-native public API changes before they land.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D76340729
fbshipit-source-id: 10c465418e0ba4eb05cf557a16119f9756843d9e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52343
This diff commits our V2 JavaScript API snapshot for React Native.
This is a new format and workflow that replaces the previous `public-api-test` Jest test.
Please look at the file header for up-to-date instructions on updating the API snapshot.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D77532617
fbshipit-source-id: d5faae815aa5071b0f472fcb02318b73772b11cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52268
Ships the feature flag introduced in https://github.com/facebook/react-native/pull/51719 to fix crahes that result from shadowed animated style values.
Changelog:
[General][Changed] - Animated now always flattens `props.style`, which fixes an error that results from `props.style` objects in which `AnimatedNode` instances are shadowed (i.e. flattened to not exist in the resulting `props.style` object).
Reviewed By: javache
Differential Revision: D77314904
fbshipit-source-id: b442d0256aee7a8925e28c7e87aee5e0a3f39425
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52354
These should no longer be needed as `ReactNativeFeatureFlags` handles the missing native module gracefully.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D77365271
fbshipit-source-id: 92c6789b2175f24c79838118f681107a43c9ff0a
Summary:
X-link: https://github.com/facebook/yoga/pull/1823
Pull Request resolved: https://github.com/facebook/react-native/pull/52348
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: D76851589
fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:
- [Accessor call that can be replaced with property access syntax](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html)
## Changelog:
[INTERNAL] - Kotlin: fix static code analysis weak warnings (6/n)
Pull Request resolved: https://github.com/facebook/react-native/pull/52338
Test Plan:
```sh
yarn android
yarn test-android
```
Reviewed By: NickGerleman
Differential Revision: D77504913
Pulled By: cortinico
fbshipit-source-id: 62661ba6adafb7893ce27811357020966d5ea4c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52346
This is bypassing the mutex, and potentially not thread-safe.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D77541041
fbshipit-source-id: f97415d066786864806836768dbce2d5e68487ef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52341
The setter for `createNewDialog` is now wrong (after D76834213).
If the `createNewDialog` has been set to `true` by any other field, we should respect it and not set it to true/false regardless
(only considering the `isEdgeToEdgeFeatureFlagOn`) property.
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D77539533
fbshipit-source-id: a1deaf1f1b856895304e8b73fa5d0c0367e677af
Summary:
There is an issue with keyboard navigation if some scroll view sets `snapToAlignment`. In this case, we are unable to find potential focus candidates if clipping is enabled since this prop will make it so that certain views in the hierarchy under the scroll view form a native view without any traits being set. The fix we have in place currently relies on `FormsStackingContext` to be set to discover potential candidates so it will break in this case. To fix this, we just return the entire ancestor list, since native will know how to deal with the cases that are not actual views, and in general has the official knowledge of what can be in the hierarchy or not.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D77467933
fbshipit-source-id: 35daaba06347c738cf7a85eef86adb7944a9cb26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52308
Experimentation shows, that we very heavily rely on the global text cache for performance (not sure how much of this is invalidation, vs repeated text, or revisiting previous surfaces).
This adds a global LRU cache, of prepared layouts, given a specific AttributedString and constraints. This is similar to the existing cache, with the caveat, that we need to have separate entries for any display states, instead of just those that effect metrics.
I sized it at 200 elements for now, since an Android `Layout` is much heavier than a `Size` (in practice, each seem to weight 1-3KB (though this will be significantly reduced with future change to move from `SpannableStringBuilder` to `SpannableString` and also contributes to the global JNI ref table, but set this up to be customizable via flag, so we can experiment, on perf impact, vs memory.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D77341994
fbshipit-source-id: b453250dc475f6a281a3260b876bf80f301dd5dd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52323
Original commit changeset: b144ca6db6f7
Original Phabricator Diff: D77388413
Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e
Original diff stack: D76908041
Revert diff stack: D77388940
Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file
Reviewed By: cortinico
Differential Revision: D77448293
fbshipit-source-id: ed40836c3ecb4ca551b23cb64de2c34cfda0dea1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52322
Original commit changeset: 4a366205ea9c
Original Phabricator Diff: D77388940
Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e
Original diff stack: D76908041
Revert diff stack: D77388940
Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file
Reviewed By: cortinico
Differential Revision: D77448238
fbshipit-source-id: f41faa19f6761b7ed644e804019f5ec4738326a7
Summary:
This follows https://github.com/facebook/react-native/pull/47554
Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)
This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
- [Android] [Added] - Add edge-to-edge opt-in support
Pull Request resolved: https://github.com/facebook/react-native/pull/52088
Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile
https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76834213
Pulled By: alanleedev
fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52309
This is another class going from Java to Kotlin.
Thish should have no breaking changes, but I'll keep an eye to see if this is disruptive for users in the ecosystem.
I also haven't removed any of the Deprecated method, which can be cleaned up afterwards.
Changelog:
[Android] [Changed] - Migrate ThemedReactContext to Kotlin
Reviewed By: javache
Differential Revision: D77374236
fbshipit-source-id: d1787b21897b01c45bbf841fdda00972e0be58db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52296
## Changelog:
[Internal] [Changed] - Fewer calls to direct manipulation callback
`NativeAnimatedNodesManager::onRender` is supposed to run each frame for c++ animation, from the callstack sample trace, the vast majority of time is spent on `updateNodes` (run update on all AnimatedNodes) and `commitProps` (where either Fabric ShadowTree commit or direct manipulation is called). Change in this PR is supposed to reduce time spent in `commitProps`
{F1979788964}
Reviewed By: sammy-SC
Differential Revision: D77380842
fbshipit-source-id: 2f25ca1fba4171a7b3e485298738379d0daff3ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52306
The RCTPushNotificationManager is deprecated and not part of the prebuilds as it is optional.
We mistakenly added it to the umbrella header and nightlies do not work with prebuilds.
This change removes the header ad should fix the build.
## Changelog:
[Internal] -
Reviewed By: philIip
Differential Revision: D77395754
fbshipit-source-id: 66371650dc56f5be16a00319d9e4a1078a7b68bd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52276
The line metrics reported do not process the Spannable, meaning their layout results may disagree with those used for measurement and display.
Changelog:
[Android][Fixed] - Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback
Reviewed By: lenaic
Differential Revision: D77261839
fbshipit-source-id: 87bdc86ce16a2ae9fa69532c5721c19567a53595
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52222
Changelog: [Internal]
Introduce environment option to force usage of OSS fantom test runner.
If env is not set - check for BUCK file in tester which is checked in for FB but not for OSS.
Reviewed By: rubennorte
Differential Revision: D77160761
fbshipit-source-id: 1701ff140ff2be1bbeacfb4305e9f89089cacb42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52294
changelog: [internal]
Views that are hidden provide couple perf benefits:
- The layer is skipped during hit-testing, so the view no longer receives touches.
- Compositing work for the layer is skipped, so nothing is uploaded to the GPU for that view.
Note, VirtualView still occupies space in memory and because this is infinite list and its numbers will grow unbounded.
In this diff, hidden = YES is only set when VirtualView does not participate in accessibility features.
Reviewed By: yungsters
Differential Revision: D76597973
fbshipit-source-id: 10eb36fccabba9e37cc6322ed5969b8502193a5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52295
The current setup for several of our podspecs abuses the `**` globbing mechanism, forcing us to specify some excluded folders.
By excplicitly mention the folders that we want to use on iOS, we can avoid the usage of the `exclude_files` property.
This should make the setup more reliable and it will also avoid to leak to OSS the presence of some folders we only use internally like `platform/macos` and `platform/windows`
## Changelog:
[Internal] -
Reviewed By: huntie
Differential Revision: D77381512
fbshipit-source-id: 4cb9118bf9f0ecd253d7d871341f733564d84c83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52300
Targeted improvement to `versionExportedApis` (D77303917) to reduce noise.
This eliminates the false positive from a rename to a local (unexported) type, that does not structurally change the shape of exported types.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D77314292
fbshipit-source-id: 4de90f5b5f1b622225762b2a73e386538000d54a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52299
Correctness improvement to the `versionExportedApis` transform (D77303917). Now handles namespaced references (e.g. `Animated.Value`) by redirecting to the locally defined type name.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D77314293
fbshipit-source-id: 6442d3ab0a3c8bebf6593455b1c2fb74266e657f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52298
Exposes the ability to output inline debug annotations for the `versionExportedApis` transform (D77303917) as a formalised `--debug-version-annotations` CLI flag.
This is helpful for debugging and future maintenance, and will be used to show the effect of the next diffs.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D77373723
fbshipit-source-id: 91c91abcb657ab88ee2f8209efccb4024602acc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52292
Adds a new transform that annotates all exported symbols in our V2 JS API snapshot with a version hash based on the shape of all input types.
This intends to be a reliable mechanism to indicate how changes to local types will ultimately affect exported types.
**Advantages** (over our alternative type inlining prototype)
- More intuitive to developers — in that source type changes are preserved closer to their original source code shapes.
- Enables useful Git blaming of individual exported APIs — hash for each export line will change every time a type is affected, and relevant commits can be looked up based on this.
- Handles recursive types.
- Can be **best-effort** with minimal structural effect over time. We are okay with false positives that over-match input type changes (these are refined later in the stack).
- Similar to this, is **lower risk** in terms of requiring future updates that may pollute the diff of the body of the API snapshot structurally.
**Example change**
Example type change with multiple references: D77378010
{F1979784798}
✅ 8 char hash based on input type shapes printed next to each root-exported identifier
✅ For a source change to the `AccessibilityProps` type, 33 dependent exported types are updated with a new hash
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D77303917
fbshipit-source-id: 9d43a617697418218eb4951e8e9858d125e222b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52293
# Changelog:
[Internal] -
Adds a helper method to the `IMountingManager` API in order to get the platform specific image loader implementation, if available.
Reviewed By: christophpurrer
Differential Revision: D77379053
fbshipit-source-id: b7595d78c83e9270ec1818daf2d0f1d342661e52
Summary:
To make sure we are exposing the same public API to swift as without prebuilt, this commit changes the follow:
- ModuleMap / Umbrella file is generated from template, not dynamically to align with non-prebuilt (cocoapods). This is temporary, we are already working toward a solution to generate them dynamically.
- Headers are extracted by reading from podspec files and expanding their globs. This is now easy since we can use the podspec_sources function to look for file globs.
## Changelog:
[Internal] - refactored header/umbrella/modulemap generation for prebuild
Pull Request resolved: https://github.com/facebook/react-native/pull/52286
Test Plan:
- Run RN-tester with/without prebuilts
- Create new RN app based on nightly, build with/without prebuiltsTo make sure we expose all the swift features that we should, we expose and declare a variable from React_RCTAppDelegate
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D77368255
Pulled By: cipolleschi
fbshipit-source-id: 88e2c9d1622753895c8667a9b5aeae4a0d332cc4
Summary:
# Changelog: [Internal]
Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].
NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.
Reviewed By: rubennorte
Differential Revision: D77374707
fbshipit-source-id: cb66b9fda06168f4b13af764afe95a63a0a8d5a0
Summary:
Changelog: [Internal]
A minimal tweak to a legacy code path for React DevTools in React Native (**NOT** Fusebox!) that enables it to work / not crash when encountering an IPv6 dev server address. See doc comment for more.
Reviewed By: hoxyq
Differential Revision: D77150288
fbshipit-source-id: c11c742aad7b83861a1242dd13c5ed2753fbdf29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52091
# Changelog: [Internal]
Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].
NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.
Reviewed By: rubennorte
Differential Revision: D76284119
fbshipit-source-id: c87c6645fe32f56d84f5915ff57865cfd9723a47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52168
# Changelog: [Internal]
The main reason for the stub is to make sure this method is always installed. The actual implementation will be part of the `jsinspector-modern` stack, which is fully initialized in production builds.
Once there is a gurantee that RuntimeTarget globals are always installed in any environments, we can remove polyfills altogether.
Reviewed By: rubennorte, GijsWeterings
Differential Revision: D76987507
fbshipit-source-id: 2602af28f9e4359cf58dfafdf84802c0bf92372d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52289
The old `devtools://devtools/...` URL is **unsupported** with our modern debugger backend.
This reference was something we'd been intentionally leaving in place to preserve the old experience in Flipper — we can now remove.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D77368319
fbshipit-source-id: 400183e9bc477a887d66d79b412277971cf425e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52280
Changelog: [Internal]
Adds a type-simplifyng transform for the API snapshot, with the goal of resolving some built-in TS types during build time. Most notably, it's able to simplify `Omit` structures emitted by the `flow-api-translator` when translating Flow's type spread operator.
It builds upon a simplified type inlining transform from the previous approach. The type inlining transform is able to handle inlining type references and resolution of built-in TS types on literal types:
- `Omit`
- `Readonly`
- `Partial`
- `keyof`
Reference inlining is performed top-down and built-in type resolution is performed bottom-up, which makes it possible for the second step to assume working on type literals.
Type simplifying transform uses the type inlining to reduce type references encountered inside `Omits` to their literal shapes, which makes possible to determine whether `Omit` is neccessary case-by-case. If `Omit` is redundant, it can be safely removed. If it's not, the omitted keys can be reduced to represent a subset of keys existing in the target type.
It also keeps the ability to resolve `Partial` and `Readonly` types on type literals, simplifying the snapshot further.
An example diff the transform can handle:
Before:
```
export declare type AccessibilityProps = Readonly<
Omit<
AccessibilityPropsAndroid,
| keyof {
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
accessibilityHint?: string
accessibilityLabel?: string
accessibilityRole?: AccessibilityRole
accessibilityState?: AccessibilityState
accessibilityValue?: AccessibilityValue
accessible?: boolean
"aria-busy"?: boolean
"aria-checked"?: "mixed" | (boolean | undefined)
"aria-disabled"?: boolean
"aria-expanded"?: boolean
"aria-hidden"?: boolean
"aria-label"?: string
"aria-selected"?: boolean
"aria-valuemax"?: AccessibilityValue["max"]
"aria-valuemin"?: AccessibilityValue["min"]
"aria-valuenow"?: AccessibilityValue["now"]
"aria-valuetext"?: AccessibilityValue["text"]
role?: Role
}
| keyof AccessibilityPropsIOS
> &
Omit<
AccessibilityPropsIOS,
keyof {
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
accessibilityHint?: string
accessibilityLabel?: string
accessibilityRole?: AccessibilityRole
accessibilityState?: AccessibilityState
accessibilityValue?: AccessibilityValue
accessible?: boolean
"aria-busy"?: boolean
"aria-checked"?: "mixed" | (boolean | undefined)
"aria-disabled"?: boolean
"aria-expanded"?: boolean
"aria-hidden"?: boolean
"aria-label"?: string
"aria-selected"?: boolean
"aria-valuemax"?: AccessibilityValue["max"]
"aria-valuemin"?: AccessibilityValue["min"]
"aria-valuenow"?: AccessibilityValue["now"]
"aria-valuetext"?: AccessibilityValue["text"]
role?: Role
}
> & {
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
accessibilityHint?: string
accessibilityLabel?: string
accessibilityRole?: AccessibilityRole
accessibilityState?: AccessibilityState
accessibilityValue?: AccessibilityValue
accessible?: boolean
"aria-busy"?: boolean
"aria-checked"?: "mixed" | (boolean | undefined)
"aria-disabled"?: boolean
"aria-expanded"?: boolean
"aria-hidden"?: boolean
"aria-label"?: string
"aria-selected"?: boolean
"aria-valuemax"?: AccessibilityValue["max"]
"aria-valuemin"?: AccessibilityValue["min"]
"aria-valuenow"?: AccessibilityValue["now"]
"aria-valuetext"?: AccessibilityValue["text"]
role?: Role
}
>
```
After:
```
export declare type AccessibilityProps = Readonly<
AccessibilityPropsAndroid &
AccessibilityPropsIOS & {
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
accessibilityHint?: string
accessibilityLabel?: string
accessibilityRole?: AccessibilityRole
accessibilityState?: AccessibilityState
accessibilityValue?: AccessibilityValue
accessible?: boolean
"aria-busy"?: boolean
"aria-checked"?: "mixed" | (boolean | undefined)
"aria-disabled"?: boolean
"aria-expanded"?: boolean
"aria-hidden"?: boolean
"aria-label"?: string
"aria-selected"?: boolean
"aria-valuemax"?: AccessibilityValue["max"]
"aria-valuemin"?: AccessibilityValue["min"]
"aria-valuenow"?: AccessibilityValue["now"]
"aria-valuetext"?: AccessibilityValue["text"]
role?: Role
}
>
```
Reviewed By: huntie
Differential Revision: D77295302
fbshipit-source-id: 213aef46035bde4f9783353b5344a6986a418399
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52246
This diff adds the required override to codegen props to make the `FabricMountingManager` aware of the availability of a prop diffing implementation for native components using codegen props.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234066
fbshipit-source-id: 8e95628348f491c5ee08609bc7d7b3d30bc7151b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52266
Native components may use `MixedType` properties in rare cases to hold untyped data. This diff adds support for serializing and prop diffing these types of props so that all of the props and object fields would be included in prop diffing results.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77307169
fbshipit-source-id: ae6b00207ef857c9cfa4bdf9c235972915410a29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52244
The ArrayType props converts to std::vector. This prompted the need for `toDynamic(const T&)` conversion functions as this breaks to potential reliance on all type instances having a `toDynamic()` function available. This includes:
- array of arrays types
- array of objects types
- object with arrays
The ArrayType conversion uses the availability of the `toDynamic` conversion methods for all supported types to convert the values stored by the `std::vector` to `folly::dynamic` values to be stored on a `folly::dynamic::array`.
The diff removes unnecessary conversion methods implemented previously for the core components prop diffing. These are now handled by the generic `toDynamic(const std::vector<T>&)` conversion method.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234065
fbshipit-source-id: 97a3b175ff07fe4a6de3adb14ee6cb42db1a2cfe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52243
Building on the availability of `toDynamic` conversion methods for all supported property types, this diff adds support for diffing of `ObjectType` props.
The template adds the generation of a default comparator for the generated C++ struct. The struct also gains a `toDynamic` conversion method that will convert each property of the object type to a `folly::dynamic` value.
Primitive types make use of the implicit conversion supported by `folly::dynamic`, all other types are converted using `toDynamic`.
The `toDynamic` logic is implemented as a method defined on the struct to avoid increased binary size when required multiple times by the prop diffing implementation.
The external `toDynamic` conversion function calls the struct method directly. This enables support for converting object types using object types within their props.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234064
fbshipit-source-id: 21deb3104303aa374fb65b969af57a6aca6db38c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52242
Codegen supports `DimensionType` props which represents a YGValue. This diff adds a conversion to `folly::dynamic` supporting all the existing value types `YGValue` can represent.
This completes codegen support for all allowed `ReservedPropTypeAnnotation` prop types.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234061
fbshipit-source-id: 6c3aef5e3ab0459d8a68ebd8efaccfecb83b0b08
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52241
Add support for converting string and int32 enum types to `folly::dynamic` and generating the correct property diffing for it conditionally adding the prop value to the prop diff result.
This diff updates the template to convert the enum back to the original string representation provided from the JS side based on the current generated C++ enum value.
The string enum re-uses the existing `toString` conversion. The number enum generates the switch-case mapping required to map back the C++ enum value to the original value assigned to it.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234070
fbshipit-source-id: 8c669d5b2e21bd6022c6ba36149465495e4d4bf3
Summary:
Changelog: [Internal]
Fixes a thread safety bug in the C++ platform's `InspectorPackagerConnectionDelegate::WebSocket` implementation. Since D60520747 `IWebSocketDelegate` event calls have been required to be made on the inspector thread, but the C++ platform was making them on the platform's WebSocket thread instead.
Reviewed By: christophpurrer
Differential Revision: D77150289
fbshipit-source-id: f57de05eaccbbe9db674076fc9e60f8d0dd243c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52271
In my haste I messed up a few of these. Either type in the text, or giving them props they should not have.
Changelog: [Internal]
Reviewed By: jorge-cab
Differential Revision: D77310876
fbshipit-source-id: 9c5a28285d4bb3673fe99630fa7ed97033b17904
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52263
Changelog: [Internal]
Adds a bare-bones API to set the dev server host and port at the time of creating a `ReactInstance` in the C++ platform.
Reviewed By: rshest
Differential Revision: D77050457
fbshipit-source-id: 642dc96d3cb486a2e7faa177adcbf8a15b8fb668
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52256
## Summary
ReactNativeAttributePayloadFabric was synced to react-native in
https://github.com/facebook/react-native/commit/0e42d33cbcfadcf5d787108da785d56a83d07a9f.
We should now consume these methods from the
ReactNativePrivateInterface.
Moving these methods to the React Native repo gives us more flexibility
to experiment with new techniques for bridging and diffing props
payloads.
I did have to leave some stub implementations for existing unit tests,
but moved all detailed tests to the React Native repo.
## How did you test this change?
* `yarn prettier`
* `yarn test ReactFabric-test`
DiffTrain build for [7a3ffef70339c10f8d65a27b88cd73bfbe13eb8a](https://github.com/facebook/react/commit/7a3ffef70339c10f8d65a27b88cd73bfbe13eb8a)
Reviewed By: rubennorte
Differential Revision: D77296286
fbshipit-source-id: a26aa0fe0f7f1c8a42407d759351734a4c85f970
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52050
Uncaught errors are currently raising a custom error to `console.error`:
* With somewhat unclear messaging.
* Only the **component stack** is reported.
* The top-most stack leads to the component where the throw occurred and not to the actual error being thrown.
* The actual error being thrown is never logged
After this change:
* We print the actual error thrown
* The *Owner stack* is attached
(see test plan for examples)
## Changelog:
[General][Breaking] Improve messaging and add error stack trace in console errors generated on throws from components.
----
This is a breaking change because someone might be monkey-patching console.errors, or just listens to them.
Reviewed By: rickhanlonii
Differential Revision: D75080385
fbshipit-source-id: 824f30a804a3bb836ea1be7257784e56c00077c1
Summary:
After switching to the new backwards compatible cocoapods structure with prebuilts, we no longer need any change in the ReactCodegen template.
This commit fixes this.
## Changelog:
[IOS] [FIXED] - revert changes in ReactCodegen template
Pull Request resolved: https://github.com/facebook/react-native/pull/52257
Test Plan: Build RN-tester with prebuilt
Reviewed By: cortinico
Differential Revision: D77303429
Pulled By: cipolleschi
fbshipit-source-id: d251d7d67b1c902082891ba705db5158c558e842
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52234
Changelog: [Internal]
Use raw regex instead of micromatch as it depends on node imports.
Reviewed By: christophpurrer
Differential Revision: D77241819
fbshipit-source-id: c579b42f064f67c2e44e15e40ab6262f45a90797
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52220
# Changelog: [Internal]
Mainly, 2 changes:
1. `PerformanceTracer::serializeTraceEvent(const TraceEvent& event)` -> `PerformanceTracer::serializeTraceEvent(TraceEvent&& event)` for less copies, actually move strings from the `TraceEvent` into the serialized `folly:object`.
2. When collecting events from the buffer, only lock when accessing buffer, not when serializing.
Reviewed By: rubennorte
Differential Revision: D77164969
fbshipit-source-id: c7dd84dd3c94dae22b89ffd4b229974e6d8084de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52196
# Changelog: [Internal]
Probably been overlooked for quite some time, but shouldn't be a bottleneck.
Reviewed By: motiz88
Differential Revision: D77148271
fbshipit-source-id: e8eb32137086d6c280aab2ec5903be03f96175ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52188
# Changelog: [Internal]
`buffer_.push_back` -> `buffer_.emplace_back`
I didn't measure if there were any runtime wins from this, because I don't expect there would be. Let's avoid potential copies, if possible.
Reviewed By: rubennorte
Differential Revision: D77053032
fbshipit-source-id: 80a0d3759bf95b1945ebe560806712bfa6a4f924
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52187
# Changelog: [Internal]
- `bool tracing_` -> `std::atomic<bool> tracingAtomic_`.
- More doc-comments to explain the usage of mutex and atomics.
- `PerformanceTracer::isTracing()` -> `inline PerformanceTracer::isTracing()`.
- `uint64_t processId_` -> `const uint64_t processId_`.
The main change is that the boolean flag that controls "if we are tracing" is now atomic, which should eliminate potential data races. To avoid "logic" races, we are still going to lock mutex, and then check again. The use of `std::atomic` allows us to perform cheaper check first to avoid potentially unnecessary serializations from other systems that report events into `PerformanceTracer`.
Reviewed By: rubennorte
Differential Revision: D77053030
fbshipit-source-id: 82966055db0d75f828e7b95ad4c6cd7f18902265
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52254
changelog: [internal]
View culling would generate incorrect mounting instructions because view culling context is checked before it is changed by a view.
Reviewed By: javache
Differential Revision: D77298889
fbshipit-source-id: 2f98dc4de90f34673ff6f627b597942d80fda865
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52239
Add `toDynamic` conversion function for `EdgeInset` which allowed for removing the custom conversion implemented for the `ViewProps`.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234069
fbshipit-source-id: 3aecad8a6d78468f0056167fa1523ccdfb68f369
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52238
Add prop diffing codegen for `PointPrimitive` prop type by adding a `toDynamic` conversion for the struct and the prop diffing conditional result update.
The addition of the `toDynamic` function will allow for converting the type when used in array and object types.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234062
fbshipit-source-id: d0f52e8fd78ac7712925ea2a47cdd0fe3392d5b0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52237
For array props conversion following later in this stack, each type should have a toDynamic conversion available that can be called upon to convert all supported types to a `folly::dynamic` result.
This diff adds the toDynamic conversion function for `ImageSource`
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234063
fbshipit-source-id: 392cbaf172595936f7f66faa824900dadd58bdcf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52252
Instead of declaring two different sets of Pods for prebuilt and build from source, this commit now keeps the pod structure the same for both modes so that consuming libraries can expect to have the same pods and header files available - without this, libraries would have to be updated to take advantage of the prebuilds.
This PR does:
- Added React-Core-prebuilt as a pod in React-Core if prebuilt is enabled
- Simplified react_native_pods to keep pods structure and add React-Core-prebuilt pod if prebuilts are enabled
- Added function for selecting source sets based on prebuilt/build from source
To be able to function both in prebuilt and in regular build from source mode, all podspecs are now using the switch function podspec_sources so that they only include header files if we are in prebuild mode.
Also added React-Core-prebuilt as dependency on React-Core if we are in prebuilt mode so that we install the React.XCFramework.
## Changelog:
[IOS] [FIXED] - Added backwards compatible use of prebuild through cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/52223
Test Plan:
Tested in RN-Tester both with and without prebuild.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D77296047
Pulled By: cipolleschi
fbshipit-source-id: f3eb4d56b2a78bfc8e10ad852746be1ceaf828b2
Summary:
`Package.swift` was missing the `RCTVibration` target. This commit adds this target.
## Changelog:
[Internal] - Added RCTVibration to SwiftPM
Pull Request resolved: https://github.com/facebook/react-native/pull/52223
Test Plan: Tested in RN-Tester both with and without prebuild.
Reviewed By: cortinico
Differential Revision: D77257066
Pulled By: cipolleschi
fbshipit-source-id: 13c918387a2ed4a8e3941ddce8b7ba11c24eaab5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52235
Adds `organizeDeclarations` transform, replacing `sortTypeDefinitions`.
All `export declare ...` statements are now collected and represented at the end of the snapshot in a single `export {}` block — significantly improving readability and diffing.
Changelog: [Internal]
Reviewed By: j-piasecki
Differential Revision: D77150017
fbshipit-source-id: 1bd451c0e2a18fd6fc0504970b10a5d2502ac872
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52245
Changes `VirtualView` to avoid dispatching redundant mode change events by reading the last committed `renderState` to determine whether the desired render state is already in effect.
This enables `VirtualView` to avoid dispatching synchronous `Visible` mode change events when a previous `Prerender` mode change event has already been committed.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D77271865
fbshipit-source-id: 75418aec1416995737f308a1beff407f2cedb940
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52240
Changes `VirtualView` to detect when its window is not in a focused window (e.g. scroll position or layout changes when it is blurred) and to instead dispatch an async `Prerender` event instead of a sync `Visible` event.
This minimizes unnecessary main thread synchronous work that is needed for a view that is not important to the user experience.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D77261958
fbshipit-source-id: 32acef9bc938005a0d73c5166f1741aebadf23bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52236
Enable experimental Flow 'match' syntax for `react-native-github/packages/react-native/src/private/components/virtualview/` and adopt in one case to see if there are any issues.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D77250963
fbshipit-source-id: 0b2a5817a05f3332031f0c0590fe956eaa74ddd3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52212
Correcting some C++ imports that show up when build with Xcode 26:
- Missing `<string>` imports.
- `<tgmath.h>` is a deprecated C++ header file, which in this case can be substituted with `<cmath>`.
## Changelog: [Internal]
[iOS][Fixed] - Fix deprecated C++ imports
Reviewed By: zhenma
Differential Revision: D77192276
fbshipit-source-id: 30c836947cb3eb54f6e7ac42b87fd2493334a4f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52231
Not calling `super.onInitializeAccessibilityNodeInfo` on the host view with accessibilityOrder prevents setting proper dimensions for the node that backs the view which leads TalkBack to trigger scrolling when under a ScrollVIew.
We still need the host's node to not be accessible so we still set it to not be focusable and not have a content description since this should be handled by the virtual views
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D77180494
fbshipit-source-id: fe8794cf421cdc9548cf3e18a62d4bb3e8c26b09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52066
Before, to disable views that were excluded from the order we were setting them to be not important for accessibility. This however breaks coopting behavior of parent views, because parent views will not announce content descriptions of children that are not important for accessibility.
Instead of disabling by setting `important for accessibility = no` now we just set `isFocusable = false` which disables focusing but still allows parent views to coopt
We also add functionality to restore view focusability when enabling disabling screen readers since `isFocusable` changes keyboard focusability and when screen readers are disabled we don't want to change it.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D76745057
fbshipit-source-id: cc237c5f8a4b894a7caa3e34207080777de440ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52228
To avoid unexpected behaviour, apply all Babel transforms within `build-types` sequentially, so that each transform plugin has an accurate starting AST.
Changelog: [Internal]
Reviewed By: j-piasecki
Differential Revision: D77148444
fbshipit-source-id: f86beac12b7a08ef800e28db1ff88755970cf64e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52194
Changelog: [Internal]
Introducing a way to include sources and deps via function that react_native_android_dep.
This will help with Fantom OSS build.
Reviewed By: cortinico
Differential Revision: D77146189
fbshipit-source-id: 06b09d433741506bc1f58fbf1f9e6add9a9cff91
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52221
It is currently not possible to use prebuilds, because we are missing the `React-Core-prebuilt.podspec` from the npm package we publish.
This change should fix it.
## Changelog:
[iOS][Added] - Ship the `React-Core-prebuilt.podspec` in the package.json
Reviewed By: cortinico
Differential Revision: D77223271
fbshipit-source-id: ab068e1711fdd86f3f0069dc9aa3c0a591fcd26b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52215
We were not handling the download of the XML properly. Using `Net::HTTP.get` will directly return the body and that won't let us check on the status code of the response.
## Changelog:
[Internal] - use get_response instead of get when downloading the maven metadata
Reviewed By: cortinico
Differential Revision: D77216121
fbshipit-source-id: 4da0abff1624c687977a7b77db8a15f19e6b887d
Summary:
This PR replaces Core Graphics implementation with Core Animation for radial gradients. I found that `endPoints` for radial gradient type works differently than linear gradient type. The `endPoint.x` accounts for horizontal length and `endPoint.y` accounts for vertical. This makes it possible to draw ellipse gradients. So we don't need the core graphics API anymore.
## Changelog:
[IOS] [CHANGED] - Optimised Radial Gradients.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52117
Test Plan: Non breaking change. Test Radial gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.
Reviewed By: rshest
Differential Revision: D77140709
Pulled By: javache
fbshipit-source-id: 6e3ad9fcf8e819d340ccf5f5946beb140e616cb0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52122
Would love to have a place with all the edge cases we can come back to when we try and tweak things.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D76942595
fbshipit-source-id: ce6e293e2c068383e54404af71a29a0586dbc04e
Summary:
### The Problem
When trying to measure the location of a `View` within a `ScrollView` (ie. for scrolling to the view), the current recommended method is to use `measureLayout` on the nested view to determine its location inside the containing scroll view:
```tsx
const MyComponent = () => {
const scrollViewRef = useRef<ScrollView>(null);
const nestedViewRef = useRef<View>(null);
const scrollToNestedView = () => {
if (!scrollViewRef.current || !nestedViewRef.current) {
return;
}
nestedViewRef.current.measureLayout(
scrollViewRef.current.getInnerViewNode(),
(x, y) => { scrollViewRef.current.scrollTo({ y, animated: true }); },
);
}
return (
<ScrollView ref={scrollViewRef}>
<View ref={nestedViewRef}>
{ /* content */ }
</View>
</ScrollView>
);
}
```
This is valid in the Typescript types layer. However, the only two methods on `ScrollView` to use in this scenario that are [available in the type definitions](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts#L830) are `getScrollableNode` and `getInnerViewNode` – both of these methods [return a `number`](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L139-L140). The issue is that a `number` not a valid value to use with `measureLayout` because [its source returns early for that type](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js#L91-L102).
(Note, you can also use `findNodeHandle` with the scroll view ref, but this also returns a `number`.)
### The Solution
The long-term solution would be to update the types for both `measureLayout` and `ScrollView`. However, that would constitute a breaking change and require some fairly expansive updates. Instead, I am proposing an additive solution.
`ScrollView` has [a public method called `getNativeScrollRef`](https://github.com/facebook/react-native/blob/e69f0726cd2616fb112d2e4fabfeaafc8cada5d7/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L142) which returns the underlying `HostInstance`. This method correctly works in the runtime layer, but is not supported in the types layer. This PR exposes the public method in the type definition so that we can properly access the underlying instance without using `ts-ignore`.
## Changelog:[GENERAL] [FIXED] - Expose `ScrollView.getNativeScrollRef` on the type definition to allow accessing the underlying `HostInstance`.
Pull Request resolved: https://github.com/facebook/react-native/pull/52203
Test Plan: None needed. This is only a type update exposing existing functionality.
Reviewed By: cortinico
Differential Revision: D77153959
Pulled By: rshest
fbshipit-source-id: 5880695da85406ed9fe49a1b736b5754db0e6382
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52095
This diff removes `shelljs` from `run-ci-javascript-tests.js` and replaces `echo, exec, and exit` methods.
### Motivation
Decrease number of references to `shelljs` across the react-native-github.
Changelog:
[Internal]
Reviewed By: NickGerleman
Differential Revision: D76512374
fbshipit-source-id: 6e02901b570cf9a36bd13a075106a7066a85a2d9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52192
Changelog: [internal]
When we shipped the event loop we removed the need to run only expired tasks in `RuntimeScheduler_Modern`, but we never cleaned up the code properly. This does it.
Reviewed By: javache
Differential Revision: D77142978
fbshipit-source-id: f808edf80a134f487723fa36ab7a3593e4efe2d3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52191
Changelog: [internal]
Some time ago we added logging for the timer ID in Systrace/Perfetto so we could see where timers were scheduled vs. executed.
This diff adds support for the same functionality for tasks in the runtime scheduler.
Reviewed By: javache
Differential Revision: D77039038
fbshipit-source-id: 792d2fe29b44fb209f9129f46f9d661dad7ebdff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52190
Changelog: [internal]
This adds some tracing metadata to IntersectionObserver to contextualize the performance of certain operations (logging how many observers it's processing).
Reviewed By: javache
Differential Revision: D77039037
fbshipit-source-id: 9cee79ac0509f57e4658a16142f3fe2d10d71fdf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52189
Changelog: [internal]
This creates a benchmark to measure the changes in performance in RuntimeScheduler.
Reviewed By: javache
Differential Revision: D77142979
fbshipit-source-id: 1a6e6824f4c6fdb8d2c5cbad77fb4b8ba406ef29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52138
Integrate React Core prebuilds with apps
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[IOS] [ADDED] - Added support for using prebuilt RNCore with Cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980286
Pulled By: cipolleschi
fbshipit-source-id: 0ef34599cf7a60e54f799708bce93bcf6fb9d950
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52134
Update RNDependencies podspec to fail fast if framework is missing
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[IOS] [CHANGED] - Fail fast when pod install i f using prebuild if frameworks are not present in the disk.
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980282
Pulled By: cipolleschi
fbshipit-source-id: 6ab029d0cb06e2f0a3d99ea9fc7b375865e7a966
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52135
Update the xcframework.js script to support Swift
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[INTERNAL] - Update the xcframework.js script to support Swift
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980285
Pulled By: cipolleschi
fbshipit-source-id: 4e5486b79c406ba4b375e2ada24cbe5450e2346f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52137
Update ReactCodegen to support Core prebuilds
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[IOS] [CHANGED] - Update ReactCodegen to support Core prebuilds
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980283
Pulled By: cipolleschi
fbshipit-source-id: 4b120203e9e1628a63580b0b3b2e882837c0b818
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52136
Update rndependencies.rb to use the same logic of rncore.rb
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[INTERNAL] - Update rndependencies.rb to use the same logic of rncore.rb
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980284
Pulled By: cipolleschi
fbshipit-source-id: a7f09d931c66e2fdf468a09da4be1d40847f472b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52133
Add React-Core-prebuild.podspec to integrate React native core prebuilds using cocoapods
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
## Changelog:
[IOS] [ADDED] - Add `React-Core-prebuild.podspec` to integrate React native core prebuilds using cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76980281
Pulled By: cipolleschi
fbshipit-source-id: ce102837d6df6ab0fa2e55862cc0c954125bd362
Summary:
Introduce rncore.rb to manage the prebuilds of RNCore.
## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
bypass-github-export-checks
## Changelog:
[INTERNAL] - Added script to handle React Core prebuilds
Pull Request resolved: https://github.com/facebook/react-native/pull/52109
Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)
Rollback Plan:
Reviewed By: cortinico, rshest
Differential Revision: D76979549
Pulled By: cipolleschi
fbshipit-source-id: 7a2b1809bf58b600293cc33ca2dcff0060f3fab0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52198
# Changelog:
[Internal] -
This provides an implementation of what was the RnCxx ImageLoaderModule stub inside ReactCxxPlatform, allowing the clients use dependency injection to provide the actual platform specific image loading functionality.
Reviewed By: javache
Differential Revision: D77015269
fbshipit-source-id: 7355dd75692c1f564de8c3daffd6c8a79182dc09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52154
I wasn't able to find any meaningful usage of `EventDispatcherImpl` in OSS, therefore I'm making this class internal.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D77024759
fbshipit-source-id: e1ff3329cedf96a8c75edb9b9ccc1ce21adfab11
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52150
This is another class moving from Java to Kotlin.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D77021952
fbshipit-source-id: 0b04a10bcbe65b7dc14ddd2821f80d90a43f8610
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52195
RNTester is currently instacrashing on release due to use minifying the `ReactModalHostView`.
In that class there is a static method that is accessed by JNI so we should annotated this class
as `DoNotStrip` as otherwise we won't be able to access it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D77148010
fbshipit-source-id: c5b2758fa2919bc1f5885433202a45b4c3f8ff99
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52185
It seems like one of the activity on the stack is not properly implementing `DefaultHardwareBackBtnHandler`.
This will make the crash more clear as it will be clear which activity is the one responsible for the crash.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D77142320
fbshipit-source-id: 1913976d1ad5d3ceafcfc0569f3b74dad9e919ae
Summary:
Splitting the CHANGELOG as it's getting too big to handle.
Changelog:
[Internal] [Changed] -
bypass-github-export-checks
Reviewed By: cipolleschi
Differential Revision: D77025333
fbshipit-source-id: cf2d54f2096f9c8c6a3fadb354d0c3065370440d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52156
Changelog: [Internal]
Fix devtoolsruntimesettings lib as it needs to be OBJECT library as it has source code included.
Reviewed By: christophpurrer
Differential Revision: D77035122
fbshipit-source-id: 27ad7fe637512afc79f3dcc6b0846dcfd4f22504
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52155
Changelog: [Internal]
Gating RN_SERIALIZABLE_STATE behind ANDROID flag so we can build ReactCommon with cmake when targeting different platforms.
This will help build reac-native-fantom for OSS.
Reviewed By: christophpurrer
Differential Revision: D77034689
fbshipit-source-id: 15f9192c90693f4743f31fcf72f593802b622c47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52110
## Changelog:
[General] [Internal] - Add Fantom test for layout props
With this test it turns out `layoutStyleUpdated_` on PropsAnimatedNode actually can change after animation update, because its connected StyleAnimatedNodes might be changing. This bug was introduced since D74602321
Reviewed By: rshest
Differential Revision: D76753864
fbshipit-source-id: 5bebb11340086390df20c89adf80abaa63cadc90
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52143
Noticed that some of the `IndexOutOfBoundsException` crashes we've been tracking we're not being reported as soft errors because they were not running wrapped by the RN ExceptionHandler
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D77017423
fbshipit-source-id: 760297a0c5ee3d58577931829a31d312dacffdf1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52111
Changelog: [Internal]
JSRuntime integration with executor on messagequeue.
Inching closer to full integration with the rest of RN.
Reviewed By: rshest
Differential Revision: D76752667
fbshipit-source-id: 0ef8fe0c615dc1eb45355f7502e01663772ebf13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52112
Adding `shouldForwardToReactInstance` check in Bridgeless since it was missed in https://github.com/facebook/react-native/pull/43351
**Changelog:**
[ANDROID][FIXED] - Adding `shouldForwardToReactInstance` check in ReactDelegate for Bridgeless
Reviewed By: cortinico, javache
Differential Revision: D76908041
fbshipit-source-id: 20b8fce248d8e560ab862cf325b6f8b15be870e3
Summary:
this PR makes the stale bot messages a bit clearer and fixes a grammatical issue.
# Changelog:
[INTERNAL] [FIXED] Tweak stale bot messages
Pull Request resolved: https://github.com/facebook/react-native/pull/52124
Test Plan: N/A
Reviewed By: andrewdacenko
Differential Revision: D76969503
Pulled By: cortinico
fbshipit-source-id: d030a0488b44521f61447e252bae5ded10826dbb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52130
After D73948178, Modals now need to access JNI to get the dimension of the
screen to properly position the modal on first rendering.
Before my change, the Modal was positioned in 0,0 (which is the default
behavior for CXX).
I'm suppressing this test for Android, as it will keep on running with the
previous behavior for CXX.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D76979787
fbshipit-source-id: 78675712f97baee29036f943b2a8bcd23047e4ed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52131
This class is not used in OSS and can be made internal.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D76979122
fbshipit-source-id: 2d81e3605e6c51336b3bdb2671dd9faf8f25639b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52132
This is yet another class that is getting converted from Java to Kotlin.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D76979123
fbshipit-source-id: d1fc54e61d64b78a56cf0198ae5fe588702a8698
Summary:
This PR replaces Core Graphics implementation with Core Animation for linear gradients. I came across a great [solution](https://stackoverflow.com/questions/38821631/cagradientlayer-diagonal-gradient/43176174#43176174) that makes the `CAGradientLayer`'s start and end point behaviour CSS spec compliant. This will make gradients much more performant.
## Changelog:
[IOS] [CHANGED] - Optimised Linear Gradients.
<!-- 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/52096
Test Plan:
Non breaking change. Test Linear gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.
## Note:
I will be doing a PR to use `CAGradientLayer` for radial gradients as well. The next properties that I have locally working are `background-size`, `background-position` and `background-repeat`. These will be addressed in small PRs.
Reviewed By: NickGerleman
Differential Revision: D76905215
Pulled By: javache
fbshipit-source-id: 0094bdf70869d619272d491dd496983316b0dbf0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52129
This remove all the usages of SafeAreaView from RNTester.
The problem is that we introduced a warning that SafEAreaView is deprecated and, therefore, we had a warning in debug mode.
This was causing a yellow bubble to appear and the OSS E2E test started failing.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D76978227
fbshipit-source-id: c45a31bae1602bc307e4fbbd71e7987a8ed78858
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51048
Fixes https://github.com/facebook/react-native/issues/50442
Closes https://github.com/facebook/react-native/pull/50704
Users reported that Modals on Android are first renderer anchored in 0,0.
That results in them being on the top left corner of the screen for some seconds.
This is happening because the native state of the Modal on Android as width/height set at 0,0 - which we then update in a subsequent callback.
I'm fixing this by making sure we render the Modal the first time with the right screen size - the status bar size
Changelog:
[Android] [Fixed] - Fix Modal first frame being rendered on top-left corner
Reviewed By: javache
Differential Revision: D73948178
fbshipit-source-id: 055c12aa62d70acc1e4c5a2a5c4ea0c5608e22c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52127
Currently using `react.internal.useHermesNightly` is broken locally because we try to search for versions such as 0.0.0.+ while the nightlies version are of the form 0.81.0-...
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: NickGerleman
Differential Revision: D76901197
fbshipit-source-id: 51f7b2e7ec936aace67d4d62a8019554800347fc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52102
Changelog: [internal]
This ships the variant of IntersectionObserver that integrates directly with the Event Loop, avoiding dispatching notifications during observation and waiting for the end of the Event Loop tick instead. Also cleans up all the associated feature flags.
Reviewed By: lenaic
Differential Revision: D76892649
fbshipit-source-id: 9364b43a4d60b75c25b9a2d6ced7937b03376b04
Summary:
Static code analysis reports 18 warnings for incorrect usages of the `VisibleForTesting` annotation as some of the classes/functions/properties that are annotated are not used only in tests but also in other non-test files across the codebase. This PR cleans that up to fix those warnings.
## Changelog:
[INTERNAL] - Clean up incorrect VisibleForTesting annotation usages
Pull Request resolved: https://github.com/facebook/react-native/pull/52025
Test Plan:
```sh
yarn test-android
yarn android
```
Reviewed By: rshest
Differential Revision: D76745241
Pulled By: sbuggay
fbshipit-source-id: 4702a7258002916cc95c178dc8931c8bb471f7bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52120
It is pretty jarring for semantically different labels to be read all at once, let's comma separate them - which VoiceOver will pause at. Android does this by default with its coopting implementation
Changelog: [Internal]
Reviewed By: jorge-cab
Differential Revision: D76921000
fbshipit-source-id: afe1f93e38babde918137576d0693c1579101ef7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52093
This change updates the `BaseViewManager` implementation to drop and restore the original focus listener when a view instance has its `onDropViewInstance` method called. This is necessary to support view recycling, since the `addEventEmitters` method is called each time a recycled view is popped out of the stack. This would result in N+1 `onFocus`/`onBlur` calls for each time the view is recycled.
Changelog: [Android][Fixed] - Remove focus change listener when dropping/recycling view instances
Reviewed By: NickGerleman
Differential Revision: D76852137
fbshipit-source-id: 9e980e7a1850a952baf04724bc251ff32186c6fa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52106
Changelog: [internal]
This slightly improves the formatting of the output produced by benchmarks, so we can just copy&paste the result to share it as valid Markdown.
Reviewed By: christophpurrer
Differential Revision: D76898244
fbshipit-source-id: dc1040ee3787c7f0dcb747c9fba8eb14086a0087
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52105
Changelog: [internal]
I just learnt there's a Hermes variant that we don't support (staging) so this adds support for it.
Reviewed By: christophpurrer
Differential Revision: D76897715
fbshipit-source-id: 3113edde3c785d71ad4a57dd435f16e13ab46976
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
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
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
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
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
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
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
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
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
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
Summary:
Compile out the legacy c++ core from android.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D72991984
fbshipit-source-id: 56bb6ca1c4797adb9235e982121712b11e85e109
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51949
This code is no longer necessary now that JSC support is offered via
https://github.com/react-native-community/javascriptcore
Instructions for users on how to continue using JSC are available in the README of such library.
Changelog:
[Android] [Removed] - Remove 1st party JSC support
Reviewed By: javache
Differential Revision: D76420382
fbshipit-source-id: f8e61556bb02fe4d5b34f89b40f8e5e38ac1c8d6
Summary:
When trying to implement e2e tests using maestro in a large app I ran into major performance issues. I tracked it down to the generation of recursive accessibility labels.
The maestro iOS driver uses [XCUIElement snapshot dictionaryRepresentation](https://developer.apple.com/documentation/xctest/xcuielementsnapshot/dictionaryrepresentation) [here](https://github.com/mobile-dev-inc/Maestro/blob/96e8c9a2be3430be991c13d033486d52d2001334/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift#L234) to get a representation of the view hierarchy. The problem is that will query the accessibilityLabel for every single view, starting from the root of the app. It goes without saying that this is extremely slow since it traverses the view hierarchy, executing a recursive function on each one.
I think the only way to fix this is to avoid generating these recursive labels when not needed. From my understanding these should only be needed for accessible views.
## Changelog:
[IOS] [CHANGED] - Only generate recursive accessibility label for accessible elements
Pull Request resolved: https://github.com/facebook/react-native/pull/51988
Test Plan:
- Tested using VoiceOver in RN tester to make sure it works exactly the same.
- Tested in an app using Maestro to make sure this fixes the performance issue.
- Tested in RNTester running Maestro e2e test by creating a larger view hierarchy to make the problem more apparent, and simulate a real app. Using [this code](https://gist.github.com/janicduplessis/9f6b302d92b4e22ff5e8462a8a84e237) in RNTesterAppShared.js
Before:
```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh
Waiting for flows to complete...
[Passed] flatlist (14s)
[Passed] text (28s)
[Passed] modal (16s)
[Passed] image (8s)
[Passed] button (10s)
[Passed] legacy-native-module (32s)
[Passed] pressable (32s)
[Passed] new-arch-examples (35s)
8/8 Flows Passed in 2m 55s
✨ Done in 180.26s.
```
After:
```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh
Waiting for flows to complete...
[Passed] flatlist (7s)
[Passed] text (15s)
[Passed] modal (10s)
[Passed] image (4s)
[Passed] button (6s)
[Passed] legacy-native-module (16s)
[Passed] pressable (16s)
[Passed] new-arch-examples (17s)
8/8 Flows Passed in 1m 31s
✨ Done in 97.53s.
```
Reviewed By: christophpurrer, joevilches
Differential Revision: D76581949
Pulled By: cipolleschi
fbshipit-source-id: 0689c7d43a0c865572c4ee5ea32ee9b2dcb33ad5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51986
"{}" defaults to false on C++ but the prop is not initialized which means that if accessibilityEnablesUserInteraction is set to false it will not be applied on first render. setting the default to true fixes that issue
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D76532158
fbshipit-source-id: 51cba8b89eb239e01db985d412dd2b19e482f068
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51979
Fix type checking that was left out from the last diff; D73224138
We should unify the type checking so remove uses of `java.lang.Boolean` and just use Kotlin version of `Boolean`.
Changelog:
[Internal]
Reviewed By: mdvacca
Differential Revision: D76523674
fbshipit-source-id: 293ae5998c78c98a20c7d6cf962ab7b19087fd9c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52048
This diff exports types defined in RNCodegen to be used by other codegens
changelog: [internal] internal
Reviewed By: christophpurrer
Differential Revision: D76472492
fbshipit-source-id: fa236a254a9a4211d2e00ace436f55978a262a76
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52041
After changing the publishing logic on Maven, the download logic for the artefacts published in a Snapshot was broken, because Maven does not support the redirect anymore.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D76725418
fbshipit-source-id: 8bad88915d9bad96355a048486972a55f232d109
Summary:
Static code analysis reports numerous unused symbols across the codebase, which accounts for several static code analysis warnings. I've cleaned up some of them (not all of them because many of them are false positives from testing files)
The cleaned-up symbols are mostly private and from internal classes, so this should not impact users (unless they are used internally at Meta – in that case, let me know so I can revert accordingly)
## Changelog:
[INTERNAL] - Kotlin: clean up some unused symbols
Pull Request resolved: https://github.com/facebook/react-native/pull/52029
Test Plan:
```sh
yarn test-android
yarn android
```
Reviewed By: javache
Differential Revision: D76722313
Pulled By: cortinico
fbshipit-source-id: 8c7dfe204fa7c457b7484a7edd120ae45e1d604d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52035
Fixes https://github.com/facebook/react-native/issues/52014
Some OSS library is still returning null for `getViewManagerNames` especially if they're
implementing the `ViewManagerOnDemandReactPackage` in Java.
I'm adding a try-catch here so that we prevent the NPE for those scenarios.
Changelog:
[Android] [Fixed] - Fix crash on ReactInstance due to null returned for getViewManagerNames
Reviewed By: javache
Differential Revision: D76723826
fbshipit-source-id: cc159dee389257c6877b03a67840a45ee5bec165
Summary:
The OSS CI for iOS is broken because of a couple of commit that landed:
- Commit 05a61e8161 : dynamic frameworks are broken
- Commit abc8fe1c92 : pod donwload is broken
This change fixes both of them
## Changelog:
[Internal] - Fix OSS CI
Pull Request resolved: https://github.com/facebook/react-native/pull/52042
Test Plan:
Tested locally by building RNTester with Dynamic frameworks
```
USE_FRAMEWORKS=dynamic bundle exec pod install
```
Reviewed By: rshest, lenaic, GijsWeterings
Differential Revision: D76730331
Pulled By: cipolleschi
fbshipit-source-id: 71cca1f50763d24773dedcd8267130df261b01dc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52012
changelog: [internal]
On iOS, once a prop on a view is controlled by animated, the control is never released to Fabric or React. That's why it is important to use direct manipulation to commit even final value.
Reviewed By: lenaic
Differential Revision: D76601913
fbshipit-source-id: ea02219e158f28977018b34ac7152b899723b35a
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
const{
prepareFailurePayload,
sendMessageToDiscord,
}=require('../notifyDiscord');
describe('prepareFailurePayload',()=>{
it('should handle undefined failures',()=>{
constmessage=prepareFailurePayload(undefined);
expect(message).toEqual({
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
});
});
it('should handle empty failures array',()=>{
constmessage=prepareFailurePayload([]);
expect(message).toEqual({
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
});
});
it('should format a single failure correctly',()=>{
constfailures=[
{
library:'react-native-reanimated',
platform:'iOS',
},
];
constmessage=prepareFailurePayload(failures);
expect(message).toEqual({
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] react-native-reanimated',
});
});
it('should sort multiple failures by platform and library name',()=>{
constfailures=[
{
library:'react-native-reanimated',
platform:'iOS',
},
{
library:'react-native-gesture-handler',
platform:'Android',
},
{
library:'react-native-screens',
platform:'iOS',
},
{
library:'react-native-svg',
platform:'Android',
},
];
constmessage=prepareFailurePayload(failures);
// The failures should be sorted: first Android (alphabetically), then iOS
// Within each platform, libraries should be sorted alphabetically
expect(message).toEqual({
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [Android] react-native-gesture-handler\n❌ [Android] react-native-svg\n❌ [iOS] react-native-reanimated\n❌ [iOS] react-native-screens',
});
});
it('should handle failures with missing properties',()=>{
constfailures=[
{
// Missing library
platform:'iOS',
},
{
library:'react-native-gesture-handler',
// Missing platform
},
{
// Both missing
},
];
constmessage=prepareFailurePayload(failures);
expect(message).toEqual({
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] Unknown\n❌ [Unknown] react-native-gesture-handler\n❌ [Unknown] Unknown',
console.log('Successfully sent message to Discord');
return;
}else{
consterrorText=awaitresponse.text();
console.error(
`Failed to send message to Discord: ${response.status}${errorText}`,
);
thrownewError(`HTTP status code: ${response.status}`);
}
}
/**
* Prepares a formatted Discord message payload from a list of failures.
* @param {Array<Object>} failures - List of failures to format
* @returns {Object} - The formatted Discord message payload
*/
functionprepareFailurePayload(failures){
if(!failures||failures.length===0){
return{
content:
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
};
}
// Sort failures by platform and then by library name
constsortedFailures=[...failures].sort((a,b)=>{
// First sort by platform
constplatformA=a.platform||'Unknown';
constplatformB=b.platform||'Unknown';
if(platformA!==platformB){
returnplatformA.localeCompare(platformB);
}
// Then sort by library name
constlibraryA=a.library||'Unknown';
constlibraryB=b.library||'Unknown';
returnlibraryA.localeCompare(libraryB);
});
// Format the failures into a message
constformattedFailures=sortedFailures
.map(failure=>{
constlibrary=failure.library||'Unknown';
constplatform=failure.platform||'Unknown';
return`❌ [${platform}] ${library}`;
})
.join('\n');
return{
content:`⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n${formattedFailures}`,
stale-issue-message:'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message:'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-issue-message:'This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
stale-pr-message:'This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
close-issue-message:'This issue was closed because it has been stalled for 7 days with no activity.'
close-pr-message:'This PR was closed because it has been stalled for 7 days with no activity.'
exempt-issue-labels:'Help Wanted :octocat:, Good first issue, Never gets stale, Issue:Author Provided Repro'
needs:[prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]# prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
needs:[prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]# prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
env:
PROJECT_NAME:iOSTemplateProject
HERMES_WS_DIR:/tmp/hermes
@@ -565,7 +573,7 @@ jobs:
test_ios_helloworld:
runs-on:macos-14
needs:[prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]# prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
needs:[prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]# prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declaremodule'jsonc-parser'{
/**
* Creates a JSON scanner on the given text.
* If ignoreTrivia is set, whitespaces or comments are ignored.
*/
declareexportconstcreateScanner:(
text:string,
ignoreTrivia?:boolean,
)=>JSONScanner;
exporttypeScanError=number;
exporttypeSyntaxKind=number;
/**
* The scanner object, representing a JSON scanner at a position in the input string.
*/
exporttypeJSONScanner=$ReadOnly<{
/**
* Sets the scan position to a new offset. A call to 'scan' is needed to get the first token.
*/
setPosition(pos:number):void,
/**
* Read the next token. Returns the token code.
*/
scan():SyntaxKind,
/**
* Returns the zero-based current scan position, which is after the last read token.
*/
getPosition():number,
/**
* Returns the last read token.
*/
getToken():SyntaxKind,
/**
* Returns the last read token value. The value for strings is the decoded string content. For numbers it's of type number, for boolean it's true or false.
*/
getTokenValue():string,
/**
* The zero-based start offset of the last read token.
*/
getTokenOffset():number,
/**
* The length of the last read token.
*/
getTokenLength():number,
/**
* The zero-based start line number of the last read token.
*/
getTokenStartLine():number,
/**
* The zero-based start character (column) of the last read token.
*/
getTokenStartCharacter():number,
/**
* An error code of the last scan.
*/
getTokenError():ScanError,
}>;
/**
* For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.
*/
declareexportconstgetLocation:(
text:string,
position:number,
)=>Location;
/**
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
* Therefore, always check the errors list to find out if the input was valid.
*/
declareexportconstparse:(
text:string,
errors?:ParseError[],
options?:ParseOptions,
)=>any;
/**
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
*/
declareexportconstparseTree:(
text:string,
errors?:ParseError[],
options?:ParseOptions,
)=>Node|void;
/**
* Finds the node at the given path in a JSON DOM.
*/
declareexportconstfindNodeAtLocation:(
root:Node,
path:JSONPath,
)=>Node|void;
/**
* Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
exports[`Babel plugin inline view configs can inline config for FullNativeComponent.js 1`] = `
"// @flow
@@ -153,6 +225,61 @@ exports[`Babel plugin inline view configs fails on inline config for CommandsExp
24 |"
`;
exports[`Babel plugin inline view configs fails on inline config for CommandsWithComplexCoverageInvalidNativeComponent.js 1`] = `
"/CommandsWithComplexCoverageInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
14 |
15 | // Complex coverage instrumentation with invalid nested structure - should fail
> 16 | export const Commands = (
| ^
17 | cov_xyz789().f[1]++,
18 | cov_xyz789().s[2]++,
19 | {"
`;
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageInvalidNativeComponent.js 1`] = `
"/CommandsWithCoverageInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
14 |
15 | // Coverage instrumentation of invalid Commands export - should still fail
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageTypeCastInvalidNativeComponent.js 1`] = `
"/CommandsWithCoverageTypeCastInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
19 |
20 | // Coverage instrumentation with type cast but wrong function - should fail
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageWrongFunctionNativeComponent.js 1`] = `
"/CommandsWithCoverageWrongFunctionNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
14 |
15 | // Coverage instrumentation of wrong function call - should fail
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.