Commit Graph

32048 Commits

Author SHA1 Message Date
Blake Friedman 345e313ba4 [RN][CI] use correct has to label hermes cache key
This incorrectly used the SHA from facebook/react-native instead of
facebook/hermes to label the hermes cache key. This would bloat our
cache by ~ 1.2GB for each PR.

Changelog: [Internal]
2024-06-19 11:44:57 +01:00
Samuel Susla 2f0c06de10 setup gating for <TextOptimized /> (#45031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45031

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D58672844

fbshipit-source-id: 2c99d3b66665c8dc0b796713b21d91211b469d81
2024-06-18 16:23:45 -07:00
Jorge Cabiedes Acosta d8739e1d37 Add unit tests for BorderRadiusStyle (#44964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44964

Testing property priority and correct setting percentages for business logic of `BorderRadiusStyle.kt`

To prevent issues like the one fixed by D57473482

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D58705515

fbshipit-source-id: 74e9a68fc0e3d1e88b8eebbb34a1ca8c29052c21
2024-06-18 10:46:23 -07:00
Nicola Corti 3fc6963da3 Fix release regex for publish-release workflow (#45043)
Summary:
The existing regex is not workign. I've split it in two and tested it against a private repo.

## Changelog:

[INTERNAL] - Fix release regex for publish-release workflow

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

Test Plan: Tested on privare repo with GHA

Reviewed By: cipolleschi

Differential Revision: D58736292

Pulled By: cortinico

fbshipit-source-id: f07ef32dcb0059922100c555f7894bbf0c7dd8f6
2024-06-18 10:09:29 -07:00
Moti Zilberman e0fcf2983a Use hermes-parser when building Node packages (#45041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45041

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D58734657

fbshipit-source-id: d5b17bc0ee8f36bae7c594d99ce70ecea9bf4a40
2024-06-18 09:43:20 -07:00
Moti Zilberman e55ea2daf1 Fix debugger handoff logic to prevent "zombie" state (#45035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45035

Changelog: [General][Fixed] Avoid a zombie state when opening a second debugger frontend concurrently.

The problem here was that we were sending proxy-protocol messages to the device in the wrong order (`disconnect` *after* `connect`):

 {F1701266597}

The root cause was that we were depending on the outgoing debugger socket's async `close` event to trigger sending the `disconnect` message to the device. This would happen after we'd already (synchronously) sent the `connect` message.

With this diff, we send the `disconnect` message synchronously with calling `close()` on the debugger socket, which fixes the ordering problem at the source. To avoid sending duplicate `disconnect` messages (e.g. one before calling `close()` and one from the `close` event handler), we store some extra state on `Device` (`#connectedPageIds`).

Reviewed By: robhogan, huntie

Differential Revision: D58730634

fbshipit-source-id: 0f54af2e4f8071a8f6d97cc9e3d8a4ea89a46f43
2024-06-18 09:39:35 -07:00
Moti Zilberman 9cca4c1ec1 Add test for connecting multiple debuggers to a single page, reproing "zombie" state (#45034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45034

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D58728261

fbshipit-source-id: 32d4b05d69f88e68b5327dc5c8e837291e3d7726
2024-06-18 09:39:35 -07:00
Moti Zilberman 6695b6e3b8 Reuse Device instances when handing off connections based on device ID (#45027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45027

Changelog: [Internal]

Changes the device ID collision handling logic to reuse `Device` instances instead of creating new ones. This enables further refactoring of `Device` to improve session state isolation.

Reviewed By: hoxyq

Differential Revision: D58724884

fbshipit-source-id: bc11ce45ce8c80c58c32dcd1b07b28f1d1753a62
2024-06-18 09:39:35 -07:00
Riccardo Cipolleschi 4ecc165029 remove publishing jobs from cci (#45040)
Summary:
We are moving to publish from gha so we need to remove these jobs

## Changelog:

[Internal] - Remove old publishing jobs from CI

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

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D58734881

Pulled By: cipolleschi

fbshipit-source-id: 5981bfcf2aa51d55d54d08556631b30b6102a7cd
2024-06-18 09:20:30 -07:00
Nicola Corti a272e8ee66 Remove unused rn-tester e2e tests (#45032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45032

Those tests haven't been running since ~1 year now.
I know it's not ideal but I'd rather remove them instead of keeping them around not executing.
We can still revert them back from the history once we decide to revive the E2E testing effort.

Changelog:
[Internal] [Changed] - Remove unused rn-tester e2e tests

Reviewed By: cipolleschi

Differential Revision: D58729123

fbshipit-source-id: f0f47e3c2e087141fdff506b7c5c9b460263721b
2024-06-18 09:06:42 -07:00
Hailey cdab5370af fix (iOS): fix selectTextOnFocus in Fabric and non-Fabric by calling selectAll after becomeFirstResponder (#44307)
Summary:
Fixes https://github.com/facebook/react-native/issues/41988

Hopefully even if this isn't the right way to go about solving this, it at least points in the right direction for a different fix!

Currently - both on Paper and Fabric - the `selectTextOnFocus` prop does not work as expected on a single line text input. It seems that if the `UITextField` has not yet become the first responder, the text will be briefly selected but then deselected immediately afterward.

This can be seen in the tester when running for either Fabric or Paper (video using Fabric)

https://github.com/facebook/react-native/assets/153161762/aa9c609e-6eb8-4177-a41f-32aae53c06ac

Instead, we can move the `selectAll` call to `reactFocus` in `RCTBaseTextInputView` or `focus` `RCTTextInputComponentView` - both of which first call `becomeFirstResponder` - to get the expected result.

## Changelog:

[IOS] [FIXED] - fix selectTextOnFocus in Fabric and non-Fabric by calling selectAll after becomeFirstResponder

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

Test Plan:
* Test changes on RN Tester (iOS)

 https://pxl.cl/55kDc

Reviewed By: cipolleschi

Differential Revision: D56699773

Pulled By: fabriziocucci

fbshipit-source-id: ed092835f3c602e2c50a4198357653a9cef942d9
2024-06-18 08:44:09 -07:00
Moti Zilberman db2c44a7eb Make inspector-proxy protocol types mutable by default (#45021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45021

Changelog: [Internal]

TSIA, hoisted from an upcoming refactor of `Device` in inspector-proxy.

Reviewed By: hoxyq

Differential Revision: D58723496

fbshipit-source-id: af272b08bc280d681bd7e1adb60d2a411a549864
2024-06-18 08:25:32 -07:00
Blake Friedman 64d5de7371 Add Android Helloworld test on PR (#45019)
Summary:
Use GHA on PRs:
1. run test_android_helloworld when users create a PR, to provide coverage while we figure out what's going on with our CircleCI tests / deprecate them.

2. fixes uploading the `.apks` that are generated.

Changelog: [Internal]

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

Test Plan: Does GHA run for this PR?

Reviewed By: cipolleschi

Differential Revision: D58728019

Pulled By: blakef

fbshipit-source-id: c6db41d60225702d50343384f103585d83e3528c
2024-06-18 06:54:31 -07:00
Jakub Piasecki 01f7ab814f Fix text baseline being moved up on iOS (#44932)
Summary:
Fixes https://github.com/facebook/react-native/issues/44929

Moves calling `RCTApplyBaselineOffset` so it's called in similar way as on the old architecture: https://github.com/facebook/react-native/blob/726a4a1e5ef3bc8034a068145da2bb94ae3acfaa/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm#L229

https://github.com/facebook/react-native/blob/726a4a1e5ef3bc8034a068145da2bb94ae3acfaa/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm#L165-L167

I'm not exactly sure why (and Apple's docs aren't helping) but it looks like calling `NSTextStorage initWithAttributedString` results in an attributed string where emojis are separate fragments with Apple's emoji font set, which results in the correct baseline calculations. This is the way it happens on the old arch.

The way it's currently implemented on the new architecture, `RCTApplyBaselineOffset` is called on ` newly created attributed string where emojis are in the same fragment as other parts of the text which alters the result of baseline calculations compared to what's later drawn on the screen.

## Changelog:

[IOS] [FIXED] - Fixed text baseline being moved upwards in certain cases

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

Test Plan:
<details>
<summary>Check the following snipped</summary>

```jsx
import React from 'react';
import {
  Text,
  View,
} from 'react-native';

const App = () => {
  return (
    <View style={{
      paddingTop: 100,
    }}>
        <Text style={{fontSize: 15, lineHeight: 20, fontFamily: 'Arial', backgroundColor: 'gray'}}>A 😞😞😞 B</Text>
    </View>
  );
};

export default App;

```

</details>

|Before|After|
|-|-|
|<img width="546" alt="new-broken" src="https://github.com/facebook/react-native/assets/21055725/cc0a3841-beb5-4afc-8abf-1124312fa6e0">|<img width="546" alt="new-fixed" src="https://github.com/facebook/react-native/assets/21055725/0ec2f6f1-3c62-4537-9a75-6abb840633f7">|

Reviewed By: cipolleschi

Differential Revision: D58589249

Pulled By: sammy-SC

fbshipit-source-id: 1e0a730519a5c79ff8a35b0dfb16b68966a8dd9f
2024-06-18 05:28:21 -07:00
Nicola Corti 37d7ec6522 Move test_android_helloworld to 4-core-ubuntu (#45023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45023

This mirrors the same setup we have on the 0.75 release branch

Changelog:
[Internal] [Changed] - Move test_android_helloworld to 4-core-ubuntu

Reviewed By: cipolleschi, blakef

Differential Revision: D58724157

fbshipit-source-id: 754d4f777d4239eeaa6a5232508f54cfe62d4c88
2024-06-18 05:25:22 -07:00
Rubén Norte 404f323359 Set up experiment to fix the mapping of event priorities between Fabric and React (#45013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45013

Changelog: [internal]

## Context

We recently realized that in the majority of events dispatched to React from Fabric, passive effects were being mounted synchronously, blocking paint instead of in a separate task after paint.

The reason for that is that in React, passive effects for discrete events are mounted synchronously by design (see https://github.com/reactwg/react-18/discussions/128), and Fabric is currently assigning the discrete event priority to most current events (including things like layout events).

## Changes

This creates a feature flag to opt into a more granular control over event priorities in React Native. Instead of assigning the discrete event priority to events by default, this would assign the "default" event priority by default, except for events dispatched during continuous events that would also be considered continuous.

This would also fix the priority for continuous events, that it was currently being assigned as "default" incorrectly.

Reviewed By: christophpurrer, javache, sammy-SC

Differential Revision: D58677191

fbshipit-source-id: c65a8dc2118ed028e1e895adec54f9072b7e55a6
2024-06-18 05:24:57 -07:00
Moti Zilberman 43d69ee26c Fix ReactNativeReloads test case (#45011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45011

Changelog: [Internal]

Fixes an inspector-proxy test case that was (silently) incorrect. This is in preparation for an upcoming rewrite of the core of inspector-proxy to more strictly isolate session state, which causes the incorrect test to fail.

Reviewed By: hoxyq

Differential Revision: D58193527

fbshipit-source-id: bdc27179210117ca9249b272f2e4aff19ba8a06c
2024-06-18 02:53:18 -07:00
Josh Katz 5df5ed1a88 Revert D58602799: Add unit tests for BorderRadiusStyle
Differential Revision:
D58602799

Original commit changeset: 605bc384267d

Original Phabricator Diff: D58602799

fbshipit-source-id: e843aa25f0cb37344a423e886b4e4a2878d89eec
2024-06-17 16:41:33 -07:00
Blake Friedman 07abfceae1 remove the template from react-native package (#45008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45008

As part of RFC0759, we are moving the template into it's own repository.

## Useful Links:
- [Section in RFC0759](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#evolving-the-react-native-community-template--cli)
- [Template's new home](https://github.com/react-native-community/template)
- [Versioning discussion](https://github.com/react-native-community/cli/issues/2345)

Changelog: [General][Breaking] removed the template from react-native into react-native-community/template

Reviewed By: cortinico

Differential Revision: D58184276

fbshipit-source-id: 5e52320af55495488587accbe144d11164cea4fd
2024-06-17 15:48:09 -07:00
Blake Friedman bc1735f014 test_android_template → test_android_helloworld but disabled until template is removed (#44908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44908

Changelog: [General] [Changed] - CircleCI test to Helloworld, but disabled for now until we remove the template

Reviewed By: cipolleschi

Differential Revision: D58469912

fbshipit-source-id: 718a774946bd70347697f18bbfc470b2897d2f87
2024-06-17 15:11:08 -07:00
Pieter Vanderwerff 36a04055d8 Create TextOptimized component to performance test changes to Text (#44962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44962

Add a short term fork of `Text` for the purpose of performance testing.

Specific differences from `Text`:
 - Lazy init Pressability via a nested component.
 - Skip children context wrapper when safe.
 - Move props destructuring to function param.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D58601810

fbshipit-source-id: 988bac6100287705fb1bf8dc48cb2cfae56343df
2024-06-17 12:11:45 -07:00
Jorge Cabiedes Acosta 8c7c6f35e3 Add unit tests for BorderRadiusStyle (#44964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44964

Testing property priority and correct setting percentages for business logic of `BorderRadiusStyle.kt`

To prevent issues like the one fixed by D57473482

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58602799

fbshipit-source-id: 605bc384267d9f4ae5a051e76c1a4d862fe54039
2024-06-17 12:09:00 -07:00
Alan Lee 4792671e4d extract ParsedError handling to helper (#44922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44922

extract ParsedError handling code into `StackTraceHelperTest`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58512611

fbshipit-source-id: 959978d80907f2afba96ef249c2fddd351d099ff
2024-06-17 10:39:22 -07:00
Alan Lee fe7e7a015f add default early JS error handler (#44884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44884

Removing JavaScript error handler supplied to ReactHostImpl.java which is just a stub and creating a default handler in ReactInstance.java which uses NativeExceptionHandler TurboModule to handle error.

Changelog: [Android][BREAKING]  Removing `ReactJsExceptionHandler` param from ReactHostImpl() constructor and providing a default private implementation

Reviewed By: javache, cortinico

Differential Revision: D58385767

fbshipit-source-id: 46548677df936b7c2f584084a2c9769c27e6a963
2024-06-17 10:39:22 -07:00
Moti Zilberman 4c6bff01b3 Fix bug in device ID collision handling, add tests (#45010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45010

D46482492 added logic for handing off state across "device" connections that have the same ID. This logic currently has no test coverage. It also contains a bug whereby the new device's pages are removed from the target listing endpoint (`/json`) when the *old* device's socket is closed.

This diff adds tests and fixes the bug.

Changelog: [General][Fixed] inspector-proxy no longer accidentally detaches connected devices.

## Next steps

It seems that the device ID handoff logic exists to paper over a deeper problem with the inspector proxy protocol (or its implementation in React Native): The React Native runtime should not routinely be creating new "device" connections without tearing down previous ones.

In followup diffs, I'll explore changing this behaviour for Fusebox, based on the new test coverage.

Reviewed By: robhogan

Differential Revision: D51013056

fbshipit-source-id: e0c17678cc747366a3b75cef18ca2a722fc93acd
2024-06-17 09:56:14 -07:00
Blake Friedman 9491deda7a disable run-ci-e2e-tests which depend on template (#45009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45009

This script dependes on the template existing in react-native/template. We're removing this, but can't land that until we disable this test.

Future work could move this test into the react-native-community/template project to validate against RN release candidates to support releases.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D58672744

fbshipit-source-id: c1500aebb0b21afd1ba37785e73dd6a0e1d6020e
2024-06-17 08:02:27 -07:00
Riccardo Cipolleschi 16380aa167 Fix tests for React 19 (#45007)
Summary:
Qhile landing the changes for React19 in 0.75, we missed one test that needs to be updated

## Changelog:
[Internal] - Fix Jest tests in React 19

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

Test Plan: CircleCI is green

Reviewed By: robhogan

Differential Revision: D58671824

Pulled By: cipolleschi

fbshipit-source-id: 48a72f5cdc4d03201cb1778915ed3519759cf017
2024-06-17 07:47:15 -07:00
Samuel Susla a6b862d427 clean up systrace for systrace View preallocation (#44956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44956

changelog: [internal]

do not show systrace logs for flattened views.

Reviewed By: rubennorte

Differential Revision: D58587946

fbshipit-source-id: 6ef12feb352b9c79db6b91767c2d77906bba9cdc
2024-06-17 06:51:24 -07:00
Blake Friedman 6f7eae5c58 fix disk utilisation step in GHA (#45006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45006

The steps were pointing to an incorrect folder.  Updated to points to react-native/packages

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58669426

fbshipit-source-id: b58b9bc7d8c7860f2f46c8bdf4bf0636e82ee357
2024-06-17 06:18:18 -07:00
Afonso 0950916846 Fix custom port listening configuration through metro.config.js (#44957)
Summary:
After updating my project to 0.73.2 I noticed that even though I had a specific port set in my `metro.config.js`, every time I'd start my project, it was running on port 8081. Passing the `--port` argument would allow me to change the port, but the config from metro did not.  I checked if the metro config was being properly applied, using `--verbose` and it was.

So I dug a bit, trying to figure out what had changed and noticed the coalescing of the value, whenever the argument `--port` is not present. That seemed odd since it meant that there's always a port defined for the `options` of `loadMetroConfig`, which would always be used in the `loadConfig` step.

To confirm I was on the right track I went to the [cli-plugin-metro](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro) repo, to the last release before the move here, and noticed that there was [no coalescing in the same method](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro/src/commands/start/runServer.ts#L60).

In this PR, I remove the coalescing of the port from `runServer.js` from the `community-cli-plugin`, to allow the port configuration through `metro.config.js`.

## Changelog:
[INTERNAL] [FIXED] - Fix server port configuration via `metro.config.js`
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

Test Plan:
Running `yarn start` and verifying that:
- it would listen to port `8081` if no argument nor a custom port was set in `metro.config.js`
- it would listen to port `8082` if that one was defined in `metro.config.js`
- it would listend to port `8083` if that port was passed as an argument to the command (i.e. `yarn start --port 8083` even though port 8082 was defined in `metro.config.js`

Reviewed By: cortinico

Differential Revision: D58605152

Pulled By: robhogan

fbshipit-source-id: 9cf7a8b6a0d9de3af1ca4092906b4c648acee373
2024-06-17 05:52:16 -07:00
Blake Friedman fa8ea481f0 Add more disk visibility on GHA Android builds (#45005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45005

We've had failures owing to running out of disk space, however this isn't a stable failure.  Adding more data about disk availability and utilisation to help debug these issues.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58667190

fbshipit-source-id: 3d5f7cc985ac71044818f7b5663ef7400ad691b5
2024-06-17 04:30:47 -07:00
Robert Pasiński abfadc6083 feat: Implement requestIdleCallback (#44636) (#44759)
Summary:
Implements `requestIdleCallback` and `cancelIdleCallback`

### Notes

Proposed implementation does yet cover all WHATWG eventloop requirements.
 - Deadline computation is not implemented and is polyfilled by giving each callback `50ms`, rather than it being shared between other idle callbacks.
 - The requested callbacks are called with lowest priority by the scheduler as of now, but the execution is not as described in the standard.

## Changelog:

- [GENERAL] [ADDED] - Implemented `requestIdleCallback` and `cancelIdleCallback`

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

Reviewed By: javache, sammy-SC

Differential Revision: D58415077

Pulled By: rubennorte

fbshipit-source-id: 46189d4e3ca1d353fa6059a904d677c28c61b604
2024-06-17 04:22:43 -07:00
Jakub Piasecki 9922628032 Allow for setting accessibility label on text (#45003)
Summary:
Closes https://github.com/facebook/react-native/issues/43648.

`accessibilityLabel` is overridden on `RCTParagraphComponentView`: https://github.com/facebook/react-native/blob/fe06cbfbf332a999e065bdc13ef5cdeed20c5517/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm#L157-L160

Effectively making it ignore whatever is set in the prop on the component. This PR updates the overridden method to check if the prop is set (and return that if it is) before returning the text as a label.

## Changelog:

[IOS] [FIXED] - Fix the accessibility label not being applied to text components on the new architecture

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

Test Plan:
Tried out on the reproduced from the issue.

|Text with label set|Text with no label set|
|-|-|
|<img width="982" alt="Screenshot 2024-06-17 at 08 33 58" src="https://github.com/facebook/react-native/assets/21055725/646014b3-5e9e-4023-8fe7-6dd65f04b217">|<img width="982" alt="Screenshot 2024-06-17 at 08 34 12" src="https://github.com/facebook/react-native/assets/21055725/2d712ced-ab78-4f8d-b482-b30df53ca949">|

Reviewed By: javache

Differential Revision: D58664380

Pulled By: cipolleschi

fbshipit-source-id: 88b45ca859283e16472630675b66a12732be6388
2024-06-17 03:12:23 -07:00
Tim Yung 97f9e101bf RN: Update Renderers for React 19 (#44991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44991

Updates the open source renderers for React 19. This is in preparation for React Native 0.75.

Notable, this incorporates the feature flag changes from [facebook/react#29903](https://github.com/facebook/react/pull/29903).

Changelog:
[General][Changed] - Upgrade Renderers for React 19

Reviewed By: robhogan

Differential Revision: D58632199

fbshipit-source-id: 674bb47554e4b0c6ab5127fb9683ed8284b7a4ce
2024-06-17 02:59:55 -07:00
Tim Yung 0dd8224a71 RN/Relay: Bump Dependency to React 19 (#44990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44990

Upgrades React Native and Relay to depend on React 19, which is currently published as release candidates. This is in preparation for React Native 0.75.

This will depend on updating open source renderers after [facebook/react#29903](https://github.com/facebook/react/pull/29903) is merged.

Changelog:
[General][Changed] - Upgrade to React 19

Reviewed By: robhogan

Differential Revision: D58625271

fbshipit-source-id: f9ad95b18716a9ce02f7cfbcc7248bdfb244c010
2024-06-17 02:59:55 -07:00
Tim Yung 5a8327857b RN: Configure Jest for React 19 (#44989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44989

Enables these 2 global feature flags for React Native Jest testing:

- `IS_REACT_ACT_ENVIRONMENT`
- `IS_REACT_NATIVE_TEST_ENVIRONMENT`

Changelog:
[General][Changed] - Enables React global flag that causes Jest testing environment to require `act()`

Reviewed By: robhogan

Differential Revision: D58644562

fbshipit-source-id: 4de5ea3a89e8ca99ac4c1c21721872db4f5552b3
2024-06-17 02:59:55 -07:00
Tim Yung 180dbbf0fb RN: Mitigate Remaining Jest Failures for React 19 (#45002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45002

There are a couple Jest unit test cases for `VirtualizedList-test.js` that require further investigation.

We believe that these are problems with Jest fake timers in the test and not with the component itself, so for now let's skip them so as to unblock the upgrade to React 19.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58656948

fbshipit-source-id: d52f3ad8277def6eae20cbbc11751d73b769d929
2024-06-17 02:59:55 -07:00
Tim Yung fe06cbfbf3 Add missing acts to VirtualizedList-test and migrate to async act (#44997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44997

Wrap `VirtualizedList-test` uses of `react-test-renderer` in `act` as appropriate, so as to pass under current React and mostly pass under React 19, with further fixes to come.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58649295

fbshipit-source-id: 5e0fa791d581fbf004a2ca7eaa5c4b4d9a15ddfe
2024-06-16 23:02:19 -07:00
Rob Hogan 8c06a69163 assetRelativePathInSnapshot-test: use act-wrapping abstraction for create
Summary:
Migrate assetRelativePathInSnapshot-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653908

fbshipit-source-id: 432b172348c445b1684e60cf60b6ab94d62f21e1
2024-06-16 21:38:01 -07:00
Rob Hogan 50e65d4828 FlatList-test: use act-wrapping abstraction for create
Summary:
Migrate FlatList-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653845

fbshipit-source-id: 426fcef454927cee0eb2c38ef16c82106354e5d9
2024-06-16 21:38:01 -07:00
Rob Hogan cf6df4392f TouchableWithoutFeedback-test: use act-wrapping abstraction for create
Summary:
Migrate TouchableWithoutFeedback-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653765

fbshipit-source-id: 901ea10ec5dd72f8403a84cfd9f9e8ed55dbe04c
2024-06-16 21:38:01 -07:00
Rob Hogan a6e4e3aad2 ReacNativeTestTools-test: use act-wrapping abstraction for create
Summary:
Migrate ReacNativeTestTools-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653724

fbshipit-source-id: bd33fcde6d620f6b5400a043b3ef944ddba7607e
2024-06-16 21:38:01 -07:00
Rob Hogan 6d836c5182 TouchableOpacity-test: use act-wrapping abstraction for create
Summary:
Migrate TouchableOpacity-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653673

fbshipit-source-id: 612ef12bca3011951297b5c17f1606e7cb7eebe7
2024-06-16 21:38:01 -07:00
Rob Hogan a66ba92526 VirtualizedSectionList-test: use act around react-test-renderer create
Summary:
Migrate `VirtualizedSectionList-test` to use `act`-wrapping in prepation for React 19.

Avoid the `react-native/jest/renderer` abstractions as this is a separate package.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653558

fbshipit-source-id: 0e19fff5c3998fb00b71c3d07100a2064682cb4c
2024-06-16 21:38:01 -07:00
Rob Hogan 102546bf04 AnimatedNative-test: use act-wrapping abstraction for create, update, unmount
Summary:
Migrate `AnimatedNative-test` to `act`-wrapping abstractions in preparation for React 19.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: yungsters

Differential Revision: D58653416

fbshipit-source-id: 320bb66b068b172dc3e90e006a58a3b6a0c74920
2024-06-16 21:38:01 -07:00
Rob Hogan 9af481d38b TextInput-test: use act-wrapping abstraction for create
Summary:
Migrate TextInput-test to act-wrapping abstractions for `react-test-renderer` `create`, in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653346

fbshipit-source-id: 3fe191cbb274b651e98e75c0059011943755a5bc
2024-06-16 21:38:01 -07:00
Rob Hogan 53c125ee6e Button-test: use act-wrapping abstraction for create
Summary:
Migrate `Button-test` to async, `act`-wrapping abstractions in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653259

fbshipit-source-id: 82e052e5ab328471d74b9f88b05bb887d89c247c
2024-06-16 21:38:01 -07:00
Rob Hogan 9381c6db25 Animated-test: use act around create, update and unmount
Summary:
Use `act`-wrapping abstractions for `create`/`update`/`unmount` in `Animated-test` so that it's React 19-ready.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653231

fbshipit-source-id: 44075dfde9740070279c0d1004674349d63de9cd
2024-06-16 21:38:01 -07:00
Rob Hogan c45896556a ReactNativeTestTools - wrap create in act
Summary:
Wrap `ReactTestRenderer.create` in `act` within `ReactNativeTestTools.expectRendersMatchingSnapshot`, as required for concurrent rendering and `IS_REACT_ACT_ENVIRONMENT` in React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653136

fbshipit-source-id: 9ca0d053bda3e87dd92b762061b839d7bdd571b5
2024-06-16 21:38:01 -07:00
Pieter Vanderwerff b56646fa08 Switch 'number of lines' validation to DEV only (#44961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44961

Switch the "number of lines" warning, which ensures this value is not negative, to only fire in DEV.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58472148

fbshipit-source-id: e52849effe9a6dc3f25288a64deebd4fd7624e4e
2024-06-16 20:30:52 -07:00