Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54142
## Changelog:
[Internal] [Added] - Allow passing down frameRateListenerCallback in cxx animated
exposing `frameRateListenerCallback` to add instrumentation at animation frame and stop
we're deferring the actual implementation of frame rate listening/logging to app/platform side
Reviewed By: sammy-SC
Differential Revision: D84510183
fbshipit-source-id: d8835542e8e50c5018032c951a510fec27b5a4d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54211
## Changelog:
[Internal] [Added] - always invoke onRender via UIManagerNativeAnimatedDelegate
Previously only android invokes `onRender` via UIManagerNativeAnimatedDelegate::runAnimationFrame()
consolidating so it's easier for debugging, also in cases where we want to add extra work per frame (e.g. add performance logging) in AnimatedNodesManagerProvider
Reviewed By: sammy-SC
Differential Revision: D85071075
fbshipit-source-id: 770df523de506c8442d063c417229e36bcf5dd31
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54232
We're not syncing the legacy renderers, which means the React package will continue to move forward while these stay frozen. That means we need to remove the version compatibility checks between react and the legacy ReactNativeRenderers.
Changelog:
[Internal]
Reviewed By: cortinico, cipolleschi
Differential Revision: D85248891
fbshipit-source-id: 19e0812c59f69301e2666e6272c10ac56ecbde1f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53837
Changelog: [Internal]
Replaces usage of Hermes built inside the React Native repository with the release published from the Hermes repo.
Reviewed By: cipolleschi
Differential Revision: D82721725
fbshipit-source-id: 357d5e2b914675ec6e60f810c382a945aa461732
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53985
Changelog: [Internal]
Updates the release scripts to set the Hermes version independently from React Native.
Reviewed By: cipolleschi
Differential Revision: D82438054
fbshipit-source-id: 154c19d1d0d16fd5879ad663428d803ceadc5a1f
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react's builds/facebook-fbsource branch on GitHub. 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
Generated by: https://www.internalfb.com/intern/sandcastle/job/9007201517475550/
GitHub Repo: facebook/react
# Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D84722100
fbshipit-source-id: cbc6f4cdec01124b00ca011b1667c4f7bdb98a37
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54227
All these flags were introduced for rollout purposes. We no longer need them. Let's get rid of them
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D85171189
fbshipit-source-id: 4bd0531dfc3a9841fbe7db9a8f80329e04896e08
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54222
Changelog: [internal]
Reduce boilerplate in some tests now that we can pass refs to some Fantom APIs.
Reviewed By: javache
Differential Revision: D85143176
fbshipit-source-id: 0e107891f1027a185821e21e5fa76f019cec5bb1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54221
Changelog: [internal]
Small change in the Fantom API to accept refs and reduce boilerplate. See next diff for examples
Reviewed By: javache
Differential Revision: D85143177
fbshipit-source-id: fd65abcc1b107df8726fee172b284f5dc96e88a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54129
Changelog: [Internal]
The team maintaining gmock is [uninterested, as a matter of principle,](https://github.com/google/googletest/issues/2646#issuecomment-630919122) in improving the ergonomics of writing helper functions around `EXPECT_CALL`. However, such helpers have proven very useful for the `jsinspector-modern` C++ test suite. The out-of-the-box ergonomics *are* pretty bad, though, so this diff tries to improve the situation.
The biggest offender in our test suite is the `expectMessageFromPage` helper function - if a test fails because an expectation isn't met, the error message points to the `EXPECT_CALL` line inside `expectMessageFromPage`, which is utterly useless compared to the line of test code that *called* `expectMessageFromPage`.
Here, we reach into gmock's internals slightly to create a variant of the `EXPECT_CALL` macro that allows passing in a [`std::source_location`](https://en.cppreference.com/w/cpp/utility/source_location.html) (thanks, C++20!). We then teach `expectMessageFromPage` and other such helpers to capture a source location at the call site (using a parameter with a default value to `source_location::current()`) and use the modified macro to pass it into gmock.
Reviewed By: huntie
Differential Revision: D84368993
fbshipit-source-id: 62f64b6c5f626a54bc3da7143d84ee2d75d16ac6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54128
Changelog: [Internal]
Adds an integration test for `NetworkReporter`'s CDP Tracing domain output (via `PerformanceTracer` behind the scenes), i.e. the traces that power the Network track in the Performance panel in React Native DevTools.
The test covers the `Tracing` and `Network` domains being enabled simultaneously, as well as `Tracing` on its own.
Reviewed By: huntie
Differential Revision: D84337901
fbshipit-source-id: f82af33575806fc3b99636cdb1eb9803c04c8c07
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54218
Observed some crashes coming from `schedulerDidRequestPreliminaryViewAllocation` which seemed to point at the FabricMountingManager being destroyed from the Hades GC thread. That thread is not attached to the JVM, so would crash when trying to destroy this global_ref.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D85143603
fbshipit-source-id: 2ecd42d57188e6f3d69a6124e21ee8913b3d5b89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54214
# Changelog: [Internal]
React started using `clearMeasures` in https://github.com/facebook/react/pull/34803. It only does it if `performance.measure()` is defined. This should be enough for a feature check of User Timings API presence, but out stub doesn't follow the same spec.
Adding `clearMarks()` and `clearMeasures()` stubs to the object.
Reviewed By: rubennorte
Differential Revision: D85082720
fbshipit-source-id: 3b117a6545e131cdbb2d5efb73d500a928469864
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54213
## Changelog: [Internal]
Modifies `VirtualViewContainerStateExperimental` to use an interval tree to store the container's VirtualViews. Interval tree's query allows us to lower the frequently-used updateModes() operation from `O(n)` to `O(m + log n)`, where `m` is the number of VirtualViews in the hysteresis range. General layout changes incur a penalty due to the requirement of maintaining a balanced BST.
Performance Changes:
* updateModes(): `O(n) -> O(m + log n)` (new algo)
* updateMode(): `O(1) -> O(1)`
* add VV: `O(1) -> O(log n)`
* update VV: `O(1) -> O(log n)`
* delete VV: `O(1) -> O(log n)`
We expect scrolling to be much more frequent than a total layout change/updating many of the elements in the container at once. However, the initial load of a page will take `O(n log n)` time rather than `O(n)` time.
We also include some bookkeeping sets for "old" hysteresis, prerender, and visible VVs. This will increase the memory footprint of `VirtualViewContainerState` by `O(m)`.
More details are in https://docs.google.com/document/d/1Cmamx6fNfruoHLApX8tedqNVZsCEUyoBvQWpMvBsfcY/edit?tab=t.gqla6vu3231k.
### Note
This diff only covers the Android version. iOS may follow after experimentation.
Reviewed By: lunaleaps
Differential Revision: D83783201
fbshipit-source-id: 93a7a93784d668e09d8ddacc7e30d289ccd8b7a2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54162
Changelog [Internal]:
Splits VirtualViewContainerState implementation into three parts: (1) an abstract parent class, (2) the "classic" version (existing version), and (3) the "experimental" version (new changes to be made). The experimental version is a copy of the classic version for now.
Reviewed By: lunaleaps
Differential Revision: D84569206
fbshipit-source-id: b41cd9faf06d2de0dff17148ded72193107e5b9e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54156
Changelog: [Internal]
Introduces new React Native feature flag for VirtualViewContainerState versioning changes.
Follow up diffs will create classic and experimental versions of VirtualViewContainerState. This feature flag is meant to eventually be overridden with MetaConfig variables.
Reviewed By: lunaleaps
Differential Revision: D84569199
fbshipit-source-id: aaca31bd1946c56f7de3d7fd52a126b0165e59d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54209
Changelog: [Internal]
This diff reverts D84624705
The marker is logged even if there is a full bundle reload.
Depends on D84624705
Reviewed By: hoxyq
Differential Revision: D85048405
fbshipit-source-id: 0d634a034efe42b404abe1992a4f82280dbeedec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54186
The `marchingFallback` directive is applied directly on the build type.
However here is invoked inside the `externalNativeBuild` making it confusing, because in reality
it has nothing to do with `externalNativeBuild`. So I'm moving it to the correct location
(this has no effect on the build setup, is just to make the code easier to read).
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D84921628
fbshipit-source-id: 064336ad64a8e1de20b747276f6e5ca7ce7cb677
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54185
Validate that the changes in D83341309 work across both experiment variants.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D84924308
fbshipit-source-id: 7bf13d00f32c7af778b142ff3abdd0c2f7a5ba24
Summary:
This PR adds native CSS parser for `backgroundImage` property. Currently, it supports linear-gradient and radial-gradient spec compliant CSS syntax.
## Changelog:
[GENERAL] [ADDED] - background image native parser.
<!-- 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/53609
Test Plan:
- Replicated existing testcases from JS. Currently i've added CSS syntax testcases. Checkout `CSSBackgroundImageTest.cpp`
### Verify example screens in RNTester
- Set `enableNativeCSSParsing` to true in `ReactNativeFeatureFlags.config.js` and run `yarn featureflags --update`
- Rebuild the project and verify `LinearGradientExample` and `RadialGradientExample` screens on both platforms.
### Notes
- Currently it is difficult to run CSS renderer tests. I made a custom cmake config to get it working, some steps would be helpful.
- Right now the new CSS renderer seems to be only working on iOS. NickGerleman mentioned there is some WIP to get it working on android. So please test this PR on iOS.
Reviewed By: mdvacca
Differential Revision: D83341309
Pulled By: javache
fbshipit-source-id: 91b88e3df164766c1f0021283697b1e5f9b44bfc
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