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