Commit Graph

38536 Commits

Author SHA1 Message Date
Moti Zilberman c6bc0b090f Add internal call sites to x_google_ignoreList (#43605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43605

Changelog: [Internal]

Leverages https://developer.chrome.com/docs/devtools/x-google-ignore-list to mark more internal files as "third party", thus collapsing them by default in stack traces in modern versions of Chrome DevTools. The list of modules to collapse is the same one used by LogBox.

This likely only affects Meta usage, since Metro's default for [`isThirdPartyModule`](https://metrobundler.dev/docs/configuration/#isthirdpartymodule) already excludes all `node_modules`, but I'm making this change across Meta and OSS for consistency and to signal intent.

Reviewed By: huntie

Differential Revision: D55236653

fbshipit-source-id: d777ea31fb3d65608a487247924885c887ebbd94
2024-03-25 07:12:18 -07:00
Samuel Susla 95a8c99f3f introduce experimental mechanism to subscribe to synchronous onScroll (#43593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43593

changelog: [internal]

Introduce experimental mechanism to subscribe to synchronous onScroll from outside of ScrollView.

Reviewed By: yungsters

Differential Revision: D55066385

fbshipit-source-id: b7cc173cb32e736f49496c1e0ba37de782ca02aa
2024-03-25 06:32:29 -07:00
chenlong12580 274faf4b39 Delete useless local-cli dir (#43602)
Summary:
local-cli seems to have not been used, so we request to delete it

## Changelog:

[INTERNAL] [REMOVED] - Delete useless local-cli dir

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

Reviewed By: cortinico

Differential Revision: D55281532

Pulled By: blakef

fbshipit-source-id: 8109222dbf643f1b1c3de491b4f42c07d09d8e13
2024-03-25 04:27:54 -07:00
Jeff Bahr 4c8e253d83 Migrate google java format from 1.7 -> 1.21.0 (#42754)
Summary:
X-link: https://github.com/facebookexternal/OculusManufacturing/pull/524

X-link: https://github.com/facebookexternal/fbpay/pull/3

X-link: https://github.com/facebook/screenshot-tests-for-android/pull/324

X-link: https://github.com/pytorch/executorch/pull/1771

X-link: https://github.com/facebook/igl/pull/68

X-link: https://github.com/facebook/mariana-trench/pull/153

X-link: https://github.com/facebook/fresco/pull/2757

X-link: https://github.com/facebook/litho/pull/974

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

X-link: https://github.com/facebook/hhvm/pull/9431

X-link: https://github.com/WhatsApp/eqwalizer/pull/52

X-link: https://github.com/facebookincubator/spectrum/pull/1858

X-link: https://github.com/fbsamples/metapay/pull/1

X-link: https://github.com/facebookincubator/fbjni/pull/95

X-link: https://github.com/facebookincubator/Battery-Metrics/pull/30

X-link: https://github.com/facebook/ktfmt/pull/440

X-link: https://github.com/facebook/flipper/pull/5456

X-link: https://github.com/facebook/hermes/pull/1290

X-link: https://github.com/facebook/TextLayoutBuilder/pull/35

X-link: https://github.com/facebook/SoLoader/pull/122

allow-large-files

This diff migrates google java format form 1.7 to 1.21.0. This update will allow for new language features from java 17 and 21. This diff also formats all necessary files.

 Changelog:
    [Internal][Changed] - Updated format from google-java-format 1.7 -> 1.21.0

Reviewed By: IanChilds

Differential Revision: D52786052

fbshipit-source-id: b675ae215084f340b93dfe628e329e696ca0616e
2024-03-23 16:07:04 -07:00
Sam Zhou 37e3626994 Fix some cyclic types (#43630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43630

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D55271602

fbshipit-source-id: cb93fae6231ade6e5865dd7e0756a12568dece12
2024-03-23 13:42:20 -07:00
Phillip Pan 38be5e35e6 decouple RCTBridge+Private from jsinspector-modern
Summary:
Changelog: [Internal]

fix for part of https://github.com/facebook/react-native/issues/43204

RCTBridge+Private is transitively bringing in boost in 0.74, which is causing build errors for some libs that were originally depending on it. this is because boost is a special pod that needs separate handling to link correctly.

let's simplify this problem by decoupling this header and moving the inspector specific logic into it's own category.

Reviewed By: motiz88, dmytrorykun

Differential Revision: D55228474

fbshipit-source-id: 28dacaf464b98fe1c164418934ab8101b47d7efb
2024-03-22 20:50:52 -07:00
Sam Zhou 9112c5b56d Fix hidden type error in react-native ahead of next flow release (#43629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43629

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D55264363

fbshipit-source-id: f9908e28f0416c9c8ed05e0b097d887eddfee5f3
2024-03-22 19:18:48 -07:00
Soe Lynn a1b318c18b Convert TouchableWithoutFeedback to a functional component (#43596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43596

## Changelog: [Internal]

- Convert TouchableWithoutFeedback to a functional component.

Reviewed By: philIip

Differential Revision: D55115080

fbshipit-source-id: c288af8f60c6c2330e80966a78288c433a0d2be1
2024-03-22 18:44:16 -07:00
Moti Zilberman b13e9f8f75 Add --create-diff mode to debugger-frontend sync script (#43621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43621

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D55244550

fbshipit-source-id: 5d3f408c51369d44e8dda1dc3768cac1125a21a4
2024-03-22 12:11:48 -07:00
Moti Zilberman a45d6eafcc Update debugger-frontend from 0beb10c...a96803a (#43622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43622

Changelog: [Internal] - Update `react-native/debugger-frontend` from 0beb10c...a96803a

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/0beb10c594a2847ec696e3b7f6e26a01a849c799...a96803a5b999d2ddbc62f8b9a12019db00019b17).

Reviewed By: huntie

Differential Revision: D55245226

fbshipit-source-id: 662ed3e25ce68c0ed4a4e3332158fa36209ba24b
2024-03-22 12:08:49 -07:00
Jakub Piasecki ad9f0b0ab8 Include boost headers needed by rrc_text and rrc_textinput (#43608)
Summary:
Updates `PreparePrefabHeadersTask` to copy more headers from `boost`, specifically those required by `rrc_text` and `rrc_textinput`.

## Changelog:

[ANDROID] [CHANGED] - Copy boost headers needed by `rrc_text` and `rrc_textinput`

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

Reviewed By: rshest

Differential Revision: D55241345

Pulled By: cortinico

fbshipit-source-id: e92164676ba78ee15b3678a55c9098b0c6214b69
2024-03-22 07:58:49 -07:00
Samuel Susla e90b97553f add missing dependency of core library to cmake (#43606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43606

changelog: [internal]

D54805494 broke CircleCI because it didn't list all of the required dependencies in CMakeList.txt

Reviewed By: cortinico

Differential Revision: D55240313

fbshipit-source-id: 7a27b1379831582556ddd72007f17cbd2d507b19
2024-03-22 06:42:55 -07:00
Nicola Corti c835f91457 Fix build from source for hermes-engine (#43609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43609

When users are building from source for React Native they don't have an ndkVersion variable specified. So we want to fallback to the global NDK version we set for the whole build here.

Changelog:
[Android] [Fixed] - Fix build from source for hermes-engine

Reviewed By: dmytrorykun

Differential Revision: D55240603

fbshipit-source-id: 3c725a164b40e176548af8ada9fcb13d391ef017
2024-03-22 05:35:46 -07:00
Nicola Corti 84c1c6ea9b Follow-up with Review Feedback on RCTAppDelegate from #43526 (#43607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43607

PR #43526 was accidentally merged with several changes excluded. I'm following up on those here.

Changelog:
[Internal] [Changed] - Follow-up with Review Feedback on RCTAppDelegate from #43526

Reviewed By: dmytrorykun

Differential Revision: D55240435

fbshipit-source-id: c296a1e14b7032b211551334ca7b5a6824e8d45c
2024-03-22 05:09:34 -07:00
zhongwuzw 0a125579f8 Invalidate displaylink when invalidate instance in bridgeless mode (#43603)
Summary:
`RCTDisplayLink` retains itself because of `CADisplayLink`, let's call `invalidate` to break the retain cycle. cc philIip

## Changelog:

[IOS] [FIXED] - [Fabric] Invalidate displaylink when invalidate instance in bridgeless mode

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

Test Plan: After instance invalidate, `RCTDisplayLink` deallocated .

Reviewed By: fabriziocucci

Differential Revision: D55239145

Pulled By: javache

fbshipit-source-id: d9ceb9cd3a2cd91700e917c909d7097dacba240b
2024-03-22 03:44:04 -07:00
Samuel Susla 223e6dc898 introduce EventEmitter::experimental_flushSync (#43592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43592

changelog: [internal]

Exposing experimental API EventEmitter::experimental_flushSync to trigger synchronous event from native. The API will be changed in the future, this is exposed only for experimentation.

Reviewed By: javache

Differential Revision: D54805494

fbshipit-source-id: fb395588cf1dc944a920ec4a2257390552850263
2024-03-22 02:33:16 -07:00
Gabriel Donadel 15a5638c62 Implement multiple view manager lookup for the interop layer on Android (#43595)
Summary:
When running with the new architurece and using the renderer interop layer on Android, view managers don't work if their names start with `RCT`. This happens because the `RCT` prefix is automatically removed from the component name, and inside the internal `mViewManagers` we store view managers with the `RCT` prefix.

Using the `RCT` pattern as a prefix works fine with the old architecture and is actually used on the [Android Native UI Components](https://reactnative.dev/docs/next/native-components-android) tutorial in the docs, making me believe that this same patterns is used across many community libraries.

This diff adds a secondary lookup logic for view managers:

1. We look for the XXXViewManager.
2. If not found, we look for RCTXXXViewManager.

Quite similar to the iOS implementation introduced in  https://github.com/facebook/react-native/pull/38093

 ---

With this change we can also remove most of the entries from FabricNameComponentMapping (I can address this in a follow up PR)

https://github.com/facebook/react-native/blob/4e6eba7a2dedaa855af0bff5df3bec73a95f0fc4/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java#L22-L45

## Changelog:

[ANDROID] [ADDED] - Implement multiple view manager lookup for the interop layer

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

Test Plan:
Tested installing a library such as [react-native-fbsdk-next](https://github.com/thebergamo/react-native-fbsdk-next) that names its view managers starting with `RCT`

<table>
<tr>
  <th>Before</th>
  <th>After</th>
</tr>
<tr>
<td>
<img width="519" alt="image" src="https://github.com/facebook/react-native/assets/11707729/123de1d6-f018-424b-b6ce-38221af9d83e">
</td>
<td><img width="519" alt="image" src="https://github.com/facebook/react-native/assets/11707729/0f35b369-e2e4-4bbf-b880-6471fbc05d38">
</td>
</tr>
</table>

Reviewed By: cortinico

Differential Revision: D55208396

Pulled By: arushikesarwani94

fbshipit-source-id: a1fb1f4cee8483cf91ebededd1d7c4ba7021f9d9
2024-03-21 18:22:21 -07:00
Nicola Corti 24a3dade29 Fix InteropUIBlockListener to support react-native-view-shot on Bridgeless (#43594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43594

I've been migrating `react-native-view-shot` to Fabric by using the `InteropUiBlockListener`
and I've realized that the interop layer doesn't work well.

1. FabricUIManager needs to implement `UIBlockViewResolver` in order for the interop layer to work correctly.
2. We need to hook `addUIBlock` to the `didDispatchMountItems` callback otherwise the UIBlocks won't be executed at all.

Changelog:
[Android] [Fixed] - Fix InteropUIBlockListener to support react-native-view-shot on Bridgeless

Reviewed By: javache

Differential Revision: D55187939

fbshipit-source-id: d048b4b5eed77fa856fdfac17c0df5f23fd44844
2024-03-21 16:18:28 -07:00
Oskar Kwaśniewski 9d79f05e68 fix(iOS): add missing forward blocks to RCTRootViewFactory (#43526)
Summary:
This PR adds missing forwarding blocks to RCTRootViewFactory, currently when a user tries to override `sourceURLForBridge` in AppDelegate it isn't overridden.

## Changelog:

[IOS] [FIXED] - add missing forward blocks to RCTRootViewFactory

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

Test Plan: Override: `extraModulesForBridge`, `extraLazyModuleClassesForBridge`, `bridge didNotFindModule`,  `sourceURLForBridge:` methods in AppDelegate and check if they are called on old architecture

Reviewed By: philIip

Differential Revision: D55186872

Pulled By: cortinico

fbshipit-source-id: 5988c7bab1439ccc4885b7337336c1e120ba9ea6
2024-03-21 15:29:25 -07:00
Nick Gerleman 1021448d7c Warn users during "pod install" if XCode is too old (#43583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43583

Fail during `pod install` if user's version of XCode is too old to avoid cryptic errors (e.g. https://github.com/reactwg/react-native-releases/issues/163).

I reused existing mechanism for version detection, though it may not be reliable for future versions of XCode.

Changelog:
[iOS][Changed] - Warn users during "pod install" if XCode is too old

Reviewed By: dmytrorykun

Differential Revision: D55149636

fbshipit-source-id: 78387ff19a6eb10f3ca0d4aa78e6b934ae3b0711
2024-03-21 13:55:11 -07:00
Nick Gerleman 7d180d7127 Fix Android HorizontalScrollView fling when content length less than ScrollView length (#43563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43563

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

## Sumary

D9405703 added some custom logic for Flings, to support FlatList scenarios where content is being added on the fly, during Fling animation. This works by allowing start Fling to not have bounds, then correcting/cancelling Fling when overscroll happens over a bound that would normally be allowed.

This has some math to try to determine max content length, and will clamp to this when scrolling over it. This logic is incorrect when content length is less than scrollview length, and we end up snapping to a negative offset.

This change adds clamping, so that we don't snap to negative position in horizontal scroll view. This clamping was already indirectly present on vertical scroll view. https://www.internalfb.com/code/fbsource/[b43cdf9b2fec71f5341ec8ff2d47e28a066f052e]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java?lines=609

## Test Plan

Above issue no longer reproes. Flinging while content is being added to horizontal FlatList still works correctly.

Changelog:
[Android][Fixed] - Fix Android HorizontalScrollView fling when content length less than ScrollView length

Reviewed By: javache

Differential Revision: D55108818

fbshipit-source-id: 7cf0065f9f92832cc2606d1c7534fc150407b9c9
2024-03-21 12:55:51 -07:00
Jakub Piasecki 623bbe6bd6 Fix prefab header paths for rrc_text and rrc_textinput (#43591)
Summary:
- `rrc_textinput` at the moment points to a wrong subdirectory and needlessly adds a prefix path
- `rrc_text` is missing headers for `attributedstring` which it depends on

## Changelog:

[ANDROID] [FIXED] - Fixed prefab header paths for `rrc_text` and `rrc_textinput`

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

Reviewed By: fkgozali

Differential Revision: D55199580

Pulled By: cortinico

fbshipit-source-id: 85126c00943f82e908a52e05587661597761852e
2024-03-21 11:37:13 -07:00
Moti Zilberman 511f29b8a7 Detect non-Fusebox frontends and log a message (#43574)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43574

Changelog: [Internal]

Once we start rolling out the Fusebox backend, users might still try to use the debugger frontends they're used to, for which we can't guarantee reliability. Let's detect this and log a message letting them know about the supported Fusebox launch flows.

Reviewed By: huntie

Differential Revision: D55122115

fbshipit-source-id: a17c0c6b9140059f489e0852fe673306fb6ef8f5
2024-03-21 10:39:33 -07:00
Moti Zilberman bdd1fb5e05 Add helpers to allow HostAgent/InstanceAgent to send simple console messages (#43575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43575

Changelog: [Internal]

Adds the `HostAgent::sendConsoleMessage` and `InstanceAgent::sendConsoleMessage` helper methods, allowing the agent implementations to send simple, text-only console messages (using `Runtime.consoleAPICalled`) from the inspector thread, without involving the Runtime (and the JS thread).

We also update the tests to ignore such messages by default, since otherwise we would encounter a lot of unexpected mock calls.

## Context

We currently use `Log.entryAdded` messages for logs generated by the CDP backend itself. This cleanly separates backend-generated messages from app-generated `Runtime.consoleAPICalled` messages (including in tests), and avoids the need to provide an `executionContextId` for protocol compliance.

However, it turns out that frontends don't consistently support the `Log` domain - in particular, `chrome://inspect` doesn't show `Log` messages for targets of type `node` (which is how RN lists itself in the `/json` endpoint). For the majority of our `Log.entryAdded` use cases, this doesn't matter. But it does mean that if we want a log message to be visible regardless of the frontend, we need to send `Runtime.consoleAPICalled` messages instead.

The one concrete use case for this at the moment is detecting non-Fusebox clients and logging an explanatory message to point users to Fusebox. We can likely refactor most *existing* uses of `Log.entryAdded` in our code to use `sendConsoleMessage`, but I've opted not to do that here. Those are primarily useful within our team and can be deleted once Fusebox is out of testing.

Reviewed By: huntie

Differential Revision: D55130368

fbshipit-source-id: 4bc6a91efe63db6753250a3d383fd497c9f5f7b5
2024-03-21 10:39:33 -07:00
Arushi Kesarwani 62ebe557b8 Expose ReactDelegate for react-native-restart (#43588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43588

Supported `reload()` in Bridgeless through ReactDelegate in https://github.com/facebook/react-native/pull/43521 in order to unblock react-native-restart

https://github.com/avishayil/react-native-restart/blob/134cabd5b3f355ffe551e5dd1be1dd46d870fe13/android/src/main/java/com/reactnativerestart/RestartModule.java#L54

which can access React Delegate through :
```
if(currentActivity instanceof ReactActivity) {
    ReactActivity reactActivity = (ReactActivity) currentActivity;
    ReactDelegate reactDelegate = reactActivity.getReactDelegate();
    reactDelegate.reload()
}
```

Changelog:
[Android][Added] Expose ReactDelegate in ReactActivity

Reviewed By: cortinico

Differential Revision: D55166962

fbshipit-source-id: 5d8dfd7ad61edbcb5233014800eb66a538842ca5
2024-03-21 09:40:32 -07:00
Samuel Susla c574ca59dc refactor metrics for ScrollViewEventEmitter (#43532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43532

changelog: [internal]

- use designated initializers.
- make ScrollViewMetrics a struct.
- move ScrollViewMetrics inside of ScrollViewEventEmitter.

This is to be more consistent with other event emitters.

Reviewed By: rubennorte

Differential Revision: D54896331

fbshipit-source-id: 01aecd1835b23bdaccff1355d33eb7b4c5ba8d92
2024-03-21 08:11:49 -07:00
Moti Zilberman 1c52d385de Create a universal way to force-enable Fusebox at Buck build time (#43589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43589

Changelog: [Internal]

Adds a way of enabling the Fusebox backend in React Native regardless of the corresponding feature flags. This is only supported in the Buck build and not intended for use in OSS.

Reviewed By: huntie

Differential Revision: D55144502

fbshipit-source-id: 116cd30464acfbd3fafc503300f94cb238adeda8
2024-03-21 04:04:04 -07:00
Rubén Norte 0267ca0a40 Move DOM APIs to native module (#43512)
Summary:
Changelog: [internal]

This moves all the new methods that were added to implement the DOM traversal and layout APIs (as per this RFC: https://github.com/react-native-community/discussions-and-proposals/pull/607) to a separate C++ native module to avoid bloating the UIManager interface, initialize lazily, provide automatic caching of methods, simplify the API for implementors, etc.

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

Reviewed By: sammy-SC

Differential Revision: D54903376

fbshipit-source-id: 69daa84c886d1c65dbb0b223dbb7c9077502c6ad
2024-03-20 11:25:03 -07:00
Joe Vilches 21b008ed40 Convert FilterHelper.java to Kotlin (#43535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43535

tsia

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D54914028

fbshipit-source-id: 78d3dd20a8e98b4d4a2335b5542e4879a4cf3e41
2024-03-20 10:43:09 -07:00
Moti Zilberman 9c48121b4e Update debugger-frontend from 622246a...0beb10c (#43576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43576

Changelog: [Internal]

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/622246a3aeff4b1b47e55153a7c89be37fd14e59...0beb10c594a2847ec696e3b7f6e26a01a849c799
).

Reviewed By: robhogan

Differential Revision: D55136910

fbshipit-source-id: 77e2a283999a63bfba98939f878b752694be3c74
2024-03-20 10:36:06 -07:00
Wojciech Dróżdż 6450d08187 Add onUserLeaveHint support to ReactActivityDelegate #43488 (#43567)
Summary:
This PR adds `onUserLeaveHint` support into the `ReactActivityDelegate`. It allows modules to receive an event every time user moves the app into the background. This is slightly different than `onPause` - it's called only when the user intentionally moves the app into the background, e.g. when receiving a call `onPause` should be called but `onUserLeaveHint` shouldn't.

This feature is especially useful for libraries implementing features like Picture in Picture (PiP), where using `onUserLeaveHint` is the [recommended way of auto-entering PiP](https://developer.android.com/develop/ui/views/picture-in-picture#:~:text=You%20might%20want%20to%20include%20logic%20that%20switches%20an%20activity%20into%20PiP%20mode%20instead%20of%20going%20into%20the%20background.%20For%20example%2C%20Google%20Maps%20switches%20to%20PiP%20mode%20if%20the%20user%20presses%20the%20home%20or%20recents%20button%20while%20the%20app%20is%20navigating.%20You%20can%20catch%20this%20case%20by%20overriding%20onUserLeaveHint()%3A) for android < 12.

This is a re-submission of https://github.com/facebook/react-native/pull/42741 and https://github.com/facebook/react-native/pull/43488 without problematic asserts, which were unnecessary (`onUserLeaveHint` is not critical to the lifecycle of the app), but were causing problems in some apps.

## Changelog:

[ANDROID] [ADDED] - Added `onUserLeaveHint` support into `ReactActivityDelegate`

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

Test Plan: Tested in the `rn-tester` app - callbacks are correctly called on both old and new architecture.

Reviewed By: javache

Differential Revision: D55123632

Pulled By: cortinico

fbshipit-source-id: 144a1d84b691af9cf3c0cffad446e674b4b68927
2024-03-20 09:19:35 -07:00
Cedric van Putten 652c74104a fix(dev-middleware): create custom message handler for synthetic page (#43559)
Summary:
This is a follow-up bugfix for expo/expo#27425, related to:
 - https://github.com/facebook/react-native/issues/43291
 - https://github.com/facebook/react-native/issues/43307
 - https://github.com/facebook/react-native/issues/43310
 - https://github.com/facebook/react-native/issues/43364

The middleware API works as intended and can run our extended CDP events. Unfortunately, this only applies to an actual `Page` from the device, not for the `React Native Experimental (Improved Chrome Reloads)` synthetic / virtual page.

That's because the middleware instantiation gets aborted when the page can't be found in `this.#pages.get(pageId)`, which always returns `null` for this synthetic page.

## Changelog:

[GENERAL] [FIXED] Create custom message handler for synthetic page

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

Test Plan: See added test case.

Reviewed By: motiz88

Differential Revision: D55129412

Pulled By: huntie

fbshipit-source-id: 9679d8fe68f3cb4104f4a042f93612b995baddc9
2024-03-20 08:59:46 -07:00
Alex Hunt d03b5dca74 Adjust version parsing in release scripts, fix release dry runs in CI (#43568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43568

Fixes to restore passing CI checks on main after D55027120.

- Widen validation checks in version utils to accept `0.x.x` (as opposed to `0.[not-'0'].x`).
- Use `tag: test` instead of `tag: latest` for dry run job params.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55123739

fbshipit-source-id: 9f76dced4e7aa3ce87d6680cd7687ae443305331
2024-03-20 08:07:36 -07:00
Moti Zilberman 1fe82671e8 Update debugger-frontend from 9ceb0ad...622246a (#43571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43571

Changelog: [Internal]

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/9ceb0ade8033ec165bbfbd41c08ac1fcd9f89a46...622246a3aeff4b1b47e55153a7c89be37fd14e59
).

Reviewed By: huntie

Differential Revision: D55125722

fbshipit-source-id: e2998d3ec75e39f744d20672b9cee76ccac27964
2024-03-20 06:54:31 -07:00
Moti Zilberman b7c1bd4e89 Remove console logs from Metro when native debugger console is available
Summary:
Changelog: [Internal] Remove console logs from Metro when native Fusebox debugger console is available

React Native currently sends all `console.log` messages to Metro, which prints them to the terminal. This feature has been in place since 2019 (D15559151) but is pretty limited when compared to what's available in modern browsers. Most of the limitations can't really be fixed within the constraints of Metro's relatively simple terminal infrastructure.

With the new React Native debugger (codenamed "Fusebox") we aim to fundamentally elevate the debugging experience by shipping a well-tested version of Chrome DevTools with React Native. Chrome DevTools has a rich, interactive console, as well as a host of other debugging features we want developers to notice and use.

To that end, we plan to **strongly nudge users towards the Fusebox console from day 1**. Specifically, if we detect that Fusebox is available and is using an engine which implements CDP `console` support ( = Hermes only for now), we'll no longer send logs to Metro, and will instead display an explanatory message directing users to Fusebox.

Reviewed By: huntie

Differential Revision: D54829811

fbshipit-source-id: 2b1cdb666094f901ff4e7f42b123271be4ce7d10
2024-03-20 06:31:34 -07:00
Moti Zilberman b79e488cc5 Log a message identifying Fusebox based on a handshake with the frontend (#43565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43565

Changelog: [Internal]

Uses https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/24 to identify the Fusebox frontend and show a corresponding message in the logs.

Also tweaks the wording and formatting of other messages logged by the Fusebox backend - including removing the "you are using the modern CDP backend" one.

Reviewed By: huntie

Differential Revision: D55075645

fbshipit-source-id: c82670570c79b61efd399f26684139ce97f017ef
2024-03-20 06:12:58 -07:00
Edmond Chui 059615f336 fix Page visibility API in launched CDT (#43560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43560

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D55047534

fbshipit-source-id: e8e17bb1ca7282e0c29e968b6cbd5b4ec147d946
2024-03-20 05:54:12 -07:00
Moti Zilberman 1ae379c6ec Migrate back to chromium-edge-launcher since Windows fix was merged (#43562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43562

A resubmission of D55013623 (Pull Request resolved: https://github.com/facebook/react-native/pull/43524) with a fix for the internal `.flowconfig` issue that got the initial diff reverted.

 ---

The [Windows fix](https://github.com/cezaraugusto/chromium-edge-launcher/pull/1) was merged and published. We no longer need to use the fork.

## Changelog:

[INTERNAL] [FIXED] - Fix experimental debugger launch flow with Edge on Windows

Reviewed By: NickGerleman

Differential Revision: D55087731

fbshipit-source-id: 6fd28a32447ad07dacdf6cd77390e18489fd6cfb
2024-03-20 03:55:35 -07:00
Moti Zilberman ce4d8f2756 Allow setting alternative debugger frontend path in development (#43561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43561

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D55074090

fbshipit-source-id: 186f1aae98c81c7c2c11209352e40365f44aeb5d
2024-03-20 01:46:49 -07:00
Arushi Kesarwani d97741af60 Support reload in ReactDelegate (#43521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43521

Changelog:
[Android] [Added] - Support reload() in ReactDelegate

Reviewed By: cortinico

Differential Revision: D54967602

fbshipit-source-id: adfa200cabcbecf9507775ac38f17c9d01b2671a
2024-03-19 13:32:21 -07:00
Samuel Susla 6084a5b8e5 delete unused member variable (#43551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43551

changelog: [internal]

unused member variable. Let's remove it

Reviewed By: rubennorte

Differential Revision: D54754610

fbshipit-source-id: 0ed6a71314f25d00779312bd97d46875c2723e9a
2024-03-19 13:27:11 -07:00
Samuel Susla b1c52925c9 delete SchedulerToolbox.mainRunLoopObserverFactory (#43552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43552

changelog: [internal]

SchedulerToolbox.mainRunLoopObserverFactory is not used. Let's remove it.

Reviewed By: rubennorte

Differential Revision: D54747330

fbshipit-source-id: d4659ae03d8d2a5f4445cfca715647799dc4450c
2024-03-19 13:27:11 -07:00
Samuel Susla 7b85e2608b delete SynchronousEventBeat (#43553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43553

changelog: [internal]

SynchronousEventBeat is not used, let's remove it.

Reviewed By: rubennorte

Differential Revision: D54746748

fbshipit-source-id: c8e16706ec56f0d49b4b848e1eb0a5ca36331da3
2024-03-19 13:27:11 -07:00
Joe Vilches ed4a4a4d9e Fix syntax errors in view/conversions.h (#43537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43537

This file always had a bunch of errors and made it so that actual errors do not show up (too many emitted). It was just because we are not including RawProps.h. I am not sure how it ever got compiled but I guess some header included something that included something etc. Maybe its a vs code issue but this seems like an obvious fix

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D55041883

fbshipit-source-id: 3445770dd25dbe294024649f96f9e3af7777b2b2
2024-03-19 11:49:56 -07:00
Samuel Susla ec6d0272af remove experimental prop endDraggingSensitivityVelocityMultiplier from ScrollView (#43554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43554

changelog: [internal]

The prop endDraggingSensitivityVelocityMultiplier makes the API more complicated and provides only limited benefit. Let's remove it for the sake of simplicity.

Reviewed By: christophpurrer

Differential Revision: D53853298

fbshipit-source-id: d2663f2f6eef1dde3136debe8965ee871f4e043d
2024-03-19 08:26:24 -07:00
Alex Hunt 5a80935cf2 Remove bump-all-updated-packages script (#43534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43534

This is no longer used after switching to the new release workflow, which uses the newer and less error-prone `set-version` script.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55027122

fbshipit-source-id: faa8cfd2af9b54fab611b108df162793c5768695
2024-03-19 07:05:03 -07:00
Alex Hunt bb4d13e80c Switch to new release workflow as default (#43533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43533

Switch to the new unified release workflow by default, now that this has been validated on the `0.74-stable` branch.

- Remove `--use-new-workflow` flag and remove legacy logic.
- Remove legacy `prepare_package_for_release` CI job, and use `run_new_release_workflow` -> `run_release_workflow` as new workflow condition match.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55027120

fbshipit-source-id: 7c05cdff95ac369ce6cd1201ccfc5718798c4da6
2024-03-19 07:05:03 -07:00
Alex Hunt 7e6ca59e82 Remove unused dev dependencies (#43549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43549

Remove unused `async` and `mock-fs` dev dependencies from the project root.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D55062743

fbshipit-source-id: 9f62eeaf66ebec4d1d099454ae95a686d12e471e
2024-03-19 06:09:10 -07:00
Blake Friedman 4a58f06c13 Fast follows from RFC-0759 cli feedback
Summary:
Updated linters, include typings in `package.json` and removed bun from the clean commands.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54493859

fbshipit-source-id: eb28d208de722c90916b14f56d5a8e847bb3d859
2024-03-19 05:29:34 -07:00
Alex Hunt d19d871361 Add changelog for 0.74.0-rc4 (#43529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43529

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55022548

fbshipit-source-id: 823fdb1c38a13ef804bad4fb20ba44e5ce5094b5
2024-03-19 04:53:20 -07:00