Commit Graph

38536 Commits

Author SHA1 Message Date
Nicola Corti 2098806c22 Unbreak RNTester instacrashing on main (#45467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45467

This unbreaks RNTester instacrashing on main.

Changelog:
[Internal] [Changed] - Unbreak RNTester instacrashing on main

Reviewed By: javache

Differential Revision: D59806826

fbshipit-source-id: 6d5246cd02e2c364068d047b973b2954b459df1e
2024-07-16 07:42:43 -07:00
Riccardo Cipolleschi 050006a7a7 Add example for Pressability with Native Driver in RNTester (#45413)
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
2024-07-16 07:20:51 -07:00
Riccardo Cipolleschi 7fd6c2c45e Fix CCI cache issues (#45460)
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
2024-07-16 06:26:07 -07:00
Pieter De Baets 5bb57eb2b3 Ignore PackagerStatusCallback on invalidated ReactInstanceManager (#45458)
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
2024-07-16 05:19:33 -07:00
shubhamguptadream11 b243d343fa fix: background color fix when border is dotted and dashed (#45430)
Summary:
This PR fixes these issues: https://github.com/facebook/react-native/issues/42289, https://github.com/facebook/react-native/issues/45368

## Changelog:

[IOS] [FIXED] - Message

In iOS for old/new architecture when we are trying to pass borderStyle other than 'solid' then in this
**Old Arch file**
https://github.com/facebook/react-native/blob/2eb7bcb8d9c0f239a13897e3a5d4397d81d3f627/packages/react-native/React/Views/RCTView.m#L807
**New Arch file**
https://github.com/facebook/react-native/blob/2eb7bcb8d9c0f239a13897e3a5d4397d81d3f627/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L652
 file useCoreAnimationBorderRendering is coming as nil since borderStyle passed is not **solid**. Due to which else case block executes and there we are applying backgroundColor as nil.

I just removed that hardcoded check for sold style and make sured that it is now working now with all three borderStyle 'dotted' | 'solid' | 'dashed' for Text and View both

<!-- 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/45430

Test Plan:
Tested with possible borderStyle values.

Providing the fixed screenshot here.

![simulator_screenshot_5E7DDDE7-71F2-4A35-93B3-BFD9F980EA18](https://github.com/user-attachments/assets/3949085e-946f-4669-aaf5-fe366f7e6fc4)

Reviewed By: cortinico

Differential Revision: D59755124

Pulled By: cipolleschi

fbshipit-source-id: 091bb9ba731ac93973230970b526396fd6ea2989
2024-07-16 04:39:21 -07:00
Pieter De Baets e02ca334b1 Skip getProperty calls for unreferenced props in RawPropsParser (#45456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45456

Small perf improvement when using enableCppPropsIteratorSetter

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D59699469

fbshipit-source-id: d65a5e26faf218d0b79c9ac691007310b6db4182
2024-07-16 04:38:45 -07:00
Blake Friedman b443e37a02 disable gradle home cleanup (#45459)
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
2024-07-16 04:20:37 -07:00
Riccardo Cipolleschi 3d5daa12d4 Factor out build-android (#45455)
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
2024-07-16 03:34:34 -07:00
Samuel Susla 334b5c9fdb Execute insert mount instructions after layout update and state update (#45448)
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
2024-07-16 02:13:12 -07:00
Samuel Susla 4d88b20847 create hook to setup animations in passive effects (#45410)
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
2024-07-16 02:13:12 -07:00
Ruslan Shestopalyuk e443c1f0cf Make sure that ScrollView.scrollIndicatorInsets prop finds its way from JS into C++/Fabric (#45444)
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
2024-07-16 01:33:43 -07:00
Joe Vilches 944d40f204 Add mix-blend-mode effects to iOS (#45304)
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
2024-07-15 18:10:17 -07:00
Joe Vilches a96272e27e Add drop-shadow test (#45306)
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
2024-07-15 16:09:43 -07:00
generatedunixname89002005232357 85dd14c912 Revert D59170923 (#45447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45447

This diff reverts D59170923
Breaking OSS build

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59759991

fbshipit-source-id: 39aa0b447a90801d1da5a39461b33b4c4cc4197b
2024-07-15 13:44:09 -07:00
Nick Gerleman 2d67b723d3 Gate off "mixBlendMode" and "filter" on Paper (#45443)
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
2024-07-15 13:05:40 -07:00
Peter Abbondanzo 018d0621c1 Declare public resources from images that are loaded by name (#45421)
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
2024-07-15 12:39:06 -07:00
Nicola Corti 52237838dc Deprecate DeveloperSettings.isStartSamplingProfilerOnInit (#45442)
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
2024-07-15 12:16:33 -07:00
rozele (Meta Employee) 8f27188037 Updates ViewConfig types to delegate isInAParentText context (#29872)
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
2024-07-15 10:58:38 -07:00
zhongwuzw 9e2f8859c4 Reland: [iOS] Fixes ellipsis carries background from trimmed text (#45412)
Summary:
Reland https://github.com/facebook/react-native/issues/39408 . Try to fix the crash https://github.com/facebook/react-native/issues/37926#issuecomment-2225113557. cc. javache I changed the range from glyph to character because all attributes related APIs are character range.

## Changelog:

[IOS] [FIXED] - Fixes ellipsis carries background from trimmed text

Pull Request resolved: https://github.com/facebook/react-native/pull/45412

Test Plan: https://github.com/facebook/react-native/issues/37926 .

Reviewed By: cipolleschi

Differential Revision: D59681679

Pulled By: javache

fbshipit-source-id: de4cb73e0304b8c0b0a40f4f6838b2c679747009
2024-07-15 10:53:35 -07:00
Blake Friedman 24997dc5ae allow use without @react-native-community/cli-server-api (#45311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45311

Allows Gradle and Xcode builds to continue without the rnc dependency.

Reviewed By: cipolleschi

Differential Revision: D59377223

fbshipit-source-id: b0daddae7377b8a0d2ee2a25b2ff10124e5db549
2024-07-15 09:28:58 -07:00
Zeya Peng 97882a16b8 Create Color<->rgba utils on all platforms (#45365)
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
2024-07-15 09:23:21 -07:00
Samuel Susla ccc234986d delete remainings of DELETE_TREE instruction (#45436)
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
2024-07-15 08:56:46 -07:00
Peter Abbondanzo aad9240fd4 Support loading vector drawables in ImageView (#45354)
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
2024-07-15 08:54:48 -07:00
Nicola Corti cbcdb38433 Remove extra dot from close-pr.yml (#45441)
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
2024-07-15 08:36:26 -07:00
Pieter De Baets cb00ca954d Remove HasJavascriptExceptionMetadata interface (#45440)
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
2024-07-15 08:23:44 -07:00
Blake Friedman b7e70968fa fix config generation without community cli (#45224)
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
2024-07-15 08:00:36 -07:00
Peter Abbondanzo 1ca63e3e3d Check nullability of native view config before validation (#45420)
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
2024-07-15 07:00:35 -07:00
Rubén Norte 7ff1e447fd Fix broken CI due to missing dependencies (#45437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45437

https://github.com/facebook/react-native/pull/45409 broke CI because it didn't set up dependencies correctly. This should fix it.

Changelog: [internal]

Reviewed By: cipolleschi, blakef

Differential Revision: D59751194

fbshipit-source-id: 03dafb2d065b2b60142c5828f00703adae0b0052
2024-07-15 06:50:39 -07:00
Blake Friedman f57740c0fb Remove sampling profiler from dev menu (#45431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45431

This build samples using the legacy format, that have to be manually downloaded and translated by the [removed](https://github.com/react-native-community/cli/commit/aca901dba88cf58a20eef6bcc4fec932e942a99a) `npx react-native-community/cli profile-hermes` command.

Changelog: [Internal][Removed] Profiler option in Catalyst's (Bridge) dev menu

Reviewed By: cortinico

Differential Revision: D59686976

fbshipit-source-id: 90a787a98c91fb398abb10ede0cb27871ca315f9
2024-07-15 06:28:47 -07:00
Riccardo Cipolleschi d2773f0c19 Factor out build-hermesc-windows in separate action (#45432)
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
2024-07-15 05:50:21 -07:00
Blake Friedman 4e14c5eeab publish template on publishing release (#45327)
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
2024-07-15 05:35:33 -07:00
Rob Hogan 3c7e307718 jsinspector: Fix various build warnings (#45423)
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
2024-07-15 04:36:25 -07:00
Blake Friedman 9aaadd9b2e remove rnc/cli-tools version & errors deps (#45380)
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
2024-07-15 04:35:26 -07:00
Blake Friedman 6547b157b5 Remove dependency on rnc/cli-tools logger (#45381)
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
2024-07-15 04:35:26 -07:00
Rubén Norte c7fab53e50 Replace BridgelessJSCallInvoker with RuntimeSchedulerCallInvoker everywhere (#45409)
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
2024-07-15 04:25:15 -07:00
Dmitry Rykun 2eb7bcb8d9 Prepare to using setNativeProps for Fabric native animations (#45387)
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
2024-07-13 14:34:39 -07:00
Joe Vilches 65a3259f03 Inset box shadow impl (#45337)
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
2024-07-12 17:17:00 -07:00
David Vacca 0b20ea9b25 Fix comment in LayoutableShadowNode (#45419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45419

EZ fix comment in LayoutableShadowNode

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D59691737

fbshipit-source-id: 452c166dd478ac6796ae55434fb557355f10fae1
2024-07-12 15:52:19 -07:00
Rubén Norte 0ca3ed87f3 Fix incorrect application of idle priority in RuntimeScheduler (#45408)
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
2024-07-12 15:51:51 -07:00
David Vacca 9d8e52b835 Serialize TransformOrigin to folly::dynamic (#45396)
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
2024-07-12 15:19:25 -07:00
David Vacca 9df4239ff9 Introduce enablePropsUpdateReconciliationAndroid feature flag (#45397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45397

This diff introduces the new feature flag named: "enablePropsUpdateReconciliationAndroid"

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59606118

fbshipit-source-id: 1c569a82e08873bdb0443f390757b526fd17e662
2024-07-12 15:19:25 -07:00
Rob Hogan 3603a22652 Include base64 in folly dependency, unbreak CI (#45417)
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
2024-07-12 11:13:44 -07:00
kunal.chavhan 18d6028ff9 fix: select text on auto focus for TextInput (#45004)
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 |
|--------|--------|
| ![before](https://github.com/facebook/react-native/assets/61144478/02da975a-2c80-41b9-86c1-196d0324f437) | ![after](https://github.com/facebook/react-native/assets/61144478/fbe78758-04ab-460f-8ecb-b267ed07751a) |

Reviewed By: javache

Differential Revision: D59448600

Pulled By: cortinico

fbshipit-source-id: 8a594d3193f227ba2d64b808d905bab8b3d24e9b
2024-07-12 10:49:54 -07:00
Nicola Corti 44f8b08b8d Back out "Kotlinify NativeModule" (#45411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45411

Original commit changeset: 6e096552750e

Original Phabricator Diff: D55792976

Changelog:
[Android] [Fixed] - Reverted "[react-native] Kotlinify NativeModule"

Reviewed By: fabriziocucci

Differential Revision: D59680321

fbshipit-source-id: f118f436dc4086676d3ed98fa8d8b28033d9cd47
2024-07-12 09:14:31 -07:00
Nicola Corti cff0d97017 AGP to 8.5.1 (#45406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45406

Just keep our Android Gradle Plugin version up to date.

Changelog:
[Internal] [Changed] - AGP to 8.5.1

Reviewed By: cipolleschi

Differential Revision: D59677574

fbshipit-source-id: 5c80391f8c357f26a9452ac5ac059ee8f5aa569c
2024-07-12 09:00:39 -07:00
Nicola Corti b82d7e100c Gradle to 8.9 (#45407)
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
2024-07-12 09:00:39 -07:00
Peter Abbondanzo 80a3ed7d0c Fix Android AlertFragment Title Accessibility (#45395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45395

## Changelog:

[Android] [Fixed] - Fix AlertDialog title accessibility
Pull Request resolved: https://github.com/facebook/react-native/pull/45048

Making title accessible for android AlertFragment

Reviewed By: blavalla, susnchen

Differential Revision: D58684576

fbshipit-source-id: 83c8cfe9e7aacdf587d325d957694c3c7daa360c
2024-07-12 07:50:05 -07:00
Peter Abbondanzo bac5f1ff3a Add feature flag to enable vector drawable support (#45394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45394

Changelog: [Internal]

The current `Image` implementation does not support loading [vector drawables](https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources) on Android, and support has been requested many times ([issue](https://github.com/facebook/react-native/issues/16651), [issue](https://github.com/facebook/react-native/issues/27502)). I am proposing to put support behind this feature flag in order to validate against performance regressions. Adding support will require reading files from disk to determine if the resource is actually an XML file.

Reviewed By: cortinico

Differential Revision: D59647903

fbshipit-source-id: 2445d71b6769266abe4c2dda521cc2be89bf4064
2024-07-12 07:34:01 -07:00
Blake Friedman ab485c6a94 Fix testID propogation in Fabric (#45379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45379

Fixes an accessibility issue where these values weren't being propogated for RCTTextInputComponentView

See facebook/react-native#38709

Changelog:
[iOS] [Fixed] - testID wasn't propogating to accessibilityIdentifier

Reviewed By: cipolleschi

Differential Revision: D59594049

fbshipit-source-id: 89ec15f92b423b6e18b1a5eb9d32fc4013c039ba
2024-07-12 06:17:42 -07:00
Rob Hogan 193cdc36f7 Implement Network.loadNetworkResource etc in C++ (#44845)
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
2024-07-12 05:21:02 -07:00