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