Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45413
## Changes
Add an example in RNTester to test that pressability with NativeDrivers works properly.
## Context
The pressability handling is a bit peculiar.
We have to handle 3 main behaviors:
* `PressIn` -> `PressOut` => triggers the `onPress`
* `PressIn` -> move inside the rectangle -> `PressOut` => triggers the `onPress`
* `PressIn` -> move outside the rectangle -> `PressOut` => cancel `onPress`.
For the first case, we detect whether the press happens inside a component in the Native layer only. And everything works.
When a move is involved, we:
1. Detect the initial press in the Native layer
2. We move the coursor and we delegate the detection of whether we are inside of a rect or not to the JS layer
3. The JS layer asks the C++ layer about the layout and decide whether we are in case 2 (move but still inside the rect) or in case 3 (move but outside the rect).
The problem is that with `nativeDriver` and animations, the C++ layer doesn't know about where the receiver view actually is.
This results in issues like the one shown by [#36504](https://github.com/facebook/react-native/issues/36504), where the onMove is not handled correctly.
## Solution
The solution is to keep detecting whether we are in the receiver view or not in the Native layer and pass the receiver view position and size back to JS so that the JS layer don't have to jump to C++ to make this decision.
We decided to pass the frame information because the JS layer is adding some padding and configurations to the final rectangle and we don't want to lose those configurations.
## Changelog
[General][Added] - Add example in RNTester to show that pressability works properly with NativeDrivers
Reviewed By: sammy-SC
Differential Revision: D58182480
fbshipit-source-id: 9ca4fb9a3ca1a8af52ccbe208cbfe8434175f87d
Summary:
CCI on main is broken. We suspect that's due to cache issues which restore a wrong layout for the Folly pod.
This PR is an attempt to fix it
## Changelog:
[Internal] - Fix missing folly base 64
Pull Request resolved: https://github.com/facebook/react-native/pull/45460
Test Plan: CCI and GHA are green
Reviewed By: sammy-SC, huntie
Differential Revision: D59804748
Pulled By: cipolleschi
fbshipit-source-id: 44d6b169cf3319f4d7ee9e0a5833f07bc6ba4bb3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45458
Checking for packager is an async operation, which may return when we've already destroyed the ReactInstanceManager. Prevent the CatalystInstance from being created if the ReactInstanceManager has been invalidated.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D59753247
fbshipit-source-id: e3ac2b6dd142330e2d4051519b9863584b33f8a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45459
Seeing failures on main with GHA for gradle builds, in the Post Setup gradle step:
```
Could not get unknown property 'cleanupTime' for object of type org.gradle.api.internal.cache.DefaultCacheConfigurations.
```
This is a speculative change to get CI back to stable.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D59802517
fbshipit-source-id: c7b5259397fddef9420570043263e92f21718934
Summary:
This change factors out build-android job so we can reuse it
## Changelog:
[Internal] - Factor out the build-android job for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45455
Test Plan: GHA are green
Reviewed By: blakef
Differential Revision: D59802116
Pulled By: cipolleschi
fbshipit-source-id: 12ece8004da3bfd1f275b4af8e9822d4b0ccc0f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45448
changelog: [internal]
I would like to experiment with executing insert mount instructions after layout and state update. It has shown small improvement in local testing
Reviewed By: mdvacca
Differential Revision: D59582123
fbshipit-source-id: 3ee6ec12a533a287ed32f7373863175f3a107548
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45410
changelog: [internal]
For better performance, let's test setting up the animation graph from passive effects. This will delay the work, not blocking the paint.
Reviewed By: rubennorte
Differential Revision: D59644374
fbshipit-source-id: ff951ee7c1a1d47e13c55fc7c7f6c0690aa465f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45444
## Changelog:
[Internal] -
Even though `ScrollView.scrollIndicatorInsets` isn't supported on the vanilla Android platform, it still may be used on some other variations of it, which means that the changes may not potentially find the way into C++/Fabric, opening a door of all kinds of weird corner case issues.
Reviewed By: christophpurrer
Differential Revision: D59761458
fbshipit-source-id: 4dae5c96791ca924d589a3d803d8fa60fdca1b67
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45304
Add support for most keyword values of mix-blend-mode on iOS and added RNTester Example
Missing compositing operators and global values
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D59402969
fbshipit-source-id: b7e1aaed01fbf8f80e04ad0fa73d2ef63b5ad933
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45306
Adding missing drop-shadow test to rn-tester.
Added with alpha-hotdog image to show we are creating the shadow with the alpha channel of the view.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D59410148
fbshipit-source-id: 5a03ee84313979f99585b8ca7e07abf9cdbe2396
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45443
We are only building these out for Fabric. This means only one natural iOS impl, but that other Android bits will not work fully correctly on Paper (like setting containing block for filter element). This also means we can remove view configs once we're on Fabric CSS parser. We will do the same for boxShadow once that is ready.
Changelog: [internal]
Reviewed By: mdvacca
Differential Revision: D59762282
fbshipit-source-id: 14ce07f04b822c6aee908894c9081419594fc484
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45421
RNTester contains Android resources that are loaded by name and not resolved by Metro. As a result, these assets are not automatically linked when RNTester JS code is embedded in other projects. This is considered "legacy" loading and is generally discouraged, but is still showcased as an alernative way of loading resources.
I also modified the Image test to ensure that flag status is printed so it's obvious why the vector drawable hasn't loaded.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D59585555
fbshipit-source-id: d42fb44d8846d8e7c7aa01dca4cec89ae85a9195
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45442
This deprecates also `DeveloperSettings.isStartSamplingProfilerOnInit`
so we can remove it in a future version of React Native.
This field is unused so you should not be using it at all.
Changelog:
[Android] [Changed] - Deprecate DeveloperSettings.isStartSamplingProfilerOnInit
Reviewed By: blakef
Differential Revision: D59757500
fbshipit-source-id: dc879ba46f2f937e5f259a4101646c2f060db548
Summary:
## Summary
Now that HostContext determination for Fabric is a DEV-only behavior, we
can move the HostContext determination to resolve from the ViewConfig
for a given type. Doing this will allow arbitrary types to register
themselves as potential parents of raw text string children. This is the
first of two diffs for react as we'll:
1. Add the new property to the ViewConfig types
2. Update React Native to include the `supportsRawText` property for
`RCTText`, `RCTVirtualText`, `AndroidTextInput`, etc.
3. Switch the behavior of react to read from the ViewConfig rather than
a static list of types.
Changelog: [Internal]
## Test Plan
- yarn test
- yarn test --prod
- Pulled change into react-native, added `supportsRawText` props to
RCTText, RCTVirtualText, etc. ViewConfigs and confirmed everything type
checks.
DiffTrain build for commit https://github.com/facebook/react/commit/a5cc797b8801dfe58c7a34c99a9fa60c6c9c8274.
bypass-github-export-checks
Reviewed By: poteto
Differential Revision: D59641180
Pulled By: rozele
fbshipit-source-id: a3ddb1bc810a70d5f782e708cb845e3eae136d78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45365
## Changelog
As a followup to https://github.com/facebook/react-native/pull/45139
There I only implemented `hostPlatformColorFromRGBA` and `alpha/red/green/blueFromHostPlatformColor` on cxx platform, then used cxx platform specific method at some places. but really I should implement and use methods in `Color.h` that are platform agnostic
* cxx/android: platform color format is int32_t, RGBA are 8bit unsigned int ([0,255])
* windows: platform color format is `winrt::Windows::UI::Color` where RGBA props are 8bit unsigned ints ([0,255])
* apple: platform color format is `UIColor` where RGBA props are floats in [0,1]
[Internal]
previous change D58872165
Reviewed By: christophpurrer
Differential Revision: D59593659
fbshipit-source-id: 5d18419039817510e607d4e3f632c207d25c30a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45436
changelog: [internal]
In D58355433, delete tree experiment was cleaned up. These are the remainings of the experiment that are no longer used. Let's delete them to clean up dead code
Reviewed By: javache
Differential Revision: D59732137
fbshipit-source-id: a22c0b14eda70e62817e80224f367ccb9006acc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45354
Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views ([issue](https://github.com/facebook/fresco/issues/329), [issue](https://github.com/facebook/fresco/issues/1463), [issue](https://github.com/facebook/fresco/issues/2463)). Guidance has been to instead load the vector drawable onto the backing image view ourselves. On the React Native side, having the ability to load vector drawables has been requested many times ([issue](https://github.com/facebook/react-native/issues/16651), [issue](https://github.com/facebook/react-native/issues/27502)).
I went this route over using a custom Fresco decoder for XML assets because vector drawables are compiled down into binary XML and I couldn't find a trivial, performant way to parse those files in a context-aware manner. This change only accounts for vector drawables, not any of the other XML-based drawable types (layer lists, level lists, state lists, 9-patch, etc.). Support could be added easily in the future by expanding the `getDrawableIfUnsupported` function.
## Changelog
[Android] [Added] - Added support for rendering XML assets provided to `Image`
Reviewed By: javache
Differential Revision: D59530172
fbshipit-source-id: 3d427c06238287e0a3b7f9570ac20e43d76126c7
Summary:
This is just a minor nit to make it easier to copy-n-paste
## Changelog:
[INTERNAL] - Remove extra dot from close-pr.yml
Pull Request resolved: https://github.com/facebook/react-native/pull/45441
Test Plan: N/A
Reviewed By: cipolleschi
Differential Revision: D59752879
Pulled By: cortinico
fbshipit-source-id: caa398010b64024e2a0259d177762fd76082507f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45440
We only have one type of JavaScriptException anymore, so this can be simplified.
Changelog: [Android][Removed] Removed HasJavascriptExceptionMetadata as a marker interface. Use JavascriptExecption directly
Differential Revision: D57379390
fbshipit-source-id: a088834fddb156ceed5ccc8010d3c4acd365bf29
Summary:
The rn-tester android build assumes the react-native-community/cli is available. This is no longer the case.
Changelog: [Internal]
Differential Revision: D59170923
Pulled By: blakef
fbshipit-source-id: 6f414c2be387ef46dd50ce09a98beb230c8e73b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45420
Devex improvement to skip validation when no native view config exists. Redbox is still hit, showing the true error. See test plan below before/after
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D59702501
fbshipit-source-id: 9aada9813c2930ee2b4bb23e5ba8a3e546c4e9af
Summary:
This change factors out the build hermesc windows job into a separate action to reuse the code in different jobs
## Changelog:
[Internal] - Factor out build hermesc windows for code reuse
Pull Request resolved: https://github.com/facebook/react-native/pull/45432
Test Plan: GHA are green
Reviewed By: blakef
Differential Revision: D59748955
Pulled By: cipolleschi
fbshipit-source-id: bb6b96c93ec7ba6af1a210511ec672907f237b45
Summary:
Call the react-native-community/template GHA to trigger a new release when we publish a react-native release. This then waits to confirm that the package is published.
See react-native-community/template#36 for the matching change
Changelog: [General][Added] trigger template publish
Pull Request resolved: https://github.com/facebook/react-native/pull/45327
Test Plan: Not sure on the best way forward here.
Reviewed By: cipolleschi
Differential Revision: D59467829
Pulled By: blakef
fbshipit-source-id: 091269e7ecdae5801ac7c03a1ede54452ae99b24
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45423
I noticed while fixing some CI issues that `jsinspector` emits a bunch of warnings, making finding errors (especially in CI logs) awkward.
Also fix up a couple of stale comments from earlier designs of `NetworkIOAgent`.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D59693730
fbshipit-source-id: d032150787bda320b9c38ccf2e95139411758f47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45380
Removed the use of version checking and error code that is in react-native-community/cli-tools.
Changelog:
[Internal] [Changed] - Removed community-cli-plugin version & error dependencies
Reviewed By: robhogan
Differential Revision: D59378012
fbshipit-source-id: b009edc615b873ff2bff31296ac5d87a4482944f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45381
Removing the remaining dependencies from the react-native-community/*. This
inlines a copy of the logger.
Changelog:
[Internal][Changed] Removed react-native-community/cli-tools logger dependency
Reviewed By: cipolleschi
Differential Revision: D59378011
fbshipit-source-id: ef93d9fff1c623658e33c36b6329f5d548f649e8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45409
Changelog: [internal]
This removes `BridgelessJSCallInvoker` in favor of `RuntimeSchedulerCallInvoker`. This change should be transparent when not invoking JS callbacks using priorities, as both of them would just go directly to the scheduler using `scheduleWork`, but when priorities are specified, they'd now be honored in `RuntimeSchedulerCallInvoker`.
I realized this wasn't being used when I saw that `PerformanceObserver` callbacks were always scheduled with the highest priority, instead of with idle priority as specified in code.
Reviewed By: sammy-SC
Differential Revision: D59679512
fbshipit-source-id: 51d36d56ef1ff0b34e5157ed7b5e08de0a3884d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45387
This diff prepares an experiment to test `setNativeProps` for syncing the final state of native driven animations with Fabric.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D59634489
fbshipit-source-id: 453c5a2f0edfea695f7564e0c5ead58db21cf61e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45337
tsia. Some things to consider when reviewing:
* Made a new drawable for inset shadows
* The drawable in this class is the same size as the view with some padding. The padding is needed for 2 reasons
* Blur near edges looks good
* Blur artifacts can appear inside the view if the clear region barely exits the bounds of the view
* We draw the clear shape with another drawable, which solely exists so that we can get the border box path for the adjust border. We just use this path to clip out the shadow
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D59300215
fbshipit-source-id: 30acc7aafd82122aa278a42d06418bb1079ca71f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45408
Changelog: [General][Fixed] Fixed prioritization of idle priority tasks
We recently found out that idle priority tasks were never scheduled with the lowest priority possible. We didn't realize before because idle priority tasks weren't used, but now they are via `requestIdleCallback` and other mechanisms.
The problem was that the timeout for idle priority tasks was `std::chrono:milliseconds::max()`, and we compute the expiration time adding that to the current time. Doing that operation is always guaranteed to overflow, and the resulting expiration time was always in the past, resulting in the task having higher priority than any other tasks with any other priorities.
Instead of using `max()` we can just use a sensible value for idle priorities. In this case, 5 minutes should be more than enough.
Reviewed By: sammy-SC
Differential Revision: D59679513
fbshipit-source-id: 6c0f9e275818737ce804f05615c01f7ea6c126ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45396
This diff extends TransformOrigin with a new method to serialize this Struct into a folly::dynamic map (similar to Transform)
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D59613247
fbshipit-source-id: 00e4a08d1a99fe9cabb67206e21712e65b355f7f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45417
Add sources for `folly::detail::base64` to our existing `folly` dependency for Android and iOS OSS build toolchains, now a (tiny) dependency of the JS debugger since D54309633, and already part of Folly's Buck sources.
Changelog: [Internal]
Reviewed By: cipolleschi, blakef
Differential Revision: D59685218
fbshipit-source-id: bac33402927f310bf867d2c47b4ebbb9276cf545
Summary:
Fixes: https://github.com/facebook/react-native/issues/43413
This pull request addresses an issue on Android where the text selection was not working when both `selectTextOnFocus` and `autoFocus` were set to true on TextInput.
`ReactTextInputManager` was calling `setSelectAllOnFocus` on `ReactEditText` before its onLayout is called causing text selection to not work on auto focus.
Changes Made
- Added logic to wait for the ReactEditText view's layout to be drawn before attempting to select the text.
On the first layout pass, the code now explicitly calls selectAll() to select the text.
- Implemented a check to ensure selectAll() is only called during the first layout pass, avoiding unnecessary calls on subsequent layout passes.
Impact
This change ensures that text selection is properly triggered when selectTextOnFocus and autoFocus are both enabled, improving the user experience and making text input behavior consistent and reliable.
## Changelog:
[ANDROID] [FIXED]: fixed select text on auto focus for TextInput
<!-- 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/45004
Test Plan:
| Before | After |
|--------|--------|
|  |  |
Reviewed By: javache
Differential Revision: D59448600
Pulled By: cortinico
fbshipit-source-id: 8a594d3193f227ba2d64b808d905bab8b3d24e9b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45407
This bumps to the latest minor of Gradle
Changelog:
[Android] [Changed] - Gradle to 8.9
Reviewed By: NickGerleman
Differential Revision: D59677575
fbshipit-source-id: 05b9afc6f32a9cd11461bc04522d1e522644867e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44845
## Design
- `NetworkIOAgent` is owned by the `HostAgent`.
- `NetworkIOAgent` is passed any CDP requests not handled by the `HostAgent` itself, and before delegating to `InstanceAgent`.
- It handles:
- [`Network.loadNetworkResource`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)
- [`IO.read`](https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-read)
- [`IO.close`](https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-close)
- `NetworkIOAgent.loadNetworkResource` creates a `Stream` corresponding to a single resource download/upload. A reference is held in a map `streams_` until an error, the agent is disconnected (destroyed) or it is discarded by the frontend with `IO.close`.
- `delegate.loadNetworkResource` is called with a `stream`-scoped executor, which it uses to call back with headers, data and errors.
- Callbacks for `IO.read` requests are held by the `Stream` until the incoming data is complete or enough data is available to fill the request (an implementation choice to optimise for fewest round trips). Any incoming data or error causes any pending requests to be rechecked.
{F1719616688}
## Unimplemented platforms
- Platforms may optionally implement `HostTargetDelegate.networkRequest` (as of this diff, none do). If they don't we report a CDP "not implemented" error, similar to the status quo where it was unimplemented by the C++ agent.
Changelog:
[General][Added] Debugging: implement common C++ layer of CDP `Network.loadNetworkResource`
Reviewed By: motiz88
Differential Revision: D54309633
fbshipit-source-id: 51e416e9d537b253f72693952d5fd520b6ae11b6