Commit Graph

12270 Commits

Author SHA1 Message Date
Eli White ff698f542e Make RN ColorScheme a Union (#46872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46872

This can now be flow typed as a union because the codegen supports it.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D63681874

fbshipit-source-id: 97783df5ae71292dd10602dee0bea39743e62234
2024-10-10 14:20:49 -07:00
Joe Vilches b0e2cb3371 Back out "fix(iOS): Replace uses of CGColorRef with UIColor to avoid manual memory management" (#46967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46967

Original commit changeset: 5e85e17567e3

Original Phabricator Diff: D63989547

This is causing some crashes internally

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D64194385

fbshipit-source-id: 835469e09971ae39d2db6e82f6c05970b1e6238c
2024-10-10 13:41:13 -07:00
Nicola Corti f25abe51ce Remove Deprecated DefaultDevSupportManagerFactory.create() (#46959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46959

This method was deprecated in: b8893c7003
since React Native 0.72.

I verified that no-one is using it in OSS so I'm removing it.

This is necessary as I'll need to refactor the BridgelessDevSupportManager a bit.

Changelog:
[Android] [Breaking] - Remove Deprecated DefaultDevSupportManagerFactory.create()

Reviewed By: javache

Differential Revision: D64184635

fbshipit-source-id: a4081b2189d2e22cd9b2067f982a6ffd4f8b054e
2024-10-10 11:32:37 -07:00
Pieter De Baets e4bdde6562 Remove default false/null props from Text (#46956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46956

isHighlighted/isPressable/selection color are the same as the native default, there's no need to send these in our props payload needlessly.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64179256

fbshipit-source-id: 22e62c8d440d3bd219a79f445e49739c24fa5d52
2024-10-10 11:30:11 -07:00
Peter Abbondanzo 09682b5109 Fix dark mode text (#46898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46898

Replaces *many* `Text` component usages with `RNTesterText`: a thin wrapper around `Text` that applies color based on the color scheme chosen by the user. It makes text legible for dark mode across 41 different example files. This changes intentionally do not touch a few larger component sites that expand beyond RNTester, like `Animated` and `NewAppScreen`

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64053464

fbshipit-source-id: 9516fef2afe1b364eb38e85e3a2dbb5c434e44db
2024-10-10 11:02:18 -07:00
Nikita Lutsenko f7b28e86aa rn/objc | Suppress warnings about set but unused variables. (#46945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46945

Fixing a warning, so we can enable it globally.

Changelog:
[iOS][Fixed] - Silenced 'set but unused variable' warning.

Reviewed By: cipolleschi

Differential Revision: D64161528

fbshipit-source-id: 39f80d46a04422dd167334a4492fd2119503ca23
2024-10-10 11:00:34 -07:00
Fabrizio Cucci f98006830c Replace React.AbstractComponent with component type in ProgressBarAndroid.android.js (#46928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46928

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64113211

fbshipit-source-id: f850739f9116cf0cc8705e541a97333aa04c3a44
2024-10-10 10:59:58 -07:00
Fabrizio Cucci c00f0d36b1 Replace React.AbstractComponent with component type in ScrollView (#46927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46927

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64112934

fbshipit-source-id: d869ccd814cd3bbda2a548c7c2d405f651605716
2024-10-10 10:59:58 -07:00
Fabrizio Cucci c8fd793cff Replace React.AbstractComponent with component type in ScrollViewStickyHeader (#46926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46926

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64111478

fbshipit-source-id: 674316b9545dd12420e50f77cff6ac1c94783d4e
2024-10-10 10:59:58 -07:00
Fabrizio Cucci 5d07c7232c Replace React.AbstractComponent with component type in TextInput (#46925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46925

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64109824

fbshipit-source-id: 9823a459c9bd4f3eed4d3c560f0bdaf4be16d410
2024-10-10 10:59:58 -07:00
Ruslan Shestopalyuk e39c91703d Add an event start timestamp field into RawEvent (#46949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46949

# Changelog:

[Internal] -

This adds an (optional) event start time field into RawEvent, so that it can be threaded by the platform-specific code to tell where is the earliest point of the event start (depending on the platform).

For example, on Android platform it can be the point of time when the original MotionEvent was received.

Reviewed By: rubennorte

Differential Revision: D64175467

fbshipit-source-id: 535c95c695713dbbed74c554bceb70fa5e511d6a
2024-10-10 09:12:15 -07:00
David Rickard 26d8d490e4 Fix null ref on iOS 18 (#46929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46929

Got this error on Marketplace Home when I tried on the iOS 18 simulator:

```
Cannot read property 'stack' of null

if (rejection.stack && ...
```

This indicated `rejection` was null.

Fixed by adding an extra null check there.

Changelog:
[iOS][Fixed] Fixed crash on promise rejection handler in iOS 18.

Differential Revision: D64116020

fbshipit-source-id: 4198748b47d27c6def9957ff475ee780962d3baa
2024-10-10 09:11:53 -07:00
sarthak-d11 af4907025e fix: change opacity logic from random to decrement by -0.20 (#46830)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

ME2E0003

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ Internal ] [ Changed ] - The opacity logic is changed from random to decrement the opacity by -0.2
For more details, see:

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

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D64173519

Pulled By: cipolleschi

fbshipit-source-id: 69a09b64e7e4f098d3bfd72529401dadb49b93d7
2024-10-10 08:59:25 -07:00
Fabrizio Cucci 1e8bee94cb Replace React.AbstractComponent with component type in TouchableBounce (#46924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46924

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64108765

fbshipit-source-id: bc10f958948c24b16964e63790a9cb40bce095e9
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 90523b62a5 Replace React.AbstractComponent with component type in TouchableHighlight (#46923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46923

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107889

fbshipit-source-id: 824e318da8e833f82d2bd869a8c6485ec9dd541e
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 8d230fa78a Replace React.AbstractComponent with component type in TouchableOpacity (#46922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46922

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107774

fbshipit-source-id: f7b9afa8b0a08cedc07c055054bd2cda9a2b5b84
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 15f5ba4f9e Replace React.AbstractComponent with component type in DebuggingOverlay (#46921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46921

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107726

fbshipit-source-id: abd75fbb79db0b8f75b55c7c57e8b021b800256f
2024-10-10 08:36:53 -07:00
Thomas Nardone 6c35ff92dc View clipping tweaks (#46933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46933

Some small tweaks to either resolve or better log clipping-related crashes in ReactViewGroup
Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63914809

fbshipit-source-id: cf8bfd260c6affb85b8e1ac13447ae9f01d19135
2024-10-10 08:32:15 -07:00
Qichen Zhu ca0abd1b9e Set TextInput selection correctly when attached to window in Android (#46948)
Summary:
On Android, when `ReactEditText` is attached to window, `setTextIsSelectable` moves the caret to the beginning, so we need to restore the selection.

This is similar to what we did in https://github.com/facebook/react-native/pull/17851.

Fixes https://github.com/facebook/react-native/issues/46943

## Changelog:

[ANDROID] [FIXED] - Fix TextInput caret moving to the beginning when attached to window

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

Test Plan:
Code to reproduce in RNTester:

```TSX
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import {TextInput} from 'react-native';
import {useEffect, useRef} from 'react';

function Playground() {
  const input = useRef(null);
  useEffect(() => { setTimeout(() => input.current?.focus(), 1000); }, []);
  return <TextInput ref={input} value='1.00' selection={{start: 4, end: 4}} />;
}

export default ({
  title: 'Playground',
  name: 'playground',
  render: (): React.Node => <Playground />,
}: RNTesterModuleExample);
```

Before | After
-- | --
![Screenshot_1728553990](https://github.com/user-attachments/assets/382cf3ec-7437-4b0d-8c15-c8923d677afd) | ![Screenshot_1728553884](https://github.com/user-attachments/assets/9883e966-e9b8-4f8a-bedb-6ee43880d482)

Reviewed By: cortinico

Differential Revision: D64175774

Pulled By: rshest

fbshipit-source-id: ef9fdbecca582c8075bcdfd2d9b810b04d87e3d9
2024-10-10 08:29:56 -07:00
Sam Zhou 2bc25be88c Replace last React.Ref type usage in react-native (#46931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46931

Prepare for deletion of this deprecated type that contain support for string ref in the next flow release.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64127228

fbshipit-source-id: 9d3a1c0e6303efb35a540349fdc8e42b7b70be8b
2024-10-10 08:19:34 -07:00
Ruslan Lesiutin 4eceb7e568 Implement Runtime.releaseObject and releaseObjectGroup (#46032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46032

Changelog: [Internal]

Implements the [`Runtime.releaseObject`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObject) and [`Runtime.releaseObjectGroup`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObjectGroup) CDP methods. These are used by CDT in a few places to release inspected objects (e.g. as part of the [popover](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/7b143e5d05a102c8c9cc7e282bab7b0751f75d61/front_end/panels/sources/DebuggerPlugin.ts#L766) feature), which is important to prevent memory leaks in long-running Fusebox sessions.

Reviewed By: dannysu, robhogan

Differential Revision: D61280394

fbshipit-source-id: 82181c6d0d6e52cf606ef2f48d389631e44b295e
2024-10-10 07:49:46 -07:00
Oskar Kwaśniewski 7e1674fc59 feat: deprecate passing separate new arch flags to RCTRootViewFactory (#46652)
Summary:
This PR follows up with the deprecation introduced here: https://github.com/facebook/react-native/pull/46228

The idea is to have new architecture depend on one flag, namely `newArchEnabled`. It exposes additional initializers for RCTRootViewFactory.

## Changelog:

[IOS] [CHANGED] - Use `newArchEnabled` flag in RCTAppDelegate and RCTRootViewFactory

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

Test Plan: CI Green

Reviewed By: javache

Differential Revision: D64173015

Pulled By: cipolleschi

fbshipit-source-id: 49474baf5415a2527e481a5d68ec94ae874185e6
2024-10-10 07:39:16 -07:00
Fabrizio Cucci 865f302e0c Replace React.AbstractComponent with component type in ImageTypes (#46920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46920

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107532

fbshipit-source-id: 9fb09e0b5735f9f7b91b46867e35043fe9d679f0
2024-10-10 07:01:29 -07:00
Fabrizio Cucci 5f058018dc Replace React.AbstractComponent with component type in various examples (#46919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46919

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64105531

fbshipit-source-id: 5729862a95f544a3c1e1a88484d145ba92e192a6
2024-10-10 07:01:29 -07:00
Fabrizio Cucci 6e2b9daf7d Replace React.AbstractComponent with component type in VScrollViewNativeComponent (#46917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46917

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64108764

fbshipit-source-id: 44cf9316a03bb18b658aeb45b7d951ad346ae3f0
2024-10-10 07:01:29 -07:00
Fabrizio Cucci f86a14e4ad Replace React.AbstractComponent with component type in View (#46916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46916

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64104990

fbshipit-source-id: c747f4e89b5631a6c1543aca86cbea4db4987f5a
2024-10-10 07:01:29 -07:00
Dawid ab8f3ff3e9 fix: vertical scroll views are detected as horizontals (#46836)
Summary:
There is a numerical issue that causes vertical scroll view to be considered as the horizontal one and leads to problems described [here](https://github.com/facebook/react-native/issues/46592). The problem is no longer visible after checking if the scroll view is horizontal with float equality.

~~I am not sure if it also happens on Android, so I am leaving it as a draft for now.~~

Fixes https://github.com/facebook/react-native/issues/46592

## Changelog:

[IOS] [FIXED] - check if scroll view is horizontal with float equality.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - fixed scroll view

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: Tested on the repro provided in the above issue.

Reviewed By: rshest

Differential Revision: D64114476

Pulled By: cortinico

fbshipit-source-id: a5048e1403c4bb675d32928937d6411cfb12fd51
2024-10-10 06:37:28 -07:00
Fabrizio Cucci 46a9711454 Replace React.AbstractComponent with component type in SafeAreaView (#46913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46913

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64104922

fbshipit-source-id: 3210b6b7368872f13f9006bb1b19de9f92aa4bc8
2024-10-10 05:21:53 -07:00
Edmond Chui 91a40a28de Fusebox reload-to-profile (Part 1 of 2: native) (#46856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46856

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/117
React: https://github.com/facebook/react/pull/31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256

fbshipit-source-id: f2f2814491e785b03af143cc26639ef178881fff
2024-10-10 05:20:18 -07:00
zhongwuzw 77889afa1c Fixes missing char mode of linebreakmode (#46941)
Summary:
cipolleschi , Fixes missing char mode of linebreakmode.

## Changelog:

[IOS] [FIXED] - Fixes missing char mode of linebreakmode

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

Test Plan: char mode works.

Reviewed By: cipolleschi

Differential Revision: D64166107

Pulled By: javache

fbshipit-source-id: 1b1a5c603652e1d3bc9f7a32039fab4de7f59627
2024-10-10 04:24:49 -07:00
Joe Vilches 0d6908f4ed Sunset the value namespace (#46930)
Summary:
X-link: https://github.com/facebook/yoga/pull/1720

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

This is not really needed anymore, we can just use `StyleLength` statics instead

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63922280

fbshipit-source-id: cd953bae8e9f68574463eafc49c33c2e85ac1856
2024-10-09 19:20:15 -07:00
Saad Najmi b70709dbc2 fix(iOS): Replace uses of CGColorRef with UIColor to avoid manual memory management (#46847)
Summary:
Update React Native on iOS to do less manual memory management, by replacing uses of `CGColorRef` with `UIColor`, and only calling `UIColor.CGColor` when needed. This results in much less manual memory management, which is probably a good thing in 2024 :D. The downside is there is a breaking change: the signature of a method in `RCTBorderDrawing` changes.

This is a followup to https://github.com/facebook/react-native/issues/46797 . After that PR merged and I tested merging React Native macOS to the `0.76-stable` branch cut commit again, I saw even more places I needed to manually call `CGColorRetain` / `CGColorRelease`. The reason is due to React Native macOS specifics (explained below) and I could update React Native macOS to not need these changes, but I thought I would at least throw up a PR to propose the changes, as it may be good to move away from using Core Graphics' C base API as much as possible.

## Longer Explanation

With https://github.com/microsoft/react-native-macos/pull/2209 , I wrote a shim of [UIGraphicsImageRenderer](https://developer.apple.com/documentation/uikit/uigraphicsimagerenderer) for macOS. The main difference is my shim calls the NSImage API [imageWithSize:flipped:drawingHandler:](https://developer.apple.com/documentation/appkit/nsimage/1519860-imagewithsize?language=objc) to shim the UIGraphicsImageRenderer API [imageWithData:](https://developer.apple.com/documentation/uikit/uiimage/1624137-imagewithdata). The difference between the two is that the macOS API copies the block, and executes it when Appkit is about to draw the image, while the iOS API executes the block right away. Because of this, I think I am hitting way more places where `CGColorRef` variables needed to be retained / released. Additionally, I hit more of them when I merge to the 0.76 branch cut commit (this is why I didn't catch it with https://github.com/facebook/react-native/issues/46797).

Given this constraint, I have a couple of options:
1. Refactor my macOS shim to use the deprecated API [[NSImage lockFocus]](https://developer.apple.com/documentation/appkit/nsimage/1519891-lockfocus)
    - I am not a fan of this because `lockFocus` was deprecated for `imageWithSize:flipped:drawingHandler:`
2. Refactor my macOS shim to do what we used to do: Create a CGContext manually and write it to an image
    - This is probably OK. Relies on less Appkit specifics, and potentially gives more control to RN on the rendering layer, which I recall lenaic told me is better for Fabric)
3. Refactor React Native to avoid CGColorRef altogether, and use `UIColor` (which ARC will memory manage for us) as much as possible.
    - This is the approach of this PR and my preferred approach. The downside is this changes the signature of some of the methods in `RCTBorderDrawing` which is a breaking change. I've seen other PRs do this, so maybe its OK?

## Changelog:

[IOS] [BREAKING] -  Replace uses of `CGColorRef` with UIColor to avoid manual memory management

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

Test Plan: Launching RNTester's View example (which tests a lot of the border / outline / shadow rendering) does not crash for me on both iOS and macOS.

Reviewed By: NickGerleman

Differential Revision: D63989547

Pulled By: joevilches

fbshipit-source-id: 5e85e17567e3dd8b4b0388452398954ad2e02464
2024-10-09 16:42:17 -07:00
Tatiana Kapos 0794fa909b fix(Windows): Fix cast and control paths errors on windows (#46899)
Summary:
Windows has a stricter set of rules for C++ files where we treat warning as error, the following files have fixes to correctly cast numbers and fix control path errors.

Control Path Error on React-Native-Windows repo:
```
1>react-native-windows\node_modules\react-native\ReactCommon\react\performance\timeline\PerformanceEntryReporter.h(138,1): warning C4715: 'facebook::react::PerformanceEntryReporter::getBufferRef': not all control paths return a value
1>react-native-windows\node_modules\react-native\ReactCommon\react\performance\timeline\PerformanceEntryReporter.h(154,1): warning C4715: 'facebook::react::PerformanceEntryReporter::getBuffer': not all control paths return a value
```

Apply these fixes will allow us to unfork these files in our repo :)

## Changelog:

[GENERAL] [FIXED] - Fix cast and control paths errors on windows

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

Test Plan: Tested on the RNW repo, these files are already forked with the respective fix

Reviewed By: cipolleschi

Differential Revision: D64086963

Pulled By: arushikesarwani94

fbshipit-source-id: fdad72dafa1a01c426536fc1b007dd4a83588d93
2024-10-09 16:12:16 -07:00
Nick Gerleman 7fb3d830be Breaking: Remove BaseViewManagerInterface (#46809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46809

BaseViewManagerInterface isn't adding much value right now. It was added in D16984121 to allow codegen generated ViewManager delegates to apply to view managers which derive from ViewMangager instead of BaseViewManager (if they did some cleverness, to make VM delegate apply to a no-op class, still implementing all of BaseViewManager's methods).

All of the cases where that was used have since been moved to `SimpleViewManager`, and `BaseViewManagerAdapter` (needed to wire this together) doesn't exist anymore, so it's not possible to take any advantage of this interface existing. We should remove it, since its existence  is a source of error (e.g. it was missing setters for `accessibilityValue` or those related to pointer events), and is more generally confusing for anyone adding to `BaseViewManager` in the future.

This is a breaking change, because there are some libraries which vendor a copy of generated ViewManagerDelegate when building against legacy arch to be able to share code normally generated at build time. That means these will need to be updated to maintain compatibility with RN versions of 0.77+ with new arch disabled. This will not effect compatibility of these libraries against the default new arch, and the updated delegate is still compatible with older RN version.

```
    sourceSets.main {
        java {
            if (!isNewArchitectureEnabled()) {
                srcDirs += [
                    "src/paper/java",
                ]
            }
        }
    }
```

1. `react-native-picker/picker`
2. `rnmapbox/maps`
3. `react-native-gesture-handler`
4. `react-native-screens`
5. `react-native-svg`
6. `react-native-safe-area-context`
7. `react-native-pdf`

Changelog:
[Android][Breaking] - Remove BaseViewManagerInterface

Reviewed By: cortinico

Differential Revision: D63819044

fbshipit-source-id: 7e4935c8e43706b168f0f599a6676e8abfa66937
2024-10-09 14:49:01 -07:00
Fabrizio Cucci c5a12df6f7 Replace React.AbstractComponent with component type in Text (#46912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46912

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64103863

fbshipit-source-id: 8a443d02b2ab8836056fa8756180d7e6942f531e
2024-10-09 12:55:12 -07:00
Fabrizio Cucci 37e0973bb3 Replace React.AbstractComponent with component type in Switch (#46911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46911

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64103195

fbshipit-source-id: e0ff745c70df910dcb84ed3a824d67883bbfc44d
2024-10-09 12:55:12 -07:00
Deepanshu.shukla 3102a58df3 test: pressable test cases (#46861)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757

Solves:
ME2E0015
ME2E0016

## Changelog:

[ Internal ] [ Added ] - Add e2e test for pressable

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: arushikesarwani94

Differential Revision: D63986636

Pulled By: cipolleschi

fbshipit-source-id: 4b58da97be3c7a14584f0343b6449b407c9517d2
2024-10-09 07:39:02 -07:00
sarthak-d11 d0e5053528 chore: test case added for Image (#46831)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

ME2E0019
## Changelog:
[ Internal ] [ Added ] - Added a test case for Image
<!-- 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/46831

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: cortinico

Differential Revision: D63889719

Pulled By: cipolleschi

fbshipit-source-id: 674879066ec159f11894f24935fe39a86ea1ea63
2024-10-09 07:17:24 -07:00
Eric Rozell 0449630612 Resolve Paper leak on Android (#46896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46896

On Android Paper UIManager, when calling `ReactRootView.unmountReactApplication`, the ReactRootView tag is unset [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java#L926), before the round trip unmount operation to JS makes it's way back to a `dropView` call on `NativeViewHierarchyManager`.

In practice, this means that legacy architecture apps that unmount surfaces via `ReactRootView.unmountReactApplication` leak references to Views, and the "finalization" step (`onDropViewInstance`) is not universally called.

This is an attempt to fix the issue by skipping the `clearReactRoot` step on Paper, instead waiting for the round trip `UIManager.removeRootView` call.

## Changelog

[Android][Fixed] Fix issue where `onDropViewInstance` cleanup was not being handled after `ReactRootView.unmountReactApplication`

Reviewed By: javache

Differential Revision: D64054042

fbshipit-source-id: b8b8c237796674ca23a332e57a1bf2e07ab5af13
2024-10-09 05:25:10 -07:00
Marc Rousavy 87bae7f734 feat: Add CallInvoker to installJSIBindings(..)/BindingsInstaller (#46851)
Summary:
While the new `installJSIBindings(..)`/`BindingsInstaller` functionality allows you to synchronously set up stuff in the JS runtime before JS runs, there is no access to the JS CallInvoker, meaning you cannot really set up anything that uses callbacks or asynchronous code.

[Nitro](https://github.com/mrousavy/nitro) needs this.

## Changelog:

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

[IOS] [ADDED] - Add `CallInvoker` to `installJSIBindings(..)`
[ANDROID] [ADDED] - Add `CallInvoker` to `BindingsInstaller`

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

Test Plan: In `SampleTurboModuleJSIBindings`, we can now use the `CallInvoker`.

Reviewed By: rshest

Differential Revision: D63975546

Pulled By: javache

fbshipit-source-id: 43cd469de2c35581f5362d2500fc27e41d6eab72
2024-10-09 04:36:04 -07:00
Blake Friedman eeaa3ff458 Let .xcode.env.local NODE_BINARY handle path spaces
Summary:
For users who may have node installed in a path with a space, this requires escaping.  For example:

```
NODE_BINARY=/Users/blakef/Library/Application Support/fnm/node-versions/v20.12.0/installation/bin/node
```

Needs to be:

```
NODE_BINARY=/Users/blakef/Library/Application\ Support/fnm/node-versions/v20.12.0/installation/bin/node
```

# Changelog
[iOS][Fixed] Generated NODE_BINARY in .xcode.env.local now supports paths with a space

Reviewed By: cipolleschi

Differential Revision: D64080118

fbshipit-source-id: 1045473e4fd284fc570fa538984618630be1af6d
2024-10-09 04:14:31 -07:00
Rubén Norte 5f00db970f Use CommonJS in feature flags definitions to simplify loading from Node.js (#46887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46887

Changelog: [internal]

This is a small change to use CommonJS in `ReactNativeFeatureFlags.config.js` so the file can be easily imported from Node.js.

Reviewed By: jorge-cab

Differential Revision: D64039860

fbshipit-source-id: c84ddbdbfe942224e213d12b9496c41b73dd5731
2024-10-09 03:40:20 -07:00
Nicola Corti a268b2bf53 Enable warningAsErrors for RN-Tester (#46817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46817

As I've cleaned up all the RN Tester warnings, I'm enable warningAsErrors for RNTester to make
sure we keep up with our warning count.

Changelog:
[Internal] [Changed] - Enable warningAsErrors for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D63837633

fbshipit-source-id: f83273dadc7aa10ce7ae52ae790279819fb88345
2024-10-09 03:12:27 -07:00
Blake Friedman e4814b0d6d Add description to CLI arguments (#46890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46890

Add details as this is discussed in the Turbo Native Modules documentation going out in 0.76:

```
Usage: combine-js-to-schema-cli.js <outfile> <file1> [<file2> ...]

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
  -p, --platform  Platforms to generate schema for, this works on filenames:
                  <filename>[.<platform>].(js|tsx?)              [default: null]
  -e, --exclude   Regular expression to exclude files from schema generation
                                                                 [default: null]
```

## Changelog:
[General][Added] Add cli --help details to combine-js-toschema-cli.js

Reviewed By: dmytrorykun

Differential Revision: D64045337

fbshipit-source-id: a4b977da2cbb0198a5d43f17ca3466ebde21e9a9
2024-10-08 19:22:29 -07:00
Panos Vekris 380175865b remove '$TEMPORARY$array' (#46897)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46897

Reviewed By: SamChou19815

Differential Revision: D64051902

fbshipit-source-id: 0cbcbb81f86f1383c7237b306cdbc839938c17b7
2024-10-08 16:33:45 -07:00
Peter Abbondanzo 768a1d8664 Add example of different resize methods (#46873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46873

## Summary

Adds a small showcase for the different `resizeMethod` options and how downsampling is applied

## Changelog

[Android][Added] - Added showcase for Android `resizeMethod` options when applied to a large image

Reviewed By: rshest

Differential Revision: D62393212

fbshipit-source-id: 46e7ff6310617acb9eb288e3831c0b5e6b1751c8
2024-10-08 16:18:27 -07:00
Arushi Kesarwani 52f8c57ac6 RN][Android] Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android (#46904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46904

Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android, default false

Changelog: [internal] internal

Reviewed By: fryfrog

Differential Revision: D64073913

fbshipit-source-id: 0d92fd47c4905e74d734113e921511120037bd8d
2024-10-08 16:11:12 -07:00
Arushi Kesarwani 05cc40952c Revert D64062268: Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android
Differential Revision:
D64062268

Original commit changeset: 474e191e6a67

Original Phabricator Diff: D64062268

fbshipit-source-id: 9003d52d60b98999a478d2bf797e2ad58c82054d
2024-10-08 15:14:27 -07:00
David Vacca 4763ef3121 Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android (#46903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46903

Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android, default false

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D64062268

fbshipit-source-id: 474e191e6a677065681b512a93af74908e8250f5
2024-10-08 15:03:11 -07:00
Peter Abbondanzo 6202319ed5 Add resizeMethod type 'none' to disable downsampling on Android (#46866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46866

## Summary
Adds a new `resizeMethod` called `none`. It disables downsampling on the image request and disregards the global image pipeline default. This has been a pain point raised when rendering large images on Android in issues like [this one](https://github.com/facebook/react-native/issues/21301) and [this one](https://github.com/facebook/fresco/issues/2397).

## Changelog
[Android][Added] - Adds a new `resizeMethod`, `none`, which disables downsampling for an image

Reviewed By: yungsters

Differential Revision: D62393211

fbshipit-source-id: d85e3ed098ad502c8edbdfa817c841271ee9e914
2024-10-08 13:29:15 -07:00