Commit Graph

38536 Commits

Author SHA1 Message Date
Thomas Nardone 0683206927 Restore subclipping view removal (#48329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48329

With the call to `removeView()` removed from `ReactViewClippingManager` in https://github.com/facebook/react-native/pull/47634, we're seeing views erroneously sticking around in the layout.

While `removeViewWithSubviewClippingEnabled()` calls `removeViewsInLayout()`, it does not trigger the corresponding side effects of [removeView()](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5501):
```
public void removeView(View view) {
  if (removeViewInternal(view)) {
--> requestLayout();
--> invalidate(true);
  }
}
```
To compensate, flip `removeViewsInLayout()` to [`removeViews()`](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5562), which will ensure layout.

Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt()

Reviewed By: javache

Differential Revision: D67398971

fbshipit-source-id: b100db468cc3be6ddc6edd6c6d078a8a0b59a2c1
2024-12-19 15:27:13 -08:00
Pieter De Baets a9f60bea72 Remove unused perftests JNI code (#48344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48344

Matching Java code was removed in D60581611

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67460124

fbshipit-source-id: 1c7e986fbb0c02af51e0c4035b2f131fcc2c64ec
2024-12-19 14:51:26 -08:00
Mateo Guzmán 52b6592559 Modal: Setting resource-id from testID prop (#48313)
Summary:
Follow up from https://github.com/facebook/react-native/issues/48271 and https://github.com/facebook/react-native/issues/48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that.

## Changelog:

[ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop

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

Test Plan:
Alternatively do:
```
$ adb shell uiautomator dump
UI hierchary dumped to: /sdcard/window_dump.xml
$ adb pull /sdcard/window_dump.xml
/sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s)
```
and check in XML: ` resource-id="playground-modal"  class="android.view.ViewGroup" `
-------
Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal.

<details>
<summary>Example of the code implementation in the RNTester Playground:</summary>

```tsx
function Playground() {
  const [modalVisible, setModalVisible] = React.useState(false);

  return (
    <>
      <Modal
        visible={modalVisible}
        testID="playground-modal">
        <Text testID="inner-text-test-id">Hello World!</Text>
      </Modal>

      <Button
        title="Open Modal"
        onPress={() => {
          setModalVisible(true);
        }}
      />
    </>
  );
}
```
</details>

<details>
<summary>Output in Appium Inspector:</summary>

<img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" />

</details>

Reviewed By: javache

Differential Revision: D67369350

Pulled By: alanleedev

fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
2024-12-19 11:49:45 -08:00
zhongwuzw dd303b2dde Fabric: Fixes AccessoryView not disappeared when pop up the page (#47311)
Summary:
Fixes AccessoryView not disappeared when page poped up. After page pop up, we can see a white view it the bottom of scrren.

Fixed:
https://github.com/user-attachments/assets/90305720-656b-4546-8730-53b89fee7a66

Before:
https://github.com/user-attachments/assets/8e4fbea3-1882-48f8-aa5f-0c4e9ddc4efd

## Changelog:

[IOS] [FIXED] - Fabric: Fixes AccessoryView not disappeared when pop up the page

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

Test Plan: RNTester InputAccessoryView example, repro steps please see the video above.

Reviewed By: christophpurrer

Differential Revision: D67455393

Pulled By: javache

fbshipit-source-id: b5d3a88bce41da77079eeb49fea8163f56d722dd
2024-12-19 10:55:21 -08:00
kirillzyusko 5fc582783d fix: do not overwrite external inputAccessoryView on Fabric (#48339)
Summary:
If 3rd party libs are using `inputAccessoryView` - the current code can easily break it. Whenever props gets changed we call `setDefaultInputAccessoryView` which will simply overwrite the current `inputAccessoryView` (which is highly undesirable).

The same fix on paper was made ~7 years ago: https://github.com/facebook/react-native/commit/bf3698323d81508fc77174df2b1ffe5fb03224e7

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - Fixed problem with accessory view & 3rd party libs

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

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

Test Plan: Make sure `inputAccessoryView` functionality works as before

Reviewed By: javache

Differential Revision: D67451188

Pulled By: cipolleschi

fbshipit-source-id: bc3fa82ae15f8acedfd0b4e17bdea69cbd8c8a8d
2024-12-19 10:12:36 -08:00
Matin Zadeh Dolatabad ea56c432b7 Disable react-in-jsx-scope rule in eslint config (#46587)
Summary:
All newly generated react native apps are still showing warnings to use react in the jsx scope. That is not needed anymore as of react 18 with built-in jsx transform plugin.

Reproduction: https://github.com/matinzd/react-in-jsx-warning-repro

Run `npm run lint` in this repo.

## Changelog:

[GENERAL] [FIXED] - Disable `react-in-jsx-scope` rule in eslint config

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

Test Plan: Initiate a new template with community CLI and you should not see this warning anymore.

Reviewed By: christophpurrer

Differential Revision: D67394923

Pulled By: cipolleschi

fbshipit-source-id: cfe8e44e33e1b3ae9fe17ca56dd3c7258b7bff69
2024-12-19 06:02:32 -08:00
Pieter De Baets 44ef2c484a Revert D66839601: Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3
Differential Revision:
D66839601

Original commit changeset: dfba4aab6d73

Original Phabricator Diff: D66839601

fbshipit-source-id: 4d59b3616193dc184f0de7df8556f2b9b192df67
2024-12-19 03:37:20 -08:00
Sam Zhou b8f3f919cc Deploy 0.257.0 to xplat (#48331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48331

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D67423622

fbshipit-source-id: 09ca17bedf15174e210e943b989537c67f197659
2024-12-18 17:39:30 -08:00
Richard Barnes 72007a14af Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 (#48250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48250

LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D66839601

fbshipit-source-id: dfba4aab6d73a2fd805ad2761a49c23612c28ccd
2024-12-18 15:24:52 -08:00
Thomas Nardone 783cc5777a Remove GuardedAsyncTask wrapper for call.cancel() (#48251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48251

The original comment mentioning https://github.com/square/okhttp/issues/869 predates the [upgrade to okhttp3](https://github.com/facebook/react-native/commit/6bbaff2944dafd6fa7e5b77ef46dece0ec2c9983), which resolved the issue via https://github.com/square/okhttp/issues/1592.

Cancel calls should now be async and don't need to be guarded.  Removing this also fixes a discrepancy in NetworkingModule unit test verification.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67157018

fbshipit-source-id: 72ce4deaaff306ef1dde6eda7be88707c37f0be7
2024-12-18 14:36:38 -08:00
Zeya Peng 2ea9a7b51f Allow debugID key in InterpolationNode config & Support debugID in NVE (#48323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48323

Allow `debugID` key in InterpolationNode config
Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67185006

fbshipit-source-id: ec0081617103bd4b7bb78210702872a42db26361
2024-12-18 09:10:13 -08:00
Saad Najmi b04d17afca Fix Direct Debugging with JSC (#39549)
Summary:
Originally with https://github.com/facebook/react-native/commit/5cf8f43ab182781ea82e88077df425c3efbfc21f , we added a call to a new Apple API `JSGlobalContextSetInspectable` to ensure that our Javascript running with JSC is debuggable. That change was guarded with a `__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)` check to make sure it only ran on OS'es where to function existed. Later, in https://github.com/facebook/react-native/commit/3eeee11d7ac4075d0917233d3be4a9469f802d35  we did an extra guard in the way of a macro to check we were compiling against a new enough version of Xcode (so that Xcode knows about the symbol).

Between the runtime check and the compile time check, we should be good right? Wrong! As it turns out, this bit of code still caused crashes on iOS 15 devices (See this [Apple Forum Thread](https://forums.developer.apple.com/forums/thread/749534)). To address this, https://github.com/facebook/react-native/pull/44185 was added which added a new compiler guard (`__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4)` was added. Unfortunately, this guard is incorrect: It is basically checking if our minimum iOS deployment target is 16.4 (It's not, as of writing it is iOS 13.4), which effectively means this code is never compiled and one can never direct debug with JSC on iOS 16.4+ 😨!

So what went wrong, and why were the first two guards not good enough? Three main reasons..

Firstly, this is a device only crash, and not reproducible on simulator. This is probably why the crash was not caught earlier. Secondly, It's because system frameworks (like JavascriptCore) are _dynamically_ linked: the linker doesn't look for the symbol till runtime (and crashes when doing so). Thirdly, It's because we are _strongly_ linking the framework, so every symbol must be present and the macros / guard Apple provides with `AvailabilityMacros.h` don't work.

What we want to do is link JavascriptCore as a `weak_framework`, more info here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

From that link:
> One challenge faced by developers is that of taking advantage of new features introduced in new versions of OS X while still supporting older versions of the system. Normally, if an application uses a new feature in a framework, it is unable to run on earlier versions of the framework that do not support that feature. Such applications would either fail to launch or crash when an attempt to use the feature was made. Apple has solved this problem by adding support for weakly-linked symbols.

>When a symbol in a framework is defined as weakly linked, the symbol does not have to be present at runtime for a process to continue running. The static linker identifies a weakly linked symbol as such in any code module that references the symbol. The dynamic linker uses this same information at runtime to determine whether a process can continue running. If a weakly linked symbol is not present in the framework, the code module can continue to run as long as it does not reference the symbol. However, if the symbol is present, the code can use it normally.

This seems to be exactly what we want, and the Apple provided method for using new APIs in system frameworks!

Let's update our podspecs so we link JavascriptCore weakly. As a bonus (and admittedly, the original purpose of this PR) let's add macOS support to the `JSC_HAS_INSPECTABLE` macro (This file `JSCRuntime.cpp` used to have more explicit macOS support in it's macros, but I had removed it with https://github.com/facebook/react-native/commit/fb30fcaa2f526cc1f7c2d4189ec9c57f9cf9b3c5).

## Changelog:

[IOS] [FIXED] - Fix Direct Debugging with JSC

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

Test Plan:
Tested that RNTester doesn't crash on boot running on an iPad Air 2 running iOS 15.8., and that an iOS 17.2 simulator is debuggable.

Built RN-Tester and RN-Tester-macOS and verified both show up in Safari Web Inspectors' debug menu:

<img width="1316" alt="Screenshot 2023-09-19 at 10 48 43 PM" src="https://github.com/facebook/react-native/assets/6722175/c642e6e0-36af-4c9f-845a-7e491489f419">

macOS screenshot small bc I got some internal stuff I gotta crop 😅

<img width="347" alt="Screenshot 2023-09-19 at 10 53 46 PM" src="https://github.com/facebook/react-native/assets/6722175/1e802c88-02b8-49e1-8fd2-d91726ca1e93">

Reviewed By: huntie

Differential Revision: D67338150

Pulled By: cipolleschi

fbshipit-source-id: 620c3b3cc1e37e54de7fa4dc9956a02c8f3c09f8
2024-12-18 08:00:19 -08:00
Oskar Kwaśniewski 9f12fce53b fix(iOS): remove unused RCTTurboModuleManagerDelegate method (#48290)
Summary:
Hey, this PR removes unused method from RCTAppDelegate.

The only called method from RCTTurboModuleManagerDelegate is `getTurboModule:jsInvoker`, the `getTurboModule:initParams:` is never called.

https://github.com/facebook/react-native/blob/5a81ceed2a6c974211e6a238efee3eea68b9568a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm#L207

## Changelog:

[INTERNAL] [REMOVED] - remove unused RCTTurboModuleManagerDelegate method

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

Test Plan: CI Green, ensure everything works as before

Reviewed By: javache

Differential Revision: D67392056

Pulled By: cipolleschi

fbshipit-source-id: e7f35f81c48cdc163cfff45987e0b7eb022cbf7d
2024-12-18 07:14:04 -08:00
Eli White 4dac99cf6d Fix FlowFixMes in CodegenVersionDiffing (#48312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48312

I figured out how to fix these FlowFixMes

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D67313962

fbshipit-source-id: 21b109824411c1537f397aca45b7cdc2495f5e11
2024-12-17 20:23:24 -08:00
Sam Zhou f8119fc52b Pre-suppress errors in xplat ahead of 0.257.0 release
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67368232

fbshipit-source-id: 23111f62c5731b5a58e15ac8ef2dcd9ea8006573
2024-12-17 18:28:25 -08:00
generatedunixname499836121 7948044179 Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
bypass-react-native-oss-changelog

Generated by: https://www.internalfb.com/intern/sandcastle/job/36028798618339642/

GitHub Repo: facebook/react

Reviewed By: kassens

Differential Revision: D67286468

fbshipit-source-id: 66632a2524e80bca065d0a0f94342c4ec2d2a7b9
2024-12-17 13:33:11 -08:00
Thomas Nardone e577e48ad7 Remove reflection in OkHttpCallUtil (#48308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48308

Reflection is overkill here, we can simply suppress the deprecation "error".

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67337980

fbshipit-source-id: 12076258ed4cb5c8737c84378621dda3072ec5a0
2024-12-17 11:22:46 -08:00
Alex Hunt dfdacb84ce Refactor PerformanceTracer buffer type to use output event format (#48310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48310

Refactors the internal storage format of trace events buffered by `PerformanceTracer`.

Aligning with the emitted [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?pli=1&tab=t.0#heading=h.yr4qxyxotyw) enables us to simplify away the issue of defining and converting from any intermediate formats. This becomes desirable as we generalise to more event types and forthcoming browser-emulating `__metadata` events.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67337442

fbshipit-source-id: 580928dfb4fcf4ac5efc82f93ab85a0d1d6dfb5c
2024-12-17 10:57:39 -08:00
Mitya Kononchuk 8696b79f73 Fix running fantom tests with high parallelism (#48307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48307

Changelog:
[General][Fixed] - Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test.

Reviewed By: rubennorte, danalex97

Differential Revision: D67334828

fbshipit-source-id: 3db18f6a100925480dbf8385f9ea414187406f4a
2024-12-17 10:07:26 -08:00
Thomas Nardone 5a01291598 Categorize SoftAssertions (#48306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48306

Extract a constant for SoftAssertions so they can be logged appropriately

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D67296589

fbshipit-source-id: c8823fd5dfa09a771bb8fbf498edb8d9264f053f
2024-12-17 09:18:55 -08:00
Dmitry Rykun 0ceb0b3942 Calculate Android mounting instructions based on updates accumulated in rawProps (#48303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48303

## Context

If a component is re-rendered/committed multiple times before mount, Android mounting layer creates and executes mounting instructions for every commit. Component's native representation is updated multiple times, potentially triggering expensive computations (e.g. recreating boxShadows) for a single draw.

A more efficient way would be to create mounting instructions to update the component from the initial state (before the first render) to the final state (after the last render) in one go.

iOS does that.

This diff is an attempt to experiment on achieving such behaviour for Android.

## Implementation Details

1. When cloning a ShadowNode, accumulate all the updates in `Props.rawProps`.
2. For calculating prop update payloads to be sent to the Android mounting layer, diff old and new `rawProps` by calling `newProps->getDiffProps(oldProps)`.
3. Most importantly, move computing of the mounting instructions from `schedulerDidFinishTransaction`, which is called after every commit, to `schedulerShouldRenderTransactions` which happens only once, after the final commit.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63457028

fbshipit-source-id: 991727838a4e11628cb696d66d41e1d441a5ef4f
2024-12-17 09:03:08 -08:00
zhongwuzw 5c789c3d3a Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan (#48296)
Summary:
Fixes https://github.com/facebook/react-native/issues/48288

## Changelog:

[IOS] [FIXED] - Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan

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

Test Plan: Repro demo in https://github.com/facebook/react-native/issues/48288

Reviewed By: cipolleschi

Differential Revision: D67334179

Pulled By: NickGerleman

fbshipit-source-id: a9456a152d31bef1666669cbded28d99ec8a2028
2024-12-17 06:53:47 -08:00
Mateo Guzmán 5370347f54 Upgrading typescript-config module version to esnext (#48230)
Summary:
Fixes https://github.com/facebook/react-native/issues/45810

Upgrading `typescript-config` module version from `es2015` to `esnext`, in order to support dynamic imports.

## Changelog:

[GENERAL] [CHANGED] - Upgrading `typescript-config` module version to `esnext`

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

Test Plan:
Create a new React Native project:

```bash
npx react-native-community/cli@latest init AwesomeProject
```

Copy the changes in the reproducer from the linked issue and add a lazy import:

```tsx
const LazyAssetExample = React.lazy(() => import('./components/AssetExample'));
```

See the error when running `yarn tsc`:

<img width="739" alt="image" src="https://github.com/user-attachments/assets/99989cd1-e11a-4b23-b178-f221d8cdd8ca" />

 ---

To fix the error, apply the following patch:

```patch
 diff --git a/node_modules/react-native/typescript-config/tsconfig.json b/node_modules/react-native/typescript-config/tsconfig.json
index d5e1bce..51f54c1 100644
 --- a/node_modules/react-native/typescript-config/tsconfig.json
+++ b/node_modules/react-native/typescript-config/tsconfig.json
@@ -3,7 +3,7 @@
     "display": "React Native",
     "compilerOptions": {
       "target": "esnext",
-      "module": "es2015",
+      "module": "esnext",
       "types": ["react-native", "jest"],
       "lib": [
         "es2019",

```

Verify it is fix by running `yarn tsc` again

Reviewed By: cipolleschi

Differential Revision: D67334277

Pulled By: NickGerleman

fbshipit-source-id: d26525023ff6fcfff651d1e4cee48ab2854b8d83
2024-12-17 06:08:43 -08:00
Riccardo Cipolleschi 0a0a1d90a7 Add Changelog for 0.77.0-rc.3 (#48302)
Summary:
Add Changelog for 0.77.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.77.0-rc.3

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D67332176

Pulled By: cipolleschi

fbshipit-source-id: 335e0b6da5d51934d383a08c5749b6d1f57d6a3d
2024-12-17 04:53:50 -08:00
Riccardo Cipolleschi 03b9f041db Improve E2E Stability for Android (#48286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48286

This change bumps the specs for the Android E2E tests. This has been reported to improve the stability of the tests.

We need to keep part of the `flatlist.yml` commented as it creates an issue with Maestro as it takes too much memory.

I'll reach out to the people working on Maestro to try and understand what's going on there.

## Changelog:
[Internal] - Improve android Stability and reenable E2E tests on main

Reviewed By: fabriziocucci

Differential Revision: D67276601

fbshipit-source-id: 7cca253547063a0ec39da7de58806286c6632b07
2024-12-17 03:45:18 -08:00
Riccardo Cipolleschi b511a95652 Fix Text tests (#48279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48279

The text tests has 2 issues:
* on iOS, the Text cell was sometimes rendered below the tabbar, with a small percentage visible. When this happens, the test was actually moving to a different tab rather then navigating to the Text screen
* on Android, sometimes navigation took too long and a scroll command was issued. This moved the screen away from the right screen we wanted to test.

This change fixes both issues by ensuring that the Text cell is 100% visible (not behind the tabbar) and by ensuring that the title "Text" is visible in Android, so the navigatin has actually happened

## Changelog:
[Internal] - Fix Text tests

Reviewed By: fabriziocucci

Differential Revision: D67274009

fbshipit-source-id: ed12f096788e7e6e74ee8d336dba350b35b85e81
2024-12-17 03:45:18 -08:00
Riccardo Cipolleschi 3f3ff554bc Bump Android executor and add timeout (#48280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48280

In an attempt to improve times and stability, I bumped the android machine to an ubuntu with 4 cores.

Sometimes the emulator can hang, so i set a timeout for the E2E tests executions of 1 hours to avoid wasting money in CI

## Changelog
[Internal] - Bump Android machine and add timeout

Reviewed By: fabriziocucci

Differential Revision: D67273842

fbshipit-source-id: b7212f52016f8ead1dbb2b4da03cb6f564222893
2024-12-17 03:45:18 -08:00
Riccardo Cipolleschi 4c4c87beaf Improve metro waiting times in E2E (#48281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48281

While working on Maestro E2E I realized that we were waiting for Metro to start even when metro was not running.

This moves the waiting only when metro is actually started.

I also added another waiting point as it takes several seconds for the app to load the bundle from metro the first time. Subsequent attempts are faster as the metro cache is warm.

## Changelog:
[Internal] - Improve metro waiting times in E2E

Reviewed By: fabriziocucci

Differential Revision: D67273648

fbshipit-source-id: 912be4d14869c8ce87d7c4e4f7ee37b643f5845c
2024-12-17 03:45:18 -08:00
Riccardo Cipolleschi 6c8473e52c Bump maestro to 1.39.5 (#48282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48282

This change bump maestro to the latest version as it present better reporting.

## Changelog:
[Internal] - Bump maestro to 1.39.5

Reviewed By: fabriziocucci

Differential Revision: D67273486

fbshipit-source-id: da41a002528a3b3c0934f86888da2bb53ae131b7
2024-12-17 03:45:18 -08:00
Thomas Nardone c832f94cf7 Extract SoftException categories (#48289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48289

Provide a mechanism to register specific category constants, which can be used by individual  `ReactSoftExceptionListener`s to differentiate behavior, if desired.

Changelog: [Android][Added] SoftException categories

Reviewed By: makovkastar

Differential Revision: D66785403

fbshipit-source-id: cb2c8861bb1dce29a6787d328b814cee09f36464
2024-12-16 20:33:18 -08:00
David Vacca 2516414f02 Migrate UIBlock to Kotlin (#48294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48294

Migrate UIBlock to Kotlin

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D67187378

fbshipit-source-id: ae38998d5adebbaddd1976397e229435229a7471
2024-12-16 20:24:22 -08:00
David Vacca b88346f9ea Update deprecation message (#48293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48293

Update deprecation message

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D67292511

fbshipit-source-id: 4d3315ce05f5c5ae1060659e98832305fee93377
2024-12-16 19:21:26 -08:00
David Vacca 45e4a3afce Migrate ReactPointerEventsView to kotlin (#47749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47749

Migrate ReactPointerEventsView to kotlin

changelog: [Android][Breaking] Mikgrating pointerEvents API breaks compatibility for kotlin usages of this api as a val

Reviewed By: cortinico

Differential Revision: D66217250

fbshipit-source-id: ff192c9f92d1df93c082b563937eb3f37176f144
2024-12-16 18:39:54 -08:00
David Vacca 25ee3e805d Migrate ReactOverflowView to kotlin (#47750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47750

Migrate ReactOverflowView to kotlin

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D66217252

fbshipit-source-id: 8cd642dee2077006eab10d718a1887a77fd029a7
2024-12-16 18:39:12 -08:00
Ruslan Lesiutin 03a1246c35 Refactor TraceEvent format (#48269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48269

# Changelog: [Internal]

I've noticed that our definition of Trace Event is different from the one that is defined in Google's doc / V8 / Chrome. This has some flaws:
* It creates fragmentation, like with custom track ids or with mocked process ids.
* Current implementation is strict the relationship between `performance.mark()`, `performance.measure` APIs and Instant, Complete Trace Events. Basically only something recorded with `performance.mark` can be an instant trace event.

This should unblock recording custom trace events inside `PerformanceTracer`, such as when tracing started and others. Same could be said about events related to CPU profiling from Hermes, which will be based on these APIs.

This is the pre-requisite for next diff that will add emitting `TracingStartedInPage` event. With this event, the trace should look similar to the one recorded in the browser, and Timings / Main tracks no longer should be registered manually.

Reviewed By: huntie

Differential Revision: D67207107

fbshipit-source-id: fd7f55dd82167c14a63c2d93aaa649072c5a2a2c
2024-12-16 15:19:16 -08:00
Riccardo Cipolleschi 4368368ef5 Fix some peer dependencies on React types (#48292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48292

These dependencies are making the CI on main to fail.

## Changelog:
[General][Fixed] - Fix peer dependencies on React types

Reviewed By: javache, hoxyq

Differential Revision: D67283609

fbshipit-source-id: b325246f5de654a9ccbf7f96eec24434047a38ee
2024-12-16 14:08:19 -08:00
Thomas Nardone b662b1f4e4 Update ReactOkHttpNetworkFetcherTest (#48205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48205

Flip mockito usages to mockito-kotlin

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66985841

fbshipit-source-id: 23c501c96567e6f4f884bc4db8930f1d68b0351c
2024-12-16 13:00:50 -08:00
Thomas Nardone 3960a2dd8c Fix up network module tests (#48160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48160

Shift to mockito-kotlin and fix ReactCookieJarContainerTest so it's not just testing a mock.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66898956

fbshipit-source-id: 5ccc652b86e5a80b81d257d3ec645d7bc813301b
2024-12-16 13:00:50 -08:00
Thomas Nardone 1cbda5f64e Fix NetworkingModuleTest (#48159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48159

Fix the setup for ignored tests and re-enable them.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66897564

fbshipit-source-id: bac777c981976e08140bc0832f5402995ffceb8e
2024-12-16 13:00:50 -08:00
Thomas Nardone e393711ef8 Add mockito-kotlin (#48158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48158

Changelog: [Android][Added] Add mockito-kotlin for Kotlin unit testing

Reviewed By: cortinico

Differential Revision: D66897263

fbshipit-source-id: c608622e2431578f4eaa3fecff4f6c82a56b5090
2024-12-16 13:00:50 -08:00
Stefano Formicola d31ac832c5 Add CCACHE_BINARY path to Xcode build settings and use it in ccache scripts (#48257)
Summary:
When building a react native app from Xcode and ccache has been set to be used, the `ccache-clang.sh` and `ccache-clang++.sh` scripts cannot find `ccache`, because Xcode PATH does not include ccache binary.
What I've done is setting a `CCACHE_BINARY` user-defined Xcode setting containing the result of executing `command -v ccache` during pod install execution and directly calling it in ccache scripts, set by ReactNativePodsUtils when ccache is enabled.

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

## Changelog:

[IOS] [FIXED] - fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts

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

Test Plan: Correctly builds helloworld and RNTester apps using ccache by enabling it at pod install time: `USE_CCACHE=1 pod install`.

Reviewed By: christophpurrer

Differential Revision: D67280700

Pulled By: cipolleschi

fbshipit-source-id: 5478a191f9bd77606a56ccd340fea225ab62d4bc
2024-12-16 10:58:28 -08:00
Rubén Norte 06584241ba Fix ESLint warnings and remove from ignore list (#48291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48291

Changelog: [internal]

`react-native-fantom` was added to `.eslintignore` when we upgraded to React 19 because we wanted to reduce the amount of warnings to ease the migration.

This re-enables ESLint for that directory and removes the warnings.

Reviewed By: cipolleschi

Differential Revision: D67283104

fbshipit-source-id: 4ec2363ceaff3cd7bd6e5d70e9588c3dd22d7d85
2024-12-16 09:19:55 -08:00
Mateo Guzmán 92bffe6571 Fix PR warnings generated by unsorted imports from RCTNetworking.js.flow (#48272)
Summary:
There are a some warnings in the PRs generated by the unsorted imports in the `RCTNetworking.js.flow` file.

This PR addresses that. As an example: https://github.com/facebook/react-native/pull/48271/files

<img width="721" alt="image" src="https://github.com/user-attachments/assets/7e5347a5-c802-4c21-870d-f4983b515a7b" />

## Changelog:

[INTERNAL] [FIXED] - Sorting `RCTNetworking.js.flow` imports that generate a warning in the PRs

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

Test Plan: Verify that this PR doesn't show these warnings anymore

Reviewed By: NickGerleman

Differential Revision: D67274752

Pulled By: javache

fbshipit-source-id: 84ac36e0aaaeaf0156e40de9f6c61bd70fa1db85
2024-12-16 08:44:03 -08:00
Riccardo Cipolleschi 5a81ceed2a React Native sync for revisions de68d2f...372ec00 (#48196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48196

X-link: https://github.com/facebook/metro/pull/1400

- **[372ec00c03](https://github.com/facebook/react/commit/372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](https://github.com/facebook/react/pull/31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](https://github.com/facebook/react/commit/3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](https://github.com/facebook/react/pull/31713)) //<Sebastian Markbåge>//
- **[1c9b138714](https://github.com/facebook/react/commit/1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](https://github.com/facebook/react/pull/31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](https://github.com/facebook/react/commit/de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](https://github.com/facebook/react/pull/31667)) //<Josh Story>//
- **[16d2bbbd1f](https://github.com/facebook/react/commit/16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](https://github.com/facebook/react/pull/31620)) //<Josh Story>//
- **[5b0ef217ef](https://github.com/facebook/react/commit/5b0ef217ef )**: s/server action/server function ([#31005](https://github.com/facebook/react/pull/31005)) //<Ricky>//
- **[e3b7ef32be](https://github.com/facebook/react/commit/e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](https://github.com/facebook/react/pull/31617)) //<lauren>//
- **[aba370f1e4](https://github.com/facebook/react/commit/aba370f1e4 )**: Add moveBefore Experiment ([#31596](https://github.com/facebook/react/pull/31596)) //<Sebastian Markbåge>//
- **[1345c37941](https://github.com/facebook/react/commit/1345c37941 )**: Mark all lanes in order on every new render ([#31615](https://github.com/facebook/react/pull/31615)) //<Sebastian Markbåge>//
- **[91061073d5](https://github.com/facebook/react/commit/91061073d5 )**: Mark ping time as update ([#31611](https://github.com/facebook/react/pull/31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](https://github.com/facebook/react/commit/a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](https://github.com/facebook/react/pull/31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](https://github.com/facebook/react/commit/c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](https://github.com/facebook/react/pull/31599)) //<lauren>//
- **[64f89510af](https://github.com/facebook/react/commit/64f89510af )**: [crud] Enable on RTR FB builds ([#31590](https://github.com/facebook/react/pull/31590)) //<lauren>//
- **[7558ffe84d](https://github.com/facebook/react/commit/7558ffe84d )**: [crud] Fix copy paste typo ([#31588](https://github.com/facebook/react/pull/31588)) //<lauren>//
- **[7c254b6576](https://github.com/facebook/react/commit/7c254b6576 )**: Log yielded time in the Component Track ([#31563](https://github.com/facebook/react/pull/31563)) //<Sebastian Markbåge>//
- **[6177b18c66](https://github.com/facebook/react/commit/6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](https://github.com/facebook/react/pull/31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](https://github.com/facebook/react/commit/eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](https://github.com/facebook/react/pull/31119)) //<Mark Skelton>//
- **[047d95e85f](https://github.com/facebook/react/commit/047d95e85f )**: [crud] Basic implementation ([#31523](https://github.com/facebook/react/pull/31523)) //<lauren>//
- **[92c0f5f85f](https://github.com/facebook/react/commit/92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](https://github.com/facebook/react/pull/31554)) //<Sebastian Markbåge>//
- **[053b3cb050](https://github.com/facebook/react/commit/053b3cb050 )**: [crud] Rename Effect type ([#31557](https://github.com/facebook/react/pull/31557)) //<lauren>//
- **[7dd6b9e68a](https://github.com/facebook/react/commit/7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](https://github.com/facebook/react/pull/31556)) //<lauren>//
- **[d8afd1c82e](https://github.com/facebook/react/commit/d8afd1c82e )**: [crud] Scaffold initial types ([#31555](https://github.com/facebook/react/pull/31555)) //<lauren>//
- **[3720870a97](https://github.com/facebook/react/commit/3720870a97 )**: Log Render Phases that Never Committed ([#31548](https://github.com/facebook/react/pull/31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](https://github.com/facebook/react/commit/8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path  ([#31547](https://github.com/facebook/react/pull/31547)) //<Sebastian Markbåge>//
- **[63cde684f5](https://github.com/facebook/react/commit/63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](https://github.com/facebook/react/pull/31524)) //<Zack Tanner>//
- **[b01722d585](https://github.com/facebook/react/commit/b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](https://github.com/facebook/react/pull/31536)) //<Sebastian Markbåge>//
- **[c13986da78](https://github.com/facebook/react/commit/c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](https://github.com/facebook/react/pull/31528)) //<Sebastian Markbåge>//
- **[4686872159](https://github.com/facebook/react/commit/4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](https://github.com/facebook/react/pull/31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](https://github.com/facebook/react/commit/5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](https://github.com/facebook/react/pull/31540)) //<lauren>//
- **[3644f0bd21](https://github.com/facebook/react/commit/3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](https://github.com/facebook/react/pull/31527)) //<Sebastian Markbåge>//
- **[8657869999](https://github.com/facebook/react/commit/8657869999 )**: Separate Tracks for Components and Phases ([#31525](https://github.com/facebook/react/pull/31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](https://github.com/facebook/react/commit/b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](https://github.com/facebook/react/pull/31539)) //<lauren>//

Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0

bypass-github-export-checks
jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D67018480

fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
2024-12-16 06:58:21 -08:00
Rubén Norte 18243d07e4 Customize log level in Fantom output (#48263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48263

Changelog: [internal]

Customize log level in Fantom based on flag in runner.js.

Reviewed By: javache

Differential Revision: D67199970

fbshipit-source-id: 31cdd2eaeee8e7ab4c8985661b35822d78d0457b
2024-12-16 06:03:03 -08:00
Rubén Norte d1293f6d44 Allow creating empty surfaces without using AppRegistry initialization paths (#48262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48262

Changelog: [internal]

At the moment, we can't start surfaces in Fabric without calling `AppRegistry.runApplication`.

This is completely unnecessary in cases like Fantom, where the creation of the surface is done manually from JS and we render to it immediately after (so we don't need to call into JS again to run AppRegistry).

Reviewed By: javache

Differential Revision: D67199971

fbshipit-source-id: e6402686b6f544a4a7651f6a21a57891ca6be3d1
2024-12-16 06:03:03 -08:00
Pieter De Baets 173b65803d Store backfaceVisibility as boolean (#48268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48268

No need to store and compare strings here when a simple boolean will do.

Changelog: [Internal]

Reviewed By: NickGerleman, mdvacca

Differential Revision: D67204387

fbshipit-source-id: c78cc758797980c2bce11875e0f6ea1961058f05
2024-12-16 05:54:38 -08:00
Dmitry Rykun eac4b32573 Rename the last remaining usage of parentShadowView.tag to parentTag (#48267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48267

`parentShadowView.tag` was renamed to `parentTag` in D66656411. This one callsite is hidden behind an `#ifdef`, so it didn't produce a compile error.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67203413

fbshipit-source-id: 8c1b1af616165b9a80bd38ab4d7376cb2f27cce5
2024-12-16 05:37:13 -08:00
Rubén Norte 358fd38825 Add scheduleTask and runWorkLoop to public API (#48284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48284

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / https://github.com/facebook/react-native/pull/48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Reviewed By: javache

Differential Revision: D67275518

fbshipit-source-id: acde0093802fbcb7083334f2c0247b37b759a6b1
2024-12-16 04:50:15 -08:00
zhongwuzw 5d67490574 Fabric: Fixes Numeric TextInput not triggering onSubmitEditing (#48276)
Summary:
Fixes https://github.com/facebook/react-native/issues/48259 . The paper code like :
https://github.com/facebook/react-native/blob/2fee13094b3d384c071978776fd8b7cff0b6530f/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L777-L784

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Numeric TextInput not triggering onSubmitEditing

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

Test Plan: Repro in https://github.com/facebook/react-native/issues/48259

Reviewed By: cipolleschi

Differential Revision: D67274739

Pulled By: javache

fbshipit-source-id: 57396c6e1a8ef96a1b29cae4a9aa9b5f48f6080b
2024-12-16 04:46:03 -08:00