Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48712
Currently, all scroll events can be throttled by the `scrollEventThrottle` value when the intention is only to throttle `onScroll` calls. As a result, the scroll view helper unintentionally drops events unrelated to scrolling, like momentum begin/end. It's imperative that these momentum events dispatch so the scroll view does not lock itself in an "animated" state on the JS side; if locked in an animation state, children of the scroll view will not receive touch events. This can happen when the throttle is sufficiently high and momentum scrolling completes before the throttle time has elapsed.
Changelog:
[Android][Fixed] - Scroll view throttle no longer impacts events other than `onScroll`
Reviewed By: javache, rshest
Differential Revision: D68234045
fbshipit-source-id: d5c11412d3f273811a45e6f61af08d3fcf9f61d5
Summary:
Continuing our usual journey, this time migrating MessageQueueThread. Was not expecting to see that many assertions in ReactContext.
One important thing to note on this PR: I had to add an extra Throw RuntimeException to `startNewBackgroundThread`. It already had one from the`dataFuture.getOrThrow()`, but if your thread is not associated with a Looper, calling `myLooper` (Line 203 of MessageQueueThreadImpl) Can return null. Until now, this would have been a `NPE`, i just decided to make it a `RuntimeException` with the message `Looper not found for thread`. Let me know if you want me to make that function return a nullable, or throw another message or exception, or if you want me to treat Looper as Nullable in the whole class.
## Changelog:
[INTERNAL] [FIXED] - Migrate MessageQueueThread and MessageQueueThreadImpl to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48652
Test Plan: <img width="1318" alt="Screenshot 2025-01-13 at 21 03 00" src="https://github.com/user-attachments/assets/462cc8af-4648-4437-9260-5ffa6c69e763" />
Reviewed By: tdn120
Differential Revision: D68155120
Pulled By: rshest
fbshipit-source-id: 1082a832df5b1d8ee64ca7be26e4b85e79152f88
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48723
## Changelog:
[Internal] -
In certain scenarios `TouchEvent` can be initialized with "unexpected" event actions, such as `ACTION_SCROLL`.
This caused an exception , even though such scenarios may be legitimate.
Reviewed By: javache
Differential Revision: D68265040
fbshipit-source-id: d31881e03d9110bb4f6af38548a4f73a41c54d2b
Summary:
The testing script is making unnecessary call to `input keyevent 82` which causes the Android device to
open the menu.
## Changelog:
[Internal] [Changed] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48707
Test Plan: Tested local with local device
Reviewed By: cipolleschi
Differential Revision: D68215641
Pulled By: cortinico
fbshipit-source-id: 3e2653d8aa0c1e6606d9921f7b3794d0d27ef3f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48715
{D68154908} fixed a problem with the `onAnimatedValueUpdate` listener not being correctly attached if `__attach` were called before `__makeNative` (which sets `__isNative` to true).
We're potentially seeing production symptoms of stuttering interactions and user responsiveness, after queuing up many operations. Our hypothesis is that in scenarios where `ensureUpdateSubscriptionExists` is being called during `__makeNative` (instead of during `__attach`), a backup of operations occurs leading to these symptoms.
This diff attempts to validate and mitigate this hypothesis by deferring `ensureUpdateSubscriptionExists` to when an `AnimatedValue` instance has had both `__attach` and `__makeNative` invoked.
Changelog:
[Internal]
Differential Revision: D68236594
fbshipit-source-id: 2089100a773ebfc161fb5b567123eb58a893939f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48708
{D68171721} [facebook/react-native#48678](https://github.com/facebook/react-native/pull/48678) mitigated the bug that necessitated this revert.
Changelog:
[General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects.
Reviewed By: sammy-SC
Differential Revision: D68217144
fbshipit-source-id: 6796440f2839d897158528642e07869951651327
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48703
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling
## This diff
- Updates files in Libraries/Alert and Libraries/ActionSheetIOS to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the related modules
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Alert` and `Libraries/ActionSheetIOS` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Differential Revision: D68210738
fbshipit-source-id: a984034b165908f75485f2bad33fcccadd865494
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48678
While diagnosing a recent issue in which `AnimatedValue` instances were not being correctly updated as expected, the insertion effects feature flag was identified as a root cause.
Upon further investigation, it appears that this is because the `onUserDrivenAnimationEnded` listener was not implemented the same way in the two feature flag states:
- When `useInsertionEffectsForAnimations` is disabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in a passive effect, after all nodes have been attached.
- When `useInsertionEffectsForAnimations` is enabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in an insertion effect when attaching nodes.
The bugs occurs because `useAnimatedProps` checks whether native driver is employed to decide whether to listen to `onUserDrivenAnimationEnded`. However, we do not know whether native driver will be employed during the insertion effect. (Actually, we do not necessarily know that in a passive effect, either... but that is a separate matter.)
This fixes the bug when that occurs when `useInsertionEffectsForAnimations` is enabled, by moving the listening logic of `onUserDrivenAnimationEnded` into a passive effect. This is the same way that it is implemented when `useInsertionEffectsForAnimations` is disabled.
Changelog:
[Internal]
Reviewed By: javache, sammy-SC
Differential Revision: D68171721
fbshipit-source-id: 50b23348fd4641580581cacebc920959651f96a7
Summary:
Whenever I run `yarn lint --fix` I noticed that this test is not formatted correctly. This fixes it.
## Changelog:
[Internal] [Changed] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48692
Test Plan: CI
Reviewed By: sammy-SC
Differential Revision: D68207001
Pulled By: cortinico
fbshipit-source-id: 2a6c44ca02249f6662b03c87f0c4d4f3eb5a3054
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48690
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68205691
fbshipit-source-id: 22a3416335052a4bf6a76faa6e6af622254a6e56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48689
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] - RNGP - Cleanup prealpha logic from the Gradle Plugin
Reviewed By: cipolleschi
Differential Revision: D68205665
fbshipit-source-id: 81d5257544df97b566421164944e3b6e71f06635
Summary:
In the old arch, stylistic sets were supported however in the new arch support was not added. It seems that fontVariant support was actually initially missed on iOS fabric however a limited version was added in https://github.com/facebook/react-native/pull/44112 . I referenced that PR and also old arch implementation for these changes.
<img width="480" alt="Screenshot 2025-01-14 at 11 15 18 AM" src="https://github.com/user-attachments/assets/ec32a356-fadd-4281-83b9-15871bbcd18f" />
## 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] [ADDED] - Support stylistic sets for fontVariant
Pull Request resolved: https://github.com/facebook/react-native/pull/48674
Test Plan:
- Verified that the "Unsupported FontVariant" native log no longer displays on both platforms
- On iOS was easy to test in the tester app as SF supports stylistic sets by default:
```
<Text>
Stylistic{'\n'}
<Text>Normal: ${'\n'}</Text>
<Text style={{fontVariant: ['stylistic-four']}}>
Stylistic Four: $
</Text>
</Text>
```
<img width="391" alt="Screenshot 2025-01-14 at 11 59 29 AM" src="https://github.com/user-attachments/assets/1ede258e-783f-448f-8300-4c8c710796ef" />
- On Android I could not find any system fonts that support stylistic sets by default so I added Raleway and confirmed with a W character

I did not add font variant example to the tester apps as I felt it could be confusing for people at a glance to understand why there is only a system font example on iOS and why I chose the specific stylistic set.
Reviewed By: cipolleschi
Differential Revision: D68205738
Pulled By: javache
fbshipit-source-id: 03ce572d3c8ecafca71fe00fc0e88eeafc2558bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48664
Simplify ViewManager base-class by making `ViewManager`'s delegate non-nullable and using a single path for updating properties.
The ViewManagerDelegate API can map back to the original ViewManagerSetter API transparently, allowing us to remove the codepath from `ViewManagerPropertyUpdater`.
Changelog: [Android][Removed] `ViewManagerPropertyUpdater.updateProps` is deprected, use the related ViewManager APIs instead
Reviewed By: mdvacca, rshest
Differential Revision: D68120420
fbshipit-source-id: cd8b906dc36d4803dbe09ee0283654285eb81fd4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48658
Migrate to Kotlin before I make further changes to this. Generics are really tricky due to our previous usage of raw generics on the Java side, but were worked around by some combination of unchecked cast and `Nothing`
Changelog: [Internal]
Reviewed By: mdvacca, rshest
Differential Revision: D68102210
fbshipit-source-id: 90013f09db0826f571a4e2a84132ae3b49fa299d
Summary:
This change improves the E2E testing by downloading the iOS RNTesterApp that is built in CI instead of building it locally. This should let us save 10 to 20 minutes when we test a new release.
## Changelog:
[Internal] - Use the RNTester app built in CI for release testing on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/48637
Test Plan:
- build the app in ci
- run `yarn test-e2e-local -c <my-token>` and `yarn test-e2e-local -h false -c <my-token>` and verify that the iOS app is not built, but run in the simulator
Reviewed By: cortinico
Differential Revision: D68161477
Pulled By: cipolleschi
fbshipit-source-id: 577d110f9ff0197a2d3348a08a60e60a4d0a752b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48547
For some unknown reason, we have been swallowing [`requestFocus`](https://developer.android.com/reference/android/view/View#requestFocus(int) calls since `TextInput` is a controlled component - meaning you can control this components value and focus state from JS. This decision was originally made pre 2015 and I cannot find the reason why
I do not think this makes sense. We can still request focus from JS, while allowing the OS to request focus as well in certain cases and we would still be controlling this text input.
This is breaking keyboard navigation. Pressing tab or arrow keys will no-op if the next destination is a `TextInput`. This is because Android will call `requestFocus` from [here](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/ViewRootImpl.java;l=7868?q=performFocusNavigation) when handling key events. Notably, Explore By Touch (TalkBack) swiping gestures WOULD focus `TextInputs` since they go through `ExploreByTouchHelper` methods which we override to call the proper `requestFocusInternal()` method.
**In this diff**: I move the logic in `requestFocusInternal()` into `requestFocus`.
Changelog: [Android] [Fixed] - TextInputs can now receive focus via external keyboard
Reviewed By: NickGerleman
Differential Revision: D67953398
fbshipit-source-id: 506006769a7c8a63f0a9b7ce27cfbe8578777790
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48677
E2E tests are flaky again.
Let's bump maestro to see if stability improves.
This will also remove some noise from the logs, make them easier to read.
## Changelog
[Internal] - Bump maestro version
Reviewed By: cortinico
Differential Revision: D68160005
fbshipit-source-id: 40a25f974dfda75785bf08d8d236e771b44d13cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48672
## Changelog:
[General] [Fixed] - Buttons becoming unresponsive when transform is animated
# The problem
D67872307 changes when `ensureUpdateSubscriptionExists` is called to in `__attach`. This breaks the functionality because `__attach` is called before flag `__isNative` is set and subscriptions are never setup.
# Fix
The diff sets up subscriptions in `__makeNative` method.
Reviewed By: yungsters
Differential Revision: D68154908
fbshipit-source-id: e2ac108b064a66dda08902653d6bd20286f92458
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48666
The New Architecture sample is getting too big and the two views are not visible anymore.
I'm fixing this but having buttons side by side.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68153245
fbshipit-source-id: 5557fd40f81078fe3994d8efe0e73784e043ed78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48670
The `LICENSE-docs` was needed when this repo was also containing the reactnative.dev docs.
As this is not the case anymore, this file is unncessary.
Changelog:
[Internal] [Changed] - Remove unnecessary LICENSE-docs
Reviewed By: cipolleschi
Differential Revision: D68156336
fbshipit-source-id: 489bf2cb95916c20eb61bfb00e34b8e271bc08e3