Compare 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 SuslaandFacebook GitHub Bot 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 AcostaandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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
HaileyandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 KatzandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 VanderwerffandFacebook GitHub Bot 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 AcostaandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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
AfonsoandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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ńskiandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 HoganandFacebook GitHub Bot 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 VanderwerffandFacebook GitHub Bot 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
Rob HoganandFacebook GitHub Bot 9435097b16 Migrate SectionList-test to async jest/renderer create abstraction (#44999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44999

Use `act`-wrapped abstraction for test rendering in preparation for this becoming mandatory.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58651098

fbshipit-source-id: d797c792b1f6ac155f02951a8264cf0631961d83
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot b24cf4f54c Introduce update and unmount helpers to react-native/jest/renderer, use in ScrollView-test (#44998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44998

Add async helpers to the existing `jest/renderer` module to wrap `react-test-renderer`'s `update` and `unmount` in `act`.

Migrate one test `ScrollView-test` as a usage example and to make it compatible with incoming React 19 concurrency requirements.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58650989

fbshipit-source-id: 5eb48722ee7a5487355969e553ba79c3ce361067
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot 132e2a305c Wrap jest/renderer create abstraction in act for concurrent rendering (#44994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44994

For RN monorepo tests, wrap `create` calls through our `jest/renderer` abstraction in `await act`.

This is a no-op under current React but will be required under `react-test-renderer@19` with `IS_REACT_ACT_ENVIRONMENT`.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58650940

fbshipit-source-id: 4013af89dd7c9f447b2dd493989f3a4fdf2b6508
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot 84866617de LogBoxInspector-test: Mock out symbolication (#44996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44996

Mock out some LogBoxData symbolication in LogBoxInspector-test that would otherwise make it sensitive to an async `useEffect` when wrapping in `act`.

This is immaterial to the snapshot under test (changing a state from `PENDING` to `NONE`).

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58651811

fbshipit-source-id: d47100a87d83102bbe183cb7266d66344e75b0b0
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot f094990450 Migrate StatusBar-test to jest/renderer create abstraction in preparation for React 19 (#44993)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44993

Use our existing thin abstraction around `react-test-renderer` `create` within `react-native/jest/renderer`, in order to benefit from the introduction of async `act` wrapping in that abstraction.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58650874

fbshipit-source-id: d3d1967fa68568e3ae2d8069478cb79aa7049ed0
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot 910e7133bc Asyncify ReactNativeTestTools.expectRendersMatchingSnapshot (#44992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44992

To allow for async `act` in a subsequent diff, make this utility method async and awaited at all call sites.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58647828

fbshipit-source-id: 3a47c57569814638c216309eed1885dd37521dde
2024-06-16 16:55:21 -07:00
Rob HoganandFacebook GitHub Bot 1e11257670 Make jest/renderer create helper async in prep for concurrent (#44995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44995

Use our existing abstraction around `react-test-renderer`'s `create` and make it asynchronous, to allow for wrapping `create` in `act` in a subsequent diff, and using the async API per guidance in https://react.dev/reference/react/act?#await-act-async-actfn .

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58647827

fbshipit-source-id: f81cf382892ef5ba14b452bd32980c98bd7ef03b
2024-06-16 16:55:21 -07:00
Tim YungandFacebook GitHub Bot ffc0640bf8 RN: Remove react-shallow-renderer Dependency (#44982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44982

Removes `react-shallow-renderer` dependency from the `react-native` package because it is no longer used.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643454

fbshipit-source-id: f9aa62af2ff0282d6b54b97da6f2870a38881947
2024-06-16 13:51:18 -07:00
Tim YungandFacebook GitHub Bot e8d235f6e2 RN: Delete Shallow Renderer Mock Tests (#44973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44973

Changes `expectRendersMatchingSnapshot` to no longer make assertions about shallow rendering, because shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643365

fbshipit-source-id: 03653045a44a176095c53fc0ff27743cc8ea1820
2024-06-16 13:51:18 -07:00
Tim YungandFacebook GitHub Bot 24295b521a RN: Delete jest/renderer Shallow Render Helpers (#44984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44984

Deletes the `jest/renderer` shallow render helpers.

The commit stack below this already migrated all references to `shallow` and `shallowRender`.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643063

fbshipit-source-id: fdf0012e06f3fb1326f3f99b78bf7a06d7f84a37
2024-06-16 13:51:18 -07:00
Tim YungandFacebook GitHub Bot 1c706cd03f RN: Delete Shallow Renderer Cases in ImageBackground-test.js (#44980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44980

These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643065

fbshipit-source-id: 34a31989f298535546a64c3ccd2888d648c1cdf1
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 19dc990aa1 RN: Delete Shallow Renderer Cases in Image-test.js (#44977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44977

These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643060

fbshipit-source-id: a61dfcf6cd778a8556aec874fd5e42f8e11f2be2
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 02dfbeaaeb RN: Delete Shallow Renderer Cases in Modal-test.js (#44970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44970

These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643058

fbshipit-source-id: 75c95b3ef8f9c481b50d90bf195ba3bd90196f0b
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 77b441249a RN: Delete Shallow Renderer Cases in InputAccessoryView-test.js (#44975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44975

These Jest unit test cases were making assertions about shallow rendering, but that shallow rendering is now deprecated.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643064

fbshipit-source-id: 19cb05df25b4b92ee584ea126d238276f5b214f7
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot f294bd8223 RN: Migrate LogBoxNotificationContainer-test.js from Shallow Renderer (#44981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44981

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643062

fbshipit-source-id: 6d7bba78945509bbb6bdab1e6347ba0d90343ec3
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 86a48c4118 RN: Migrate LogBoxNotification-test.js from Shallow Renderer (#44971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44971

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643068

fbshipit-source-id: f3a0331140fbaa9ee19b76da8700e60b3efc525a
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 81130f8b0f RN: Migrate LogBoxInspectorStackFrames-test.js from Shallow Renderer (#44976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44976

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643067

fbshipit-source-id: 2e298e2736227afb9322463daa3db0578638559a
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 96cbfb1e66 RN: Migrate LogBoxInspectorStackFrame-test.js from Shallow Renderer (#44969)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44969

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643057

fbshipit-source-id: 0d2943a714ca718841ab4bec5a33f6c9e48fea92
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 6dd9fa46ca RN: Migrate LogBoxInspectorSourceMapStatus-test.js from Shallow Renderer (#44986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44986

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643069

fbshipit-source-id: a2dbba104a7f6af57b6990da3cb0055a5390bc00
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot 8c0541cb12 RN: Migrate LogBoxInspectorSection-test.js from Shallow Renderer (#44983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44983

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643056

fbshipit-source-id: 61494765f68f1810b19a33f5e2a6c5d4087ce11c
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot a83d8d1590 RN: Migrate LogBoxInspectorReactFrames-test.js from Shallow Renderer (#44972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44972

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643055

fbshipit-source-id: 419fe07643f623e75050487beb9ca306417e43d9
2024-06-16 12:15:49 -07:00
Tim YungandFacebook GitHub Bot d75a28db62 RN: Migrate LogBoxInspectorHeader-test.js from Shallow Renderer (#44978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44978

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643059

fbshipit-source-id: 0eb36537fd3a8c69f4861fac14b99755eff97f04
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot c5acff86bd RN: Migrate LogBoxInspectorFooter-test.js from Shallow Renderer (#44968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44968

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643066

fbshipit-source-id: 216a036ef8e5cfe9b362c2f367da052ee6c9808b
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot ba2e4a57e8 RN: Migrate LogBoxInspectorCodeFrame-test.js from Shallow Renderer (#44979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44979

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58643061

fbshipit-source-id: 0c68324d4d92fc8818ac469737eda3679aa773b3
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot 7dd4811bea RN: Migrate LogBoxInspector-test.js from Shallow Renderer (#44974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44974

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58641098

fbshipit-source-id: be7592b3fb5c4a66879ad734439faceb4ad5cdde
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot e05cbd9912 RN: Migrate LogBoxButton-test.js from Shallow Renderer (#44987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44987

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58641097

fbshipit-source-id: a9d3abee19d58262d36ac250a55780df803c464b
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot 9eee99fd8c RN: Migrate LogBoxInspectorMessageHeader-test.js from Shallow Renderer (#44967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44967

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58641096

fbshipit-source-id: e9752f21763156ee409ae81a304cada84a346bdb
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot 00253a2efe RN: Migrate LogBoxInspectorContainer-test.js from Shallow Renderer (#44985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44985

Migrates this Jest unit test away from using `react-shallow-renderer` because it is no longer recommended.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58641095

fbshipit-source-id: 90563955876a148a2b867e0ec5128bdd8786f274
2024-06-16 10:30:39 -07:00
Tim YungandFacebook GitHub Bot 64e6721b23 Do not passthrough logbox errors that already have a component stack (#44888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44888

In https://github.com/facebook/react/pull/29839 we removed the `Warning: ` prefix. This PR replaces the special cases in LogBox for `Warning: ` to use the presence of a component stack instead. This is what LogBox really cares about anyway, since the reason to let errors pass through to the exception manager is to let DevTools add the component stacks.

Changelog: [General] [Fixed] - Fix logbox reporting for React errors

Reviewed By: rickhanlonii

Differential Revision: D58441017

fbshipit-source-id: 5355cd04ddcd5238dadbfcbd64fe1f43c8cd04dc
2024-06-15 19:24:03 -07:00
Ramanpreet NaraandFacebook GitHub Bot 2f8d4f0c25 Ensure redbox shows up after reloads fail (#44959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44959

If a react instance create fails, ReactHost [calls handleHostException](https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793%2C956-959%2C966%2C979-980%2C982%2C985-986). This method uses the dev support manager to show the redbox: line 789.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=784-793

But, if react instance reload fails, react host does everything in handleHostException, **except** call into dev support manager to show the redbox.

https://www.internalfb.com/code/fbsource/[bf94dae8c8b7527653145fdd799f6f47b1f8b284]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java?lines=457-466

Hence, the redbox doesn't show.

## Thoughts
These two code-paths do really similar things. I'm thinking about how to unify them.

Changelog: [Android][Fixed] Show RedBox after reloads fail (bridgeless)

Reviewed By: alanleedev

Differential Revision: D58592928

fbshipit-source-id: 37a7adc1845a8b28917fcd9acbaae1484478e4e6
2024-06-14 16:33:55 -07:00
Ramanpreet NaraandFacebook GitHub Bot ce2e4263bd Make soft exceptions easier to spot in logcat (#44958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44958

Now, all soft exception methods will have raiseSoftException(...)

## Before

```
BridgelessReact: ReactHost{0}.getOrCreateDestroyTask(): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```

## After
```
BridgelessReact: ReactHost{0}.raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D58593609

fbshipit-source-id: 171a872cd41e4ffe9c2e9654c563a6f3af342ad9
2024-06-14 16:32:34 -07:00
alicataandFacebook GitHub Bot 457d14bd1b Fix onprogress not firing when Content-Length is not available for XMLHttpRequest (#44899)
Summary:
When an XMLHttpRequest is performed, the `onprogress` event it is not invoked when the `Content-Length` header is missing in the response. This is the case when we are calling an endpoint that responds with `transfer-encoding: chunked` (https://tools.ietf.org/html/rfc9112#section-7.1), preventing the user to keep track of the progress while the server is sending chunks. Despite we will never know the total length of the content (because it will not be known due to the RFC specification, so it will be always `-1`), we will now be able to keep track of the loaded data.

Note that in Android, this is the current default behaviour.

To address this issue:
- I removed the condition where the `downloadProgressBlock` was dispatched only when  `response.expectedContentLength` was greater than 0
- I created a new test case for `XMLHttpRequest` in the tester app to download a chunked file

## Changelog:

[IOS] [CHANGED] - fire `onprogress` event for `XMLHttpRequest` even when the `Content-Length` header is missing in the response headers

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

Test Plan:
|before|after|
|----------|:-------------:|
|https://github.com/facebook/react-native/assets/37150312/6da3518f-eed3-4808-a2f8-abe26e5c7487|https://github.com/facebook/react-native/assets/37150312/ed1da300-dcf7-4874-a941-a2289f1cb777

Reviewed By: cortinico

Differential Revision: D58562088

Pulled By: NickGerleman

fbshipit-source-id: 23a1cafa49ddcd25fa0db7d04fae845126771425
2024-06-14 13:58:14 -07:00
zhongwuzwandFacebook GitHub Bot 9d637e4622 Fixes NSDataBigString length calculation (#44900)
Summary:
We assume data[length] is '\0', like Android https://github.com/facebook/react-native/blob/33aa83a0e6f63d3d50d4803074ad9e2243439100/packages/react-native/ReactCommon/cxxreact/JSBigString.h#L81. So we should minus 1 after we called `ensureNullTerminated`. it may crash in hermes engine because hermes should ensure data[length] is `\0`.

## Changelog:

[IOS] [FIXED] - Fixes NSDataBigString length calculation

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

Test Plan:
We can mimic the crash by changes some code :
![image](https://github.com/facebook/react-native/assets/5061845/cc65f232-c37c-452c-bf0d-aeb71b7b2950)

Reviewed By: javache

Differential Revision: D58561775

Pulled By: NickGerleman

fbshipit-source-id: 0f7879a028b84379f4f00c65bcfc6b1a7d66814a
2024-06-14 13:55:58 -07:00
Nicola CortiandFacebook GitHub Bot 2b640bec34 Fix for broken test_helloworld_android on Release (#44952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44952

The test_helloworld_android Release variant are broken on GHA.
This fixes it as it forces hermesc to be built *before* the app attempts to create a bundle.

Changelog:
[Internal] [Changed] - Fix for broken test_helloworld_android on Release

Reviewed By: cipolleschi, blakef

Differential Revision: D58591480

fbshipit-source-id: 2afc1cfe8c416da6f5919d20098639653798dd1a
2024-06-14 11:11:20 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f1a362d834 Update the testing-script to use github actions (#44923)
Summary:
With the migration to GHA, we are updating the testing scripts to work with the new CI.

There are a bit of shenanigans due to:
* How GHA archives artifacts => they are all `.zip` files, so I had to play around with unzipping them
* GHA seems to create a different commit, like if it is forking the repo instead of using it. I think that it is how the checkout action works. *Note:* this might be a problem for the `Create React Native Release` workflow because it has to commit on the stable branch!
* Android is building only the simulator architecture when running from regular CI. The app is not configured to run only on that, so the RNTestProject was a failing because it was trying to build all the available architectures. It is an easy fix in the user project space when release testing.

## Changelog:
[Internal] - Update the testing script to work with the new CI

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

Test Plan:
Tested locally.

* [iOS] RNTester - Hermes 
* [iOS] RNTester - JSC 
* [Android] RNTester - Hermes 
* [Android] RNTester - JSC 
* [iOS] RNTestProject - Hermes   (The project is created correctly and it builds, crash at runtime for https://github.com/facebook/react-native/issues/44926)
* [iOS] RNTestProject - JSC  (The project is created correctly and it builds, crash at runtime for https://github.com/facebook/react-native/issues/44926)
* [Android] RNTester - Hermes  (Needed to build only the simulator architecture)
* [Android] RNTester - JSC  (Needed to build only the simulator architecture)

Reviewed By: andrewdacenko

Differential Revision: D58528432

Pulled By: cipolleschi

fbshipit-source-id: 733065de4c532b13d8e95e2217f9aafd5a2ef8a0
2024-06-14 10:56:52 -07:00
Ruslan LesiutinandFacebook GitHub Bot 09bdbace95 refactor[LogBox]: filter out ANSI color styles (#44924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44924

# Changelog: [Internal]

For Strict Mode, RDT backend will apply ANSI escape codes to style the message, basically to dim it for 2-nd invocations of logs / warnings / errors in Strict Mode.

With these changes, LogBox will filter out these stylings, so that the message is displayed correctly in the LogBox bubble and in LogBox panel (full screen mode).

Reviewed By: rickhanlonii, yungsters

Differential Revision: D58477316

fbshipit-source-id: 17773f658d2a3bfa7f6a3ccec9fc88a97dd2c0af
2024-06-14 10:42:12 -07:00
Christoph PurrerandFacebook GitHub Bot 810a516475 Call Turbo Module methods 'methods' in the Turbo Module JSON schema (#44919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44919

## Changelog:

[Internal] [Fixed] - Call Turbo Module methods 'methods' in the Turbo Module JSON schema

We don't support `properties` on Turbo Modules. We only support methods (even eventEmitters are just methods)

Reviewed By: javache

Differential Revision: D58510557

fbshipit-source-id: 02b1dc93a37b58b47bb9fd94a9658b5a7301bf55
2024-06-14 10:36:31 -07:00
Wojciech LewickiandFacebook GitHub Bot 358fe46969 fix: make it possible to add multiple mountingOverrideDelegates (#44927)
Summary:
PR changing the single mountingOverrideDelegate to a vector of those, so other listeners can operate on the transaction. Used by `react-native-screens` in https://github.com/software-mansion/react-native-screens/pull/2134 and `react-native-reanimated` in https://github.com/software-mansion/react-native-reanimated/pull/6055.

Till now, only one listener could be added there, meaning that e.g. `Layout Animations` from `react-native`,  `Layout Animations` from `react-native-reanimated` and listening for `Screen` removal in `react-native-screens` could not operate at the same time.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Message

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

[GENERAL] [FIXED] - Add option for multiple `mountingOverrideDelegates`

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

Test Plan: The code of `LayoutAnimations` inside `react-native` should work the same since it will add just one listener then. For other cases, different libraries can read/mutate transactions.

Reviewed By: javache

Differential Revision: D58530278

Pulled By: sammy-SC

fbshipit-source-id: d6305963621000be11d51a50cffff64526cca934
2024-06-14 10:22:32 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9093f6f9c1 Move to M1 machines (#44944)
Summary:
CircleCI is removing support for intel machines at the end of June, hence we have to migrate to M1.

## Changelog:
[Internal] - Migrate to M1

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

Test Plan: CircleCI is green

Reviewed By: robhogan

Differential Revision: D58589100

Pulled By: cipolleschi

fbshipit-source-id: da7359d8c13093ef1595adc5fabb4f3628006c7a
2024-06-14 10:17:33 -07:00
Nicola CortiandFacebook GitHub Bot 19f6aec4a1 AGP to 8.5.0 (#44951)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44951

As the latest minor of AGP just released, let's bump it so that 0.75 users can use it.

Changelog:
[Android] [Changed] - AGP to 8.5.0

Reviewed By: cipolleschi

Differential Revision: D58587826

fbshipit-source-id: c14091faba1cb270ea2386f22fdbf079bce61421
2024-06-14 09:48:30 -07:00
Nicola CortiandFacebook GitHub Bot 9c7c955834 Add package.json to default lockFiles for ReactSettingsExtension (#44948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44948

This is a small improvement suggested by tido64 to also account for package.json when computing caching
for autolinking of libraries.

Changelog:
[Internal] [Changed] - Add package.json to default `lockFiles` for ReactSettingsExtension

Reviewed By: cipolleschi

Differential Revision: D58587739

fbshipit-source-id: 6e0acf7d4badd8d8cc25dd90bb55fd6c0fa3779b
2024-06-14 09:33:45 -07:00
Ramanpreet NaraandFacebook GitHub Bot e78742a9d8 Allow native module loads during react instance init
Summary:
## Context
Right now, the ReactInstance construtor eagerly initializes native modules.

## Problem
When these modules initialize, they may load other modules. But, all those loads will fail, because the react instance is in the process of being constructed.

## Changes
Eagerly initialize modules after the react instance is created. That way, these native module requires work.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58537536

fbshipit-source-id: d0e424df708ec35b014f5cecda11e8756e8f4346
2024-06-14 09:17:32 -07:00
Ramanpreet NaraandFacebook GitHub Bot 74d030de70 Attach react instance to react host immediately
Summary:
## Changes
1. Store the react instance inside a private property (vs in the mReactInstanceTaskRef)
2. Attach the react instance to that property immediatley, after create

## Problems resolved
1. React host apis that use the instance (like ReactContext.getNativeModule()) will now also work **during** react native init. (see T191972567).
2. If exceptions get thrown during react instance init, the react instance will now get cleaned up (see test plan).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58537535

fbshipit-source-id: fddf44d45b214b52a950e33d67ac6612a50ddcba
2024-06-14 09:17:32 -07:00
Blake FriedmanandFacebook GitHub Bot 2e2b71eeab replace test_android_template with test_android_helloworld (#44905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44905

Replaces the last template CI job.

Changelog: [Internal] [Changed] Use Helloworld in GHA CI workflow.

Reviewed By: cortinico

Differential Revision: D58466813

fbshipit-source-id: 333b9a4c71eec6901c78f144db48f365539c6a5a
2024-06-14 08:08:26 -07:00
Blake FriedmanandFacebook GitHub Bot 7061649c03 Fixes for release builds (#44943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44943

Release builds require more configuration.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58529721

fbshipit-source-id: ca78ab530a459e6b9ec4595d22c1aecc66bc9dc0
2024-06-14 06:10:52 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c7d3220f4d Properly export the hermes tarball path to reuse it in RNTester (#44931)
Summary:
While working on GHA, I realized that RNTester is not reusing the hermes package we create in the previous steps.

This change should fix that, saving ~5 minute per RNTester test as it does not have to rebuild hermes every time.

## Changelog:
[Internal] - Improve CI to reuse hermes tarballs

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

Test Plan:
| Before | After |
| --- | --- |
| <img width="847" alt="Screenshot 2024-06-13 at 16 02 32" src="https://github.com/facebook/react-native/assets/11162307/099fd2d4-0954-4e64-baf0-6322e02d57bb"> | <img width="1203" alt="Screenshot 2024-06-13 at 16 34 20" src="https://github.com/facebook/react-native/assets/11162307/f8b9f9b6-0bd3-4ea4-8acd-3a4c1bffbc88"> |

Reviewed By: cortinico

Differential Revision: D58530335

Pulled By: cipolleschi

fbshipit-source-id: e711ae8affd78a4da4b64e6092cfffafd40589e5
2024-06-14 04:42:15 -07:00
Ruslan LesiutinandFacebook GitHub Bot 7bd98eecd0 Add test showcasing memory leak in RemoteObjectsTable in Hermes (#44936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44936

# Changelog: [Internal]

Added a small test that uses `folly:ManualExecutor`, which reproduces the memory leak issue in Hermes' RemoteObjectsTable:
1. Send `Runtime.enable`
2. Evaluate `console.log(<object>);` to populate `RemoteObjectsTable`
3. Send `Page.reload` to reload VM

This test is expected to fail, because by the time it is published, the D58398254 hasn't landed.

Reviewed By: motiz88

Differential Revision: D58531763

fbshipit-source-id: 99af3bfce0a31fe905d5bf2bf433f62cfbc34897
2024-06-14 04:05:10 -07:00
Alex Taylor (alta)andFacebook GitHub Bot 6584b408fb Deploy 0.238.0 to xplat (#44941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44941

Changelog: [Internal]

Reviewed By: cyan33

Differential Revision: D58565114

fbshipit-source-id: ba6cba0445327ff7ff57505dbb498f2b5d8d5fe7
2024-06-14 02:19:11 -07:00
Charles DudleyandFacebook GitHub Bot 8b53d41a88 Update RN Share.share()'s argument types to be more explicit (#44887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44887

The previous inexact object types and documentation for Share.share()'s arguments have led to confusion in how this library should be used. This diff updates the argument types to be more explicit, and rewrites some of the documentation for clarity.

Changelog:
[General][Breaking] Update `Share.share()`'s argument types to be more explicit.

Reviewed By: NickGerleman

Differential Revision: D58224906

fbshipit-source-id: 5ac8efe7caa0ecdd430fa7a1951c73c4acd8c6a1
2024-06-13 14:55:27 -07:00
Richard HowellandFacebook GitHub Bot 261f7b9f11 make yogaApple modular (#44938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44938

Yoga is transitively included in Swift targets and needs to be modular.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58469454

fbshipit-source-id: 72bc6b5d3e5ee0710d9334a626e4e7297ce26b09
2024-06-13 14:18:45 -07:00
Rubén NorteandFacebook GitHub Bot 49a911fab4 Back out "Revert D58459930: [react-native][PR] Add ReactMarkerConstants.CONTENT_APPEARED support on Android"
Summary:
Changelog: [ANDROID] [ADDED] - Add the ReactMarkerConstants.CONTENT_APPEARED support on Android in bridgeless mode.

This re-applies https://github.com/facebook/react-native/pull/43620 which was reverted because a CI job started failing because we forgot to update `packages/react-native/ReactAndroid/api/ReactAndroid.api`.

Reviewed By: cortinico

Differential Revision: D58535868

fbshipit-source-id: 9eec33c5e798850a7434a6c391abf2fc3fc9d0a6
2024-06-13 12:49:25 -07:00
Moti ZilbermanandFacebook GitHub Bot be6eda8c98 Suppress LogBox for warnings if Fusebox console is available
Summary:
Changelog: [Internal]

Showing warnings in LogBox is noisy, confusing for web developers, and not the best use of screen real estate on mobile platforms. Since the Fusebox console offers a superior experience, as of this diff we'll suppress warnings in LogBox if we detect that Fusebox is available.

*The first time* a warning is suppressed, globally (i.e. at most once per app launch), we'll show a notification pointing the user towards Fusebox. When the notification is clicked, we call the `DevSettings.openDebugger` method and dismiss it.

The wording of the notification ("Open debugger to view warnings") is intentional:

1. It's short enough to fit on small screens in its entirety.
2. It doesn't actually say "*click here* to open the debugger". This is for the best because `DevSettings.openDebugger` is a best-effort method that might fail, and in the current implementation there's no reliable feedback to the user about the success/failure of the launch.

Reviewed By: huntie

Differential Revision: D57681446

fbshipit-source-id: fe6101785780de3bc586ade11f471f7c74707be1
2024-06-13 12:22:48 -07:00
Moti ZilbermanandFacebook GitHub Bot e3a76c5155 Expose DevSettings.openDebugger method to JS (#44934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44934

Resubmission of D57681447 with an updated `ReactAndroid.api`.

 ---

Changelog: [Internal]

Adds a private API that gives JS the ability to trigger the same "open debugger" action as in the Dev Menu. This is in preparation for changes to LogBox.

For simplicity, this method operates on a best-effort basis - i.e. it doesn't report the success or failure (or failure reason) of the launch.

Reviewed By: huntie

Differential Revision: D58529832

fbshipit-source-id: e5510f529a19e0149d8dce04fa610e6c2371cc79
2024-06-13 12:22:48 -07:00
Vitali ZaidmanandFacebook GitHub Bot dc460147bb Update debugger-frontend from 06a25f7...f7e972c (#44935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44935

Changelog: [Internal] - Update `react-native/debugger-frontend` from 06a25f7...f7e972c

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

Reviewed By: hoxyq

Differential Revision: D58531480

fbshipit-source-id: 72d6d56a6a0d2262fb0a9120276add25fd4c219a
2024-06-13 10:40:30 -07:00
Pieter VanderwerffandFacebook GitHub Bot a237e8da7a Destructure all overridden props (#44910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44910

Props within the `Text` component are accessed both via destructuring the props object but also in some cases by using a "dot" access on the destructured `restProps`. However in all of the "dot" access cases the property is being overrided. Which means in the final JSX these properties get set twice, e.g. via the `restProps` spread then overrrided by static properties. This change just destructures all values to avoid this inefficiency.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58446569

fbshipit-source-id: 12a800f5e2218a1d95d57cc689a4c79caab480b4
2024-06-13 10:14:56 -07:00
Alex HuntandFacebook GitHub Bot 1c6bf24cfb Fix default accessor for unstable_fuseboxEnabled (RNTester crash)
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58527490

fbshipit-source-id: 7974189ab2f4d4e7f38199d5e824611634cd4d7b
2024-06-13 08:28:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ece68f0efd Remove the trigger-react-native-release to use the GHA workflow_dispatch UI (#44898)
Summary:
This change removes the need for the trigger-react-native-release.js script.
Thanks to the migration to Github Actions, we can now leverage the GHA workflow UI to trigger a Prepare Release job that creates a github tag that will spin a new release.

The pro of this approach are:
- less code to maintain: instead of a complex trigger release scripts, we only have to maintain two very straightforward scripts for the CI
- easier to trigger a release: instead of running a script, we can now just use the GH UI

The `trigger-react-native-release` script was doing the following steps:
- check that we are in the release branch ==> Already implemented in the GHA workflow
- Gets the branch name (not needed) ==> the job will automatically run on the stable branch
- Check for unsent changes (not needed) ==> we are not in a local environment
- get the gh token (not needed) ==> You need to be logged in GH and have write access to the repo
- get the version ==> provided as a parameter
- fails if the tag is already there ==> Functionality added in the workflow
- Parse and validate the version ==> Functionality added to the action prepare-release action + the JS Script
- Compute the npmTag ==> Functionality added to the action prepare-release action + the JS Script
- trigger the release workflow ==> The GH UI does that for us

## Changelog:
[Internal] - Remove the trigger-react-native-release.js

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

Test Plan: Testing in Production!

Reviewed By: cortinico, huntie

Differential Revision: D58461470

Pulled By: cipolleschi

fbshipit-source-id: 32bb0ee91370c9483a29e2ca2e18e24557d5fd53
2024-06-13 08:19:58 -07:00
Sergei RybalkinandFacebook GitHub Bot 726a4a1e5e Revert D57681447: Expose DevSettings.openDebugger method to JS
Differential Revision:
D57681447

Original commit changeset: ddb1fbd0f1c8

Original Phabricator Diff: D57681447

fbshipit-source-id: 94bf94227bcc9fab8282bd68ddf3f4f1df64656b
2024-06-13 07:20:18 -07:00
Sergei RybalkinandFacebook GitHub Bot 7e0f894d3a Revert D58459930: Add ReactMarkerConstants.CONTENT_APPEARED support on Android
Differential Revision:
D58459930

Original commit changeset: 4498a3623c50

Original Phabricator Diff: D58459930

fbshipit-source-id: 8bc5ef3c8b1e42a4085ee6d2834bf6906c936c0d
2024-06-13 07:19:45 -07:00
Alfonso CurbeloandFacebook GitHub Bot 3cb03cb297 Add 0.72.15 to Changelog (#44904)
Summary:
Add 0.72.15 to Changelog

## Changelog:
[Internal] [Changed] - Generated changelog

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Reviewed By: cipolleschi

Differential Revision: D58470819

Pulled By: cortinico

fbshipit-source-id: 20a1816811213ed9a69f1ede3579aa8fc661faf2
2024-06-13 04:53:46 -07:00
Blake FriedmanandFacebook GitHub Bot b2e6a37e5b configure to build from source (#44920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44920

Configure helloworld to build from source, using a combination of our [How to Build from Source](https://reactnative.dev/contributing/how-to-build-from-source#update-your-project-to-build-from-source) guide, as well as using rn-tester's config as a guide.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58287748

fbshipit-source-id: 836b09416f4da4087fbdea4476d29cd226157914
2024-06-13 04:51:20 -07:00
Blake FriedmanandFacebook GitHub Bot 6970854a15 cli assemble support (#44903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44903

Call our wrapper to assemble an Android build of helloworld.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58287785

fbshipit-source-id: 15aa303008254780b3d1b625b392bdbe2869a19a
2024-06-13 04:51:20 -07:00
Blake FriedmanandFacebook GitHub Bot 20c89f6d83 point react gradle config to monorepo (#44901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44901

Point Gradle to the monorepo instead of a node_modules, as well as remove some commented out entries we're not interested in.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58287786

fbshipit-source-id: 92b3d15d05c55a2589bb8a6b75dc3d5d0f9756ff
2024-06-13 04:51:20 -07:00
Blake FriedmanandFacebook GitHub Bot 89f16da89e Fix cli assemble, build & install (#44902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44902

Add support for building (assembling) a React Native Android project.

Changelog: [General][Added] core-cli-utils Android support

Reviewed By: cortinico

Differential Revision: D58287783

fbshipit-source-id: 381909fd461902723d6046b82ea5a2047a99deab
2024-06-13 04:51:20 -07:00
Biki-dasandFacebook GitHub Bot 45ac64ee13 Fix:-fixed dark mode appearance for the a11y and action sheet examples in … (#44795)
Summary:
Fixes the `a11y` and actionSheet examples in the RN tester iOS app, where in dark mode, some text were not taking the appropriate color

**Before**

<img width="401" alt="Screenshot 2024-06-05 at 5 28 28 PM" src="https://github.com/facebook/react-native/assets/72331432/a17f2713-66e8-45bc-9923-baa328f40839">

<img width="401" alt="Screenshot 2024-06-05 at 5 28 37 PM" src="https://github.com/facebook/react-native/assets/72331432/4ca765a1-ebff-41e5-97ba-84f4d274f0c3">

**After**

<img width="401" alt="Screenshot 2024-06-05 at 5 29 56 PM" src="https://github.com/facebook/react-native/assets/72331432/c4f82d2c-4602-4165-abef-5620cbe45446">

<img width="401" alt="Screenshot 2024-06-05 at 5 30 08 PM" src="https://github.com/facebook/react-native/assets/72331432/973558dd-854c-4eb8-91d6-a288ba7b0561">

## Changelog:

N/A

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Fix RN tester Example appearance in dark mode for A11y and ActionSheet.

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

Test Plan: Tested using the RN tester app.

Reviewed By: NickGerleman

Differential Revision: D58469005

Pulled By: huntie

fbshipit-source-id: 05f991f1c3efae7ccfc90535aaa62d6075aad18e
2024-06-13 04:26:27 -07:00
Moti ZilbermanandFacebook GitHub Bot 1fb5a4b283 Expose DevSettings.openDebugger method to JS (#44647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44647

Changelog: [Internal]

Adds a private API that gives JS the ability to trigger the same "open debugger" action as in the Dev Menu. This is in preparation for changes to LogBox.

For simplicity, this method operates on a best-effort basis - i.e. it doesn't report the success or failure (or failure reason) of the launch.

Reviewed By: hoxyq

Differential Revision: D57681447

fbshipit-source-id: ddb1fbd0f1c8d07bfa57d65c54e3a34bb7a470a8
2024-06-13 04:01:25 -07:00
Kudo ChienandFacebook GitHub Bot 5da9fdf8f1 Add ReactMarkerConstants.CONTENT_APPEARED support on Android (#43620)
Summary:
Add the `ReactMarkerConstants.CONTENT_APPEARED` support on Android in bridgeless mode. This is an important marker for TTI measurement.

## Changelog:

[ANDROID] [ADDED] - Add the `ReactMarkerConstants.CONTENT_APPEARED` support on Android in bridgeless mode.

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

Test Plan:
adding this on RNTesterActivity to see if the log is executed

```kotlin
ReactMarker.addListener { name, tag, instanceKey ->
  if (name == ReactMarkerConstants.CONTENT_APPEARED) {
    Log.i("XXX", "XXX")
  }
}
```

Reviewed By: cortinico

Differential Revision: D58459930

Pulled By: rubennorte

fbshipit-source-id: 4498a3623c506d228aea995c8aeafdb51fcc5b96
2024-06-13 03:57:16 -07:00
Nicola CortiandFacebook GitHub Bot 1cb587c620 Do not publish Gradle Scans (#44925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44925

I have the suspect this is causing our builds to be slower and especially causing the template tests to take 6 hours.
Let's try to disable it.

Changelog:
[Internal] [Changed] - Do not publish Gradle Scans

Reviewed By: cipolleschi

Differential Revision: D58520463

fbshipit-source-id: 028e16a725ea87e178ed4e0bf134737f32780544
2024-06-13 03:41:39 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9fe9f032e6 Fix publish-release regex (#44921)
Summary:
The publish_release job is broken due to the initial regex. This change would like to fix it

## Changelog:
[Internal] - Fix publish_release job

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

Test Plan:
Test on PR

<img width="1028" alt="Screenshot 2024-06-13 at 08 51 59" src="https://github.com/facebook/react-native/assets/11162307/0f68be41-a820-454e-9aca-99b2178984cd">

Reviewed By: huntie

Differential Revision: D58513441

Pulled By: cipolleschi

fbshipit-source-id: 55d632e111c4057431c5c607330571af2848534e
2024-06-13 03:24:40 -07:00
Phillip PanandFacebook GitHub Bot b19bf2b6d7 ship shared module queue (#44916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44916

Changelog: [Internal]

reached ship decision last year, getting rid of the gating here

Reviewed By: javache

Differential Revision: D58476997

fbshipit-source-id: 0ad52d29ac79b1751d6f10e67dc6886bf88e5ba4
2024-06-12 21:13:38 -07:00
Pieter VanderwerffandFacebook GitHub Bot f7aea0c8e1 Fork onPress callbacks for ios highlighting (#44909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44909

Today we wrap all `onPressIn` and `onPressOut` callbacks we pass to pressability so we can set the `highlighted` state. However highlighted state is only ever set to anything other that false on iOS. This change not only skips calling `setHighlighted(false)` on every press event but also skips wrapping the callback.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58391419

fbshipit-source-id: e79f51469609a59063098501f015f8078e3db79f
2024-06-12 19:12:15 -07:00
Peter AbbondanzoandFacebook GitHub Bot 0ad107b988 Add Clipboard module to base packages (#44881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44881

Updates the companion object for `ClipboardModule` to re-export the generated parent's `NAME`.

Changelog: [Internal]

Differential Revision: D58426185

fbshipit-source-id: a60462a990003413f9b0c646a97026217a64b418
2024-06-12 17:06:27 -07:00
Jakub KosmydelandFacebook GitHub Bot 3753b7a0e7 Fix inverted flat list (#44168)
Summary:
This PR solves [this issue](https://github.com/facebook/react-native/issues/44151).
Inverted FlatList doesn't work (elements cannot be clicked) when the list is scrolled.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Fix clicking items on the inverted FlatList on the new architecture

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

Test Plan:
# Steps
1. `buck2 install catalyst-ios` or `buck2 install catalyst-android`
2. Go to `RNTester Browser - Fabric` -> `FlatList` -> `Inverted`
3. Toggle inverted to `true`
4. Scroll to the top
5. Tap down and drag to either left or right
6. Expected is to have Red highlighted (which indicate Press Down) when dragged.

## iOS
| Before | After |
|-----------------------|----------------------|
|  https://pxl.cl/53vCW  |  https://pxl.cl/53vDq |

## Android
| Before | After |
|-----------------------|----------------------|
|  https://pxl.cl/53vFp |  https://pxl.cl/53vFG |

## Reproducing steps from OSS

1. Use this reproducer: https://github.com/WoLewicki/reproducer-react-native/tree/%40wolewicki/flatlist-inverted
2. Apply changes from this PR & build the app.
3. Scroll a bit the list, so it changes the position.
4. The `onPress` should be fired when the button is clicked.
5. Do the following tests:
  1. Add a `horizontal` prop to the FlatList - verify everything works.
  2. Remove a `inverted` prop - verify everything works.
  3. Remove a `inverted` prop and add a `horizontal` prop - verify everything works.
6. Test different combinations of transforms of the FlatList, example:
```javascript
      <FlatList
        inverted
        horizontal
        style={{
          transform: [
            {scaleY: -1},
            {scaleY: -2},
            {scaleY: -0.5},
            {translateY: 20},
            {translateY: -10},
            {skewX: '10deg'},
            {rotateX: '10deg'},
          ],
        }}
      />
```

<details>

<summary>Reproducrer</summary>

https://github.com/facebook/react-native/assets/104823336/28cfe607-43e8-4f80-bbfb-59085ae0f986

</details>

<details>

<summary>RN tester</summary>

https://github.com/facebook/react-native/assets/104823336/e00cd488-d98f-4ece-9cab-b8a7212acb04

</details>

Reviewed By: arushikesarwani94

Differential Revision: D56441112

Pulled By: realsoelynn

fbshipit-source-id: 82c47f6bcc1f25cfbbd55aedf9652052bb86cf47
2024-06-12 16:18:23 -07:00
Blake FriedmanandFacebook GitHub Bot d54fd6219e disable on PRs (#44912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44912

While moving from CircleCI → GHA, we're removing this blocking folks landing PRs and just running on main.  We will re-enable once GHA is stable.

Changelog: [General][Changed] Disable GHA on PRs until it's stable

Reviewed By: NickGerleman

Differential Revision: D58478000

fbshipit-source-id: 053ee53455956bf19b6f9113cb796346359ad4ef
2024-06-12 14:41:25 -07:00
Peter AbbondanzoandFacebook GitHub Bot b6c3433537 Hybrid image aliasing (#44803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44803

This change introduces a new prop to the Android `Image` component: `resizeMultiplier`. This prop can be used when the `resizeMethod` is set to `resize`, and it directly modifies the resultant bitmap generated in memory from Fresco to be larger (or smaller) depending on the multiplier. A default of 1.0 means the bitmap size is designed to fit the destination dimensions. A multiplier greater than 1.0 will set the `ResizeOptions` provided to Fresco to be larger that the destination dimensions, and the resulting bitmap will be scaled from the hardware size.

This new prop is most useful in cases where the destination dimensions are quite small and the source image is significantly larger. The `resize` resize method performs downsampling and significant image quality is lost between the source and destination image sizes, often resulting in a blurry image. By using a multiplier, the decoded image is slightly larger than the target size but smaller than the source image (if the source image is large enough).

It's important to note that Fresco still chooses the closest power of 2 and will not scale the image larger than its source dimensions. If the multiplier yields `ResizeOptions` greater than the source dimensions, no downsampling occurs.

Here's an example:
If you have a source image with dimensions 200x200 and destination dimensions of 24x24, a `resizeMultiplier` of `2.0` will tell Fresco to downsample the image to 48x48. Fresco picks the closest power of 2 (so, 50x50) and decodes the image into a bitmap of that size. Without the multiplier, the closest power of 2 would be 25x25, which is half the quality.

## Changelog

[Android][Added] - Adds a new `Image` prop `resizeMultiplier` to help increase quality of small images on low DPI devices

Reviewed By: javache

Differential Revision: D58120352

fbshipit-source-id: e0ebf4bd899170134825a29f72a68621447106c0
2024-06-12 12:57:53 -07:00
Edmond ChuiandFacebook GitHub Bot deb4819229 Update debugger-frontend from fa5df76...06a25f7 (#44907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44907

Changelog: [Internal] - Update `react-native/debugger-frontend` from fa5df76...06a25f7

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

Reviewed By: huntie

Differential Revision: D58469457

fbshipit-source-id: c79a41888726d526ffc851bcc7550fd287bbf26b
2024-06-12 12:11:53 -07:00
Pieter VanderwerffandFacebook GitHub Bot 54997e429a Cleanup accessibility checks (#44885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44885

Cleanup accessibility related props checks to ensure we are doing the minimal amount of work. e.g. reduce duplicate `null` checks and shift checks to conditional branches that use them.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58390430

fbshipit-source-id: f2c8989b6520cda9f14f9a04cd4fd6e126c501fd
2024-06-12 11:51:44 -07:00
Gijs WeteringsandFacebook GitHub Bot b44e3f69a4 Add java and JS coverage collection to RNTester for Jest E2E (#44856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44856

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D58360098

fbshipit-source-id: dd06f9d3f2fe887cb9311ccfef811a2965ca5750
2024-06-12 11:48:07 -07:00
Moti ZilbermanandFacebook GitHub Bot df35e258b2 Prevent Fusebox infra crash if RCTBridge is dealloc'ed off the main queue (#44877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44877

Changelog: [Internal]

We're seeing a sporadic iOS crash that suggests `[RCTBridge dealloc]` is being called off the main queue (despite a comment suggesting it shouldn't be). This exposes a race condition between destroying the `HostTarget` and attempting to unregister the instance+runtime from it . Here we use `RCTExecuteOnMainQueue` to make sure the `HostTarget` destruction is always sequenced after the `unregisterFromInspector()` call.

Reviewed By: huntie

Differential Revision: D58415684

fbshipit-source-id: a22e239c80c3204fe32b9e73719ffaa131feaffb
2024-06-12 11:31:56 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 11e5394796 Revert D58288489: Multisect successfully blamed "D58288489: [RN][Fusebox][iOS] Implement new HostTargetMetadata fields (iOS)" for one test failure (#44911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44911

This diff reverts D58288489
D58288489: [RN][Fusebox][iOS] Implement new HostTargetMetadata fields (iOS) by huntie causes the following test failure:

Tests affected:
- [fbsource//xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern:testsAndroid - main](https://www.internalfb.com/intern/test/844425054538351/)

Here's the Multisect link:
https://www.internalfb.com/multisect/5466028
Here are the tasks that are relevant to this breakage:
T191385299: 50+ tests unhealthy for react_native

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58475289

fbshipit-source-id: 3a4476d1350c4986cdb673bdb4ac52af353a00ea
2024-06-12 11:30:13 -07:00
Peter AbbondanzoandFacebook GitHub Bot 297ded90aa Fall back to app AlertDialog for non AppCompat themes (#44495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44495

## Summary
Migrates the `AlertFragment` from `android.app.AlertDialog` to `androidx.appcompat.app.AlertDialog`. This backports tons of fixes that have gone into the AlertDialog component over the years, including proper line wrapping of button text, dark mode support, alignment of buttons, etc.

This change provides a fallback to the original `android.app.AlertDialog` if the current activity is not an AppCompat descendant.

## For consideration
- Alert dialog themes may no longer need the `android` namespace, meaning themes can now be specified as `alertDialogTheme` rather than `android:alertDialogTheme`.

## Changelog:

[Android] [Changed] - Migrated `AlertFragment` dialog builder to use `androidx.appcompat`

Reviewed By: zeyap

Differential Revision: D57113950

fbshipit-source-id: ba5109c9d79b6ceb042ff93eebe796a2d14ebd63
2024-06-12 11:24:56 -07:00
Peter AbbondanzoandFacebook GitHub Bot 600d3f6ff1 Migration RN Alert Dialog to androidx (#44494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44494

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

Migrates the `AlertFragment` from `android.app.AlertDialog` to `androidx.appcompat.app.AlertDialog`. This backports tons of fixes that have gone into the AlertDialog component over the years, including proper line wrapping of button text, alignment of buttons, etc.

## For consideration
- Alert dialog themes may no longer need the `android` namespace, meaning themes can now be specified as `alertDialogTheme` rather than `android:alertDialogTheme`.
- This change requires all implementing activities to have a theme that inherits from `Theme.AppCompat`. Creation of any activities which do not have a descendant of this style will result in an `IllegalStateException`: https://www.internalfb.com/intern/signalinfra/exception_owners/?mid=5ee93f6ecd59f3d8ad82a78c213ea016&result_id=16044073705339118.281475102518721.1715097866

## Changelog:

[Android] [Changed] - Migrated `AlertFragment` dialog builder to use `androidx.appcompat`

Reviewed By: zeyap

Differential Revision: D57019423

fbshipit-source-id: 84d8f69d896d32e72434149c0e31735d358370a9
2024-06-12 11:24:56 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ae7d543d31 Move HelloWorld jobs from CCI to GHA (#44875)
Summary:
This change migrates the GHA template jobs to the HelloWorld package for iOS.

## Changelog:
[Internal] - Move iOS template jobs to HelloWorld

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

Test Plan: GHA are green

Reviewed By: cortinico

Differential Revision: D58459398

Pulled By: cipolleschi

fbshipit-source-id: 95404445d7375186860af5835b750b4735795434
2024-06-12 10:21:49 -07:00
Christoph PurrerandFacebook GitHub Bot c5d380fc98 Avoid static_pointer_cast in GenerateModuleH.js (#44889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44889

Avoid static_pointer_cast. It provides no type-safety, and requires increasing the shared_ptr

## Changelog:

[Internal] [Fixed] - Avoid static_pointer_cast in GenerateModuleH.js

Reviewed By: javache

Differential Revision: D58449748

fbshipit-source-id: 4d46b4e18fc28758296a67271182a471a99b5d83
2024-06-12 10:14:48 -07:00
Edmond ChuiandFacebook GitHub Bot 20462ca984 fix timing of terminating an unresponsive debugger socket (#44811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44811

Changelog:
[General][Fixed] - Debugger frontend socket-termination countdown now begins after the ping message is actually sent

The debugger is currently disconnected if a ping-pong message is missed.

This causes the debugger to be unusable if it happens to be lagging, e.g. when the initialisation is competing with the flood of log spam T191394188

There are a few ways to fix this as discused with motiz88 and robhogan:

1. Ensure the websocket has a chance to respond, e.g. in via web worker
1. Lengthen the time allowed for the pong resopnse

I've done some digging to find the root cause of the UI being blocked in CDT, However, profiling shows that most of the work is not simple to break up, i.e. the number of expensive re-layout calls. Diving into that rabbit hole could mean accidentally writing React.

Because we ping every 10 seconds, we could get un/lucky where CDT happens to be busy _at that exact moment_, making this a flaky symptom to fix, even if we lengthen the allowed time-to-respond.

# V2+

So upon further investigation, CDT websocket is actually responding to the pings in due time:

{F1679132204}

(CDT doesn't show the ping/pong API as frames, so a custom tick/tock message was used to visualise the timing)

Over here in dev-middleware, we currently start a timeout to terminate the socket after sending the ping:

https://www.internalfb.com/code/fbsource/[813870db697a8701f2512d25a7fed730f0ec6ed9]/xplat/js/react-native-github/packages/dev-middleware/src/inspector-proxy/InspectorProxy.js?lines=306-307

If CDT doesn't respond in time, websocket would be terminated.

But we saw CDT respond immediately above, even during the log spam, so the delay must be coming from somewhere else.

The intuition is that during the log-spam, the middleware takes a perf hit too when it's processing the spam from the device and forwarding it to the CDT websocket.

We can confirm this by passing a "sent" callback via `socket.ping(cb)`:

https://github.com/websockets/ws/blob/9bdb58070d64c33a9beeac7c732aac0f4e7e18b7/lib/websocket.js#L246-L254

This gives us the timing between calling `socket.ping()` and when the ping is actually sent.

Regular, stress-free operation without log-spam shows most pings are sent within the same millisecond:

 {F1679223326}

With the pong response grace period at 5 seconds, there's plenty of time for CDT to `pong` back. That's why it has been working in most cases.

However, during the log-spam, we easily see this send-sent delay over 5 seconds. In extreme cases, almost 30 seconds would have passed before middleware sent a message to CDT, which then responded under 2 seconds:

 {F1679163335}

This means while CDT is getting flooded and has observable lag in the UI, the smoking gun is actually the middleware.

Digging a little deeper, we know that incoming messages from the target goes into a Promise queue, including the console logs:

https://www.internalfb.com/code/fbsource/[d5d312082e9c]/xplat/js/react-native-github/packages/dev-middleware/src/inspector-proxy/Device.js?lines=155-157

This means during the flood of logs from the target, the Promise queue keeps getting chained rapidly for each message.

Meanhile, the `ws` lib uses the underlying NodeJS `Socket.write` method for `ping(…)` and `send(…)`:

https://github.com/websockets/ws/blob/9bdb58070d64c33a9beeac7c732aac0f4e7e18b7/lib/sender.js#L349

…which is guaranteed to fire the callback asynchronously:

https://github.com/nodejs/help/issues/1504#issuecomment-422879594

Promise queue is in the macro task queue, which gets priority before the micro task queue. So if the Promise queue is not cleared yet, the websocket queue will have a hard time getting executed in time – explaining the extreme send-sent durations during a log spam.

The fix is simple:

1. Start the terminate-socket-timer until the `ping` is actually sent
1. Treat any incoming message (along with `pong`s) as a terminate-socket-timer reset
    1. This also applies if `pong` comes in between `send` and `sent`, which can happen sometimes due to the async nature of the callback:

 {F1679288626}

# V1

~~In this diff, a more forgiving mechanism is introduced, i.e. CDT is allowed to miss a ping-pong roundtrip 3 times before the websocket connection is terminated.~~

~~This allows a bit more breathing room for CDT's initialisation during log spam while maintaining the same ping-pong interval for VS Code to keep the auto SSH tunnel alive.~~

Reviewed By: huntie

Differential Revision: D58220230

fbshipit-source-id: 7111c9878492d8755a6110a5cdf4ef622265001d
2024-06-12 09:45:34 -07:00
Alex HuntandFacebook GitHub Bot 14914bd816 Implement new HostTargetMetadata fields (iOS) (#44893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44893

Adds the following debugger metadata fields (sent over the `ReactNativeApplication.metadataUpdated` CDP event), and implements these on iOS (Bridge and Bridgeless).

- `appIdentifier`
- `deviceName`
- `platform`
- `reactNativeVersion`

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58288489

fbshipit-source-id: 7105ad3b70d409bcd98b232154ebd6b7c827fb2b
2024-06-12 09:39:08 -07:00
Alex HuntandFacebook GitHub Bot aced4072cf Add ReactNativeApplication CDP domain (#44894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44894

Adds the new CDP domain `ReactNativeApplication`, with the following messages:

- `ReactNativeApplication.enable` (method) — Sent by the connected frontend to enable features under this domain.
- `ReactNativeApplication.metadataUpdated` (event) — Sent by the backend containing a metadata object about the host.

We intend to use this for displaying richer information in the debugger frontend, such as device information and React Native version.

Changelog:
[General][Added] - Add `ReactNativeApplication.[enable,metadataUpdated]` CDP messages for reading host metadata

Reviewed By: motiz88

Differential Revision: D58288490

fbshipit-source-id: 02384f0cdfaa35f1c5de9fad7ddd5aab483b2768
2024-06-12 09:39:08 -07:00
Alex HuntandFacebook GitHub Bot 28ded2c6cd Move SessionMetadata to HostTargetDelegate (#44878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44878

A refactor moving `SessionMetadata` (now renamed as `HostTargetMetadata`) out of `inspectorTarget->connect()` calls into a `HostTargetDelegate::getMetadata` method. This provides a cleaner interface and location for extending metadata fields in future.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58288491

fbshipit-source-id: 67e8b9a3fb6d0b7966187fa98d9852222f242b9d
2024-06-12 09:39:08 -07:00
Samuel SuslaandFacebook GitHub Bot 18be49e7bb split trace blocks inside of IntBufferBatchMountItem by type of operation (#44897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44897

changelog: [internal]

To get better understanding of where the time is spent, let's split IntBufferBatchMountItem systrace section into individual types.

Reviewed By: javache

Differential Revision: D58080444

fbshipit-source-id: d71dcc74a042c6c40270ca6f1dc7a8735c0471b8
2024-06-12 08:32:26 -07:00
Alex HuntandFacebook GitHub Bot 55e08a9319 Enable Fusebox by default in RNTester (#44895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44895

Enables the new debugger stack (codename Fusebox) in RNTester.

This feature is experimental and is enabled for testing purposes only. This change **should not** be adopted as the default by React Native frameworks.

Changelog: [Internal]

Reviewed By: cortinico, rubennorte, NickGerleman

Differential Revision: D58366246

fbshipit-source-id: 809a1edb79ced4a7920457ed661cc3d863b35c7b
2024-06-12 08:30:40 -07:00
Pieter De BaetsandFacebook GitHub Bot c92f31d834 Fix include directive to solve redefinition error (#44891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44891

Changelog: [Internal]

Reviewed By: cortinico, fabriziocucci, cipolleschi

Differential Revision: D58459144

fbshipit-source-id: a07280de01c9ff4333e5140c6b741d88c1c5d89a
2024-06-12 07:24:40 -07:00
Fabrizio CucciandFacebook GitHub Bot 33aa83a0e6 Stop ReactSurface in ReactDelegate::onHostDestroy (bridgeless) (#44873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44873

Changelog:
[Android][Fixed] - Unmount React root when activity is destroyed on bridgless

Reviewed By: javache

Differential Revision: D58411605

fbshipit-source-id: ff9940efd4cf5da5887d79d99bcf3721e16d6725
2024-06-12 05:38:02 -07:00
Nicola CortiandFacebook GitHub Bot b8f1b92298 Setup publishing of Gradle Scans on GHA (#44879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44879

This sets up publishing of Gradle scans for every build on GHA.

Changelog:
[Internal] [Changed] - Setup publishing of Gradle Scans on GHA

Reviewed By: blakef

Differential Revision: D58419361

fbshipit-source-id: f54365ad259324747248ef0bb726dc64964507f8
2024-06-12 03:47:00 -07:00
Nicola CortiandFacebook GitHub Bot 14ccf6bc9c Remove android.enableJetifier (#44876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44876

We probably don't need Jetifier anymore at this point.
Also see: https://github.com/react-native-community/template/pull/9

Changelog:
[Internal] [Changed] - Remove `android.enableJetifier`

Reviewed By: rshest

Differential Revision: D58416487

fbshipit-source-id: f60c58aaf17b90c610959589fcd46026979c749a
2024-06-12 02:58:16 -07:00
Christoph PurrerandFacebook GitHub Bot 42f136d00d Turbo Module EventEmitters as functions (#44886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44886

## Changelog:

[General] [Added] - Turbo Module EventEmitters as functions

Reviewed By: javache

Differential Revision: D58429202

fbshipit-source-id: c56793d216f5ecf981e62d3b004f715110903945
2024-06-11 23:35:36 -07:00
Christoph PurrerandFacebook GitHub Bot 6a3a305628 Add C++ Turbo Module Event Emitter example (#44810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44810

Adds an example how to use the `EventEmitter` on a (C++) Turbo Module

## Changelog:

[General] [Added] - Add C++ Turbo Module Event Emitter example

Reviewed By: javache

Differential Revision: D57473949

fbshipit-source-id: 1a8d17fb83af4220ef12379e0102b5b2e233ed45
2024-06-11 21:12:33 -07:00
Pieter VanderwerffandFacebook GitHub Bot 872d5d3c5e Cleanup style checks (#44864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44864

Switch the style normalizer checks to only do a single top level `null` check and remove unneeded flow suppression comments.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58386781

fbshipit-source-id: e4df6fdadb5bfab4c8ae674a420ac453ba262f78
2024-06-11 20:45:56 -07:00
Soe LynnandFacebook GitHub Bot ce588db63f Make getContentOriginOffset to know info about if call-site want transform or not (#44822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44822

Changelog: [Breaking]

This is to make `getContentOriginOffset` to have `includeTransform` information passed during Layout computation.

Reviewed By: NickGerleman

Differential Revision: D58223380

fbshipit-source-id: 4faa1409d9c87e2c92118941aa193ba0a0f34367
2024-06-11 19:48:32 -07:00
Christoph PurrerandFacebook GitHub Bot fd618819c7 Add EventEmitter code-gen support for C++ Turbo Modules (#44809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44809

Adding react-native-codegen parser support for a new `EventEmitter` property type on C++ Turbo Modules.

It is possible to later expand this feature to other languages (Java, ObjC).

## Characteristics

An `EventEmitter` must:
- be non null:
 `EventEmitter<string>` works, `?EventEmitter<string>` does NOT
- have a non null eventType:
  `EventEmitter<number>` works, `EventEmitter<?number>` does NOT
- have at most 1 eventType, `void` is possible as well:
  `EventEmitter<>` or `EventEmitter<MyObject>` work - `EventEmitter<number, string>` do NOT
- have a concrete eventType, `{}` is not allowed
  `EventEmitter<{}>` does NOT work
- be used in `Cxx` Turbo Modules only at this time

## Example

For these 4 eventEmitters in on an RN JS TM spec
```
  +onPress: EventEmitter<void>;
  +onClick: EventEmitter<string>;
  +onChange: EventEmitter<ObjectStruct>;
  +onSubmit: EventEmitter<ObjectStruct[]>;
```
We now generate this code:
1.) in the spec based header `{MyModuleName}CxxSpec` in the constructor:
```
      ... // existing code
      eventEmitterMap_["onPress"] = std::make_shared<AsyncEventEmitter<>>();
      eventEmitterMap_["onClick"] = std::make_shared<AsyncEventEmitter<OnClickType>>();
      eventEmitterMap_["onChange"] = std::make_shared<AsyncEventEmitter<OnChangeType>>();
      eventEmitterMap_["onSubmit"] = std::make_shared<AsyncEventEmitter<OnSubmitType>>();
```
2.) as `protected` functions
```
  void emitOnPress() {
      std::static_pointer_cast<AsyncEventEmitter<>>(delegate_.eventEmitterMap_["onPress"])->emit();
  }

  void emitOnClick(const OnClickType& value) {
      std::static_pointer_cast<AsyncEventEmitter<OnClickType>>(delegate_.eventEmitterMap_["onClick"])->emit(value);
  }

  void emitOnChange(const OnChangeType& value) {
      std::static_pointer_cast<AsyncEventEmitter<OnChangeType>>(delegate_.eventEmitterMap_["onChange"])->emit(value);
  }

  void emitOnSubmit(const OnSubmitType& value) {
      std::static_pointer_cast<AsyncEventEmitter<OnSubmitType>>(delegate_.eventEmitterMap_["onSubmit"])->emit(value);
  }
```

## Changelog:

[General] [Added] - Add EventEmitter code-gen support for C++ Turbo Modules

Reviewed By: javache

Differential Revision: D57407871

fbshipit-source-id: 2345cc6dacf0cb0d45f8a374ad9d4cbf8082f9d6
2024-06-11 19:19:22 -07:00
Nick GerlemanandFacebook GitHub Bot bfb3b7008d Support clipping to children everywhere using ReactViewBackgroundManager (#44734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44734

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

This integrates functionality for clipping content to padding box into `ReactViewBackgroundManager`, to be shared between several ViewManagers. In practice, this means:

1. `overflow: hidden` now works on `Text` and `TextInput`
2. ScrollView children are now clipped to the interior of borders, included curved ones via borderRadius

This will be made more generic, then start being used in ReactViewGroup, and eventually ReactImage. That abstraction will then hide away extra background management we will use for shadows.

Different places in code currently do clipping in any of `draw()`, `onDraw()`, or `dispatchDraw()`. The distinction between these, is that `draw()` allows code to run before drawing background even, `onDraw()` is invoked before drawing foreground, and `dispatchDraw()` is before drawing children. We don't want to clip out borders/shadows, but do want to clip foreground content like text, so I used `onDraw()` here.

Changelog:
[Android][Fixed] - Better overflow support for ScrollView, Text, TextInput

Reviewed By: rozele

Differential Revision: D57953429

fbshipit-source-id: ca3b788deb4b32706df7db958877d18f525c039c
2024-06-11 16:13:28 -07:00
Pieter VanderwerffandFacebook GitHub Bot c9d7774a24 Cleanup imports and types (#44862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44862

Clean up:
* type imports to be consistent
* Remove long since deprecated `{| ... |}` exact object style.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58381905

fbshipit-source-id: 4c061385a987a2bc7dd8339183533084f1efd699
2024-06-11 15:41:19 -07:00
danandFacebook GitHub Bot 32c3cd3e8a Fix junk in React warnings in Logbox (#44812)
Summary:
Before all React errors showed junk like this:

![Screenshot 2024-06-06 at 06 24 38](https://github.com/facebook/react-native/assets/810438/40be3133-e31d-43e8-b04d-ffbc5b462027)

This is because `isComponentStack` detected a component stack but `parseComponentStack` couldn't actually parse it (it doesn't deal with React's current format like `in Foo (created by FeedItemInner)`) so `componentStack` was an empty array, resulting in the next block of code pushing stuff into `argsWithoutComponentStack` _again_, thus repeating its args.

The fix is not to do that. Result on my local copy:

![Screenshot 2024-06-06 at 06 24 24](https://github.com/facebook/react-native/assets/810438/8f3d32d9-6f28-472c-be34-c802a0e2f161)

Ofc this doesn't actually show the component stack but that was broken before too.

I edited in-place in my `node_modules` so I haven't verified this 100% works on main.

Hope this is useful!

## Changelog:

[General] [Fixed] - Remove accidental duplication in React warnings in Logbox

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

Reviewed By: cortinico

Differential Revision: D58240357

Pulled By: rickhanlonii

fbshipit-source-id: b6ecb659d3b393e497caf5e7b2087a8e529f1b28
2024-06-11 15:16:13 -07:00
Christoph PurrerandFacebook GitHub Bot 2a0a11256a Add EventEmitter C++ bridging type (#44808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44808

Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript.

Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought.

It implements this interface
```
export type EventEmitter<T> = {
  addListener(handler: (T) => mixed): EventSubscription,
};
```

## Hybrid
It is a 'hybrid' object.

1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code)
2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript)

## Changelog:

[General] [Added] - Add EventEmitter C++ bridging type

## Facebook:
Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h

Reviewed By: javache

Differential Revision: D57424391

fbshipit-source-id: 4999cafe9daeac125712a4bb7679d7acb9a6c389
2024-06-11 15:00:16 -07:00
Eric RozellandFacebook GitHub Bot d3e3e2a870 Allow out of tree platforms to customize cursor values (#44841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44841

This change adds native support in Fabric for the remaining CSS cursor style values as defined here: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor. Please note, this functionality is simply for prop parsing capabilities in Fabric, which are shared across all platforms. This does not add any additional cursor behavior support to iOS or Android, and the Flow and TypeScript types for cursor style values are still limited to `auto` and `pointer`.

## Changelog

[General][Added] Fabric prop parsing capabilities for all CSS cursor style values

Reviewed By: NickGerleman

Differential Revision: D58301970

fbshipit-source-id: 37ef8fcb4f62ac8c7613c7f6abcc48303953b71b
2024-06-11 14:58:45 -07:00
Wojciech LewickiandFacebook GitHub Bot 8a15e0d97a fix: singletonMap for module events (#42354)
Summary:
Sometimes the events map can be a of type `SingletonMap` which will cause this code to throw exception when adding keys to it, so we change it to normal `HashMap`. Creating `SingletonMap` can especially happen in Kotlin when there is only one event added to a map, see:
https://github.com/plaid/react-native-plaid-link-sdk/blob/5ffab5eef576163528f0da504181162da3bef08b/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt#L21
## Changelog:

[ANDROID] [FIXED] - Cover SingletonMap when parsing events exported by module

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

Test Plan: Create `getExportedCustomBubblingEventTypeConstants` as `SingletonMap` in some example module and see that the code does not throw.

Reviewed By: cipolleschi

Differential Revision: D58417266

Pulled By: cortinico

fbshipit-source-id: 6c46398ddf4d044386a36d0c1663bd071d642fb6
2024-06-11 12:20:07 -07:00
Alex HuntandFacebook GitHub Bot 53dda9e542 Format code-workspace file, clarify use of .vscode/ dir (#44874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44874

While reviewing https://github.com/facebook/react/pull/29830, I noticed this file was committed with tab indentation in React Native. I have also used the `.gitignore` entry to clarify how `react-native.code-workspace` interacts with an optional user `.vscode/` config directory.

Note: The `json-stringify` parser can be used with Prettier 3+ only, so we use `json` instead.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D58413581

fbshipit-source-id: 58c14db6648fed10736062b1f055475154aa74a4
2024-06-11 09:27:48 -07:00
Mauricio MeirellesandFacebook GitHub Bot 8597727c28 Adjust InputAccessoryView width to match device width within Safe Area constraints (#43303)
Summary:
This PR updates the `InputAccessoryView` component to improve its width handling during device orientation changes for both Fabric and the old renderer. With this update, the component will always occupy the full width of the screen and adjust its size when the device orientation changes.

It also updates the component to stick to the safe area in React Native instead of iOS native. This tweak opens up possibilities for better customizations down the line.

Resolves: https://github.com/facebook/react-native/issues/27887

## Changelog:

[IOS] [FIXED] - Fix `InputAccessoryView` width on device orientation change

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
https://github.com/facebook/react-native/assets/5813840/cd3cc7bf-21c2-42a7-9f59-53bb613b9ef1

Difference between horizontal list with horizontal safe area inset in the component or on the content
| component constraint | content inset |
| ------ | ------ |
|   <video src="https://github.com/facebook/react-native/assets/5813840/173c26c8-5420-4ea2-beaa-6151c13c2119">  |<video src="https://github.com/facebook/react-native/assets/5813840/217a06eb-8634-4a26-9b70-392f7cf16112">   |

Reviewed By: cortinico

Differential Revision: D58188210

Pulled By: cipolleschi

fbshipit-source-id: 196343494cf545a22f3bc011f79b5fd592a5deb3
2024-06-11 09:21:29 -07:00
Alex HuntandFacebook GitHub Bot d72ac96e8e Remove nonstandard "vm" field from modern CDP targets (#44835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44835

As titled. The `vm` field is not part of the CDP spec and will not be used by the modern debugger frontend or proxy.

This change affects modern CDP targets only (using `InspectorPackagerConnection`). We aim to enable sharing of more detailed metadata over 1/ a new, dedicated CDP domain, and 2/ namespaced under the existing `reactNative` field (for the latter, strictly limited to metadata necessary for dev server functionality).

Changelog: [Internal]

(Note: `/json` endpoint behaviour is unchanged for legacy CDP targets)

Reviewed By: robhogan

Differential Revision: D58285587

fbshipit-source-id: dfef3a56b20486ba11891df9940f6c7bef59528e
2024-06-11 08:48:45 -07:00
Nicola CortiandFacebook GitHub Bot d0012b7dcd Simplify build_android (#44870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44870

This just simplifies the build_android step on GHA

Changelog:
[Internal] [Changed] - Simplify build_android

Reviewed By: cipolleschi

Differential Revision: D58407537

fbshipit-source-id: 2bb34ef8b8d1883e653914488d4d417356f0f1d2
2024-06-11 08:34:46 -07:00
Nicola CortiandFacebook GitHub Bot 3c3c687bf7 Add Gradle Wrapper validation workflow (#44872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44872

This is just a security measure against wrapper tampering attacks.
See more on this here: https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md

Changelog:
[Internal] [Changed] - Add Gradle Wrapper validation workflow

Reviewed By: cipolleschi

Differential Revision: D58408099

fbshipit-source-id: 9768b924aa051128e4adc83f862536fb87238e65
2024-06-11 06:36:15 -07:00
Alex HuntandFacebook GitHub Bot 3303dd35ed Expose unstable_loadFusebox API on Android (#44858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44858

- Enables an opt-in to the Fusebox stack on Android for both architectures in open source.
- Templates use of this opt-in in RNTester.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D58359907

fbshipit-source-id: d565dc8e00747dff56d3060e36e7f59e7dd2aec5
2024-06-11 06:11:35 -07:00
Nicola CortiandFacebook GitHub Bot 2867d6679e Fix test_android_template (#44871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44871

This re-enables and fix `test_android_template`.
The problem was that we were invoking `yarn install` inside the template after we already installed with `npm install --registry`.
So this was invalidating the Verdaccio setup and effectively fetching packages from NPM

Changelog:
[Internal] [Changed] - Fix test_android_template

Reviewed By: cipolleschi

Differential Revision: D58407941

fbshipit-source-id: 9b7b877cfc994eb8db1b5bf71dd35289c3937f5c
2024-06-11 04:58:20 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 54bbb2b4fc Move the Publish Release workflow to GHA (#44868)
Summary:
This change moves the Publish release workflow to GHA

## Changelog:
[Internal] - Move the Publish Release workflow to GHA

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

Test Plan: GHA is green

Reviewed By: cortinico, huntie

Differential Revision: D58406352

Pulled By: cipolleschi

fbshipit-source-id: 99fb1df16aeffa9d48bb4ed409847c6ac4892a82
2024-06-11 04:46:55 -07:00
Alex HuntandFacebook GitHub Bot 812f155527 Expose unstable_fuseboxEnabled API on iOS (#44860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44860

- Enables an opt-in to the Fusebox stack on iOS for both architectures in open source.
- Templates use of this opt-in in RNTester.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D58364053

fbshipit-source-id: c604b1589174bf7cfd0fe1bfb5624c4edd0a125d
2024-06-11 04:38:32 -07:00
Nicola CortiandFacebook GitHub Bot 1d926d47ff Make hermesc executable
Summary:
Seems like hermesc produced by GitHub Actions is not executable. This fixes it.

Changelog:
[Internal] [Changed] - Make hermesc executable

Reviewed By: cipolleschi

Differential Revision: D58407086

fbshipit-source-id: 84d7ba950b99214dfaed09a6aa499835fd01ede0
2024-06-11 03:55:53 -07:00
Nicola CortiandFacebook GitHub Bot 7c0c9a2b93 Cleanup the .github/workflows folder (#44857)
Summary:
Just doing some cleanup of the `.github/workflows` folder:
* apply-version-label-issue.yml hasn't been working since 0.72
* ios-tests is unnecessary as it's now covered by test-all
* nightlies-feedback.yml was experimental and last execution was ~5 months ago.

We can still recover them from the Git history if necessary.

## Changelog:

[INTERNAL] - Cleanup the .github/workflows folder

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

Test Plan: Will wait for CI result

Reviewed By: NickGerleman

Differential Revision: D58362912

Pulled By: cortinico

fbshipit-source-id: d886e4f077eebfdf906169f09f96a950a361cab7
2024-06-11 03:14:49 -07:00
Nick GerlemanandFacebook GitHub Bot db0e9eaa32 Disable test_android_template on PR (#44865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44865

This has not yet passed on main since we started testing on main two weeks ago: https://github.com/facebook/react-native/actions/runs/9316380994/job/25688028045

This change disables the GitHub Actions version `test_android_template` as a signal for PRs or diffs, since it isn't stable yet (but we still run it on main, and can manually dispatch it on any branch). This coverage is still enabled in CircleCI.

Changelog: [Internal]

Reviewed By: cortinico, alanleedev

Differential Revision: D58394745

fbshipit-source-id: 3227328b150a89b450d48784190f5d08d510cd1b
2024-06-11 03:01:18 -07:00
rickhanlonii (Meta Employee)andFacebook GitHub Bot b0c0bb4591 Fix xplat sync syntax error
Summary: DiffTrain build for commit https://github.com/facebook/react/commit/bf1bb2e5e52733a9577848f2913d06edcf24df14.

Reviewed By: yungsters

Differential Revision: D58369382

Pulled By: rickhanlonii

fbshipit-source-id: 0e6058a285108279465b3c6f4edd8d23d9ddd4b8
2024-06-11 01:46:27 -07:00
Soe LynnandFacebook GitHub Bot 0d345698d8 Measure with transform bugfix (#44821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44821

Changelog: [Internal]

- Originally D37994809 was attempted to fix `Inverted FlatList` but was put behind Feature Toggle because it was causing problems in other scenarios.
- Later, D45866231 which was trying to fix scaling transform issue helped solve the issue attempted by the original diff.
- But after that points, Unit test around `computeRelativeLayoutMetrics` was having two variants where Feature Toggle for D37994809 was checked in with a wrong expected value.
- This diff revert D37994809 changes and clean up the unit test.

Reviewed By: NickGerleman

Differential Revision: D58197918

fbshipit-source-id: d8ae552018617e785e4010bc5805c53a875e02a3
2024-06-10 21:03:45 -07:00
Zeya PengandFacebook GitHub Bot 712ff8cdba make RNTesterApp's back button customizable
Summary:
## Changelog

make RNTesterApp take a `customBackButton` prop to enable overriding whether to display back button and the look
by default, only ios platform has a back button, and android app relies on back button on navigation bar that comes with platform

[Internal]

Reviewed By: christophpurrer

Differential Revision: D58218208

fbshipit-source-id: 63a47390cc6d3de057b92a3c522c1b00d942c69d
2024-06-10 20:48:12 -07:00
Joe VilchesandFacebook GitHub Bot 5b3a321422 Fix issue with alternating flex direction and percent postions (#44792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44792

X-link: https://github.com/facebook/yoga/pull/1663

Fixing https://github.com/facebook/yoga/issues/1658. We had a problem where if a child had a different flex direction than its parent, and it also set a position as a percent, it would look at the wrong axis to evaluate the percent. What was happening was we were passing in the container's mainAxis size and crossAxis size to use to evaluate the position size if it was a percent. However, we matched these sizes with the main/cross axis of the child - which is wrong if the flex direction is different.

I changed it so that the function just takes in ownerWidth and ownerHeight then calls isRow to determine which one to use for the main/cross axis position. This reduces the ambiguity quite a bit imo.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58172416

fbshipit-source-id: eafd8069e03493fc56c41a76879d1ad9b7e9236d
2024-06-10 18:25:19 -07:00
Joe VilchesandFacebook GitHub Bot 940d738b89 Fix issue where % width would be wrong if physical and relative padding defined on parent (#44791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44791

X-link: https://github.com/facebook/yoga/pull/1662

This should fix https://github.com/facebook/yoga/issues/1657. Rather insidious bug but we had code like

```
  // The total padding/border for a given axis does not depend on the direction
  // so hardcoding LTR here to avoid piping direction to this function
  return node->style().computeInlineStartPaddingAndBorder(
             axis, Direction::LTR, widthSize) +
      node->style().computeInlineEndPaddingAndBorder(
          axis, Direction::LTR, widthSize);
```

That comment is NOT true if someone sets both the physical edge and relative edge. So like paddingLeft and paddingEnd for RTL. This diff simply pipes the direction to that spot to use instead of hardcoding LTR. Every file changed is just to pipe `direction`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58169843

fbshipit-source-id: 5b4854dddc019285076bd06955557edf73ef7ec5
2024-06-10 18:25:19 -07:00
Nicola CortiandFacebook GitHub Bot e686b4330d Tentative fix for NPE JavaTimerManager$IdleCallbackRunnable.cancel (#44852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44852

This attempts to fix #44842 by capturing the accessed field in a new variable.
We don't have a way to reproduce this & this is a best guess fix.

Changelog:
[Android] [Fixed] - Tentative fix for NPE `JavaTimerManager$IdleCallbackRunnable.cancel`

Reviewed By: javache

Differential Revision: D58356826

fbshipit-source-id: d016df9a52f81a8d645a0a100c6bc6111841e24e
2024-06-10 13:39:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7ce5e56f38 Migrate the Prepare Release workflow (#44833)
Summary:
This change migrates the prepare_release workflow from CCI to GHA

## Changelog:
[Internal] - Migrate from CCI to GHA

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

Test Plan: Test on GHA

Reviewed By: huntie

Differential Revision: D58289050

Pulled By: cipolleschi

fbshipit-source-id: 134fc7ffb66a18eec1187e14500daec2828cae61
2024-06-10 09:49:45 -07:00
Pieter De BaetsandFacebook GitHub Bot fdb2427a86 Add getNativeModule(String) to ReactContext interface (#44851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44851

This method is available on the (deprecated) CatalystInstance interface, but not on ReactContext, even though it is trivially supported.

Changelog: [Android][Added] - Added getNativeModule(name) to ReactContext

Reviewed By: cortinico

Differential Revision: D58355135

fbshipit-source-id: 0cc76bb2da2b49510dc626cb8b3a3e93db5a16b0
2024-06-10 09:02:05 -07:00
Rubén NorteandFacebook GitHub Bot e94852ff28 Modify IntersectionObserver example in RNTester to showcase changes in intersection due to changes in layout, instead of scroll (#44823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44823

Changelog: [internal]

This modifies the example for `IntersectionObserver` in RNTester to test that the API reports changes in intersection also coming from changes in layout (previously is was only from changes in scroll position).

Reviewed By: javache

Differential Revision: D58260057

fbshipit-source-id: 305d5996148730d718da30896f6cc62991b717f7
2024-06-10 08:28:45 -07:00
Peter AbbondanzoandFacebook GitHub Bot 0b8222a854 Fix status bar height calculation for all cutout sizes (#44805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44805

Google has discouraged attempting to read the `status_bar_height` resource [since 2017](https://youtu.be/_mGDMVRO3iE?si=qGQd7gLa_qTmfLGL&t=1079). With the introduction of display cutouts there can be a mismatch between the resource value and the true status bar size (and issues like [this one](https://github.com/facebook/react-native/issues/33612) popped up). The recommended approach is to instead call `getInsets` with the proper status bar and navigation flags provided by `WindowInsets`. On older APIs where `getInsets` is not supported, we have access to `systemWindowInsetTop`.

Changelog:
[Android][Fixed] - Fixed StatusBar.currentHeight calculations to honor all cutout sizes

Reviewed By: tdn120

Differential Revision: D58088036

fbshipit-source-id: 9c035a79cbb96db1cf3b5b5c36242df7453fe205
2024-06-10 08:25:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 01822eb66f Add VisionOS support to GHA nightlies (#44855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44855

We recently landed a change that added support for VisionOS in the general test case for GHA but we forgot to include nightlies.

This change takes the same changes applied to [this file](https://github.com/facebook/react-native/pull/44691/files#diff-12d2c3c126fcc84106dce4b6d2be2220f018661b111a5382ad6effc1047f66aeR114-R368) and applies them to the nightlies.

## Changelog:
[Internal] - Add GHA nightlies support for VisionOS

Reviewed By: huntie

Differential Revision: D58358115

fbshipit-source-id: 577f62e53fb530bc534ba98508801a6970aef095
2024-06-10 07:12:02 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a8f4f1d658 Fix External CI (#44854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44854

In the previous change, I followed the suggestion of the linter but in that case I shouldn't.

This was breaking circleci and GHA

This change will fix it

## Changelog:
[Internal] - Fix OSS CI

Reviewed By: huntie

Differential Revision: D58358164

fbshipit-source-id: eba1f41c17a191aa9d3bd213fddddd8ff3c24a6a
2024-06-10 05:53:06 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 924fb3de9b feat: build visionos hermes binary on the CI (#44691)
Summary:
As discussed with cipolleschi offline, this PR adds visionOS to the prebuilt Hermes binary for the CI.

## Changelog:

[IOS] [ADDED] - Prebuilt version of Hermes for visionOS

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

Test Plan: Check if CI builds xcframework for visionOS.

Reviewed By: cortinico

Differential Revision: D58189271

Pulled By: cipolleschi

fbshipit-source-id: dc76746b2c1e22670bef4c21411a598e43dad577
2024-06-10 04:52:24 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 38bae4bdf4 fix: run nightly CI only on the main repo (#44844)
Summary:
I've noticed that nightly CI build was also running on my fork. I don't think this is necessary for every React Native fork (there are 24k of forks). This can save lots of unnecessary CI time.

## Changelog:

[INTERNAL] [FIXED] - Enable nightly run only on the main repo

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan: CI Green

Reviewed By: cipolleschi

Differential Revision: D58356192

Pulled By: cortinico

fbshipit-source-id: 1384d06708220d297e67d31433fcf3ac1d58bbbc
2024-06-10 04:32:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9fa0764334 Fix Nightlies for Android (#44847)
Summary:
While migrating from CCI to GHA, we mistakenly set the `ORG_GRADLE_PROJECT_reactNativeArchitectures` wrongly. The result was that the nightly was building only 1 architecture for android instead of all of them.

This change fixes that, but asking GHA to build all the architectures when running nightlies

bypass-github-export-checks

## Changelog:
[Internal] - Build all the architectures for android when running nightlies

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

Test Plan: Run a nightly from the branch and see it working

Reviewed By: huntie

Differential Revision: D58347697

Pulled By: cipolleschi

fbshipit-source-id: 43a2b83ba9183e6f5a11d1e6f6a27df622ee8cc6
2024-06-10 03:56:24 -07:00
Nicola CortiandFacebook GitHub Bot feeb4b773b Remove import of com.facebook.react.ReactSettingsExtension (#44850)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44850

I'm removing this line from settings.gradle:
```
import com.facebook.react.ReactSettingsExtension
```
and just using a fully qualified class name in the `configure{}` block
as imports cannot be conditionally included and is making hard for RNTA
to integrated those changes.

Changelog:
[Internal] [Changed] - Remove import of `com.facebook.react.ReactSettingsExtension`

Reviewed By: huntie

Differential Revision: D58354443

fbshipit-source-id: bc45516661318021a042e1c5921e28d7217cacbc
2024-06-10 03:26:34 -07:00
Nicola CortiandFacebook GitHub Bot 6937c7044b rncli.h -> autolinking.h (#44829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44829

Another renaming that now we can merge to make clear what's the intent of this header.

Changelog:
[Internal] [Changed] - rncli.h -> autolinking.h

Reviewed By: javache

Differential Revision: D58284662

fbshipit-source-id: 7b69118f72d9b34a88ece7e0855918f5c717999a
2024-06-09 05:09:18 -07:00
Levi BuzolicandFacebook GitHub Bot 2483c63017 Add missing remove method to addEventListener Jest mocks (#44270)
Summary:
While writing some Jest tests, I noticed some instances of the following error:

```
Cannot read properties of undefined (reading 'remove')
```

Looks like there were two cases where the `{remove: () => {}}` return result was missing in the provided Jest mocks:

 - `AccessibilityInfo.addEventListener`
 - `Linking.addEventListener`

## Changelog:

[GENERAL] [FIXED] - Added missing `remove` methods for `Linking.addEventListener` and `AccessibilityInfo.addEventListener` Jest mocks

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D58324784

Pulled By: robhogan

fbshipit-source-id: f46bd55db2517413f14182ae1bb81068d8d1e9f6
2024-06-08 10:59:04 -07:00
Nicola CortiandFacebook GitHub Bot 61de7da032 PackageList2 -> PackageList (#44828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44828

I was using PackageList2 temporarily as I was migrating to Core Autolinking.
Now we can rename everything to `PackageList` to reduce the number of changes to the template for users.

Changelog:
[Internal] [Changed] - PackageList2 -> PackageList

Reviewed By: blakef

Differential Revision: D58284661

fbshipit-source-id: 8e1cc54e248519ece05336d79bb79e3f4ca706f4
2024-06-07 11:02:40 -07:00
Vitali ZaidmanandFacebook GitHub Bot 138d50f412 Update debugger-frontend from 3307f31...fa5df76 (#44839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44839

Changelog: [Internal] - Update `react-native/debugger-frontend` from 3307f31...fa5df76

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

Reviewed By: EdmondChuiHW

Differential Revision: D58291849

fbshipit-source-id: 10dd25c205b13b3ae142e9af552c23809dd3e9ce
2024-06-07 10:49:00 -07:00
Nicola CortiandFacebook GitHub Bot 8ce450c435 Convert MountingManagerTest to Kotlin (#44837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44837

As the title says.

Changelog:
[Internal] [Changed] - Convert MountingManagerTest to Kotlin

Reviewed By: javache

Differential Revision: D58290597

fbshipit-source-id: a5c499fbffcaeef4e21ebbca1904b22803c35270
2024-06-07 10:40:36 -07:00
Ingrid WangandFacebook GitHub Bot f4b921c1d5 Fix broken scroll view caused by D58157667 (#44820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44820

# Changelog

[iOS][Fixed] Fixing scroll view breakage caused by #44789

Reviewed By: cipolleschi

Differential Revision: D58260014

fbshipit-source-id: 375697f1103ba7794f572f490b409a1d27304e66
2024-06-07 10:39:33 -07:00
Nicola CortiandFacebook GitHub Bot cf914e412d RNGP - Autolinking. Add support for linking projects. (#44799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44799

This is the final part of core autolinking:
1. I split RNGP into an `app-plugin` and a `settings-plugin`. This was necessary as the Gradle modules need to be loaded inside the settings.gradle.kts.
2. I've introduced a Settings Plugin to take care of either invoking the `config` command from CLI or receiving a file in input.
3. I've removed the former `RunAutolinkingConfigTask` as now the command is invoked inside the settings plugin
4. I've added hashing computed based on the lockfiles so we won't be re-executing teh `config` command if the lockfiles are not changed.
5. I've updated RN-Tester to use the core autolinking rather than manual linking for the 2 libraries it's using.

Changelog:linking
[Internal] [Changed] - RNGP - Autolinking. Add support for linking projects

Reviewed By: blakef

Differential Revision: D58190363

fbshipit-source-id: 6ab8b36729e77ca715f50a4a00aa0ca4eb5b63b1
2024-06-07 10:32:16 -07:00
Chang YanandFacebook GitHub Bot d8a0d30e70 Build and sync lint/sort-imports from WWW (#44824)
Summary:
X-link: https://github.com/facebook/relay/pull/4708

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

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

Run the build script based on the commit in D58271034.

Changelog: [Internal]

NOTE: Test plan and summary intentionally obfuscated because it's exported to an external github pull request, but trust me.

Reviewed By: yungsters

Differential Revision: D58271323

fbshipit-source-id: be19c63d630281b9f6feca00b24f45d000e07089
2024-06-07 10:01:49 -07:00
Benoit GirardandFacebook GitHub Bot 5a4cb3de3d Add Perfetto Hermes Sampling Data Source (#44818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44818

Introduce a new data source for Perfetto. This one turns on the Hermes sampler, and at the end we flush the state to Perfetto.

This provides JS sampling data in Perfetto traces that can be used to easily spot JS performance problems not otherwise obvious.

Reviewed By: javache

Differential Revision: D57226087

fbshipit-source-id: 77c4a335bb462e73d74345eedc3fa634405bfd0f
2024-06-07 09:52:42 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2b343ca449 Handle lowercase->uppercase of hermes ios artifacts (#44836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44836

Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.

## Changelog
[Internal] - Handle lowercase->uppercase of hermes ios artifacts

Reviewed By: cortinico

Differential Revision: D58290049

fbshipit-source-id: c1e76e9e5718500378ba08d26d5c4dd0620c78c4
2024-06-07 08:38:04 -07:00
Alex HuntandFacebook GitHub Bot df19e597e3 Remove faviconUrl field from CDP list response (#44834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44834

- Remove the nonstandard, unused `faviconUrl` field from CDP `/json` response targets (note: both legacy and modern targets).
- Reorder `PageDescription` members.

Changelog:
[General][Removed] - `react-native/dev-middleware`: Remove nonstandard `faviconUrl` field from CDP `/json` response

Reviewed By: hoxyq

Differential Revision: D58092090

fbshipit-source-id: a593be00464853a3fe179305efae5643d616573b
2024-06-07 08:23:45 -07:00
zhongwuzwandFacebook GitHub Bot 1a1795a537 Fixes enum codegen value cases (#44654)
Summary:
Fixes https://github.com/facebook/react-native/issues/44632

## Changelog:

[GENERAL] [FIXED] - [codegen] Fixes enum codegen value cases

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

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

Reviewed By: cipolleschi, dmytrorykun

Differential Revision: D58135645

Pulled By: cortinico

fbshipit-source-id: 5c0634ef1d1d7375d2ecfcf7f916d67fd39b7300
2024-06-07 07:53:59 -07:00
Nicola CortiandFacebook GitHub Bot 538dd1760d Add libmapbufferjni.so to pickFirst directives (#44827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44827

After D57856389 (#44684), the build is now firing an issue as `libmapbufferjni.so` is exposed as a public `.so` and we're missing a pickFirst directive.

Changelog:
[Internal] [Changed] - Add libmapbufferjni.so to pickFirst directives

Reviewed By: javache

Differential Revision: D58284481

fbshipit-source-id: d476bd5df8ec4687177df7a698cbb6595ce62565
2024-06-07 07:06:37 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f57d6246f1 Bump build_npm_package machine to more powerful ones (#44831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44831

The build_npm_package jobs remains sometimes in queue because there are not enough executors for it to run.
This makes our signals less reliable.

Plus, it is rebuilding part of Android, so it can benefit from a bigger machine

## Changelog:
[Internal] - Bump build_npm_package machine to more powerful ones

Reviewed By: cortinico

Differential Revision: D58284884

fbshipit-source-id: a29b7db843633ff3cfd9373cf4dbe55b24c939b1
2024-06-07 05:38:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a7d5bbada9 Remove Nightlies (#44830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44830

Now that we have nightlies in GHA, we can safely remove them from CCI.

## Changelog:
[Internal] - Remove Nightlies from CCI

## Facebook:
Once this land, we need to disable the trigger in the CCI setting page.

Reviewed By: cortinico

Differential Revision: D58284941

fbshipit-source-id: 9a6ceb416de1d54f59f784a61509cd93f5684aaf
2024-06-07 05:32:44 -07:00
Pieter De BaetsandFacebook GitHub Bot 7ee2dcb0f0 Cleanup enableBridgelessArchitectureNewCreateReloadDestroy (#44826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44826

This was rolled out a while back, but some references remained.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58190612

fbshipit-source-id: e7884909959c98eb5617c9dee75f4ce53834b05c
2024-06-07 05:24:57 -07:00
Andrew CoatesandFacebook GitHub Bot dbdd4da14f Add ability to override the ViewStyle of the root View component (#44665)
Summary:
In order to host a ReactNative surface whose size is controlled by the RN content rather than the size of the surface, we need the ability to remove  the flex:1 style on the root View component.

`SurfaceHandler` has layout functions which take a `LayoutConstraint` (so min/max size).   The root View component in `AppContainer` has a hardcoded `flex:1` style.  This view is above the `WrapperComponent`, which we can currently override.  But I dont see anyway to avoid the root View having that flex style.  This flex style means that the rootview will always be the maxheight passed into the layout functions on `SurfaceHandler`.  Which prevents allowing RN surfaces that can size themselves based on their content.

This change adds a `setRootViewStyleProvider` method to `AppRegistry`, which works similar to `setWrapperComponentProvider` but allows apps to override the style property on the root View component.  In particular, this allows apps to remove the flex:1 style, which is required to enable react surfaces which are sized based on their contents.

## Changelog:

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Added AppRegistry.setRootViewStyleProvider

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

Test Plan: Will be including this change into react-native-windows to enable scenarios with content sized surfaces within Microsoft Office to work with the new architecture.  Would like signoff on this direction before I go and integrate it there.

Reviewed By: javache

Differential Revision: D58138443

Pulled By: hoxyq

fbshipit-source-id: 95ab4842aa7f827867788d8787527f9675cf4fcc
2024-06-07 03:19:43 -07:00
Wojciech LewickiandFacebook GitHub Bot f5c888c2d7 feat: move notifying observers to event dispatcher (#44474)
Summary:
Based on the discussion starting here: https://discord.com/channels/514829729862516747/1073566663825432587/1237407161991172157, I suggest moving the call to `_notifyEventDispatcherObserversOfEvent_DEPRECATED` straight to `RCTEventDispatcher.mm`. It was previously in `RCTInstance.mm` which is only relevant on bridgeless mode. We want to mimic the behavior of https://github.com/facebook/react-native/blob/06eea61c19cd730cf0c14a436f042d30791c3f4a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm#L75-L78 but without using `currentBridge` since it is considered bad practice: https://github.com/software-mansion/react-native-reanimated/issues/5497#issuecomment-2083400038.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[IOS] [CHANGED] - Move `notifyObservers` straight to `RCTEventDispatcher.mm`.

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

Test Plan:
See that example with `stickyHeaders` still works correctly on both bridgeless and bridge mode.

Videos with it on https://github.com/facebook/react-native/blob/deee037c62a7d62a349d34db427b14d3560ddf83/packages/rn-tester/js/examples/FlatList/FlatList-stickyHeaders.js example with more items for visibility:

- bridgeless:

https://github.com/facebook/react-native/assets/32481228/8b78104a-226b-466a-9f32-60ba4ec14100

- bridge:

https://github.com/facebook/react-native/assets/32481228/f2ca67cb-578f-45d4-954f-3249c6fa9410

- old arch:

https://github.com/facebook/react-native/assets/32481228/7d642923-ddda-4dd3-8f14-c9982a03bc2e

Reviewed By: javache

Differential Revision: D57097880

Pulled By: cipolleschi

fbshipit-source-id: de1504e90529fe4f001f44f02ace329386cf7727
2024-06-07 03:15:09 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ace899a2bb Setup Nightlies (#44741)
Summary:
This change adds a separate workflow for Nightlies. This workflow do not run tests on iOS and Android and proceed to release a nightly.

**🚨 Important 🚨** We need to update the GHA secrets as there is none set.

_Note: This is a first step to ensure that we can release Nightlies from GHA. I'll factor out all the actions in following updates to cleanup and refactor once we know that everything works!_

## Changelog:
[INTERNAL] - Add nightlies workflow on GHA

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

Test Plan:
1. Add the `pull_request` trigger to see the workflow start
2. Monitored the workflow to make sure that it worked
3. Tested the nightly locally
4. Removed the `pull_request` trigger, otherwise we would publish a nightly on each PR! xD

Reviewed By: cortinico

Differential Revision: D58084002

Pulled By: cipolleschi

fbshipit-source-id: 593145392fe686930ccb00beb68d9130b8401cbc
2024-06-07 01:27:25 -07:00
filip131311andFacebook GitHub Bot b957513cc6 Fix Application always in light mode on initial load. (#44335)
Summary:
Hi, I'm Filip from software mansion.  This PR solves a problem I stumbled upon.

On iOS, applications are always in light mode on initial load. Even if the device is turned to dark mode.

### Cause of the problem:

The initial appearance is taken from `RCTKeyWindow()`, but at the time of initialization of `RCTAppearance` it does not exist yet.

### Solution:

This PR moves repeats initialization of the appearance the first time `getColorScheme()` is called if it was not initialized properly before.

## Changelog:

[IOS] [FIXED] - Fix dark mode on initial load.

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

Test Plan:
- Create new React native app with `npx react-native@latest init AwesomeProjec`
- Run the application on iphone using simulator
- turn on dark mode using `cmd+shift+A`
- close application and run it again

### without changes:
  The application will turn on in light mode despite the simulator being set to dark mode.
  When you reload the application it works as expected (is in dark mode)

### with changes:
  Works as expected

#### note:
any change to device ui settings will trigger a listener that will set appearance to correct state, so testing of this problem should happen in as isolated conditions as possible.

Reviewed By: cortinico

Differential Revision: D58189058

Pulled By: cipolleschi

fbshipit-source-id: 9a864f3d045e966bc88601f661d221c4796c5c95
2024-06-07 01:03:29 -07:00
Blake FriedmanandFacebook GitHub Bot b5fd041917 swap test_ios_template for test_ios_helloworld in CircleCI (#44815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44815

Remove our `test_ios_template` job for `test_ios_helloworld`.

NOTE: There needs to be a followup to do the same in our Github Actions.

Changelog: [General][Changed] use helloworld instead of template for CI tests.

Reviewed By: cipolleschi

Differential Revision: D57122797

fbshipit-source-id: 744c79230b716716fdfc234832f1eb241e091893
2024-06-06 14:41:19 -07:00
Pieter De BaetsandFacebook GitHub Bot 4324f08749 Add experiment to bypass bridgeless background executor (#44797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44797

Noticed when profiling bridgeless that  that every call into JS would be passed via a (default priority) background thread first. This is inefficient from a scheduling perspective. Instead use the Task's default/immediate executor to immediately execute the success callback on the current thread and avoid a thread change.

This diff adds a new feature flag, to use the immediate executor for any ReactInstance method that doesn't require further synchronization within ReactInstance. For most methods, this is indeed unnecessary as ReactInstance will synchronize internally by scheduling work on the JS thread.

Changelog: [Android][Added] Added featureflag to avoid additional background threads during execution

Reviewed By: cortinico

Differential Revision: D58186090

fbshipit-source-id: 67ffed2d34083a6b6e7871160a2f3d6f1967d630
2024-06-06 13:15:45 -07:00
Kudo ChienandFacebook GitHub Bot 52cec1e798 Decouple DevInternalSettings from DevSupportManagerBase (#44441)
Summary:
I was tried to fix breaking changes for Expo's React Native nightlies CI testing. Recently React Native core has some effort to migrate Java code to Kotlin. Since https://github.com/facebook/react-native/commit/a977b2e69, we cannot reuse the `DevSupportManagerBase` and replace `DevInternalSettings` inside [expo-dev-client](https://github.com/expo/expo/blob/26c9f49042f53db7d37f832c133d4da0f6d64f02/packages/expo-dev-launcher/android/src/debug/java/expo/modules/devlauncher/helpers/DevLauncherReactUtils.kt#L117-L126) because we cannot access to the `DevInternalSettings` anymore because Kotlin "internal" visibility.
This PR tries to decouple `DevInternalSettings` from `DevSupportManagerBase` then we could still use reflection to change the mDevSettings.

## Changelog:

[ANDROID] [CHANGED] - Decouple `DevInternalSettings` from `DevSupportManagerBase`

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

Test Plan: CI passed

Reviewed By: tdn120

Differential Revision: D57054234

Pulled By: cortinico

fbshipit-source-id: e87d64518cf98182e1d98b215038a1755dae84a0
2024-06-06 12:14:04 -07:00
Ingrid WangandFacebook GitHub Bot ce10ce4d98 Migrate RCTScrollView off of deprecated scrollIndicatorInsets (#44789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44789

# Changelog

[iOS][Fixed] Remove usage of deprecated scrollIndicatorInsets in RCTScrollView

Reviewed By: cipolleschi

Differential Revision: D58157667

fbshipit-source-id: be0fd4075934060f9419a8164ad3f7fd378d3ce7
2024-06-06 09:28:29 -07:00
Elene BotchoradzeandFacebook GitHub Bot ed9978b8de feat(iOS): add all supported ReturnKeyTypes (#43362)
Summary:
Related issue: https://github.com/facebook/react-native/issues/43243
As [documentation](https://reactnative.dev/docs/textinput#returnkeytype) stated for the ReturnKeyType prop on the input there are different options, like "next", "go" and etc. They are actually supported on the iOS side but we can't use it in our react native app, because of the hardcoded version of DoneButton on existing code:
<img width="887" alt="image" src="https://github.com/facebook/react-native/assets/53994979/9ecaf63b-675c-45f0-b737-7ae3e937584a">
So, I decided to add support for types which were in documentation

## Changelog:
[IOS] [ADDED]: ReturnKeyTypes
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
ran yarn jest react-native-codegen and yarn jest react-native, both successfully:
<img width="420" alt="image" src="https://github.com/facebook/react-native/assets/53994979/c36b61f7-ef45-4062-ac5b-1dd2d0a9e544">

<img width="420" alt="image" src="https://github.com/facebook/react-native/assets/53994979/af83c22c-d110-4c28-94c1-d48ee27bfcfe">

Reviewed By: cortinico

Differential Revision: D56571845

Pulled By: cipolleschi

fbshipit-source-id: 74dbffb3795ab0b5c9eafa685761c2e770cd5cf9
2024-06-06 09:21:49 -07:00
Marlene CotaandFacebook GitHub Bot 3b60c86453 Fix signed/unsigned mismatch in BoundedConsumableBuffer.h (#44806)
Summary:
Previous PR (https://github.com/facebook/react-native/issues/44564) missed one int -> size_t switch to fix C4018 in react-native-windows.
![image](https://github.com/facebook/react-native/assets/1422161/373480ed-7f49-4c01-a7ac-ea65a347ab1c)

## Changelog:

[INTERNAL] - Fix signed/unsigned mismatch in BoundedConsumableBuffer.h

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

Test Plan: Builds on Windows + identical to forked file used in react-native-windows.

Reviewed By: cortinico

Differential Revision: D58234088

Pulled By: javache

fbshipit-source-id: 0453f3509c97854975b90e7a3b8c458ca977ec65
2024-06-06 08:43:50 -07:00
Moti ZilbermanandFacebook GitHub Bot bbf8a87ce7 Defer HostTarget destruction until after the instance has been unregistered (#44767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44767

Changelog: [Internal]

Fixes a lifecycle bug in both the Bridge (`com.facebook.react.bridge`) and Bridgeless (`com.facebook.react.runtime`) integrations of Fusebox in React Native Android, whereby `HostTarget::unregisterInstance` gets called after the `HostTarget` has been destroyed.

The solution consists of two parts:

1. If a ReactHost / InstanceManager is asked to destroy itself while it contains no active ReactInstance / ReactContext, we destroy the `HostTarget` immediately.
2. Otherwise, if there *is* a live ReactInstance / ReactContext that has yet to be destroyed, we wait for that to happen before destroying the `HostTarget`. In practice, we do this by checking for the BEFORE_CREATE ( = Host destroyed) lifecycle state every time we destroy a ReactInstance / ReactContext.

Reviewed By: javache

Differential Revision: D58031215

fbshipit-source-id: 321c73e85afd17a1b38c63f73aee5ebb59c00686
2024-06-06 07:38:23 -07:00
Blake FriedmanandFacebook GitHub Bot 9744fa9283 cli support to bundle, build & upload (#44722)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44722

Add support for bundling, building and uploading on iOS.  I've verified these locally and will enable on CircleCI to validate.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915365

fbshipit-source-id: 1e73918b31f70d337de4d3aee934c8acf88c86d0
2024-06-06 07:06:29 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 756f89aa59 feat: set Swift active compilation conditions build setting to DEBUG (#42330)
Summary:
This PR adds cocoapods utility to set `SWIFT_ACTIVE_COMPILATION_CONDITIONS` to DEBUG, which is set to this value by default (when generating a new native Xcode project).

This allows to use the `#if DEBUG` compilator directive in Swift to work out of the box, without any changes on user's side:

```swift
override func bundleURL() -> URL? {
#if DEBUG
    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
    Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }
```

## Changelog:

[IOS] [ADDED] - Set SWIFT_ACTIVE_COMPILATION_CONDITIONS to DEBUG

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

Test Plan:
Run `bundle exec pod install` and check if the active compilation flags are populated:

![CleanShot 2024-01-17 at 13 11 03@2x](https://github.com/facebook/react-native/assets/52801365/68f119a6-af47-41bc-a1f1-9085fe4df6a0)

Reviewed By: cortinico

Differential Revision: D58188103

Pulled By: cipolleschi

fbshipit-source-id: 64746f3c7bfbdf47c2dea5e5e8cb2962635b719b
2024-06-06 04:06:28 -07:00
Kudo ChienandFacebook GitHub Bot 8956869792 Support customizeRootView from RCTRootViewFactory (#44775)
Summary:
The new `customizeRootView` does not have the feature parity as `createRootViewWithBridge` where reusing RCTRootViewFactory to create a root view, it does not call `customizeRootView`. This PR moves the `customizeRootView` support from RCTAppDelegate into RCTRootViewFactory and improves the customizeRootView support.

## Changelog:

[IOS] [CHANGED] - Support `customizeRootView` from `RCTRootViewFactory`

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

Test Plan:
Add customizeRootView to **packages/rn-tester/RNTester/AppDelegate.mm** and test whether RNTester has blue background color in both new arch and old arch mode.

```objc
- (void)customizeRootView:(RCTRootView *)rootView
{
  rootView.backgroundColor = [UIColor blueColor];
}
```

Reviewed By: dmytrorykun

Differential Revision: D58179693

Pulled By: cipolleschi

fbshipit-source-id: 0fac9a1bd5b2583a2700b3a3d2c80d0f608c4481
2024-06-06 03:50:50 -07:00
George ZaharievandFacebook GitHub Bot 7781c2780c Update hermes-parser and related packages in fbsource to 0.22.0 (#44804)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44804

Bump hermes-parser and related packages to [0.22.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D58172293

fbshipit-source-id: 9261a4d2e4fd2319c168f36d9928857b7bed37c2
2024-06-06 02:35:20 -07:00
Alex HuntandFacebook GitHub Bot a569c82eb5 Back out "chore(dev-middleware): add localhost as default host in start command config" (#44800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44800

This is a revert of https://github.com/facebook/react-native/pull/44244, as we've observed [breaking behaviour](https://github.com/facebook/react-native/pull/44244#issuecomment-2078957734) where Android emulators could not connect to the dev server with default settings.

The team doesn't have bandwidth/prio to figure this out with the default `host` value just now, so we are reverting.

Changelog: [Internal] (Nullifies c402dcf)

Reviewed By: cipolleschi

Differential Revision: D58192651

fbshipit-source-id: dd2183d6baa6499ab59e21365adfe62e7a786dfc
2024-06-05 09:48:16 -07:00
Blake FriedmanandFacebook GitHub Bot eba1828a83 directly call community-cli-plugin in react-native-xcode.sh (#44721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44721

For iOS builds of `react-native`, the [react-native-xcode.sh](https://www.internalfb.com/code/fbsource/[7ad79aae3e8bf565d53f087ac7f7b7622b19acec]/xplat/js/react-native-github/packages/react-native/scripts/react-native-xcode.sh) script is executed as one of the build phases.  This phase bundles the JS application (dev or production).

I've updated this to use the new `bundle.js` script instead of calling the `react-native/cli.js`.  This is identical except with how the config is captured:

{F1669960016}

This is similar to our approach with the Gradle plugin, giving Framework authors more control.

**Other:** formatting changes for the Privacy Manifest that Xcode keeps updating.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915368

fbshipit-source-id: f52ea4b3cb94212ac97a3d7edeb68747418fe0a9
2024-06-05 09:08:16 -07:00
Edmond ChuiandFacebook GitHub Bot 7ae0e46530 Update debugger-frontend from 94c8238...3307f31 (#44798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44798

Changelog: [Internal] - Update `react-native/debugger-frontend` from 94c8238...3307f31

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/94c8238595b2abd157fd615095946f90ed10af32...3307f310241a11811288f70c756fded3b9ec2951).

Reviewed By: hoxyq

Differential Revision: D58189077

fbshipit-source-id: 58d87e8ee3c193820b4ab8019068fe0714a02cdc
2024-06-05 08:16:28 -07:00
Giulio JiangandFacebook GitHub Bot 42299499d8 Limit log spam from FrameBasedAnimationDriver (#44782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44782

## Changelog:

[Android] [Fixed] - Reduce maximum log spam from FrameBasedAnimationDriver

Reviewed By: ahmed-shehata

Differential Revision: D58135399

fbshipit-source-id: 355524b9b96bb1fc9de73fddb6486b1c377da077
2024-06-05 05:31:33 -07:00
Alex HuntandFacebook GitHub Bot a1e8118541 Fix ANDROID_ID segment for inspector device ID
Summary:
Fixes a bug where page IDs would collide for multiple connected Android devices running the same React Native app. The `Secure.ANDROID_ID` key (not value!) was being substituted in the ID string (pre-hashing) — now this segment is fixed.

Changelog:
[Android][Changed] - Update constructor signature of `DevServerHelper`

Reviewed By: hoxyq

Differential Revision: D58134323

fbshipit-source-id: 859e2758108e266167205a777bb6a6e87ca0573b
2024-06-05 04:24:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f71d7d7281 Exclude windows from React-Fabric
Summary:
## Changelog:
[Internal] - Exclude the windows folder from View in React-Fabric podspec

## Facebook:
The `platforms/windows` folder is internal only, not synched with OSS.

However, the C++ linking was picking up some files from that folder when running RNTester on iOS using the OSS pipeline.

bypass-github-export-checks

Reviewed By: dmytrorykun

Differential Revision: D58182437

fbshipit-source-id: 5397fadbe96d5c2c7980fbf5e74ffab7b237b912
2024-06-05 03:25:01 -07:00
Danny SuandFacebook GitHub Bot bb61e07739 Don't strip TargetDelegate (#44790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44790

Was seeing crash due to:
> Abort message: 'terminating due to uncaught exception of type facebook::jni::JniException: java.lang.NoSuchMethodError: no non-static method "Lcom/facebook/react/bridge/ReactInstanceManagerInspectorTarget$
TargetDelegate;.onSetPausedInDebuggerMessage(Ljava/lang/String;)V"

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D58165901

fbshipit-source-id: ceafd5776933fca5abb2e2edcac5e5f677cb7f7d
2024-06-04 23:43:07 -07:00
Rubén NorteandFacebook GitHub Bot 2d9e54bbb1 Re-enable event loop in OSS (#44788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44788

We disabled the event loop in RN on the main branch after we found some issues in the implementation. Those have been resolved already so we can re-enable it again.

For context, it's already enabled in the latest branch so this is just for main.

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D58146393

fbshipit-source-id: ab908ecbd507d7087137a36cad5cc917eb7b1311
2024-06-04 16:21:44 -07:00
Pieter De BaetsandFacebook GitHub Bot 627cdd5ddd Move MountingManagerTest to open-source (#44765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44765

Noticed this was not shared with open-source. Needs to be converted to Kotlin still.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58088583

fbshipit-source-id: 51d13f2faddc7bce297dda54f2dd23cefed6a588
2024-06-04 15:05:08 -07:00
Nicola CortiandFacebook GitHub Bot 3f3abf5b40 Kotlin to 1.9.24 (#44787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44787

Another patch bump for our dependencies ahead of branch cut.

Changelog:
[Android] [Changed] - Kotlin to 1.9.24

Reviewed By: cipolleschi

Differential Revision: D58143548

fbshipit-source-id: 70654cb821c220ff0eed37e37ce3e68ff8e7d3a1
2024-06-04 14:51:39 -07:00
Nicola CortiandFacebook GitHub Bot f6a490b036 AGP to 8.4.1 (#44785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44785

Just another patch bump of our dependencies ahead of the branch cut

Changelog:
[Android] [Changed] - AGP to 8.4.1

Reviewed By: cipolleschi

Differential Revision: D58143546

fbshipit-source-id: 6356b444b4a1514cf8dce6eead0c80ba725e555e
2024-06-04 14:51:39 -07:00
Nicola CortiandFacebook GitHub Bot f9b69cdb81 Gradle to 8.8 (#44786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44786

Just bumping our deps before the 0.75 branch cut.

Changelog:
[Internal] [Changed] - Gradle to 8.8

Reviewed By: cipolleschi

Differential Revision: D58143547

fbshipit-source-id: 0762e36aabecda66ba637be8d02d8147d7e32d27
2024-06-04 14:51:39 -07:00
Nicola CortiandFacebook GitHub Bot 744024be7f Fresco to 3.2.0 (#44783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44783

This resolves CVE-2018-14498 coming from libjpeg-turbo via Fresco.
https://github.com/facebook/fresco/issues/2728

Changelog:
[Android] [Changed] - Bump Fresco to 3.2.0 to fix CVE-2018-14498

Reviewed By: javache

Differential Revision: D58136396

fbshipit-source-id: 6889f082fac501d0915e444c4e1130bc08c66e6d
2024-06-04 11:04:36 -07:00
Alex HuntandFacebook GitHub Bot 4d1fedc527 Add changelog for 0.74.2 (#44784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44784

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D58143431

fbshipit-source-id: 3c189107f972685136cdca0af1bbb8f4ebcd71b7
2024-06-04 10:49:57 -07:00
Pieter De BaetsandFacebook GitHub Bot 95c721646d Remove unused Bolts code from runtime (#44779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44779

We forked a copy of Bolts when we open-sourced bridgeless, but it contains many features we don't require, since we only use Tasks to orchestrate the bridgeless startup path.

The only meaningful change I made is removing the fallback on stack overflow from the immediate executor, which is not something we expect to hit during startup, and would be better surfaced as a StackOverflowException.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58087989

fbshipit-source-id: a4908723a04bf47fdc38d91bf47df928b91456f5
2024-06-04 10:36:09 -07:00
Edmond ChuiandFacebook GitHub Bot a9bcc0d46c Update debugger-frontend from 78d3771...94c8238 (#44781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44781

Changelog: [Internal] - Update `react-native/debugger-frontend` from 78d3771...94c8238

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/78d377129ab12bd3b80d1b9416699b01149f4ccf...94c8238595b2abd157fd615095946f90ed10af32).

Reviewed By: motiz88

Differential Revision: D58090889

fbshipit-source-id: 61065d58c3ec6c05d098f6039ab79a47cd05080a
2024-06-04 08:16:48 -07:00
Alex HuntandFacebook GitHub Bot bb3f35f38a Back out "Remove legacy InspectorPackagerConnection"
Summary:
Revert of D58017460 + remove TODO comments.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D58132473

fbshipit-source-id: 81e14e5fc0ab461f11c4ecb64d3fee14986fe4f7
2024-06-04 07:35:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 6c2e1cf230 Add Java assertions for order of Host/Instance inspector target teardown (#44766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44766

Changelog: [Internal]

There is currently a lifecycle bug in both the Bridge (`com.facebook.react.bridge`) and Bridgeless (`com.facebook.react.runtime`) integrations of Fusebox in React Native Android, whereby `HostTarget::unregisterInstance` gets called after the `HostTarget` has been destroyed. This manifests as a handful of related C++ crashes depending on the exact circumstances and build flags.

This diff makes the bug trigger a Java assertion instead of a C++ crash for ease of debugging. The next diff in the stack will actually fix the lifecycle issue.

Reviewed By: hoxyq

Differential Revision: D58031217

fbshipit-source-id: 9301b34edf5e526cbc72d86e78b328d29c9921b5
2024-06-04 07:02:37 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f471b92b03 Remove publish bumped packages from CircleCI (#44778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44778

We now have the Publish_bumped_packages in GHA, so we should not have two jobs in two different systems that perform the same publishing operation.

## Changelog:
[Internal] - Remove duplicated jobs from CCI

Reviewed By: cortinico

Differential Revision: D58131196

fbshipit-source-id: 408b0a76dff89e9d327fe56d1e6e4c13b55eb2bb
2024-06-04 05:58:10 -07:00
Jakub PiaseckiandFacebook GitHub Bot 91c5a6d936 Fix border drawn over children on iOS (#44777)
Summary:
Fixes https://github.com/facebook/react-native/issues/44690

In the code responsible for drawing border on iOS there's a comment saying:
> iOS draws borders in front of the content whereas CSS draws them behind the content. For this reason, only use iOS border drawing when clipping or when the border is hidden.

The condition that follows checks whether the content is clipped and the width and alpha channel of the border: https://github.com/facebook/react-native/blob/e0a2e86d0346bd7e40adf69311daa538ca8c9c5f/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L643-L644.

The problem is when the color is not set at all - `colorComponentsFromColor(borderMetrics.borderColors.left).alpha` will be equal to 0 since the relevant `SharedColor` is `null`: https://github.com/facebook/react-native/blob/e0a2e86d0346bd7e40adf69311daa538ca8c9c5f/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm#L76-L86

Then it uses the path with the default iOS behavior (drawing the border on top of the content) instead of the custom one (with the border below) and it seems like it defaults to drawing black when the passed color is `nil`.

This PR simply adds one more check to make sure the color is actually set before choosing the default platform behavior.

## Changelog:

[IOS] [FIXED] - Fixed border being drawn over children when no color was set

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

Test Plan:
Tested on the code from the issue.

|Before|After|
|-|-|
|<img width="546" alt="Screenshot 2024-06-04 at 11 18 14" src="https://github.com/facebook/react-native/assets/21055725/f13250a9-2e99-41c5-a9bc-02d65c00a6c0">|<img width="546" alt="Screenshot 2024-06-04 at 11 17 38" src="https://github.com/facebook/react-native/assets/21055725/f4571a5f-dfc4-4191-854c-fd3faf698b29">|

Reviewed By: cortinico

Differential Revision: D58131337

Pulled By: cipolleschi

fbshipit-source-id: 7da247d81ecec586de6f0023e0cb399f9966213d
2024-06-04 05:57:33 -07:00
Sam ZhouandFacebook GitHub Bot e0a2e86d03 Deploy 0.237.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D58120938

fbshipit-source-id: f789623005f47ab9d6dd134819a08bc832642a22
2024-06-03 21:27:39 -07:00
Nick LefeverandFacebook GitHub Bot 839ee0aae9 Add unit test for runtime reference updates on clone (#44758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44758

Changelog: [Internal]

Adding a unit test to verify that the shadow node references are correctly updated to reference the new shadow node instance after cloning.

Reviewed By: sammy-SC

Differential Revision: D57893880

fbshipit-source-id: 6e36ca3d1b159f7bafb084246f714f3bfec58c1e
2024-06-03 20:25:46 -07:00
Nick LefeverandFacebook GitHub Bot bb9917a580 Update runtime shadow node references only on layout (#44773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44773

Changelog: [Internal]

Update runtime shadow node references for cloning happening within `YogaLayoutableShadowNode` during layout. This will update the JS references to shadow nodes with the latest layout metrics used to render the component and improve layout cache usage on the next commit.

Reviewed By: sammy-SC

Differential Revision: D58000071

fbshipit-source-id: 373d41f37a81e81ab8f23006491027473493de61
2024-06-03 20:25:46 -07:00
Nick LefeverandFacebook GitHub Bot 4806077457 Add feature flag for clone reference updates only on layout (#44771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44771

Changelog: [Internal]

Adding a feature flag for enabling runtime shadow node reference updates only for clones happening within `YogaLayoutableShadowNode` to support layout data changes.

Reviewed By: sammy-SC

Differential Revision: D58000072

fbshipit-source-id: 204c0488edb992511a4b33d098b9df1b04001b9d
2024-06-03 20:25:46 -07:00
Nick LefeverandFacebook GitHub Bot a643e191f6 Update runtime shadow node references when cloning within react native (#44770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44770

Changelog: [Internal]

Any shadow node cloning happening outside the execution of the UIManagerBinding `cloneNode` function should update references held to the shadow node to reference the latest revision. All shadow node cloning not requested by the JS runtime should update the references to those shadow nodes within the JS runtime so that these would hold the latest state updated outside of the React renderer (i.e. state data and layout metrics).

This guarantees that the React renderer's current fiber tree holds references to the ShadowNode instances that acually were layed out and committed for rendering on the native side. Maintaining these references up to date on the JS current fiber tree allows to maximize layout cache usage on subsequent commits.

Reviewed By: sammy-SC

Differential Revision: D57860867

fbshipit-source-id: f13e3fa9ad501fb2c8a387fb58b6379d236d7c2d
2024-06-03 20:25:46 -07:00
Nick LefeverandFacebook GitHub Bot cc37634937 Make runtime shadow node references updatable from native (#44772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44772

Changelog: [Internal]

React native clones shadow nodes internally without providing the new instances to the React renderer (current fiber tree). To support updating the shadow node references held by the JS side, this diff wraps the returned shadow nodes and adds a link to the runtime reference on the shadow node instance.

This will allow for updating the shadow node references held within the JS runtime from the native side.

Reviewed By: sammy-SC

Differential Revision: D57860869

fbshipit-source-id: 1703f0cd0183e2760436920a122857e17fda8dbb
2024-06-03 20:25:46 -07:00
Nick LefeverandFacebook GitHub Bot 12411e9731 Add feature flag for shadow node reference updates (#44769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44769

Changelog: [Internal]

Adding a feature flag to conditionally enable shadow node reference updates when cloning nodes within react native.

Reviewed By: sammy-SC

Differential Revision: D57860868

fbshipit-source-id: 5542257cd22d9020b3d98a53ca872b5bde3c5738
2024-06-03 20:25:46 -07:00
generatedunixname89002005232357andFacebook GitHub Bot a6a7cdf0b7 Revert D57878119: Multisect successfully blamed "D57878119: [RN] [Android] Fix status bar height calculation for all cutout sizes" for one test failure
Summary:
This diff reverts D57878119
D57878119: [RN] [Android] Fix status bar height calculation for all cutout sizes by Abbondanzo causes the following test failure:

Tests affected:
- [xplat/endtoend/jest-e2e/apps/fb4a/__tests__/dating/onboarding/fb4aDatingOnboardingSessionImpressionLogging-e2e.js](https://www.internalfb.com/intern/test/562949977559606/)

Here's the Multisect link:
https://www.internalfb.com/multisect/5267005
Here are the tasks that are relevant to this breakage:
T189149205: 17 critical tests unhealthy for oncall dating_react_native_sop

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D58053899

fbshipit-source-id: c65a1094259f85c8e6084b2f191ca1e4cd149510
2024-06-03 09:45:15 -07:00
Edmond ChuiandFacebook GitHub Bot c43adb2134 Update debugger-frontend from bf5ec69...78d3771 (#44753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44753

Changelog: [Internal] - Update `react-native/debugger-frontend` from bf5ec69...78d3771

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

Reviewed By: huntie

Differential Revision: D58069944

fbshipit-source-id: 8a5ce5644c208eb13cb3d5d839d00bd7657a52d1
2024-06-03 09:11:52 -07:00
Pieter De BaetsandFacebook GitHub Bot 9d3bac6fd5 Integrate perfetto with UserTiming API (#44702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44702

Based on bgirard initial changes in D53478653, this creates an initial integration of the Perfetto SDK with the User Timing API, allowing performance information to be logged from JS to Perfetto traces.

We only enable this for Android right now, but may be able to leverage this on other platforms too in the future.

The logic in `initializePerfetto` may need to moved to another common target (eg reactperflogger) once we want to make this usable in other components, but keeping it scoped to User Timing for now.

Changelog: [Internal]

Reviewed By: bgirard

Differential Revision: D57881823

fbshipit-source-id: 11ba09cbc01a102a72eee65ce6d6aeca508e864a
2024-06-03 08:55:48 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 84ff977b37 Fix GHA for Publish bumped packages (#44760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44760

This change fixes the gha that should publish bumped packages.

## Changelog
[Internal] - Fix CI

Reviewed By: huntie

Differential Revision: D58084675

fbshipit-source-id: 16639f5413dbe2a7182561a1de911194ae52a161
2024-06-03 07:10:34 -07:00
Riccardo CipolleschiandFacebook GitHub Bot be38fbb3f8 Add publish_bumped_packages in GHA
Summary:
This change introduce the publish_bumped_packages job in GHA as this job was not ported before.

This is a porting of [this workflow](https://github.com/facebook/react-native/blob/main/.circleci/configurations/workflows.yml#L128-L135), which calls the [`find_and_publish_bumped_packages`](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L1278-L1289) which uses the [`build_packages`](https://github.com/facebook/react-native/blob/main/.circleci/configurations/commands.yml#L100-L104) command

## Changelog:
[Internal] - Add the `publish_bumped_packages` to GHA

Reviewed By: huntie

Differential Revision: D58016209

fbshipit-source-id: 3c8cf7bc50eeaf11b00850fc2251183b12b18d20
2024-06-03 06:14:58 -07:00
Alex HuntandFacebook GitHub Bot c144382316 Remove legacy InspectorPackagerConnection (#44746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44746

Cleanup after this experiment's removal in D57730921.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D58017460

fbshipit-source-id: f9328875d6ef9a76599ae560c58cef6caab87a57
2024-06-03 06:04:50 -07:00
Blake FriedmanandFacebook GitHub Bot ec1742a6bb build and bundle (#44720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44720

Bug fixes to bootstrap, build and bundle on iOS.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915363

fbshipit-source-id: 1c82f0020572d7d9bf599a7c568dfc6f3a3292e8
2024-06-03 06:01:43 -07:00
Pieter De BaetsandFacebook GitHub Bot 910cde6134 Remove types for removed onTextInput events (#44480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44480

TextInputs' onTextInput callback was removed way back in React Native 0.62 with https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab , but remnants of the implementation exists.

Fully remove references on JS side now that no older clients are emitting this event

Changelog: [General][Removed] Remove viewconfigs for onTextInput callbacks

Reviewed By: cipolleschi

Differential Revision: D57092733

fbshipit-source-id: 62dae37d8e8f155969a1ca65131d4ee9a1d5f1c4
2024-06-03 05:05:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 31d6ed14d0 Remove Old Arch build jobs (#44729)
Summary:
Based on https://github.com/facebook/react-native/issues/44723.
This PR removes some Old Arch build only jobs on iOS.
Some of the recent changes where unifying the build process across archs, so we don't have to build Old and New Arch

## Changelog:
[Internal] - Remove OldArch jobs when they are not required

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

Test Plan: CCI is green

Reviewed By: cortinico

Differential Revision: D57975238

Pulled By: cipolleschi

fbshipit-source-id: ffd0ff0534f25019d501aa3862baee1442088784
2024-06-03 03:09:51 -07:00
Samuel SuslaandFacebook GitHub Bot 033a55f7fb clarify systrace annotations in MountItemDispatcher (#44747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44747

changelog: [internal]

Change names of systrace blocks to better reflect where the operation is happening.

Reviewed By: rubennorte

Differential Revision: D57969459

fbshipit-source-id: 3c857a66f060992e1792e18973caafea7c995c5b
2024-06-01 00:56:31 -07:00
Nick GerlemanandFacebook GitHub Bot c046198cc9 Add more clipping examples (#44735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44735

Add some more examples of overflow clipping for scrollview, text, textinput.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57999676

fbshipit-source-id: dfede321b2c7c61dda3afaf2aea784f6c295c384
2024-05-31 12:06:33 -07:00
Nick GerlemanandFacebook GitHub Bot a1f68dbfb4 Avoid returning mutable Path in CSSBackgroundDrawable (#44733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44733

We are returning a Path to callers, which shouldn't be mutated. This isn't really safe. Return a copy to external callers instead, if they need a path to work with.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57996157

fbshipit-source-id: 53cd95df6e2641d946f7c3fef40f6449b16ca5cb
2024-05-31 12:06:33 -07:00
Nick GerlemanandFacebook GitHub Bot 869eebe02d Fix CSSBackgroundDrawable.java Path accessor nullability (#44732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44732

`getBorderBoxPath()` and `getPaddingBoxPath()` currently assume `updatePath()` will set a path, but this does not happen on Android 24 emulators where it seems like `onBoundsChanged` isn't called to set flag for needing update.

But, the current design tries to be lazy with path generation, and these are probably more expensive to clip, so we should really make these functions return nullable value, then fall back to rect, like the internals of `CSSBackgroundDrawable`, and how I misremembered these as working in the view code added originally in D57668976.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57951852

fbshipit-source-id: 33bc8f738950597822ae9026408ab3a23b0923f3
2024-05-31 12:06:33 -07:00
Aakash PatelandFacebook GitHub Bot a0237e96f1 Enable regenerator transform for hermes-canary (#44668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44668

Enables regenerator for `hermes-canary`. Along with the previous diff, regenerator is the only difference between `hermes-stable` and `hermes-canary`.

Reviewed By: motiz88

Differential Revision: D57742907

fbshipit-source-id: ca14cb50fe976744c7fa2c0b3397e81661359f15
2024-05-31 12:03:04 -07:00
Aakash PatelandFacebook GitHub Bot b5b497ff10 Align hermes-canary and hermes-stable profiles (#44728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44728

This makes them identical so the diff that makes them diverge is clear.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D57970711

fbshipit-source-id: 8586ef202ad27796918378832fa62df1708a0218
2024-05-31 12:03:04 -07:00
Sam ZhouandFacebook GitHub Bot f4325dac8e Replace direct React.createElement call with jsx in react-native (#44738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44738

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58004147

fbshipit-source-id: f42c939d92a876b8746703c134b246567846c3ee
2024-05-31 10:06:09 -07:00
Pieter De BaetsandFacebook GitHub Bot 48f48f8e67 Handle Java exceptions without message correctly (#44744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44744

Correctly handle TurboModule promise rejections when there is no Exception message.

Changelog: [Android][Fixed] Android exceptions without a message would lead to unexpected crashes

Reviewed By: fabriziocucci

Differential Revision: D58014797

fbshipit-source-id: c94042818a00669a1be2db8e89e84c6b616efbec
2024-05-31 09:48:22 -07:00
Peter AbbondanzoandFacebook GitHub Bot cc485ccf7d Fix status bar height calculation for all cutout sizes (#44697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44697

Google has discouraged attempting to read the `status_bar_height` resource [since 2017](https://youtu.be/_mGDMVRO3iE?si=qGQd7gLa_qTmfLGL&t=1079). With the introduction of display cutouts there can be a mismatch between the resource value and the true status bar size (and issues like [this one](https://github.com/facebook/react-native/issues/33612) popped up). The recommended approach is to instead call `getInsets` with the proper status bar and navigation flags provided by `WindowInsets`. On older APIs where `getInsets` is not supported, we have access to `systemWindowInsetTop`.

Changelog:
[Android][Fixed] - Fixed StatusBar.currentHeight calculations to honor all cutout sizes

Reviewed By: cipolleschi, alanleedev

Differential Revision: D57878119

fbshipit-source-id: 9fadd33d5f9b617a70a052c98dbd53fd29281650
2024-05-31 08:57:41 -07:00
Rubén NorteandFacebook GitHub Bot db1043dfbf Continue running microtasks when parent task throws
Summary:
Changelog: [General][Fixed] Fixed LogBox not showing correctly on the New Architecture

We found an incorrect behavior in the event loop, where an error in a task would prevent its microtasks from running. This isn't spec compliant and should be fixed.

This caused LogBox to not work correctly, as error reporting is implemented via microtasks that would never execute.

Reviewed By: sammy-SC

Differential Revision: D58010521

fbshipit-source-id: 7901c5d6e83fb63af148e12ad6c32be490a3999d
2024-05-31 05:20:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 68d513bd21 Run GHA on main (#44723)
Summary:
In the previous months, we worked with a GH engineer to run our test workflow on PRs. The workflow was running properly, so we want to run it on main too.

## Changelog:
[Internal] - Run gha on main too

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

Test Plan: GHA is green

Reviewed By: cortinico, NickGerleman

Differential Revision: D57975230

Pulled By: cipolleschi

fbshipit-source-id: 89d06361ad6f2230b7000e05970e9b16539c9164
2024-05-31 02:52:52 -07:00
Kudo ChienandFacebook GitHub Bot d999e9bf1e Add BindingsInstaller for TurboModules on Android (#44526)
Summary:
Add synchronous JS bindings installation for TurboModules. That would help some 3rd party JSI based modules to install JS bindings easier.
https://github.com/facebook/react-native/issues/44486 for Android

## Changelog:

[Android] [ADDED] - Add BindingsInstaller for TurboModules

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

Test Plan:
Added test in RN-Tester TurboModule test case

 {F1660267530}

 {F1660287029}

Reviewed By: javache

Differential Revision: D57223328

Pulled By: philIip

fbshipit-source-id: d4a69a16f6ce77c0a0fd63f008bea929b1964ab8
2024-05-30 20:43:27 -07:00
Nick GerlemanandFacebook GitHub Bot c2c9b27ff2 Add extra logging for invalid Paragraph Attributes MapBuffer (#44709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44709

Add some extra logging to try to figure out heisenbug, where we cannot find MapBuffer key that we should expect to be present, only during view preallocation.

ReadableMapBuffer toString() will itself iterate through MapBuffer entries, so this might not return something sane if underlying MapBuffer is corrupt or wrongly oriented, but should give us more context.

We also need to be careful here, to avoid logging the actual state mapbuffer or its binary which may contain text content. Only the paragraph attributes.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D57925730

fbshipit-source-id: cecca1a1fe53b4b417d520e65c30d47243cb2fb2
2024-05-30 17:33:43 -07:00
Soe LynnandFacebook GitHub Bot e880ed76fe DrawerLayoutAndroid fix for Layout inspector to select correct node (#44707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44707

Changelog: [Internal]

For DrawerLayoutAndroid in New Architecture, when we use ReactDev Tools layout inspection, incorrect node is being shown in the inspector tools.

This is because pointerEvents is not set to either `box-none` or `none` based on the drawer open/close state for the drawer child wrapper `View`.

Reviewed By: hoxyq

Differential Revision: D57873834

fbshipit-source-id: b2b82633969922189a0b96feea2115ddc0b2ebb5
2024-05-30 17:09:25 -07:00
Rubén NorteandFacebook GitHub Bot 0bea4cd0cc Mark root view as attached after executing all pending operations (#44726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44726

Changelog: [internal]

## Context

We ran an experiment to test synchronous state updates in Fabric and we saw some crashes on Android. Those crashes were caused by mounting operations not being applied in the correct order.

There were 2 root causes for that problem:
1. State updates triggered during mount would be committed and mounted synchronously during that specific mount operation. That caused problems like trying to clip views that weren't created already (as we were processing the state update for the content offset before we actually created the child views).
2. Same problem as before, but with mount operations that were processed when the root view wasn't available yet (this is a separate queue).

We tried to fix the problem in https://github.com/facebook/react-native/pull/44015, but the solution for 2) was incorrect, as we didn't account for those operations being in a different queue (it was reverted in https://github.com/facebook/react-native/pull/44724).

## Changes

I think the right solution for point 2) is that, instead of marking the root view as available and then process all pending operations, we flip those operations.

That was, if there are any mount operations as a side-effect of processing that queue, those will also be added to the same queue, instead of being processed immediately in `MountItemDispatcher`.

Reviewed By: sammy-SC

Differential Revision: D57968937

fbshipit-source-id: 93d10cdeced0c837d4301768aee8575d2c940b10
2024-05-30 12:37:17 -07:00
Rubén NorteandFacebook GitHub Bot d1c72016c1 Allow recursive calls to schedulerShouldRenderTransactions without deadlocks (#44725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44725

Changelog: [internal]

## Context

We're currently testing synchronous state updates in Fabric (committing shadow trees for state updates synchronously in the thread where they were dispatched, instead of always scheduling it in the JS thread).

In these experiments we saw a problem caused by a recent change in the Android mounting layer (done to fix a problem with the Event Loop) where we were doing the mount operations inside a mutex lock. The problem is that we didn't have recursive commit+mount operations (because we were dispatching state updates in the JS thread) but now that we do we get a deadlock here.

 {F1659804385}

These recursive commit+mount operations happen because it's possible to trigger state updates while we mount changes in the host platform (e.g.: we create the scroll view and we update the state to set the content offset). Those state updates trigger more mount operations, which deadlock in the mentioned place.

## Changes

This fixes the described issue by restricting the lock only to access the list of pending operations, but not to apply them. In the current implementation, `mountingManager->executeMount` is protected by the lock, whereas in the new version it isn't (so it can be safely called recursively). The synchronization of the mount operations is done directly at the mounting layer on Android.

Reviewed By: sammy-SC

Differential Revision: D57968936

fbshipit-source-id: 52f996d212cad691646610632b03b5223e7e90ca
2024-05-30 12:37:17 -07:00
Rubén NorteandFacebook GitHub Bot 958c2e840a Revert batching for mount operations accumulated before root view attached (#44724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44724

Changelog: [internal]

Batching operations at this layer was wrong because these are the operations that were already flushed by the mounting layer but were accumulated in `SurfaceMountingManager` because the root view wasn't created.

These operations should be executed before anything else that's scheduled in the `MountItemDispatcher`, so we should never batch them. The problem this was trying to solve is solved in a different way in D57968937.

This was gated so this shouldn't affect any current usages.

Reviewed By: sammy-SC

Differential Revision: D57968939

fbshipit-source-id: e9131614cdc76e9d553540757611bc8b0736c927
2024-05-30 12:37:17 -07:00
Dmitry RykunandFacebook GitHub Bot c0692ab063 Re-land: Fix race condition in native module invalidation (#44727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44727

This is a re-land of https://github.com/facebook/react-native/pull/44048

Reverting it caused even bigger regression, so my earlier assessment was wrong. The initial regression was caused by something else.

Changelog: [Internal] - Let's keep the changelog entry form the original diff.

Reviewed By: fkgozali

Differential Revision: D57970133

fbshipit-source-id: c683d661a805d44434f5491e89dd4b7218379bee
2024-05-30 11:42:22 -07:00
Blake FriedmanandFacebook GitHub Bot 3b59b27087 fix rxjs flow types linting warnings (#44719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44719

Removed shadowing of generic values, which would cause warnings.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915364

fbshipit-source-id: 6abf68a62fca88687343ac5677ac905e87220a91
2024-05-30 08:20:00 -07:00
Blake FriedmanandFacebook GitHub Bot 32b5c9601f listr → listr2 (#44716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44716

Move to listr2 which handle non-TTY environment, outputting to CircleCI logs in a useful way.  This gives our CI users more useful debugging information, but limits the output when running locally.

If you want more explicit output locally, do something like:

```
yarn run build | cat
```

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D57915369

fbshipit-source-id: ae9f87b0b9608f16ee035b791c5f7b81544c498c
2024-05-30 07:40:36 -07:00
Saad NajmiandFacebook GitHub Bot c67dfbbe42 chore(ci): Set retryOnFailure for RNTester iOS Unit and Integration tests (#44642)
Summary:
On React Native macOS (I am not sure with the current state of React Native), the Xcode Unit and Integration tests are a bit flaky. Rather than set "retry on failure up to 3 times" through the pipeline config (in our case, Azure Pipelines), I realized my earlier PR to use Xcode test plans (https://github.com/facebook/react-native/pull/36443) means we can have Xcode retry the test. This should be faster than retrying it on the pipeline, because it retries just the failing test, not the entire "test" step. I did this on React Native macOS, so I'm doing it upstream so we can remove a diff.

## Changelog:

[INTERNAL] [CHANGED] - Set `retryOnFailure` for Xcode Unit and Integration tests

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

Test Plan: CI should pass (faster)

Reviewed By: cortinico

Differential Revision: D57662523

Pulled By: cipolleschi

fbshipit-source-id: 8de2ab0ea15ba4d38c3b5bf96108c0c7ff5e9f32
2024-05-30 07:24:35 -07:00
Rubén NorteandFacebook GitHub Bot e91a577262 Clean up old code for microtasks in Hermes (#44708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44708

Changelog: [internal]

We had a fallback to use a Hermes internal API if the native module exposing `queueMicrotask` wasn't available. This is no longer necessary as the module is available everywhere we enable the event loop, so we can remove it.

Reviewed By: christophpurrer

Differential Revision: D57922076

fbshipit-source-id: 0ca48abacd77a75ce8559db08f55c78a3e0ec815
2024-05-30 04:22:50 -07:00
Nick GerlemanandFacebook GitHub Bot cfbd15aff1 Add border clipping examples (#44711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44711

This adds just the border clipping examples and tests from D57668976

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D57941945

fbshipit-source-id: 2234927cb944710c9d929d1d77087d3d2ecdbca6
2024-05-29 23:32:34 -07:00
Neil AgarwalandFacebook GitHub Bot 06512aa565 fix: use consistent version of glob in react-native (#44713)
Summary:
https://github.com/isaacs/node-glob/issues/493

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

## Changelog:
[General][Fixed] - Use consistent version of glob in react-native

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

Reviewed By: yungsters

Differential Revision: D57949442

Pulled By: NickGerleman

fbshipit-source-id: 9ea246c6b5307370628f34a78373a8bddb42420d
2024-05-29 23:21:24 -07:00
Kudo ChienandFacebook GitHub Bot bed487e24b Add BindingsInstaller for TurboModules on iOS (#44486)
Summary:
Add synchronous JS bindings installation for TurboModules. That would help some 3rd party JSI based modules to install JS bindings easier.
Re-create from https://github.com/facebook/react-native/issues/43110 but for iOS

## Changelog:

[IOS] [ADDED] - Add BindingsInstaller for TurboModules

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

Test Plan: Added test in RN-Tester TurboModule test case

Reviewed By: javache

Differential Revision: D57224891

Pulled By: philIip

fbshipit-source-id: fabe5c4f8d2087ac9a465f2cb90d884b83265a68
2024-05-29 20:34:25 -07:00
Eric RozellandFacebook GitHub Bot 775713cef7 Make consistent focusable behavior (#44705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44705

`focusable` props behaviors are inconsistent across different flavors of Touchable components. Some use the disabled prop to check if the component should be focusable, others do not.

This ensures all Touchable* component flavors use the disabled prop.

## Changelog

[General][Fixed] Fixed inconsistency in TouchableX component disabled / focusable behavior

Reviewed By: yungsters

Differential Revision: D57910488

fbshipit-source-id: af17227403338fcd5bebd9ba7c3172b4c6776e1f
2024-05-29 19:06:34 -07:00
Sam ZhouandFacebook GitHub Bot f1265f7758 Deploy 0.237.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D57939041

fbshipit-source-id: 738523fac25112ab3c75bde0c09b2df62c29aa9c
2024-05-29 16:44:34 -07:00
Nick GerlemanandFacebook GitHub Bot 5fbebb4852 Cleanup ReactFeatureFlags.enableTextSpannableCache (#44706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44706

We didn't ship this, and asking around, I don't think mdvacca was looking at this actively (though is on PTO right now).

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D57913491

fbshipit-source-id: 86afd5a6bb5e7ce6be540f2295aa407134a6d81c
2024-05-29 13:31:36 -07:00
Samuel SuslaandFacebook GitHub Bot 3c31e9dd9f clip content offset when scroll view is restored from shadow tree (#44704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44704

changelog: [internal]

Checkout the code comments for explanation.

Reviewed By: javache

Differential Revision: D57903106

fbshipit-source-id: 202edfa0b93ce222997ed793313cdc3ca32f8818
2024-05-29 10:01:46 -07:00
zhongwuzwandFacebook GitHub Bot 690df7a556 Fixes animated frame timing (#44622)
Summary:
Fixes https://github.com/facebook/react-native/issues/44608 .

## Changelog:

[IOS] [FIXED] - Fixes animated frame timing

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

Test Plan: Example in https://github.com/facebook/react-native/issues/44608 .

Reviewed By: sammy-SC

Differential Revision: D57559884

Pulled By: cipolleschi

fbshipit-source-id: 33eaf71c24eb83715403a67b3471dd1ac2dd9d2f
2024-05-29 08:16:42 -07:00
zhongwuzwandFacebook GitHub Bot f500b47a95 Bridgeless: Expose host delegate methods (#44158)
Summary:
Expose host delegate methods that users can do some customize work.

## Changelog:

[IOS] [ADDED] - Bridgeless: Expose host delegate methods

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

Test Plan: Users can do some customized work by `RCTRootViewFactory`.

Reviewed By: sammy-SC

Differential Revision: D56521470

Pulled By: cipolleschi

fbshipit-source-id: dd22d0978b9fd4385380945a514eb6596b7d874f
2024-05-29 08:14:09 -07:00
Renaud ChaputandFacebook GitHub Bot fc4e099920 Fix Privacy Manifest generator when it does not contain a NSPrivacyAccessedAPITypes key (#44628)
Summary:
XCode privacy files might not contain a `NSPrivacyAccessedAPITypes` key, which causes the following error:

```
[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `each' for nil

node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `block (4 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `block (3 levels) in get_used_required_reason_apis'
```

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[IOS] [FIXED] - Privacy Manifest aggregation failing due to no `NSPrivacyAccessedAPITypes` key

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

Test Plan: I tested this patch on our own app and it solved the issue.

Reviewed By: christophpurrer

Differential Revision: D57618425

Pulled By: cipolleschi

fbshipit-source-id: 1a36ab5a1bb45b8507d3663b782c95258d97c8a4
2024-05-29 08:08:42 -07:00
Soe LynnandFacebook GitHub Bot 805f1493c7 overflow props is not honored in ScrollView in new architecture (#44699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44699

Changelog: [Internal]

In Fabric, overflow props for ScrollView is not passed down. Hence, the overflow props is ignored and FlatList content is always clipped.

Reported from OSS https://github.com/facebook/react-native/issues/44683

Reviewed By: sammy-SC

Differential Revision: D57895399

fbshipit-source-id: 6ce65bea0803971060e8229b66563123dd6fc114
2024-05-29 07:49:13 -07:00
Gijs WeteringsandFacebook GitHub Bot f4ec8cbdba Add rntester_android as a valid app in ReactNativeCoreE2ESetup
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D54662740

fbshipit-source-id: f845b127dc1cf5ef509eebea29c1c495a9ceb763
2024-05-29 07:06:19 -07:00
Edmond ChuiandFacebook GitHub Bot 82a3bb8f75 add fusebox flag to error case of launch debugger event (#44696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44696

Changelog: [Internal]

Add `prefers_fusebox_frontend` annotation to the error case for the launch debugger event

Reviewed By: hoxyq

Differential Revision: D57866634

fbshipit-source-id: fcd3655539c936d9965b0c79a47b1b58bb9a4e48
2024-05-29 06:00:36 -07:00
Rubén NorteandFacebook GitHub Bot dc3a530191 Clean up androidEnablePendingFabricTransactions feature flag (#44695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44695

Changelog: [internal]

We tested this feature flag at Meta and it's neutral when used outside the event loop. We'll handle its effects on the event loop as part of the event loop experiment itself (when enabling paint blocking).

Reviewed By: tdn120

Differential Revision: D57861195

fbshipit-source-id: 11a208ef5433321a464cfc16f4ff026d52988b42
2024-05-29 05:00:12 -07:00
Vladyslav KrasnolutskyiandFacebook GitHub Bot a93a15aca3 Fix Animate.sequence restart issues (#44031)
Summary:
Currently, if the `Animated.sequence` animation is finished, and then the `start()` method is called without a `reset()` method being invoked beforehand, the failure happens: ```undefined is not an object (evaluating 'animations[current].start')```.
Use cases:
- sequence animation started, finished, and then started again
- sequence animation is used in `Animation.loop` with `resetBeforeIteration` set to `false`, which essentially does the same as the previous case

Related issues:
- https://github.com/facebook/react-native/issues/43120
- https://github.com/facebook/react-native/issues/37611

## Changelog:

[General] [Fixed] - Fix sequence restart failure

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

Test Plan: Test cases are included: 1 for regression and 2 for mentioned use cases in the summary

Reviewed By: cipolleschi

Differential Revision: D56015346

Pulled By: dmytrorykun

fbshipit-source-id: 8b0f46c8a33397fece807634463ce630c89d28af
2024-05-28 07:33:44 -07:00
Sachin TewariandFacebook GitHub Bot 3c5a3e0a07 Cleanup ImageLoaderModule (#44693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44693

Changelog: [Internal]
Kotlin related simplifications

Reviewed By: oprisnik

Differential Revision: D57858309

fbshipit-source-id: 02ae17db13f5877ab83b05beadff3ff666aeff81
2024-05-28 07:30:20 -07:00
Christoph PurrerandFacebook GitHub Bot 24aed6ec49 Align with code-gen output Sample Turbo Modules (#44640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44640

These modules are manually typed and don't use `react-native-codgen` (as a show case to demonstrates what code-gen produces).

There are some typos in the manually written code and they don't exactly match the JS Spec used at runtime:

https://github.com/facebook/react-native/blob/main/packages/react-native/src/private/specs/modules/NativeSampleTurboModule.js#L45-L48

Changelog: [Internal][Fixed] Align with code-gen output Sample Turbo Modules

Reviewed By: rshest

Differential Revision: D57624824

fbshipit-source-id: 023f2318630aa342758d5ea495e6298cb8884ae1
2024-05-28 07:15:28 -07:00
Håkon KnutzenandFacebook GitHub Bot d93788301c Add missing call to super.viewDidLoad in RCTRedBox.mm (#44686)
Summary:
When running the Analyzer in Xcode, I got a warning denoting that `viewDidLoad` was not called on `super` in the overridden `RCTRedBox.viewDidLoad`. While I have not observed any anomalies, it is best practice to call on super in the overridden view controller life cycle methods.

## Changelog:

[iOS] [FIXED] - Add missing call to `[super viewDidLoad]` in `RCTRedBox.mm`.

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

Test Plan:
Running the RNTester yielded the following screenshot:

<img width="549" alt="Screenshot 2024-05-27 at 11 26 40" src="https://github.com/facebook/react-native/assets/2263015/b91e126c-9dc1-4e52-8a6b-50ea8bea2c3f">

Reviewed By: fabriziocucci

Differential Revision: D57856354

Pulled By: javache

fbshipit-source-id: d76a4779e02f40af69eed156489e57299968d4be
2024-05-28 04:54:09 -07:00
Tomek ZawadzkiandFacebook GitHub Bot c73e22142e Expose mapbufferjni via prefab (#44684)
Summary:
The `mapbufferjni` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[ANDROID] [CHANGED] - Expose `mapbufferjni` via prefab.

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

Reviewed By: fabriziocucci

Differential Revision: D57856389

Pulled By: javache

fbshipit-source-id: 9926b02724950f4025c7f867257e8229d44c43a3
2024-05-28 03:19:10 -07:00
Christoph PurrerandFacebook GitHub Bot ea3a7143b9 Align CodegenSchema.d.ts with CodegenSchema.js (#44629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44629

Changelog: [General][Fixed] Align CodegenSchema.d.ts with CodegenSchema.js

Reviewed By: yungsters

Differential Revision: D57594059

fbshipit-source-id: 554afcb1520e291d5452f330137ea577000f2428
2024-05-27 19:15:42 -07:00
John MavrantonakisandFacebook GitHub Bot c207708c4b Fix for Clang tidy, needed for fbcode include (#44655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44655

Required to compile with clang

This is because previously it was comparing size_t with int which is not allowed under compilation with clang

Changelog: [Internal] [Fixed] - Replaced old style for loop with new style to avoid clang errors with size_t to int comparisons

Differential Revision: D57721635

fbshipit-source-id: 2738f7b415d668c37536f7f93b2e0985fa2cc5e6
2024-05-27 12:14:03 -07:00
Alex HuntandFacebook GitHub Bot 29beea6b57 Split debugger flags into fuseboxEnabledDebug and fuseboxEnabledRelease (#44663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44663

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57733525

fbshipit-source-id: 70a7dacb641b75e73bd4f7e18bc5e3d04bc2c508
2024-05-27 09:27:47 -07:00
Alex HuntandFacebook GitHub Bot 03b8b0997a Rename jsinspector-modern feature flag to fuseboxEnabled (#44661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44661

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57730920

fbshipit-source-id: 4761f7e8c2189ff5bfd5fa24891bba20c3750da8
2024-05-27 09:27:47 -07:00
Alex HuntandFacebook GitHub Bot 352d4b1c83 Add default browser fallback to debugger launch flow (#44673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44673

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57726648

fbshipit-source-id: 66eaab1dd0d53fe2befb3dc96d5deb426b86e3e7
2024-05-27 02:53:36 -07:00
Alex HuntandFacebook GitHub Bot 5d827d83c1 Simplify debugger launch flow to invoke Chrome directly, drop kill API (#44672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44672

Swaps out and simplifies the internals of the debugger launch flow.

We observed that we could achieve better launch/windowing behaviour by passing the `--app` argument directly to the detected Chrome path.

This shares the user's default Chrome profile:
- Fixes unwanted behaviour such as a separate dock icon on macOS (which, when clicked, would launch an unwanted empty window).
- Enables settings persistence.

This change also removes the `LaunchedBrowser.kill` API.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57726649

fbshipit-source-id: fc3a715dc852a50559048d1d1c378f64aeb2013f
2024-05-27 02:53:36 -07:00
Alex HuntandFacebook GitHub Bot 7e0f86f34b Revert debugger launch behaviour to default profile (#44638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44638

Reverts the debugger launch flow to use the default `ChromeLauncher` profile. This is the approach used in the current `--experimental-debugger` experiment and by Expo.

This is motivated after a review of the tradeoffs of a guest profile — which allow us to programatically quit the browser process, however takes over system URL handling.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57619542

fbshipit-source-id: 3713e1cf8eed61e7a70ed1e4eb58f02da845155f
2024-05-27 02:53:36 -07:00
Alex HuntandFacebook GitHub Bot a908387b73 Remove inspectorEnableCxxInspectorPackagerConnection flag (#44662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44662

- Remove `inspectorEnableCxxInspectorPackagerConnection` feature flag.
- Replace existing checks with `getEnableModernCDPRegistry()`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57730921

fbshipit-source-id: fd13b84a826a4fa5973053a721d311c7d68dd2f5
2024-05-26 10:48:48 -07:00
Alex HuntandFacebook GitHub Bot e363eeb53e Update debugger-frontend from b453d8bd...bf5ec69 (#44675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44675

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57782487

fbshipit-source-id: 449180c0fcbb8ef043716bc954f149aec6b2a263
2024-05-26 10:05:58 -07:00
Liron YahdavandFacebook GitHub Bot 840c31c3a4 Make SystraceSection feed into Instruments signposts API (#44496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44496

When doing performance profiling on a React Native iOS app and trying to identify bottlenecks on the native side it can be helpful to correlate actions to what is happening inside React Native. We already have the SystraceSection class for this, but it does nothing in open source. This diff allows SystraceSection to feed into the Instruments signpost API on iOS/macOS.

Changelog:
[iOS][Added] - Add Instruments signposts API for SystraceSection

Reviewed By: sammy-SC

Differential Revision: D56280451

fbshipit-source-id: 4e962e932b6b6e09e5953abdc1aa621a2723c91e
2024-05-24 18:39:02 -07:00
Nick GerlemanandFacebook GitHub Bot 91d12d9b99 Revert D57668976: Simplify ReactViewGroup clip to border
Differential Revision:
D57668976

Original commit changeset: 8b8cf956dc86

Original Phabricator Diff: D57668976

fbshipit-source-id: 5147557c1f3561863b1ad9226ca6244ff94cb29c
2024-05-24 11:55:43 -07:00
Peter AbbondanzoandFacebook GitHub Bot ac51deeaf4 Add suppression for deprecated setters and getters (#44676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44676

Some of the setters and getters in these functions, like [`getStatusBarColor`](https://developer.android.com/reference/android/view/Window#getStatusBarColor), have been marked as deprecated in [`VANILLA_ICE_CREAM`](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). This change suppresses deprecation warnings until we can move to newer alternatives.

## Changelog

[Android] [Changed] - Added suppression for deprecated getter/setter usage in StatusBarModule

Reviewed By: sumkit

Differential Revision: D57780503

fbshipit-source-id: 6201f7a3e597fef420de0f80dd2243bee78bc583
2024-05-24 10:41:12 -07:00
Alex HuntandFacebook GitHub Bot 06461c4ab5 Disable Fusebox in prod builds (temp) (#44664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44664

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57737342

fbshipit-source-id: 85bff2d2810e666a97b79b5d1fe598b6f8b68c68
2024-05-24 10:31:18 -07:00
NishanandFacebook GitHub Bot c13790ff1d feat(android): percentage support in translate (#43193)
Summary:
This PR adds percentage support in translate properties for android. Isolating this PR for easier reviews.

## Changelog:
[Android] [ADDED] - Percentage support in translate
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
- Checkout TransformExample.js -> Translate percentage example.
- Added a simple test in `processTransform-test.js`. The regex is not perfect (values like 20px%, 20%px will pass, can be improved, let me know!)

Related PRs - https://github.com/facebook/react-native/pull/43191, https://github.com/facebook/react-native/pull/43192

Reviewed By: joevilches

Differential Revision: D57723216

Pulled By: NickGerleman

fbshipit-source-id: c9da007678341b62745df858f043821bcc662a98
2024-05-24 04:50:41 -07:00
Nick GerlemanandFacebook GitHub Bot 4294b2446a Simplify ReactViewGroup clip to border (#44646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44646

We can remove most of the code for clipping children to border radius, and recalculating paths, in ReactViewGroup, and rely on the padding box path/rect already set.

I will move this to something more generic up the stack so other native components can reuse this logic.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57668976

fbshipit-source-id: 8b8cf956dc8689827bccba5e41751b465fd85eeb
2024-05-24 04:42:27 -07:00
Peter AbbondanzoandFacebook GitHub Bot 1cc1673c32 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java (#44656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44656

## Changelog

[Android] [Changed] - Converted StatusBarModule to Kotlin

Reviewed By: andrewdacenko

Differential Revision: D57614041

fbshipit-source-id: 054b13cd286e9e9b7f870e66ff0e07def075a3c3
2024-05-24 04:35:42 -07:00
Pieter De BaetsandFacebook GitHub Bot b2ced62d33 Shortcut emitDeviceEvent in bridgeless (2nd attempt) (#44590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44590

emitDeviceEvent is frequently used for perf-critical operations such as sending network responses from native to JS. We don't need to go through JavaScriptModule Proxy (which is missing caching in bridgeless) and instead can immediately invoke the callable JS module.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D57435750

fbshipit-source-id: 1c120073ac80afd95deb8e3e6f1c00c2d3d80133
2024-05-23 14:57:00 -07:00
Pieter De BaetsandFacebook GitHub Bot 1343313dc6 Invoke callableModule factory once (#44576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44576

Store callable modules as either a factory function or an object, so we can skip invoking the factory function for frequently accessed objects.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57338528

fbshipit-source-id: cd39ccbe7168c6f093a0e62d5880cbbcd5209c8e
2024-05-23 12:33:41 -07:00
zhongwuzwandFacebook GitHub Bot 3f74f69cf0 Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls (#44653)
Summary:
Fixes https://github.com/facebook/react-native/issues/44649.

## Changelog:

[IOS] [FIXED] - Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/44649.

Reviewed By: fabriziocucci

Differential Revision: D57727886

Pulled By: sammy-SC

fbshipit-source-id: 967e2d8452cc477f2225151a46e9aa27698f4506
2024-05-23 11:11:27 -07:00
Samuel SuslaandFacebook GitHub Bot 33b064bb9c enable preventDoubleTextMeasure optimisation by default (#44659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44659

changelog: [internal]

Reviewed By: javache

Differential Revision: D57678341

fbshipit-source-id: cc6fbcfedccc0fd4610d52feee60b0fc35cc83b9
2024-05-23 10:58:01 -07:00
Christoph PurrerandFacebook GitHub Bot b7fc5867f2 Use hasteModuleName for C++ Turbo Module enums (#44631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44631

Changelog:
[General][Breaking] Use hasteModuleName for C++ Turbo Module enums

This is a follow up to https://github.com/facebook/react-native/pull/44630

This changes the names of C++ Turbo Modules enums to use the `hasteModuleName`.

Example: `NativeMyAbcModule.js` with this spec:
```
export enum EnumNone {
  NA,
  NB,
}

export interface Spec extends TurboModule {
  +getStrEnum: (arg: EnumNone) => EnumStr;t
}

export default (TurboModuleRegistry.get<Spec>('MyAbcModuleCxx'): ?Spec);
```

Before now we generated a base C++ struct with the name:
```
MyAbcModuleCxxEnumNone
           ^^^
```

Now the generate name is:
```
NativeMyAbcModuleEnumNone
^^^^^^
```

## Changes:
- No `Cxx` injected anymore
- Ensure base struct is `Native` prefixed (all RN JS TM specs start with it)

Reviewed By: cipolleschi

Differential Revision: D57602082

fbshipit-source-id: 9ebd68b8059dfbc6e2ec11065915cf049aa3cb0b
2024-05-23 10:23:36 -07:00
szymonrybczakandFacebook GitHub Bot b98c5b960c fix: warn only in init command when CLI uses cached npx version (#44644)
Summary:
In https://github.com/facebook/react-native/pull/37510, a check was introduced to check if user is using `latest` version of `npx`, but right now it checks for every command executed, but it should only ensure that `latest` is included when creating a new project.

In this Pull Request I've added a condition to only warn if `init` was fired.

## Changelog:

[GENERAL] [FIXED] - Warn only in `init` command when CLI uses cached `npx` version

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

Test Plan: Warning about using `latest` version CLI should only be presented when running `init` command.

Reviewed By: arushikesarwani94

Differential Revision: D57681864

Pulled By: blakef

fbshipit-source-id: 5c81b9a08141396efcd24539b2560cea16028dd9
2024-05-23 09:43:02 -07:00
Christoph PurrerandFacebook GitHub Bot 053e302a00 Enable Plugin support for (RCT)SampleTurboModule (#44641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44641

Changelog: [iOS][Fixed] Enable Plugin support for (RCT)SampleTurboModule

Reviewed By: javache

Differential Revision: D57625901

fbshipit-source-id: fe57777970b3b342be77ea9bb4e8e3f95d66471a
2024-05-23 09:41:46 -07:00
Moti ZilbermanandFacebook GitHub Bot 5a6b64f2f9 Do not strip CxxInspectorPackagerConnection.DelegateImpl methods (#44650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44650

Changelog: [Internal]

Adds the missing `DoNotStrip` annotations to methods of `CxxInspectorPackagerConnection.DelegateImpl` that are called from C++.

Reviewed By: huntie

Differential Revision: D57708376

fbshipit-source-id: 8a72b19211b60ce7a6049079e5ecfc2e96bc974f
2024-05-23 05:02:46 -07:00
Christoph PurrerandFacebook GitHub Bot 07261d0408 Use hasteModuleName for C++ Turbo Module structs (#44630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44630

Changelog:
[General][Breaking] Use hasteModuleName for C++ Turbo Module structs

This changes the names of C++ Turbo Modules structs to use the `hasteModuleName`.

Example: `NativeMyAbcModule.js` with this spec:
```
export type ValueStruct = {
  x: number,
  y: string,
  z: ObjectStruct,
};

export interface Spec extends TurboModule {
  +getValueStruct: () => ValueStruct
}

export default (TurboModuleRegistry.get<Spec>('MyAbcModuleCxx'): ?Spec);
```

Before now we generated a base C++ struct with the name:
```
MyAbcModuleCxxValueStruct
           ^^^
```

Now the generate name is:
```
NativeMyAbcModuleValueStruct
^^^^^^
```

## Changes:
- No `Cxx` injected anymore
- Ensure base struct is `Native` prefixed (all RN JS TM specs start with it)

## Why?
- The `Cxx` extension is a temporary hint to react-native-codegen to enable extra capabilities and might disappear eventually
- The C++ base struct name should be 'stable'
- The name of the exported TM JS spec `TurboModuleRegistry.get<Spec>(...)` is abritrary, the hasteName is not
- The name of the RN JS TM spec must start with `Native` which better guarantees a consistent naming scheme for these generated base class
- The C++ Turbo Module base class has now the same prefix as the generated structs - `NativeMyAbcModule` for the example above

Reviewed By: cipolleschi

Differential Revision: D57599257

fbshipit-source-id: 4fafe6c7e920737fa766bd7e8e68e521f608e775
2024-05-23 03:28:52 -07:00
Fabrizio CucciandFacebook GitHub Bot 95de14dc53 Drop unused code + minor lint fixes (#44645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44645

Changelog: [Internal]

As per title.

Reviewed By: NickGerleman

Differential Revision: D57664819

fbshipit-source-id: 2388bd01c00d814a12de7f2e285b78f207e6012c
2024-05-22 12:11:33 -07:00
Rubén NorteandFacebook GitHub Bot b8f3478b37 Implement re-entrancy and unlocked scenarios for LazyShadowTreeRevisionConsistencyManager (#44620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44620

We added a log message when trying to lock revisions in `LazyShadowTreeRevisionConsistencyManager` when they were already locked, and we've seen that being logged in existing experiments, which could indicate we're doing re-entrance from the JS runtime.

This protects against that case migrating the boolean flag to an integer.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D57509193

fbshipit-source-id: 1712aa84d665c9dfe50630818e7f56de7d7e145c
2024-05-22 10:26:55 -07:00
Rubén NorteandFacebook GitHub Bot 98bf5ef080 Implement thread-safety for LazyShadowTreeRevisionConsistencyManager (#44619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44619

Some methods in `LazyShadowTreeRevisionConsistencyManager` can be called in parallel when using synchronous state updates (which is also behind a flag). This implements thread-safety to cover that case so we don't have issues when testing that variant in production.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D57506540

fbshipit-source-id: 362e1df534bc8c87289882236cfe0d7ee261f507
2024-05-22 10:26:55 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 494c86eb02 Add <named-color> to CSSParser (#44623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44623

The syntax for <color> is defined as (https://www.w3.org/TR/css-color-4/#color-syntax):

```
<color> = <color-base> | currentColor | <system-color>

<color-base> = <hex-color> | <color-function> | <named-color> | transparent
<color-function> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()>
```

This diff implements in particular:
```
<color-base> = <named-color>
```

We create a map containing all hex value representations of each named color and directly return the RGBA Values

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57553237

fbshipit-source-id: 7b5bbaf77424cc4a4c833d107ef89601f9fcd9a9
2024-05-22 09:12:51 -07:00
Moti ZilbermanandFacebook GitHub Bot 9dfcb9ec3a Generate object previews for live console messages
Summary:
Changelog: [Internal]

bypass-github-export-checks

Currently, Hermes never generates object/array previews for values logged via the `console` API. This makes console logs significantly less readable than in Chrome. Here we enable the preview generation machinery that already exists in Hermes.

We conservatively mimic V8's behaviour of [only generating previews for immediately-emitted messages](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/inspector/v8-console-agent-impl.cc;l=53,64;drc=451a101b0a8bbc323dbf5697dd956b55284ec9ee) and not for buffered messages. I don't know *why* V8 does this, but can only guess it's meant to improve the performance of starting a debugging session, by evaluating less code and sending smaller payloads. (Anyway, we can change our decision later.)

Reviewed By: dannysu

Differential Revision: D57617059

fbshipit-source-id: 1f5a71ce98ac915a5b874ed6c009d971405a9f2d
2024-05-21 15:17:34 -07:00
Joe VilchesandFacebook GitHub Bot ed3f2f40e1 Fix small props parsing bug for filter (#44637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44637

Setting the wrong thing to {}. `result` should be set here just like in the other early returns.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57617046

fbshipit-source-id: e47dbdb7821879ffa02d11b7e68eec1c9bfbdefd
2024-05-21 14:04:01 -07:00
Nick GerlemanandFacebook GitHub Bot 644facd19d Make dimension units case insensitive (#44639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44639

https://www.w3.org/TR/css-values-4/#dimensions

> Like keywords, unit identifiers are ASCII case-insensitive.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57620806

fbshipit-source-id: 26946ed4031f379888651c08b1b0895ac701a320
2024-05-21 11:25:57 -07:00
Ramanpreet NaraandFacebook GitHub Bot fb23470483 Push ReactContext logic in derived classes (#44226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44226

Changelog: [Android][Removed] Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead.

Yet another attempt to land this (last one was D55964787).

Copy-pasting below the amazing summary from RSNara.

## Context
Prior, ReactContext used to implement bridge logic.

For bridgeless mode, we created BridgelessReactContext < ReactContext

## Problem

This could lead to failures: we could call bridge methods in bridgeless mode.

## Changes
Primary change:
- Make all the react instance methods inside ReactContext abstract.

Secondary changes: Implement react instance methods in concrete subclasses:
- **New:** BridgeReactContext: By delegating to CatalystInstance
- **New:** ThemedReactContext: By delegating to inner ReactContext
- **Unchanged:** BridgelessReactContext: By delegating to ReactHost

## Auxiliary changes
This fixes ThemedReactContext in bridgeless mode.

**Problem:** Prior, ThemedReactContext's react instance methods did not work in bridgeless mode: ThemedReactContext wasn't initialized in bridgeless mode, so all those methods had undefined behaviour.

**Solution:** ThemedReactContext now implements all react instance methods, by just forwarding to the initialized ReactContext it decorates (which has an instance).

NOTE: Intentionally not converting `BridgeReactContext` to Kotlin to minimize the risk of these changes.

Reviewed By: cortinico

Differential Revision: D56064036

fbshipit-source-id: 2e380bf7ee46892c5fc0044b03a929f12d122157
2024-05-21 09:58:17 -07:00
Karol LatusekandFacebook GitHub Bot cfa784c5ce Avoid redundant state updates in Pressable if children and style are not functions (#44615)
Summary:
Goal of this PR is to optimise `Pressable` component, similarly to https://github.com/react-native-tvos/react-native-tvos/pull/724 . `Pressable` `style` and `children` properties can, but doesn't have to be functions. Usually we passing objects or arrays. `pressed` state is used only when `style` or `children` are `functions`, so let's update that state only in such case, otherwise let's skip state updates to improve the performance.

 That way we won't have to rerender the component when it is being pressed (assuming that `style` and `children` are not going to be functions)

## Changelog:

[GENERAL] [CHANGED] - Improve performance of `Pressable` component.

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

Test Plan: Verify that `Pressable` updates its `pressed` state when `style` or `children` are functions.

Reviewed By: javache

Differential Revision: D57614309

Pulled By: fabriziocucci

fbshipit-source-id: 473e0ab3c4bf7b3ef04ba19f76105ac65371a3fb
2024-05-21 09:51:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot cd1ddbbef3 Update debugger-frontend from 141c8c9...b453d8b (#44635)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44635

Changelog: [Internal] - Update `react-native/debugger-frontend` from 141c8c9...b453d8b

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

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

Reviewed By: huntie

Differential Revision: D57616476

fbshipit-source-id: aa06c3d7d1fe7db3c2f34cbc025d8840475ae091
2024-05-21 08:48:39 -07:00
Fabrizio CucciandFacebook GitHub Bot cf94797f93 Resolve $FlowFixMe in Pressable (#44634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44634

Changelog: [Internal]

As per title.

Reviewed By: NickGerleman

Differential Revision: D57612982

fbshipit-source-id: 5aafd38889b3db49a5f4360563e1803169d9b943
2024-05-21 07:40:51 -07:00
Pieter De BaetsandFacebook GitHub Bot e67d5560cf Fix HeadlessJsTaskContext creating Handler on background thread (#44582)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44582

D54496604 fixed lifecycle methods for JavaTimerManager, which now reveals another bug. Because this codepath ends up creating a `HeadlessJsTaskContext` which in turn creates a `Handler`, ReactInstance destruction doesn't complete cleanly.

```
2024-05-15 17:42:52.935 12681 27113 W fb4a.BridgelessReact: ReactHost{1}.getOrCreateDestroyTask(): React destruction failed. ReactInstance task faulted. Fault reason: Can't create handler inside thread Thread[pool-51-thread-1,5,main] that has not called Looper.prepare(). Destroy reason: FbReactInstanceHolder.destroyReactManager(): FbReactInstanceLogoutCleaner.clearReactInstanceData()
```

The fix is to not create our own Handler, but instead use the shared methods in UiThreadUtil.

Changelog: [Android][Fixed] Fixed error thrown during ReactInstance teardown

Reviewed By: cortinico

Differential Revision: D57378247

fbshipit-source-id: a31dc8e35b5418a71b83c301973f12350f2ee01b
2024-05-21 06:37:28 -07:00
Pieter De BaetsandFacebook GitHub Bot fd8eb4878b Fix crash in ParagraphState when running with USE_FABRIC_DEBUG (#44633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44633

`toDynamic` no longer exists for ParagraphState, so try the MapBuffer value first, before triggering the error introduced in D56963463.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57439386

fbshipit-source-id: 31e6466d9dec5b835551cca6c946b28cfbd4578b
2024-05-21 05:58:38 -07:00
Richard HowellandFacebook GitHub Bot 2a96dba075 remove shadowed static (#44626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44626

This variable is unused and is shadowed by a function local.
Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57568098

fbshipit-source-id: e5f56b7ef88497d4b9935275eb7e805660741146
2024-05-20 13:11:48 -07:00
Christoph PurrerandFacebook GitHub Bot 1be073e832 Fix assert Turbo Module example crash the app when tap Run all tests (#44607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44607

Same as https://github.com/facebook/react-native/pull/41521?fbclid=IwAR1X3qRAyVCZIy2w2T7tmqd1FYVCqrT2TyO-gszIgJ0XKN6F60ODkq_K3nI for the Java / ObjC Turbo Module example.

Changelog: [INTERNAL] [FIXED] - [RN-Tester] Fix assert Turbo Module example crash the app when tap `Run all tests`

Reviewed By: cortinico

Differential Revision: D57531736

fbshipit-source-id: 7cad5dfd31c306dff4763b67466664f2dde6b239
2024-05-20 10:31:17 -07:00
Samuel SuslaandFacebook GitHub Bot 30d7a0f1d7 handle re-entry in RuntimeScheduler::executeNowOnTheSameThread (#44606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44606

changelog: [internal]

Protect RuntimeScheduler::executeNowOnTheSameThread against re-entry to prevent deadlocks.

Reviewed By: NickGerleman

Differential Revision: D57514317

fbshipit-source-id: 88309aa27fedefcce7bf8ce5be9a382fdf72cfae
2024-05-20 09:36:26 -07:00
Ryan LintonandFacebook GitHub Bot 4fb5573796 Update ColorPropConverterto support color function values (#44237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44237

This adds support for color function values to ColorPropConverter per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738). It updates the color conversion code so that it returns a Color instance before ultimately being converted to an Integer in preparation for returning long values as needed.

## Changelog:

[ANDROID] [ADDED] - Update ColorPropConverter to support color function values

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

Test Plan:
Colors should work exactly the same as before.

Follow test steps from https://github.com/facebook/react-native/pull/42831 to test support for color() function syntax.

While colors specified with color() function syntax will not yet render in DisplayP3 color space they will not be misrecognized as resource path colors but will instead fallback to their sRGB color space values.

 ---

After the failure with the tests, I reapplied the changes and test some Jest e2e tests that were failing yesterday:

{F1495277376}

Reviewed By: cortinico

Differential Revision: D56517579

Pulled By: cipolleschi

fbshipit-source-id: ae9b5bc2afe9eb9760dd91afb090385daf7102b8
2024-05-20 09:27:06 -07:00
Gijs WeteringsandFacebook GitHub Bot 252519666f Deduplicate test case for TextExample in preparation of rntester android onboarding
Summary:
D57197676 reordered the TextExample test cases, but accidentally reused the same string as the case in packages/rn-tester/js/examples/Text/TextInlineViewsExample.js

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57279961

fbshipit-source-id: 60a41eaf13d82538ee149fe4ef5531e42c00b012
2024-05-20 07:57:10 -07:00
Gijs WeteringsandFacebook GitHub Bot b6269ebc4f default the RNTTestDetails to collapsed by default
Summary:
tsia. Done to allow for easier interaction of the examples, especially those with long descriptions

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57278607

fbshipit-source-id: f0a1d06c97c019fe177c8b9e51c3ca0ae12caef5
2024-05-20 07:57:10 -07:00
Gijs WeteringsandFacebook GitHub Bot 3c5a6b3d43 Allow Deeplinking via Linking.getInitialURL() (#44552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44552

Changelog: [Android][Fixed] If the RNTester app is started with a deeplink intent, we now correctly navigate there for Android to facilitate e2e testing. This already worked on ios.

Reviewed By: javache

Differential Revision: D54662737

fbshipit-source-id: 5bbf824c80e226f441bdcbc4fa67e41ab4c3eb33
2024-05-20 07:57:10 -07:00
Gijs WeteringsandFacebook GitHub Bot 99238d2bb9 Configure ViewHierarchy dump for RNTester
Summary: Changelog: [Android][Added] add FBEndToEndDumpsysHelper stub to RNTester Android to be able to dump ViewHierarcies internally.

Reviewed By: makovkastar

Differential Revision: D54662739

fbshipit-source-id: 5236ae84ed648d431a8f01558f8f84049480ba39
2024-05-20 07:57:10 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 417ff5fec9 Add <hex-color> to CSSParser (#44624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44624

The syntax for <color> is defined as (https://www.w3.org/TR/css-color-4/#color-syntax):

```
<color> = <color-base> | currentColor | <system-color>

<color-base> = <hex-color> | <color-function> | <named-color> | transparent
<color-function> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()>
```

This diff implements in particular:
```
<color-base> = <hex-color>
```

We parse over a `<hash-token>` to extract a 3, 4, 6 or 8 digit long hexadecimal and parse it into a CSSColor struct representation:

```
struct Color {
    uint8_t r // 0-255
    uint8_t g // 0-255
    uint8_t b // 0-255
    uint8_t a // 0.0 - 1.0
}
```
Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57287309

fbshipit-source-id: 35ce82e52fdc8fc86425e03d7883ae09b429b9e4
2024-05-20 07:29:51 -07:00
Peter AbbondanzoandFacebook GitHub Bot 7349dabae2 Make StatusBarModule nullsafe (#44618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44618

This change is a prerequisite to converting this file to Kotlin. It adds null checks to potentially nullable window and inset getters that were previously not there.

## Changelog:
[Android] [Changed] - Added null checks, marked null safety in StatusBarModule

Reviewed By: NickGerleman

Differential Revision: D57553395

fbshipit-source-id: 5293bb74a95d22bb82971c0a9d691c9e5e36d81f
2024-05-20 07:20:05 -07:00
legobtandFacebook GitHub Bot 99704800a1 chore: Increase iOS script portability (#44417)
Summary:
`pod install` and CocoaPods are actually not macOS specific.
Still, the pod lifecycle scripts of `react-native` depend on macOS-only utilities and will fail on Linux.

This is an attempt to make the scripts portable and make the pod install cleanly on Linux as well as macOS.

## Changelog:

    [INTERNAL] [FIXED] - Skip XCode patching when not run on macOS
    [INTERNAL] [FIXED] - Fall back to `which gcc`/`which g++` to identify C/C++ compiler when `xcrun` not available
    [INTERNAL] [FEAT] - Recognize CC and CXX env vars supplied to the script and prefer them over autodetection

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

Reviewed By: NickGerleman

Differential Revision: D57055928

Pulled By: cipolleschi

fbshipit-source-id: 1c49f70c52b4667abf0a215cbee52ee6aa6dd052
2024-05-20 06:39:26 -07:00
Samuel SuslaandFacebook GitHub Bot 1945939808 avoid calling setState when onScrollEmitter exists (#44609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44609

changelog: [internal]

Do not call setState when onScrollEmitter exists to prevent unnecessary re-render.

Reviewed By: yungsters

Differential Revision: D57537436

fbshipit-source-id: 3a0883171e8fa7995b715aff84702daca075f843
2024-05-20 05:58:04 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 8d5bbca1eb Fix borderRadius incorrect overrides (#44602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44602

Fix regression caused by D56943825 where radii set to 0 was not being considered. Also preemptively fix a possible bug with RTL due to incorrect overrides.

Changelog:
[Android][Fixed] - Fix borderRadius incorrect overrides

Reviewed By: NickGerleman

Differential Revision: D57473482

fbshipit-source-id: d22a46bdd271d5f254e7d7e54abc55c00a8da8f2
2024-05-20 05:18:50 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 06e37bb194 Remove tests using Xcode 14 (#44448)
Summary:
Apple is enforcing that new apps submission to the store mst use XCode 15. There is no reason to keep testing on Xcode 14.3 anymore, hence we are removing those jobs.
While doing that, we are also aligning the tests between Test_All and test_iOS workflows.

bypass-github-export-checks

## Changelog:
[Internal] - Remove CircleCI tests for Xcode 14.3

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

Test Plan: CircleCI must stay Green

Reviewed By: huntie

Differential Revision: D57153939

Pulled By: cipolleschi

fbshipit-source-id: 82278bcb598b134238852e32b667a28619fb74cb
2024-05-20 05:02:13 -07:00
zhongwuzwandFacebook GitHub Bot fbf9c4343a Remove _logWarnIfCreateRootViewWithBridgeIsOverridden (#44271)
Summary:
Fixes customizeRootView migration comment. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes customizeRootView migration comment

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

Test Plan: ![image](https://github.com/facebook/react-native/assets/5061845/bf8b7628-9c23-4920-80bb-72b3ab08fbe3)

Reviewed By: christophpurrer

Differential Revision: D56821755

Pulled By: cipolleschi

fbshipit-source-id: 5f85929d35ffc8768e5a7f1e76d738613bc70b14
2024-05-20 03:29:02 -07:00
Rob AndersonandFacebook GitHub Bot de1967d631 convert circleci to github actions part 3 (#44511)
Summary:
One of the last parts of the migration. This PR foucuses on bringing the template jobs to Github actions.

bypass-github-export-checks

## Changelog:
[Internal] - Migrate template jobs from CCI to GH

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

Test Plan: https://fburl.com/workplace/f6mz6tmw

Reviewed By: blakef

Differential Revision: D57202477

Pulled By: cipolleschi

fbshipit-source-id: be562cd3690d221f094dc734dd501aac25c36f59
2024-05-20 03:09:36 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 1ad69d94bc Add <hash-token> consumption for CSSTokenizer (#44613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44613

We are building a native CSS parser for Fabric, to allow broader support for CSS. One area not yet implemented are features required for color.

<hash-token> is a pre-requisite.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57180293

fbshipit-source-id: 0932c44d881f205aed55bcdf4fa23ad04b336c11
2024-05-20 03:09:02 -07:00
Nick GerlemanandFacebook GitHub Bot 93c079b92a Mark CSSBackgroundDrawable as Nullsafe (#44541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44541

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57250750

fbshipit-source-id: 433213b83ebd8fba8d326434787a2d7e6cf1c626
2024-05-17 20:38:26 -07:00
Nick GerlemanandFacebook GitHub Bot e16faca18c Propagate layout direction to Android Views and Drawables
Summary:
Right now we use layout direction determined by I18NManager to influence the root Yoga layout direction.

Individual views may have a different resolved layout direction (e.g. due to `direction` style prop), and even though we don't rely on Android layout props, Android components still need to inherit or know the right layout direction to still do correct drawing. Example of this was scrollbar showing up on the left, instead of right in RTL, as soon as ScrollView knew it was in RTL.

This has potential to change a good amount of behavior, so this is under QE.

Changelog:
[Android][Fixed] - Propagate layout direction to Android Views and Drawables

Reviewed By: joevilches

Differential Revision: D57248417

fbshipit-source-id: 4bcdf2b23277ff926a796b8377df08d49c7b914c
2024-05-17 20:38:26 -07:00
Nick GerlemanandFacebook GitHub Bot 355ca28b5d Reland: Sanitize measure function results
Summary:
D57285584 was reverted because we have service code with a faulty measure function, and adding logging to Yoga when invalid measurements were received was enough to spike error rate to elevated levels and block release.

This is a reland of the below change, with a couple modifications:
1. We log warnings instead of errors, which from what I heard, shouldn't block release, but should still make signal
2. We only zero the dimension which was NaN, to preserve exact behavior

## Original

We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D57473295

fbshipit-source-id: 979f1b9a51f5550a8d3ca534276ec191a3cb7b9e
2024-05-17 19:12:13 -07:00
Oleh MalanchukandFacebook GitHub Bot af721084af Fix SurfaceMountingManager leaking activity from stopped surfaces (#44584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44584

Changelog: [Android][Fixed] Surfaces no longer leak activity once stopped

Reviewed By: javache

Differential Revision: D57367419

fbshipit-source-id: 7aa69256284f97679ebcc3309f2b74650ec3fb51
2024-05-17 16:36:27 -07:00
Nick GerlemanandFacebook GitHub Bot 044aadbaf6 Fix bad merge of I18nUtil (#44600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44600

I didn't pay close enough attention during merge between V1 and V2 of D57248205, and what I ultimately checked in is not correct. Fix the logic here.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D57488372

fbshipit-source-id: c9db597a6ae4ca5ae81e6ccd9913a14be268dd57
2024-05-17 06:20:29 -07:00
Blake FriedmanandFacebook GitHub Bot 355fe7717c mark hasRtlSupport as public API (#44599)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44599

Contributed in D57248205 / facebook/react-native#44538

From:
```
buck2 run //xplat/js/scripts/rn-api:generate-rn-api-metadata
```

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57487065

fbshipit-source-id: 35308c7a1ef7368b4b1792fe26cf057e45de1360
2024-05-17 03:40:28 -07:00
NishanandFacebook GitHub Bot f997b81288 feat(iOS/fabric): percentage support in translate (#43192)
Summary:
This PR adds percentage support in translate properties for new arch iOS. Isolating this PR for easier reviews.

The approach taken here introduces usage of `ValueUnit` struct for transform operations so it can support `%` in translates and delay the generation of actual transform matrix until view dimensions are known. I have tried to keep the changes minimal and reuse existing APIs, open to changes if there's an alternative approach.

## Changelog:
[IOS] [ADDED] - Percentage support in translate in new arch.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
- Checkout TransformExample.js -> Translate percentage example.
- Added a simple test in `processTransform-test.js`. The regex is not perfect (values like 20px%, 20%px will pass, can be improved, let me know!)

Related PRs - https://github.com/facebook/react-native/pull/43193, https://github.com/facebook/react-native/pull/43191

Reviewed By: javache

Differential Revision: D56802425

Pulled By: NickGerleman

fbshipit-source-id: 978cbbdde004afe1e68ffee9a3c7eb7d16336b46
2024-05-16 19:35:15 -07:00
Nick GerlemanandFacebook GitHub Bot 82c6f8a580 Set and require android:supportsRtl="true" for RTL layout (#44538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44538

Android originated without RTL support. When RTL support was added, Applications needed to set `android:supportsRtl="true"` in their manifest, to allow Android to do RTL specific layout and drawing. This became the default for new projects created by Android Studio at some point.

React Native was not setting this in template, which means apps created from it do not do any of Android's RTL layout, text alignment, or drawing (e.g. in D3652980 8 years ago, a native drawer component came from the wrong side of the screen). RN would still layout the app using Yoga in RTL if in RTL locale though.

This change sets `android:supportsRtl` in template matching default new Android projects, and to avoid mismatched states in the future, will only tell I18NManager that RTL is allowed if `android:supportsRtl` is also set. This is breaking, since existing apps may not get Yoga RTL support unless telling Android that the application should support RTL layout.

Changelog:
[Android][Breaking] - Set and require `android:supportsRtl="true"` for RTL layout

Reviewed By: joevilches

Differential Revision: D57248205

fbshipit-source-id: 3f60c9f855db26f8d34a2e05d460f95961f5ffeb
2024-05-16 19:06:18 -07:00
Nick GerlemanandFacebook GitHub Bot 258b481ae5 Revise ComponentValue parsing model (#44561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44561

D57089275 introduced a layer to parse component values out of the token stream. I modeled this similar to the tokenizer, as a flat iterator of component values. Because function components can nest a variable number of child component values, this now looks like storing a fully resolved tree of tokens on the heap during parsing.

This diff changes the model, so that `CSSSyntaxParser::consumeComponentValue()` no longer returns a resolved CSS function value. Instead, users of the parser are expected to provide "visitors" which continue parsing, matched based on component value type pattern matched. Visitors can perform parsing specific to their context, and propagate values up the stack, based on their evaluation of the component value.

Removing the heap allocated list of tokens here also lets this core CSS parsing stack keep constexpr, so I added that back, though we need to keep expression trees for math expressions in uncommon cases, so the layer up probaly won't keep constexpr.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57206706

fbshipit-source-id: 25db84d376ef18f6291e60ed953e29c4000a7a26
2024-05-16 15:19:25 -07:00
Blake FriedmanandFacebook GitHub Bot 0c7095faa3 Fix ReadableNativeMap linting warning (#44596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44596

Minor fix to get CI running again.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D57454420

fbshipit-source-id: be80fbc8e899ad9aaeafa2cf63fbb6cd4ce32269
2024-05-16 14:17:46 -07:00
Blake FriedmanandFacebook GitHub Bot 1aabefc5b3 build and install an iOS app (#44465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44465

Allows us to `yarn build ios` the helloworld app.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D57067038

fbshipit-source-id: 3e2f3184a698fc5f39da9949c1ee17bd2b2ca7f5
2024-05-16 12:57:09 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 6b2e5df382 Migrate *NativeMap classes to Kotlin (#44581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44581

# Changelog:
[Internal] -

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

Reviewed By: javache

Differential Revision: D57329244

fbshipit-source-id: 8c6b8138801c6e07c21da65a2dbf1dcb7e0f2183
2024-05-16 09:50:08 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 44bac48ed6 Kotlinify functional interfaces in react.bridge (#44546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44546

# Changelog:
[Internal] -

This is the first chunk of moving all of the interfaces to Kotlin inside `react.bridge`, covering the small-ish (functional/SAM and such) interfaces.

Reviewed By: javache

Differential Revision: D57253634

fbshipit-source-id: aa26d26b9681ac7c6059c249b985ff5121ad1e9d
2024-05-16 07:13:50 -07:00
Blake FriedmanandFacebook GitHub Bot c481bce649 Add getEntries API to breaking-change-detector (#44592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44592

The breaking change detector snapshot update to include getEntries:

  buck2 run //xplat/js/scripts/rn-api:generate-rn-api-metadata

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57436792

fbshipit-source-id: c910dc145ef49ac4836918f4ec4d6d7020e7ec0f
2024-05-16 06:22:01 -07:00
Pieter De BaetsandFacebook GitHub Bot 0bf8c6e422 Stub more methods of performance API (#44583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44583

This native module is only available in the new architecture, stub the methods elsewhere.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D57382785

fbshipit-source-id: f6c988bcfd12633697b45a1f862b2cd4fb5d00d4
2024-05-16 02:57:45 -07:00
abingandFacebook GitHub Bot 16775215d5 Fix RCTPerfMonitor not showing up in scene based app (#43476)
Summary:
Currently RCTPerfMonitor won't show up in scene based app, we should first try to extract the window from the connected scenes, and fallback to the window in `UIApplicationDelegate`.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[iOS] [Fixed] - Fix RCTPerfMonitor not showing up in scene based app

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

Test Plan:
- Tested RCTPerfMonitor in app not using scenes;
- Tested RCTPerfMonitor in app using scenes in iOS 13 & 14;
- Tested RCTPerfMonitor in app using scenes in iOS 15+.

Reviewed By: rshest

Differential Revision: D57381551

Pulled By: javache

fbshipit-source-id: fd6cce20c9a4ed41d7aae84751fc0c83391d0865
2024-05-16 02:52:21 -07:00
SvenandFacebook GitHub Bot 46d4b837a5 fix hint when using createRootViewWithBridge to show correct method name (#44585)
Summary:
I used the `createRootViewWithBridge` in a Project and got the hint to migrate to the `customiseView` Method. I searched for the Method, but found it under a different name: `customizeRootView`.
So i thought it would be helpful to use the correct Method name inside the hint message.

## Changelog:
<!-- 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
-->
[IOS] [FIXED] - fixed Method name in hint from customiseView to customizeRootView

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

Test Plan:
* Use `createRootViewWithBridge`
* Should get a hint to migrate to `customizeRootView` method

Reviewed By: fabriziocucci

Differential Revision: D57431185

Pulled By: javache

fbshipit-source-id: 14f8c33771551ea3fb66d2c8f3fce4b4e3ef962a
2024-05-16 02:29:43 -07:00
Ramanpreet NaraandFacebook GitHub Bot d94c4c46f2 Keep ReactImageView logging disabled in bridgeless (#44578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44578

In bridgeless mode, when we fix themed react context, this code-path slows rendering (in dev), starting a feedback loop.

Best understanding of feedback loop:
1. Some code tries to render an <Image/> component.
2. Fabric preallocates the <Image/> component, assigns a null src to the image.
3. The image component warns that there's no src: [RNLog.w](https://www.internalfb.com/code/fbsource/[8cf3936aee379b1f5fa31cc8f02745ceafa72ff3]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java?lines=603-609).
4. **Prior to the themed react context fix,** RNLog.w() would just noop: this [ThemedReactContext.hasActiveReactInstance()](https://www.internalfb.com/code/fbsource/[19ba3ff63f5342a4ba86e18f2e790c69c6cfc7e1]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt?lines=93-95) returned false.
5. **After the themed react context fix,** RNLog.w() dispatches a [native -> javascript call](https://github.com/facebook/react-native/blob/44f9371f246932215627a7ea01fbedf5c13e3019/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt#L94). This renders a LogBox.
6. LogBox renders a <Image/>, which re-starts this loop.

We're not sure what the right long-term solution here is. But, I will follow up! But, until then, it's important that we unblock the ThemedReactContext fix.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56970919

fbshipit-source-id: 26f0cf0acaf6647ded26e6c816483b9ea3e4f4c2
2024-05-15 17:25:39 -07:00
Pieter De BaetsandFacebook GitHub Bot ad4c39ec94 Revert D57329165: Shortcut emitDeviceEvent in bridgeless
Differential Revision:
D57329165

Original commit changeset: 6506a7afb522

Original Phabricator Diff: D57329165

fbshipit-source-id: 98fb81b7c16a2330f1bd58ad6bbfee6f04934b57
2024-05-15 08:43:59 -07:00
Donald RoshiandFacebook GitHub Bot 86dffb3f15 fix(ios) use condensed system font (#43188)
Summary:
The current implementation does not support System font variants. Currently the isCondensed variable is always returning false. This pr adds an extra check to support the 'SystemCondensed' font variant on iOS.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[IOS][ADDED] - Update font to handle system condensed variant

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

Test Plan:
```
<Text style={{ fontSize: 28, fontFamily: 'System' }}>System</Text>
<Text style={{ fontSize: 28, fontFamily: 'SystemCondensed' }}>SystemCondensed</Text>
<Text style={{ fontSize: 28, fontFamily: 'AmericanTypewriter-Condensed' }}>AmericanTypewriter-Condensed</Text>
<Text style={{ fontSize: 28, fontFamily: 'HelveticaNeue' }}>HelveticaNeue</Text>
<Text style={{ fontSize: 28, fontFamily: 'HelveticaNeue-CondensedBold' }}>HelveticaNeue-CondensedBold</Text>
```
![Simulator Screenshot - iPhone 15 Pro - 2024-02-26 at 17 56 40](https://github.com/facebook/react-native/assets/63480001/36daea22-2e75-4526-8b2d-f0555fbf2441)

Reviewed By: fabriziocucci

Differential Revision: D57329036

Pulled By: javache

fbshipit-source-id: b0fffde1a568cb498f907e0a007df4da3e11d586
2024-05-15 05:15:25 -07:00
Pieter De BaetsandFacebook GitHub Bot 524e3eec3e Fix bridgeless triggering reloads twice from BridgelessDevSupportManager (#44554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44554

Noticed than when reload is triggered by Metro (`handleReloadJS`), the application would often get stuck and not respond to further reload commands. Often an IOException would get printed as well, due to concurrent bundle loads happening.

Changelog: [Android][Fixed] Improved resiliency of reloads when bundle loading fails

Reviewed By: RSNara

Differential Revision: D57112152

fbshipit-source-id: b0bf8c8311264504684a137c0910e2eeb008b0c7
2024-05-15 03:47:13 -07:00
Pieter De BaetsandFacebook GitHub Bot d0bb396ddb Shortcut emitDeviceEvent in bridgeless (#44574)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44574

`emitDeviceEvent` is frequently used for perf-critical operations such as sending network responses from native to JS. We don't need to go through JavaScriptModule Proxy (which is missing caching in bridgeless) and instead can immediately invoke the callable JS module.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D57329165

fbshipit-source-id: 6506a7afb522b672a1f3dc7d348c9b80e6734225
2024-05-15 02:03:46 -07:00
Tim YungandFacebook GitHub Bot 95f7a5c597 RN: Delete AnimationsDebugModule (#44577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44577

There are no references to `AnimationsDebugModule` and it is also no longer public, so it is dead code. This cleans it up.

Changelog:
[Android][Removed] - Removed `NativeAnimationsDebugModule` (already not Public API)

Differential Revision: D57351893

fbshipit-source-id: 5a78a3b8e93a87ccb0cd5cdf8d2308d6c53d0ffa
2024-05-14 18:05:49 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 734ac42d61 Kotlinify react.bridge.CatalystInstance interface (#44545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44545

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57253633

fbshipit-source-id: d8631f5d25c00bdf4c94fcd0d56746c35e5b2fc3
2024-05-14 11:51:39 -07:00
Thomas NardoneandFacebook GitHub Bot 13dff7cdf2 Nullsafe views/scroll module (#44532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44532

Changelog: [Internal]

Fix nullsafe errors in the module and add the annotation

Reviewed By: rshest

Differential Revision: D57218666

fbshipit-source-id: 9fc8c6d002bb2c4b53c0874a6d8c38fcf52b9e19
2024-05-14 09:21:15 -07:00
Thomas NardoneandFacebook GitHub Bot 6876775dc7 Fix ViewManager.receiveCommand nullability (#44531)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44531

Changelog: [Internal]

Properly propagate the `Nullable` to the delegates.

Reviewed By: rshest

Differential Revision: D57218665

fbshipit-source-id: 2783ad9b37688e0928ad2e3cf6a2ab1f41190fe7
2024-05-14 09:21:15 -07:00
Gilad BarandFacebook GitHub Bot 1a56b9a808 Revert D57285584: Sanitize measure function results
Differential Revision:
D57285584

Original commit changeset: 935fcdd28c05

Original Phabricator Diff: D57285584

fbshipit-source-id: 3c5d7ccefd608885af4d6f08c0d1cd00553f1f34
2024-05-14 07:13:21 -07:00
Marlene CotaandFacebook GitHub Bot b53aa08678 EventPerformanceLogger + BoundedConsumableBuffer - switch members to size_t (#44564)
Summary:
The RNW integration to RN 04/13 (https://github.com/microsoft/react-native-windows/pull/13226) adds EventPerformanceLogger.cpp and PerformanceEntryReporter.cpp.

We're getting the following errors:
![image](https://github.com/facebook/react-native/assets/1422161/33a4dc42-1d14-4ac4-befd-87ec5cd02640)

![image](https://github.com/facebook/react-native/assets/1422161/6269968d-c0e8-489b-992e-0bb41b6ef7c6)

Switching to size_t fixes it.

## Changelog:
[Internal] [FIXED] - EventPerformanceLogger + BoundedConsumableBuffer - switch members to size_t

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

Test Plan: Builds on Windows

Reviewed By: fabriziocucci

Differential Revision: D57327696

Pulled By: javache

fbshipit-source-id: 21ec3a9597958aa70fbca64710bd615a1022292d
2024-05-14 05:34:37 -07:00
Nick GerlemanandFacebook GitHub Bot 2ad51e53f0 Move showSoftInputOnFocus example to TextInputSharedExamples (#44558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44558

Right now this is only exposed to RNTester on iOS, but the prop exists on both platforms.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57281892

fbshipit-source-id: 9effc2b9c6421f8c74a2f4b933ab0fa0f15e7d70
2024-05-14 05:26:35 -07:00
huzhanbo.lucandFacebook GitHub Bot 62cbdbbcc6 fix: android native rejections should be instanceof Error (#44487)
Summary:
fix https://github.com/facebook/react-native/issues/44050

## Changelog:

[ANDROID] [FIXED] - fix: android native rejections should be instanceof Error

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

Test Plan: reject returns Error.

Reviewed By: NickGerleman

Differential Revision: D57205131

Pulled By: javache

fbshipit-source-id: a5950481d0c4909be4dbea0b430e75222258ae68
2024-05-14 04:57:01 -07:00
SunbreakandFacebook GitHub Bot 7dd91d3437 fix: use local scheduler for thread-safe (#44565)
Summary:
`getScheduler()` is intended for thread-safe

## Changelog:

[Android][FIXED] - local scheduler for thread-safe

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

Test Plan: none

Reviewed By: fabriziocucci

Differential Revision: D57326255

Pulled By: javache

fbshipit-source-id: fa3a1df0f2653d5c286fdb537e0d44ab6fd1ed54
2024-05-14 04:05:36 -07:00
Nick GerlemanandFacebook GitHub Bot 2cc3ba1f19 Mark IntBufferBatchMountItem as nullsafe (#44540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44540

Noticed when running `arc nn`

> Advice xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java:39
> [Class has 0 issues and can be marked Nullsafe] Congrats! `IntBufferBatchMountItem` is free of nullability issues. Mark it `Nullsafe(Nullsafe.Mode.LOCAL)` to prevent regressions.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57249958

fbshipit-source-id: d38559a3fafae0ad778c19dd85c5da610a650d7c
2024-05-14 00:08:56 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 61887338ea Kotlinify DeviceInfoModule (#44536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44536

# Changelog:
[Internal] -

As in the title.

Reviewed By: alanleedev

Differential Revision: D57248069

fbshipit-source-id: 4187b620483d439da5fc4c81012c1124fa19fc09
2024-05-14 00:05:23 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8593eee9fe Kotlinify I18nManagerModule (#44537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44537

# Changelog:
[Internal] -

As in the title.

Reviewed By: NickGerleman

Differential Revision: D57248159

fbshipit-source-id: 800de0454e4ac1bbb95679eaad6c24dc4d48ad22
2024-05-13 22:45:04 -07:00
Nick GerlemanandFacebook GitHub Bot 44f9371f24 Sanitize measure function results (#44557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44557

We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57285584

fbshipit-source-id: 935fcdd28c05bbac0d73e1c7654ae11a74898537
2024-05-13 17:12:49 -07:00
Nick GerlemanandFacebook GitHub Bot 5a100ae3fe Fix CircleCI Android GTest Build (#44562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44562

D56963463 deleted some tests for code it also deleted. This broke the Android GTest OSS build, which is a centralized list of these test files. Remove from there as well.

Changelog: [Internal]

Reviewed By: joevilches, realsoelynn

Differential Revision: D57299969

fbshipit-source-id: 1bf0b718ca5fcee03272dd0142f80ea2f8257902
2024-05-13 15:42:56 -07:00
Sam ZhouandFacebook GitHub Bot 062205ba50 Update hermes-parser and related packages to 0.21.1 (#44560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44560

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D57289099

fbshipit-source-id: c1525c8e9606a05f479a3964f450c71b131f01f1
2024-05-13 14:16:09 -07:00
Blake FriedmanandFacebook GitHub Bot 2fd7733137 Add support for building using Metro (#44464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44464

Adds `app` to allow building and serving your React Native app in a similar structure to the boostrap and build tasks.  This is the more comprehensive followup to D57067040.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067039

fbshipit-source-id: fdbe891657d826535cb779a4d1b71cfd13921684
2024-05-13 14:06:33 -07:00
Blake FriedmanandFacebook GitHub Bot 6b56fb0d0b iOS autolinking.rb needs to export react_native_pods.rb (#44462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44462

Users using the new `react-native/scripts/cocoapods/autolinking.rb` script will expect all of the helper methods previously exposed throug `react_native_pods.rb`.

This was an oversight.

Changelog: [iOS][Fixed] exposes react_native_pods methods through autolinking.rb

Reviewed By: cipolleschi

Differential Revision: D57066094

fbshipit-source-id: d65dc79430101c9c43cbd90d1456630e338a22bb
2024-05-13 14:06:33 -07:00
Blake FriedmanandFacebook GitHub Bot fedb1452a2 cli helper methods (#44463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44463

Helper methods to help the cli grab system state, devices and run react-native/core-cli-utils tasks using Listr.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067037

fbshipit-source-id: 28cb4239f3a93558b88417f366a2146f696cc411
2024-05-13 14:06:33 -07:00
Blake FriedmanandFacebook GitHub Bot 9b0072ad71 Add metro app building support (#44466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44466

Contains a *light* wrapper to help launch Metro and build bundles or wait for localhost requests against Metro's dev-server.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067040

fbshipit-source-id: 8ab7ecb5d9b98d1abddd5d4f04c7eb25129cd0a1
2024-05-13 14:06:33 -07:00
Nick GerlemanandFacebook GitHub Bot fd8f1f5274 Remove folly::dynamic AttributedString storage (#44512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44512

We only ever go through MapBuffer now, so we can remove the code related to storing text fragments in folly::dynamic.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D56963463

fbshipit-source-id: 98bce8aa4ccad134ce18bf35028e1b7b5082c3ca
2024-05-13 13:40:53 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 082e29ed4e Fix border-radius percentage formula typo (#44529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44529

The percentage formula was incorrect. We actually want to consider the shorter side as 100%. If we set a radius > minimum side there are no changes reflected. This is correct on iOS.

D56943825's summary also highlights the reasoning.

Changelog:
[Android][Fixed] Border-Radius percentages are now correctly resolved.

Reviewed By: NickGerleman

Differential Revision: D57214561

fbshipit-source-id: 45125b80289506a6dd51d24451e2b0222cd227c0
2024-05-13 11:10:40 -07:00
Tim YungandFacebook GitHub Bot 651c1d2cf5 RN: Cleanup Comment Reference to Navigator (#44542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44542

React Native no longer has a `Navigator` component, so let's clean up this reference in a comment in the `StatusBar` component definition.

Changelog:
[General][Changed] - Obsolete comments referencing Navigator

Reviewed By: GijsWeterings

Differential Revision: D57251899

fbshipit-source-id: bf2923bcaf22daf525381efbc3577c3610afaec4
2024-05-13 08:46:23 -07:00
Tim YungandFacebook GitHub Bot cdc3b9cdfc RN: Disable Babel Plugin for Arrow Functions for Hermes (#44534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44534

Reapplies {D50818568} (reverted by D50885400).

Changelog:
[General][Changed] - Disable Babel plugin for arrow functions for Hermes

Reviewed By: robhogan

Differential Revision: D57242622

fbshipit-source-id: 63ec2aeb7562dbb1a049dedd6a35b10aa822193c
2024-05-13 08:45:14 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 02d2f8c984 Migrate MathMatrixHelper to Kotlin (#44547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44547

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57254265

fbshipit-source-id: 532fd8fe4b120d16b3ec3fa173233a0290c93aff
2024-05-13 07:18:03 -07:00
Fabrizio CucciandFacebook GitHub Bot f44476dd9d Fix experimental_filter validation error in bridgeless (#44524)
Summary:
Changelog: [Internal]

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

After D56845572, I've started seeing the following redbox when running apps in bridgless mode:

 {F1633641432}

Note sure this is the correct/complete fix but, after this, the error seems to go away.

Reviewed By: RSNara

Differential Revision: D57207925

fbshipit-source-id: c02b9b268c135aabaaa1dc8329abc80ca5c8a500
2024-05-13 04:23:19 -07:00
Kudo ChienandFacebook GitHub Bot c70d791036 Fix dangling surfaces in ReactHostImpl (#44393)
Summary:
Though the `ReactHost.destroy()` is not being used from OSS code, we use it at Expo for expo-dev-client to change loading apps from different dev servers. Without cleanup the `mAttachedSurfaces`, it will have dangling or duplicated attached surfaces that cause duplicated react trees.

<img src="https://github.com/facebook/react-native/assets/46429/f84d274e-aaad-4352-9e3c-6262571a5625">

This PR tries to cleanup the `mAttachedSurfaces` from destroying.

## Changelog:

[ANDROID] [FIXED] - Fixed dangling `mAttachedSurfaces` after `ReactHost.destroy()`

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

Test Plan: have to manually call `ReactHost.destroy()` and recreate the MainActivity without killing the process. then reload the app will startSurface for the same attached surfaces.

Reviewed By: RSNara

Differential Revision: D56901863

Pulled By: javache

fbshipit-source-id: c7f822501d971810ac6aa7262b15da69ec41355e
2024-05-13 04:04:07 -07:00
Pieter De BaetsandFacebook GitHub Bot 596e14e423 Fix missing systrace marker end (#44527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44527

Marker was never closed.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57204350

fbshipit-source-id: 271d285fa55d72e9d3b2f74575ebff5a3fc01045
2024-05-13 03:58:13 -07:00
Dmitry RykunandFacebook GitHub Bot 6a75662c9c Back out "Fix race condition in native module invalidation" (#44523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44523

This is a revert of https://github.com/facebook/react-native/pull/44048
The original change has introduced some regression in native module invalidation stability.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57207598

fbshipit-source-id: eb967102351434c652cb9d6f9935cbf9952d7328
2024-05-13 02:47:18 -07:00
Nick GerlemanandFacebook GitHub Bot a37111a4dd CSS function component values (#44470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44470

CSS component values, as defined in the syntax spec, are either "preserved tokens", CSS functions, or simple blocks. This is distinct from the higher-level "component value type" specified in the [values and units](https://www.w3.org/TR/css-values-3/#component-types) spec.

I was previously short-circuiting a bit, from preserved tokens, to a higher level data structure. This separates them out, adding a layer exposing the preserved token as `CSSSyntaxParser::Token`, and now a `CSSSyntaxParser::Function`, which can represent a named function and its nested component values.

This does not yet wire functions beyond CSSParser returned component values.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57089275

fbshipit-source-id: 97eeb1a7b3363c79d99f9419ba6e022c4c3c31d0
2024-05-11 16:37:39 -07:00
Samuel SuslaandFacebook GitHub Bot 3f17c8b5f0 isolate mapbuffer only to components that use it (#44521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44521

changelog: [internal]

mapbuffer leaks into every component even though it is only used by 2: Paragraph and TextInput. Let's isolate it only to those two.

To do that, I added a new template prop: usesMapBufferForStateData. It is false by default and only Paragraph and TextInput set it to true.

Reviewed By: christophpurrer

Differential Revision: D56636011

fbshipit-source-id: 4a99e6e68caaf40111b6b7b205854a71f33c5864
2024-05-11 03:11:21 -07:00
Nicola CortiandFacebook GitHub Bot 5c798fa2df Bump AGP to 8.4.0 (#44493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44493

Just keeping our version of AGP up to date.

Changelog:
[Internal] [Changed] - Bump AGP to 8.4.0

Reviewed By: arushikesarwani94

Differential Revision: D57104079

fbshipit-source-id: 4d5c0dec95bf73696a0274f61e0536e53c11adaf
2024-05-10 17:32:23 -07:00
Alex HuntandFacebook GitHub Bot 88526e9d34 Update Fusebox welcome notice, fix dark mode styling (#44530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44530

- Update notice when debugger is connected, removing internal Fusebox codename.
- Explicitly set black foreground for highlighted text, to fix dark mode styling in DevTools console.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57215418

fbshipit-source-id: a82a12744e029e573000733f7842c1e082b0a620
2024-05-10 14:21:43 -07:00
Rubén NorteandFacebook GitHub Bot 1db50a37d6 Guard against null rootShadowNode in IntersectionObserverManager for initial notifications (#44528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44528

Changelog: [internal]

In the `IntersectionObserver` API we dispatch the initial notification in the `observe` method, but it might be possible that the surface has been removed from the registry by the time we execute that code.

This guards against that case to possibly fix a crash we're seeing in on the `IntersectionObserver` experiments.

Reviewed By: sammy-SC

Differential Revision: D57213994

fbshipit-source-id: 5cd1f16958949cc1ff64153e8012e6a59819d68a
2024-05-10 11:26:57 -07:00
Eric RozellandFacebook GitHub Bot 36dc7b4523 Clean up dead code in LogBoxStateSubscription (#44513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44513

The removed code was moved to LogBoxInspectorContainer, and is not referenced inside the LogBoxStateSubscription component.

## Changelog

[Internal]

Reviewed By: GijsWeterings

Differential Revision: D57168569

fbshipit-source-id: 07f843b2df126cc05f65937dd44781525d6afeb4
2024-05-10 10:01:41 -07:00
Gijs WeteringsandFacebook GitHub Bot 143e31058c Fix xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeCoreE2E/__tests__/Border-corner-radii-elevation-percentages-e2e.js to actually use the right example (#44525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44525

These examples were added, but their names were duplicated. This caused our internal e2e tests to accidentally target the wrong examples.

Changelog:
[General][Fixed] RNTester examples for border percentages are now properly covered by E2E screenshot tests.

Reviewed By: NickGerleman

Differential Revision: D57207306

fbshipit-source-id: 32ed5cc6b136a8928b11afe8b824c752edcdd9e5
2024-05-10 09:38:34 -07:00
Alex HuntandFacebook GitHub Bot 01afb08165 Tweak paused overlay design, widen tap area
Summary:
Tweaks the Paused Debugger Overlay design on iOS. The tap area to resume the application is now the entire "Paused in debugger" item.

|Before|After|
| {F1578785144} | {F1578734918} |

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D57161216

fbshipit-source-id: 581ebe44e45a57cdfe3e617e8f97f78619f84e73
2024-05-10 09:10:53 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 3bbc3f2a48 Move textAlignVertical into TextAttributes (#44516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44516

# Changelog:
[Internal] -

This is a generally cross-platform attribute, which is supported not only on Android, and conceptually does arguably belong in TextAttributes.

Reviewed By: NickGerleman

Differential Revision: D57181633

fbshipit-source-id: 7251f0a90158f0466fbf13b9d855c7a449e6dd0f
2024-05-10 08:40:39 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f8c1ad6f43 Flatten Text examples in RNTester to make them searchable (#44518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44518

# Changelog:
[Internal] -

For some inexplicable reason, we had majority of `Text` test examples (42 out of 46) in RNTester stuffed into `<RNTesterBlock/>` components inside one huge "Basic" test case.

This was highly imbalanced, introduced extra nesting, cluttering the UI, but most importantly, none of those 42 out 46 test cases were searchable for.

This change flattens all of the corresponding nested test cases to the top level, making them into valid separate test cases, which are also searchable.

It also corresponds to the general structure we have in other test examples, such as `TextInput`.

Reviewed By: cipolleschi

Differential Revision: D57197676

fbshipit-source-id: 777eb2aa238a91bb3f52d2f0ab10edc6bfad5c85
2024-05-10 08:38:59 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 26fc40d0f7 Convert AccessibilityInfoModule (#44520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44520

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57203063

fbshipit-source-id: 3a19b29f6ed2291fa9464d1e8341d38c8824a069
2024-05-10 08:24:54 -07:00
Samuel SuslaandFacebook GitHub Bot 00b251b8ee delete 'decouple commit from mount on Android' (#44504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44504

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D57154279

fbshipit-source-id: 5902a81fe892ae1d4cf85f63c2b81a16c31baa34
2024-05-10 04:54:47 -07:00
Pieter De BaetsandFacebook GitHub Bot 34a50ae8ef Stop emitting deprecated onTextInput events (#44479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44479

TextInputs' onTextInput callback was removed way back in React Native 0.62 with https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab , but remnants of the implementation exists.

We first have to remove the event emitting in native code, and can land the full removal separately in D57092733, once there's no older client references remaining to this event.

Changelog: [General][Removed] Remove deprecated onTextInput callback

Reviewed By: cipolleschi

Differential Revision: D57092734

fbshipit-source-id: 5b0beee3d55b70717216fe8ceaf52444540f5adc
2024-05-10 03:48:43 -07:00
Rui YingandFacebook GitHub Bot 4ad65ac59a Handle the case where the file reference doesn't have a path (#44410)
Summary:
The new cocoapod post install script includes aggregation and generation of privacy manifests for iOS, which is great. However, the script doesn't consider the case where the file reference doesn't have a path.

Example, for a project setup like the screenshot:
<img width="249" alt="image" src="https://github.com/facebook/react-native/assets/22592111/45dd1cf4-c2f6-4abb-940f-136a4d502966">

The code
https://github.com/facebook/react-native/blob/05a4232dd591e2d43f192d69ca14a04f4a3fb6a1/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb#L80-L81

prints `file_refs`:
```
[
<PBXFileReference name=`LaunchScreen.storyboard` path=`learnX/LaunchScreen.storyboard` UUID=`81AB9BB72411601600AC10FF`>,
<PBXVariantGroup name=`InfoPlist.strings` UUID=`D40B9F832B248EF5004BC08C`>,
<PBXFileReference path=`AppCenter-Config.plist` UUID=`D40B9F802B248EC2004BC08C`>,
<PBXFileReference name=`PrivacyInfo.xcprivacy` path=`learnX/PrivacyInfo.xcprivacy` UUID=`D403DD362BCA2BCF00E5295C`>,
<PBXFileReference name=`Assets.xcassets` path=`learnX/Assets.xcassets` UUID=`D40B9F652B248AEB004BC08C`>
]
```

where a `PBXVariantGroup` exists and it doesn't have `path`. The error `undefined method 'end_with?' for nil` occurs as a result.

## Changelog:

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

[IOS] [FIXED] - In privacy manifest post install script, handle the case where the file reference doesn't have a path

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

Test Plan:
1. Add a new "Strings File (Legacy)" in Xcode to the project.
2. Run `pod install` for iOS.
3. See the error `undefined method 'end_with?' for nil`.
4. Apply the fix and rerun `pod install`.
5. The script runs successfully.

Reviewed By: javache

Differential Revision: D57056159

Pulled By: cipolleschi

fbshipit-source-id: 42caaf1a98efb9111f6ff1014a5c8b7703b042f2
2024-05-10 02:51:11 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8c3260f2a4 Make relevant TextInput examples not depend on top window size (#44517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44517

# Changelog:
[Internal] -

A follow-up to https://github.com/facebook/react-native/pull/44505, turns out this is also an issue for TextInput examples, which work of assumption of some of the text input fields being of limited width, but in practice growing to occupy the parent window width, which can be quite large on platforms different from the classic mobile ones.

This diff makes the corresponding tests more practical, not expanding to the parent window anymore.

Reviewed By: christophpurrer

Differential Revision: D57196308

fbshipit-source-id: 7018e8c51adb70fe6a03e50d71eff9ba997fd07a
2024-05-10 00:14:33 -07:00
Panos VekrisandFacebook GitHub Bot 0142f82ea7 remove default option experimental.global_find_ref=true (#44515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44515

this has been the default for a while

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D57195561

fbshipit-source-id: b441d972134dba754d714ae5694d94537707ded3
2024-05-09 23:14:37 -07:00
huzhanbo.lucandFacebook GitHub Bot c647950e5e fix fetch memory leak (#44336)
Summary:
Root cause of the fetch memory leak:

The fetch requests store its result inside Blob which memory is managed by BlobCollector. On the JS engine side,
the Blob is represented by an ID as JS string, and the GC don't know the size of the blob. So GC won't have interests to release the Blob.

Fix:

On iOS and Android, use `setExternalMemoryPressure` to acknowledge JS engine the size of Blob it holds.

## Changelog:

[GENERAL] [FIXED] - fix fetch memory leak

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

Test Plan: `RepeatedlyFetch` inside `XHR` example

Reviewed By: javache

Differential Revision: D57145270

Pulled By: NickGerleman

fbshipit-source-id: afa53540e8563db4f9c6657f2dbbdff7bdfa66c0
2024-05-09 19:55:43 -07:00
Pieter VanderwerffandFacebook GitHub Bot 007ca0c376 Deploy 0.236.0 to xplat (#44510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44510

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D57186863

fbshipit-source-id: 389dcb039c7d4c461b3be28f4eba32d5d9781e61
2024-05-09 19:33:12 -07:00
Nick GerlemanandFacebook GitHub Bot 54f582f651 Fix duplicate rotation operations (#44429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44429

`Transform::Rotation(x, y, z)` creates an empty transform with the associated operation, then [multiplies by xyz rotation vectors](https://en.wikipedia.org/wiki/Rotation_matrix#General_3D_rotations).

Multiplication chains each transform operation, so afterward, we end up with correct transform matrix, but duplicate operations.

This removes the first transform operation, and lets the per-axis multiplications set them.

Changelog:
[General][Fixed] - Fix duplicate rotation operations

Reviewed By: rshest

Differential Revision: D57025602

fbshipit-source-id: 5eb47dbf9a72eab89a351fd5ae02261566b35ffb
2024-05-09 18:30:56 -07:00
Nick GerlemanandFacebook GitHub Bot cea5309839 Split "renderer/css" headers (#44471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44471

Need to make the current headers a bit more granular to avoid cyclical dependencies, and a lot of bloat.

This code isn't wired up more broadly, so this isn't breaking yet.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57089140

fbshipit-source-id: f6e0312c207664b0a59f682c673cd00e263915bc
2024-05-09 17:12:17 -07:00
Nick GerlemanandFacebook GitHub Bot 7003e3544c Teach CSSTokenizer about function-token, parens, comma (#44450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44450

Adding some of the tokenization needed for things like `transform` and `filter`. Parsing will be a bit trickier with the model currently built up.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57047886

fbshipit-source-id: 260a681ab60944c8f127d937589fc4c8589a53e2
2024-05-09 17:12:17 -07:00
Nick GerlemanandFacebook GitHub Bot c300310c38 String setters for CSSDeclaredStyle (#44435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44435

Every CSS prop at this sparse stage is represented as an enum, and each enum can be specialized to different types, according to the global CSS property table.

With this change, we add a string name to each property table entry that we use to generate a function to be able to set CSS value strings, against property name strings. Like `declaredStyle.set("aspectRatio", "4 / 3")`.

I was considering specializing this a bit, to allow DeclaredStyles which only support a subset of CSS props. E.g. so `ParagraphShadowNode` has a more derived declared style than `LayoutableShadowNode` does. But, I am not sure the best way yet to make that compose nicely.

Changelog: [internal]

Reviewed By: sammy-SC, rshest

Differential Revision: D57039255

fbshipit-source-id: c5289254bb97fa355af5f416b79952e426720934
2024-05-09 17:12:17 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f4996e0b63 Make text wrap examples not rely on the RNTester window width (#44505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44505

# Changelog:
[Internal] -

The RNTester/Text tests, that are related to text wrapping (such as "wrap mode", "hyphenation", "ellipsize", "numberOfLines" ones) were written with the mobile form factor in mind, whereas the RNTester window is generally expected to be narrow and tall.

Now, that we are running on other platforms as well, there is no guarantee about the RNTester window width, in general, so these tests relying on particular window width is not practical anymore.

This makes the corresponding tests work in a useful way without making assumptions about the RNTester's window width.

Differential Revision: D57166025

fbshipit-source-id: 3305a31f7ca254d82c85d67c975c1140050adc28
2024-05-09 13:04:43 -07:00
Joe VilchesandFacebook GitHub Bot 5f0361a704 e2e tests for FilterExample on RN-Tester (#44500)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44500

tsia really, added tests for blur, brightness, and chained brightness + blur. I don't really think I need to add them all, as e2e tests can be flaky and I doubt someone changes specific color matrix values ever.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D57127765

fbshipit-source-id: 7644c9493eee176e24922f7c06656360340e00d4
2024-05-09 12:29:39 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 311afc1801 Add E2E tests for border-radius percentages (#44460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44460

Added missing e2e tests for border-radiusf

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57062098

fbshipit-source-id: ef84b2f05af5e1139a7af5c67192b23172e2a735
2024-05-09 11:18:27 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 181ed33ab0 Add percentages for border-radius props (#44408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44408

Why?
Previously we didn't support using percentages like:
```
style={{
  width=100,
  height=100,
  borderRadius='100%',
}}
```

These percentages refer to the corresponding dimension of the border box.

What?
- Added LengthPercentage class and LengthPercentageType enum. To track when we are dealing with percentage vs points
- Now radius properties start as Dynamic which then get transformed into LengthPercentage.
- Modified certain function parameters so we can consider height and width when resolving BorderRadius values

With this we conditionally calculate the corresponding point (dp) value for a given percentage (considering size). Ex:

```
result = {raw_percentage_value} / 100 * (max(height, width))
```

We know the maximum border radius for our current implementation is half the dp of the shorter side of our view, hence why we consider half our maximum view side as equivalent to 100%.

Note: We still don't support vertical/horizontal border radii

## Changelog:

[Android][Added] - Added support for using percentages when defining border radius related properties.

Reviewed By: NickGerleman

Differential Revision: D56943825

fbshipit-source-id: 3e5a9933ca90e499aff9c7d2561f5f6bb55157da
2024-05-09 11:18:27 -07:00
yungsters (Meta Employee)andFacebook GitHub Bot a45c5895f9 Setup Wave 2 of Feature Flags for React Native (#28990)
Summary:
## Summary

Sets up dynamic feature flags for `disableStringRefs`, `enableFastJSX`,
and `enableRefAsProp` in React Native (at Meta).

## How did you test this change?

```
$ yarn test
$ yarn flow fabric
```

DiffTrain build for commit https://github.com/facebook/react/commit/9b1300209eb00a2d6c645fddf6d2729d67d7b10a.

Reviewed By: kassens

Differential Revision: D57026752

Pulled By: yungsters

fbshipit-source-id: 18b2112fce1671bb83f281b1e036991fa7d6d4ee
2024-05-09 09:27:39 -07:00
Edmond ChuiandFacebook GitHub Bot cc99e924ca add prefersFuseboxFrontend field to debugger_command (#44499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44499

Changelog: [internal]

As [discussed](https://fb.workplace.com/groups/react.devx.team/permalink/930483712103526/), we'll begin segmenting Telemetry signals by Fusebox/non-Fusebox.

* Add new flag in event reporter for `debugger_command` (other events in subsequent diffs)
* Add new column to the Scuba destination

Reviewed By: blakef

Differential Revision: D57140479

fbshipit-source-id: 7ea813b1b4d53a282873fa95c8ee82e5d6f3d1d3
2024-05-09 03:43:38 -07:00
Edmond ChuiandFacebook GitHub Bot 75dc42f4df extract param type (#44498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44498

Changelog: [internal]

Quick refactor to reduce commit noise in the following diff in the stack

Reviewed By: blakef

Differential Revision: D57140480

fbshipit-source-id: aa1fef83d5347b8a11651d3d5c4112b4adf7a7d5
2024-05-09 03:43:38 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7835aa4341 Complete conversion of modules.debug module (#44476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44476

# Changelog:
[Internal] -

This is the last step to converting the whole `modules.debug` module to Kotlin.

Reviewed By: christophpurrer

Differential Revision: D57095966

fbshipit-source-id: 3fcb52528674565a4a2b5c306262e0af11a19e6e
2024-05-09 03:21:30 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7ec70a94dd Convert FpsDebugFrameCallback/AnimationsDebugModule to Kotlin (#44475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44475

# Changelog:
[Internal] -

As the title says, this is preparing to complete the conversion of the whole corresponding module to Kotlin.

Reviewed By: christophpurrer

Differential Revision: D57095896

fbshipit-source-id: 87fe08aec974f5f1327189d0e74c3782c4391e85
2024-05-09 03:21:30 -07:00
Robin ShinandFacebook GitHub Bot 2bde626a9f fix: TextInput selectionColor props on iOS (#44420)
Summary:
This pull request fixes an issue where the `selectionColor` prop was not applied to the `TextInput` component on iOS, starting from React Native version 0.74.x.

This issue was introduced in PR [1e68e485](https://github.com/facebook/react-native/commit/1e68e48534aedf1533327bf65f26e5cf5b80127b#diff-b6634353ea5b10a91de24605dc51bdfb50e8ddb652ccd5b9dab194168a69d4b1) which relocated `selectionColor` along with `selectionHandleColor` and `cursorColor` out of `otherProps`. This modification inadvertently prevented `selectionColor` from being passed to the iOS native component.

This change ensures that the `selectionColor` prop is explicitly included in the `RCTTextInputView` component's properties, fixing the regression.

Note: `selectionHandleColor` and `cursorColor` are Android-specific and do not require explicit passing on iOS.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fixed an issue where the `selectionColor` prop was not being applied on the `TextInput` component.

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

Test Plan:
**Environment:** iOS Simulator, React Native 0.74.0.

**Steps to reproduce:**

- Implement a `TextInput` component with the `selectionColor` prop set.
- Run the application on an iOS device or simulator.
- Focus on the TextInput component, write some text and select it.

**Expected Result:** the selection color should match the color provided to the `selectionColor` prop.

**Actual result before fix:** the selection color did not reflect the specified `selectionColor` prop and fell back to the default iOS selection color (blue).

**Screenshots:**
- Before fix:
<img width="1710" alt="before_fix" src="https://github.com/facebook/react-native/assets/17989553/8660068c-55c9-4f55-a788-f96eb681fb70">

- After fix:
<img width="1710" alt="after_fix" src="https://github.com/facebook/react-native/assets/17989553/93c9eb26-7da0-4957-b54f-8444aff7e374">

Reviewed By: javache

Differential Revision: D57017836

Pulled By: NickGerleman

fbshipit-source-id: 263ce22168e09c15cdfdb4eb4300a2605d8af032
2024-05-08 20:10:54 -07:00
Liron YahdavandFacebook GitHub Bot 17164280f4 Remove duplicate SystraceSection.h file (#44319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44319

The files were identical so no need for both. Having both is error-prone as one may be modified without modifying the other.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56659179

fbshipit-source-id: e5f414f0c4a00c126d301a7fcd26eeb17d74a56c
2024-05-08 15:09:08 -07:00
Thomas NardoneandFacebook GitHub Bot 2ac8dc1e78 Coordinate Synchronous Events with Choreographer (#44491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44491

Changelog: [internal]

Ensure only one scroll event is fired per frame by tracking the events in FabricUIManager

Reviewed By: sammy-SC

Differential Revision: D57018741

fbshipit-source-id: c1ad59f934e359edfeb8f3e084106eebd467a0b1
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot 52ca6f6569 Enable synchronous scroll events (#44490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44490

Changelog: [internal]

Enable the experimental syncOnScroll flag in JS.

Reviewed By: sammy-SC

Differential Revision: D56886404

fbshipit-source-id: 6d5081cdcd319b73f0dc4329adc4e2cd7ba17139
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot dbc0334159 Fling][Android] Add synchronous event support (#44489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44489

Changelog: [internal]
Integrate a synchronous event API to trigger synchronous scroll events in Android. The API will be changed in the future, this is exposed only for experimentation.

Reviewed By: sammy-SC

Differential Revision: D56886403

fbshipit-source-id: 337277c735c0943ce4ba29bb2d646a72fe101ede
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot c913196cc0 Add native synchronous event support (#44451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44451

Changelog: [internal]

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

Reviewed By: NickGerleman

Differential Revision: D56886402

fbshipit-source-id: 7b71cd489e3bb65dffcfb53fef2ea7cafbb973f2
2024-05-08 14:32:24 -07:00
Joe VilchesandFacebook GitHub Bot 88ab1ceeae RN tester example for filters (#44459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44459

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56857709

fbshipit-source-id: 4bbeeed89ec40ca5c9a3472578388699e47f9c9c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot 0dceac9f02 JS plumbing to get filters into native (#44458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44458

This is the JS plumbing to get it so that views can now use filters. The typing looks like

`filter: [{brightness: 1.5}, {hueRotate: '90deg'}]`

which is different than web which would look like `filter: brightness(1.5) hue-rotate(90deg)`. I feel like the web version is overly complicated and not very *react native-y*. Transform uses the array based approach (albeit they also accept a string). Open to changing this but really feel like the web format is silly and bad since it would just involve parsing some arbitrary string.

The diff includes:

* Style sheet changes so typing is valid
* Process function to turn filter format into {name: string, amount: string}
* Test for process function
* View config changes on Android, iOS and ReactNativeStyleAttributes

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56845572

fbshipit-source-id: 5029b5adac29bb863c89f6c699d5693c58cad711
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot c27f2ab747 Implement brightness and opacity using blend modes (#44457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44457

Most filters are not going to work on iOS. It is a long story but essentially there is not a good way to continuously get a snapshot of the view and its descendants to filter.

We can, however, implement `brightness` using `compositingFilter` and blend mode. This is really not documented at all, but if you assign a string representing the blend mode to the [`compositingFilter`](https://developer.apple.com/documentation/quartzcore/calayer/1410748-compositingfilter?language=objc) property on CALayer, it will actually work. The filter we use is [`multiplyBlendMode`](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIMultiplyBlendMode). As the title suggests this just multiplies the two layers. We can apply this to a `_filterLayer` and set its background color to the brightness amount to get the desired results. Most other color filters either operate on the color components dependently (e.g. new red component depends the value in blue and green), or they have addition operations. We can do addition with `linearDodgeBlendMode`, but the order of operations does not work (we multiply, clamp, then add vs. multiply, add, then clamp).

`opacity` is just a multiplier on the CALayer `opacity` property.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56447175

fbshipit-source-id: 6705673dd9dec9fc3ec89e49b583523eec1028b7
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot d776d8c8a4 Make it so that a view with a filter forms a stacking context and containing block (#44456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44456

Self explanatory: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context#description and https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D55044674

fbshipit-source-id: fcc3b04f5b1d5dd11b8e9e15b3c5bdbf9b609f7c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot f340e6e575 Parse raw filter props (#44455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44455

Title says it all. Right now this ignores drop-shadow as that will be implemented later. Some of this code will need to be adjusted as it is the one filter that takes multiple amounts. But I feel that can be amended later when we get there - after all the `amount` parsing code is just casting to a float at the moment, so we are not locking ourselves into anything.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D54640629

fbshipit-source-id: c8e1206ab46accab3c99614241b8bd9aa252e12c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot 00f3867ac3 Opacity filter on Android (#44454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44454

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56847475

fbshipit-source-id: bbd51e8c744914f1d2caf392996d20ab03b3fb6f
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot b0e746e4bb Plumbing to set filters on Android views (#44453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44453

This works similar to how `transform` is parsed in that it sets tags on the View to actually update the prop when all the prop setters are done being called since the parsing of the array is not very trivial. Besides that it is pretty simple and just calls into `FilterHelper` and uses `setRenderEffect`: https://developer.android.com/reference/android/view/View#setRenderEffect(android.graphics.RenderEffect).

That API is only exposed in version 31 of the SDK so it is gated accordingly.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D54640600

fbshipit-source-id: ad4cde2bed9611f476f4ecb2550c2269965d7917
2024-05-08 13:39:09 -07:00
kaganeceandFacebook GitHub Bot 6213b2a62a fix: deprecated babel plugins issue fixed (#44416)
Summary:
In this pr, I updated the deprecated babel-plugins with their new library. When you enter the npm page of the relevant plugins, it is recommended to implement new packages instead of the deprecated package.
For example :

<img width="1305" alt="Screenshot 2024-05-05 at 17 50 16" src="https://github.com/facebook/react-native/assets/113903710/a58fdac3-79db-4b53-98bd-4c5325a1e560">

## Motivation:

We use the react-native package in our project and aim to upgrade pnpm to the latest version. First, we wanted to clear deprecated warnings. Babel plugin deprecated warnings were caused by the react-native package, so I created this pull request.
Deprecation Warnings from package installing :

<img width="581" alt="Screenshot 2024-05-05 at 17 53 05" src="https://github.com/facebook/react-native/assets/113903710/9c5859a5-f194-43ab-ae35-417dfaacebab">

## Changelog:

[GENERAL][FIXED] - Replace deprecated babel-plugin libraries to fix deprecation warnings on installation

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

Test Plan: CI should pass

Reviewed By: huntie

Differential Revision: D57056843

Pulled By: robhogan

fbshipit-source-id: b75b329bbc2105c31da85e861ef71ffdcbbb0623
2024-05-08 12:51:00 -07:00
Rubén NorteandFacebook GitHub Bot fd299509df Implement potential fix for mounting errors during synchronous state updates (v2)
Summary:
Changelog: [internal]

This is a new attempt at fixing mounting errors during synchronous state updates after what we tried in https://github.com/facebook/react-native/pull/44015.

That fix didn't work because `dispatchMountItems` actually makes a copy of the mount items that it's going to process, so when we added the mount items to the list they were actually not being picked up by the current processing.

This changes the fix to call `dispatchMountItems` as many times as needed, while there are mount items to process in the list.

Reviewed By: sammy-SC

Differential Revision: D57107212

fbshipit-source-id: 46988a71daae15d70399258f850653046d0790ff
2024-05-08 12:36:06 -07:00
Arushi KesarwaniandFacebook GitHub Bot 958f8e2bb5 Remove deprecated measureLayoutRelativeToParent of UIManagerModule (#44452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44452

`measureLayoutRelativeToParent` was deprecated 5 years ago in D16471845 and doesn't have [JS usages](https://fburl.com/code/tgwon7nb)

For the JS exposed UIManager API for measureLayoutRelativeToParent is through [UIImplementation.measureLayoutRelativeToParent()](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java?lines=804-815)

Hence deleting this for 0.75 Release. This will simplify the backwards compatibility of UIManagerModule

Changelog:
[Android][Removed] Delete UIManagerModule.measureLayoutRelativeToParent()

Reviewed By: javache

Differential Revision: D57069921

fbshipit-source-id: 9f871424a39caf3cbeaa5570c7e101a714c11aa6
2024-05-08 10:23:24 -07:00
Tim YungandFacebook GitHub Bot 4290ef5d0d RN: Cleanup ReactNativeInternalFeatureFlagsMock (#44445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44445

The `ReactNativeInternalFeatureFlagsMock` module is not references in the open source repository, so there's no reason it should exist there. This cleans that up.

Changelog:
[Internal]

Reviewed By: kassens

Differential Revision: D57052284

fbshipit-source-id: d220eae2ba76f20ed48742779fbffd5de1f77529
2024-05-08 07:14:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 64739066dd Request bundles with excludeSource=true and sourcePaths=url-server in Fusebox experiment (#44444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44444

Changelog: [Internal] - Request bundles with `excludeSource=true` and `sourcePaths=url-server`.

Changes RN's bundle client to request more efficient source maps from Metro by relying on lazy-fetching of source contents.

NOTE: Requires a Metro version with D56952064 and D56952063 (not yet released on npm) to work properly.

Reviewed By: robhogan

Differential Revision: D56952065

fbshipit-source-id: 0ed083ecc64adbd7acf209bb9abd40db24ffc86b
2024-05-08 07:00:31 -07:00
Moti ZilbermanandFacebook GitHub Bot de1d605253 Add Flow to @react-native/polyfills entry point (#44477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44477

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D57091620

fbshipit-source-id: 54fd105069ba0a34b9ab5bd12295e4e9641492a3
2024-05-08 06:46:15 -07:00
Blake FriedmanandFacebook GitHub Bot 01cbb173aa Allow apple to configure Hermes as option (#44461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44461

Users would have to do this by manipulating the environment before.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067036

fbshipit-source-id: 6df16c884412578c3b5cae50e26ca37636a7dc5b
2024-05-08 06:43:52 -07:00
Moti ZilbermanandFacebook GitHub Bot 8d0046a5e1 Make INTERNAL_CALLSITES_REGEX work with Windows paths (#44469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44469

Changelog: [General][Fixed] LogBox and Chrome DevTools stack frame collapsing patterns are now compatible with Windows file paths.

Reviewed By: GijsWeterings

Differential Revision: D57091214

fbshipit-source-id: f62d9fe7f3d4f91ed8ea07521b174989c2dd1c81
2024-05-08 03:52:44 -07:00
monholmandFacebook GitHub Bot 2d8c6f591c docs(react-native): fix app build.gradle react config default paths (#44472)
Summary:
Minor inconvenience I noticed while doing some testing in a mono-repo.

The current paths points to the android folder, but should point to the project root. Currently the android build fails if one uncomments the folder paths as they are.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

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

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

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

Test Plan:
Uncomment the paths are they are and notice the android build error:
```
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > /xyz/xyz/xyz/xyz/RNPathTester/android/node_modules/react-native/ReactAndroid/gradle.properties (No such file or directory)
```

Use the updated paths and notice the build succeeds 🥳

Reviewed By: GijsWeterings

Differential Revision: D57093768

Pulled By: cipolleschi

fbshipit-source-id: 8472151c74c7aa5c51dc75f9adda6116387bdf99
2024-05-08 02:27:23 -07:00
Ramanpreet NaraandFacebook GitHub Bot deee037c62 Back out "chore: Remove deprecated onTextInput callback"
Summary:
Original commit changeset: 89101fa53cdc

Original Phabricator Diff: D56804590

Changelog: [IOS] [Added] - Un-removed deprecated onTextInput callback

Reviewed By: realsoelynn

Differential Revision: D57082228

fbshipit-source-id: 30d62164788b94a9f3193bf78a7bee0c7ce464f6
2024-05-07 20:29:10 -07:00
Nick GerlemanandFacebook GitHub Bot 9da6546967 Avoid ByteBuffer copies when reading nested MapBuffers (#44436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44436

The backing buffer behind `ReadableMapBuffer` is effectively immutable, so we can make reads of nested MapBuffers work on an inline view of the same buffer. This book-keeping is kept within ReadableMapBuffer (we can not user `ByteBuffer.wrap()` because the fbjni produces ByteBuffer is not array backed).

The main downside I can think of is that the whole buffer is kept in memory until all children buffers leave, but current use-cases don't involve long-term storage of MapBuffer children, so this is probably a better tradeoff.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57020759

fbshipit-source-id: d2f5a76561fa4a4219fe5022ba62cc96f56ce022
2024-05-07 15:40:37 -07:00
Pieter De BaetsandFacebook GitHub Bot 29c3bc0444 Simplify timer deletion code (#44443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44443

Call `erase` directly instead of doing `find` + `erase`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57049086

fbshipit-source-id: b8a30b66f080897fef31677b2c9e1cdff99a71d2
2024-05-07 15:27:45 -07:00
Alan LeeandFacebook GitHub Bot be09d12667 TextInput - selection prop is not set on component creation (#44398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44398

**Problem:**
`selection` prop is not being set on component creation.
Not quite sure which RN version this issue was introduced but fixing it on latest code.

Use playground for testing (refer to following diff)

**Proposed Solution:**

Added notes in comments but `viewCommands.setTextAndSelection()` is called only on text or selection update which relies on comparing data with `lastNativeSelection`. Problem is that `lastNativeSelection` is initially set to the props value that is passed in so does not send the command on component creation.

So assign a default selection value of `{start: -1, end: -1}` so it can be set on component creation.

**Changelog:**
[General][Fixed] - `selection` prop in `TextInput` was not being applied at component creation

Reviewed By: cipolleschi

Differential Revision: D56911712

fbshipit-source-id: 7774b246383f85216536040688b0a8ea85b3478a
2024-05-07 13:15:55 -07:00
Nick GerlemanandFacebook GitHub Bot 9b77506309 Fix CSSTokenizer handling of decimals without leading zeroes (#44432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44432

Implements a bit more of the tokenizer algorithm, to correctly support dimensions like `.25turn` instead of just `0.25turn`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57033796

fbshipit-source-id: 6d73de22e3a0f0ca0de432be56bca97f0069ad96
2024-05-07 12:43:59 -07:00
Nick GerlemanandFacebook GitHub Bot 0c9b2a433f Use macro for CSSTokenizerTest assertions (#44431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44431

Turn `expectTokens()` function into a macro so that GTest assertion macros point to the right line numbers.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57034303

fbshipit-source-id: f6d18c0d2420e50c75b61a57489e9ddc12653fb6
2024-05-07 12:43:59 -07:00
Nick GerlemanandFacebook GitHub Bot 5c79e99ce8 Add CSSValue support for <angle> data type (#44430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44430

Let's add support for angles so we can correctly represent things like rotation/skew transforms or hue-rotate filter. This should replace `ValueUnit` in prop related transform code.

A couple implementation notes:
1. RN currently uses radians internally, but CSS says the cannonical angle unit is degrees, so we keep to that
2. We have all the information to convert to cannonical value type at parsing layer, so we do that, and clients can only see degreee values instead of units. Less flexible, but simpler/more efficient for now, where higher levels don't care.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57029378

fbshipit-source-id: 91341f1bf4686d9016823ac8cf91897e933345f9
2024-05-07 12:43:59 -07:00
Eric RozellandFacebook GitHub Bot 40b54ee671 Cleanup unnecessary includes in default modules header (#44427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44427

We only need the default module implementation headers in the C++ file. These were added to the header file for the default module helper by mistake.

## Changelog

[Internal]

Reviewed By: NickGerleman

Differential Revision: D57003838

fbshipit-source-id: d37ebd247eaa2c0cb05ebc6c666a585e6352646d
2024-05-07 10:14:04 -07:00
Stefan WrobelandFacebook GitHub Bot 47b42dc845 Add nil check to privacy manifest generation (#44400)
Summary:
After upgrading my app from React Native 0.74.0 to 0.74.1, iOS builds were failing due to the privacy manifest ruby script failing due to what seemed to be a missing nil check.

```
[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file.
[Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs.
[!] An error occurred while processing the post-install hook of the Podfile.

no implicit conversion of nil into Array

node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:115:in `+'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:115:in `block (5 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `block (4 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `block (3 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:105:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:105:in `block (2 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:104:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:104:in `block in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:102:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:102:in `get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:18:in `add_aggregated_privacy_manifest'
node_modules/react-native/scripts/react_native_pods.rb:301:in `react_native_post_install'
ios/Podfile:38:in `block (3 levels) in from_ruby'
vendor/bundle/ruby/3.3.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/podfile.rb:196:in `post_install!'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook'
vendor/bundle/ruby/3.3.0/gems/cocoapods-pod-sign-1.3.0/lib/cocoapods-pod-sign/pod_installer.rb:45:in `run_podfile_post_install_hook'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:149:in `message'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:307:in `generate_pods_project'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:183:in `integrate'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/command/update.rb:63:in `run'
vendor/bundle/ruby/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
vendor/bundle/ruby/3.3.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
vendor/bundle/ruby/3.3.0/bin/pod:25:in `load'
vendor/bundle/ruby/3.3.0/bin/pod:25:in `<top (required)>'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `load'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:58:in `kernel_load'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli/exec.rb:23:in `run'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli.rb:451:in `exec'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli.rb:34:in `dispatch'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/cli.rb:28:in `start'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/exe/bundle:28:in `block in <top (required)>'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/Users/swrobel/.gem/ruby/3.3.1/gems/bundler-2.5.9/exe/bundle:20:in `<top (required)>'
/Users/swrobel/.gem/ruby/3.3.1/bin/bundle:25:in `load'
/Users/swrobel/.gem/ruby/3.3.1/bin/bundle:25:in `<main>'
```

Adding some good old `puts` debugging to this file indicated that the problem was that an invalid manifest file was being generated for react-native-image-crop-picker, which I don't understand, because it [doesn't currently have a Privacy Manifest](https://github.com/ivpusic/react-native-image-crop-picker/issues/2040).

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>NSPrivacyTracking</key>
        <false/>
        <key>NSPrivacyTrackingDomains</key>
        <array/>
        <key>NSPrivacyCollectedDataTypes</key>
        <array/>
        <key>NSPrivacyAccessedAPITypes</key>
        <array>
                <dict/>
        </array>
</dict>
</plist>
```

It seems there may be some upstream issue in whatever tool generates these missing privacy manifests, but that seemed beyond the scope of a simple nil check.

## Changelog:

[iOS] [FIXED] - Privacy Manifest aggregation failing due to missing nil check

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

Test Plan: Build completes successfully after making this change.

Reviewed By: cipolleschi

Differential Revision: D56921303

Pulled By: philIip

fbshipit-source-id: 1b6b10b05d403bf71f78f5b80543a2d82f043e23
2024-05-07 10:00:55 -07:00
Rubén NorteandFacebook GitHub Bot 024f3357bb Fix bug in IntersectionObserver (#44439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44439

Changelog: [internal]

(IntersectionObserver isn't enabled yet in OSS).

This fixes a bug in `IntersectionObserver` when observing the same target in multiple observers. In that case, the first time we `unobserve` we clean up some metadata that's shared across observers, and other observers observing the target have problems with the missing data.

This fixes the problem by removing the clean up, as the data structure backing this information is a `WeakMap` anyway, so it'll be cleaned up automatically eventually, and the stored data is very small.

Reviewed By: twobassdrum

Differential Revision: D57046864

fbshipit-source-id: b001cf1ae4f4c91b74b1ad487e01691d5f3be1ce
2024-05-07 09:43:48 -07:00
Ingrid WangandFacebook GitHub Bot a23ae9c7f2 Migrate references to deprecated UIActivityIndicatorViewStyles (#44428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44428

## Changelog:

[iOS][Fixed] Removed references to deprecated UIActivityIndicatorViewStyles

Reviewed By: cipolleschi

Differential Revision: D57006157

fbshipit-source-id: c85a6d1415c43be145ab06c3719dc04bf1e63a0b
2024-05-07 08:58:42 -07:00
Blake FriedmanandFacebook GitHub Bot 3ddf509924 Back out "conditional Babel registration no longer necessary"
Summary:
Original commit changeset: 6bec706c639f

Original Phabricator Diff: D56839521

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D57052476

fbshipit-source-id: 7c598f43b23959f1accf555be38abc95e4ef35fd
2024-05-07 08:36:04 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 12110a4d94 Migrate fabric.mounting.mountitems subset to Kotlin (#44440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44440

# Changelog:
[Internal] -

As in the title, note that there are more files there to migrate, will come separately, to make reviewing easier.

Reviewed By: javache

Differential Revision: D57046953

fbshipit-source-id: e45316da1ed9caaa4daafa96dfabfd374926bd73
2024-05-07 08:34:04 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot b63a523c16 Move fabric.Binding* to Kotlin (#44438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44438

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57046289

fbshipit-source-id: 383141821cc73c1cbbfc3aa168441cd051c4c2d6
2024-05-07 08:23:44 -07:00
Thomas NardoneandFacebook GitHub Bot c7dcdc1c09 ReactEventEmitter null fix (#44394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44394

Lint fix - flip to a guaranteed non-null value instead of the nullable field

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56898951

fbshipit-source-id: 8740ed77d71a827c7ce80b2df941d24985339619
2024-05-07 08:05:33 -07:00
Thomas NardoneandFacebook GitHub Bot 3f59d53281 Nullsafe fabric/events classes (#44392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44392

Updating null annotations to match convention.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56895070

fbshipit-source-id: 05ef7d8ba7f3c4a8ec352336c86e1c02cf0bb601
2024-05-07 08:05:33 -07:00
Saad NajmiandFacebook GitHub Bot 24aece35b4 chore: Remove deprecated onTextInput callback (#44351)
Summary:
TextInputs' `onTextInput` callback was removed way back in React Native 0.62 with https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab , but remnants of the implementation exists. Let's just remove it altogether?

## Changelog:

[IOS] [REMOVED] - Remove deprecated onTextInput callback

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

Test Plan: CI should pass

Reviewed By: NickGerleman

Differential Revision: D56804590

Pulled By: javache

fbshipit-source-id: 89101fa53cdc628a97ba176cf3deca691784bfdd
2024-05-07 07:08:35 -07:00
Matin Zadeh DolatabadandFacebook GitHub Bot 06eea61c19 chore: update Gemfile in template (#44434)
Summary:
Cocoapods regression is now fixed (been fixed for a while) but we forgot to remove the upper bound and explicit `activesupport` in Gemfile.

https://github.com/CocoaPods/CocoaPods/releases/tag/1.15.2

## Changelog:

[IOS] [CHANGED] - Update Gemfile in template

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

Test Plan: Run `bundle install/update` should update cocoapods to the latest version and active support should work properly without any issues.

Reviewed By: blakef

Differential Revision: D57046638

Pulled By: cipolleschi

fbshipit-source-id: 9d8e716d4392d7bc5a1940b523e57d2193134f95
2024-05-07 05:40:40 -07:00
Blake FriedmanandFacebook GitHub Bot 47848ad15f conditional Babel registration no longer necessary (#44362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44362

Packages that are built and directly run in the monorepo no longer need to worry about
conditionally registering themselves to transpile Flow -> JS at runtime. Our build step
strips this file now.

Changelog: [Internal] changes in published packages no longer require conditional calls to Babel register.

Reviewed By: huntie

Differential Revision: D56839521

fbshipit-source-id: 6bec706c639f1ab4138e0b790be8a07654333046
2024-05-07 03:16:00 -07:00
Kudo ChienandFacebook GitHub Bot 2d46dbe6ce Fix HermesExecutorFactory build error (#44423)
Summary:
https://github.com/facebook/react-native/commit/7af288e5 introduced a breaking change for whoever importing HermesExecutorFactory.h, because the `hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h` is not a public header. Also the nested import is not ideal for CocoaPods or use_frameworks.
I think HermesRuntimeTargetDelegate could be an implementation detail that hide from header. This PR tries to turn the ownership declaration from std::optional to std::unique_ptr, so that we could hide the concrete type.

## Changelog:

[IOS] [FIXED] - Fixed `HermesExecutorFactory.h` build error when importing its private header

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

Test Plan: should introduce no breaking change and ci passed

Reviewed By: cipolleschi

Differential Revision: D57041498

Pulled By: huntie

fbshipit-source-id: bfa10c7307458813d99c52313682dd62bea80f19
2024-05-07 03:06:54 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 362abb9ffe Factor hardcoded image paths out in RNTester/Image example, get rid of .ico file (#44415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44415

# Changelog:
[Internal] -

RNTester Image example used hardcoded `https://www.facebook.com/favicon.ico`, which has an uncommon ICO format, for no good reason aside of just this image being served from `facebook.com`.

This diff:
* Replaces the ICO image with a PNG one (which is still served from `facebook.com`
* Factors out all the multiple hardcoded paths into constants, so that it's easier to make such changes in the future
* Changes another image to something that is a bit better on the eyes when severely downscaled

Reviewed By: christophpurrer

Differential Revision: D56978929

fbshipit-source-id: c627d1671c8cb66e9a78f4382faa56e539b2f7b3
2024-05-05 13:22:59 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 9d2cf42f95 Add "Refresh Image" to RNTester Image.fadeDuration example (#44414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44414

# Changelog:
[Internal] -

I noticed that "Image/Fade Duration" test in RNTester is practically useless, as at the moment one scrolls to the test, the fading is most probably had already ended.

This adds a "button" to refresh the image and be able to see the fading in again and again, if desired.

Reviewed By: christophpurrer

Differential Revision: D56978930

fbshipit-source-id: 02873b45600ad319b0b1077467f599dc1a54bee3
2024-05-05 13:22:59 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7558d5f6f5 Migrate ImageLoaderModule to Kotlin (#44413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44413

## Changelog:
[Internal] -

As in the title, the corresponding module is migrated from Java to Kotlin.

Reviewed By: christophpurrer

Differential Revision: D56978931

fbshipit-source-id: e1e8f22ad9bd2f594bc7cf77c6344f8f23996bcc
2024-05-05 11:11:16 -07:00
Ramanpreet NaraandFacebook GitHub Bot a881b51feb Add todo for RCTRuntimeExecutor deletion
Summary:
Followup to D56848799!

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D56935723

fbshipit-source-id: 859cd88c06a972b2fb44525eee075df7c701c83a
2024-05-04 09:27:26 -07:00
Phillip PanandFacebook GitHub Bot 69bb4fca44 introduce CallInvokerHolder stable API (#44381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44381

Changelog: [Android][Added]

I am adding this API in favor of RCTRuntimeExecutor. CallInvoker is now preferred because after #43375, the CallInvoker has access to the jsi::Runtime. Since the community is using CallInvoker already for their async access use cases, CallInvoker is the preferred choice of RuntimeExecutor / RuntimeScheduler because of easier migration. Also, having a wrapper like CallInvoker will give us more flexibility in the future if we want to expand this API.

this will be forward compatible in the old architecture

Reviewed By: RSNara

Differential Revision: D56866817

fbshipit-source-id: 4096847c52559d9a49feb072a0385da6b64392d4
2024-05-04 02:21:37 -07:00
Jesse Watts-RussellandFacebook GitHub Bot 377c2f5d88 Allow custom override to utilize KeyWindow for default fallback colorScheme (#44383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44383

This diff allows the default fallback style to be grabbed from KeyWindow. Previously with the TraitCollections being passed in from overridden views it was not getting the accurate system fallback.

We need this for Twilight, which is adopting a Light/Dark mode toggle. Previously when setColorScheme was getting called it would modify overrideUserInterfaceStyle and that would serve as the "default fallback" for future setColorScheme calls. setColorScheme shouldn't be setting the defaults, it should be setting the user-session theme preference.

Changelog:
[Internal] [Changed] - Added option for treating the KeyWindows's userInterfaceStyle as the source of truth for the system's dark/light mode.

Differential Revision: D56868862

fbshipit-source-id: 229894947baed65ef15cece5bece120e8497462f
2024-05-03 22:15:29 -07:00
Nick GerlemanandFacebook GitHub Bot 002396beae Fix cached spannable measurement path (#44409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44409

This is kind of a mess.

D56800381 moved us away from code relying on legacy TextLayoutManager, under the assumption we weren't using the old one anymore. It turns out we were still using the legacy TextLayoutManager for the sole case of  cached spannables, where we ask FabricUIManager to measure using non-mapbuffer path, and pass the cache key (no underlying attributedstring). After the diff, we call default VM measure function, which returns zero size. This specifically breaks measurements of uncontrolled TextInput components.

This updates that path to use the same TextLayoutManager as we use for everything else.

This model breaks some code which assumes the AttributedString is present, instead of just para attributes. The redundant calls to get fragments is expensive and already something on my radar to fix, but for now, we mostly just no-op, the same way the old TextLayoutManager did when fragments were not set. This needs a good cleanup.

Changelog:
[Android][Fixed] - Fix cached spannable measurement path

Reviewed By: javache

Differential Revision: D56963152

fbshipit-source-id: 6dc0e29f6b63d367be1ba0be82dfbc18c4654ab2
2024-05-03 20:48:27 -07:00
Phillip PanandFacebook GitHub Bot 05a4232dd5 add forward compatibility for bridgeless CallInvoker API (#44376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44376

Changelog: [Internal]

In order to make migration a little bit cleaner, I thought it would be nice to implement forward compatibility for RCTCallInvokerModule. This way, the consumer doesn't have to have branching logic when they try to retrieve the callInvoker in their code, and can remove a callsite to the bridge.

Reviewed By: RSNara

Differential Revision: D56807993

fbshipit-source-id: 6c9aa74db15e04b8ab632d230b3e525363a4d1ca
2024-05-03 16:38:26 -07:00
George ZaharievandFacebook GitHub Bot 1d2221ab4e Update hermes-parser and related packages in fbsource to 0.21.0, take 2 (#44395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44395

Bump hermes-parser and related packages to [0.21.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D56900032

fbshipit-source-id: 073aeb6f538bb4b56bf309fbd3f9edb2f04b30d0
2024-05-03 11:19:05 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5a120322bf Prepare changelog for 0.74.1 (#44391)
Summary:
Changelog for 0.74.1

## Changelog:

[Internal] - Added changelog for 0.74.1

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D56898528

Pulled By: cipolleschi

fbshipit-source-id: d93f043ef1bf5f33573c656ecdad6a83d36089d5
2024-05-03 09:54:51 -07:00
Tim YungandFacebook GitHub Bot 5062c5256e RN: Define name on Mock Components in Jest (#44399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44399

Improves the result of `mockComponent` in React Native's Jest environment so that it has an accurate `name` property.

This will be important when React enables deriving component stack locations via error stack frames.

Changelog:
[General][Changed] - `mockComponent` now also mocks `name`

Reviewed By: kassens

Differential Revision: D56914915

fbshipit-source-id: 1bea3e8773c56f70a89d2171c436f85178676373
2024-05-03 08:16:36 -07:00
Pieter De BaetsandFacebook GitHub Bot a16f7dc547 Improve spec-compliance of bridgeless timer implementation (#44380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44380

* setInterval's second argument is optional, and defaults to 0
* setTimeout is spec'ed to return a positive integer.

There's also no need to use HostObjects here to represent the timer index, it just hurts performance and makes this code more complex for no clear reason.

Changelog: [General][Fixed] New architecture timer methods now return integers instead of an opaque object.

Reviewed By: RSNara

Differential Revision: D56863422

fbshipit-source-id: fd3e75303662d865083d01e2bfe8633bac151a0e
2024-05-03 08:04:05 -07:00
Nicola CortiandFacebook GitHub Bot b163ed8655 RNGP - Fix core Autolinking attemping to link dependencies without a android block (#44385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44385

The current core autolinking is failing if a dependency doesn't have an `android` block.
Instead we should filter out all the dependencies that don't have an `android` definition when generating code.

Fixes https://github.com/reactwg/react-native-releases/issues/276

Changelog:
[Internal] [Changed] - RNGP - Fix core Autolinking attemping to link dependencies without a `android` block

Reviewed By: blakef

Differential Revision: D56876267

fbshipit-source-id: 900b13bec697fceac50c994f277621a10e281410
2024-05-03 01:51:28 -07:00
Phillip PanandFacebook GitHub Bot 7ea84bd3eb deprecate RCTRuntimeExecutorModule (#44377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44377

Changelog: [iOS][Deprecated] deprecate RCTRuntimeExecutorModule

After we make CallInvoker available to native modules, we don't need this. Document it and mark it as deprecated.

Reviewed By: RSNara

Differential Revision: D56848799

fbshipit-source-id: 5628eef01a53bfd29d5b89c0398a938bdd87b0ac
2024-05-03 01:29:13 -07:00
Phillip PanandFacebook GitHub Bot 8f9ff89093 introduce CallInvoker API for bridgeless modules (#44378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44378

Changelog: [iOS][Added] introduce CallInvoker support in bridgeless native modules

I am adding this API in favor of RCTRuntimeExecutor. CallInvoker is now preferred because after #43375, the CallInvoker has access to the jsi::Runtime. Since the community is using CallInvoker already for their async access use cases, CallInvoker is the preferred choice of RuntimeExecutor / RuntimeScheduler because of easier migration. Also, having a wrapper like CallInvoker will give us more flexibility in the future if we want to expand this API.

Reviewed By: RSNara

Differential Revision: D56807994

fbshipit-source-id: 5c3585356d016a50645eda3af2d3bbe00298b4e4
2024-05-03 01:29:13 -07:00
Christoph PurrerandFacebook GitHub Bot eb1b42fa8b Sort spec members
Summary:
The motiviation of this change is to produce sorted / stable native module schemas which members are alphabetically sorted. The benefit is mainly for verifying test fixtures as now new test cases will be inserted at predicatable spots.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D56741776

fbshipit-source-id: 842af73cac3b4859d2074e6a5206015924e87201
2024-05-02 20:31:50 -07:00
Tim YungandFacebook GitHub Bot abb7070a51 RN/Relay: Upgrade to React v18.3.1 (#44397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44397

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

Upgrades `react-native` and `relay` to the newly published `react@18.3.1`.

Changelog:
[General][Changed] - Upgrade to `react@18.3.1`

Reviewed By: jackpope

Differential Revision: D56901818

fbshipit-source-id: 423d35205bb533c6a39c0fed25a1ffea1f0bc12d
2024-05-02 16:18:26 -07:00
Pieter De BaetsandFacebook GitHub Bot 88de74b2dc Do not pass ReactContext to getViewManagersMap (#44379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44379

A common pattern to implement `ViewManagerOnDemandReactPackage` is to use a `getViewManagersMap` helper. If we capture `ReactApplicationContext` there, we will indefinitely retain the the very first ReactApplicationContext, and break/leak across reloads. Instead we should pass the `ReactApplicationContext` whenever we construct the ViewManager.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D56838427

fbshipit-source-id: 76583dd7f5564ed29f0dbfcef33d8d288cbb90e0
2024-05-02 13:25:18 -07:00
Nick GerlemanandFacebook GitHub Bot bbb52c575d Rename TextLayoutManagerMapBuffer to TextLayoutManager
Summary:
Clean this up, now that there is only one TextLayoutManager.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56801446

fbshipit-source-id: 1b81a16031ab520d06d8935000d5019609f8a254
2024-05-02 12:50:15 -07:00
Nick GerlemanandFacebook GitHub Bot 8871b95cda Delete old Android TextLayoutManager
Summary:
No longer used after last diff.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56801475

fbshipit-source-id: 45320418493cb47cc9df192de3dcc73284005fb4
2024-05-02 12:50:15 -07:00
Nick GerlemanandFacebook GitHub Bot 1499e67b39 Remove code relying on non-MapBuffer TextLayoutManager
Summary:
These are all either dead, or duplicate code (e.g. for spannable cache). Let's delete it, so we can get rid of the redundant TextLayoutManager that is no longer getting new updates.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56800381

fbshipit-source-id: 264c2ede43b765ff094d3d3976ad8535579cc4d9
2024-05-02 12:50:15 -07:00
Ramanpreet NaraandFacebook GitHub Bot 5a8fe43673 <ScrollView/>: Add static ViewConfig for scrollEventThrottle
Summary:
This prop was introduced into horizontal <ScrollView/> in D35735978.

**Note:** This prop did not work for bridgeless mode.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56854758

fbshipit-source-id: 2b25296a065b01f11aa04c2ff06cabf64ff5fce1
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 35f1e308e8 <ScrollView/>: Add static ViewConfig for maintainVisibleContentPosition
Summary:
This prop was introduced for horizontal and vertical scrollview in D40642469.

That diff updated the native view configs only.

**Note:** This prop did not work for bridgeless mode.

Partial fix: Add the prop to vertical scrollview: D54223244

Full fix: this diff.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56854757

fbshipit-source-id: aff2da407f4df4575ceb66d3d381a144fa07a8e9
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 0a8e2c81a9 <ScrollView/>: Add native view config for horizontal
Summary:
horizontal was introduced here: D55367445

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56831754

fbshipit-source-id: 289bb8c5c8fd1c84b84b524d374b31f99766eb04
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 87e8dde9a5 <Image/>: Add native view config for source
Summary:
<Image/>'s source prop was introduced in D51479305.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56831756

fbshipit-source-id: 55d67e74b0dcb5c7b107eac030192b941d8c9d51
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 457372c87e Add native view config for {margin,padding}{block,inline} props
Summary:
The margin/padding props were introduced in this diff: D41267765

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56846578

fbshipit-source-id: 396cab3fdd63d9c630690157a385f1ae53208bb7
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 063ae7d3e8 Add native view config for inset props
Summary:
The insets props were introduced in this diff: D42193661

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56849870

fbshipit-source-id: 7be2a5825086ac954fdb8bc3bb86b57a2fa6d326
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 8c3f8a3e6b Add static view config for onClickCapture
Summary:
onClick was made into a capture event in this diff: D45745906
- Partial fix: D51551255
- Full fix: this diff.

**Note:** This prop did not work for bridgeless mode.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56849867

fbshipit-source-id: 15acc16b162e0dd17513c6452008331e3fee4526
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot ef1e84e425 Add native view config for collapsableChildren
Summary:
collapsableChildren was introduced in D56226241

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56849868

fbshipit-source-id: b2b08bfc2b8a35a863a91a53e1bee0b700c50f69
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 5e46712dc8 Add native view config for experimental_layoutConformance
Summary:
experimental_layoutConformance was added in this diff: D47940100

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56849869

fbshipit-source-id: 2346a869aa9d87916d074e54306d3c1230b7a91c
2024-05-02 12:46:05 -07:00
Ramanpreet NaraandFacebook GitHub Bot 3ffdace137 Fix comments in LayoutShadowNode!
Summary: Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56831755

fbshipit-source-id: 04b8c131355d711224085caeb6a26eb4c17db755
2024-05-02 12:46:05 -07:00
Jesse SahliandFacebook GitHub Bot 1ca35bb211 Revert D56857738: Update hermes-parser and related packages in fbsource to 0.21.0
Differential Revision:
D56857738

Original commit changeset: 6027f529df8a

Original Phabricator Diff: D56857738

fbshipit-source-id: e2725cd97bc6954ddd2494cad28ef34eccc5d104
2024-05-02 12:09:53 -07:00
aleqsioandFacebook GitHub Bot 00b366159d Hotfix privacy manifest aggregation script (#44390)
Summary:
As pointed out by liamjones here:
https://github.com/facebook/react-native/pull/44214#discussion_r1587755403

The original PR did introduce a bug in the `find/first` check, but in my testing, we do need to look at `group.name`, so let's make sure we check both.

This also makes it play nice with an existing file even if it is added to a different directory, by appending to it instead of forcing it to exist in the main group.

## Changelog:

[IOS] [FIXED] - Fix privacy aggregation

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

Test Plan: Tested on rn-tester

Reviewed By: cipolleschi

Differential Revision: D56893594

Pulled By: philIip

fbshipit-source-id: b92589bc2bed9d07e9af20c56a8b9f6c61d864f0
2024-05-02 11:40:07 -07:00
George ZaharievandFacebook GitHub Bot 55dc853d07 Update hermes-parser and related packages in fbsource to 0.21.0
Summary:
Bump hermes-parser and related packages to [0.21.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D56857738

fbshipit-source-id: 6027f529df8a5e1e3cf3b2d383f399f9e1050e96
2024-05-02 10:30:44 -07:00
Alex HuntandFacebook GitHub Bot 185f63b0db Add experiment to configure internal debugger branding (#44388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44388

Towards the open source rollout of the `rn_fusebox.ts` entry point.

NOTE: Requires https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/59, but can (and should) be landed safely beforehand.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D56883040

fbshipit-source-id: acee5d53c0f93ef9dc2d498001291b1e35237824
2024-05-02 09:15:30 -07:00
Alex HuntandFacebook GitHub Bot 817f610983 Update debugger-frontend from 24b0c81...141c8c93
Summary:
This is a major sync, featuring our recent rebase of `chromium/6344`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D56884975

fbshipit-source-id: bc91f66bfc92464ab8fa99893ab0181077041b79
2024-05-02 09:15:24 -07:00
Blake FriedmanandFacebook GitHub Bot b38f80aeb6 update shared build to strip Babel wrapper (#44339)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44339

We require the wrapper code for in repository calls to these packages directly from node (i.e. using CommonJS).  This wrapper code typically sits at the entrypoint of the build packages (i.e. `index.js`).

NOTE: This unblocks an issue preventing me from landing further work on the `helloworld` cli replacing the community template.

## Problem:
The [flow-api-translator](https://www.npmjs.com/package/flow-api-translator) library doesn't allow CommonJS `module.exports` when generating TypeScript Type Defintions.

## Change
1. At the built time, this strips out our wrapper code and sets up the dist/ folder appropriately for npm distribution.
2. Updated the `package.json` files to consistently share Flow types

Changelog: [Internal] refactor build packages output to remove wrapper.

NOTE: Added better error messages when users deviated from the current pattern:
{F1501571608}

Reviewed By: huntie

Differential Revision: D56762162

fbshipit-source-id: f110b31e4ad780998dbc81a2482891ac8d8c6458
2024-05-02 04:00:21 -07:00
Pieter De BaetsandFacebook GitHub Bot d280772ea4 Remove manual flattening of pointerEvents in View (#44352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44352

Confirmed in https://github.com/facebook/react/commit/d779eba4b375134f373b7dfb9ea98d01c84bc48e that style properties already take priority over direct props, so we can avoid flattening style here.

Changelog: [General][Fixed] Small performance tweak to View wrapper to avoid unnecessary style flattening.

Reviewed By: sammy-SC

Differential Revision: D56740899

fbshipit-source-id: ceec3e9665e2f69637c832af7dc59ce2feb65e24
2024-05-01 22:50:10 -07:00
Arushi KesarwaniandFacebook GitHub Bot 63043b79be Fix shouldShowDevMenuOrReload in RELEASE
Summary:
In RELEASE mode, the `devSupportManager` received is ReleaseDevSupportManager for which `showDevOptionsDialog()` & `handleReloadJS()` is a no-op
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java

Which is expected since this is a capability only in Dev mode(useDeveloperSupport = true). However, ATM `shouldShowDevMenuOrReload()` returns true in RELEASE as well which is a bug.

Since there is no need for `shouldShowDevMenuOrReload()` in RELEASE, changing it's logic to introduce that check, early exit and return false in case of RELEASE.

Changelog:
[Android][Fixed] shouldShowDevMenuOrReload() in RELEASE mode

Reviewed By: RSNara

Differential Revision: D56851473

fbshipit-source-id: e9e12b0bec8aead5e9227fcd676459ca54490b61
2024-05-01 21:27:58 -07:00
Arushi KesarwaniandFacebook GitHub Bot bdcc979bab Fix onKeyLongPress() in RELEASE
Summary:
In RELEASE mode, the `devSupportManager` received is ReleaseDevSupportManager for which `showDevOptionsDialog()` is a no-op
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java#L66

Which is expected since this is a capability only in Dev mode(useDeveloperSupport = true). However, ATM `onKeyLongPresss()` returns true in RELEASE as well which is a bug.

Since there is no need for `onKeyLongPress()` in RELEASE, changing it's logic to introduce that check and return false in case of RELEASE.

Changelog:
[Android][Fixed] onKeyLongPress() in RELEASE mode

Reviewed By: christophpurrer, RSNara

Differential Revision: D56850466

fbshipit-source-id: 92d2c8572b32d065f5f9d54e22588bb085b9dcc9
2024-05-01 21:27:58 -07:00
Eric RozellandFacebook GitHub Bot 67bc65df85 Add C++ header for default TurboModules and cross-platform reuse (#44361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44361

In order to keep all platforms in sync (Android, iOS, Windows, etc.), it makes sense to consolidate all C++ TurboModules that we want available by default on all platforms to a shared C++ header / implementation.

This moves the duplicated code from Android and iOS to such a shared module provider and updates relevant build specs.

## Changelog

[Internal]

Reviewed By: christophpurrer

Differential Revision: D56835783

fbshipit-source-id: 7322ed054ded5749973885c63257e5caf23b3fc3
2024-05-01 20:16:16 -07:00
John WardandFacebook GitHub Bot 0383669a4b Only schedule Choreographer callbacks if there's an active animation
Summary:
Changelog: [Internal]
A very similar diff was attempted with D50647971 and reverted in D51617862. The main difference here is all behavior is gated behind the feature flag. Before, we were enqueuing the extra frame callback on start_animating_node even if ondemand choreographer was disabled.

Reviewed By: javache

Differential Revision: D56085369

fbshipit-source-id: fa6335303fe98199b18fa2b4819110afb8efcc0d
2024-05-01 16:41:53 -07:00
Arushi KesarwaniandFacebook GitHub Bot dfa6519749 getJavaScriptContextHolder() in BridgelessReactContext (#44360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44360

Support `getJavaScriptContextHolder()` in BridgelessReactContext

Changelog:
[Android][Added] - getJavaScriptContextHolder() supported in BridgelessReactContext since it's supported in ReactContext[Bridge]

Reviewed By: philIip, RSNara

Differential Revision: D56834958

fbshipit-source-id: e274adc01b0993012f36224d5afaa3918997c13c
2024-05-01 16:10:04 -07:00
Kudo ChienandFacebook GitHub Bot 539922339b fix ReactActivity.getReactDelegate().reload() (#44223)
Summary:
fixing some problem for `ReactActivity.getReactDelegate().reload()` from https://github.com/facebook/react-native/issues/43521:
- the `reload()` does not work for bridge mode on release build

## Changelog:

[ANDROID] [FIXED] - Fixed app reloading for `ReactActivity.getReactDelegate().reload()`.

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

Test Plan:
tried to temporary change toast.show as reload and test from rn-tester
```diff
 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt
+++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt
@@ -10,6 +10,7 @@ package com.facebook.react.modules.toast
 import android.view.Gravity
 import android.widget.Toast
 import com.facebook.fbreact.specs.NativeToastAndroidSpec
+import com.facebook.react.ReactActivity
 import com.facebook.react.bridge.NativeModule
 import com.facebook.react.bridge.ReactApplicationContext
 import com.facebook.react.bridge.UiThreadUtil
@@ -30,9 +31,11 @@ public class ToastModule(reactContext: ReactApplicationContext) :
       )

   override public fun show(message: String?, durationDouble: Double) {
-    val duration = durationDouble.toInt()
-    UiThreadUtil.runOnUiThread(
-        Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() })
+//    val duration = durationDouble.toInt()
+//    UiThreadUtil.runOnUiThread(
+//        Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() })
+    val activity = reactApplicationContext.currentActivity as? ReactActivity
+    activity?.reactDelegate?.reload()
   }

   override public fun showWithGravity(
```

tried for different mode
- [x] bridge mode + debug build
- [x] bridgeless mode + debug build
- [x] bridge mode + release build
- [x] bridgeless mode + release build

Reviewed By: fkgozali

Differential Revision: D56795975

Pulled By: arushikesarwani94

fbshipit-source-id: 895eab1927ba6db748ebb32c0fd5313f19cf9d1b
2024-05-01 15:21:44 -07:00
Pieter De BaetsandFacebook GitHub Bot 90663081de Expose BaseJavaModule constructors through ViewManager
Summary:
ViewManagers are all BaseJavaModule, and thus have access to methods like `getReactApplicationContext`. We don't expose the appropriate constructors though to pass this context down from the base class.

Not a breaking change, as the no-arg constructor is still used implicitly.

Changelog: [Android][Fixed] ViewManagers can pass context to their base class.

Reviewed By: fabriziocucci

Differential Revision: D56804318

fbshipit-source-id: b0e6b15dfd7786073da058beccfaba2ff30daf5a
2024-05-01 11:49:53 -07:00
Tim YungandFacebook GitHub Bot 387250112e RN: Configure no-string-refs as Error
Summary:
In a future release of React Native, string refs will no longer be supported. This increases the severity of the `no-string-refs` lint rule to convey this.

Changelog:
[General][Changed] - `no-string-refs` is now a lint error

Reviewed By: kassens

Differential Revision: D56826663

fbshipit-source-id: 603f5b205bb9fd8a5dcb8ee917f6a2ba1ac47e6e
2024-05-01 10:21:18 -07:00
Moti ZilbermanandFacebook GitHub Bot 694e8e7dce Document HostFunction dtor threading requirement
Summary:
Changelog: [Internal]

Updates the doc comment on `Function::createFromHostFunction` to
mention that (a copy of) the provided `std::function` may be destroyed
on an arbitrary thread, much like `HostObject` (where this is already
documented).

Reviewed By: neildhar

Differential Revision: D56628194

fbshipit-source-id: 1939602135e83a9c36896c395816054376026edc
2024-05-01 09:25:12 -07:00
Samuel SuslaandFacebook GitHub Bot d77f806960 pass trait when shadow node is cloned from update state (#44355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44355

changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D56765820

fbshipit-source-id: 5bfd2231883c25a0d9149bb07d529da796fd921e
2024-05-01 06:02:06 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f19371f28d Remove getSurfacePresenter and getModuleRegistry from RCTHost
Summary:
This change removes a couple of method from RCTHost which were not following the iOS convention for names.

We deprecated them in 0.74 and now that the branch is cut, we can remove them.

## Changelog:
[iOS][Breaking] - Remove `getSurfacePresenter` and `getModuleRegistry` from RCTHost

Reviewed By: sammy-SC

Differential Revision: D56633554

fbshipit-source-id: 88fd1525bfe68ca1f6c2d8403d0dec505a23e9f8
2024-05-01 03:54:55 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 94537c7beb Honor requiresMainQueueSetup in bridgeless mode for ViewManagers
Summary:
We [received an issue](https://github.com/react-native-maps/react-native-maps/issues/5042) in OSS where a ViewManager was configured to be initialized on the main queue, but it wasn't.
This was creating a soft crash and showing a RedBox to the user.
The library was going through the Interop Layer.

This change makes sure that, if the ViewManager is configured to be setup in the main queue, we retrieve the constants from the Main Queue

## Changelog
[iOS][Fixed] - Extract the constants from ViewManagers in the UI Thread if needed.

Reviewed By: sammy-SC

Differential Revision: D56762253

fbshipit-source-id: ca807b34d6e61418da9fd6a639a05f3394879f7c
2024-05-01 03:53:10 -07:00
Rubén NorteandFacebook GitHub Bot c3b7aac143 Migrate enableGranularShadowTreeStateReconciliation from CoreFeatures to ReactNativeFeatureFlags
Summary:
Changelog: [internal]

Migrating this feature flag (which is currently unused) to the new system, so we can test it in production and ship it soon.

Reviewed By: NickGerleman

Differential Revision: D56766553

fbshipit-source-id: 42d44cdd163568564e789cdffe1683e78fe91b53
2024-05-01 03:41:42 -07:00
Gijs WeteringsandFacebook GitHub Bot 237ddb4dbf Fix Circle CI builds due to incorrect UnsupportedEnumDeclarationParserError import
Summary:
Changelog: [Internal]

The import style used
```
npm ERR! /home/circleci/react-native/packages/react-native-codegen/lib/parsers/typescript/modules/index.js:13
npm ERR! import {UnsupportedEnumDeclarationParserError} from '../../errors';
npm ERR! ^^^^^^
npm ERR!
npm ERR! SyntaxError: Cannot use import statement outside a module
npm ERR!     at internalCompileFunction (node:internal/vm:73:18)
npm ERR!     at wrapSafe (node:internal/modules/cjs/loader:1175:20)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1219:27)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1113:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:960:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1137:19)
npm ERR!     at require (node:internal/modules/helpers:121:18)
npm ERR!     at Object.<anonymous> (/home/circleci/react-native/packages/react-native-codegen/lib/parsers/typescript/parser.js:60:19)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1255:14)
```
is not supported.

Reviewed By: philIip

Differential Revision: D56809538

fbshipit-source-id: 4b42f9e964d49c4fe3c3a4020eb2b3860fdd810c
2024-05-01 03:16:15 -07:00
Soe LynnandFacebook GitHub Bot a9a7382d95 Fix findNodeAtPoint returns incorrect view
Summary:
This work is based on Ruslan's https://www.internalfb.com/intern/diff/D56185630/

Changelog: [Internal]
`Expectation`: In React DevTools, user should be able to select an element on screen and it will show you what React component rendered it. This doesn't work in RN app that is using JS navigation

`Root Cause`:
In Fabric, when we try to find `ShadowNode` in the `ShadowTree`, `pointerEvents` props are not considered during the lookup of node using coordinate. Hence, in React DevTools when we inspect element, it was hightlighting the overlay `View` with `pointerEvents` props `box-none` was getting highlighted instead of its children view in the hierarchy.

Reviewed By: javache

Differential Revision: D56334314

fbshipit-source-id: ebfe58c5a1516add347c2c21ab5d075f804df8a9
2024-05-01 00:51:59 -07:00
Nick GerlemanandFacebook GitHub Bot 7f5bff48dd Remove "deduplicated" Spannable path
Summary:
This removes the bulk of code added in https://github.com/facebook/react-native/pull/39630.

We're not shipping it, as it caused performance regressions.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D56796936

fbshipit-source-id: 82f3a51cf145bc1695d70393e1f050685a1e6174
2024-04-30 22:30:05 -07:00
Christoph PurrerandFacebook GitHub Bot 536edf3726 Don't support float enums
Summary:
Changelog: [General][BREAKING] Don't support 'float' enums in Turbo Modules

- The current implementation of 'float enums' in C++ does not work as invalid results are returned.
- At potential fix could still cause rounding errors when crossing language bounaries, e.g. `4.6` can become `4.5599999942..`
- C++ enum classes don't support float: https://eel.is/c++draft/dcl.enum#2.sentence-4

> The type-specifier-seq of an enum-base shall name an integral type; any cv-qualification is ignored.

Hence removing the feature of `float enums` for now

Reviewed By: NickGerleman

Differential Revision: D52120405

fbshipit-source-id: 3685ad0629e16ff9db424ba67e07d09df6027553
2024-04-30 21:52:09 -07:00
Jakub PiaseckiandFacebook GitHub Bot 12aef32b82 Apply padding to the text attachements (#44258)
Summary:
Paddings are not applied to inline views in text, this PR fixes that.

Closes https://github.com/facebook/react-native/issues/42099

## Changelog:

[GENERAL] [FIXED] - Fixed padding not being applied to inline views in text

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

Test Plan:
<details>
<summary>A simple test case</summary>

```jsx
      <Text style={{paddingHorizontal: 40, paddingVertical: 40, backgroundColor: 'green', width: 300 }}>
        <View style={{backgroundColor: 'red', width: 50, height: 50}} />
        foobar foobar
        <View style={{backgroundColor: 'red', width: 50, height: 50}} />
      </Text>
```

|iOS before|iOS after|Android before|Android after|
|-|-|-|-|
|<img width="502" alt="Screenshot 2024-04-25 at 17 17 50" src="https://github.com/facebook/react-native/assets/21055725/e6981de0-6714-4bb0-a006-547b30374b8a">|<img width="546" alt="Screenshot 2024-04-25 at 17 15 56" src="https://github.com/facebook/react-native/assets/21055725/51e8458b-ad4e-4755-865c-664414bfee55">|<img width="457" alt="Screenshot 2024-04-26 at 11 18 17" src="https://github.com/facebook/react-native/assets/21055725/ac351eff-6d24-40a0-bf7e-0cf3782e9368">|<img width="457" alt="Screenshot 2024-04-26 at 11 17 11" src="https://github.com/facebook/react-native/assets/21055725/3284a79a-157d-43ea-b080-849520e2ee7d">|

</details>

Reviewed By: christophpurrer

Differential Revision: D56789213

Pulled By: NickGerleman

fbshipit-source-id: 2dd0e4bf291e20b3e4c4d73f58079d1abafc3f8e
2024-04-30 20:59:35 -07:00
Alan LeeandFacebook GitHub Bot 639d890dff add missing struct member initialization in Props.h (#44294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44294

**Problem:**

It was discovered while testing 3 party library, generated member variables in a C++ `struct` in `Props.h` is not initialized.
Also `WithDefault` would not work as well.
(For the problematic case it was a `boolean` but would also apply to other primitive types.)

If there is no default initialization and the component prop is optional and the user of the native component does not set the prop then the variable is never initialized and this is problematic for primitive types in C++ where no initialization results in an undefined behavior.

**Proposed solution:**

(Following C++Core Guideline of [always initialize](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-always).)
Reusing `generatePropsString()` used by `ClassTemplate` to generate props for `StructTemplate` as well.
updated relevant test snapshots.
This change is only concerning the `Props.h` file.

**Changelog:**
[General][Fixed] - fixed `Props.h` created from codegen missing default initializers in C++ `struct`

Reviewed By: cipolleschi

Differential Revision: D56659457

fbshipit-source-id: 0d21ad20c0491a7e8bb718cd3156da65def72f23
2024-04-30 18:29:31 -07:00
aleqsioandFacebook GitHub Bot 61f584c3af Implement privacy manifest aggregation (#44214)
Summary:
As of now, Apple does not respect privacy manifests added as cocoapods resource bundles. This forces react-native developers to manually copy `.xcprivacy` files content for each native dependency that accesses restricted reason APIs to the root file.

This PR adds an aggregation step that crawls through pod dependencies to collect all reasons into the root privacy info file.

## Changelog:

[IOS][ADDED] – Add privacy manifest aggregation.

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

Test Plan:
When run on RNTester, it appends aggregated entries (while keeping existing ones) to existing .xcprivacy file without modifing .pbxproj:
![image](https://github.com/facebook/react-native/assets/5597580/1d07a07d-bbec-4266-a599-a8d629078971)

When run on RNTester with the xcprivacy file removed from xcode beforehand, it creates a new .xcprivacy file, and adds it to Compile Bundle Resources in the same way as in the new template:
![image](https://github.com/facebook/react-native/assets/5597580/f80a3b4e-e41a-4906-8e2f-06cca0bc225a)

When run on RNTester with an empty .xcprivacy file, it appends aggregated entries from pods AND reasons for react-native core.

When run with `privacy_file_aggregation_enabled: false` in `use_react_native`, it falls back to existing behavior:
![image](https://github.com/facebook/react-native/assets/5597580/4519bba1-c80e-4cd0-b19c-bbbebfa8493b)

Reviewed By: cipolleschi

Differential Revision: D56481045

Pulled By: philIip

fbshipit-source-id: 1841bad821511c734d0cc0fcff5065ed92af76d8
2024-04-30 18:19:28 -07:00
Christoph PurrerandFacebook GitHub Bot c96c893374 Support emitting typed RCTDeviceEmitter events
Summary:
This enables to code-gen base C++ types for custom exported JS types from a RN TM spec - which have been previously excluded from code-gen as these aren't used in any function.

The only work around so far was to ‘register’ a random function using the custom type which should be used for RCTDeviceEventEmitter events

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D56685903

fbshipit-source-id: add9ca40018b91c9fca98609ba3d1f85d3affec1
2024-04-30 11:16:57 -07:00
Rubén NorteandFacebook GitHub Bot cfbee0b7ec Add test for LazyShadowTreeRevisionConsistencyManager and fix bugs
Summary:
Changelog: [internal]

`LazyShadowTreeRevisionConsistencyManager` wasn't correctly updating the locked revision, because `emplace` is a no-op if there's already a value for the key in the `unordered_map`.

This fixes the issue and adds tests that actually showed it.

Reviewed By: sammy-SC

Differential Revision: D56761941

fbshipit-source-id: 340e9195b14460a591c48186bd365688c74ade04
2024-04-30 10:29:22 -07:00
hurali97andFacebook GitHub Bot 9cfc71dc66 changelog: 0.72.14 (#44333)
Summary:
## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

Changelog: [Internal] Generated changelog

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

Reviewed By: cortinico

Differential Revision: D56756077

Pulled By: cipolleschi

fbshipit-source-id: 4e8d2f6b83499bd89d6a60de4eede385b7a8ac3c
2024-04-30 09:15:55 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9bdd777fd7 Avoid calling abstract methods in RCTComposedViewRegistry
Summary:
`RCTComposedViewRegistry` extends `NSMutableDictionary` which is a clustered class in iOS.
NSMutableDictionary is techncially an abstract class, but when instantiated by `[NSMutableDictionary new];` the system will return one of concrete classes that inherit from `NSMutableDictionary`, opaquely from the perspective of the caller.

By calling `super`, we are actually calling the not implemented method for the abstract class. If this happen, this can crash the app.

Given that the `RCTComposedViewRegistry` is extending the dictionary only for its interface but is using other mechanisms as storage, is it fair to return `NULL`if the storages don't have the requested view.

## Changelog
[iOS][Fixed] -  Avoid calling abstract methods in RCTComposedViewRegistry

Reviewed By: cortinico

Differential Revision: D56755427

fbshipit-source-id: f5c56dc59ccc6b30c00199b4196c42eb9b021e2b
2024-04-30 08:42:42 -07:00
Nicola CortiandFacebook GitHub Bot 44e78ff74a Fix accidentally broken build_android job
Summary:
I accidentally broke build_android.
Here the two fixes:
1. Make sure the constructor of PackageList2 are actually called `PackageList2`
2. Make sure the package of `OSSLibraryExamplePackage` is `com.facebook.react.osslibraryexample`

Changelog:
[Internal] [Changed] - Fix accidentally broken build_android job

Reviewed By: dmytrorykun

Differential Revision: D56756601

fbshipit-source-id: 862597ca829d702d880624d29276193f8548715d
2024-04-30 08:02:20 -07:00
Moti ZilbermanandFacebook GitHub Bot 845a879442 Lift console method bodies out of installConsoleHandler
Summary:
Changelog: [Internal]

The bodies of all `console` methods are currently written as lambdas within `installConsoleHandler` but actually capture nothing meaningful from that scope. This diff rewrites them as free functions instead.

To enable the "forwarding console methods" to be written as free functions, we also replace the runtime loop over `kForwardingConsoleMethods` with a compile-time equivalent using macros. (This technique is inspired by the Hermes source code, which uses it heavily for compile-time code generation.)

Reviewed By: huntie

Differential Revision: D56679956

fbshipit-source-id: babf368ecacb9dc426b2356a4a2091881ca1023e
2024-04-30 05:38:32 -07:00
Moti ZilbermanandFacebook GitHub Bot 38f8b8e099 Remove unnecessary std::function indirection in console
Summary:
Changelog: [Internal]

Switches to constrained `auto` instead of `std::function` to represent intermediate function types in `RuntimeTargetConsole::installConsoleHandler`. This removes some indirection and potential runtime overhead.

Reviewed By: huntie

Differential Revision: D56675188

fbshipit-source-id: 76cbf8b8be9ca1a9466efbcd187bddd60c921019
2024-04-30 05:38:32 -07:00
Nicola CortiandFacebook GitHub Bot c57ca2c3b4 RNGP - Move the generateAutolinkingNewArchitectureFiles task to core autolinking
Summary:
This diff is part of RFC0759
https://github.com/react-native-community/discussions-and-proposals/pull/759

Here I'm moving the New Architecture C++ Autolinking from the CLI to core.
It follows the same logic as this:
https://github.com/react-native-community/cli/blob/73f880c3d87cdde81204364289f2f488a473c52b/packages/cli-platform-android/native_modules.gradle#L544-L550

Changelog:
[Internal] [Changed] - RNGP - Move the generateAutolinkingNewArchitectureFiles task to core autolinking

Reviewed By: cipolleschi, blakef

Differential Revision: D55475594

fbshipit-source-id: d3768d932032e8e98f992d5f1bc54c439520873d
2024-04-30 04:33:56 -07:00
Nicola CortiandFacebook GitHub Bot 0d37d0a4b7 RNGP - Move generateAutolinkingPackageList to core autolinking
Summary:
This diff is part of RFC0759
https://github.com/react-native-community/discussions-and-proposals/pull/759

Here I'm moving over the task to generate the Package List for Autolinking inside RNGP.
The logic is the same as this one:
https://github.com/react-native-community/cli/blob/73f880c3d87cdde81204364289f2f488a473c52b/packages/cli-platform-android/native_modules.gradle#L217

The class is generated as PackageList2 to avoid a duplicate class build failure with the current Autolinking from CLI.

Changelog:
[Internal] [Changed] - RNGP - Move generateAutolinkingPackageList to core autolinking

Reviewed By: cipolleschi

Differential Revision: D56637394

fbshipit-source-id: 929b42af3a0e1951cb7a0f4ace47bbbb84000780
2024-04-30 04:33:56 -07:00
Rubén NorteandFacebook GitHub Bot cc5bab83ab Use private fields in performance APIs
Summary:
Changelog: [internal]

This migrates all the classes related to performance in `react-native/src/private` to use private fields instead of regular fields prefixed with `_`.

Reviewed By: yungsters

Differential Revision: D55931659

fbshipit-source-id: e8b2018048dbb6c8d6e8a4d143357bf2ac39dd1e
2024-04-30 04:32:10 -07:00
Rubén NorteandFacebook GitHub Bot 59688a1aee Migrate a bunch of classes in react-native/src/private to use private fields
Summary:
Changelog: [internal]

Quick refactor to use private fields instead of fields with a naming convention, in classes in `react-native/src/private`.

Reviewed By: yungsters

Differential Revision: D56700382

fbshipit-source-id: ee0a7b30a9da20c31b92878be3316227b2d0a0c4
2024-04-30 04:31:00 -07:00
Thibault MalbrancheandFacebook GitHub Bot 0ee79be405 chore: changelog for 0.73.8 (#44331)
Summary:
Adds changelog for the 0.73.8 patch.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[Internal] [Changed] - Add 0.73.8 changelog

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

Reviewed By: cortinico

Differential Revision: D56753881

Pulled By: cipolleschi

fbshipit-source-id: eed053cd39a768d6acb40a037a4218ee5e1fbbf8
2024-04-30 04:19:32 -07:00
Rubén NorteandFacebook GitHub Bot c3a1ae3c3e Add comment to indicate how to update generated files for feature flags in ReactNativeFeatureFlags.config.js
Summary:
Changelog: [internal]

We have a comment explaining how to update all generated files everywhere but here.

Reviewed By: NickGerleman

Differential Revision: D56717344

fbshipit-source-id: cc538e37dd6ab09f67d67bb13ce4e560870d44d0
2024-04-30 03:25:59 -07:00
Nicola CortiandFacebook GitHub Bot 8f1b27001f RNGP - Autolinking - Add model classes for parsing the config output
Summary:
This diff is part of RFC0759
https://github.com/react-native-community/discussions-and-proposals/pull/759

Here I'm creating data classes that will allow us to parse the `config` JSON output.
Code is pretty straightforward and follows the structure as the `config` command output.

Changelog:
[Internal] [Changed] - RNGP - Autolinking - Add model classes for parsing the `config` output

Reviewed By: cipolleschi, blakef

Differential Revision: D55475595

fbshipit-source-id: 3457c008ff0c5bce2b47fd637c7b10a5e7427c01
2024-04-30 02:49:48 -07:00
Nicola CortiandFacebook GitHub Bot 1df1570810 RNGP - Setup the RunAutolinkingConfigTask to run the config command
Summary:
This diff is part of RFC0759
https://github.com/react-native-community/discussions-and-proposals/pull/759

Here I'm creating the `runAutolinkingConfig` task.

This task is responsible of either:
- Invoking the `npx react-native-community/cli config` command (or the one specified by the user)
- Copying the config output file specified by the user (if any).

The task re-executes only if any of the lockfile are actually changed otherwise it just returns as "UP-TO-DATE"

This allows us to

Changelog:
[Internal] [Changed] - RNGP - Setup the RunAutolinkingConfigTask to run the config command

Reviewed By: cipolleschi, blakef

Differential Revision: D55475596

fbshipit-source-id: 3c687f965c59eb82fc447546ebd936ba401f34f2
2024-04-30 02:49:48 -07:00
Danny SuandFacebook GitHub Bot 6262158c11 Pass StackTrace directly to Hermes ConsoleMessage
Summary:
Hermes' ConsoleMessage constructor now accepts StackTrace, so the construction can be done in one go.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D56738060

fbshipit-source-id: 709b47d8f9cf69994e4c5eaa4f9310e70a4d9ed0
2024-04-30 00:19:48 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7b3c622219 Hoist TextInput.autoCapitalize to BaseTextInputProps on C++ side
Summary:
## Changelog:
[Internal]-

Even though `TextInput.autoCapitalize` is supposed to be cross-platform, on the C++ side of the props data structures it was only exposed as an Android-specific one.

This would have it still work on the iOS side (as the corresponding prop is passed to Objective C around the C++ structs anyway), however it may also cause subtle scenarios, whereas the prop changes dynamically on the iOS side, but this doesn't get reflected on the native side.

This change fixes this problem by simply hoisting the prop into the `BaseTextInputProps`, which makes it available across all platforms, as it should be.

Differential Revision: D56726940

fbshipit-source-id: 9ba18f1f92095874e07207650b46655c331f3e91
2024-04-29 23:45:49 -07:00
Danny SuandFacebook GitHub Bot 35c7956baf Remove RuntimeAdapter.h from HermesRuntimeAgentDelegate
Summary:
RuntimeAdapter.h is only needed when using CDPHandler, which the new code path doesn't need.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D56738299

fbshipit-source-id: 8cb512a3dc8dc303851871021e04aab94aa25d1e
2024-04-29 23:41:50 -07:00
Pieter De BaetsandFacebook GitHub Bot dd51b38101 Fix missing close for canceled bundle downloads
Summary:
`Response` is `Closeable`, so we must close it even if the download is no longer relevant. Found while running with StrictMode enabled and reloading quickly multiple times.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56629079

fbshipit-source-id: 041bf295313cbf78b7f2bb6580c50fdc2a324728
2024-04-29 21:10:28 -07:00
Edmond ChuiandFacebook GitHub Bot b7de916664 move launch ID gen out of dev-middleware
Summary: Changelog: [General][Removed] `launchId` query param for `/debugger-frontend` is no longer generated automatically for each `/open-debugger` call. Caller of `/open-debugger` is now responsible for generating the `launchId`, which will be passed along to `/debugger-frontend`.

Reviewed By: robhogan

Differential Revision: D55164645

fbshipit-source-id: b83303eda77b6fb86ebf50f699d9f308676533c6
2024-04-29 11:55:28 -07:00
Edmond ChuiandFacebook GitHub Bot 820d1e1ff4 add fields to launch_debugger_frontend
Summary: Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D56610268

fbshipit-source-id: 37abee41dd068f3cafa19466b914545f6460a3f0
2024-04-29 11:55:28 -07:00
Nick VlugandFacebook GitHub Bot eb01a8f0c5 Remove duplicated use_hermes in RCTAppDelecate podspec (#44299)
Summary:
remove duplicated use hermes variable in RCTAppDelecate podsec file.

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

Test Plan:
Default setup flow (ios)

## Changelog:
[Internal] [Changed] - Remove duplicated use hermes variable in RCTAppDelecate podsec file.

Reviewed By: cipolleschi

Differential Revision: D56693121

Pulled By: arushikesarwani94

fbshipit-source-id: 2bbe4090d94cadd128be9c5d233a63499f735e68
2024-04-29 10:40:06 -07:00
Alex HuntandFacebook GitHub Bot 548fcd8b3b Update "Open Debugger" to print extended Flipper guidance
Summary:
Supports the removal of Flipper from the template in 0.74, paried with additional blog post messaging: https://reactnative.dev/blog/2024/04/22/release-0.74#removal-of-flipper-react-native-plugin.

Changelog:
[General][Changed] - Update "Open Debugger" action to print extended Flipper guidance

Reviewed By: cipolleschi

Differential Revision: D56705236

fbshipit-source-id: d7e869625262ebb02bc2454c924f832cccfbcd31
2024-04-29 10:18:45 -07:00
Marc RousavyandFacebook GitHub Bot 8ce4bf1893 fix: Fix missing space (#44311)
Summary:
Just a minor fix to fix a missing space in the debug message.

Fixes a missing space in the message

```
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'MmkvPlatformContext' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","Timing","AppState","SourceCode","BlobModule","WebSocketModule","SettingsManager","DevSettings","RedBox","Networking","Appearance","DevLoadingView","UIManager","DeviceInfo","ImageLoader","LinkingManager"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","SoundManager","IntentAndroid","MmkvPlatformContext","MmkvCxx"]}
```

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[INTERNAL] [FIXED] - Fixed missing space in TurboModule.getEnforcing error message

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

Reviewed By: christophpurrer

Differential Revision: D56702036

Pulled By: rshest

fbshipit-source-id: e339a6ee8c265b2c6d27184e8e9941f3f02e3c85
2024-04-29 09:21:23 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot ab00a453a8 Fix minor formatting issue in AppRegistry logging in non-dev builds
Summary:
## Changelog:
[Internal] -

I was looking at the logs, troubleshooting a non-dev build issue, and noticed a line:
```
I0429 15:56:42.107558 1874554880: Running "MyApplication
```
In `__DEV__` mode this usually continues with `" with ...`, but in release mode the closing quote was missing, which made me think there may be something going on garbling the log messages.

Which ultimately was a red herring, and it's just a bad formatting in the message in release mode, which this change fixes.

Reviewed By: zeyap

Differential Revision: D56704170

fbshipit-source-id: a28604fffec6be74733c8759f59ee52a67a81746
2024-04-29 08:55:22 -07:00
Moti ZilbermanandFacebook GitHub Bot 8689f563ed Make inspector executor safe to destroy on any thread
Summary:
Changelog: [Internal]

Fixes a crash that may happen on Android when the `inspectorEnableModernCDPRegistry` feature flag is true, and clarifies the documentation of `HostTarget::create()` to avoid similar issues in future integrations.

## Context

The executor provided to `HostTarget::create()` ("the inspector executor") is used throughout the CDP backend to schedule work on the inspector thread. (See also D53356953.) To facilitate this, the executor is a copyable `std::function`.

On Android, the executor is backed by a Java object, to which we hold a reference from C++ using JNI. This reference is expressed as a `facebook::jni::global_ref` which gets copied as part of the executor. (`global_ref` is a RAII wrapper around the `NewGlobalRef` / `DeleteGlobalRef` JNI functions.)

## The bug

All the *calls* to the inspector executor from C++ happen on threads that are already properly [attached to the JVM](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#attaching_to_the_vm) ( = the UI thread / the JS thread) and are therefore allowed to make JNI calls. However, there are cases where a copy of the inspector executor may have its *destructor* run on an unexpected thread, namely the (Hermes) JS GC thread. (This happens when the executor itself is captured in a lambda that's stored in a `jsi::HostObject` or `jsi::HostFunction`, which is in turn [destroyed on the JS GC thread](https://github.com/facebook/react-native/blob/5a0ae6e2d9d7f2357f9ea6c5dc1d573233075326/packages/react-native/ReactCommon/jsi/jsi/jsi.h#L118-L126).) In such cases, the `DeleteGlobalRef` call mentioned above will crash, because the JS GC thread is not attached to the JVM.

## The fix

First, we document that copies of the inspector executor provided to `HostTarget::create` may indeed be destroyed on arbitrary threads. This is an unavoidable consequence of the existing design. Second, we adapt the Android integration to this requirement.

`fbjni` provides the [`jni::ThreadScope`](https://github.com/facebookincubator/fbjni/blob/968e3815f92aeb0670f5d88ae975fbbd47a4b482/cxx/fbjni/detail/Environment.h#L93-L123) RAII helper to manage attaching C++ threads to the JVM. If we had any explicit control over the setup and teardown of the JS GC thread, we could create a single `jni::ThreadScope` to globally ensure the safety of JS-finalizer-to-JNI calls in React Native. However, neither JSI nor the Hermes API provides such control.

Instead, we essentially resort to creating a temporary `ThreadScope` around each `DeleteGlobalRef` call where we don't control the calling thread. We do this using a new kind of JNI reference wrapper class called `SafeReleaseJniRef`. Retaining a `SafeReleaseJniRef` instead of a plain `global_ref` is all that's needed to make a particular reference safe to destroy on any thread.

Reviewed By: huntie

Differential Revision: D56620131

fbshipit-source-id: 0b6f32a7bd6477d0384af19c42e21d9242ce623d
2024-04-29 05:24:53 -07:00
Blake FriedmanandFacebook GitHub Bot c754755cd8 CLI supports ordering of tasks
Summary:
This gives Frameworks more control in selecting specific tasks and integrating the return types data in their UI.  For example piping `stdout` to the user or using packages like [Listr2](https://www.npmjs.com/package/listr2) to run tasks in parallel and show progress.

The ordering is suggestive (but also enforced by some assertions).  Frameworks are free to do what they want.

The order was implicit in the previous data structure with lists of Tasks, but made it difficult to tap into each async task.

I've also had to rework how we transpile the code if directly executed from the monorepo.  This keeps our:
- flow types valid,
- allows the core-cli-utils package to be built (to generate TypeScript types and a valid npm module), and
- allows direct transpiled execution as a yarn script.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D56242487

fbshipit-source-id: a1a18f14a4aef53a98770462c8ebdef4111f0ab4
2024-04-29 05:04:26 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2168e3f515 Add 0.71.19 changelog
Summary:
Add changes for the 0.71.19 changelog

## Changelog
[General][Added] - Add changelog for 0.71.19

Reviewed By: blakef

Differential Revision: D56698644

fbshipit-source-id: d920221bbff4acb1d7456ad72fe32bef188c241d
2024-04-29 04:28:38 -07:00
Moti ZilbermanandFacebook GitHub Bot fb0c856cf2 Fix use-after-move in console implementation
Summary:
Changelog: [Internal]

In the new CDP backend, calling any `console` method a second time involves a call to a moved-from `std::function`. This shouldn't work, and indeed results in an exception on some platforms, but isn't strictly an error according to the C++ standard: moving from a `std::function` leaves it in an [unspecified state](https://en.cppreference.com/w/cpp/utility/functional/function/function#:~:text=the%20call%20too.-,other,is%20in%20a%20valid%20but%20unspecified%20state%20right%20after%20the%20call.,-5), not necessarily an empty state, so (in particular) it's perfectly legal for the implementation to perform a copy instead of a move and leave the original variable intact.

(See [Compiler Explorer](https://godbolt.org/z/qoo5Mnd68) for proof that libc++ and libstdc++ differ on this - the former performs a copy, while the latter actually performs a move, resulting in a `std::bad_function_call` exception later.)

In the code in question, we're right to want to avoid a copy of the `body` function into the argument of `delegateExecutorSync` - only one copy of this function needs to exist at a time. But the correct way to avoid this copy is to capture `body` by reference, as we can do that repeatedly with no ill effects. (`delegateExecutorSync` is, as its name suggests, synchronous, so there are no lifetime issues.) Doing this also allows us to remove the use of `mutable` so the capturing is by *const* reference.

Reviewed By: sammy-SC

Differential Revision: D56673529

fbshipit-source-id: b235977b2fbc889462c4c78adfe41ae6f509e349
2024-04-29 04:04:56 -07:00
Samuel SuslaandFacebook GitHub Bot bb120ff663 remove force_static from textinput module
Summary:
changelog: [internal]

force_static doesn't need to be in here, let's remove it.

I change one module per diff. It makes it easier to land it and pinpoint where build failures are coming from.

Reviewed By: christophpurrer

Differential Revision: D56678530

fbshipit-source-id: c602e065d77fdd649c66ce2d26eee83428ef5ba8
2024-04-29 03:34:14 -07:00
Samuel SuslaandFacebook GitHub Bot bb2c13af53 remove force_static from componentregistry module
Summary:
Resolved Pull request: https://github.com/facebook/react-native/pull/44296

changelog: [internal]

force_static doesn't need to be in here, let's remove it.

I change one module per diff. It makes it easier to land it and pinpoint where build failures are coming from.

Reviewed By: javache

Differential Revision: D56632286

fbshipit-source-id: e942603d3c69d9eebf4d3b64e2f73ee6a5df6de4
2024-04-28 00:18:58 -07:00
Samuel SuslaandFacebook GitHub Bot e2ad6696d8 make mapbuffer Android only module (#44295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44295

changelog: [internal]

mapbuffer is only used on Android. Let's remove the option to have it compile on iOS.

Reviewed By: NickGerleman

Differential Revision: D56635289

fbshipit-source-id: 1a57c271d21b8aef81179d96b1a6832e7615dd27
2024-04-27 06:00:54 -07:00
Samuel SuslaandFacebook GitHub Bot 30ba470a6f remove force_static from safeareaview module (#44283)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44283

changelog: [internal]

force_static doesn't need to be in here, let's remove it.

I change one module per diff. It makes it easier to land it and pinpoint where build failures are coming from.

Reviewed By: christophpurrer

Differential Revision: D56630625

fbshipit-source-id: 069587893dbb8866d1a08de256b4612d60bcc3b8
2024-04-27 04:37:21 -07:00
Samuel SuslaandFacebook GitHub Bot 3239089f67 use forward declaration in ComponentDescriptor.h (#44284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44284

changelog: [internal]

Employ forward declaration in ComponentDescriptor.h to avoid importing header unnecessarly.

Reviewed By: cipolleschi

Differential Revision: D56631399

fbshipit-source-id: 13878cff0683081db21656e16d70cd45d62bb71c
2024-04-27 03:35:25 -07:00
Samuel SuslaandFacebook GitHub Bot d116837da2 fix a crash in <Modal /> component
Summary:
changelog: [Android][Fixed] - fix a crash in Modal component

Instance variable `propertyRequiresNewDialog` in `ReactModalHostView` controls if new dialog will be created on next `showOrUpdate` or not. It must be kept in sync with `dialog` ivar.

if `dismiss` is ever called from anywhere but `showOrUpdate`, the class gets into a state where the next `showOrUpdate` call will throw an error because dialog is set to null but `propertyRequiresNewDialog` stays false.

`dismiss` is called from three places: `showOrUpdate` (this is ok), `onDropInstance()` and `onDetachedFromWindow`.

The fix in this diff is to make sure propertyRequiresNewDialog is set to true when dialog is dismissed.

Reviewed By: alanleedev

Differential Revision: D56627522

fbshipit-source-id: e7a16cd022401a7a4a0fbf8fc71a2312d05fcb8e
2024-04-27 02:35:50 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 9c4ee6df08 Add support for percentage on borderRadius ViewStyle props (#44140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44140

Why?
Previously we didn't support using percentages like:
```
style={{
  width=100,
  height=100,
  borderRadius='100%',
}}
```

These percentages refer to the corresponding dimension of the border box.

What?
Change the unit type for `BorderRadii` values to `ValueUnit`. This type allows us to have an object containing a `float`, and a `UnitType` properties. With this we conditionally calculate the corresponding point (dp) value for a given percentage (considering size). Ex:

```
result = {raw_percentage_value} / 100 * (max(height, width))
```

We know the maximum border radius for our current implementation is half the dp of the shorter side of our view, hence why we consider half our maximum view side as equivalent to 100%.

Note: We still don't support vertical/horizontal border radii

## Changelog:

[iOS][Added] - Added support for using percentages when defining border radius related properties.

Reviewed By: NickGerleman

Differential Revision: D56198302

fbshipit-source-id: 6cd510b1c7164dcb82ca5ad8a9861c5ce5c8b15b
2024-04-26 13:34:37 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 9204e44ef5 Fix bug with borderRadii caused by iOS 10 specific code
Summary:
Non-uniform edge insets caused issues on iOS 10. The code nowadays interferes with the rendering for large borderRadii so this diff removes it.

Since we didn't support this behavior before there are some bugs/missing features that happen:

T186810893 Incorrect border rendering with large radii
T186812303 View discoloring with overlapping border radii
T186812736 Add support for vertical and horizontal border radii

## Changelog:

[iOS][Fixed] - Removed Legacy iOS 10 code messing with border radius

Reviewed By: NickGerleman

Differential Revision: D56333637

fbshipit-source-id: 92b1bb1459d1e95476b3d768db725dfbbc1e55ae
2024-04-26 13:34:37 -07:00
Blake FriedmanandFacebook GitHub Bot d18229bc92 fix Flow failure breaking yarn run build
Summary:
`flow-api-translator` can't handle `module.exports`.  Shift this to ESM style exports like the other built packages.

Changelog: [Internal] - Fixing an internal build script broken by D56243647

Reviewed By: cipolleschi

Differential Revision: D56638506

fbshipit-source-id: f5a4c7bea06b7f95300388e3d37cf0d377bc3b17
2024-04-26 12:58:04 -07:00
Nicola CortiandFacebook GitHub Bot 2455eab9df RNGP - Add autolinking fields to ReactExtensions (#44220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44220

This diff is part of RFC0759
https://github.com/react-native-community/discussions-and-proposals/pull/759

Here we're looking into splitting the autolinking into a component that will live inside core (specifically inside the React Native Gradle Plugin - RNGP) and another component that will live inside the Community CLI.

Here I start by adding 2 fields to RNGP extension, that frameworks and templates can use to provide their autolinking config.

Changelog:
[Internal] [Changed] - RNGP - Add autolinking fields to ReactExtensions

Reviewed By: cipolleschi

Differential Revision: D55475597

fbshipit-source-id: 316d1919a113a94c57426710f487f334c6128345
2024-04-26 10:50:47 -07:00
Marlene CotaandFacebook GitHub Bot b53c4395ce Fix comparison of narrow type with wide type in loop condition in RawPropsKeyMap.cpp (#44262)
Summary:
We ran CodeQL in react-native-windows and it found a comparison of narrow type with wide type in loop condition in ReactCommon/react/renderer/core/RawPropsKeyMap.cpp

microsoft/react-native-windows#12701

## Changelog:
[INTERNAL] [SECURITY] - Fix comparison of narrow type with wide type in loop condition in RawPropsKeyMap.cpp

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

Test Plan: Tested on windows.

Reviewed By: cipolleschi

Differential Revision: D56628137

Pulled By: javache

fbshipit-source-id: 9ff3bd3cbcfd084efc1e01180ff01529d1be02eb
2024-04-26 08:47:24 -07:00
Tim YungandFacebook GitHub Bot 452373b5bf RN: Further Optimize createAnimatedComponent
Summary:
In addition to memoizing `mergedStyle` in `createAnimatedComponent`, this avoids unnecessary object allocations by:

* Not allocating `passthroughProps`, created via a rest spread operator. It is unnecessary because we always override `style` in the JSX.
* Not allocating a new object if either `style` or `passthroughStyle` are null or undefined. Also, create an array of the two style objects instead of spreading them, which is needless.

Changelog:
[General][Changed] - Improved  performance of `Animated` components

Reviewed By: sammy-SC

Differential Revision: D56621191

fbshipit-source-id: ac863661c60d87c681284ce5ef5d6774b9c50653
2024-04-26 08:30:35 -07:00
Tim YungandFacebook GitHub Bot 34331af9ce RN: Optimize StyleSheet.compose
Summary:
Changes two important aspects of `StyleSheet.compose`:

- Extract it from `StyleSheet` so that it can be imported from other internal modules without incurring circular dependencies. (Surprisingly, `StyleSheet` has a lot of dependencies.)
- Avoid a redundant `style1 != null` check.

Changelog:
[General][Changed] - Optimized performance of `StyleSheet.compose`

Reviewed By: sammy-SC

Differential Revision: D56621407

fbshipit-source-id: f899b50d9f13f1514485371c8513a85be78eae24
2024-04-26 08:30:35 -07:00
Blake FriedmanandFacebook GitHub Bot 71c293d716 Add a custom CLI to build iOS apps (#44239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44239

A simple CLI to build our iOS `helloworld` application.  This isn't intended for an audience other that the release team.

Some Framwork authors might be interested in it as an example of how to use our react-native/core-cli-utils to build a React Native application.

Changelog: [Internal]

I'm not going to export because it's not that interesting to folks outside / in need of scrutiny.

Reviewed By: cipolleschi

Differential Revision: D56243647

fbshipit-source-id: a5f1b6d1046bda165aa7c6848938e05f0cca2dc8
2024-04-26 08:15:04 -07:00
Jakub PiaseckiandFacebook GitHub Bot 1f08799560 Fix textAlign with inline views on the new architecture on Android (#44146)
Summary:
On the new architecture on Android on the new arch, `textAlign` style was ignored (`Layout.Alignment.ALIGN_NORMAL` was always used) during the measurement of text. During this phase, the positions of attachments are also calculated, which results in inline views being always positioned as if alignment to the left was set. This PR updates the measurement logic to also take `textAlign` into account during measurement.

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

## Changelog:

[ANDROID] [FIXED] - Fixed `textAlign` not being taken into account when positioning views inlined in text

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

Test Plan:
<details>
<summary>I've been testing on the following code</summary>

```jsx
import { SafeAreaView, Text, View } from "react-native";

function InlineView(props) {
  return (<View style={{margin: 10}} >
    <Text style={{ textAlign: props.textAlign, backgroundColor: 'cyan' }}>
        Parent Text
        <Text style={{ fontWeight: 'bold' }}>Child Text</Text>
        <View style={{width: 50, height: 50, backgroundColor: 'red'}} />
        <Text style={{ fontWeight: 'bold' }}>Child Text</Text>
        {props.long && <Text style={{ fontWeight: 'bold' }}>aaaa a aaaa aaaaaa aaa a a a aaaaa sdsds dsdSAD asd ASDasd ASDas</Text>}
      </Text>
  </View>)
}

export default function Test() {
  return (
    <SafeAreaView style={{ flex: 1 }}>
      <Text style={{textAlign: 'center', fontSize: 20}}>BoringLayout</Text>
      <InlineView textAlign="left" />
      <InlineView textAlign="center" />
      <InlineView textAlign="right" />
      <InlineView textAlign="justify" />

      <Text style={{textAlign: 'center', fontSize: 20}}>StaticLayout</Text>
      <InlineView textAlign="left" long />
      <InlineView textAlign="center" long />
      <InlineView textAlign="right" long />
      <InlineView textAlign="justify" long/>
    </SafeAreaView>
  );
}
```

</details>

| Old architecture | New architecture |
|------------------|------------------|
| <img width="447" alt="Screenshot 2024-04-18 at 17 08 59" src="https://github.com/facebook/react-native/assets/21055725/b21848ff-3939-4dde-9f78-03ce50c9429a">            | <img width="447" alt="Screenshot 2024-04-18 at 17 04 46" src="https://github.com/facebook/react-native/assets/21055725/fb57a3c4-09e8-4db7-abc3-79747314529b">          |

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D56361169

Pulled By: cortinico

fbshipit-source-id: c3002f65541774e376e315c3076a6157aa330f8d
2024-04-26 06:54:17 -07:00
Blake FriedmanandFacebook GitHub Bot 67392cef3c add listr + rxjs flow types for OSS export
Summary:
Based on a more recent 14.x.x release of Listr.

Changelog: [Internal]

These are direct copies from `xplat/js/flow/{listr,rxjs_v6.x.x}.js`

Reviewed By: huntie

Differential Revision: D56576985

fbshipit-source-id: c850c89891bf8eb57586a5e2a50f0204fd885f65
2024-04-26 03:10:00 -07:00
Rob AndersonandFacebook GitHub Bot d224e8c911 convert circleci mac and ios workflows to github actions (#44032)
Summary:
This pull request converts the CircleCI workflows to GitHub actions workflows. This change only inlcudes the mac and ios build and test jobs.

## Changelog:
[Internal] - Migrate iOS to github actions

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

Test Plan:
[Here is the latest workflow run in my fork](https://github.com/robandpdx-org/react-native/actions/runs/8637660560).

 ---
https://fburl.com/workplace/f6mz6tmw

Reviewed By: NickGerleman

Differential Revision: D56581393

Pulled By: cipolleschi

fbshipit-source-id: a806b1a274e3d86c03e66a543360a800187855e4
2024-04-26 02:50:12 -07:00
David RickardandFacebook GitHub Bot be06fd4e22 Fix memoization for Animated components when no style is passed in
Summary:
Any component wrapped via `createAnimatedComponent()` will always re-render, because it creates a new `style` object. It's impossible to memoize.

Adding `useMemo()` here ensures that the `style` object passed to the underlying object is stable: if no `style` is passed to the wrapped component, then memoization can work.

Allowing memoization to function when the `style` object is passed in will require a deeper fix. See https://fb.workplace.com/groups/rn.support/permalink/26084643474490921/

Before:
{F1496803038}

After:
{F1496805410}

## Changelog:

[General] [Fixed] - Fixed memoization for components wrapped with createAnimatedComponent

Differential Revision: D56618868

fbshipit-source-id: a0af8b1a02c34b5cf6e6d7e9f0381fb323b232cc
2024-04-26 00:38:43 -07:00
Nikolai TillmannandFacebook GitHub Bot 5a0ae6e2d9 @DoNotStrip com.facebook.react.bridge.PromiseImpl and its constructor
Summary:
While the class and constructor are referenced from native code, the constructor is only accidentally retained on the Java side without proper keep rules. Adding explicit DoNotStrip in the code here.

Changelog: [Internal]

Reviewed By: beicy

Differential Revision: D56529943

fbshipit-source-id: 5459b7d32ada5eeb1fabff1dfc796c2f81d3bb96
2024-04-25 18:53:19 -07:00
Ramanpreet NaraandFacebook GitHub Bot b9e52f0807 Make DefaultReactHost configurable w/ cxxreactpackages
Summary:
One way we register cxx turbo modules with React Native is via cxxreactpackages.

This diff allows the application to pass in cxxreactpackages into the default react host, which allows the application to, in turn, register cxx modules with react native!

Changelog: [Android][Added] - Allow bridgeless apps to register cxx modules via cxxreactpackages

Reviewed By: cortinico

Differential Revision: D56547493

fbshipit-source-id: 4e8f02f0546c4b647a915fc65ea9687aa1592190
2024-04-25 16:28:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 993f500fcf Add support for patch rc versions
Summary:
We might want to publish some new versions of React Native with experimental feature to allow some partners to test whether those versions fixes some reported issues, before creating a proper stable version for the whole ecosystem.

The infra is mostly [setup for this](https://www.internalfb.com/code/fbsource/[496a64d180faab501b8598aa0ec26d47454fb961]/xplat/js/react-native-github/scripts/releases/utils/version-utils.js?lines=149), already. The only detail we need to take care of is not to move the `next` tag.

## Changelog:
[Internal]

Reviewed By: cortinico, huntie

Differential Revision: D56578456

fbshipit-source-id: 8dcc674aab5f85077c1b3e6580c5aeb99226eff8
2024-04-25 15:17:34 -07:00
Nick GerlemanandFacebook GitHub Bot 7b44c8d1d0 Automatically disable flattening of scroll content view children when needed
Summary:
There are a couple scenarios where flattening the child of a ScrollView can cause problems.

1. `maintainVisibleContentPosition` on both Android and iOS rely on reading live positions in the view tree
2. `snapToAlignment` on Android uses live view tree, for items to snap to. iOS seems to have very different behavior, and aligns assuming that children are scroll view height, or that a snap interval has been set.

This change adds a prop `collapsableChildren` which can be used to disable children of scroll content view from being collapsed.

Differentiator is... complicated... but we can mostly just adapt the code dealing with existing traits at the surface level.

Changelog:
[General][Fixed] - Automatically disable flattening of scroll content view children when needed
[General][Added] - Add `collapsableChildren` prop

Reviewed By: javache

Differential Revision: D56226241

fbshipit-source-id: ed81f7fff5a15eac424708f763afc9b844aefa9c
2024-04-25 14:52:22 -07:00
Blake FriedmanandFacebook GitHub Bot 2876fae8d3 exclude react-native/sdks from consideration
Summary:
Flow shouldn't consider definitions inside this folder.  This speeds up working in the OSS checkout if you happen to have Hermes built.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D56575537

fbshipit-source-id: 8e5cdd0436712322a4a7298a24c721d9659d98af
2024-04-25 10:42:35 -07:00
Samuel SuslaandFacebook GitHub Bot 510d2906b2 maintain correct content offset when scroll view is suspended (#44256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44256

## Changelog:

[iOS] [Fixed] - Preserve content offset in ScrollView when the component is suspended

# The problem
On iOS, components are recycled. For ScrollView, its content offset has to be reset back to original position. When we call `[UIScrollView setContentOffset:]`, it triggers all of its delegate methods and triggers `scrollViewDidScroll` where we set native state.

So when user scrolls to position 100 and scroll view suspends. it is removed from view hierarchy and recycled. Once the suspense boundary is resolved, scroll view will be inserted back into view hierarchy. But when it was recycled, we set back its original content offset (the default is 0, 0) but this was accidentally propagated through to shadow tree.

# Solution

To avoid this, we simply need to invalidate `_state` before calling `[UIScrollView setContentOffset:]`.

Reviewed By: cipolleschi

Differential Revision: D56573370

fbshipit-source-id: c03d7d2d403af2e1649b4cf189072baeb4c286c8
2024-04-25 09:20:42 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 794aaa52d3 Fix enable hermes debugger in Bridgeless mode
Summary:
Set the proper build flags for debugging in Bridgeless mode.

This fixes [#44240](https://github.com/facebook/react-native/issues/44240)

## Changelog:
[iOS][Fixed] - Add `HERMES_ENABLE_DEBUGGER=1` flag to React-RuntimeApple

Reviewed By: cortinico

Differential Revision: D56575647

fbshipit-source-id: a0613a5d46caeb1d3e636e54ecd43428fbaf46e8
2024-04-25 08:28:26 -07:00
Kudo ChienandFacebook GitHub Bot 4e6186555e Defines module for React-jsinspector (#44252)
Summary:
Defines module for `React-jsinspector` that for swift modules to integrate with.

to fix https://github.com/expo/expo/issues/28209, any podspec depends on HermesExecutorFactory should use ` add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')` to add dependency. otherwise it will encounter the header not found issue because use_frameworks will change "jsinspector-modern" to "jsinspector_modern".

to depend on React-jsinspector from expo-modules-core, we need it to define as a module.
otherwise, it will have the error
```
The Swift pod `ExpoModulesCore` depends upon `React-jsinspector`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

## Changelog:

[IOS] [CHANGED] - Add `DEFINES_MODULE` for React-jsinspector.podspec

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

Test Plan: ci passed

Reviewed By: cortinico

Differential Revision: D56575102

Pulled By: cipolleschi

fbshipit-source-id: 9b7b4568a3e499f0a741a79a846263118ff2d112
2024-04-25 08:18:20 -07:00
Nick GerlemanandFacebook GitHub Bot 3db7ab6683 Run Android Build and Tests Against 8-core-ubuntu (#44248)
Summary:
The final merged GitHub Actions PR ended up keeping us on `ubuntu-latest` for Android jobs. These are ridiculously slow and are also now running out of disk space (which then files a task on a random change author). E.g. https://github.com/facebook/react-native/actions/runs/8826104037/job/24231379139

Switch to the `8-core-ubuntu`, which is closer to what we were using for CircleCI, and has more disk space: https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners#specifications-for-general-larger-runners

Changelog:
[Internal]

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

Test Plan: GitHub Actions still runs these successfully

Reviewed By: cortinico

Differential Revision: D56558697

Pulled By: NickGerleman

fbshipit-source-id: 180abcf2d3420760c090c0c21173afc6fa5bcf0c
2024-04-25 06:40:59 -07:00
Samuel SuslaandFacebook GitHub Bot b40b3b31a2 delete feature flag enableCustomDrawOrderFabric (#44231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44231

changelog: [internal]

The flag is not used and is statically set to false, let's delete it.

Reviewed By: NickGerleman

Differential Revision: D56473851

fbshipit-source-id: fe1076d20a765ffed2437f080764f2b5fe060bb6
2024-04-25 04:43:00 -07:00
Samuel SuslaandFacebook GitHub Bot 0dbe6f10c1 clean up interfaces for view preallocation (#44232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44232

changelog: [internal]

surfaceId parameter is not needed `schedulerDidRequestPreliminaryViewAllocation` as it can be derived from shadow node.
Additionally, conversion to ShadowView can happen on the lower layers.

Reviewed By: NickGerleman

Differential Revision: D56350599

fbshipit-source-id: 9c38cc0df36911bbd6927fe0a0d5e64c248d87c4
2024-04-25 04:39:08 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 42ceacd281 Fallback to the first foregroundInactive window when there are no foregroundActive windows in RCTKeyWindow (#44167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44167

We received an issue for OSS where, when the main window is inactive and the system tries to present a dialog, the dialog is not presented in the right position on the screen.

This change introduce a fallback to the first inactive window (which is still visible on screen) and it fixes the issues.

## Changelog:
[iOS][Changed] - Fallback to the first `foregroundInactive` window when there are no `foregroundActive` windows in RCTKeyWindow

Reviewed By: dmytrorykun

Differential Revision: D56354741

fbshipit-source-id: fa23131ecd40f6d91c705879a72890506ee21486
2024-04-25 03:28:22 -07:00
szymonrybczakandFacebook GitHub Bot c402dcfe57 chore(dev-middleware): add localhost as default host in start command config (#44244)
Summary:
Inside [Re.Pack](https://github.com/callstack/repack) we consume command's options, to reduce the amount of assumptions that 3rd party tools need to make - we can move assigning default value to config command level, so default values will be aligned across tools.

For default `start` command this change doesn't change any behaviour.

## Changelog:

[INTERNAL] [CHANGED] - Add `localhost` as default host in `start` command config

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

Test Plan: `start` command should work the same way as before.

Reviewed By: huntie

Differential Revision: D56567793

Pulled By: blakef

fbshipit-source-id: fe8f3686ae39a3d2996de11930a0d03364692adc
2024-04-25 03:01:51 -07:00
NizamandFacebook GitHub Bot 78ab5f4b83 img events fixes for ios and android (#43945)
Summary:
fixes Image events in new architecture
https://github.com/facebook/react-native/issues/43874

## Changelog:

[iOS] [Fixed] - Missing `source` in `onLoad` native event arguments
[iOS] [Fixed] - Missing `error`, `responseCode`, and `httpResponseHeaders` in `onError` native event arguments
[iOS] [Fixed] - Missing `loaded` and `total`  in `onProgress` native event arguments
[Android] [Fixed] - Missing `progress`  in `onProgress` native event arguments

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

Test Plan:
test using Image section of rn-tester app

before
![image](https://github.com/facebook/react-native/assets/1734518/8f7d714b-2ddf-4db0-a539-7be52e3fd948)
after
![image](https://github.com/facebook/react-native/assets/1734518/50f14906-1b65-447f-ae84-634989c1bfc7)

Reviewed By: rozele

Differential Revision: D55945341

Pulled By: NickGerleman

fbshipit-source-id: da4e0e68a78ec8566d94e6df63e17f0436972a4f
2024-04-24 16:25:37 -07:00
Nick GerlemanandFacebook GitHub Bot 15f27bc299 Handle fontWeight normalization for TextInput component
Summary:
Web props work (somewhere around  D41230978 and D39268920) made it so that numeric font weights can be set instead of just strings. This is implemented by converting number to string before passing to native component within the `Text` component.

We have crash with:
```
2024-04-19 09:38:21.360 16963 17190 E ViewManager: Error while updating prop fontWeight
2024-04-19 09:38:21.360 16963 17190 E ViewManager: java.lang.IllegalArgumentException: method com.facebook.react.views.text.ReactBaseTextShadowNode.setFontWeight argument 1 has type java.lang.String, got java.lang.Double
2024-04-19 09:38:21.360 16963 17190 E ViewManager: 	at java.lang.reflect.Method.invoke(Native Method)
```

`TextStyleProps` can also be passed to `TextInput`, which passes to underlying native component, without going through this logic. And the types for Native props directly derive from JS props, so type system does not catch passing incorrect number type to underlying native component.

This does a quick and dirty replication of the exact logic in `Text.js` to `TextInput.js`. I'd love to potentially fix this up for Fabric in a different way when we rethink CSS parsing.

Changelog:
[General][Fixed] - Handle `fontWeight` normalization for TextInput component

Reviewed By: arushikesarwani94

Differential Revision: D56539571

fbshipit-source-id: 8975886c117d814a624f817bffe408841bb03b88
2024-04-24 16:02:46 -07:00
Samuel SuslaandFacebook GitHub Bot cf926a1329 decouple commit from mount on Android (#44236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44236

## Changelog:

[Android] [Fixed] - fix a case when view preallocation or props forwarding on Android lead to dropped props update

# What does this fix

This fixes a bug where prop change is not delivered to Android mounting layer if the prop change was initiated from state update inside of `useLayoutEffect`, `componentDidMount` or `componentDidUpdate`.
This affects android only and when batched rendering is enabled.

There are two root causes of this problem:
1. View preallocation on Android: https://fburl.com/code/r62p3vot
2. Prop forwarding on Android: https://fburl.com/code/644f1ppk

Minimal repro :
```
import React, {useLayoutEffect, useState} from 'react';
import {Button, SafeAreaView, View} from 'react-native';
function Foo() {
  const [bgColor, setBgColor] = React.useState('red');
  useLayoutEffect(() => {
    console.log('useLayoutEffect');
    setBgColor('blue');
  }, []);
  return (
    <View
      style={{
        backgroundColor: bgColor,
        width: '100%',
        height: '100%',
      }}
    />
  );
}
function RNTesterApp() {
  const [show, setShow] = useState(false);
  return (
    <SafeAreaView>
      <Button title="Toggle" onPress={() => setShow(!show)} />
      {show && <Foo />}
    </SafeAreaView>
  );
}
export default RNTesterApp;
```

# The underlaying problem
The problem is combination of view preallocation and batched rendering updates.

Here is a step by step what happens in the repro above:
1. React issues asks Fabric to create new shadow node A with background colour **red**.
2. Fabric asks Android to allocate a view for shadow node A with background colour **red**.
3. React commits tree **T1** and calls layout effects. Meanwhile Fabric waits, without trying to mount the tree **T1**, to prevent painting state that is about to be updated and prevent flickering.
4. React clones node A, changing the background colour to **blue** and commits the new tree **T2**.
5. Fabric, will now go ahead and mount the latest tree **T2**. While creating mount instructions, it will drop prop updates because it believes prop updates where delivered already as part of step 2.

# The fix

The fix is to change two things:
1. Ignore view preallocation for shadow nodes which were cloned with new props.
2. Set hasBeenMounted flag on ShadowNode later in the Fabric pipeline to fix it.

Both of these are hidden behind a single feature flag: `fixMountedFlagAndFixPreallocationClone`

## Performance implication:
I estimate that this will impact around 3% of views.

Reviewed By: rubennorte

Differential Revision: D56353589

fbshipit-source-id: 651d3cd2d0f78bfbbe9c05aa1ae1b1690c15e4ea
2024-04-24 14:54:08 -07:00
Sam ZhouandFacebook GitHub Bot 132563d81c Deploy 0.235.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D56505986

fbshipit-source-id: 2eb4ca02d766f4e2a88ab050e4acd25cd15c490b
2024-04-24 12:27:04 -07:00
Pieter De BaetsandFacebook GitHub Bot 766ece7b9b Fix PointerEvents not dispatching post-scroll (#44238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44238

Changelog: [Android][Fixed] PointerEvents were not dispatching after a scroll event

Reviewed By: RSNara

Differential Revision: D56519337

fbshipit-source-id: 72ea6fba583f1105e6c71560fc3a06913287844f
2024-04-24 08:22:00 -07:00
Pieter De BaetsandFacebook GitHub Bot 767197c9a2 Rollout enableFabricPendingEventQueue feature flag (#44208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44208

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D56467342

fbshipit-source-id: 0461b16727af708769af363125bf51c0761c9505
2024-04-24 06:30:50 -07:00
Pieter De BaetsandFacebook GitHub Bot 849da2146c Split scheduler commit and flush delegate methods (#44188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44188

The current approach used for `batchRenderingUpdatesInEventLoop` is not compatible with Android due to limitations in its props processing model. The raw props changeset is passed through to Android, and must be available for the Android mounting layer to correctly apply changes.

We have some logic to merge these payloads when multiple ShadowNode clones take place but were previously assuming that a ShadowTree commit was a safe state to synchronize.

In the current implementation this means that two commits driven from layout effects (triggering states A → B → C) may cause Android to observe only the B → C props change, and miss out on any props changed in A → B.

Changelog: [Android][Fixed] Cascading renders were not mounting correctly when `batchRenderingUpdatesInEventLoop` is enabled.

Reviewed By: rubennorte

Differential Revision: D56414689

fbshipit-source-id: 7c74d81620db0f8b7bd67e640168afc795c7a1d7
2024-04-24 03:54:10 -07:00
Blake FriedmanandFacebook GitHub Bot 9d1f951ab0 remove from build script (#44233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44233

The package was added to our build scripts, but shouldn't have been.  We're not exporting this package or making it public.

Changelog: [Internal]

This should unblock our OSS CI.

Reviewed By: cipolleschi

Differential Revision: D56513694

fbshipit-source-id: f37c75871253b2570fb933175165d8f0a9593a16
2024-04-24 03:53:34 -07:00
Arushi KesarwaniandFacebook GitHub Bot e25860f07c Fixing exposing ReactDelegate through ReactActivity for reload() (#44227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44227

In https://github.com/facebook/react-native/pull/44223/ kudo identified the incorrect return type.

Reviewed By: christophpurrer, philIip

Differential Revision: D56497700

fbshipit-source-id: 5d7fc7ef21c3d3033a2567eba51b613eb41f0a1a
2024-04-24 00:20:54 -07:00
Phillip PanandFacebook GitHub Bot 8b1a01610c remove unused functions from RuntimeExecutor.h (#44197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44197

Changelog: [General][Breaking] Remove executeAsynchronously and executeSynchronously_CAN_DEADLOCK

these are not used anywhere nor in OSS, we can delete this safely

Reviewed By: javache

Differential Revision: D56447959

fbshipit-source-id: d66c10f676946422385750c1b8825ead2d5d0ed8
2024-04-23 19:43:42 -07:00
Blake FriedmanandFacebook GitHub Bot 995d5b832d Add an internal HelloWorld template
Summary:
This is a copy of the current packages/react-native/template that we exclusively use internally for testing.

Changelog: [Internal]

NOTE: Best contribution would be to scan the file list and ensure there isn't anything that shouldn't be in there.

bypass-github-export-checks

Reviewed By: cortinico, cipolleschi

Differential Revision: D56242484

fbshipit-source-id: 0913ff7acff9b0314b49f48e986674b77dbb908e
2024-04-23 15:07:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 05f0861878 Back out "Update ColorPropConverterto support color function values" (#44225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44225

Back out [#43031](https://github.com/facebook/react-native/pull/43031) as it makes some internal test fails.

## Changelog:
[Android][Fixed] - Revert #43031

Reviewed By: arushikesarwani94

Differential Revision: D56489260

fbshipit-source-id: bd843e6eb60fce0a1d5d8da9f3c5d2a36473ecfb
2024-04-23 13:58:25 -07:00
Sam ZhouandFacebook GitHub Bot 41f525ccae Pre-suppress unsafe string key access errors in xplat/js (#44221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44221

This diff pre-suppresses errors of the following pattern, to prepare for the next Flow release.

```
declare const obj: {foo: string};
declare const key: string;
obj[key]; // error: invalid-computed-prop
```

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D56477899

fbshipit-source-id: 5676b8685bd3157a519fe433cfce0fa28e003502
2024-04-23 11:36:14 -07:00
Samuel SuslaandFacebook GitHub Bot 4928f44f70 tear down surfaces when React Native instance is destoyed (#44209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44209

## Changelog:

[Android] [Fixed] - When React Native is destroyed, unmount all Fabric surfaces.

Previously, Fabric surfaces would not be torn down. Meaning that passive and layout effects wouldn't be unmounted and surface infra wouldn't be cleaned up.

For example:

```
useEffect(() => {
    return () => {
      console.log('unmounted');
    }
)};
```

When calling `ReactNativeHost.clear()` on Android in native code, the above effect should be unmounted.

This is a requirement for Fabric.

Reviewed By: javache

Differential Revision: D56238947

fbshipit-source-id: 5dbf5cdef520f34c78953c2b8f2d42349549e893
2024-04-23 10:18:55 -07:00
Blake FriedmanandFacebook GitHub Bot c884d19a50 Moved @react-native-community script internally into react-native/scripts
Summary:
This decouples the listing of modules from the linking of those modules into Cocoapods. I've made this backwards compatible, but our internal template wont lean on the community config.

The user can now override how they capture a list of React Native modules, providing an escape hatch for Framework authors to build on.

Changelog: [General][iOS] Use our fork of the react-native-communti/cli-platform-ios use_native_modues.rb script

Reviewed By: cipolleschi

Differential Revision: D56242486

fbshipit-source-id: 78505669ab6abd6718348388c3bfba3290f7071b
2024-04-23 09:50:17 -07:00
Rubén NorteandFacebook GitHub Bot ff094d80d0 Clean up feature flag for mount hooks on Android (#44206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44206

Changelog: [internal]

We finally managed to implement mount hooks without reliability issues on Android, so we can clean up the feature flag and enable it unconditionally.

Reviewed By: cortinico

Differential Revision: D56467379

fbshipit-source-id: d797ec770b731135332bc9f39df1c1e684b3bde4
2024-04-23 08:48:06 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0a80270187 Extend Property Processor to support long properties
Summary:
This change is a preliminary change to add support to `Long` and `long` React props that are required for supporting WideGamut color space.

## Changelog
[Android][Added] - Extend Property Processor to support long props

Reviewed By: cortinico

Differential Revision: D56461183

fbshipit-source-id: 0f70388abe2b414a09df640f04e767f1164d63ce
2024-04-23 08:37:44 -07:00
Ryan LintonandFacebook GitHub Bot 0a9891a2f2 Add isWideColorGamutEnabled to ReactActivityDelegate (#43036)
Summary:
This adds support for enabling wide color gamut mode for ReactActivity per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738).

## Changelog:

[ANDROID] [ADDED] - Add isWideColorGamutEnabled to ReactActivityDelegate

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

Test Plan:
Update RNTesterActivity.kt to enable wide color gamut:

```diff
  class RNTesterActivity : ReactActivity() {
    class RNTesterActivityDelegate(val activity: ReactActivity, mainComponentName: String) :
      // ...
      override fun getLaunchOptions() =
          if (this::initialProps.isInitialized) initialProps else Bundle()

+     override fun isWideColorGamutEnabled() = true
    }
```

Reviewed By: cortinico

Differential Revision: D55749124

Pulled By: cipolleschi

fbshipit-source-id: 44dd5631e1a2e429c86c01ed8747bbebbc8bdb3b
2024-04-23 08:37:44 -07:00
Ryan LintonandFacebook GitHub Bot fa7dbd578d Update ColorPropConverterto support color function values (#43031)
Summary:
This adds support for color function values to ColorPropConverter per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738). It updates the color conversion code so that it returns a Color instance before ultimately being converted to an Integer in preparation for returning long values as needed.

bypass-github-export-checks

## Changelog:

[ANDROID] [ADDED] - Update ColorPropConverter to support color function values

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

Test Plan:
Colors should work exactly the same as before.

Follow test steps from https://github.com/facebook/react-native/pull/42831 to test support for color() function syntax.

While colors specified with color() function syntax will not yet render in DisplayP3 color space they will not be misrecognized as resource path colors but will instead fallback to their sRGB color space values.

Reviewed By: cortinico

Differential Revision: D55749058

Pulled By: cipolleschi

fbshipit-source-id: 37659d22c1db4b1a27a9a4f88c9beb703517b01f
2024-04-23 08:37:44 -07:00
Keion AnvaripourandFacebook GitHub Bot 098454d425 Expose JSExceptionHandler to ReactNativeHost (#44172)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44172

Changelog: [Android][Added] Option to set a custom JSExceptionHandler instance

Reviewed By: javache

Differential Revision: D56382090

fbshipit-source-id: 69ad72ee34f1c9f636d95035d0463c5344cb4a37
2024-04-23 04:04:19 -07:00
Samuel SuslaandFacebook GitHub Bot 00055f89a0 reset animation state in TouchableOpacity and TouchableBounce (#44182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44182

## Changelog:

[iOS] [Fixed] - Fixed stale state on TouchableOpacity and TouchableBounce

When TouchableOpacity and TouchableBounce are unmounted, we need to reset their state. This includes animation state. If we don't do that, view is unmounted on the mounting layer and animation will not be applied. This leaves view in undefined state. In TouchableOpacity, it is view with reduced opacity. TouchableBounce that is view with applied transform.

This was reported in https://github.com/facebook/react-native/issues/44044

Reviewed By: rubennorte, cipolleschi

Differential Revision: D56416571

fbshipit-source-id: 01214ec8a5e07c80a609e082b955a30305ad8396
2024-04-23 03:20:03 -07:00
Phillip PanandFacebook GitHub Bot d59de54507 decouple BufferedRuntimeExecutor from various targets (#44196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44196

Changelog: [Internal]

BufferedRuntimeExecutor is unnecessarily coupled with these other targets (React-runtime, React-cxxreact), break that dependency so we can modularize this file

Reviewed By: realsoelynn

Differential Revision: D56382644

fbshipit-source-id: ed9725fbddcda04b73c583d927351440b4fc3328
2024-04-22 18:39:28 -07:00
Frieder BluemleandFacebook GitHub Bot 968884ae86 Fix space/tab indentation in template project.pbxproj (#44186)
Summary:
After creating a new project with `npx react-native init`, line 39 in `project.pbxproj` contains both spaces and tabs for indentation (accidentally introduced in 520d120375). This line will be unnecessarily touched and rewritten by a subsequent `pod install`.

Fix the indentation by replacing 4 spaces with one tab character (the Xcode managed file exclusively uses tabs for indentation).

## Changelog:

[GENERAL] [FIXED] - Fix space/tab indentation in template project.pbxproj

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

Test Plan: Generate project again with change and observe that the file will be generated with the expected indentation.

Reviewed By: NickGerleman

Differential Revision: D56439289

Pulled By: arushikesarwani94

fbshipit-source-id: ced9f0c94757a4925cd01673c65f2c38d28629e6
2024-04-22 18:15:49 -07:00
Phillip PanandFacebook GitHub Bot 8e4b7fb4cf add privacy manifest to react native glog
Summary:
Changelog: [Internal]

add this to the framework's resource bundle

from the audit there was a callsite to fstat in our forked copy of glog, so use C617.1.
callsites:
- glog/src/logging.cc

current problem with this method is that the required reasons are not currently be aggregated during app store review, so those need to live in the app's. but go ahead and add it here for now, i think apple will try to fix it.

Reviewed By: cipolleschi

Differential Revision: D55625116

fbshipit-source-id: b10ea2dad2238cc85b5fe30df56269a5808a35b5
2024-04-22 16:15:53 -07:00
Phillip PanandFacebook GitHub Bot 11def80f5d add privacy manifest to RCT-Folly
Summary:
Changelog: [Internal]

add this to the framework's resource bundle

from the audit there were callsites to fstat variants in our forked copy of boost, so use C617.1.
callsites:
- RCT-Folly/folly/FileUtil.h
- RCT-Folly/folly/portability/SysStat.h

current problem with this method is that the required reasons are not currently be aggregated during app store review, so those need to live in the app's. but go ahead and add it here for now, i think apple will try to fix it.

Reviewed By: cipolleschi

Differential Revision: D55625114

fbshipit-source-id: fb388f474e62543828218925b0d409d4b558c3db
2024-04-22 16:15:53 -07:00
Phillip PanandFacebook GitHub Bot c05591b25b add privacy manifest to react native boost
Summary:
Changelog: [Internal]

add this to the framework's resource bundle

from the audit there were callsites to mach_absolute_time and fstat variants in our forked copy of boost, so use 35F9.1 and C617.1 respectively.

current problem with this method is that the required reasons are not currently be aggregated during app store review, so those need to live in the app's. but go ahead and add it here for now, i think apple will try to fix it.

Reviewed By: cipolleschi

Differential Revision: D55625113

fbshipit-source-id: 0dcd216116595d1bb14e6b843f711aac68f84e5c
2024-04-22 16:15:53 -07:00
Phillip PanandFacebook GitHub Bot 54c9748bb1 add privacy manifest to React-cxxreact
Summary:
Changelog: [Internal]

add this to the framework's resource bundle

reasons:
  - C617.1 (JSBigString)

current problem with this method is that the required reasons are not currently be aggregated during app store review, so those need to live in the app's. but go ahead and add it here for now, i think apple will try to fix it.

Reviewed By: sammy-SC

Differential Revision: D55624716

fbshipit-source-id: 400e9852a64e7f9fd9e32225b199f2664a069fc2
2024-04-22 16:15:53 -07:00
Phillip PanandFacebook GitHub Bot 14c7794f1d add privacy manifest to React-Core
Summary:
Changelog: [Internal]

add this to the framework's resource bundle

reasons:
 - C617.1 (RCTJavaScriptLoader)
 - CA92.1 (RCTI18nUtil, RCTBundleURLProvider, RCTSettingsManager)

current problem with this method is that the required reasons are not currently be aggregated during app store review, so those need to live in the app's. but go ahead and add it here for now, i think apple will try to fix it.

Reviewed By: sammy-SC

Differential Revision: D55622471

fbshipit-source-id: f6ab864f51d4fa6e20f5de4fd56d8126d55dea8d
2024-04-22 16:15:53 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 224ac21568 Fix Symbol not found: (_JSGlobalContextSetInspectable) (#44185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44185

This change will fix a symbol not found for JSC Runtime.

The `if` check was not a compile time check, therefore the symbol ended up in the binary even if it is not available.

Following this post on [Apple forum](https://forums.developer.apple.com/forums/thread/749534), this changes should do the trick.

## Changelog
[iOS][Fixed] - Fix Symbol not found: (_JSGlobalContextSetInspectable)

Reviewed By: hash3r

Differential Revision: D56425834

fbshipit-source-id: a37af51b078bd47a938e6b65d9d8e0f7506e746f
2024-04-22 13:59:16 -07:00
Nivaldo BondançaandFacebook GitHub Bot 876914be55 Update ktfmt component on FBS:master (#44184)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44184

Reviewed By: zertosh

Differential Revision: D56421174

fbshipit-source-id: 686e23775f53d67980c2e84a17d0a5c490dbec2a
2024-04-22 12:43:18 -07:00
Arushi KesarwaniandFacebook GitHub Bot 57663f7673 Refactor ReactHostImpl to simplify logging (#44170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44170

Addressing following logging issues with ReactHostImpl
- replacing `ReactSoftExceptionLogger.logSoftException()` directly with private `raiseSoftException()` at all call-sites
- `raiseSoftException()` already has a call to `log()`, hence removing that.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D56335797

fbshipit-source-id: 41e094b5dc25f23fa19cd391a85ea101c3ff9058
2024-04-22 11:11:22 -07:00
NizamandFacebook GitHub Bot 99f3c241ad fix array enum prop parsing for array enum types (#44123)
Summary:
codegen generates type alias for  array enum props with uint32_t which cause wrong overloaded fromRawValue to call at runtime eventually app to terminate
more detailed info at issue https://github.com/facebook/react-native/issues/43821

## Changelog:

[Internal] [Fixed] - Codegen for array enum props

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

Test Plan: TODO

Reviewed By: cipolleschi

Differential Revision: D56414554

Pulled By: dmytrorykun

fbshipit-source-id: 0ec1b65951bc16ff58dd2b119c97a4e3fac2b161
2024-04-22 10:55:36 -07:00
Alex HuntandFacebook GitHub Bot c1f5504e3a Add changelog for 0.74.0
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56424487

fbshipit-source-id: 0be20582f38a4674afbd5113526612d1017500e2
2024-04-22 10:21:06 -07:00
Jan KassensandFacebook GitHub Bot f453d7a254 Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react-fbsource-import 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!

Changelog: [Internal]

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
diff-train-source-id: 13710c68616cf643d3cdfd69e5f39b2dc5a801b4

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

GitHub Repo: facebook/react-fbsource-import

Reviewed By: jackpope

Differential Revision: D56357596

fbshipit-source-id: 171ed7b816869348a1cc3c06a78b3803b86eb7c4
2024-04-22 09:27:24 -07:00
Moti ZilbermanandFacebook GitHub Bot b1bb0bee41 Align debugger Chrome launch flags with Meta-internal version (#44180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44180

Changelog: [General][Changed] Update Chrome launch flags for `--experimental-debugger` launch flow

Internally at Meta, we've been testing the experimental debugger launch flow with a different set of Chrome flags than are currently shipped in open source. This diff fixes those differences:

* Removes `--disable-backgrounding-occluded-windows`
* Adds `--guest`

Reviewed By: EdmondChuiHW

Differential Revision: D56418271

fbshipit-source-id: 884c5746e93cad89f17e4ef9e3ef193a2a454eb5
2024-04-22 08:37:32 -07:00
Moti ZilbermanandFacebook GitHub Bot d7f28b3ff1 Update debugger-frontend from b6c974c...24b0c81 (#44181)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44181

Changelog: [Internal] - Update `react-native/debugger-frontend` from b6c974c...24b0c81

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

Reviewed By: EdmondChuiHW

Differential Revision: D56419657

fbshipit-source-id: 6b87ffdb190f743926138e16b194abafd8a9508d
2024-04-22 08:12:09 -07:00
Rob HoganandFacebook GitHub Bot b0f6a05650 Fix @react-native/oss-library-example package.json#exports (#44179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44179

Fix `package.json#exports` main entry point in `react-native/oss-library-example` (which is actually at `packages/react-native-test-library`), to fix a Metro resolver warning on building RN-tester.

`"./": "./index.js"` is intended as an export map entry for the main export, whereas `".": "./index.js"` is correct (see [`PACKAGE_EXPORTS_RESOLVE`](https://nodejs.org/api/esm.html) spec).

Changelog: [Internal]

(This package is not published)

Reviewed By: cortinico, dmytrorykun

Differential Revision: D56414480

fbshipit-source-id: 01874cf11ae687aaf5aa5aa56075232f03d691b8
2024-04-22 05:23:04 -07:00
Jakub PiaseckiandFacebook GitHub Bot b236e154a1 Fix font scaling when numberOfLines is not set on Android on the new arch (#44165)
Summary:
This is a follow-up to https://github.com/facebook/react-native/pull/44075. I've missed the fact that `ReactConstants.UNSET` is `-1` and the default value of `numberOfLines` prop is `0`. This resulted in font size being set to the minimal value when `adjustFontSizeToFit` was used without setting `numberOfLines` to a positive value.

## Changelog:

[ANDROID] [FIXED] - Fixed `adjustFontSizeToFit` when used without `numberOfLines`

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

Test Plan:
<details>
<summary>Tested on the following code</summary>

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

export default function Test() {
  return (
    <SafeAreaView style={styles.container}>
      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Some text that fits (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Some text that fits (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={1}>
          Some text that fits (no adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit numberOfLines={1}>
          Some text that fits (adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Some longer text that doesn't fit if displayed in one line (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Some longer text that doesn't fit if displayed in one line (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={1}>
          Some longer text that doesn't fit if displayed in one line (no adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit numberOfLines={1}>
        Some longer text that doesn't fit if displayed in one line (adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={2}>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (no adjust, 2 lines)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={2} adjustsFontSizeToFit>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (adjust, 2 lines)
        </Text>
      </View>
    </SafeAreaView>
  );
}
```

</details>

|Old arch|New arch (without this PR)|New arch (with this PR)|
|-|-|-|
|<img width="447" alt="a_old" src="https://github.com/facebook/react-native/assets/21055725/4822f7f1-a19c-4225-9318-0eb2fec6f925">|<img width="447" alt="a_new_no_change" src="https://github.com/facebook/react-native/assets/21055725/ff594673-b362-4a81-8837-624cb1061d28">|<img width="447" alt="a_new_changed" src="https://github.com/facebook/react-native/assets/21055725/1f29c01c-1c91-4c9f-9edd-0950338b5d39">|

Reviewed By: NickGerleman

Differential Revision: D56362020

Pulled By: cortinico

fbshipit-source-id: 2aecbe66043870cf14536850ecbfb7c3890acd72
2024-04-22 04:13:36 -07:00
Moti ZilbermanandFacebook GitHub Bot 03a51da727 Populate function descriptions in RemoteObject
Summary:
bypass-github-export-checks

Changelog: [Internal]

[`Runtime.RemoteObject`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#type-RemoteObject) 's `description` property is a string, but in
the case of functions, V8 populates it with the result of [toString][1]
and Chrome DevTools uses a [series of regexes][2] to extract structured
information about the function.

Here, we add similar behaviour to Hermes to enable the various Chrome
DevTools UI features that are powered by function descriptions, such as
showing function names on hover and in object previews.

[1]: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/debug/debug-interface.cc;l=138-174;drc=42debe0b0e6bf90175dd0d121eb0e7dc11a6d29c
[2]: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/9a23d4c7c4c2d1a3d9e913af38d6965f474c4284/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts#L311-L391

Reviewed By: dannysu

Differential Revision: D56343190

fbshipit-source-id: a7ef5f09c98f34f486c4db2d4af192f10811d671
2024-04-19 15:00:16 -07:00
Arushi KesarwaniandFacebook GitHub Bot 73b4d67a78 Delete deprecated JSIModule methods (#42115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42115

React Native Android had a concept called JSIModules, which iOS doesn't have. The JSIModule concept was introduced in the early stages of the Fabric project to represent modules that interact with JS through JSI and they are not NativeModules.

In the new architecture this concept is not really necessary and these interfaces were only used to initialize and destroy the Fabric renderer and TurboModule Manager in react native core. Bridgeless mode doesn’t use JSIModule anymore. Also, it has an explicit list of supported JSI module types, so is not open for extension.
In order to simplify RN concepts and reduce confusion with TurboModules, which also "use JSI", deleting everything related to JSIModule. This was already deprecated in 0.74.0.

Please use ReactInstanceEventListener to subscribe for react instance events instead of getJSIModule() and we recommend using TurboModules instead of JSIModules.

Changelog:
[General][Breaking] Delete JSIModule

Reviewed By: javache, cortinico

Differential Revision: D49597702

fbshipit-source-id: bc2bc190aafaf559336b341b50ffabf413474105
2024-04-19 11:54:36 -07:00
Arushi KesarwaniandFacebook GitHub Bot ac3261ff60 Add ReactSoftException in ReactHostImpl only when onActivityResult, onNewIntent and onWindowFocusChange do not have the context (#44155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44155

Add ReactSoftException in ReactHostImpl only when `onActivityResult`, `onNewIntent`and `onWindowFocusChange` do not have the context

Changelog:
[Android][Fixed] ReactSoftExceptions in ReactHostImpl only when Context is null

Reviewed By: cortinico

Differential Revision: D56325407

fbshipit-source-id: a9f8fd5772fc05d39e72236fb8edfe5f8a9d6a43
2024-04-19 11:54:24 -07:00
Arushi KesarwaniandFacebook GitHub Bot efb073f46b NIT Changelog (#44156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44156

Adding the correct account to changelog

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56334873

fbshipit-source-id: 7e01f8ad7d19ba9708713d847f9ed1fcbecb4802
2024-04-19 11:37:37 -07:00
Samuel SuslaandFacebook GitHub Bot cf75d032d0 disable event loop (#44169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44169

## Changelog:
[General][Changed] Disable new event loop behavior when bridgeless (new architecture) is enabled.

# What is the problem
With event loop, specifically with `batchRenderingUpdatesInEventLoop`, prop change is not delivered to Android mounting layer if the prop change was initiated from state update inside of `useLayoutEffect`, `componentDidMount` or `componentDidUpdate`.  Note this has to be a prop change affecting mounting layer directly, not something consumed by Yoga, e.g. background colour or border colour.

This affects android only.

Minimal repro :
```
import React, {useLayoutEffect, useState} from 'react';
import {Button, SafeAreaView, View} from 'react-native';
function Foo() {
  const [bgColor, setBgColor] = React.useState('red');
  useLayoutEffect(() => {
    console.log('useLayoutEffect');
    setBgColor('blue');
  }, []);
  return (
    <View
      style={{
        backgroundColor: bgColor,
        width: '100%',
        height: '100%',
      }}
    />
  );
}
function RNTesterApp() {
  const [show, setShow] = useState(false);
  return (
    <SafeAreaView>
      <Button title="Toggle" onPress={() => setShow(!show)} />
      {show && <Foo />}
    </SafeAreaView>
  );
}
export default RNTesterApp;
```

# The underlaying problem
The problem is in batched rendering updates and how props are delivered to Android mounting layer.

Here is a step by step what happens in the repro above:
1. React issues asks Fabric to create new shadow node A with background colour **red**.
2. Fabric asks Android to allocate a view for shadow node A with background colour **red**.
3. React commits tree **T1** and calls layout effects. Meanwhile Fabric waits, without trying to mount the tree **T1**, to prevent painting state that is about to be updated and prevent flickering.
4. React clones node A, changing the background colour to **blue** and commits the new tree **T2**.
5. Fabric, will now go ahead and mount the latest tree **T2**. While creating mount instructions, it will drop prop updates because it believes prop updates where delivered already as part of step 2.

At first this might appear as a problem with view preallocation. But the underlaying trouble is that on Android, we currently have no way of knowing how to combine changesets from React into single folly::dynamic.

Reviewed By: javache, cortinico

Differential Revision: D56355863

fbshipit-source-id: f8616ee48e10fc10e129bb632c5d398842220d24
2024-04-19 11:02:54 -07:00
Jakub PiaseckiandFacebook GitHub Bot ed7766cee9 Don't enlarge font when adjustFontSizeToFit is set on iOS on the new architecture (#44163)
Summary:
On the old architecture `adjustFontSizeToFit` only shrinks the font size when there's too little space, while on the new arch it's also enlarged when there's too much space so that it always takes the entire width. This PR changes this behavior so that it only shrinks the text.

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

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixed font size enlarging when `adjustFontSizeToFit` is set

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

Test Plan:
<details>
<summary>Tested on the following code</summary>

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

export default function Test() {
  return (
    <SafeAreaView style={styles.container}>
      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Some text that fits (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Some text that fits (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={1}>
          Some text that fits (no adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit numberOfLines={1}>
          Some text that fits (adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Some longer text that doesn't fit if displayed in one line (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Some longer text that doesn't fit if displayed in one line (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={1}>
          Some longer text that doesn't fit if displayed in one line (no adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit numberOfLines={1}>
        Some longer text that doesn't fit if displayed in one line (adjust, 1 line)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }}>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (no adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} adjustsFontSizeToFit>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (adjust, unlimited height)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={2}>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (no adjust, 2 lines)
        </Text>
      </View>

      <View style={{margin: 4, borderWidth: 1, borderColor: 'black'}}>
        <Text style={{ fontSize: 16 }} numberOfLines={2} adjustsFontSizeToFit>
          Even longer text that doesn't even fit if it has as much as two entire lines for itself, what a darn shame (adjust, 2 lines)
        </Text>
      </View>
    </SafeAreaView>
  );
}
```

</details>

|Old arch (without this PR)|Old arch (with this PR)|
|-|-|
|<img width="546" alt="old_no_change" src="https://github.com/facebook/react-native/assets/21055725/f9682c0c-9a23-46b3-984d-607f83811d9e">|<img width="546" alt="old_changed" src="https://github.com/facebook/react-native/assets/21055725/c07f88fb-8ca2-415e-95c9-27bf718fc510">|

|New arch (without this PR)|New arch (with this PR)|
|-|-|
|<img width="546" alt="new_no_change" src="https://github.com/facebook/react-native/assets/21055725/173ac140-a836-4a40-83ef-c5365972700f">|<img width="546" alt="new_changed" src="https://github.com/facebook/react-native/assets/21055725/b0b00e45-17d2-4756-8ae5-a21c4ec242d9">|

Reviewed By: cortinico

Differential Revision: D56356139

Pulled By: cipolleschi

fbshipit-source-id: d11a5f4b95fb7da28a24d9136d41349d39851d9e
2024-04-19 10:20:15 -07:00
Jakub PiaseckiandFacebook GitHub Bot 8ecbb36492 Remove _textStorageForNSAttributesString which is unused (#44166)
Summary:
`_textStorageForNSAttributesString` seems to be unused and its implementation is exactly the same as `_textStorageAndLayoutManagerWithAttributesString`. This PR removes it.

## Changelog:

[IOS] [REMOVED] - Removed `_textStorageForNSAttributesString` which was unused

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

Test Plan: Built RN Tester on iOS.

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D56355860

Pulled By: javache

fbshipit-source-id: d9672478c1c914a468b480d9e7cbcbb0eaf8371f
2024-04-19 09:18:48 -07:00
Riccardo CipolleschiandFacebook GitHub Bot b7cd26d908 Split React-Fabric in React-Fabric and React-FabricComponents
Summary:
This change splits the React-Fabric podspec in two podspecs: React-Fabric and React-FabricComponents.

The reson is that we are codegenerating some of the core components and we want for the FabricComponents to depend on ReactCodegen.
Before this change, we had a circular dependency if we make ReactFabric depends on Codegen because ReactCodegen has to depend on ReactFabric.

Now, the dependency graph would be:
`React-FabricComponents --> ReactCodegen --> React-Fabric`
and no cycle is created

## Changelog
[internal] Split React-Fabric in React-Fabric and React-FabricComponents

Reviewed By: cortinico

Differential Revision: D56306355

fbshipit-source-id: 8b609d9c962913d5d730ac1c4e3614777b5953d9
2024-04-19 09:03:25 -07:00
Alan LeeandFacebook GitHub Bot a664d03ce8 rename PopupMenuAndroid.onPopupDismiss (#44109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44109

(Following up from suggestion of prior diff)
For consistency with `OnSelectionChange` callback, rename `onPopupDismiss` to `onDismiss`.

Changelog:
[Android][Internal] - rename function

Reviewed By: RSNara

Differential Revision: D56168456

fbshipit-source-id: c4a32637951200736202f43294973d783ecf5ace
2024-04-19 08:34:40 -07:00
Rick HanlonandFacebook GitHub Bot 57aa8b86ca Manual React Native sync for revisions 48b4ecc...b5e5ce8
Summary:
This sync includes the changes from:
- D56103750
- [TODO] A shim for SECRET_INTERNALS

This sync includes the following changes:
- **[b5e5ce8e0](https://github.com/facebook/react/commit/b5e5ce8e0 )**: Update ReactNativeTypes for root options (part 2) ([#28857](https://github.com/facebook/react/pull/28857)) //<Ricky>//
- **[da6ba53b1](https://github.com/facebook/react/commit/da6ba53b1 )**: [UMD] Remove umd builds ([#28735](https://github.com/facebook/react/pull/28735)) //<Josh Story>//
- **[0c245df1d](https://github.com/facebook/react/commit/0c245df1d )**: Complete the typo fix ([#28856](https://github.com/facebook/react/pull/28856)) //<Sebastian Silbermann>//
- **[f82051d7a](https://github.com/facebook/react/commit/f82051d7a )**: console test utils fix: match entire string, not just first letter ([#28855](https://github.com/facebook/react/pull/28855)) //<Andrew Clark>//
- **[4ca20fd36](https://github.com/facebook/react/commit/4ca20fd36 )**: Test top level fragment inside lazy semantics ([#28852](https://github.com/facebook/react/pull/28852)) //<Sebastian Markbåge>//
- **[c0cf7c696](https://github.com/facebook/react/commit/c0cf7c696 )**: Promote ASYNC_ITERATOR symbol to React Symbols ([#28851](https://github.com/facebook/react/pull/28851)) //<Sebastian Markbåge>//
- **[657428a9e](https://github.com/facebook/react/commit/657428a9e )**: Add ReactNativeTypes for root options ([#28850](https://github.com/facebook/react/pull/28850)) //<Ricky>//
- **[7909d8eab](https://github.com/facebook/react/commit/7909d8eab )**: [Flight] Encode ReadableStream and AsyncIterables ([#28847](https://github.com/facebook/react/pull/28847)) //<Sebastian Markbåge>//
- **[13eb61d05](https://github.com/facebook/react/commit/13eb61d05 )**: Move enableUseDeferredValueInitialArg to canary ([#28818](https://github.com/facebook/react/pull/28818)) //<Andrew Clark>//
- **[8afa144bd](https://github.com/facebook/react/commit/8afa144bd )**: Enable flag disableClientCache ([#28846](https://github.com/facebook/react/pull/28846)) //<Jan Kassens>//
- **[734956ace](https://github.com/facebook/react/commit/734956ace )**: Devtools: Add support for useFormStatus ([#28413](https://github.com/facebook/react/pull/28413)) //<Sebastian Silbermann>//
- **[17e920c00](https://github.com/facebook/react/commit/17e920c00 )**: [Flight Reply] Encode Typed Arrays and Blobs ([#28819](https://github.com/facebook/react/pull/28819)) //<Sebastian Markbåge>//
- **[0347fcd00](https://github.com/facebook/react/commit/0347fcd00 )**: Add on(Caught|Uncaught|Recoverable) opts to RN ([#28836](https://github.com/facebook/react/pull/28836)) //<Ricky>//
- **[c113503ad](https://github.com/facebook/react/commit/c113503ad )**: Flush direct streams in Bun ([#28837](https://github.com/facebook/react/pull/28837)) //<Kenta Iwasaki>//
- **[9defcd56b](https://github.com/facebook/react/commit/9defcd56b )**: Remove redundant props assign ([#28829](https://github.com/facebook/react/pull/28829)) //<Sebastian Silbermann>//
- **[ed4023603](https://github.com/facebook/react/commit/ed4023603 )**: Fix mistaken "react-server" condition ([#28835](https://github.com/facebook/react/pull/28835)) //<Sebastian Markbåge>//
- **[c8a035036](https://github.com/facebook/react/commit/c8a035036 )**: [Fizz] hoistables should never flush before the preamble ([#28802](https://github.com/facebook/react/pull/28802)) //<Josh Story>//
- **[4f5c812a3](https://github.com/facebook/react/commit/4f5c812a3 )**: DevTools: Rely on sourcemaps to compute hook name of built-in hooks in newer versions ([#28593](https://github.com/facebook/react/pull/28593)) //<Sebastian Silbermann>//
- **[435415962](https://github.com/facebook/react/commit/435415962 )**: Backwards compatibility for string refs on WWW ([#28826](https://github.com/facebook/react/pull/28826)) //<Jack Pope>//
- **[608edcc90](https://github.com/facebook/react/commit/608edcc90 )**: [tests] add `assertConsole<method>Dev` helpers ([#28732](https://github.com/facebook/react/pull/28732)) //<Ricky>//
- **[da69b6af9](https://github.com/facebook/react/commit/da69b6af9 )**: ReactDOM.requestFormReset  ([#28809](https://github.com/facebook/react/pull/28809)) //<Andrew Clark>//
- **[374b5d26c](https://github.com/facebook/react/commit/374b5d26c )**: Scaffolding for requestFormReset API ([#28808](https://github.com/facebook/react/pull/28808)) //<Andrew Clark>//
- **[41950d14a](https://github.com/facebook/react/commit/41950d14a )**: Automatically reset forms after action finishes ([#28804](https://github.com/facebook/react/pull/28804)) //<Andrew Clark>//
- **[dc6a7e01e](https://github.com/facebook/react/commit/dc6a7e01e )**: [Float] Don't preload images inside `<noscript>` ([#28815](https://github.com/facebook/react/pull/28815)) //<Josh Story>//
- **[3f947b1b4](https://github.com/facebook/react/commit/3f947b1b4 )**: [tests] Assert scheduler log empty in internalAct ([#28737](https://github.com/facebook/react/pull/28737)) //<Ricky>//
- **[bf09089f6](https://github.com/facebook/react/commit/bf09089f6 )**: Remove Scheduler.log from ReactSuspenseFuzz-test ([#28812](https://github.com/facebook/react/pull/28812)) //<Ricky>//
- **[84cb3b4cb](https://github.com/facebook/react/commit/84cb3b4cb )**: Hardcode disableIEWorkarounds for www ([#28811](https://github.com/facebook/react/pull/28811)) //<Ricky>//
- **[2243b40ab](https://github.com/facebook/react/commit/2243b40ab )**: [tests] assertLog before act in useEffectEvent ([#28763](https://github.com/facebook/react/pull/28763)) //<Ricky>//
- **[dfc64c6e3](https://github.com/facebook/react/commit/dfc64c6e3 )**: [tests] assertLog before act in ReactUse ([#28762](https://github.com/facebook/react/pull/28762)) //<Ricky>//
- **[42eff4bc7](https://github.com/facebook/react/commit/42eff4bc7 )**: [tests] Fix assertions not flushed before act ([#28745](https://github.com/facebook/react/pull/28745)) //<Ricky>//
- **[ed3c65caf](https://github.com/facebook/react/commit/ed3c65caf )**: Warn if outdated JSX transform is detected ([#28781](https://github.com/facebook/react/pull/28781)) //<Andrew Clark>//
- **[3f9e237a2](https://github.com/facebook/react/commit/3f9e237a2 )**: Fix: Suspend while recovering from hydration error ([#28800](https://github.com/facebook/react/pull/28800)) //<Andrew Clark>//
- **[7f5d25e23](https://github.com/facebook/react/commit/7f5d25e23 )**: Fix cloneElement using string ref w no owner ([#28797](https://github.com/facebook/react/pull/28797)) //<Joseph Savona>//
- **[bf40b0244](https://github.com/facebook/react/commit/bf40b0244 )**: [Fizz] Stop publishing external-runtime to stable channel ([#28796](https://github.com/facebook/react/pull/28796)) //<Josh Story>//
- **[7f93cb41c](https://github.com/facebook/react/commit/7f93cb41c )**: [DOM] Infer react-server entries bundles if not explicitly configured ([#28795](https://github.com/facebook/react/pull/28795)) //<Josh Story>//
- **[f61316535](https://github.com/facebook/react/commit/f61316535 )**: Rename SECRET INTERNALS to `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` ([#28789](https://github.com/facebook/react/pull/28789)) //<Sebastian Markbåge>//
- **[9644d206e](https://github.com/facebook/react/commit/9644d206e )**: Soften useFormState warning ([#28788](https://github.com/facebook/react/pull/28788)) //<Ricky>//
- **[c771016e1](https://github.com/facebook/react/commit/c771016e1 )**: Rename The Secret Export of Server Internals ([#28786](https://github.com/facebook/react/pull/28786)) //<Sebastian Markbåge>//
- **[d50323eb8](https://github.com/facebook/react/commit/d50323eb8 )**: Flatten ReactSharedInternals ([#28783](https://github.com/facebook/react/pull/28783)) //<Sebastian Markbåge>//
- **[f62cf8c62](https://github.com/facebook/react/commit/f62cf8c62 )**: [Float] treat `props.async` in Float consistent with the rest of react-dom ([#26760](https://github.com/facebook/react/pull/26760)) //<Josh Story>//
- **[dfd3d5af8](https://github.com/facebook/react/commit/dfd3d5af8 )**: Add support for transition{run,start,cancel} events ([#27345](https://github.com/facebook/react/pull/27345)) //<Hugo Sales>//
- **[1f8327f83](https://github.com/facebook/react/commit/1f8327f83 )**: [Fiber] Use real event priority for hydration scheduling ([#28765](https://github.com/facebook/react/pull/28765)) //<Josh Story>//
- **[97c90ed88](https://github.com/facebook/react/commit/97c90ed88 )**: [DOM] Shrink ReactDOMCurrentDispatcher method names ([#28770](https://github.com/facebook/react/pull/28770)) //<Josh Story>//
- **[9007fdc8f](https://github.com/facebook/react/commit/9007fdc8f )**: [DOM] Shrink ReactDOMSharedInternals source representation ([#28771](https://github.com/facebook/react/pull/28771)) //<Josh Story>//
- **[14f50ad15](https://github.com/facebook/react/commit/14f50ad15 )**: [Flight] Allow lazily resolving outlined models ([#28780](https://github.com/facebook/react/pull/28780)) //<Sebastian Markbåge>//
- **[4c12339ce](https://github.com/facebook/react/commit/4c12339ce )**: [DOM] move `flushSync` out of the reconciler ([#28500](https://github.com/facebook/react/pull/28500)) //<Josh Story>//
- **[8e1462e8c](https://github.com/facebook/react/commit/8e1462e8c )**: [Fiber] Move updatePriority tracking to renderers ([#28751](https://github.com/facebook/react/pull/28751)) //<Josh Story>//
- **[0b3b8a6a3](https://github.com/facebook/react/commit/0b3b8a6a3 )**: jsx: Remove unnecessary hasOwnProperty check ([#28775](https://github.com/facebook/react/pull/28775)) //<Andrew Clark>//
- **[2acfb7b60](https://github.com/facebook/react/commit/2acfb7b60 )**: [Flight] Support FormData from Server to Client ([#28754](https://github.com/facebook/react/pull/28754)) //<Sebastian Markbåge>//
- **[d1547defe](https://github.com/facebook/react/commit/d1547defe )**: Fast JSX: Don't clone props object ([#28768](https://github.com/facebook/react/pull/28768)) //<Andrew Clark>//
- **[bfd8da807](https://github.com/facebook/react/commit/bfd8da807 )**: Make class prop resolution faster ([#28766](https://github.com/facebook/react/pull/28766)) //<Andrew Clark>//
- **[cbb6f2b54](https://github.com/facebook/react/commit/cbb6f2b54 )**: [Flight] Support Blobs from Server to Client ([#28755](https://github.com/facebook/react/pull/28755)) //<Sebastian Markbåge>//
- **[f33a6b69c](https://github.com/facebook/react/commit/f33a6b69c )**: Track Owner for Server Components in DEV ([#28753](https://github.com/facebook/react/pull/28753)) //<Sebastian Markbåge>//
- **[e3ebcd54b](https://github.com/facebook/react/commit/e3ebcd54b )**: Move string ref coercion to JSX runtime ([#28473](https://github.com/facebook/react/pull/28473)) //<Andrew Clark>//
- **[fd0da3eef](https://github.com/facebook/react/commit/fd0da3eef )**: Remove _owner field from JSX elements in prod if string refs are disabled ([#28739](https://github.com/facebook/react/pull/28739)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions 48b4ecc...b5e5ce8

jest_e2e[run_all_tests]
bypass-github-export-checks

Reviewed By: kassens

Differential Revision: D56251607

fbshipit-source-id: e16db2fa101fc7ed1e009158c76388206beabd5f
2024-04-19 08:21:16 -07:00
zhongwuzwandFacebook GitHub Bot c0ea79d49b Fixes Android tests build error (#44160)
Summary:
Fixes build_android failure.

```
' file not found
  #include <react/renderer/mounting/stubs.h>
```

bypass-github-export-checks

## Changelog:

[INTERNAL] [FIXED] - Fixes Android tests build error

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

Test Plan: ci green.

Reviewed By: javache

Differential Revision: D56350360

Pulled By: cipolleschi

fbshipit-source-id: 03c0fe524b0725696cde16e693df2a612361e8e8
2024-04-19 07:07:00 -07:00
Kudo ChienandFacebook GitHub Bot 23709f7c61 Improve reusability for RCTRootViewFactory (#43528)
Summary:
RCTRootViewFactory is a great work for creating react binding view. we want to reuse the factory inside expo and would be good to have these improvements.
- exposing `reactHost` property so that we can update the RCTHost instance without recreate a factory.
- break bridgeless creation logic to a specific `createReactHost`, so that we can reuse the method for RCTHost creation

## Changelog:

[IOS][CHANGED] - Improve reusability for RCTRootViewFactory

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

Test Plan: this pr should not introduce any regression and getting all ci passed

Reviewed By: cortinico

Differential Revision: D56056103

Pulled By: cipolleschi

fbshipit-source-id: 9f312707b9013c36863945c9b99a697f949f10b5
2024-04-19 06:12:11 -07:00
Alan HughesandFacebook GitHub Bot c9b3a3106b 0.72.13 Changelog (#44154)
Summary:
Changelog: [Internal]

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Reviewed By: cortinico

Differential Revision: D56335973

Pulled By: arushikesarwani94

fbshipit-source-id: b481b04e218f34b0760f21106e6b5b583cb7f760
2024-04-19 04:12:46 -07:00
Ruslan LesiutinandFacebook GitHub Bot 9e9fbec475 Update debugger-frontend from 1467870...b6c974c (#44161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44161

Changelog: [Internal] - Update `react-native/debugger-frontend` from 1467870...b6c974c

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

Reviewed By: robhogan

Differential Revision: D56347692

fbshipit-source-id: 5efd6b5339008238aebe50bb5ac060df59c6afd9
2024-04-19 02:40:51 -07:00
Jane LiandFacebook GitHub Bot 727c4040b8 Back out "Use ClassFinder inside ViewManagerPropertyUpdater" (#44152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44152

We're seeing an increase of crashes on Twilight (https://www.internalfb.com/logview/twilight_android_crashes/d25ec89876821abdd07f98d08a729f7c?trace_tab=0&ds=%7B%22start%22%3A%22-2%20weeks%22%2C%22end%22%3A%22now%22%7D) related to setting fontWeight with Double instead of String.

Original commit changeset: a67195e98377

Original Phabricator Diff: D56191175

Changelog:
[Internal] [Changed] - Revert use ClassFinder inside ViewManagerPropertyUpdater

Reviewed By: cortinico

Differential Revision: D56311183

fbshipit-source-id: e3407ff4858f00f8dadb882221e64a2631105597
2024-04-18 18:02:55 -07:00
Nick GerlemanandFacebook GitHub Bot ed6abc4e83 Use modern Differentiator "sliceChildShadowNodeViewPairs" in tests (#44131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44131

Stub tree creation is using an old differentiator path we aren't shipping today. This removes that path, so that we can unit test the new one

1. Remove `ForTesting`/`Legacy` functions
3. Update stub view tree code for API/behavior difference of new differentiator functions including unflattened views. Don't create view instructions for those, and use `mountIndex` instead of pair index
4. Remove `V2` suffix, since the old path is deleted
5. Move mounting stub test utils out of the production library

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D56227426

fbshipit-source-id: 0f525097cfb576e0228c9ca20a770fa41ddf1e0d
2024-04-18 17:37:12 -07:00
Alex Taylor (alta)andFacebook GitHub Bot 739a8dfcf4 Deploy 0.234.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D56280192

fbshipit-source-id: 68e0288bb214644d24f3d9f132c3ffff2a3d512a
2024-04-18 16:40:54 -07:00
Alan LeeandFacebook GitHub Bot c631e93341 Remove UIManager.{show|dismiss}PopupMenu (#44096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44096

These Android only APIs have been deprecated and are being removed for 0.75 release.

Changelog:
[Android][Removed] - UIManager.showPopupMenu() and UIManager.dismissPopupMenu() have been removed

Reviewed By: RSNara

Differential Revision: D56041827

fbshipit-source-id: e2afebf55860f33d2c8d1887e865adb4dd555e6c
2024-04-18 13:52:21 -07:00
Moti ZilbermanandFacebook GitHub Bot 4fbc1f2ef8 Include stack traces in console messages (#44150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44150

Changelog: [Internal]

* Adds the `RuntimeTargetDelegate::captureStackTrace` method for capturing stack traces during JS execution. The returned stack traces are opaque to RN, but may be passed back into the `RuntimeTargetDelegate`, particularly through the `addConsoleMessage` method.
* Implements `captureStackTrace` for Hermes (based on D55757947).
* Integrates `captureStackTrace` into the `console` handler (`RuntimeTargetConsole`)

Reviewed By: hoxyq

Differential Revision: D55474512

fbshipit-source-id: 3547d756844fa24c24cd9bcdc507b33c6ab673a9
2024-04-18 12:44:06 -07:00
Arushi KesarwaniandFacebook GitHub Bot 2c9574eb29 NIT Changelog (#44153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44153

Adding missing # in the changelog

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56314996

fbshipit-source-id: 1160685a5d65c2dd49b33a3bfa14f91f5e95b8c4
2024-04-18 12:37:42 -07:00
Alfonso CurbeloandFacebook GitHub Bot 65ae73785b 0.73.7 Changelog (#44149)
Summary:
0.73.7 Changelog

## Changelog:

[INTERNAL] - 0.73.7 Changelog

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

Reviewed By: cipolleschi

Differential Revision: D56307297

Pulled By: cortinico

fbshipit-source-id: 0c57d5ce62bc029eb06060859d8d753fdf5f3de1
2024-04-18 10:51:43 -07:00
Moti ZilbermanandFacebook GitHub Bot ddc9bd1ff3 Refactor ConsoleApiTest to use stored Matchers instead of an intermediate struct
Summary:
bypass-github-export-checks

Changelog: [Internal]

Rewrites all `ConsoleApiTest` test cases to use matchers instead of a homegrown solution for buffering `EXPECT_*` calls.

Reviewed By: robhogan

Differential Revision: D55485495

fbshipit-source-id: 1aa50bbbb5a3b02280ed4a0bee59682716b4fd7e
2024-04-18 08:00:37 -07:00
Intl SchedulerandFacebook GitHub Bot 0276500d19 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907948563891
Sandcastle Job Instance ID: 18014399763343604
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D56301324

fbshipit-source-id: 76491a8facd51ac155096a7b07ef29afc630e3c5
2024-04-18 05:25:32 -07:00
Nick GerlemanandFacebook GitHub Bot f21d9afe0b Fixup margin: auto and justification behavior for overflowed containers (#44069)
Summary:
X-link: https://github.com/facebook/yoga/pull/1646

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

Fixes https://github.com/facebook/yoga/issues/978

1. Don't allow auto margin spaces to become a negative length
2. Replicate fallback alignment behavior specified by box-alignment spec that we are using for align-content.

Reviewed By: joevilches

Differential Revision: D56091577

fbshipit-source-id: 3c02f81f969bb947cdc5c80b15faaa0b0d39c0c2
2024-04-17 21:50:55 -07:00
Jane LiandFacebook GitHub Bot b580a071ca Fix logic for mKeepActivity (#44139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44139

I added logic to make useEffect() work w/ fragment-based nav, but I mixed up some logic. Fixed it here
Changelog: [Internal]

Differential Revision: D56264138

fbshipit-source-id: b551f0cb93cb4a0291733edbd341d3508b61e392
2024-04-17 20:17:47 -07:00
Intl SchedulerandFacebook GitHub Bot 72e262eb5b translation auto-update for i18n/oculus-mirage.config.json on master
Summary:
Chronos Job Instance ID: 1125907948552357
Sandcastle Job Instance ID: 9007200506994282
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D56284224

fbshipit-source-id: 9e91ccd825f78960dc0e09ff923867f544f7883d
2024-04-17 20:16:15 -07:00
Soe LynnandFacebook GitHub Bot 41a14962fc Expose Gap Percentage to ReactNative (#44129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44129

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

X-link: https://github.com/facebook/yoga/pull/1647

Expose the Gap Percent from Yoga to RN Layer

Changelog:
[Android][Breaking] Enable flex gap percentage value for RN.

Reviewed By: NickGerleman

Differential Revision: D56160597

fbshipit-source-id: 34c05d39a03cf013f279a2cf9eb9762772ee11de
2024-04-17 17:24:00 -07:00
Arushi KesarwaniandFacebook GitHub Bot daf3f8a30f JSI Module Breaking Change in Changelog (#44138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44138

Adding the missing breaking change in 0.74.0-rc0 changelog for https://github.com/facebook/react-native/commit/65552055392a5996bf50548018953875dde4560b

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56261881

fbshipit-source-id: 00f9f0a8707812eeb37e7d64e579e429388c3484
2024-04-17 14:14:52 -07:00
Ruslan LesiutinandFacebook GitHub Bot fe9942a19d Update debugger-frontend from fa52bd7...1467870
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from fa52bd7...1467870

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

Reviewed By: EdmondChuiHW

Differential Revision: D56249192

fbshipit-source-id: 7c1de5780c86222d48b2f277aaebe21afbfa153d
2024-04-17 10:00:47 -07:00
Arushi KesarwaniandFacebook GitHub Bot 4595351310 Remove getJavaScriptContextHolder() from BridgelessReactContext (#44124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44124

This API was introduced as part of Backwards Compat effort recently but now this backwards comptability is supported through BridgelessCatalystInstance. The major OSS usages are through Catalyst Instance and not through Bridgeless React Context which is why deleting this makes sense so that people do not start depending on this.

Changelog:
[Android][Removed] - Remove getJavaScriptContextHolder() from BridgelessReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode

Reviewed By: RSNara

Differential Revision: D56205699

fbshipit-source-id: 175463e17c526359c2e04fec4b2104aea3949d5d
2024-04-17 09:53:35 -07:00
Arushi KesarwaniandFacebook GitHub Bot f7b9aafd10 Remove getRuntimeExecutor() from ReactContext (#44102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44102

Remove `getRuntimeExecutor()` from ReactContext since now it can be accessed through BridgelessCatalystInstance.getRuntimeExecutor() directly

Changelog:
[Android][Removed] - Remove getRuntimeExecutor() from ReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode

Reviewed By: RSNara

Differential Revision: D56151365

fbshipit-source-id: 42bb6a6a3d729339cfb83ffdd3f7cbec314b687a
2024-04-17 09:53:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 1d1b40cbbe fix: always subscribe RDT listeners, even if frontend is already connected (#44133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44133

# Changelog: [Internal]

Previous implementation doesn't have support for one specific case, when RN runtime was initialized and frontend is ready to be connected, but then it gets disconnected and re-connected again for the same runtime.

The issues were:
- For Fusebox: backend and frontend are correctly re-connected if user had Chrome DevTools opened, frontend invalidated via reload, then Chrome DevTools closed and re-opened again
- For DebuggingOverlayRegistry: it didn't subscribe to events from new `react-devtools-agent`, which emits events such as `showNativeHighlight` or `drawTraceUpdates`

Reviewed By: motiz88

Differential Revision: D56239185

fbshipit-source-id: ffa886b396790cb46de1d86fb000ff907edc1437
2024-04-17 09:46:19 -07:00
Alex HuntandFacebook GitHub Bot 38d5232cc9 Remove leftover fields from root package.json (#44076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44076

Removes fields in the root `package.json` manifest left over from the monorepo migration. `react-native/monorepo` is not a package published to npm, but is a root project configuration for the monorepo. Therefore it **doesn't need**:

- npm metadata fields (or even a `name` or `version` — I'm leaving these included due to 1/ references in fbsource, 2/ some non-Yarn tooling may complain).
- Fields used by tooling that are present in packages/react-native: `jest-junit`, `types`.
- A `peerDependency` on `react` (again, present in packages/react-native/package.json).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56134668

fbshipit-source-id: bc3449eb4c122eb5d885fabda9af7d19bb71faff
2024-04-17 09:26:41 -07:00
Jakub PiaseckiandFacebook GitHub Bot 747a96b7b3 Add implementation of adjustsFontSizeToFit on the new architecture on Android (#44075)
Summary:
`adjustsFontSizeToFit` prop is exposed on both platforms but is missing implementation on the new arch on Android. This Pr adds it.

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

## Changelog:

[ANDROID] [FIXED] - Fixed `adjustsFontSizeToFit`  not working on Android when using the new architecture

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

Test Plan:
Tested on the RN Tester app using the `AdjustingFontSize` test:

| Old architecture | New architecture |
|------------------|------------------|
| <video src="https://github.com/facebook/react-native/assets/21055725/9243317c-1917-4ddb-9b8a-e9e99638409d">           | <video src="https://github.com/facebook/react-native/assets/21055725/39a7a9f2-21e4-4ba7-9ceb-dfec4ca6f643">         |

Reviewed By: javache

Differential Revision: D56134348

Pulled By: cortinico

fbshipit-source-id: b8339e3bec08e307abb0c6e4bd3f5fe143303014
2024-04-17 08:57:41 -07:00
Andrew DatsenkoandFacebook GitHub Bot 46366867f7 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model:modelAndroid (#44134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44134

Changelog: [Internal]

Reviewed By: strulovich

Differential Revision: D56138858

fbshipit-source-id: 5ea349b6c8565f825de273adbb192c6005a2a357
2024-04-17 08:50:34 -07:00
Moti ZilbermanandFacebook GitHub Bot 3220825782 Don't autosize text in "Paused in debugger" overlay
Summary:
Changelog: [Internal]

bypass-github-export-checks

Reviewed By: EdmondChuiHW, huntie

Differential Revision: D56244413

fbshipit-source-id: 99218114a7cefb9a305f504d45550f10bd6f1586
2024-04-17 08:40:48 -07:00
zhongwuzwandFacebook GitHub Bot 297ae37367 Fix rn-tester Animated example label color in dark mode (#44127)
Summary:
Fix rn-tester Animated example label color in dark mode

## Changelog:

[INTERNAL] [FIXED] - Fix rn-tester Animated example label color in dark mode

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

Test Plan:
Animated examples render incorrectly in dark mode. So let's fix them. :)

![image](https://github.com/facebook/react-native/assets/5061845/ad882ee2-d156-4b24-8ddb-0ec27dc27cba)

Reviewed By: fabriziocucci

Differential Revision: D56234954

Pulled By: javache

fbshipit-source-id: 5fd8604077ced9aa3acd23a7dc9ebd8476a7330b
2024-04-17 08:21:38 -07:00
Blake FriedmanandFacebook GitHub Bot e0799536ef Fix: OSS builds can accidentally using coreutils cp (#44097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44097

There are two places where we use a feature specific to the system version of 'cp', the:

  -X    Do not copy Extended Attributes (EAs) or resource forks.

This feature isn't available in GNU's cp, which is commonly installed on macOS using:

  brew install coreutils && brew link coreutils

We can avoid the problem alltogether by being specific about the path of the system cp.

Changelog: [General][Fixed] don't break script phase and codegen when coreutils installed on macOS

Reviewed By: cipolleschi

Differential Revision: D56143216

fbshipit-source-id: f1c1ef9ea2f01614d6d89c4e9eedf43113deb80c
2024-04-17 08:08:50 -07:00
Moti ZilbermanandFacebook GitHub Bot 1d26907ca4 Internal API for Activity-less "Paused in debugger" overlay (#44132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44132

Changelog: [Breaking][Android] `DevSupportManagerFactory.create()` changed to take an additional parameter of type `PausedInDebuggerOverlayManager` (nullable)

Enables integrators of React Native Android to supply their own implementation of the Fusebox "paused in debugger" overlay. This is primarily intended for legacy Meta-internal integrations that can't use the built-in implementation based on `Dialog`. **The API will likely go away once those integrations have been migrated.**

Reviewed By: javache

Differential Revision: D56215119

fbshipit-source-id: 9cd79a6948c268a952ac28e5563ae57c90756da7
2024-04-17 07:26:54 -07:00
Dmitry RykunandFacebook GitHub Bot 2f1cd04073 Try static view config if native view config is not available (#44065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44065

React Native will try to use static view config if native view config is not available.
This will allow Fabric-only native components in Bridge mode.

Changelog: [General][Added] - Add support for Fabric-only native components in Bridge mode.

Reviewed By: cortinico

Differential Revision: D56062759

fbshipit-source-id: e562700695c14c88d11056aec1e66f8aa10a3957
2024-04-17 06:14:35 -07:00
Moti ZilbermanandFacebook GitHub Bot 3426591bbe Tweak pause overlay design, remove Step Over button (#44119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44119

Changelog: [Internal]

TSIA - following design feedback from huntie.

Reviewed By: hoxyq

Differential Revision: D56193523

fbshipit-source-id: 89e9fc77702e40a2f39be719c700fe9ad400a8a2
2024-04-17 05:22:09 -07:00
Moti ZilbermanandFacebook GitHub Bot 233da7dde7 Style pause overlay to be similar to Chrome's (#44081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44081

Changelog: [Internal]

Migrates the Fusebox "pause in debugger" on Android from `AlertDialog` to a custom dialog, with a look and feel based closely on the equivalent Chrome feature. I've adapted the layout slightly to be mobile-appropriate (touch target sizes etc) and drawn new icon assets that are effectively hand-upscaled versions of the Chrome ones.

Reviewed By: hoxyq

Differential Revision: D56105051

fbshipit-source-id: 42d7472c8dd8f842c0dbd82c12eba102bcf59b87
2024-04-17 05:22:09 -07:00
Moti ZilbermanandFacebook GitHub Bot a5c6779ce5 Add Step Over and Resume buttons to pause overlay (#44082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44082

Changelog: [Internal]

Adds the ability to interactively resume/step from the Fusebox "paused in debugger" overlay on Android. This uses HostCommands (D56098083) and extends the AlertDialog-based overlay (D56068445). In an upcoming diff on this stack, we'll update the design of the overlay to match Chrome's.

Reviewed By: hoxyq

Differential Revision: D56098084

fbshipit-source-id: 587b8bac7b0dd636363fc28ea7d0577b1a52d5c7
2024-04-17 05:22:09 -07:00
Moti ZilbermanandFacebook GitHub Bot 6930f3daf7 Minimal implementation of "paused in debugger" overlay (#44079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44079

Changelog: [Internal]

Implements an unstyled, non-interactive version of the "paused in debugger" in-app overlay in Fusebox on Android, based on the event introduced in D56068444. The implementation in `DevSupportManagerBase` is shared across Bridge and Bridgeless.

In upcoming diffs in this stack, we'll add interactive features (namely "resume" and "step over" buttons, like in Chrome) and improve the visual styling of this overlay.

Reviewed By: hoxyq

Differential Revision: D56068445

fbshipit-source-id: a9ac2765d29d64615751b5cdf03939e0b84d2545
2024-04-17 05:22:09 -07:00
Luis Miguel AlvaradoandFacebook GitHub Bot 66fd1e8145 remove: leftover RCTSegmentedControl code (#44023)
Summary:
The `SegmentedControl` component was removed in https://github.com/facebook/react-native/pull/33140, but not all related code was moved.

See React Native 0.69 breaking-changes:  https://reactnative.dev/blog/2022/06/21/version-069#breaking-changes

## Changelog:

[INTERNAL] - remove: leftover `RCTSegmentedControl` code

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

Test Plan: CI will be OK.

Reviewed By: cortinico

Differential Revision: D56015121

Pulled By: dmytrorykun

fbshipit-source-id: 10e64e9bbd0e5346711fd2f42553deb2d992c191
2024-04-17 04:25:27 -07:00
Moti ZilbermanandFacebook GitHub Bot f9eb35a581 Tweak pause overlay design, remove Step Over button (#44118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44118

Changelog: [Internal]

TSIA - following design feedback from huntie.

Reviewed By: huntie, hoxyq

Differential Revision: D56191051

fbshipit-source-id: 6497a0ec6c51808410c3745ce97ed44085add0ac
2024-04-17 04:05:36 -07:00
Moti ZilbermanandFacebook GitHub Bot 8872652236 Style pause overlay to be similar to Chrome's (#44085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44085

Changelog: [Internal]

Styles the Fusebox "paused in debugger" overlay on iOS to look similar to the Chrome implementation (and the Android implementation as of D56105051) instead of using a plain `UIAlertController`.

The only thing missing at this point is the custom asset for the "step over" icon. Unlike on Android, RN doesn't currently ship any built-in images for iOS, so I'll figure out how to do that in a separate diff and use a system-provided icon in the interim.

Reviewed By: hoxyq

Differential Revision: D56116881

fbshipit-source-id: a07e1a7592c4210606a0e61366ad750faf6148bc
2024-04-17 04:05:36 -07:00
Moti ZilbermanandFacebook GitHub Bot fc9e8ce649 "Paused in debugger" overlay based on UIAlertController (#44083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44083

Changelog: [Internal]

Adds a working, interactive "paused in debugger" overlay to Fusebox for iOS (similar to what D56068445 + D56098084 did on Android). The overlay is rendered using a standard `UIAlertController`. In upcoming diffs on this stack we'll style the overlay to look more like the Chrome implementation.

Reviewed By: hoxyq

Differential Revision: D56105959

fbshipit-source-id: d752d6611b2d9e48b67a82f3a9a96c7785c31a7a
2024-04-17 04:05:36 -07:00
Nicola CortiandFacebook GitHub Bot 56da650c90 Use ClassFinder inside ViewManagerPropertyUpdater (#44114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44114

In OSS, we should use the ClassFinder wrapper as the `Class.byName` calls will never succeed (we don't run the annotation processor in OSS).

Changelog:
[Internal] [Changed] - Use ClassFinder inside ViewManagerPropertyUpdater

Reviewed By: arushikesarwani94

Differential Revision: D56191175

fbshipit-source-id: a67195e983774872e27d35456b45651540411e2b
2024-04-17 03:43:02 -07:00
Phillip PanandFacebook GitHub Bot aa7a0bc6a6 fix broken link in privacy manifest template message (#44128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44128

Changelog: [Internal]

idk what happened but this link got abbreviated when i copypastad it, fixing it here

Reviewed By: javache

Differential Revision: D56228228

fbshipit-source-id: 35c5c9fb44e82083773302618474c1e3bbc71712
2024-04-17 03:02:18 -07:00
Moti ZilbermanandFacebook GitHub Bot 58ddd74202 Add HostCommands for resuming and stepping debugger (#44080)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44080

## Design

Adds a new public `HostTarget::sendCommand` method, enabling integrators to send simple imperative commands to the target.

As an implementation detail, the commands are translated internally to CDP and sent over a dedicated `HostTargetSession` (encapsulated in `HostCommandSender`). Any response from the underlying Agent is ignored.

From the caller's perspective, these commands don't occur in the context of a session at all, and from the frontend's perspective, only the *effects* of the commands (if any) are seen.

## Use case

HostCommands are specifically useful when we want to resume/step execution in response to a UI action. The commands map directly to the `Debugger.resume` and `Debugger.stepOver` CDP methods.

NOTE: This is inspired by Chrome/V8's existing support for multiple concurrent CDP sessions. Any CDP client can successfully send `Debugger.resume` and `Debugger.stepOver` (without even subscribing to debugger events using `Debugger.enable`) and affect the state of other ongoing debugging sessions.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D56098083

fbshipit-source-id: 013ab748b360f700c453cf1447fb82d6d0d77c6f
2024-04-17 00:58:02 -07:00
Jane LiandFacebook GitHub Bot 2509eb710e Configure fragment-based nav to work with useEffect() (#44105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44105

Previously, we skipped calling the ReactDelegate callback functions when the ReavtNavigationFragment was destroyed because it set the current activity to null when we need to actually keep the reference to the activity. However, skipping this entirely also skips core clean up logic, such as running the return() function for useEffect().

Instead of skipping the callback function entirely, we just need to make sure we don't set mCurrentActivity to null. I followed D30504616 to configure an option to not set mCurrentActivity to null if mKeepActivity flag is set on the ReactInstanceManager.

Changelog: [Internal]

Reviewed By: keoskate

Differential Revision: D56167533

fbshipit-source-id: cb3620e21599683e0c6bbc5a6a9c4f384fdbcc51
2024-04-16 17:18:09 -07:00
Jane LiandFacebook GitHub Bot 63e202f3d5 Remove changes to ReactFragment introduced for fragment-based navigation (#44104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44104

We previously added the option to skip calling the delegate lifecycle events in D55646221 to support fragment-based navigation. However, we don't actually want to skip calling these events as they run some core clean up logic, such as calling the return value of useEffect(). There's a better way to get this working with fragment-based nav (see next diff).

Changelog:
[Internal] [Changed] - Remove option to skip calling delegate on ReactFragment lifecycle events

Reviewed By: keoskate, cortinico

Differential Revision: D56167614

fbshipit-source-id: 3a4b91a303a27c0e19644a4e6611229211a1e530
2024-04-16 17:18:09 -07:00
Samuel SuslaandFacebook GitHub Bot 8c53ac6078 setup an experiment to prevent double measure of text (#44120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44120

changelog: [internal]

Prevent measuring the same text twice in `ParagraphShadowNode`.

The current implementation calls `TextLayoutManager::measure` twice for a single `ParagraphShadowNode`. The first time to measure the node for Yoga. The second time inside `ParagraphShadowNode::layout`. I think the original author counted on the cache inside of `TextLayoutManager` to deal with this, but this is not always the case and `TextLayoutManager::measure` is called with two different available widths, leading to cache miss and fills the cache faster.

Reviewed By: NickGerleman

Differential Revision: D55757264

fbshipit-source-id: 0bf8b49f062f802a4e2f04cad1bf1d4bf001b870
2024-04-16 12:19:11 -07:00
Ruslan LesiutinandFacebook GitHub Bot e47297967c Update debugger-frontend from 864bc72...fa52bd7 (#44110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44110

Changelog: [Internal] - Update `react-native/debugger-frontend` from 864bc72...fa52bd7

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/864bc721a3f0f26b94f5730e59739a25e3182ce5...92227970f9128db14d080b5b9e9ddcafa23e7e17).

Reviewed By: robhogan

Differential Revision: D56159198

fbshipit-source-id: 8e39274569ee15476a6bb9ccab812d91177f388d
2024-04-16 10:56:24 -07:00
Ruslan LesiutinandFacebook GitHub Bot 430dd0be26 refactor[setUpReactDevTools]: support both RDT from Fusebox and standalone ws-based frontend (#44095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44095

# Changelog:
[General][Added] - support opening React DevTools from both Chrome DevTools frontend (React Native DevTools) and `react-devtools` standalone app

Reviewed By: robhogan

Differential Revision: D54896251

fbshipit-source-id: d6156ca09578b67d53393f564a3a591fd13d145f
2024-04-16 10:56:24 -07:00
Ruslan LesiutinandFacebook GitHub Bot b8e6e35a59 feat: import setUpFuseboxReactDevToolsDispatcher in DEV (#44094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44094

# Changelog: [Internal]

This script was added in D54770207.

This will be DEV-only for 2 reasons:
1. We need to double-check if Fusebox is ready to be used with production bundles, I don't think so.
2. Previous integration with RDT was DEV-only

Reviewed By: motiz88

Differential Revision: D56141041

fbshipit-source-id: 1141c65a5811d0f56c944e25a319ba21211b7836
2024-04-16 10:56:24 -07:00
Alex HuntandFacebook GitHub Bot 7c0676db06 Add useLastSuccessfulPipeline to release testing script (#44088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44088

This is a power user option for Release Crew members when testing locally — a flag to bypass being blocked on the latest in-progress CircleCI job and instead fetch build artifacts from the most recent successful pipeline (typically `HEAD~1`).

Example use cases where the latest pushed commit isn't impactful:
- An iOS-only fix, meaning Android can be tested now.
- A trivial fix that applies to CI only (e.g. RNTester Podfile.lock update).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56138727

fbshipit-source-id: f9884bdb289a92486807e8e033b756466fcec559
2024-04-16 10:34:44 -07:00
Ramanpreet NaraandFacebook GitHub Bot 3a3f3e6232 Introduce ReactContext.hasReactInstance() (#44116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44116

This is just the bridgeless analogue to .hasCatalystInstance()

Changelog: [Android][Added] - Introduced ReactContext.hasReactInstance() to replace .hasCatalystInstance()

Reviewed By: fabriziocucci

Differential Revision: D56164488

fbshipit-source-id: 8be4676e18dc7df4765746f46cf36e62405b4ffa
2024-04-16 10:12:54 -07:00
Andrew DatsenkoandFacebook GitHub Bot 94a58a8e42 fix AsyncTask deprecation suppression in ImageStoreManager.kt (#44113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44113

Changelog: [Internal]
as title

Reviewed By: cortinico

Differential Revision: D56189597

fbshipit-source-id: 5e33f5db378c634a3ef34b1124bb25d3c97308ed
2024-04-16 10:10:16 -07:00
zhongwuzwandFacebook GitHub Bot 89eb794751 Fabric: Add font variant support (#44112)
Summary:
Fixes https://github.com/facebook/react-native/issues/44064

## Changelog:

[IOS] [FIXED] - [iOS] Fabric: Add font variant support

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/44064 .

Reviewed By: cortinico

Differential Revision: D56189145

Pulled By: cipolleschi

fbshipit-source-id: a814cf4959b0160e36f79eaf6c7dcbffe5ef60c5
2024-04-16 08:53:17 -07:00
Andrew DatsenkoandFacebook GitHub Bot 8a343c6256 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/camera:cameraAndroid (#44101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44101

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56138400

fbshipit-source-id: 5c09e4d28c69bbf87236607d38afbfbddcd28a0c
2024-04-16 08:03:33 -07:00
Biki-dasandFacebook GitHub Bot b1576e5b1a feat: Added PixelRatio API example (#44000)
Summary:
Added the [PixelRatio](https://reactnative.dev/docs/pixelratio) API to the RN tester app on the API list examples.

## Changelog:

[General] [Added] - Add examples for the Pixel Ratio API, with all the available methods.

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

Test Plan:
**iOS**

https://github.com/facebook/react-native/assets/72331432/dd481916-a8df-4a62-8f63-61936d886d33

**android**

https://github.com/facebook/react-native/assets/72331432/4d8d67dc-ddeb-4ca7-b61c-07522951f9ee

Reviewed By: NickGerleman

Differential Revision: D56135685

Pulled By: hoxyq

fbshipit-source-id: f2f4eb9e31159a4a2c660d1a864b649e537916af
2024-04-16 07:17:36 -07:00
Blake FriedmanandFacebook GitHub Bot b71cebbd37 react-native.config.js handle optional @react-native-community dependencies
Summary:
As part of decoupling our dependency on the react-native-community/cli, the `react-native.config.js` which is
a part of the community's config ecosystem should probably be entirely removed from the react-native package.

As part of this, we're making the config fail gracefully if these dependencies aren't available in a user's project:

- react-native-community/cli-platform-android
- react-native-community/cli-platform-ios

Changelog: [Internal]

This isn't going to be a visible change to any users.

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D56137820

fbshipit-source-id: 528e25809a83b90e79b806a875001fc0f06db1cf
2024-04-16 07:16:48 -07:00
Moti ZilbermanandFacebook GitHub Bot 8afa8beac2 Add boilerplate for handling Overlay.setPausedInDebuggerMessage (#44078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44078

Changelog: [Internal]

Adds stub support for the [`Overlay.setPausedInDebuggerMessage`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Overlay#method-setPausedInDebuggerMessage) CDP method to `HostAgent` in the Fusebox backend, and propagates it into the Android and iOS integrations through `HostTargetDelegate`.

We take care to call `HostTargetDelegate::onSetPausedInDebuggerMessage()` a final time with a null `message` parameter, regardless of whether the client has actually sent the corresponding CDP message. Since multiple clients might be connected concurrently, we only send the `null` message when the *last* client which has requested a non-null message has disconnected.

Reviewed By: robhogan

Differential Revision: D56068444

fbshipit-source-id: c26e1cf17dec8d7dbb7edd5ab7fa3133642628ff
2024-04-16 04:52:13 -07:00
zhongwuzwandFacebook GitHub Bot d181f06b58 Fix rn-tester Accessibility example label color in dark mode (#44061)
Summary:
Fix rn-tester Accessibility example label color in dark mode

## Changelog:

[INTERNAL] [FIXED] - Fix rn-tester Accessibility example label color in dark mode

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

Test Plan:
Before:
![image](https://github.com/facebook/react-native/assets/5061845/286f25c1-3e9f-49d0-876b-8da552ecf5a9)

After fix:
![image](https://github.com/facebook/react-native/assets/5061845/264bfea4-c65b-4d72-be91-2fe72acbbf88)

Reviewed By: NickGerleman

Differential Revision: D56064680

Pulled By: dmytrorykun

fbshipit-source-id: bdf63939948803d15b2b730df567fce22160de73
2024-04-16 03:30:09 -07:00
Rob HoganandFacebook GitHub Bot a52bd7dd08 Inspector proxy: Rewrite 127.0.0.1 to localhost in source map URLs to support IPv4->IPv6 tunnels (#44092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44092

In a setup where a device retrieves a bundle from `http://127.0.0.1:8081`, but this is tunnelled to a remote host with only an IPv6 stack (eg, FB dev servers), the host running the inspector-proxy will fail to fetch source or source maps from 127.0.0.1 despite typically being on the same host (indeed, process) as Metro.

This causes a surprising inconsistency where using a bundler URL of `localhost` from the device results in source maps being inlined into `Debugger.scriptParsed`, but using a bundler URL of `127.0.0.1` causes inspector-proxy to fall back to preserving URLs, which are typically fetched lazily by CDT later.

This should be unnecessary once we've implemented CDP `Network.loadNetworkResource` and removed `Debugger.scriptParsed` rewriting, but for now it brings IPv6 tunnelled servers in line with local servers.

Changelog:
[General][Changed] Inspector proxy: Rewrite 127.0.0.1 to localhost in source map URLs for better IPv4->IPv6 tunnelling support.

Reviewed By: motiz88

Differential Revision: D56138742

fbshipit-source-id: b65c9cc8225a0ed54cf32171f640ef9e6408c762
2024-04-16 03:00:13 -07:00
Alan LeeandFacebook GitHub Bot 47c6311422 fix issue with PopupMenuAndroid event (#44103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44103

Changes here fixes events in PopupMenuAndroid not being triggered correctly.

Issuses were:
1) naming mismatch
2) wrong parameters were set for the Event Map
3) missing code in .cpp

Applied fixes:
1) consistent event naming
2) fixed key used for event mapping
3) re-ran codegen to update .cpp files

## Changelog:

[Android] [internal] - Fix issue with PopupMenuAndroid event callback not working

Steps took to run codegen for this diff: https://www.internalfb.com/intern/phabricator/paste/markdown/P1214671854/

This diff is patching issues from D55531870

Reviewed By: RSNara

Differential Revision: D56164235

fbshipit-source-id: 4cf66ad3cfd753c146c5e219f27910834731e183
2024-04-16 00:27:57 -07:00
Soe LynnandFacebook GitHub Bot 0c6fd0a86b Implement Percentage support for gap styles (#44067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44067

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

X-link: https://github.com/facebook/yoga/pull/1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340

fbshipit-source-id: c0bc86ac70a1391f115c87da99c2ef411535f68b
2024-04-15 16:44:16 -07:00
Nick GerlemanandFacebook GitHub Bot d1e8328f7e Add QualifierAlignment to Clang Format Config (#44098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44098

This sets `QualiferAlignment` so that code is automatically formatted to west const.

I did a pass at this before, but now that we are on new Clang Format, we can enforce it automatically, and I think a couple more cases not previously changed now are.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56143678

fbshipit-source-id: 8f12b288476ea6019fd7d7a93a39b4fe2e75af14
2024-04-15 16:03:26 -07:00
Andrew DatsenkoandFacebook GitHub Bot d53a2bd4a2 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast:toastAndroid (#44100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44100

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56138594

fbshipit-source-id: a3010e4d99e5ba9948c7214d546461cbbf959851
2024-04-15 14:09:52 -07:00
Ruslan LesiutinandFacebook GitHub Bot e7154bdd9b upgrade[react-devtools]: v5.1.0 (#44093)
Summary:
X-link: https://github.com/facebook/flipper/pull/5575

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

# Changelog: [Internal]

Bump `react-devtools-*` packages to 5.1.0.

allow-large-files

Reviewed By: motiz88

Differential Revision: D56141042

fbshipit-source-id: 33ae0351dd1db21002d6323addd51ad98d86e3c3
2024-04-15 13:30:07 -07:00
Pieter De BaetsandFacebook GitHub Bot 5e7f74d3a2 Support more stubbed methods in BridgelessCatalystInstance (#44091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44091

These can be stubbed easily using existing ReactHostImpl/ReactInstance API's

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56139806

fbshipit-source-id: cefabe3aa0fb6556f8e296243ff233df07ddffee
2024-04-15 12:46:50 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6dd83cbb35 Backport fix for Ccache from 0.74 to main (#44089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44089

While doing the release of 0.74.0-RC.9, we encountered some failures while building because the committed project had some new flags that have been added by cocoapods and that required Ccache.

However, Ccache is not a hard requirement to run React Native and the build started failing on systems that does not have ccache installed.
That happened because we were missing the piece of code that removed Ccache from the project in case the tool is not installed in the system.

We already committed such commit in the stable branch of 0.74, with [this commit](https://github.com/facebook/react-native/commit/2b18fdf8063b423a0fb5762f2c6044244b4c35e6). This change will port the same fix in main.

## Changelog
[iOS][Fixed] - Make sure to remove ccache scripts when ccache is not installed

Reviewed By: cortinico

Differential Revision: D56140015

fbshipit-source-id: 24e7ebb4e5c08766b29705e8b6f03c3f164a96ab
2024-04-15 10:11:03 -07:00
Alex HuntandFacebook GitHub Bot 5493d7dea6 Add changelog for 0.74.0-rc.9 (#44090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44090

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56141063

fbshipit-source-id: 19b1255fd8c26567b16176f8acca5768ac3f92f6
2024-04-15 09:57:02 -07:00
Rob HoganandFacebook GitHub Bot 704756352c Inspector proxy: Add ping/pong keepalive/heartbeat to debugger connection (#44086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44086

When a debugger frontend is connected to inspector-proxy via another proxy or tunnel that times out on idle (such as [VS Code's remote tunnel](https://github.com/microsoft/vscode/blob/main/src/vs/platform/tunnel/node/tunnelService.ts)), the connection between proxy and debugger may be dropped.

In addition, when the connection is dropped without a closing handshake, the proxy does *not* detect the disconnection - no disconnect is logged to the reporter and no notifications are sent to any connected devices.

This adds a mechanism using the WebSocket-standard `ping` and `pong` frames to:
1. Keep the connection alive
2. Detect when the debugger has gone away

Note that as all WebSocket clients already **must** reply to a ping with a pong, this is non-breaking for compliant implementations: https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2

Changelog:
[General][Added] Inspector proxy: Add ping/pong keepalive to debugger connections.

Reviewed By: hoxyq

Differential Revision: D56069185

fbshipit-source-id: e322de631c652a502f3d554c15ed5412a751ee04
2024-04-15 08:55:05 -07:00
Nicola CortiandFacebook GitHub Bot 718041a9e4 ReactFeatureFlags.mFabricEnabled should default to ReactFeatureFlags.enableFabricRenderer (#44087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44087

The `mFabricEnabled` field is initialized to false. This is a misalignment with how other classes are behaving like
ReactActivityDelegate.

Changelog:
[Internal] [Changed] - ReactFeatureFlags.mFabricEnabled should default to ReactFeatureFlags.enableFabricRenderer

Reviewed By: arushikesarwani94

Differential Revision: D56013057

fbshipit-source-id: fcab903ab42d3b30094dcebbcf5b662cd2f2c506
2024-04-15 07:51:50 -07:00
Nicola CortiandFacebook GitHub Bot 5d538ec105 Clarify documentation for debuggableVariants (#44040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44040

This is just a clarification for the KDoc of this property.

Changelog:
[Internal] [Changed] - Clarify documentation for debuggableVariants

Reviewed By: andrewdacenko

Differential Revision: D56012825

fbshipit-source-id: 837d2dbc0f7ca5853ba1cedf71a4a5c36661318f
2024-04-15 06:54:33 -07:00
Arushi KesarwaniandFacebook GitHub Bot 99d0c540ca Edit Changelog (#44052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44052

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56043702

fbshipit-source-id: d5e255a5d8fa12ec7cdd1d1086119142a20a29f5
2024-04-15 01:47:21 -07:00
Andres SuarezandFacebook GitHub Bot a5eeea814d Apply clang-format 18
Summary: Previously this code conformed from clang-format 12.

Reviewed By: igorsugak

Differential Revision: D56065247

fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
2024-04-14 11:28:32 -07:00
Nick GerlemanandFacebook GitHub Bot 314a919df6 Introduce "BoxShadowDrawable" for Android box shadows (#43722)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43722

This change adds a drawable, when when drawn on the bounds of a border-box sized view, will draw a spec compliant box-shadow outside the box. This is reliant on Android `RenderNode` and `RenderEffect` APIs provided by API 31.

Inset box shadows can also be added using a similar method, but this is not done yet.

The code which manages this is in flux, but the underlying drawable should be good. Will add some tests once it's more wired up.

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D55561465

fbshipit-source-id: 6180568cff2779b826e73bb9184dbe042863b262
2024-04-13 15:34:12 -07:00
Nick GerlemanandFacebook GitHub Bot c710386e72 Encapsulate border radius resolution logic (#43983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43983

We duplicate some pretty hairy code related to conversion between logical and physical edges, along with the grafting between uniform and non uniform radii. This encapsulates border radius resolution/assignment logic.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D55635743

fbshipit-source-id: 906c35af2bf18f0586d71d05f9cf61d4248ede1e
2024-04-13 15:34:12 -07:00
Nick GerlemanandFacebook GitHub Bot efc5ddd3ee Allow sigma blur without filter prop (#43721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43721

Makes some changes to `FilterHelper` to expose RenderEffects for filters publicly to other classes in the module. We use this in box-shadow, in order to reuse logic for sigma accepting blur filters.

Also fixes a crash related to the conversions back and forward between sigma and radius, where small values would cause a crash.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D55563775

fbshipit-source-id: fabc888eecb451e75a88c8633fe5cca1f6644faa
2024-04-13 15:34:12 -07:00
Nick GerlemanandFacebook GitHub Bot d7766fa927 Move background drawing code from "react/views/view" to "react/uimanager/drawable" (#43720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43720

This lets us use BG drawing code in rules which view depends on. I also removed some lib usage.

The original class is still present, subclassing the class in its new location, but is marked deprecated.

Next diffs in stack clean up some of our own now deprecated usage.

Changelog:
[Android][Breaking] - Deprecate `ReactViewBackgroundDrawable` in favor of `CSSBackgroundDrawable`

Reviewed By: javache

Differential Revision: D55565035

fbshipit-source-id: 501b3e2f674c09a88b1825657ba6349823054e8c
2024-04-13 15:34:12 -07:00
Sam ZhouandFacebook GitHub Bot 1b152f6eca Deploy v0.233.0 to xplat (#44062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44062

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D55773070

fbshipit-source-id: 685e290e27c9ea22d925fe6f8fbfaa30d0af3bb4
2024-04-12 17:25:25 -07:00
Arushi KesarwaniandFacebook GitHub Bot b72f5e9982 Implement getJavaScriptContextHolder for BridgelessCatalystInstance (#44054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44054

Implement `getJavaScriptContextHolder()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getJavaScriptContextHolder()` for Bridgeless Catalyst Instance

Reviewed By: christophpurrer

Differential Revision: D56046452

fbshipit-source-id: b7fed1da3064608d8ef5fa84f4e53a4f7a84cba7
2024-04-12 12:55:05 -07:00
Arushi KesarwaniandFacebook GitHub Bot 6a5aaad9e0 Implement getRuntimeExecutor for BridgelessCatalystInstance (#44053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44053

Implement `getRuntimeExecutor()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getRuntimeExecutor()` for Bridgeless Catalyst Instance

Reviewed By: christophpurrer

Differential Revision: D56046398

fbshipit-source-id: b9f947cf6f83ce7c1d334558a11b76fccab45dbd
2024-04-12 12:35:43 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 18916f391a Fix Open Debugger dev menu item missing from iOS Bridgeless
Summary:
After a [recent change](https://github.com/facebook/react-native/commit/90296be1d4fab09a52e02dd09f34f819136d0a07) we break part of the integration with the debug menu, which is was using the presence/absence of the bridge to decide whether we were in bridge or bridgeless.

For backward compatibility reasosn, the bridge ivar is now populated with the bridgeProxy, so just checking whether is nil or not is not enough to verify whether we are in bridge or in bridgeless mode anymore.

## Changelog:
[iOS][Fixed] - Make sure that the Open Debugger appears in bridgeless mode

Reviewed By: fkgozali

Differential Revision: D56067897

fbshipit-source-id: e2501ed730ff35bc755c24ef400130c551032e28
2024-04-12 11:37:41 -07:00
zhongwuzwandFacebook GitHub Bot 776f90024f Change bridgeless check in dev menu (#43976)
Summary:
We would set the value of  _bridge ivar to bridgeProxy for turbo module in bridgeless mode in https://github.com/facebook/react-native/issues/43757 , so we need to change the way of bridgeless/bridge check.

## Changelog:

[IOS] [FIXED] - Change bridgeless check in dev menu

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

Test Plan: Dev menu shows bridgeless/bridge mode correctly.

Reviewed By: christophpurrer

Differential Revision: D56056640

Pulled By: cipolleschi

fbshipit-source-id: 1358c3027c1d5f12c70dd4486cc1d5975c7a185a
2024-04-12 09:56:16 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 214a1e0722 Kotlinify DevSupportManager interface (#44056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44056

## Changelog:
[Internal] -

Was looking into how devsupport is exactly implemented on different platforms (in the context of doing it for a new platform) and figured I may just well convert this to Koltin in the process (helped to understand inner working details as well).

Reviewed By: christophpurrer

Differential Revision: D56058560

fbshipit-source-id: 1e2ffcec480c5fa3fd8b6494c29a0db6f94aec78
2024-04-12 09:40:31 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot b15d438498 Convert interfaces inside devsupport/interfaces to Kotlin (#44055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44055

## Changelog:
[Internal] -

Was looking into how devsupport is exactly implemented on different platforms (in the context of doing it for a new platform) and figured I may just well convert this to Koltin in the process (helped to understand inner working details as well).

Reviewed By: christophpurrer

Differential Revision: D56052137

fbshipit-source-id: 25280a57f46bec95dc1437ea6eb2eef08332797f
2024-04-12 09:40:31 -07:00
Andrew DatsenkoandFacebook GitHub Bot a666718879 Make OverrideColorScheme fun interface (#44059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44059

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56062919

fbshipit-source-id: 3181608ae6be5250831ce2d2f22ab2a424409168
2024-04-12 09:26:30 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 72a78d674c Fix unsafe downcasting in ShadowTree::emitLayoutEvents (#44058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44058

## Changelog:
[Internal] -

This was revealed when running an ASAN build on MacOS - we were doing an unsafe downcast from `LayoutableShadowNode->ViewShadowNode` inside `ShadowTree::emitLayoutEvents`.

Which, even though incidentally worked, is generally unsafe, as we may get e.g. `ImageShadowNode` there, which doesn't inherit from `ViewShadowNode`.

That downcast to `ViewShadowNode` wasn't even required, to begin with, as all the needed information can be already extracted from the `LayoutableShadowNode` itself.

Reviewed By: christophpurrer, javache

Differential Revision: D56062334

fbshipit-source-id: 08d5b3f5e0c57dc51b051d23506c7933581fea29
2024-04-12 09:21:15 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 5aea518d88 feat: allow use of RCTRootViewFactory from Swift (#43590)
Summary:
The goal of this PR is to allow the usage of `RCTRootViewFactory` from Swift. The issue with `RCTTurboModuleManager.h` is that it uses C++ in its header file, which is not allowed in Swift, making this initializer unavailable.

This PR allows users to just pass configuration + adds a nullable annotation to bundleURL.

Example usage:

```swift
import Foundation
import UIKit
import React
import React_RCTAppDelegate

main
class AppDelegate: NSObject, UIApplicationDelegate {
  var window: UIWindow?
  private var rootViewFactory: RCTRootViewFactory?

  func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
  ) -> Bool {

    // Create config
    let config = RCTRootViewFactoryConfiguration(
      bundleURL: self.bundleURL(),
      newArchEnabled: true,
      turboModuleEnabled: true,
      bridgelessEnabled: false
    )

    // Create rootview factory
    rootViewFactory = RCTRootViewFactory(configuration: config)

    // Create rootview
    let rootView = rootViewFactory?.view(withModuleName: "RN0740RC4")
    let rootViewController = UIViewController()
    rootViewController.view = rootView

    // Create window and assign view controller
    window = UIWindow(frame: UIScreen.main.bounds)
    window?.rootViewController = rootViewController;
    window?.makeKeyAndVisible()

    return true
  }

  func bundleURL() -> URL? {
    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
  }
}
```

## Changelog:

[IOS] [FIXED] - Allow usage of `RCTRootViewFactory` from Swift

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

Test Plan: CI Green, check usage of initializer without turbo module delegate

Reviewed By: christophpurrer

Differential Revision: D56055938

Pulled By: cipolleschi

fbshipit-source-id: c80d9f7f707c376f590f3dc4c9bb8f88f2e57e6a
2024-04-12 09:20:47 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 18f0a90358 Properly recycle RCTPullToRefreshViewcomponentView (#44047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44047

This change properly recycles the RCTPullToRefreshViewComponentView so that it fixes some misbehaviors of the UIRefreshControl in OSS.

This should fix https://github.com/facebook/react-native/issues/37308 and https://github.com/facebook/react-native/issues/36173

## Changelog:
[iOS][Fixed] - Properly recycle the RCTPullToRefreshViewComponentView

Reviewed By: sammy-SC

Differential Revision: D56018924

fbshipit-source-id: 3c71328aa0f6fb2a98a19593f0f06419e04e9cae
2024-04-12 08:08:19 -07:00
Fabrizio CucciandFacebook GitHub Bot 7131f94895 Revert D55964787: Push ReactContext logic in derived classes
Differential Revision:
D55964787

Original commit changeset: b404efe0c709

Original Phabricator Diff: D55964787

fbshipit-source-id: 0742b9aa870a08fed603cf6f33774d4813f5050c
2024-04-12 06:11:04 -07:00
Dmitry RykunandFacebook GitHub Bot b7812a8b6c Fix race condition in native module invalidation (#44048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44048

This is an attempt to fix a couple of similar memory corruption crashes that happen during the deallocation of RCTHost.

**Hypotheis:** there is a race condition between [this](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm#L1038-L1058) and [this](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm#L1062) chunks of work.
I.e. let's say we are invalidating 10 modules. Because of the race condition it is possible that we call `dispatch_group_enter`/`dispatch_group_leave` for the first five before we call `dispatch_group_enter` for the sixth one. In that case we would resume at [dispatch_group_wait](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm#L1079), not waiting for the remaining modules to invalidate. That would lead to `RCTInstance` potentially being invalidated prematurely, deallocating all its ivars including `_turboModuleManager` and `_jsThreadManager`. That in turn would lead to memory access error during the invalidation of remaining modules.

This diff is trying to solve this problem by calling `dispatch_group_enter` for all modules before any other work is performed.

Changelog: [iOS][Fixed] - Fixed race condition in native module invalidation.

Reviewed By: cipolleschi

Differential Revision: D55965290

fbshipit-source-id: 0c2b5957371bf3573155cee687c661603da162de
2024-04-12 03:17:12 -07:00
Moti ZilbermanandFacebook GitHub Bot 91d3bc5be6 Update CDPAgent reentrancy test to cover evaluate ordering
Summary:
Changelog: [Internal]

With the Hermes fix in D55250610, we're able to make stronger assertions in `CDPAgentReentrancyRegressionTest`, which is an integration test covering a class of related bugs.

bypass-github-export-checks

Reviewed By: mattbfb

Differential Revision: D55962593

fbshipit-source-id: 09d03effc51d6f1904842f1c7c2f7e4407fefc63
2024-04-12 03:10:16 -07:00
Samuel SuslaandFacebook GitHub Bot 2ef59c988d move to unified feature flag system for new state reconciliation algorithm (#44022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44022

changelog: [internal]

move the new state reconciliation algorithm to the unified feature flag system.

Reviewed By: rubennorte

Differential Revision: D55965530

fbshipit-source-id: 3edde0858a670e86dc2d1cb561f03f584ff21896
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot 4d9b11b45d Introduce new State Alignment Mechanism (#44021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44021

changelog: [internal]

This is an evolution of cloneless state progression, introduced in D49012353.

# Problem

## When React clones the wrong node revision
Whenever React wants to commit a new change, it first needs to clone shadow nodes. React sometimes clones from the wrong revision. This has mostly been fine, Fabric does state reconciliation to pass newest state forward. State reconciliation is needed, as we need to keep native state in the shadow tree.
However, when React clones a node that has never been through layout step, it will clone a node without any layout information and its yoga node is dirtied. Even though there might be a subsequent revision of the node with layout information already calculated. As a result, Yoga needs to traverse bigger parts of the tree, even though layout has been calculated before. It is just cached on a different revision that was used as a source.

There are two main sources (there is more but they don't help to paint the picture) when this can happen. Background Executor and State Progression. Let's start with the simpler one but less severe: Background Executor.

Background Executor moves layout from JavaScript thread. React can start cloning nodes right away, even though they might not have layout information calculated yet. This is a race condition and depending on when the node is cloned, we can see different results. In this case, React eventually clones node from the correct revision with the layout cache. It will be in a correct state in the end. This case is not as bad as far as I can tell but I included it here because it better illustrates what is going on.

State Progression is where things get worse. In this scenario, React will never clone from the correct revision and will never recover from this. Anytime React clones node with a state that needs to be progressed, it will get cloned one more time during commit but React will hold the wrong revision. Depending on where this node is located in the view hierarchy, it may lead to expensive layout calculations.

Example:
Let's use notation A/r1 as node of family A revision 1.

- React calls create node. Node A/r1 is created and React holds reference to this. It will later use it to clone it.
Node A has native state that was updated. New revision A/r2 is created. Now React and RN do not observe the same node anymore (this is sometimes necessary).
- React now clones node A to create A/r3. This revision may have the wrong yoga cache. Now this might sound like one off but let's explore what happens next.
- During commit, Fabric must do state progression to give node A/r3 state from A/r2. This requires cloning and new revision A/r4 is created. React has again a wrong node that does not have Yoga cache and can't recover from this state.

The blast radius of this varies depending on where in the tree the node is.

# Solution - State Alignment Mechanism
The main principle for new state progression is to make sure React references the correct shadow node after commit to avoid layout cache miss on subsequent commit.

Agenda for the diagrams below:
- Black colour: node was not cloned.
- Blue colour: node was cloned by React.
- Orange colour: node was cloned by host platform.
- Blue and Orange colour: node was cloned by both React and host platform.

## Simple cases
### Base case

 {F1483309510}

### React Cloned

 {F1483308354}

### React and host platform clone the same node

 {F1483309324}

## Medium difficulty

### React clones a different branch than host platform

 {F1483349393}

### React deletes a branch that was cloned by host platform
 {F1483349259}

### React changes structure of the tree, node cloned by host platform remains

 {F1483349758}

### React reorders nodes that were cloned by host platform

 {F1483350283}

Reviewed By: rubennorte

Differential Revision: D53405702

fbshipit-source-id: c7d4b0772c144c86d72e39965e9626a2daefa6fd
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot 223c0398fd extend StateReconciliationTests (#44020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44020

changelog: [internal]

This diff only adds more tests for state reconciliation to cover more cases.
Thanks to this, I discovered bugs in my previous implementation of cloneless state progression.

Reviewed By: rubennorte

Differential Revision: D55926491

fbshipit-source-id: 5945ba9bc1d6fed111fbca07e19589cbef50712d
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot cc40c59993 Use size_t instead of casting to int32_t (#44019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44019

changelog: [internal]

use size_t instead of int32_t so that caller of `ShadowNode::replaceChild` does not need to cast.

Reviewed By: rubennorte

Differential Revision: D55923333

fbshipit-source-id: 8f8062708d9aaddedb600aa7dac419a177e2ab24
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot 669aa1c3c2 Introduce new trait: ClonedByNativeStateUpdate (#44018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44018

changelog: [internal]

New trait ClonedByNativeStateUpdate is used to mark the path that was cloned by native state update.

This is a pre-requisite for new state reconciliation algorithm. It will mark part of shadow tree that was affected by native state update.

Reviewed By: rubennorte

Differential Revision: D55922776

fbshipit-source-id: 6d4515460346c341af3ee6117d570b3201328bc9
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot 3b49db3bfe add option to set traits when cloning up to the root (#44017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44017

changelog: [internal]

Add an option to mark all nodes clone indirectly by `ShadowNode::cloneTree`.

This is a pre-requisite for new state reconciliation algorithm. It will be used to mark part of shadow tree that was affected by native state update.

Reviewed By: rubennorte

Differential Revision: D55745323

fbshipit-source-id: 5e2a2e8a572cc5077d907608f83992a43625d58e
2024-04-12 02:47:01 -07:00
Samuel SuslaandFacebook GitHub Bot 49f7ec30d6 add option to set traits with ShadowNodeFragment (#44016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44016

changelog: [internal]

Add option to set traits when node is created or cloned via ShadowNodeFragment.

This is a pre-requisite for new state reconciliation algorithm.

Reviewed By: rubennorte

Differential Revision: D55691094

fbshipit-source-id: 0bdf024c3c9b28304969ddc9b9c63b0f0b924bb0
2024-04-12 02:47:01 -07:00
Max HoffmannandFacebook GitHub Bot 2b85a236a1 delete deprecated Xcode version check (#43949)
Summary:
IOS builds started failing due to Xcode version checks falsely claiming newer versions are not installed

TODO affecting Xcode version checking reads: Remove this code after April 2024, when Apple will push the lower version of Xcode required to upload apps to the Store.

## Changelog:

remove deprecated Xcode version check

Pick one each for the category and type tags:

[IOS] [REMOVED] - Message

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

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

Test Plan: Should run as before, only the deprecated version check has been removed.

Reviewed By: dmytrorykun

Differential Revision: D56056701

Pulled By: cipolleschi

fbshipit-source-id: 47288e04bd1cfc989cf05994cb47421fd2379af0
2024-04-12 02:46:04 -07:00
Fabrizio CucciandFacebook GitHub Bot 05ef779c0b Push ReactContext logic in derived classes (#44026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44026

Changelog: [Android][Removed] Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead.

Yet another attempt to land this (last one was D55505416).

Copy-pasting below the amazing summary from RSNara.

## Context
Prior, ReactContext used to implement bridge logic.

For bridgeless mode, we created BridgelessReactContext < ReactContext

## Problem

This could lead to failures: we could call bridge methods in bridgeless mode.

## Changes
Primary change:
- Make all the react instance methods inside ReactContext abstract.

Secondary changes: Implement react instance methods in concrete subclasses:
- **New:** BridgeReactContext: By delegating to CatalystInstance
- **New:** ThemedReactContext: By delegating to inner ReactContext
- **Unchanged:** BridgelessReactContext: By delegating to ReactHost

## Auxiliary changes
This fixes ThemedReactContext in bridgeless mode.

**Problem:** Prior, ThemedReactContext's react instance methods did not work in bridgeless mode: ThemedReactContext wasn't initialized in bridgeless mode, so all those methods had undefined behaviour.

**Solution:** ThemedReactContext now implements all react instance methods, by just forwarding to the initialized ReactContext it decorates (which has an instance).

NOTE: Intentionally not converting `BridgeReactContext` to Kotlin to minimize the risk of these changes.

Reviewed By: RSNara

Differential Revision: D55964787

fbshipit-source-id: b404efe0c7095894fa815165cc8682f78dccfa17
2024-04-12 01:47:52 -07:00
Samuel SuslaandFacebook GitHub Bot b4f9aa1479 fix sticky header with tappable element (#44046)
Summary:
X-link: https://github.com/facebook/react-fbsource-import/pull/5

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

changelog: [internal]

`passthroughAnimatedPropExplicitValues` from sticky header were removed in D46703731 with assumption that native animations trigger on complete callback and it can be used as a synchronisation point for Fabric.
On complete callback is triggered for native animations do trigger on complete callback with one exception: when the native animation is driven by scroll view's content offset.
As a result, synchronisation between React and Fabric doesn't happen and Pressability stops working if there is a pressable element in the sticky header.

Reviewed By: rubennorte

Differential Revision: D56005408

fbshipit-source-id: daead3a566e157593aa3f1b3ae3553ec1094b6da
2024-04-12 01:35:07 -07:00
Ruslan LesiutinandFacebook GitHub Bot aacde17954 Fusebox/RDT: setup global for Fusebox React DevTools dispatcher (#43418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43418

Changelog: [Internal]

This diff adds a script, which will be later imported from `InitializeCore` to setup a required global for communication between React Native runtime (RDT Backend in it) and Chrome DevTools Frontend (RDT Frontend in it).

See README for the architecture overview and how bidirectional communication is established.

Corresponding PR in Chrome DevTools frontend - https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/15

Reviewed By: motiz88

Differential Revision: D54770207

fbshipit-source-id: 0f0f04a338b5c7eab817c843a99b07cca95e57fd
2024-04-12 01:14:22 -07:00
Sam ZhouandFacebook GitHub Bot 78d523d178 Fix type errors that will be exposed in future versions of Flow (#44049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44049

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D56036891

fbshipit-source-id: e7771d51bd8797c7237a66b499e1e6e082b8912d
2024-04-11 16:28:25 -07:00
D NandFacebook GitHub Bot 401f2fbb14 chore: [TS] Transform TouchableHighlight from class to ForwardRef component (#44038)
Summary:
If you check the source of truth `packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js` I'll find that `TouchableHighlight` is a result of `React.forwardRef(...)` :

https://github.com/facebook/react-native/blob/44d59ea6f9a1705487314e33de52f7056651ba25/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js#L382-L391

So the TS type isn't correct : (

```tsx
<TouchableHighlight ref={ref => {   }} />
//                     ^^^ ref should be a `View` (but now it's `TouchableHighlight`)
```

 ---

**Breaking  changes**

As `TouchableHighlight` isn't class anymore it can't be used as value & type

```tsx
import {TouchableHighlight} from 'react-native';
const ref = useRef<TouchableHighlight>();
//                ^^^ TS2749: TouchableHighlight refers to a value, but is being used as a type here.
//                            Did you mean typeof TouchableHighlight?
```

**Recommend solution:** use build-in react type `React.ElementRef`

```diff
-const ref = useRef<TouchableHighlight>();
+const ref = useRef<React.ElementRef<typeof TouchableHighlight>>();
```

Also, it possible to use `View` as type:

```diff
-const ref = useRef<TouchableHighlight>();
+const ref = useRef<View>();
```

## Changelog:

[GENERAL] [BREAKING] - [Typescript] Transform TouchableHighlight from JS class to ForwardRef component

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

Test Plan: See: `packages/react-native/types/__typetests__/index.tsx`

Reviewed By: NickGerleman

Differential Revision: D56015309

Pulled By: dmytrorykun

fbshipit-source-id: fee346536787a5921626ed69a4c01da2b599dc2f
2024-04-11 14:21:55 -07:00
D NandFacebook GitHub Bot 3d00549399 chore: [TS] Transform TouchableOpacity from class to ForwardRef component (#44030)
Summary:
If you check the source of truth `packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js` I'll find that `TouchableOpacity` is a result of `React.forwardRef(...)` :

https://github.com/facebook/react-native/blob/f7eaf63881b23216c06ab3c81ea94d0312cd6a7b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js#L326-L335

So the TS type isn't correct : (

```tsx
<TouchableOpacity ref={ref => {   }} />
//                     ^^^ ref should be a `View` (but now it's `TouchableOpacity`)
```

 ---

**Breaking  changes**

As `TouchableOpacity` isn't class anymore it can't be used as value & type

```tsx
import {TouchableOpacity} from 'react-native';
const ref = useRef<TouchableOpacity>();
//                ^^^ TS2749: TouchableOpacity refers to a value, but is being used as a type here.
//                            Did you mean typeof TouchableOpacity?
```

**Recommend solution:** use build-in react type `React.ElementRef`

```diff
-const ref = useRef<TouchableOpacity>();
+const ref = useRef<React.ElementRef<typeof TouchableOpacity>>();
```

Also, it possible to use `View` as type:

```diff
-const ref = useRef<TouchableOpacity>();
+const ref = useRef<View>();
```

## Changelog:

[GENERAL] [BREAKING] - [Typescript] Transform `TouchableOpacity` from JS `class` to `ForwardRef` component

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

Test Plan: See: `packages/react-native/types/__typetests__/index.tsx`

Reviewed By: NickGerleman

Differential Revision: D56017133

Pulled By: dmytrorykun

fbshipit-source-id: 58f4c1a14c9b3bd2407ea6c825a90b355acb16bb
2024-04-11 14:15:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 46b6453eb6 Fix the Redefinition of 'NativeXXXSpecJSI' error with Frameworks (#44005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44005

When using frameworks on iOS, there is a possibility that modules import the Spec.h file twice and this might end up in a Redefinition of some symbols and duplication of symbols which ends up in build errors, as reported here: https://github.com/facebook/react-native/issues/42670.

This change adds some [`#include guards`](https://en.wikipedia.org/wiki/Include_guard) in codegen to avoid the redefinition of those symbols if the header is imported/included multiple times.

Note: I also experimented with `#pragma once`, but it looks like Apple is not happy with that directive. [It seems](https://forums.developer.apple.com/forums/thread/739964) that it started working flakely from Xcode 15.

## Changelog:
[General][Fixed] - Make sure that we can't include Codegen symbols multiple times

Reviewed By: cortinico

Differential Revision: D55925605

fbshipit-source-id: 15ca076aace2ffbd03ab8fa8a68a3d8ce0d1ea65
2024-04-11 11:39:43 -07:00
Sophie LandFacebook GitHub Bot 9433506465 chore(AndroidExecutors): clean up outdated compat function (#43958)
Summary:
this PR cleans up an outdated compatibility function in AndroidExecutors. the function in question was checking whether the code was running on Gingerbread or later - this is no longer needed, as RN requires Marshmallow or later.

## Changelog:

[INTERNAL] [FIXED] - Clean up outdated compatibility function

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

Test Plan: this should work as normal.

Reviewed By: cortinico

Differential Revision: D55877661

Pulled By: dmytrorykun

fbshipit-source-id: 02eac50b0898d683f6abf731bf8e438ae4219a41
2024-04-11 10:41:54 -07:00
Samuel SuslaandFacebook GitHub Bot 77efd191a8 use availableSize instead of measure result for measureLines (#43979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43979

changelog: [internal]

using `availableSize` instead of `measurement` to avoid dependency on calling `textLayoutManager_->measure` before dispatching `onTextLayout` event.
This is important in subsequent optimisation.

Reviewed By: javache

Differential Revision: D55796594

fbshipit-source-id: 06b516e2afaf668c6359ad86b570229824933bae
2024-04-11 10:00:25 -07:00
hurali97andFacebook GitHub Bot 5e9ed14cb1 Changelog: 0.71.18 (#44008)
Summary:
## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

Changelog: [Internal] Generated changelog

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

Reviewed By: christophpurrer

Differential Revision: D56017161

Pulled By: dmytrorykun

fbshipit-source-id: 512c576a055a17b37a1f9fd5e328a1ff5165b398
2024-04-11 08:50:56 -07:00
Blake FriedmanandFacebook GitHub Bot affadb6da8 core-cli-utils - Added version information
Summary:
Using version information previously housed in react-native-communtiy/cli

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55960009

fbshipit-source-id: 38f8b2310942a9337a7b64b51a87ae629d9bbbaf
2024-04-11 07:59:01 -07:00
Fabrizio CucciandFacebook GitHub Bot e14e6ce2a1 Fix rn-tester label color in drawer example (#44039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44039

Changelog: [Internal]

Get label color from theme to fix dark mode.

Reviewed By: NickGerleman

Differential Revision: D56011777

fbshipit-source-id: 3ef14d6437c51118f0c0db3950b24f7e71d33fb3
2024-04-11 07:45:10 -07:00
Samuel SuslaandFacebook GitHub Bot 840fd30194 delete text measure cache experiment (#43914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43914

changelog: [internal]

This QE with caching text measurement and NSTextStorage did not deliver the desired results. Let's remove the code to simplify the text measure infra.

Reviewed By: javache

Differential Revision: D55753670

fbshipit-source-id: b194c4ca1eded70b0d00da748716628c264a47b9
2024-04-11 05:47:41 -07:00
Andrew DatsenkoandFacebook GitHub Bot 88c7391485 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/appstate:appstateAndroid (#43938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43938

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55726807

fbshipit-source-id: 7338ee8949c05e192c47c6c06e999600dfad07a9
2024-04-11 05:25:47 -07:00
Blake FriedmanandFacebook GitHub Bot b530371b7f react-native-info - clean up licenses + docs
Summary:
Capturing the correct attribution in the licenses as well as adding some documentation.

I think the code will have changed significantly enough across the files that once we change to flow, we can drop the attribution in the files but leave the mention in the README.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D55752899

fbshipit-source-id: b436d745d5ad439661d2af840b2cc8df4bff0038
2024-04-11 05:16:46 -07:00
Samuel SuslaandFacebook GitHub Bot 564f86ef92 add .gitignore for rn-tester build artifacts (#44041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44041

changelog: [internal]

Building rn-tester left artifacts that would be picked up by mercurial.

```
❯ hg s
? rn-tester.xcodeproj.local/Project Settings.plist
? rn-tester.xcodeproj.local/Project Settings.plist.lock
```

To mitigate this, add  `rn-tester.xcodeproj.local` introduce .gitignore for rn-tester.

Reviewed By: fabriziocucci

Differential Revision: D56006193

fbshipit-source-id: 5701f1adf395e98f84ca59574dbd8747cf7e85db
2024-04-11 04:53:08 -07:00
Mohamed MoussaandFacebook GitHub Bot 08ecdee71c Fix missing setLeftTopRightBottom method (#44033)
Summary:
We were seeing errors due to `setLeftTopRightBottom` being called without a check for the Android version despite that method [being added in Android API level 29](https://developer.android.com/reference/android/view/View#setLeftTopRightBottom(int,%20int,%20int,%20int)). I've replaced it with the older API methods to fix the issue.

This issue originates from https://github.com/facebook/react-native/pull/38526

## Changelog:

[ANDROID] [FIXED] - Resolved error "No virtual method setLeftTopRightBottom"

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

Test Plan: Change is pretty trivial, but we tested it in our production app ([Tarteel](https://www.tarteel.ai/)) for a week and confirmed that the error is resolved.

Reviewed By: cortinico

Differential Revision: D56002098

Pulled By: NickGerleman

fbshipit-source-id: ff97d0be2703006b14c865dd148e40eb10069acb
2024-04-11 04:28:07 -07:00
Nick GerlemanandFacebook GitHub Bot 44d59ea6f9 Make new nodes dirty by default (#44010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44010

X-link: https://github.com/facebook/yoga/pull/1641

Yoga has quirk where newly constructed nodes are clean, which isn't really correct. Normally never shows in in real code because setting a style or children  will dirty. Fabric doesn't use the public APIs that do this dirtying, so it ends up getting creative instead.

We should fix so that newly constructed nodes are dirty. Copy-constructed Nodes (also only a Fabric thing, will retain original dirty flag.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D55855328

fbshipit-source-id: be49efaf8ac29351f8e5ec509bd9912546944332
2024-04-10 22:15:25 -07:00
Fabrizio CucciandFacebook GitHub Bot 3098613f6e Fix ReactImagePropertyTest (#44028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44028

Changelog: [Internal]

While testing something completely unrelated (i.e. D55964787), I've noticed that [test_android](https://github.com/facebook/react-native/actions/runs/8635097933/job/23673157303?pr=44026) actually failed on Github with this error:

> Task :packages:react-native:ReactAndroid:compileDebugUnitTestKotlin
e: file:///__w/react-native/react-native/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/image/ReactImagePropertyTest.kt:62:38 Smart cast to 'CatalystInstance' is impossible, because 'catalystInstanceMock' is a mutable property that could have been changed by this time

Reviewed By: RSNara

Differential Revision: D55982797

fbshipit-source-id: a49e766ae95e22603293326da93007d78250da6a
2024-04-10 15:45:16 -07:00
Biki-dasandFacebook GitHub Bot f7eaf63881 - added combining animted values example to the animated api example list (#43435)
Summary:
Added an example to add ```combining``` values with the animated API

## Changelog:

[General] [Added] - Add examples for Combining Animated Values with the Animated API

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

Test Plan:
https://github.com/facebook/react-native/assets/72331432/c4a0c1e2-df9d-4e73-8602-e4550a22b8dc

https://github.com/facebook/react-native/assets/72331432/d2f1196e-68b0-49d4-8d3d-2c53ee30652b

Reviewed By: cortinico

Differential Revision: D55917557

Pulled By: hoxyq

fbshipit-source-id: d4214323f2a8823b1b3fe0c8d90a7518d0953b48
2024-04-10 10:55:17 -07:00
Alan LeeandFacebook GitHub Bot 244eb42b33 add back @Deprecated in ViewUtil (#44011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44011

Add back `Deprecated` annotation which was removed in D55651762

Changelog:
[Internal] internal

Reviewed By: javache

Differential Revision: D55955345

fbshipit-source-id: bc255983a57fa01e63b17400079cf4215de9a41f
2024-04-10 09:43:04 -07:00
Nicola CortiandFacebook GitHub Bot 80aa714630 Move reactperfloggerjni to INTERFACE library (#43998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43998

Another library with an empty JNI_OnLoad method.
Moving it to `INTERFACE` so it exposes only the Header it has declared.
This removes the `libreactperfloggerjni.so` from the final APK.

Changelog:
[Internal] [Changed] - Move reactperfloggerjni to INTERFACE library

Reviewed By: javache

Differential Revision: D55919228

fbshipit-source-id: 634f4f6013825b0de8827b3143a012e6c880509d
2024-04-10 09:19:26 -07:00
Nicola CortiandFacebook GitHub Bot 3f2b1d732f Add changelog for v0.74.0-rc.8 (#44024)
Summary:
Add changelog for v0.74.0-rc.8

## Changelog:

[INTERNAL] - Add changelog for v0.74.0-rc.8

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D55967400

Pulled By: cortinico

fbshipit-source-id: 0b76a5e3187c8c9c4027fe6a0f04db8864630271
2024-04-10 08:04:01 -07:00
Andrew DatsenkoandFacebook GitHub Bot c8d5f0f1aa //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/appearance:appearanceAndroid (#44006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44006

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725334

fbshipit-source-id: 4d7ad2bb6395674d47fd5e3cd01a8515627f6cd4
2024-04-10 07:45:57 -07:00
Rubén NorteandFacebook GitHub Bot b9a2249fff Implement potential fix for mounting errors during synchronous state updates (#44015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44015

Changelog: [internal]

## Context

When we introduced synchronous state updates in Fabric, we saw some crashes on coming from the mounting layer on Android.

It seems some of these crashes are caused by nested mount operations. When we're mounting some views, like [scroll views](https://github.com/facebook/react-native/blob/881c0bc8970b9e402df6b4f87e1759b238b24735/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java#L383), we dispatch state updates that end up doing more mutations. When we were doing these state updates asynchronously, all the original mutations were processed before these updates, but now that we do them synchronously, the mutations are interleaved causing errors.

## Changes

This introduces a new flag that will force all the mutations going through `MountItemExecutor` in `FabricUIManager` to be batched instead of executed synchronously. This fixes the issues I saw locally and I'm expecting this will unblock synchronous state updates in production.

Potentially, this might fix other crashes we've been seeing with a low frequency.

Reviewed By: sammy-SC

Differential Revision: D55942125

fbshipit-source-id: b8d9c145ec307de7318dbbed14880bc9a84fdb2a
2024-04-10 07:44:11 -07:00
Andrew DatsenkoandFacebook GitHub Bot 54757ca017 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper:imagehelperAndroid (#44001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44001

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D55725532

fbshipit-source-id: 5fa4e774247e79b0e43d04f58dcb150d682de090
2024-04-10 07:41:29 -07:00
Rubén NorteandFacebook GitHub Bot ea566ad70d Remove unnecessary systrace section from UIManagerBinding (#44003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44003

Changelog: [internal]

This systrace section isn't providing any value, as the durations are always negligible.

Reviewed By: christophpurrer

Differential Revision: D55921320

fbshipit-source-id: 95e1de3359ecc0cde3e913b6f77b567cdd126214
2024-04-10 05:50:30 -07:00
Moti ZilbermanandFacebook GitHub Bot 403bbae1f2 Stub support for Tracing start/end methods and events (#44004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44004

Changelog: [Internal]

Adds the minimal boilerplate needed to support taking an (empty) recording using Chrome DevTools's Performance panel.

Reviewed By: hoxyq

Differential Revision: D55925170

fbshipit-source-id: 8f5048bd545be3ef410b794573ef7b7bc92f73cc
2024-04-10 04:04:12 -07:00
Moti ZilbermanandFacebook GitHub Bot 27ef6cdbaf Update debugger-frontend from b0a76fa...864bc72 (#44013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44013

Changelog: [Internal] - Update `react-native/debugger-frontend` from b0a76fa...864bc72

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

Reviewed By: hoxyq

Differential Revision: D55957651

fbshipit-source-id: a3a18bd18b729cef6f645eeeb0ab77771d6f1202
2024-04-10 02:29:39 -07:00
Soe LynnandFacebook GitHub Bot f6b9a42985 Deprecate react_native_image_logging GK (#44009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44009

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

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

Clean up RCTImageLoadingPerfInstrumentationEnabled as GK is 100%

Changelog:
[iOS][Breaking] Remove unused RCTImageLoadingPerfInstrumentationEnabled

Reviewed By: philIip

Differential Revision: D55769009

fbshipit-source-id: c99a7b7076597e65acc0ba97f5a4846719688401
2024-04-09 17:47:25 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 881c0bc897 Unify DevLoadingView code on JS side to be platform-independent (#43992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43992

# Changelog:
[Internal] -

While looking into implementing native DevLoadingView on non-Android/iOS platform, I realized that the current code inside `LoadingView.android.js`/`LoadingView.ios.js` is functionally identical, and can be transformed into each other with simple code transformations.

This diff:
* Renames `LoadingView` into `DevLoadingView` (as it's arguably more fitting name, given that it also relies on `NativeDevLoadingView` native module implementation)
* Merges the iOS/Android specific JS files into one
* Factors usage of the colors out of the actual logic, to better separate presentation from the business logic

From the perspective of public APIs there should be no changes.

Reviewed By: christophpurrer

Differential Revision: D55914787

fbshipit-source-id: 656311db80e5ee03f60ee7ffcf5f405ca99a9ce5
2024-04-09 13:21:05 -07:00
Dmitry RykunandFacebook GitHub Bot 1cb0a3342a Add react-native-test-library package (#43068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43068

This diff adds `react-native-test-library` package.
It contains native module and native component example, and targets both the new and the old architecture. It has structure similar to many OSS React Native libraries, and is supposed to be used to test the integration with third-party libraries.

It is integrated with RNTester as the **OSS Library Example** screen.

{F1457510909}

**Change Background** tests native commands.
**Set Opacity** tests native props.
**Get Random Number** tests native module.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D50793835

fbshipit-source-id: ff6daefab10e6e9f13049e3013f8f63cfa8a929e
2024-04-09 11:35:43 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 30d6251b78 Avoid Snapshotting Modal too often (#43995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43995

With a previous change, we started taking snapshots of the Modal every time a Fabric mounting event was happening. this might cause perf regression when a modal is presented, and there is no need to take a snapshot that often.

This change moves the snapshotting code right before the dismissal of the Modal.

## Changelog
[iOS][Changed] - Move the snapshotting code before the dismissal.

## Facebook
This should fix T179288585, T184520225

Differential Revision: D55914776

fbshipit-source-id: 6679babf7f72aef7254113497116d5482640e789
2024-04-09 11:32:46 -07:00
Nicola CortiandFacebook GitHub Bot a25004c86c Fix bridge mode by constructing ReactDelegate correctly. (#43999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43999

Currently NewArch-BridgeMode is partially broken when creating views via `ReactDelegate`.
That's because we're using the ctor that doesn't account for `Boolean: fabricEnabled`.

That means that the `RootView` that it will be created are all having setIsFabric(FALSE).
This is causing problems like whitescreens on several reload + multiple warnings such as:
```
                         E  com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager because the context doesn't contain an active CatalystInstance.
```

Fixes #43692

See for more context on this issues: https://github.com/facebook/react-native/issues/43692

Changelog:
[Android] [Fixed] - Fix bridge mode by constructing ReactDelegate correctly

Reviewed By: cipolleschi

Differential Revision: D55921078

fbshipit-source-id: 2c21d089a49538402d546177bcdb26c8d7d5fbc1
2024-04-09 10:10:04 -07:00
Blake FriedmanandFacebook GitHub Bot 177f2bfc8f react-native-info - added simple copy of @react-native-community's implementation
Summary:
This current consists of a bunch of TypeScript code, which will be ported to Flow in the stack.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D55741526

fbshipit-source-id: 1dc30d2ab63e0526dd6fed17ccf7cce9f57bdbee
2024-04-09 10:00:14 -07:00
Fabrizio CucciandFacebook GitHub Bot 51552e6a1e Kotlinify SoftAssertions (#43911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43911

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55797031

fbshipit-source-id: eb53ae671b0a7b5d277b931a11eb0fcd84c51a19
2024-04-09 09:10:50 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 8b8b85bb1f Fix Connect to Metro after Reload in Bridgeless mode (#43994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43994

We received [this issue](https://github.com/facebook/react-native/issues/43764) from OSS where an app can't connect to Metro on reloads in the following scenario:

* Start the App when metro does not run.
* Observe the error screen
* Start Metro
* Press Reload
* Observe the error message again

While the desired behavior should be to connect to Metro now that this is running.

The root cause of the problem is that the RCTHost is initialized with a value of the `bundleURL` that is `nil`. Upon reload, the RCTHost is **not** recreated: the instance is restarted, but with the previous `bundleURL`, which is still `nil`.

The solution is to initialize the `RCTHost` with a closure that re-evaluate the `bundleURL` whenever it is invoked and to evaluate it only on `start`, to keep the initialization path light.
This way, when the app is started with Metro not running, the `bundleURL` is `nil`. But when it is reloaded with Metro starting, the `bundleURL` is properly initialized.

Note that the changes in this diff are not breaking as I reimplemented (and deprecated) the old initializer so that they should work in the same way.

## Changelog:
[iOS][Fixed] - Let RCTHost be initialized with a function to provide the `bundleURL` so that it can connect to metro on Reload when the url changes.

Reviewed By: dmytrorykun

Differential Revision: D55916135

fbshipit-source-id: 6927b2154870245f28f42d26bd0209b28c9518f2
2024-04-09 08:54:33 -07:00
Christoph PurrerandFacebook GitHub Bot a98c54f616 iOS Remove unused RCTUIManager from RCTRootView (#43978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43978

Changelog: [Internal]

Seems to be un-used:

https://www.internalfb.com/code/search?q=filepath%3Areact-native-github%20repo%3Afbsource%20allocateRootTag

Reviewed By: javache

Differential Revision: D55874782

fbshipit-source-id: 8bea740e01942ac6684a19bd55025ea68067c4dc
2024-04-09 08:49:26 -07:00
Samuel SuslaandFacebook GitHub Bot 3e73dfb535 remove enableFixForClippedSubviewsCrash experiment (#43963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43963

changelog: [internal]

This experiment did work out. Let's clean it up

Reviewed By: cortinico

Differential Revision: D55797519

fbshipit-source-id: a5da97a7d31b9395b25bfd37db567054721599b0
2024-04-09 07:59:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 49b0d26d45 Fix Orientation listener in bridgeless mode (#43971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43971

It turns out that we forgot to add a listener for the orientation change event in Bridgeless.

We used to have `UIApplicationDidChangeStatusBarOrientationNotification` but this is slightly unreliable because there might be use cases where the status bar has been hidden and, therefore, the event is not triggered.

This should fix an issue reported by OSS.

## Changelog:
[iOS][Fixed] - Make sure that the New Architecture listens to orientation change events.

Reviewed By: cortinico

Differential Revision: D55871599

fbshipit-source-id: c9b0634ec2126aa7a6488c2c56c87a9610fa1adf
2024-04-09 07:57:54 -07:00
Rubén NorteandFacebook GitHub Bot d35de2d043 Small refactor in RuntimeScheduler_Modern to favor references over shared_ptr for non-owning function args (#43852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43852

Changelog: [internal]

Just a small refactor so we rely less on shared pointers within `RuntimeSCheduler_Modern`.

Reviewed By: javache

Differential Revision: D55646389

fbshipit-source-id: d01dcba7b1551d349d21717ba585828ed7fb3259
2024-04-09 07:51:03 -07:00
Rubén NorteandFacebook GitHub Bot d16f0f297c Decouple event logger from PerformanceEntryReporter and remove singleton (#43853)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43853

Changelog: [internal]

## Context

This is part of a refactor to decouple the performance entry reporter from the rendering infra and from the native module that uses it.

## Changes

This moves the logic to report the timing of events to a separate class (outside `PerformanceEntryReporter` that now is agnostic to the rendering infra).

Reviewed By: sammy-SC

Differential Revision: D55646392

fbshipit-source-id: 5032a36b23d0741b19fb74cb04f0af3d3d476ef0
2024-04-09 07:51:03 -07:00
Rubén NorteandFacebook GitHub Bot c61c80b5c3 Move PerformanceEntryReporter to its own target (#43854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43854

Changelog: [internal]

## Context

This is part of a refactor to decouple the performance entry reporter from the rendering infra and from the native module that uses it.

## Changes

This moves the `PerformanceEntryReporter` and related classes to their own target in `ReactCommon/react/performance/timeline` that's not coupled with any rendering logic.

Reviewed By: sammy-SC

Differential Revision: D55646391

fbshipit-source-id: a759ed39c893a0bc14246c7ee608b1727e6ee4cd
2024-04-09 07:51:03 -07:00
Rubén NorteandFacebook GitHub Bot f5c9ed1ff4 Decouple PerformanceEntryReporter from NativePerformanceObserver (#43849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43849

Changelog: [internal]

## Context

This is part of a refactor to decouple the performance entry reporter from the rendering infra and from the native module that uses it.

## Changes

This refactors `PerformanceEntryReporter` to make the class not depend on the native module that uses it. Instead of using the `RawPerformanceEntry` type from the native module, we define `PerformanceEntry` in `PerformanceEntryReporter` and use it as the source of truth in the native module instead.

Thanks to the bridging template sytem we have, we can convert the raw objects passed from JS to the C++ structs, defining how the enums are converted from and to JS.

Reviewed By: sammy-SC

Differential Revision: D55646394

fbshipit-source-id: 9cf5a7db6ecb221ca08320d0aaae7e7bc8d91804
2024-04-09 07:51:03 -07:00
Rubén NorteandFacebook GitHub Bot 0f43f86035 Add example of Event Timing API in RNTester examples (#43848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43848

Changelog: [internal]

This makes it easier to see the behavior of the new Event Timing API in RN.

Reviewed By: sammy-SC

Differential Revision: D55646393

fbshipit-source-id: 441fed789a980211783f04095303a139e7b08483
2024-04-09 07:51:03 -07:00
Rubén NorteandFacebook GitHub Bot af27d29553 Fix problems in PerformanceObserver notifications (#43847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43847

Changelog: [internal]

(This is an internal change because the API hasn't been released in OSS yet)

This fixes 2 problems in how we dispatch `PerformanceObserver` notifications:
1. If an observer callback throws an error, the remaining observers don't receive notifications.
2. We're notifying observers with an empty list of events when they don't match the filters.

Reviewed By: javache

Differential Revision: D55646390

fbshipit-source-id: 6511c7babd45517baf42076308268ea89afe1265
2024-04-09 07:51:03 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1ad3593167 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug:interfacesAndroid (#43921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43921

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725389

fbshipit-source-id: 556b6d051fb0ed6f99bf585770c18a873e4edcee
2024-04-09 07:21:45 -07:00
Andrew DatsenkoandFacebook GitHub Bot a3a5a60052 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/annotations:annotationsAndroid (#43937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43937

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55724728

fbshipit-source-id: 8536aa8eb1c8876fa1208932f5c706ef239d4212
2024-04-09 07:17:24 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot b23960ad99 Migrate TouchEvent to Kotlin (#43982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43982

## Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D55877979

fbshipit-source-id: 63ca9b403509e08632ad1a3c0aa866f6df3f423b
2024-04-09 07:01:54 -07:00
Samuel SuslaandFacebook GitHub Bot c24a9a9309 simplify StateReconciliationTest (#43993)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43993

changelog: [internal]

clean up tests. The logic is exactly the same, just renaming few variables and deleting unused ones.

Reviewed By: javache

Differential Revision: D55689499

fbshipit-source-id: fffef1051798f1787210cced5e681fa3fe47842b
2024-04-09 04:04:19 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 2fcdab47f5 Kotlinify ReactSurfaceView (#43964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43964

## Changelog:
[Internal] -

As in the title.

Reviewed By: alanleedev

Differential Revision: D55869113

fbshipit-source-id: 650304aee8aedc147b4f27b7c490fb4f64160c96
2024-04-09 02:21:18 -07:00
Alan LeeandFacebook GitHub Bot a7e9a222e7 convert DefaultStyleValuesUtil to Kotlin (#43884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43884

convert Java to Kotlin: `/react/view/text/DefaultStyleValuesUtil.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55777322

fbshipit-source-id: 4cdbc82a636cb133f486ac3e22534f12daddfcee
2024-04-08 19:43:47 -07:00
Alan LeeandFacebook GitHub Bot f5f7ba0be0 add nullability annotation for DefaultStyleValuesUtil (#43980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43980

add nullability annotation to DefaultStyleValuesUtil.java

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55784913

fbshipit-source-id: f51b4a469f7fdcf59981675344995023cd8e6bec
2024-04-08 19:43:47 -07:00
Ramanpreet NaraandFacebook GitHub Bot 37eca5d6cd Refactor: ReactInstance: Make ctor more readable (#43984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43984

Just improvemnts for readability.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55563578

fbshipit-source-id: cb0ee311091db187bb938547c335c5583243116b
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot 2e3f2268dc Refactor: JsErrorHandler: Rename JsErrorHandlingFunc -> OnJsError (#43985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43985

This is just personal preference.

The name "OnJsError" makes the intent of the abstraction clear: an instance of OnJsError is a function that gets called when a js error is caught.

The name "JsErrorHandlingFunc" is not as good.

Changelog: [General][Breaking] - JsErrorHandler: Rename JsErrorHandlingFunc to OnJsError

Reviewed By: christophpurrer

Differential Revision: D55563580

fbshipit-source-id: 4d20bc984e6633aeac6193b9276a88d76961df2c
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot c041b9f40f Refactor: JsErrorHandler: Rename handleJsError to handleFatalError (#43957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43957

Right now, JsErrorHandler is only used to handle fatal exceptions.

So, let's just scope handleJsError down to handleFatalError.

Changelog: [General][Breaking] - JsErrorHandler: Rename handleJsError to handleFatalError

Reviewed By: cortinico

Differential Revision: D55547901

fbshipit-source-id: 261e0c8fea2852bc95e53c688d90d012d4abea34
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot ba3e078c04 Refactor: ReactInstance: Pull "fatal error" bool into JsErrorHandler (#43956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43956

I think we should try to centralize all things js error handling related inside JsErrorHandler. So, I moved this bool into JsErrorHandler.

This makes ReactInstance easier to understand: it removes one member variable from ReactInstance.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55547897

fbshipit-source-id: 73d1e0eedf3896c42cda4ce1013863960585da2c
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot bffc54d19e Refactor: ReactInstance: Store JsErrorHandler inside a shared_ptr (#43955)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43955

Just makes it easier to pass around JsErrorHandler.

We'll need this in D55547897, when we start storing the "has fataled" boolean inside the JsErrorHandler.

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D55547898

fbshipit-source-id: 162faaeff43bada0301de29111b2c17f7ef878c6
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot 3382b15f08 Refactor: RuntimeScheduler: Stop defaulting ctor args redundantly (#43954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43954

Now, all the defaulting is in RuntimeScheduler.h.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55547900

fbshipit-source-id: 53678c6a0c83a47e3b0c1a51e388daadfa6bff5e
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot 3094273e8b Refactor: RuntimeScheduler: Delete ErrorUtils.h (#43953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43953

RuntimeScheduler's ErrorUtils.h is redundant.

Let's just remove it.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55547905

fbshipit-source-id: 5263c9fca8ae32bbfc672f0e16b79ee177cdd421
2024-04-08 19:36:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot 9ad71387e8 Noop: ReactInstance: Add todo above getRuntimeScheduler() (#43952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43952

getRuntimeScheduler() allows things to schedule work on the js thread by bypassing main bundle buffering.

This is unsafe: almost everything should be using the buffered runtime executor, unless it sets up bindings used in the main bundle.

I filed a task for the investigation to see if there's any problems. And added it to the code in this diff.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55547899

fbshipit-source-id: 7785b9777e93f36ea0278993332662ed45a20cf2
2024-04-08 19:36:04 -07:00
Andrew DatsenkoandFacebook GitHub Bot 379a2729f1 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview:unimplementedviewAndroid (#43970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43970

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725588

fbshipit-source-id: e7c5a9b0fad05c7de65115a69571725ce6b91640
2024-04-08 17:13:00 -07:00
Andrew DatsenkoandFacebook GitHub Bot 2c680195bc //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard:clipboardAndroid (#43861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43861

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/22517999373069959/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: cortinico

Differential Revision: D55725451

fbshipit-source-id: fea231c0f11f41013bcf7a8a9b5cf65badf82503
2024-04-08 17:11:55 -07:00
Zeya PengandFacebook GitHub Bot c3d45740cd Use semver to compare version in cli instead of custom function (#43744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43744

## Changelog:
[General] [Changed] - Use semver to do version comparison in cli instead of custom fn `parseVersion`

~~adding test for PR change in https://github.com/facebook/react-native/pull/43712~~

Reviewed By: NickGerleman

Differential Revision: D55600458

fbshipit-source-id: eaffa3e89696b90fd354aefaba79e035d180a0b5
2024-04-08 17:10:59 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1e6f5a48a6 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager:DisplayMetricsAndroid (#43981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43981

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/27021599000417439/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: cortinico

Differential Revision: D55725602

fbshipit-source-id: b8b77bf97de5a0eda5b077d6c5441b9af36fc26b
2024-04-08 16:37:57 -07:00
Andrew DatsenkoandFacebook GitHub Bot 026361ddb4 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/devloading:devloadingAndroid (#43975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43975

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725612

fbshipit-source-id: b597e906c8e2cdb571c8882e82083626a74a6d70
2024-04-08 16:09:49 -07:00
Andrew DatsenkoandFacebook GitHub Bot 5b77df0199 Update package com.facebook.react.perflogger -> com.facebook.react.reactperflogger (#43873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43873

Changelog: [Internal]
Addressing lint for package name com.facebook.react.perflogger

Reviewed By: alanleedev

Differential Revision: D55747967

fbshipit-source-id: 5d05a14e396d80f8b0bc88515333dcd708e8736a
2024-04-08 14:37:02 -07:00
Andrew DatsenkoandFacebook GitHub Bot 8c804de60c //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/share:shareAndroid (#43977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43977

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725721

fbshipit-source-id: 21f190043da053197bd5ba047122af79635f56ba
2024-04-08 14:30:15 -07:00
Andrew DatsenkoandFacebook GitHub Bot 515694663d //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry:appregistryAndroid (#43858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43858

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725317

fbshipit-source-id: eb0b583070dea1bc7ccac5dfd5d5d983c59c1b6b
2024-04-08 14:28:46 -07:00
Andrew DatsenkoandFacebook GitHub Bot f9ca6d73c7 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/common:commonAndroid (#43974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43974

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725173

fbshipit-source-id: 79bfea85ef9b376d8892fc79198c27027aaf13fa
2024-04-08 14:24:38 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot eae5d97113 Kotlinify DefaultDevSupportManagerFactory (#43960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43960

## Changelog:
[Internal] -

As in the title.

Reviewed By: NickGerleman

Differential Revision: D55865794

fbshipit-source-id: e109cd28735ce2125f599b01d11f3667e3c5b033
2024-04-08 13:10:21 -07:00
Alan LeeandFacebook GitHub Bot 3422dcf55c Convert ReactSwitchEvent to Kotlin (#43881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43881

convert Java to Kotlin: `/react/views/switchview/ReactSwitchEvent.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55770377

fbshipit-source-id: e285d7e0c8b55745e05b0e0b1258c12fd02faa19
2024-04-08 11:58:39 -07:00
Andrew DatsenkoandFacebook GitHub Bot f77d028294 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util:utilAndroid (#43973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43973

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725614

fbshipit-source-id: da5b06758c928e8ffe935f646b0f802cf8a4fda0
2024-04-08 11:34:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 64ed8200f7 Fix double metro banner in Bridgeless (#43967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43967

Following up https://github.com/facebook/react-native/issues/43943, the metro loading banner is presented twice in Bridgeless mode.

This happens because both the RCTInstance and the RCTHost are listening to the Reload Command and issuing the instructions to refetch the JSBundle and to present the banner.

The RCTInstance should not concern itself with lifecycle events, owned by the RCTHost.

## Changelog:
[iOS][Fixed] - Avoid to show Metro Loading banner twice.

Reviewed By: cortinico

Differential Revision: D55870640

fbshipit-source-id: addb67d3226f7d7db20736309172a42fc15f3aa3
2024-04-08 11:16:38 -07:00
Alan LeeandFacebook GitHub Bot f4a3deb3c6 convert ColorUtil to Kotlin (#43878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43878

convert Java to Kotlin: `/react/views/view/ColorUtil.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55768201

fbshipit-source-id: 7bf8ca5db6d55bcb1801a87098739a244459c6cc
2024-04-08 10:47:47 -07:00
Nicola CortiandFacebook GitHub Bot 92715e91dd Add changelog for v0.74.0-rc.7 (#43969)
Summary:
Just the changelog for v0.74.0-rc.7

## Changelog:

[INTERNAL] - Add changelog for v0.74.0-rc.7

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D55871499

Pulled By: cortinico

fbshipit-source-id: 371ea1557b8d4e4c218e8a2050cd5e087f487802
2024-04-08 10:31:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot d274826fec Vendoring Boost to reduce footprint (#43864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43864

This change tries to vendor boost. It has several sustainable benefits:
- Reduce the download time to download boost
- Reduce the time to install pods
- Reduce the time to build the project
- Protects us from SEVs due to boost download link being down (happened twice already)
- Fixes how we build boost: currently it is a pseudo-target in iOS with no code, this makes all the symbols weak and this does not plays nicely with the new Apple linker.

## Changelog:
[Internal] - Vendor boost from React Native

Reviewed By: cortinico

Differential Revision: D55742345

fbshipit-source-id: 75abb5a2875e949b3dae299d2e18cb648c46151e
2024-04-08 09:57:00 -07:00
Ruslan LesiutinandFacebook GitHub Bot 877cb98dd6 Update debugger-frontend from 3c57538...b0a76fa (#43972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43972

Changelog: [Internal] - Update `react-native/debugger-frontend` from 3c57538...b0a76fa

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

Reviewed By: motiz88, EdmondChuiHW

Differential Revision: D55874213

fbshipit-source-id: de1f2962c999ef2e8d7ac5da3e74933f2155d655
2024-04-08 09:08:31 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8c3f8b6f2d Kotlinify MemoryPressure* (#43961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43961

## Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D55866117

fbshipit-source-id: 2561f6bfe3fc58ae10d57f9fb59c908dd20b9b86
2024-04-08 08:32:10 -07:00
Moti ZilbermanandFacebook GitHub Bot c14425567a Use different device IDs for modern and legacy backend (#43968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43968

Changelog: [Internal]

When going from a Fusebox build to a non-Fusebox build of the same app, users can accidentally connect a previously opened Fusebox frontend to a non-Fusebox backend (or vice versa).

To prevent this, here we assign a distinct "device ID" to the Fusebox backend on both Android and iOS. This will prevent a mismatched CDT frontend from reconnecting to the app after a backend change, forcing the user to close and reopen the debugger.

Reviewed By: hoxyq

Differential Revision: D55870800

fbshipit-source-id: 8552e009ef1e43b512d35035c98d1a859e3ccf91
2024-04-08 08:28:51 -07:00
Christoph PurrerandFacebook GitHub Bot 7dec625eca Add ReactRootViewTagGenerator (#43882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43882

Changelog: [General][Added] Add ReactRootViewTagGenerator

This copies over a modified version of the [react-native-windows](https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Modules/ReactRootViewTagGenerator.h) implementation so it can be shared with other C based platforms

This also updates the outdated comment about the non existing ReactIOSTagHandles JS module.

Reviewed By: javache

Differential Revision: D55772580

fbshipit-source-id: 88f5e15011ef89c522746fb2a62753c7b5a75cb9
2024-04-08 08:23:34 -07:00
Nicola CortiandFacebook GitHub Bot 15ff82f811 Fix ClassCastException in ReactModalHostView (#43966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43966

The `context` field was confusing. I've renamed it to `currentActivityContext` +
I've made sure the `onKey` method is using the right context with a this@ accessor.

Changelog:
[Android] [Fixed] - Fix ClassCastException in `ReactModalHostView`

Reviewed By: GijsWeterings

Differential Revision: D55870250

fbshipit-source-id: a25a31452fb0d21cf8e2807eca62cf09fe4fd74b
2024-04-08 08:14:39 -07:00
Andrew DatsenkoandFacebook GitHub Bot e19423a4b0 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common:commonAndroid (#43927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43927

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725544

fbshipit-source-id: 7e2066671e8a51f2559e2ab7e88a15117aeb3f1a
2024-04-08 07:11:36 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot a977b2e69b Migrate DevSettings related code to Kotlin (#43731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43731

# Changelog:
[Internal] -

Converts code related to DevSettings Module/Activity to Kotlin.

Reviewed By: cortinico

Differential Revision: D55574529

fbshipit-source-id: 41057307d0a12685a937a232e02a1a7a15736abe
2024-04-08 06:56:34 -07:00
Samuel SuslaandFacebook GitHub Bot 88b6e11508 delete ShadowNodeFragment::Value (#43962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43962

changelog: [internal]

Not used, let's delete it.

Reviewed By: fabriziocucci

Differential Revision: D55689099

fbshipit-source-id: 37751aad8119a7421fc5f2f78230540da4a244ea
2024-04-08 06:43:48 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot b069fca5c5 Convert views/image interface files (#43742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43742

## Changelog:
[Internal] -

As in the title - taking a subset of the views/image Java files, those that are related to interfaces, and convert them to Kotlin.

Reviewed By: tdn120

Differential Revision: D55589946

fbshipit-source-id: 60f03eaaca467821634d5b0195e42bfb931f65fb
2024-04-08 06:40:56 -07:00
Fabrizio CucciandFacebook GitHub Bot 3a15af7467 Kotlinify NativeMethodCallInvokerHolderImpl (#43809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43809

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55687786

fbshipit-source-id: 45eb656e066348ee4b26d7c4b92db642361c7598
2024-04-08 05:24:39 -07:00
zhongwuzwandFacebook GitHub Bot 90296be1d4 Support launchOptions in bridgeless mode (#43757)
Summary:
Support launchOptions in bridgeless mode
bypass-github-export-checks
## Changelog:

[IOS] [FIXED] - Support launchOptions in bridgeless mode

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

Test Plan:
```
useEffect(() => {
    const processInitialURL = async () => {
      const url = await Linking.getInitialURL();
      if (url !== null) {
        console.log(`Initial url is: ${url}`);
      }
    };

    processInitialURL();
  }, []);
```

Reviewed By: javache

Differential Revision: D55790758

Pulled By: cipolleschi

fbshipit-source-id: 0f6aa6bdcebfc5bc42d632bea9193f122c1eb84f
2024-04-08 05:21:27 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 5ea511736b MultiSourceHelper.java -> MultiSourceHelper.kt (#43776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43776

## Changelog:
[Internal] -

As in the title.

Reviewed By: alanleedev

Differential Revision: D55640126

fbshipit-source-id: 1e35c77ebb56b8cf419a28dccfbbf695747b92e4
2024-04-08 03:27:26 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot c35cc43a6c ReactScrollViewHelper -> Kotlin (#43735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43735

## Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D55576494

fbshipit-source-id: ee056b6ba629614a65440f68ad4dee5f53674879
2024-04-08 03:14:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 8ad308e847 Kotlinify NativeModule (#43898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43898

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55792976

fbshipit-source-id: 6e096552750e3e0828cfdb9b62e45636731b3917
2024-04-08 02:55:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c0ed2f4c34 Remove boost version (#43920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43920

React native is shipped as a whole, so it makes no sense for individual pods to specify which version of boost they support.

With this change we let the `react_native_pods` and the `boost.podspec` file to decide which version of boost is supported and all the other podspecs will follow.

## Changelog:
[Internal] - Remove explicit boost version from other podspecs

Reviewed By: NickGerleman

Differential Revision: D55801708

fbshipit-source-id: 3dcbbfb25010d2ee615afc4acfd5232fdc0c2a14
2024-04-08 02:51:59 -07:00
Ramanpreet NaraandFacebook GitHub Bot b52c7aa13c Remove mapbuffer from early js error handling (#43951)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43951

## Context
The **early js** error reporting pipeline catches javascript exceptions.

After errors are caught, the pipeline parses the exception, and puts the data into into a map buffer. 🤨

## Problems
We don't need to use a mapbuffer here: The structure of this exception data is known and never changes. (A map buffer is a type-unsafe bag of key/value pairs).

Instead, we could just use lower-level type-safe language primitives: regular C++ struct, and java class w/ fbjni.

## Changes
Migrate the **early js** error handling infra to C++ structs/fbjni.

## Impact
Now, there is no mapbuffer usage on iOS. We could re-introduce it when there is a need.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D55265170

fbshipit-source-id: cda97633d4c6ccaad541e5d416067390fe6f61b2
2024-04-07 19:40:22 -07:00
Fabrizio CucciandFacebook GitHub Bot 5927165822 Kotlinify Dynamic (#43905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43905

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55793644

fbshipit-source-id: 8808bebfdc04d50ec8562839b7a20c6ecdc188ff
2024-04-07 08:27:47 -07:00
Fabrizio CucciandFacebook GitHub Bot bbb7d2cb9d Kotlinify ReadableMap (#43904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43904

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55793535

fbshipit-source-id: 13ddcd97da4a6a2ccc61b13291f64e7f6c9ed459
2024-04-07 06:43:35 -07:00
Fabrizio CucciandFacebook GitHub Bot 9b54e226bd Kotlinify ReadableMapKeySetIterator (#43903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43903

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55793441

fbshipit-source-id: 8963b07b7982680cda89e4b21a99653ec60609e4
2024-04-07 03:19:03 -07:00
Fabrizio CucciandFacebook GitHub Bot a05466c5b7 Kotlinify WritableArray (#43902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43902

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55793358

fbshipit-source-id: 7921597d2c445e1129404bcb83084b1e2887efe9
2024-04-06 13:33:25 -07:00
Fabrizio CucciandFacebook GitHub Bot aae9fa24fa Kotlinify WritableMap (#43894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43894

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: javache, cortinico

Differential Revision: D55793215

fbshipit-source-id: bec6ca309683831f4c976cc49c91698fb6dd6552
2024-04-06 06:29:15 -07:00
Samuel SuslaandFacebook GitHub Bot 35d5754b36 add feature flag to enable explicit yoga node cleaning in TextInput (#43913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43913

changelog: [internal]

We have this turned on in ParagraphShadowNode, let's roll it out for TextInput as well.

I came across this while profiling scroll performance when TextInput is part of the view hierarchy.

Reviewed By: javache

Differential Revision: D55751341

fbshipit-source-id: 2af20ddb5a4fb9b0ccd33217e60e8b9e8a95b920
2024-04-06 05:09:54 -07:00
Fabrizio CucciandFacebook GitHub Bot 0e4aed1061 Kotlinify JSInstance (#43893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43893

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55791330

fbshipit-source-id: 5b5b687a126cfe9dc867032a45033f0cb70dc31d
2024-04-06 05:08:51 -07:00
Fabrizio CucciandFacebook GitHub Bot d50f6ffd8e Kotlinify ReadableArray (#43899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43899

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55791026

fbshipit-source-id: 748da23474230ac6f7e48779ccd39058217202d5
2024-04-06 03:22:14 -07:00
Ramanpreet NaraandFacebook GitHub Bot 7facb32f30 Remove core modules from the default tmmdelegate (#43939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43939

## Problem
If we link the default tmmdelegate with our vr apps, we get this issue:

```
ld.lld: error: duplicate symbol: facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)
>>> defined at firsttimenux_v2AppModulesCodegen-generated.cpp:1367 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-codegen-modules-jni_cpp__/out/firsttimenux_v2AppModulesCodegen-generated.cpp:1367)
>>>            firsttimenux_v2AppModulesCodegen-generated.cpp.pic.o:(facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-jni__/libfirsttimenux_v2AppModulesCodegen-jni.pic.a
>>> defined at rncore-generated.cpp:606 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-codegen-modules-jni_cpp__/out/rncore-generated.cpp:606)
>>>            rncore-generated.cpp.pic.o:(.text._ZN8facebook5react27NativeDevLoadingViewSpecJSIC2ERKNS0_15JavaTurboModule10InitParamsE+0x0) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-jniAndroid__/librncore-jniAndroid.pic.a
```

## Cause
My best understanding of the problem:
- Default tmmdelegate links against rncore, which contains codegen for react native's standard library of modules.
- But, the default delegate also pulls in this appmodules.so library. That library also contains codegen for react native's standard library of modules + the app's modules.

So, two so libraries define the same symbols. Hence the build fails.

## Solution
Remove the codegen for react native's standard library of modules from the default tmmdelegate.

Prereq: In open source, also make appmodules.so include the codegen for react native's standard library of modules.

Changelog: [Android][Breaking] - Make the app responsible for returning core turbomodule jsi hostobjects

Reviewed By: cortinico

Differential Revision: D55613024

fbshipit-source-id: 6406a9f388ff9de01288de0e263a78a079e7a0da
2024-04-05 20:12:17 -07:00
Fabrizio CucciandFacebook GitHub Bot a0d809cdd3 Kotlinify ViewGroupClickEvent (#43866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43866

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55749364

fbshipit-source-id: 184c43da537e550842cb9a675c525fa18cdee9f6
2024-04-05 17:00:47 -07:00
Fabrizio CucciandFacebook GitHub Bot 93a2dd9545 Kotlinify Systrace (#43917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43917

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55796784

fbshipit-source-id: f793e94cee18af717b9de7a09ae8c478f2a3d5fe
2024-04-05 16:32:55 -07:00
Fabrizio CucciandFacebook GitHub Bot 0ee40aac39 Kotlinify ReadableType (#43901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43901

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55790585

fbshipit-source-id: e3b539626d93d195809101826f3be74f1054f946
2024-04-05 16:28:23 -07:00
Fabrizio CucciandFacebook GitHub Bot f4bafdd616 Kotlinify ModulusAnimatedNode (#43889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43889

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55767001

fbshipit-source-id: cec29691185f7f0b9fa99c8b0194e94af9fc5933
2024-04-05 16:22:49 -07:00
D NandFacebook GitHub Bot 0a0cd6517f chore: [TS] Remove tvParallaxProperties prop & add missing focusable, rejectResponderTermination props (#43912)
Summary:
I do TV developing using a RN, and found one missing prop in TS:

```tsx
<TouchableOpacity focusable={false} />
//                          ^^^ Error: Property focusable does not exist on type Readonly<TouchableOpacityProps>
```

Then I decides to compare Flow & TS types definitions and found more:

1.  `tvParallaxProperties` - [was removed](https://github.com/search?q=repo%3Afacebook%2Freact-native%20tvParallaxProperties&type=code) and never used in the runtime (but [`rn-tvos`](https://github.com/react-native-tvos/react-native-tvos/blob/92f73d1d7966dd41e3d8d9101a4e298e9462887b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js#L299) has own ver. of `TouchableOpacity`  & handle its types)
2. `focusable` is missing
3. `rejectResponderTermination` is missing

## Changelog:

[GENERAL] [REMOVED] - [TS] Remove `tvParallaxProperties` prop from `TouchableOpacity` & add missing `focusable`, `rejectResponderTermination` props

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

Test Plan: TypeScript tests were updated

Reviewed By: NickGerleman

Differential Revision: D55805520

Pulled By: javache

fbshipit-source-id: 5eb8c65857beb86361e74b9369a1739b1ae18190
2024-04-05 15:28:26 -07:00
Fabrizio CucciandFacebook GitHub Bot 81b27c9204 Kotlinify WindowFocusChangeListener (#43906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43906

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: javache

Differential Revision: D55794517

fbshipit-source-id: 09301521494660b768633f23e60a55e5bea75dea
2024-04-05 14:16:41 -07:00
Fabrizio CucciandFacebook GitHub Bot efb00077ae Kotlinify LinearCountingRetryPolicy (#43871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43871

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55753695

fbshipit-source-id: 4a46b02b2dd18981968371a94d2fa07af90fc74e
2024-04-05 14:14:06 -07:00
Fabrizio CucciandFacebook GitHub Bot 7cffdf2d73 Kotlinify LayoutUpdateAnimation (#43890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43890

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55766128

fbshipit-source-id: a7f5fc653bd44ec7fc9f4995e82193d8b0d28660
2024-04-05 14:09:29 -07:00
Andrew DatsenkoandFacebook GitHub Bot 092ed2fc21 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/sound:soundAndroid (#43860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43860

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/1239557953/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: cortinico

Differential Revision: D55725322

fbshipit-source-id: 8f78d221a8f04136019055a6ea64d8ec05bfd8a2
2024-04-05 14:08:53 -07:00
Fabrizio CucciandFacebook GitHub Bot 5cf4f25d96 Kotlinify UnexpectedNativeTypeException (#43919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43919

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55796709

fbshipit-source-id: 68609954bd6dd8f9a9d81c243df86f6e1b8a0f0d
2024-04-05 14:07:09 -07:00
Fabrizio CucciandFacebook GitHub Bot f6a8e4337f Kotlinify PointerEvents (#43876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43876

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55764512

fbshipit-source-id: 49f3eabf8064d39ced9d28f240e91cfdc8ab98c9
2024-04-05 14:04:56 -07:00
Nicola CortiandFacebook GitHub Bot 98a38cc1a7 Convert the whole com.facebook.react.views.text.internal.span package to Kotlin (#43923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43923

Another round of Kotlin migration.
This time I'm doing `com.facebook.react.views.text.internal.span` which has been recently been annotated as `Nullsafe`

Changelog:
[Internal] [Changed] - Convert the whole `com.facebook.react.views.text.internal.span` package to Kotlin

Reviewed By: tdn120

Differential Revision: D55802155

fbshipit-source-id: 4bed023557f45a43d921df73dfc685e547788fd4
2024-04-05 13:59:21 -07:00
Nicola CortiandFacebook GitHub Bot 47a00f97d8 Migrate AndroidUnicodeUtils to Kotlin (#43929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43929

Migrate AndroidUnicodeUtils to Kotlin

Changelog:
[Internal] [Changed] - Migrate AndroidUnicodeUtils to Kotlin

Reviewed By: tdn120

Differential Revision: D55804037

fbshipit-source-id: 932fd08e3d826ddf131c74f8b4722732cd9ac46a
2024-04-05 13:55:48 -07:00
Fabrizio CucciandFacebook GitHub Bot 2aef4418ea Kotlinify NativeGestureUtil (#43867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43867

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55750840

fbshipit-source-id: 356828e6fc9c1b4c77e130cce281e5503ffb0d16
2024-04-05 13:54:51 -07:00
Fabrizio CucciandFacebook GitHub Bot d5dcaf3c1e Kotlinify DispatchStringCommandMountItem (#43870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43870

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55752447

fbshipit-source-id: 1965cc39601f514d0664d4d73bff4546f7c0f170
2024-04-05 13:47:44 -07:00
Fabrizio CucciandFacebook GitHub Bot 3f05ad6e8e Kotlinify DispatchIntCommandMountItem (#43868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43868

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55751796

fbshipit-source-id: 60349c63c11c27bb4049f41ae43bb84bd3090c21
2024-04-05 13:44:59 -07:00
Fabrizio CucciandFacebook GitHub Bot 0c2d4d3fb8 Kotlinify LifecycleEventListener (#43897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43897

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55790235

fbshipit-source-id: 9e1132304238137154467deeb96666abf537024f
2024-04-05 13:44:24 -07:00
Nicola CortiandFacebook GitHub Bot 2f46e1ac72 Move libreact_cxxreactpackage.so to INTERFACE library (#43930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43930

We don't need `libreact_cxxreactpackage.so` as there is nothing to load. I'm moving this to be an INTERFACE library as there is only a Header file now to load.
Move libreact_cxxreactpackage.so to INTERFACE library

Changelog:
[Internal] [Changed] - Move libreact_cxxreactpackage.so to INTERFACE library

Reviewed By: javache

Differential Revision: D55805573

fbshipit-source-id: 9ef99c430c19250439b8ace5d26b0984a8fb759e
2024-04-05 12:19:22 -07:00
Nicola CortiandFacebook GitHub Bot d45b843398 Fix crash of RNTester on back navigation (#43931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43931

RN Tester is crashing on back navigation with this stacktrace:

```
04-05 17:14:22.906 25051 25051 E AndroidRuntime: FATAL EXCEPTION: main
04-05 17:14:22.906 25051 25051 E AndroidRuntime: Process: com.facebook.react.uiapp, PID: 25051
04-05 17:14:22.906 25051 25051 E AndroidRuntime: java.lang.NullPointerException: Parameter specified as non-null is null: method com.facebook.react.devsupport.DoubleTapReloadRecognizer.didDoubleTapR, parameter view
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.devsupport.DoubleTapReloadRecognizer.didDoubleTapR(Unknown Source:2)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactDelegate.shouldShowDevMenuOrReload(ReactDelegate.java:302)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactActivityDelegate.onKeyUp(ReactActivityDelegate.java:158)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactActivity.onKeyUp(ReactActivity.java:89)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.KeyEvent.dispatch(KeyEvent.java:2878)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.app.Activity.dispatchKeyEvent(Activity.java:4164)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:126)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:404)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6377)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6243)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5946)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6104)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3159)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2723)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2714)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3136)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.MessageQueue.nativePollOnce(Native Method)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.MessageQueue.next(MessageQueue.java:335)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:161)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7842)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
```

This is happening because the `view: View` parameter is actually null at that point. I'm fixing it.

Changelog:
[Internal] [Changed] - Fix crash of RNTester on back navigation

Reviewed By: tdn120

Differential Revision: D55805574

fbshipit-source-id: 368109ef70725dad2cf72789b259726f859f05b8
2024-04-05 12:19:22 -07:00
Nicola CortiandFacebook GitHub Bot f14746f48b Fix broken HermesExecutor compilation (#43932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43932

Converting to Kotlin the `RuntimeConfig` class caused the project to stop compiling.

Changelog:
[Internal] [Changed] - Fix broken HermesExecutor compilation

Reviewed By: tdn120

Differential Revision: D55805572

fbshipit-source-id: bc53c91280d65ecaf2605009b17045200669f240
2024-04-05 12:19:22 -07:00
Andrew DatsenkoandFacebook GitHub Bot 0a7984435f //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/devtoolssettings:devtoolssettingsAndroid (#43922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43922

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725626

fbshipit-source-id: 1cb1ced5adab5c3c20f12ae0783d1f01d73b4829
2024-04-05 12:16:55 -07:00
Andrew DatsenkoandFacebook GitHub Bot 13432b5d8c //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/reactperflogger:reactperfloggerAndroid (#43872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43872

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725695

fbshipit-source-id: bdb9112203c744b59e74bb099f8a994e3a8b8dbe
2024-04-05 11:53:25 -07:00
Andrew DatsenkoandFacebook GitHub Bot dc8b7f8322 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/vibration:vibrationAndroid (#43918)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43918

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/1239558926/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: javache

Differential Revision: D55725326

fbshipit-source-id: f0960e42cf248ea78613299c16c6a47aa6169c7a
2024-04-05 11:46:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 49ea2a43c2 Kotlinify NativeArrayInterface (#43892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43892

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55789985

fbshipit-source-id: 5523012a66179b2a35cc046c948bfd4f7cccf200
2024-04-05 11:21:33 -07:00
Nicola CortiandFacebook GitHub Bot ed4106736a Convert ReactModalHostManager to Kotlin (#43844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43844

This converts the last class inside `com.facebook.react.views.modal` to Kotlin

Changelog:
[Internal] [Changed] - Convert ReactModalHostManager to Kotlin

Reviewed By: javache

Differential Revision: D55739386

fbshipit-source-id: 6bf85449c2bfd6d81a2d899bd044835b9b72c185
2024-04-05 11:12:02 -07:00
Nicola CortiandFacebook GitHub Bot ab44550f6e Convert ReactModalHostView to Kotlin (#43845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43845

This class is quite legacy and requires a couple of eyes before merging it.
I've tested that modals are working fine on RN-Tester both Old & New Arch.

Changelog:
[Internal] [Changed] - ReactModalHostView to Kotlin

Reviewed By: javache

Differential Revision: D55739128

fbshipit-source-id: 740d24df39ceb7b6a8120ae5315cf0684d1e6e27
2024-04-05 11:12:02 -07:00
Nicola CortiandFacebook GitHub Bot 20c1cc5e65 Bump AGP from 8.2.1 to 8.3.1 (#43925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43925

Another diff to keep our dependencies updated.

Changelog:
[Internal] [Changed] - Bump AGP from 8.2.1 to 8.3.1

Reviewed By: cipolleschi

Differential Revision: D55803537

fbshipit-source-id: f94512799f5d32c667520cd11b8db38c93485ab7
2024-04-05 10:14:42 -07:00
Nicola CortiandFacebook GitHub Bot acd6d154e5 Bump Kotlin to 1.9.23 (#43928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43928

This is a patch version for Kotlin, no practical changes expected.

Changelog:
[Internal] [Changed] - Bump Kotlin to 1.9.23

Reviewed By: cipolleschi

Differential Revision: D55803534

fbshipit-source-id: 99fcf444885cbc7b95baec2983303cfee88874a6
2024-04-05 10:14:42 -07:00
Nicola CortiandFacebook GitHub Bot ca7cc32288 Bump Gradle to 8.7 (#43926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43926

Just keeping our dependencies up-to-date.

Changelog:
[Internal] [Changed] - Bump Gradle to 8.7

Reviewed By: cipolleschi

Differential Revision: D55803535

fbshipit-source-id: 90bc2902d8692f1fa621a088189f6bae74c3c61f
2024-04-05 10:14:42 -07:00
Nicola CortiandFacebook GitHub Bot 854c57c3e8 Bump SoLoader to 0.11.0 in OSS (#43924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43924

Just keeping our dependecies up to date.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.11.0 in OSS

Reviewed By: cipolleschi

Differential Revision: D55803536

fbshipit-source-id: a1bea4d53c325db3f56986b08e3f3963c75f2269
2024-04-05 10:14:42 -07:00
Fabrizio CucciandFacebook GitHub Bot 33a1794755 Kotlinify RuntimeConfig (#43891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43891

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55788661

fbshipit-source-id: 1da14b556c013d679a671ae78671df690ebd9326
2024-04-05 08:42:22 -07:00
Nicola CortiandFacebook GitHub Bot 03c75c22fa Rename reactnative.a -> react_cxxreact.a (#43859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43859

This frees up the `reactnative` CMake target so we could use it as single .so
for the CMake build.

Changelog:
[Internal] [Changed] - Rename reactnative.a -> react_cxxreact.a

Reviewed By: javache

Differential Revision: D55745640

fbshipit-source-id: 3cad512cc07a277af2a0cea696863c85a17dabc1
2024-04-05 08:02:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 041bca4227 do not force CMake version for windows (#43916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43916

build_hermesc_windows is starting to fail because version 3.14.7 is [not available anymore](https://app.circleci.com/pipelines/github/facebook/react-native/44621/workflows/0c7d3474-ddf4-4138-bdbc-3fec59486f6c/jobs/1452518?invite=true#step-108-735_84) on chocolatey. By removing the version, the system should try to download the latest available.

## Changelog:
[Internal] - use the latest cmake on chocolatey for windows

Reviewed By: cortinico

Differential Revision: D55799078

fbshipit-source-id: d33a3a5f2c45c05e86a0cdf775ed820df5f8b9d4
2024-04-05 07:49:56 -07:00
Thomas NardoneandFacebook GitHub Bot 8c0b5df05a Convert systrace module (#43877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43877

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D55765258

fbshipit-source-id: 1582500d73239064272f567f183f6f6f406d815d
2024-04-05 07:37:15 -07:00
Nicola CortiandFacebook GitHub Bot bc832ca3aa Fix Android instacrashing on JSC with NoSuchMethodException (#43907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43907

JSC is currently instacrashing because we missed a JvmStatic.
Android will attempt to load JSCInstance.initHybrid which is missing unless we specify JvmStatic.

Changelog:
[Internal] [Changed] - Fix Android instacrashing on JSC with NoSuchMethodException

Reviewed By: GijsWeterings

Differential Revision: D55795290

fbshipit-source-id: 5d10344e3f481dc5832706d77ccf2bf163dfb30f
2024-04-05 05:25:31 -07:00
Dmitry RykunandFacebook GitHub Bot d6c21495f7 Print Hermes build script shell commands only in CI (#43767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43767

Print Hermes build script shell commands only in CI.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55635527

fbshipit-source-id: f0a901e11c523987e97a28b5238dcc08586516dd
2024-04-05 05:08:25 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 627bff2c38 Remove duplicated include when preparing prefabs (#43865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43865

Some of the includes in the task that prepares prefabs are duplicated. Removing the duplication

## Changelog:
[Internal] - Cleanup android prefabs

Reviewed By: cortinico

Differential Revision: D55751660

fbshipit-source-id: 2ea610937f122f82bc91e09fac1a2c78efa83410
2024-04-05 01:18:05 -07:00
Soe LynnandFacebook GitHub Bot d2a8222bc6 Back out "Update useNativeViewConfigsInBridgelessMode" (#43883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43883

Changelog: [Internal]

Backing out original diff `D55705805` to fix CircleCI Dynamic library test failure

Reviewed By: philIip

Differential Revision: D55773581

fbshipit-source-id: 2ec1b82241389166c1c31c979106c4ee6ead83fe
2024-04-04 23:03:47 -07:00
Soe LynnandFacebook GitHub Bot b5db214d2a Deprecate RedBox from RCTBridge to RCTModuleRegistry (#43717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43717

As we are going to bridgeless in new architecture, we want to clean up the usage of RCTBridge to use RCTModuleRegistry to access NativeModule.

Changelog:
[iOS][Breaking] Remove `RCTRedBox` access through `RCTBridge`

Reviewed By: philIip

Differential Revision: D55532209

fbshipit-source-id: 62aa2a24b60ab54d7f3cf25c34beda4449aaeaed
2024-04-04 20:27:32 -07:00
Alan LeeandFacebook GitHub Bot bf1a5d4934 convert ViewUtil to Kotlin (#43799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43799

convert Java to Kotlin: `/react/uimanager/common/ViewUtil.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55651762

fbshipit-source-id: 26896a41df8efec9fa032f0e16e3e50342dd54f8
2024-04-04 18:30:57 -07:00
Thomas NardoneandFacebook GitHub Bot fd3ef7b692 Avoid !! in ResourceDrawableHelper.kt (#43820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43820

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55701291

fbshipit-source-id: afdce3ffa59bc488d6c36d78a8cf3176089599ba
2024-04-04 15:00:41 -07:00
Samuel SuslaandFacebook GitHub Bot 70c3158b64 delete unused trait: AndroidMapBufferPropsSupported (#43787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43787

changelog: [internal]

This is not used. Let's delete it.

Reviewed By: fabriziocucci

Differential Revision: D55485422

fbshipit-source-id: 13c2e75aa384810ad07c055cedb3bb18f30b8378
2024-04-04 13:08:11 -07:00
Alan LeeandFacebook GitHub Bot 445c9ce806 convert LayoutMetricsConversions to Kotlin (#43863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43863

convert Java to Kotlin: `react/fabric/mounding/LayoutMetricsConversions.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55714004

fbshipit-source-id: fbf167cb6030916789f6676c1bd0690f144cf330
2024-04-04 13:07:26 -07:00
Fabrizio CucciandFacebook GitHub Bot c84faadd50 Kotlinify DoubleTapReloadRecognizer (#43862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43862

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: andrewdacenko

Differential Revision: D55747942

fbshipit-source-id: 07376f5ca2790d1656903cd03705f32c2050a589
2024-04-04 12:36:06 -07:00
Fabrizio CucciandFacebook GitHub Bot 0132142446 Kotlinify ReactUnimplementedView (#43828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43828

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55709336

fbshipit-source-id: 714e6d806cfe7ff4a2979e896201b640de4f5182
2024-04-04 12:33:18 -07:00
Fabrizio CucciandFacebook GitHub Bot e36baddff7 Kotlinify NoRetryPolicy (#43831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43831

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708871

fbshipit-source-id: c557743bf35cd27559fe8365025ca071bef57701
2024-04-04 12:33:18 -07:00
Fabrizio CucciandFacebook GitHub Bot 06a3028694 Kotlinify SimpleViewManager (#43834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43834

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708429

fbshipit-source-id: ff76e5dc2e8c6d99b7792ed58e8bcd5e1441b2dd
2024-04-04 12:30:49 -07:00
Fabrizio CucciandFacebook GitHub Bot af35442d88 Kotlinify GuardedFrameCallback (fabric) (#43842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43842

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55738719

fbshipit-source-id: 13bf28bf17f15f2e7d4dfbe2b49473a945a139ef
2024-04-04 12:30:49 -07:00
Andrew DatsenkoandFacebook GitHub Bot 4c4a6e4b7c Update useNativeViewConfigsInBridgelessMode (#43824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43824

Changelog: [Internal]

# Feature flag cleanup/migration
This migration is part of the new Feature Flag system built by rubennorte. The goal of this migration is to clean up our Feature Flags and consolidate them into a single place, accessible by all platforms.

# In this diff
Replaced `RCTSetUseNativeViewConfigsInBridgelessMode` and `RCTGetUseNativeViewConfigsInBridgelessMode` with `ReactNativeFeatureFlags.useNativeViewConfigsInBridgelessMode()` and ReactNativeFeatureFlags::override

Reviewed By: javache

Differential Revision: D55705805

fbshipit-source-id: 861675a1a94da0fcef8d8a02ccbd8ecdd97ec700
2024-04-04 12:27:07 -07:00
Alan LeeandFacebook GitHub Bot b09f378320 covert MainPackageCongfig to Kotlin (#43784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43784

convert Java to Kotlin: `react/shell/MainPackageConfig.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55627449

fbshipit-source-id: 1d0c0a034eb12e88fbadab88fa5e4c08bdbc1ad3
2024-04-04 12:10:56 -07:00
Vojtech NovakandFacebook GitHub Bot 98b1331609 fix: add missing fields to native errors in new arch (#43649)
Summary:
With 0.74.rc-5 one bug which related to errors was fixed (https://github.com/facebook/react-native/issues/41950). However, the fix introduced another one: the shape of Error objects that come from native modules has changed. This PR attempts to fix that, though it's not (yet) doing it in a way that would be 100% compatible with the old arch.

The problem was observed on iOS, not sure what the situation is on Android but believe it's okay there.

edit: on Android, there are no issues but the `message` field is enumerable, so that part is different from ios (see logs below).

Consider this code, where `error` is produced from a promise rejection inside of a native module.

```ts
  console.log(
    'own properties: ',
    JSON.stringify(Object.getOwnPropertyNames(error), null, 2),
  );
  console.log(
    'own enumerable properties: ',
    JSON.stringify(Object.entries(error), null, 2),
  );
```

These are the results for

<details>
  <summary>Old architecture</summary>

```
 LOG  Running "google-one-tap-example" with {"rootTag":1,"initialProps":{}}
 LOG  own properties:  [
  "stack",
  "code",
  "message",
  "domain",
  "userInfo",
  "nativeStackIOS"
]
 LOG  own enumerable properties:  [
  [
    "code",
    "-5"
  ],
  [
    "message",
    "RNGoogleSignIn: The user canceled the sign in request., Error Domain=com.google.GIDSignIn Code=-5 \"The user canceled the sign-in flow.\" UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}"
  ],
  [
    "domain",
    "com.google.GIDSignIn"
  ],
  [
    "userInfo",
    {
      "NSLocalizedDescription": "The user canceled the sign-in flow."
    }
  ],
  [
    "nativeStackIOS",
    [
      "0   ReactTestApp                        0x0000000102f4a6d8 RCTJSErrorFromCodeMessageAndNSError + 112",
      "1   ReactTestApp                        0x0000000102eeedd0 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.73 + 152",
      "2   ReactTestApp                        0x0000000102e2ae24 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
      "3   ReactTestApp                        0x0000000102e2aa8c -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
      "4   ReactTestApp                        0x0000000102e2a8e0 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
      "5   ReactTestApp                        0x0000000102e28628 __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
      "6   ReactTestApp                        0x0000000102dc9d80 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
    ]
  ]
]
```
</details>

<details>
  <summary>RN 74 rc-5 (with bridgeless on)</summary>

```
  (NOBRIDGE) LOG  Bridgeless mode is enabled
 (NOBRIDGE) LOG  Running "google-one-tap-example" with {"rootTag":1,"initialProps":{"concurrentRoot":true},"fabric":true}
 (NOBRIDGE) LOG  own properties:  [
  "stack",
  "message",
  "cause"
]
 (NOBRIDGE) LOG  own enumerable properties:  [
  [
    "cause",
    {
      "code": "-5",
      "message": "RNGoogleSignIn: The user canceled the sign in request., Error Domain=com.google.GIDSignIn Code=-5 \"The user canceled the sign-in flow.\" UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}",
      "nativeStackIOS": [
        "0   ReactTestApp                        0x00000001023a7b38 RCTJSErrorFromCodeMessageAndNSError + 112",
        "1   ReactTestApp                        0x00000001026cf774 ___ZZN8facebook5react15ObjCTurboModule13createPromiseERNS_3jsi7RuntimeENSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEU13block_pointerFvU13block_pointerFvP11objc_objectEU13block_pointerFvP8NSStringSH_P7NSErrorEEENK3$_0clES4_RKNS2_5ValueEPSQ_m_block_invoke.57 + 332",
        "2   ReactTestApp                        0x0000000102270958 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
        "3   ReactTestApp                        0x00000001022705c0 -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
        "4   ReactTestApp                        0x0000000102270414 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
        "5   ReactTestApp                        0x000000010226e15c __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
        "6   ReactTestApp                        0x000000010220f328 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
      ],
      "domain": "com.google.GIDSignIn",
      "userInfo": {
        "NSLocalizedDescription": "The user canceled the sign-in flow."
      }
    }
  ]
]
```
</details>

<details>
  <summary>with the diff from this PR</summary>

```
 (NOBRIDGE) LOG  own properties:  [
  "stack",
  "message",
  "code",
  "nativeStackIOS",
  "domain",
  "userInfo"
]
 (NOBRIDGE) LOG  own enumerable properties:  [
  [
    "code",
    "-5"
  ],
  [
    "nativeStackIOS",
    [
      "0   ReactTestApp                        0x000000010083b8f8 RCTJSErrorFromCodeMessageAndNSError + 112",
      "1   ReactTestApp                        0x0000000100b63534 ___ZZN8facebook5react15ObjCTurboModule13createPromiseERNS_3jsi7RuntimeENSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEU13block_pointerFvU13block_pointerFvP11objc_objectEU13block_pointerFvP8NSStringSH_P7NSErrorEEENK3$_0clES4_RKNS2_5ValueEPSQ_m_block_invoke.57 + 332",
      "2   ReactTestApp                        0x0000000100704718 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
      "3   ReactTestApp                        0x0000000100704380 -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
      "4   ReactTestApp                        0x00000001007041d4 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
      "5   ReactTestApp                        0x0000000100701f1c __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
      "6   ReactTestApp                        0x00000001006a30e8 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
    ]
  ],
  [
    "domain",
    "com.google.GIDSignIn"
  ],
  [
    "userInfo",
    {
      "NSLocalizedDescription": "The user canceled the sign-in flow."
    }
  ]
]

```
</details>

You see there is a change compared to old arch because `message` is no longer own enumerable property. If that needs to change (I guess it should), it'd be nice if someone more familiar with JSI pointed me in the right direction. Even with this inconsistency, the PR is an improvement and would be nice to have this fix included in the next RC.

This is output from Chrome's console for completeness, just to have something to compare to:

```
let err = new Error('hello')
undefined
Object.getOwnPropertyNames(err)
> ['stack', 'message']
Object.entries(err)
> []
```

bypass-github-export-checks

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - add missing fields to native errors in new arch

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

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

Test Plan: Tested locally with an example app running RN 74-rc 5

Reviewed By: cortinico

Differential Revision: D55690184

Pulled By: cipolleschi

fbshipit-source-id: 60a857b9871af888dcd526782b5e6b73c07c051a
2024-04-04 12:09:41 -07:00
Moti ZilbermanandFacebook GitHub Bot b309af79e8 Introduce DevSupportManager.openDebugger() method (#43685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43685

Changelog: [Changed][Android] Expose `openDebugger()` method on `DevSupportManager`

Exposes the `openDebugger()` method on `DevSupportManager` for ease of integration by RN Android frameworks.

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D55408820

fbshipit-source-id: f06684de47cee23642bf893afaedb2755453f253
2024-04-04 11:19:54 -07:00
Alan LeeandFacebook GitHub Bot c84f5cb5cd convert StandardCharsets to Kotlin (#43790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43790

convert Java to Kotlin: `react/common/StandardCharsets.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55611308

fbshipit-source-id: 11af39f9bcff555c7d5b30e1836d73c09d278f72
2024-04-04 11:12:45 -07:00
Alex HuntandFacebook GitHub Bot 9c00d6d332 Add VS Code workspace config (#43851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43851

## Summary

Adds a `react-native.code-workspace` workspace file when using VS Code. This disables the built-in TypeScript Language Service for `.js` files, recommends extensions, enables `formatOnSave`, and configures Flow language support.

We will recommend this workspace config in our contributing guide: https://github.com/facebook/react-native-website/pull/4075.

**Motivation**

This is a DevX benefit for **React Native contributors** using open source VS Code — in particular to help with recent/trivial papercuts in PRs such as inserting a final newline in files (configured by EditorConfig).

**Recommended extensions**

NOTE: The recommended extensions list is currently minimal — happy to extend this now or in future, but let's aim to keep these conservative.

- Flow — language support
- EditorConfig — formatting based on `.editorconfig`, all file types
- Prettier — formatting for JS* files
- ESLint — linter for JS* files

**Why `react-native.code-workspace`?**

`.code-workspace` files have slight extra behaviours over a `.vscode/` directory:
- Allows user to opt-in or skip.
- Allows double-click launching from file managers.
- Allows base folder (and any subfolders in future) to be opened with local file tree scope (useful in fbsource!)
- (Minor point) Single config file over multiple files.

https://code.visualstudio.com/docs/editor/workspaces

Changelog: [Internal]

## Test plan

Aganst a new unconfigured copy of Visual Studio Code Insiders.

**Without workspace config**

 `.js` files raise errors by default (built-in TypeScript language service)

 {F1478195672}

 When using the Flow VS Code extension, the wrong version (global) of Flow is used.

**With workspace config**

 Workspace config is suggested when folder is opened in VS Code

 {F1478194795}

 Dialog is shown on workspace launch with recommended VS Code extensions

{F1478196003}

 Built-in TypeScript Language Service is disabled for `.js` files
 Flow language support is configured correctly against `flow` version in `package.json`

{F1478291085}
{F1478200649}

Reviewed By: motiz88

Differential Revision: D55698495

fbshipit-source-id: b0b2f459cf05afc3e7862c9845066a66aaa1985b
2024-04-04 09:04:20 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 82b58d0367 Fix RCTRCTComposedViewRegistry for Old Arch by adding count and keyEnumerator (#43850)
Summary:
In the Old Architecture and for Swift Libraries, these two methods are used to initialize a new disctionary but their implementation was missing so some libraries like lottie were failig to build.

## Changelog:
[Internal] - Implement missing `count` and `keyEnumerator` methods for RCTComposedViewRegistry

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

Test Plan: Tested locally with the repro provided by SWM

Reviewed By: javache

Differential Revision: D55743648

Pulled By: cipolleschi

fbshipit-source-id: 7bdb92625341cd704b8b09920ab3223a2ca61a54
2024-04-04 08:36:58 -07:00
Fabrizio CucciandFacebook GitHub Bot 6bac579a12 Back out "Kotlinify OkHttpCallUtil" (#43857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43857

Changelog: [Internal]

There seems to be a weird problem with OkHttpCallUtil:
* D55707704 works in fbsource but breaks the CircleCI build with

> using 'dispatcher(): Dispatcher' is an error. moved to val

* D55744165 fixes the CircleCI build but breaks in fbsource with

> cannot access 'dispatcher': it is package-private in 'OkHttpClient'

Not sure what's the real fix to migrate `OkHttpCallUtil` to Koltin but at this point is probably safer to backout the original migration! 😥

Reviewed By: cortinico

Differential Revision: D55745345

fbshipit-source-id: 3ec6e4d99c950098fae974aa5f0e5be0b6663249
2024-04-04 08:25:14 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0b6b8e2fe6 Fix static linking for Bridgeless mode (#43846)
Summary:
Working with gabrieldonadel, we realized that static frameworks of the React-RendererRuntime are not following the proper folder structure.
When a user tries to import `ReactCommon/RCTHost` in the app delegate, for example, the user ends up with an error and they can't find the files.

These changes fixes this by establishing the right folder structure in the static frameworks

## Changelog:
[Internal] - Make sure that React-RuntimeCore and JSErrorHandler are created with the proper structure for static frameworks

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

Test Plan:
Tested locally on an app with 0.74.
Before: it failed to build.
After: it build successfully.

Reviewed By: cortinico

Differential Revision: D55741581

Pulled By: cipolleschi

fbshipit-source-id: 11ac0882d3feea05ef8904d55856ba5704b7a3b8
2024-04-04 08:06:53 -07:00
zhongwuzwandFacebook GitHub Bot 91279a822b Remove invalidate observer instead of re-adding observer in DeviceInfo module (#43737)
Summary:
Previous fix brings in https://github.com/facebook/react-native/pull/42396. Seems it's a mistake to re-add observer?
So let's remove it and also not `invalidate` method not be called twice.

## Changelog:

[IOS] [FIXED] - Remove invalidate observer instead of re-adding observer in DeviceInfo module

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

Test Plan: Fix for https://github.com/facebook/react-native/issues/42120 also works.

Reviewed By: javache

Differential Revision: D55692219

Pulled By: cipolleschi

fbshipit-source-id: dba1ddc39a9f2611fc2b84fadf8c23827891379a
2024-04-04 07:33:10 -07:00
Alex HuntandFacebook GitHub Bot 629159a1e3 Improve comment describing inspectorExecutor lifetime (#43856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43856

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D55744630

fbshipit-source-id: 4dc930342948253d4cc3b2d04fc4c474e53fc14d
2024-04-04 07:17:56 -07:00
Nicola CortiandFacebook GitHub Bot 71cc8a506b Annotate as @Nullsafe everything in package com.facebook.react.views.text.internal.span (#43843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43843

This just annotates more classes as nullsafe.

Changelog:
[Internal] [Changed] - Annotate as Nullsafe everything in package com.facebook.react.views.text.internal.span

Reviewed By: fabriziocucci

Differential Revision: D55739092

fbshipit-source-id: f4f4267b344d103b87376aad88291941dce896cd
2024-04-04 06:07:46 -07:00
Samuel SuslaandFacebook GitHub Bot c7d9571d6a only trigger RCTContentDidAppearNotification when content appears (#43823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43823

changelog: [internal]

Notification RCTContentDidAppearNotification was posted too early in RCTSurfaceHostingProxyRootView, which does not know when views are mounted.
It was also posted if no views were mounted, leading to inconsistent behaviour between Paper and Fabric.

The implementation is aligned with Paper: https://github.com/facebook/react-native/blob/main/packages/react-native/React/Base/RCTRootContentView.m#L45-L55

Reviewed By: cipolleschi

Differential Revision: D55640654

fbshipit-source-id: 2d7bc5afb6ba1c1e8db529ee11eac2bae2d936d6
2024-04-04 05:52:53 -07:00
Arushi KesarwaniandFacebook GitHub Bot dc83cb7a26 Migrate FabricSoLoader to Kotlin (#43837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43837

FabricSoLoader.java -> FabricSoLoader.kt

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55724712

fbshipit-source-id: bef37f74df50006d842dd4913386841a2eddf2b5
2024-04-04 04:19:17 -07:00
Fabrizio CucciandFacebook GitHub Bot e7b352daf0 Kotlinify ViewUtils (#43826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43826

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55707886

fbshipit-source-id: ffe291cbb9ac18b1092b5d466019a8230c1772c1
2024-04-04 04:02:55 -07:00
Fabrizio CucciandFacebook GitHub Bot 0646d50306 Kotlinify OkHttpCallUtil (#43825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43825

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55707704

fbshipit-source-id: 658f2aed252abfd75f8d7670ca35a396ed06390a
2024-04-04 04:02:55 -07:00
Fabrizio CucciandFacebook GitHub Bot c1081cc1ac Kotlinify GuardedFrameCallback (#43841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43841

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55732555

fbshipit-source-id: baab9a33be7d963dfe0fe765211de3d5abaebaca
2024-04-04 03:43:38 -07:00
Fabrizio CucciandFacebook GitHub Bot 13cdd480ea Kotlinify ChoreographerProvider (#43840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43840

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55731748

fbshipit-source-id: f43c687f44b351ade907be4dcd55518b5bef913d
2024-04-04 03:43:38 -07:00
Fabrizio CucciandFacebook GitHub Bot 9d51bfdc14 Kotlinify AndroidChoreographerProvider (#43839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43839

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55731620

fbshipit-source-id: c75eca4d324fb6761b681f28a9fe65fb2659aa3e
2024-04-04 03:43:38 -07:00
Alan LeeandFacebook GitHub Bot bc3e3360d1 add PopupMenuDismissEvent (#43785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43785

Deprecated `UIManager.showPopupMenu()` had success callback that would be triggered on 1) item selection or 2) dismiss.
New `PopupMenuAndroid` only has item selection callback so adding in missing dismiss callback.

Changelog:
[Android][Added] - Add (optional) onPopupDismiss() callback for PopupMenuAndroid

Reviewed By: cortinico

Differential Revision: D55531870

fbshipit-source-id: 26f3992ef6c85fbc6d8dfff00cb723ac4aae3762
2024-04-04 02:29:29 -07:00
Fabrizio CucciandFacebook GitHub Bot f937f55ec4 Kotlinify DrawerStateChangedEvent (#43835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43835

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709997

fbshipit-source-id: 43c89680ca373c6f68119f63107c616568df0cbc
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 4b580c0060 Kotlinify DrawerSlideEvent (#43836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43836

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709887

fbshipit-source-id: ce15c18dcfdcf68eba0973ac2277a377435149fb
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot c34dfb036b Kotlinify DrawerClosedEvent (#43833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43833

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709690

fbshipit-source-id: fdfe8fbc8f8faffc3dcde27e03a5f6667f621e46
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot bd385f831f Kotlinify DrawerOpenedEvent (#43830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43830

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709628

fbshipit-source-id: f87483381e948333fc6a437e3c2b42ec927cffda
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 49589fe92e Kotlinify RefreshEvent (#43829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43829

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55708970

fbshipit-source-id: 7a19f509ce97a9159b85c4e0a7540c0ae7cff3f1
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 1cbe5376ba Kotlinify ScrollEventType (#43827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43827

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: arushikesarwani94

Differential Revision: D55708353

fbshipit-source-id: 30a31e7eb9e6ad59b7c90468f9e6f55c91c579a8
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot a97109ef2e Kotlinify ContextUtils (#43832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43832

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: arushikesarwani94

Differential Revision: D55708157

fbshipit-source-id: 8c89a569f5ace30c480dc562c2d8e4e5cab208dc
2024-04-04 02:00:36 -07:00
Fabrizio CucciandFacebook GitHub Bot ce811a009d Kotlinify CoreComponentsRegistry (#43798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43798

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55656496

fbshipit-source-id: 5ef9161dd2f3834f71cb0ac634b60bf146eb41ad
2024-04-04 00:24:45 -07:00
Fabrizio CucciandFacebook GitHub Bot 1aabaecde0 Kotlinify ReactHorizontalScrollContainerViewManager (#43795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43795

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55654460

fbshipit-source-id: 9a498619d6a7e6c3691dcddf1ec455974b8d8e1f
2024-04-04 00:23:49 -07:00
Fabrizio CucciandFacebook GitHub Bot d7d6a8fbe8 Kotlinify RootViewManager (#43791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43791

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55641381

fbshipit-source-id: 6f36ccbd5143c5c344d2f795e45e85660534c7c3
2024-04-04 00:22:22 -07:00
Fabrizio CucciandFacebook GitHub Bot 722eb286fb Kotlinify DevSupportSoLoader (#43774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43774

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55637189

fbshipit-source-id: 88ebab2cfc7169f73b650c8a93e981231a9bc695
2024-04-04 00:17:57 -07:00
Alan LeeandFacebook GitHub Bot 76a29fc8e7 convert DebuggingOverlayManager to Kotlin (#43818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43818

convert Java to Kotlin: `react/views/debuggingoverlay/DebuggingOverlayManager.java`

Changelog:
[Internal] internal

Reviewed By: makovkastar

Differential Revision: D55662140

fbshipit-source-id: 6ebb5806be153a6427b9d1f35bbdda5e4cf98d11
2024-04-03 23:42:44 -07:00
Alan LeeandFacebook GitHub Bot 49c40812ca convert DebuggingOverlay to Kotlin (#43819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43819

convert Java to Kotlin: `react/views/debuggingoverlay/DebuggingOverlay.java`

Changelog:
[Internal] internal

Reviewed By: makovkastar

Differential Revision: D55662115

fbshipit-source-id: 45fd36efdb93a598224af0fb6c9d33ac5e5cad27
2024-04-03 23:42:44 -07:00
Alan LeeandFacebook GitHub Bot 9876adba4a convert TraceUpdate to Kotlin (#43805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43805

convert Java to Kotlin: `react/views/debuggingoverlay/TraceUpdate.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55658446

fbshipit-source-id: d5c8d714f759b78138ea9069dc179c13ff10adeb
2024-04-03 23:42:44 -07:00
danandFacebook GitHub Bot 727f30bd0b Replace outdated Prettier settings with recommended ones (#43756)
Summary:
The React Native ESLint preset currently endorses the Prettier integration that is [explicitly recommended against by Pretier itself](https://prettier.io/docs/en/integrating-with-linters). Notice the difference between these two packages:

- `eslint-config-prettier` is the config that turns off all formatting rules. It's **recommended by Prettier** to be used together with Prettier. You'd still use Prettier itself to actually do the formatting.
- `eslint-plugin-prettier` is a legacy plugin developed a long time ago and that predates most modern Prettier integrations. It runs Prettier as if it were an ESLint rule, applies formatting on `--fix`, and **is not recommended**.

Unfortunately, RN uses the latter one (and always has).

This PR removes `eslint-plugin-prettier` and instead enables `eslint-config-prettier`, as recommended by Prettier.

As a consequence, you'll no longer see squiggly lines in your editor for stuff that isn't actually errors:

<img width="558" alt="Screenshot 2024-04-01 at 20 00 50" src="https://github.com/facebook/react-native/assets/810438/91ae2cec-a9ef-4205-a9ce-6ab858785ed2">

As another consequence, **you'll have to set up your own Prettier step in your pipeline**.

For example, if your precommit hook only contained `eslint --fix`, you'll now also need to run `prettier --write` there as well. Similarly, if you want Prettier to fail CI, you'd need to find where you call `eslint` and also do `prettier --check` there.

Here's an example for how to do it: https://github.com/bluesky-social/social-app/pull/3373

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL] [BREAKING] - RN ESLint config no longer runs Prettier during ESLint

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

Test Plan:
Tested locally, verified formatting changes no longer get flagged as violations by the RN config.

<img width="470" alt="Screenshot 2024-04-01 at 20 33 55" src="https://github.com/facebook/react-native/assets/810438/515db971-18bc-4625-bb6d-b9d072692923">

Reviewed By: motiz88

Differential Revision: D55643699

Pulled By: yungsters

fbshipit-source-id: 97df774275922086f0356ac857d6425713184e39
2024-04-03 23:38:12 -07:00
Nicola CortiandFacebook GitHub Bot 26cc8cddf9 Do not attempt to call Class.forName in OSS (#43816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43816

We should not attempt to load generated classes by the Annotation processor in OSS because we simply don't run it, so those classes will fail to load. I'm short-circuiting the logic here.

This is sustainability work as we got a report for this in OSS a while ago and I never got the time to work on it.

Changelog:
[Internal] [Changed] - Do not attempt to call Class.forName in OSS

Reviewed By: rshest

Differential Revision: D55693479

fbshipit-source-id: 3ec84e2c7940011b48f354058b5099b46065166d
2024-04-03 23:00:03 -07:00
Alan LeeandFacebook GitHub Bot 8c62df6396 convert MeasureSpecAssertions to Kotlin (#43797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43797

convert Java to Kotlin: `/react/uimanager/MeasureSpecAssertions.java`

Changelog:
[Internal] internal

Reviewed By: makovkastar

Differential Revision: D55606951

fbshipit-source-id: ca01a80f70583f39feb3e01c4bdb2367a3b770c0
2024-04-03 22:27:54 -07:00
Andrew DatsenkoandFacebook GitHub Bot e9d9de1a1e Update useNativeViewConfigsInBridgelessMode (#43822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43822

Changelog: [Internal]

# Feature flag cleanup/migration
This migration is part of the new Feature Flag system built by rubennorte. The goal of this migration is to clean up our Feature Flags and consolidate them into a single place, accessible by all platforms.

# In this diff
Replaced `ReactFeatureFlags.useNativeViewConfigsInBridgelessMode` with `ReactNativeFeatureFlags.useNativeViewConfigsInBridgelessMode()`

Reviewed By: cortinico

Differential Revision: D55695173

fbshipit-source-id: e5158a9d5606f16f8e333321bad472f7eb315d0b
2024-04-03 19:20:06 -07:00
Andrew DatsenkoandFacebook GitHub Bot bd70d9c83c Add useNativeViewConfigsInBridgelessMode (#43817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43817

Changelog: [Internal]

# Feature flag cleanup/migration
This migration is part of the new Feature Flag system built by rubennorte. The goal of this migration is to clean up our Feature Flags and consolidate them into a single place, accessible by all platforms.
# In this diff
Generate new flag useNativeViewConfigsInBridgelessMode that will be used in

https://www.internalfb.com/code/fbsource/[2b7df36a7830c2713219538f83683d6b675fc369]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java?lines=233

https://www.internalfb.com/code/fbsource/[2b7df36a7830c2713219538f83683d6b675fc369]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt?lines=46

Reviewed By: cortinico

Differential Revision: D55693703

fbshipit-source-id: e42eedb34ab3db6f21ffd97332e89cb2546566c9
2024-04-03 19:20:06 -07:00
Arushi KesarwaniandFacebook GitHub Bot 99c80114e2 Migrate JSRuntimeFactory to Kotlin (#43748)
Summary:
JSRuntimeFactory.java -> JSRuntimeFactory.kt

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

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D55605824

fbshipit-source-id: 7361972b020fbf2cc655be35c10e70aef96c20d5
2024-04-03 16:58:00 -07:00
Thomas NardoneandFacebook GitHub Bot 7a458025ca Convert debug/holder module (#43747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43747

Convert module to Kotlin.
changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D55598977

fbshipit-source-id: d289e230bae721de6d7d209663fcdc35ec37fbac
2024-04-03 16:15:45 -07:00
Thomas NardoneandFacebook GitHub Bot 1139700424 debug/holder (#43746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43746

Mark relevant classes as nullsafe prior to Kotlin conversion.

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D55591487

fbshipit-source-id: dc3ee0070c7b14aaca4c13cfdcc2422ce8c1d5a5
2024-04-03 16:15:45 -07:00
Christoph PurrerandFacebook GitHub Bot 4fd95b6e02 Remove unused imports from ReactPrimitives.h (#43806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43806

[General][Breaking] - Remove unused imports (folly/dynamic.h) from ReactPrimitives.h

Reviewed By: cipolleschi

Differential Revision: D55679447

fbshipit-source-id: 09dbab197be3cc149f481ee5459bf21fd6c376df
2024-04-03 14:07:36 -07:00
Nicola CortiandFacebook GitHub Bot e1c1910c9c Mark ReactModalHostView as @NullSafe (#43811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43811

This class was really old and had a lot of potential NPEs as it was accessing fields that could have been not initialized properly. I'm fixing it here ahead of a Kotlin migration.

Changelog:
[Internal] [Changed] -  Mark ReactModalHostView as NullSafe

Reviewed By: fkgozali

Differential Revision: D55690285

fbshipit-source-id: 3e910da6dc43a30f2f86d4f1e9d02ead006a31c1
2024-04-03 14:05:19 -07:00
Arushi KesarwaniandFacebook GitHub Bot 3559a6c58a Migrate JSTimerExecutor to Kotlin (#43804)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43804

JSTimerExecutor.java -> JSTimerExecutor.kt

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55671797

fbshipit-source-id: f65ef2bf5e674908e40e00512a8b7a8751d66d77
2024-04-03 11:32:20 -07:00
Arushi KesarwaniandFacebook GitHub Bot 531e94b8d7 Migrate BridgelessReactStateTracker to Kotlin (#43792)
Summary:
BridgelessReactStateTracker.java -> BridgelessReactStateTracker.kt

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

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D55628784

fbshipit-source-id: 5327a13957f2fcc839a0ab3f6ac2ea86801200ec
2024-04-03 11:15:53 -07:00
Nicola CortiandFacebook GitHub Bot d9895b4522 Annotate AndroidUnicodeUtils as NullSafe (#43814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43814

This is just an example on how to use the NullSafe annotation

Changelog:
[Internal] [Changed] - Annotate AndroidUnicodeUtils as NullSafe

Reviewed By: alanleedev

Differential Revision: D55419929

fbshipit-source-id: 4eac059c5992661ada4ef8d35327dd9a4bc11d25
2024-04-03 10:29:32 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 75776a25c9 Kotlinify ImageLoadEvent (#43778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43778

## Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D55640524

fbshipit-source-id: 191324a7001497fb550472307f080a939abac8e7
2024-04-03 10:02:11 -07:00
Nicola CortiandFacebook GitHub Bot e0c90100b5 Convert several classes inside com.facebook.react.views.modal to Kotlin (#43815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43815

This moves a lot of classes from Java to Kotlin from the `package com.facebook.react.views.modal`

Changelog:
[Internal] [Changed] - Convert several classes inside `com.facebook.react.views.modal` to Kotlin

Reviewed By: rshest

Differential Revision: D55692067

fbshipit-source-id: 67e93c9d5d5f58add31ca6726c9f1e4ac2e8ffc3
2024-04-03 09:53:17 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 3ef1fac749 Kotlinify ScrollEvent (#43779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43779

## Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D55641002

fbshipit-source-id: 093fa2f1efbdf2b66593a485cac7e62af7ac69ee
2024-04-03 09:05:32 -07:00
Nicola CortiandFacebook GitHub Bot 426aa0d504 Mark ReactModalHostManager as NullSafe (#43812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43812

Mark ReactModalHostManager as NullSafe

Changelog:
[Internal] [Changed] - Mark ReactModalHostManager as NullSafe

Reviewed By: rshest

Differential Revision: D55690286

fbshipit-source-id: f347fc28dfccbca03d76c276c09e5c099397535c
2024-04-03 08:21:05 -07:00
Jane LiandFacebook GitHub Bot 79e5e64b9a RN changes to enable fragment-based navigation [1/3] (#43789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43789

This diff introduces some changes to React Native needed to enable fragment-based navigation (see next diff for usage).

Fragment-based navigation will enable us to, instead of re-creating the entire main activity on navigation, create a fragment instead - allowing us to bypass a lot of unnecessary onCreate() logic in our main activity to improve user experience and performance.

Changelog:
[Internal] [Changed] - Add option to skip calling delegate on ReactFragment lifecycle events

Reviewed By: keoskate

Differential Revision: D55646221

fbshipit-source-id: 45b148cb9ecdb1484f1ac714ac2b93ce09c52237
2024-04-03 08:18:46 -07:00
Alex HuntandFacebook GitHub Bot d855974dae Set prefersFuseboxFrontend capability flag in jsinspector-modern targets (#43689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43689

Context: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/34.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D55474521

fbshipit-source-id: 9756fe29adcbdda686af24c1a65073720cba4b53
2024-04-03 08:07:39 -07:00
Edmond ChuiandFacebook GitHub Bot 8ceb4a2a3e Update debugger-frontend from a96803a...3c57538 (#43788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43788

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

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

Reviewed By: motiz88

Differential Revision: D55644153

fbshipit-source-id: 73e018013fe5bb77bc89b868f83c6e5c5637c622
2024-04-03 08:07:39 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7a5bf02275 Migrate Spacing.java to Kotlin (#43733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43733

## Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D55574525

fbshipit-source-id: a39b376026729c56d59e61db1a7d4a01711836be
2024-04-03 08:03:10 -07:00
Fabrizio CucciandFacebook GitHub Bot ca5d940fe4 Kotlinify CallInvokerHolderImpl (#43796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43796

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55655061

fbshipit-source-id: fd2c81ce91681f9f26e2b4a659b8fbae8a4b7d51
2024-04-03 06:26:29 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot e1800726af Migrate SystemClock and JavaScriptException to Kotlin (#43732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43732

## Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D55574532

fbshipit-source-id: bffa17a4be0f881a574988c34d9446f6392c816c
2024-04-03 06:16:17 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f2bdec2835 Migrate ResourceDrawableHelper.java (#43765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43765

## Changelog:
[Internal] -

As in the title, migrates the corresponding file to Kotlin.

Reviewed By: cortinico

Differential Revision: D55636177

fbshipit-source-id: 9e7f94475185953f22fdcb0b4c94b84d4fc4e931
2024-04-03 06:00:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 11108f3763 Migrate ProgressBarShadowNode.java to Kotlin (#43770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43770

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D55636867

fbshipit-source-id: 2c88d8e2c39baead0094865af9dd7de5d6bc111a
2024-04-03 05:57:12 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot c01edf4115 Migrate ViewProps.java to Kotlin (#43734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43734

## Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D55574527

fbshipit-source-id: 6d8951479104cf2366c443b3be4775624927ac95
2024-04-03 05:55:40 -07:00
Nicola CortiandFacebook GitHub Bot 3f7dadd838 Always quote the user + add links to the release support policy (#43810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43810

This bot never works because facebook bot is faster.
I'm updating the logic to always publish the thank you message + update the link with the correct one.

Changelog:
[Internal] [Changed] - Always quote the user + add links to the release support policy

Reviewed By: rshest, cipolleschi

Differential Revision: D55643675

fbshipit-source-id: d2e726580c82d7f89b37d17846675b7c4c38e908
2024-04-03 05:44:01 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 1561cc9855 Wrap UIMenuAutoFill in compilation pragmas for iOS 17 checks (#43808)
Summary:
PR https://github.com/facebook/react-native/issues/43468 landed in main which uses UIMenuAutoFill that is available only in iOS 17.
Despite having the `available` checks, these are only runtime checks. The symbol is not stripped on older versions of Xcode and therefore our jobs which uses older Xcode versions started failing.

This change wraps the offending code in a compilation pragma that strips away the symbol when building with Xcode versions that does not know iOS 17.

## Changelog:
[iOS][Fixed] - wrap UIMenuAutoFill in compilation checks for iOS 17

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

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D55688255

Pulled By: cipolleschi

fbshipit-source-id: d69874b60e73da1fbdfc61d594870a48f97c3797
2024-04-03 04:45:30 -07:00
Jean-Baptiste LARRIVIEREandFacebook GitHub Bot bcac3c4d9c fix: build settings for custom build configuration (#43780)
Summary:
This allows build configuration named like `StagingDebug` to match with settings applied to `Debug` This fixes https://github.com/facebook/react-native/issues/43185

Custom build setting were only applied to `Debug` build configurations, preventing configurations named `StagingDebug` or similar to access the new experimental debugger, as reported in https://github.com/facebook/react-native/issues/43185

This now applies the setting to every configuration ending with `Debug`

## Changelog:

[IOS] [CHANGED] - fix: build settings for custom build configuration

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

Reviewed By: dmytrorykun

Differential Revision: D55688996

Pulled By: cipolleschi

fbshipit-source-id: 1f34cd722f6acfaa08d3377e19a04d08af97ed7c
2024-04-03 04:43:11 -07:00
Fabrizio CucciandFacebook GitHub Bot 558f6ba9f7 Kotlinify TouchEventType (#43793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43793

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: arushikesarwani94

Differential Revision: D55654220

fbshipit-source-id: 36ac09e69560001e373befe2646561de1a3d3d71
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot ed3c0a1423 Kotlinify IllegalViewOperationException (#43794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43794

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55653543

fbshipit-source-id: 71414e4b46aea7497bb64881cfb99d3b5c84c150
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 669bcb8675 Kotlinify YogaNodePool (#43786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43786

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55643838

fbshipit-source-id: 0138a9a9c328bea4838ab4f4c5a0db8a7436ebbe
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 08af9eaa29 Kotlinify ComponentFactory (#43783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43783

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55643354

fbshipit-source-id: de6b676ae138f823c0521f1dcc48f3bcb7fd4e04
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 3856a46946 Kotlinify DispatchCommandMountItem (#43781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43781

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55642568

fbshipit-source-id: e03a4cc5e2fac4b975d757944520d378f6ea368b
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 0d04f5d147 Kotlinify LifecycleState (#43782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43782

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55642371

fbshipit-source-id: d37fc2eb19635a70e60c57dc6c150aa7e713f778
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot 7df9dbbccf Kotlinify NativeKind (#43775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43775

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55640039

fbshipit-source-id: 5e8f395db0b7010e9a8b225a472db3bb46459d00
2024-04-03 02:43:36 -07:00
Fabrizio CucciandFacebook GitHub Bot de617d03e1 Kotlinify NotificationOnlyHandler (#43745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43745

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55601731

fbshipit-source-id: d5da4002ee12cea1b2e04df237cfd27a4727df05
2024-04-03 02:43:36 -07:00
Arushi KesarwaniandFacebook GitHub Bot b9dc0ae7de Reducing visibility of companion object in JSCInstance (#43800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43800

Changelog: [Internal]

Facebook : D55610929 comments

Reviewed By: alanleedev

Differential Revision: D55657065

fbshipit-source-id: 3380dc13ee9cbc122a053a55363cc0842e01eded
2024-04-02 22:40:47 -07:00
Phillip PanandFacebook GitHub Bot d39712f54a add privacy manifest to pod install
Summary:
Changelog: [iOS][Added]

this creates the RN privacy manifest in the ios build step if user has not created one yet. the reasons have been added for the following APIs:

NSPrivacyAccessedAPICategoryFileTimestamp
- C617.1: We use fstat and stat in a few places in the C++ layer. We use these to read information about the JavaScript files in RN.

NSPrivacyAccessedAPICategoryUserDefaults
- CA92.1: We access NSUserDefaults in a few places.
1) To store RTL preferences
2) As part of caching server URLs for developer mode
3) A generic native module that wraps NSUserDefaults

NSPrivacyAccessedAPICategorySystemBootTime
- 35F9.1: Best guess reason from RR API pulled in by boost

Reviewed By: cipolleschi

Differential Revision: D53687232

fbshipit-source-id: 6dffb1a6013f8f29438a49752e47ed75c13f4a5c
2024-04-02 21:38:52 -07:00
Phillip PanandFacebook GitHub Bot 520d120375 add privacy manifest to hello world template
Summary:
Changelog: [iOS][Added]

this change will be included in the RN CLI. so all new apps running the RN CLI to get created will get this manifest. the reasons have been added for the following APIs:

NSPrivacyAccessedAPICategoryFileTimestamp
- C617.1: We use fstat and stat in a few places in the C++ layer. We use these to read information about the JavaScript files in RN.

NSPrivacyAccessedAPICategoryUserDefaults
- CA92.1: We access NSUserDefaults in a few places.
1) To store RTL preferences
2) As part of caching server URLs for developer mode
3) A generic native module that wraps NSUserDefaults

NSPrivacyAccessedAPICategorySystemBootTime
- 35F9.1: Best guess reason from RR API pulled in by boost

Reviewed By: cipolleschi

Differential Revision: D53682756

fbshipit-source-id: 0426fe0002a3bc8b45ef24053ac4228c9f61eb85
2024-04-02 21:38:52 -07:00
Arushi KesarwaniandFacebook GitHub Bot e70caeec10 Unbreak build_android in OSS (#43803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43803

The dependency resolution of java/com/facebook/soloader/annotation:annotation is missing in OSS and needs to be included in [build.gradle.kts](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/build.gradle.kts) instead

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D55664486

fbshipit-source-id: 3350241a7c90d075114e3f0c2776afc1ab209d5d
2024-04-02 17:42:02 -07:00
Fabrizio CucciandFacebook GitHub Bot 7b302dc8bd Kotlinify RequestOnlyHandler (#43743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43743

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55588782

fbshipit-source-id: 89f15fb55eaa338be97c938d6b23c3e77ce610f0
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 7d60f403f9 Kotlinify SingleThreadAsserter (#43768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43768

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55636773

fbshipit-source-id: 2f3d1c73a5d3c7d229b854ab73dcf2902a639c3a
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot fa808b0840 Kotlinify MeasureUtil (#43769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43769

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55636884

fbshipit-source-id: 331f414db729f1b5f6f285df015ec65c2ade38cc
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot cb28372c72 Kotlinify ReactRootViewTagGenerator (#43771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43771

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55637406

fbshipit-source-id: e66690a1f10d7825f27e060d6f434544b5f8c39d
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 79fa565b8c Kotlinify ReactYogaConfigProvider (#43773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43773

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55638955

fbshipit-source-id: 068e0e43367e8f11d43dcbd811b881bdc27d801c
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 16fd4e4c0f Kotlinify ReactInvalidPropertyException (#43759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43759

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55633375

fbshipit-source-id: 5b934ec2295c2f276249588f293fd56e243fb347
2024-04-02 16:17:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 0a1a7cafa3 Kotlinify ReactConstants (#43758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43758

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55632715

fbshipit-source-id: 9461c131ba250061647b37a5dcc20de10ee8393d
2024-04-02 16:17:39 -07:00
Alan LeeandFacebook GitHub Bot e5db122924 Convert WindowOverlayCompat to Kotlin (#43749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43749

Convert Java to Kotlin: `react/devsupport/WindowOverlayCompat.java`

Changelog:
[Internal] internal

Reviewed By: rshest

Differential Revision: D55604746

fbshipit-source-id: 413bf28c8f692e85150a04de05dc7bae324ddd26
2024-04-02 15:12:58 -07:00
Fabrizio CucciandFacebook GitHub Bot 477611c8db Kotlinify InspectorFlags (#43772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43772

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55637558

fbshipit-source-id: b0bcbed4790940e52af6ca82c0ee50e6a4fd510c
2024-04-02 13:43:39 -07:00
Fabrizio CucciandFacebook GitHub Bot 9bebab5ab1 Kotlinify LayoutDeleteAnimation (#43741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43741

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55589024

fbshipit-source-id: dc14584b0f52fb20ba2b533c48de062824757256
2024-04-02 13:43:39 -07:00
Jakub GrzywaczandFacebook GitHub Bot 493dbb2190 Remove AutoFill from context menu when using contextMenuHidden (#43468)
Summary:
This pull request resolves the issue https://github.com/facebook/react-native/issues/43452
Previously, when utilizing `contextMenuHidden`, the context menu wasn't entirely hidden as the "AutoFill" option remained visible. However, it's now possible to eliminate it using the menu builder.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[IOS] [FIXED] - hide AutoFill from context menu when using `contextMenuHidden`

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

Test Plan:
Manual tests in RNTester:

https://github.com/facebook/react-native/assets/39670088/dc0f828c-f613-412d-b560-f3b795dd3ffb

Reviewed By: javache

Differential Revision: D54902269

Pulled By: tdn120

fbshipit-source-id: e0f3d3b5a0817db1c072caf2f01648432c7d868d
2024-04-02 12:22:32 -07:00
Arushi KesarwaniandFacebook GitHub Bot 3571f9a5c8 Migrate JSCInstance to Kotlin (#43750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43750

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D55610929

fbshipit-source-id: eb269bdb9a2d123605ae07d86739b32c576f5fa5
2024-04-02 12:18:50 -07:00
Fabrizio CucciandFacebook GitHub Bot 1252f63c18 Kotlinify LayoutCreateAnimation (#43740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43740

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55588908

fbshipit-source-id: 4e502e32e6b43ca1df866ab7ba4653d3cee0ec65
2024-04-02 12:05:06 -07:00
Eric RozellandFacebook GitHub Bot 1a164fae6a Avoid shared_mutex re-entrancy for setNativeProps_DEPRECATED (#43777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43777

It's best to avoid mutex reentrancy, even when using "read" locks (i.e., std::shared_lock). Since we already have a read lock on the ShadowTree in `UIManager::setNativeProps_DEPRECATED`, we can avoid the reentrancy by grabbing ancestor node from the shadow tree instead of relying on a recursive call to ShadowTreeRegistry::visit

## Changelog

[GENERAL][FIXED] - Avoid ShadowTreeRegistry::mutex_ read lock reentrancy

Reviewed By: rubennorte

Differential Revision: D55640201

fbshipit-source-id: 7a5c6674d290ea280ab584ae734733f12a65f6f8
2024-04-02 11:55:07 -07:00
Alex HuntandFacebook GitHub Bot 0b23ff6631 Add capability flag to select rn_fusebox debugger frontend (#43688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43688

Context: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/34.

Changelog: [Internal]

Reviewed By: EdmondChuiHW

Differential Revision: D55474522

fbshipit-source-id: 4f514dba228bfa4df41a0eb9687f2525cc32b2d7
2024-04-02 10:12:49 -07:00
Pieter De BaetsandFacebook GitHub Bot d195fd0c06 Use useDevSupport instead of ReactHostImpl.DEV (#43673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43673

Changelog: [Android][Changed] In bridgeless, `useDevSupport` now is configurable by ReactNativeHost.

Reviewed By: cortinico

Differential Revision: D55365753

fbshipit-source-id: 691ceb648be30029e753b234038c0997aa59ffd8
2024-04-02 09:39:04 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 0c02b26c1e fix: remove loadSourceForBridge in RCTRootViewFactory (#43656)
Summary:
This PR removes forward declaration of `loadSourceForBridge` methods from the RCTRootViewFactory as it was causing an issue on old architecture, where the RedBox wouldn't popup when metro wasn't running.

As stated by Kudo [here](https://github.com/reactwg/react-native-releases/issues/177):

> the problem was coming from the implementation
> https://github.com/facebook/react-native/blob/00725fadff28bb3c7fed65f208e647f0dab69e75/packages/react-native/React/CxxBridge/RCTCxxBridge.mm#L519-L540
>
> we should dynamically override loadSourceForBridge:onProgress:onComplete: and loadSourceForBridge:withBlock: in RCTRootViewFactory only when AppDelegate override it. one way to achieve this might be tricky that we may need to override respondsToSelector:.
>
> otherwise, we could just skip the loadSourceForBridge:onProgress:onComplete: and loadSourceForBridge:withBlock: support.

There is no straight forward solution to implement this without some _hacks_ so I'm removing this forward block for now.

## Changelog:

[IOS] [FIXED] - remove loadSourceForBridge in RCTRootViewFactory

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

Test Plan: CI Green

Reviewed By: rshest

Differential Revision: D55485094

Pulled By: cortinico

fbshipit-source-id: 1e391e0795c3d99686f2805165f64a7715b013f6
2024-04-02 06:46:23 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot c32a053722 Fix broken build due to a land time race
Summary:
With D55574528 and D55623682 having landed concurrently, and the latter enabling warnings-as-errors for Kotlin files vs the former having one such warning, this caused a build breakage.

This diff fixes  it.

Reviewed By: andrewdacenko

Differential Revision: D55636176

fbshipit-source-id: 781b8cf40a4e9aa8a3da3005d26dca975f146c09
2024-04-02 06:40:01 -07:00
Rubén NorteandFacebook GitHub Bot 2f1643dc0c Remove unnecessary wrapper from Performance/PerformanceObserver examples screen in RNTester (#43706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43706

Changelog: [internal]

Just a small improvement of the UI for the Performance API examples in RNTester.

Reviewed By: christophpurrer

Differential Revision: D55489933

fbshipit-source-id: a1fe4f4962227941827f02cf18a0d4685e18f006
2024-04-02 06:27:05 -07:00
Rubén NorteandFacebook GitHub Bot f9c61f6ecd Remove unnecessary UNDEFINED entry type from PerformanceObserver (#43701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43701

Changelog: [internal]

We were defining an `UNDEFINED` type of entry that should never happen in practice and we were using unnecessarily to signal "no type" where an optional type would be more suitable. Most importantly, **we were incorrectly allocating a buffer for entries of this type**.

This removes that type and the unnecessary buffer.

Reviewed By: rshest

Differential Revision: D55478890

fbshipit-source-id: 145210a9c4e2614a342f2d913b9eb6b3d62f676f
2024-04-02 06:27:05 -07:00
Rubén NorteandFacebook GitHub Bot 9284fcb97f Use C++20 designated initializers in PerformanceEntryReporter (#43702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43702

Changelog: [internal]

Just a minor refactor to use C++20 designated initializers in `PerformanceEntryReporter` and its tests, while removing unnecessary initialization for optional fields.

Reviewed By: rshest

Differential Revision: D55477745

fbshipit-source-id: a643adf7ae48df23c5c383420fd4c4dd550e1322
2024-04-02 06:27:05 -07:00
Rubén NorteandFacebook GitHub Bot 20598949c8 Fix measure not using the last reported mark with a given name (#43703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43703

Changelog: [internal]

(internal because this API isn't available in OSS yet)

I found a bug in the current implementation of `performance.measure` where the API would use the first `mark` reported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button).

The root cause for this problem is that we were using `insert` from `std::unordered_set` to update the value, but `insert` doesn't modify the value if it's already present.

This fixes the issue by doing a lookup and removing the value prior to inserting it.

Reviewed By: rshest

Differential Revision: D55477743

fbshipit-source-id: e72aa784a936828db64b572988fe0acb2ad78214
2024-04-02 06:27:05 -07:00
Rubén NorteandFacebook GitHub Bot 636289c441 Add example of performance.mark and performance.measure in RNTester (#43704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43704

Changelog: [internal]

Adding examples of the rest of APIs in `Performance`/`PerformanceObserver` starting with marks and measures.

Reviewed By: rshest

Differential Revision: D55477746

fbshipit-source-id: 965796b6a97dc527192093e3c93af837a4d5b714
2024-04-02 06:27:05 -07:00
Rubén NorteandFacebook GitHub Bot fa47c27eae Support dark theme in PerformanceApiExample in RNTester (#43705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43705

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D55477744

fbshipit-source-id: 6960366330343678e493dd54292bda7df5a61e6a
2024-04-02 06:27:05 -07:00
Alex HuntandFacebook GitHub Bot 1dea81cc10 Add changelog for 0.74.0-rc.6 (#43762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43762

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55635543

fbshipit-source-id: e4470cb72d1fe41e23f26a40bc55bde54e57e9b6
2024-04-02 05:58:40 -07:00
Nick GerlemanandFacebook GitHub Bot 2ba07df426 Update align-content handling of overflow (#43752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43752

Gentest tests started failing because Chrome changed behavior of overflowed align-content container. Spec says should fallback to "safe center", which is really just "start", instead of previous "center" behavior. This changes behavior accordingly.

There is one bit where I think we are doing the wrong thing wrt alignment of flex start vs start (which we don't support yet), but couldn't repro a failing chrome test.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D55617689

fbshipit-source-id: 08f23d198c75f2c2f51ccaa8795289e6e4a92cb8
2024-04-02 04:47:09 -07:00
Fabrizio CucciandFacebook GitHub Bot 584e8b90be Kotlinify NoSuchNativeViewException (#43739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43739

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55588272

fbshipit-source-id: 6dff095322959e9eada0fc50ca18da870053cc52
2024-04-02 04:38:39 -07:00
Rob AndersonandFacebook GitHub Bot 036ffbc530 convert circleci workflows to github actions for android build and test (#43644)
Summary:
This pull request converts the CircleCI workflows to GitHub actions workflows. This change only inlcudes the android build and test jobs.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
[Here is the latest workflow run in my fork](https://github.com/robandpdx-org/react-native/actions/runs/8426560047).

 ---
https://fburl.com/workplace/f6mz6tmw

Reviewed By: NickGerleman

Differential Revision: D55417814

Pulled By: cortinico

fbshipit-source-id: 918c6be6fa06bb6605fad6efe21def5fe397f024
2024-04-02 04:04:34 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot db60eca6d0 Migrate react/devsupport/LogBox*.java to Kotlin (#43730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43730

# Changelog:
[Internal] -

As in the title, converts corresponding type declarations in `react/devsupport/LogBox*.java` to Kotlin.

Reviewed By: NickGerleman

Differential Revision: D55574528

fbshipit-source-id: 56cf5de75d18cd73929cb7f0c9375a3f62e83574
2024-04-02 03:29:30 -07:00
Nick GerlemanandFacebook GitHub Bot 15a965f0f2 Enable Kotlin warnings as errors in rn_android_library (#43755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43755

This is another place where the OSS build went ahead of the internal source of truth, which has caused build breaks more than once.

This enables warnings as errors in `rn_android_library` for consistency. This is used for a couple libraries outside of ReactAndroid that might need fixup/suppression.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55623682

fbshipit-source-id: 37da30c642de2c3d8390334a0d0bff365a4ed7a1
2024-04-02 03:21:55 -07:00
Fabrizio CucciandFacebook GitHub Bot d6fbc6b241 Kotlinify ViewDefaults (#43738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43738

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: rshest

Differential Revision: D55584737

fbshipit-source-id: 1b009ac9cc7f7670ee36d705d0439c0743bd5165
2024-04-02 02:47:48 -07:00
Nick GerlemanandFacebook GitHub Bot ac74bd8c64 Fix PixelUtil OSS Build failure (#43754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43754

Moves off of deprecated `DisplayMetrics.scaledDensity` API to builtin font scaling API, while still clamping to max multiplier using previous logic.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55623674

fbshipit-source-id: 2668eea8dbd154cc046e2c515323ad66b289dc64
2024-04-02 01:52:39 -07:00
Nick GerlemanandFacebook GitHub Bot 2477fbc600 Back out "fix: prevent error when react extension was already created" (#43753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43753

New build failures when this was merged seem likely related.

```
FAILURE: Build failed with an exception.

* Where:
Build file '/root/react-native/packages/react-native/ReactAndroid/build.gradle.kts' line: 784

* What went wrong:
Script compilation errors:

  Line 784: react {
            ^ Unresolved reference: react

  Line 787:   libraryName = "rncore"
              ^ Unresolved reference: libraryName

  Line 788:   jsRootDir = file("../src")
              ^ Unresolved reference: jsRootDir
```

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D55618667

fbshipit-source-id: 1a188ba31b013863f3d46a773ff3ebbdd5f696cb
2024-04-01 19:50:33 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 08f57473cc Convert react/uimanager/*Util.java -> Kotlin (#43729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43729

# Changelog:
[Internal] -

As in the title, converts corresponding type declarations in `react/uimanager/*Util.kt` to Kotlin.

Reviewed By: tdn120

Differential Revision: D55574531

fbshipit-source-id: 974234bd57c77e863aa723388e48ffc455e73a96
2024-04-01 16:17:13 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 287b5d697f LayoutAnimation types to Kotlin (#43728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43728

# Changelog:
[Internal] -

As in the title, converts corresponding type declarations in `react/uimanager/layoutanimation/*Type.kt` to Kotlin.

Differential Revision: D55574530

fbshipit-source-id: 8527b5c9b491435c60ed9c05092ffeccd7552f9c
2024-04-01 12:37:48 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 1e44cbe9f4 Migrate ErrorType.java to Kotlin (#43727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43727

# Changelog:
[Internal] -

As in the title, converts this one particular Java file to Kotlin.

Reviewed By: arushikesarwani94

Differential Revision: D55574526

fbshipit-source-id: 04af5b870670a5560eaba7ab8c029c580032d09a
2024-04-01 12:37:48 -07:00
Tommy NguyenandFacebook GitHub Bot 489d9f6c62 fix: version checker not considering nightlies (#43712)
Summary:
Fix version checker not considering nightlies:

```
  WARNING: You should run npx react-native@latest to ensure you're always using the most current version of the CLI. NPX
 has cached version (0.74.0-nightly-20240214-b8ad91732) != current release (0.73.6)
```

## Changelog:

[GENERAL] [FIXED] - Fix version checker not considering nightlies

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

Test Plan: On a recent nightly version, run any cli command.

Reviewed By: rshest

Differential Revision: D55525055

Pulled By: zeyap

fbshipit-source-id: 6dd08e30e542d9ddd191bf95c968a26c0cc14e4e
2024-04-01 12:37:05 -07:00
Alexander EggersandFacebook GitHub Bot b9dad7fc0c fix: prevent error when react extension was already created (#43694)
Summary:
Currently the react-native-gradle-plugin does not allow the "react" plugin extension to already exist when running its apply block. I had a use-case where I wanted to create a new gradle plugin which would take care of applying the react plugin including setting some of its options. Without the change in this PR, this would currently turn into a build failure.

## Changelog:

[ANDROID] [FIXED] - prevent error when the "react" extension was already created by another gradle plugin

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

Reviewed By: rshest

Differential Revision: D55478611

Pulled By: zeyap

fbshipit-source-id: cc743a99cb72ed315d21c52597efd5ee92a3be62
2024-04-01 11:31:53 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 220588004b ImageResizeMethod/Mode to Kotlin (#43725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43725

## Changelog:
[Internal] -

Converts `react/views/image/ImageResizeMethod.java` and `react/views/image/ImageResizeMode.java` to Kotlin.

Grouped together, as it kind of makes sense.

Reviewed By: fabriziocucci

Differential Revision: D55574319

fbshipit-source-id: 5fb47425e1eb0fca1e06527e16e994d659a749a8
2024-03-31 16:14:53 -07:00
Rob HoganandFacebook GitHub Bot 8769378e0d Delete unused RCT_ENABLE_LOADING_FROM_PACKAGER (#43677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43677

Remove `RCT_ENABLE_LOADING_FROM_PACKAGER` from `RCTDefines`, as it is not referenced anywhere and does nothing.

Changelog: [Internal]

Reviewed By: hoxyq, realsoelynn

Differential Revision: D55421282

fbshipit-source-id: ae29a8a421a6cc23d863b489eae2175392f684cd
2024-03-31 08:46:03 -07:00
Ramanpreet NaraandFacebook GitHub Bot fa4bfde630 Revert D55505416: Pull react instance method impls out of ReactContext
Differential Revision:
D55505416

Original commit changeset: ce1e3ab379eb

Original Phabricator Diff: D55505416

fbshipit-source-id: ae988ae3464f40923521922d4c3ac4a57846a3ef
2024-03-31 06:10:45 -07:00
Ramanpreet NaraandFacebook GitHub Bot 14fb1cc335 Pull react instance method impls out of ReactContext
Summary:
## Context
Prior, ReactContext used to implement bridge logic.

For bridgeless mode, we created BridgelessReactContext < ReactContext

## Problem

This could lead to failures: we could call bridge methods in bridgeless mode.

## Changes
Primary change:
- Make all the react instance methods inside ReactContext abstract.

Secondary changes: Implement react instance methods in concrete subclasses:
- **New:** BridgeReactContext: By delegating to CatalystInstance
- **New:** ThemedReactContext: By delegating to inner ReactContext
- **Unchanged:** BridgelessReactContext: By delegating to ReactHost

## Auxiliary changes
This fixes ThemedReactContext in bridgeless mode.

**Problem:** Prior, ThemedReactContext's react instance methods did not work in bridgeless mode: ThemedReactContext wasn't initialized in bridgeless mode, so all those methods had undefined behaviour.

**Solution:** ThemedReactContext now implements all react instance methods, by just forwarding to the initialized ReactContext it decorates (which has an instance).

Changelog: [Android][Removed] Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead.

 ---

Reviewed By: fkgozali

Differential Revision: D55505416

fbshipit-source-id: ce1e3ab379eb788d26130dd44a66544aada3db02
2024-03-30 16:53:30 -07:00
Rob HoganandFacebook GitHub Bot e05319cc87 Inspector proxy: catch and report errors in device message handling (#43697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43697

Currently, messages from a device are handled by async handlers added to a promise chain.

If a handler rejects, the end of the chain becomes a rejected promise, picked up only asynchronously by Metro's global `unhandledRejection` handler.

This triggers a warning from Node.js, and worse, prevents any `then()` callback chained by subsequent messages from being invoked at all.

Handlers *should* attempt to gracefully deal with errors (as we do with source map fetching errors, for example), but this diff adds a catch-all fallback for anything we might've missed (in this case, a frontend socket disconnecting while we're busy fetching a source map). Errors are caught and logged to EventReporter.

**To follow**: Gracefully handle socket disconnections while an async handler is working or queued.

Changelog:
[General][Fixed] Inspector proxy: prevent errors proxying a device message from blocking the handler queue or spamming logs.

Reviewed By: EdmondChuiHW

Differential Revision: D55482735

fbshipit-source-id: bb726218495e105f9cb4f723a1d110c9815abdef
2024-03-30 15:29:47 -07:00
Christoph PurrerandFacebook GitHub Bot 04bf8cfb23 Clean up old Cxx TM member generation (#43710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43710

As we had already cut a branch for RN 0.74
https://github.com/facebook/react-native/releases/tag/v0.74.0-rc.1

We can delete this code already

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D55511382

fbshipit-source-id: 3ef15af338b5ad31b02e0a1eed7ac873566d9562
2024-03-29 14:39:24 -07:00
Alex Taylor (alta)andFacebook GitHub Bot 1b4a0cd9f2 Use hook syntax for builtin React hooks in xplat (1/2) (#43714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43714

Migrate React builtin hooks to use the new React "hook" type. This diff converts all builtin hooks except for `useContext` which will be updated after the next flow release.

Details:
- Announcement: https://fb.workplace.com/groups/react.fyi/posts/7642294409114198
- Docs: https://www.internalfb.com/intern/wiki/Component_Syntax_Documentation/Hook_syntax_0/
- Support group: https://fb.workplace.com/groups/749069370011855

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D55500989

fbshipit-source-id: 8a13898b1d2e851dfc2afed3b41e0f1a6332b6bd
2024-03-29 14:24:01 -07:00
Nick GerlemanandFacebook GitHub Bot 3f88821167 Avoid TextInput example styles causing non-deterministic rendering on iOS (#43599)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43599

iOS E2E tests non-deterministic rendering happens around examples with a border set to `StyleSheet.hairlineWidth`. That value has special subpixel math, that doesn't seem to render consistently on iOS (this is its own bug).

To unblock adding some new E2E iOS TextInput tests, this removes usage of `hairlineWidth` in styles, and more generally, tries to unify TextInput styles in the examples.

This will break a whole bunch of RNTester Jest E2E baselines on different apps, which I will update from land-time runs or after continuous builds are available for different endpoints.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D55213090

fbshipit-source-id: 6d81b9355adc538a3ade6f50ef93c3ca08782ae7
2024-03-29 02:41:26 -07:00
78d6873b04 Don't Rethrow Errors at the Root (#28627)
Summary:
Stacked on top of #28498 for test fixes.

### Don't Rethrow

When we started React it was 1:1 setState calls a series of renders and
if they error, it errors where the setState was called. Simple. However,
then batching came and the error actually got thrown somewhere else.
With concurrent mode, it's not even possible to get setState itself to
throw anymore.

In fact, all APIs that can rethrow out of React are executed either at
the root of the scheduler or inside a DOM event handler.
If you throw inside a React.startTransition callback that's sync, then
that will bubble out of the startTransition but if you throw inside an
async callback or a useTransition we now need to handle it at the hook
site. So in 19 we need to make all React.startTransition swallow the
error (and report them to reportError).

The only one remaining that can throw is flushSync but it doesn't really
make sense for it to throw at the callsite neither because batching.
Just because something rendered in this flush doesn't mean it was
rendered due to what was just scheduled and doesn't mean that it should
abort any of the remaining code afterwards. setState is fire and forget.
It's send an instruction elsewhere, it's not part of the current
imperative code.

Error boundaries never rethrow. Since you should really always have
error boundaries, most of the time, it wouldn't rethrow anyway.

Rethrowing also actually currently drops errors on the floor since we
can only rethrow the first error, so to avoid that we'd need to call
reportError anyway. This happens in RN events.

The other issue with rethrowing is that it logs an extra console.error.
Since we're not sure that user code will actually log it anywhere we
still log it too just like we do with errors inside error boundaries
which leads all of these to log twice.
The goal of this PR is to never rethrow out of React instead, errors
outside of error boundaries get logged to reportError. Event system
errors too.

### Breaking Changes

The main thing this affects is testing where you want to inspect the
errors thrown. To make it easier to port, if you're inside `act` we
track the error into act in an aggregate error and then rethrow it at
the root of `act`. Unlike before though, if you flush synchronously
inside of act it'll still continue until the end of act before
rethrowing.

I expect most user code breakages would be to migrate from `flushSync`
to `act` if you assert on throwing.

However, in the React repo we also have `internalAct` and the
`waitForThrow` helpers. Since these have to use public production
implementations we track these using the global onerror or process
uncaughtException. Unlike regular act, includes both event handler
errors and onRecoverableError by default too. Not just render/commit
errors. So I had to account for that in our tests.

We restore logging an extra log for uncaught errors after the main log
with the component stack in it. We use `console.warn`. This is not yet
ignorable if you preventDefault to the main error event. To avoid
confusion if you don't end up logging the error to console I just added
`An error occurred`.

### Polyfill

All browsers we support really supports `reportError` but not all test
and server environments do, so I implemented a polyfill for browser and
node in `shared/reportGlobalError`. I don't love that this is included
in all builds and gets duplicated into isomorphic even though it's not
actually needed in production. Maybe in the future we can require a
polyfill for this.

### Follow Ups

In a follow up, I'll make caught vs uncaught error handling be
configurable too.

---------

DiffTrain build for commit https://github.com/facebook/react/commit/6786563f3cbbc9b16d5a8187207b5bd904386e53.

Changelog:
[Internal]

Reviewed By: kassens

Differential Revision: D55408481

Pulled By: yungsters

fbshipit-source-id: 598aa306369e21cb3e93ad6041a87bfbaa9eef9e

Co-authored-by: Ricky Hanlon <rickhanlonii@gmail.com>
2024-03-29 01:42:24 -07:00
Tim YungandFacebook GitHub Bot e175912e7d RN: Fix Open Source Test Scripts
Summary:
Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D55502889

fbshipit-source-id: aabba96bd816982f7bce9cbd752ba9eee409bbf6
2024-03-29 01:42:24 -07:00
TatianaKaposandFacebook GitHub Bot d0cac87c6e Fix [Windows]: Rename utils/jsi files (#43700)
Summary:
This PR: https://github.com/facebook/react-native/pull/42801/files#diff-ff466c93fb60f2b0e79ed187f492c9935349a2b2f2a7300b310e2bb30e31c33e creates a new jsi.h and jsi.cpp file in ReactCommon. On windows, even though the files have different paths, MSVC doesn't allow two files to have the same name in the same project. This PR changes the name of the new jsi.h and jsi.cpp files.

## Changelog:

[General][Fixed] - Rename utils/jsi files

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

Test Plan: tested on windows

Reviewed By: zeyap

Differential Revision: D55491700

Pulled By: arushikesarwani94

fbshipit-source-id: 2995c0602a9528ed0f8e8eb2230945cb6bd516e9
2024-03-28 20:03:38 -07:00
Viresh UmbreandFacebook GitHub Bot f7ec4694a6 Revert D53145010: Pull react instance method impls out of ReactContext
Differential Revision:
D53145010

Original commit changeset: 2405bc24afb0

Original Phabricator Diff: D53145010

fbshipit-source-id: 2d37cef8f6b6810f9b114ea633373668bcc805dc
2024-03-28 16:14:07 -07:00
Fabrizio BertoglioandFacebook GitHub Bot f6badca2f9 Fix Multiline TextInput with a fixed height scrolls to the bottom when prepending new lines to the text (#38679)
Summary:
### Please re-state the problem that we are trying to solve in this issue.

Multiline TextInput with a fixed height will scroll to the bottom of the screen when prepending new lines to the text.

### What is the root cause of that problem?

The issue is caused by iOS UITextView:
- The cursor moves to the end of the text when prepending new lines.
- Moving the cursor to the end of the text triggers the scroll to the bottom.

The behavior was reproduced on an iOS App (without react-native).
The example included below implements a Component RCTUITextView based on UITextView, which modifies the UITextView attributedText with the textViewDidChange callback (source code available in this [comment](https://github.com/Expensify/App/issues/19507#issuecomment-1595730348)).

Adding a new line on top of the UITextView on iOS results in:
Issue 1) The cursor moves to the end of TextInput text
Issue 2) The TextInput scrolls to the bottom

<details><summary>Reproducing the issue on an iOS App without react-native</summary>
<p>

<video src="https://user-images.githubusercontent.com/24992535/246601549-99f480f3-ce80-4678-9378-f71c8aa67e17.mp4" width="900" />

</p>
</details>

Issue 1) is already fixed in react-native, which restores the previous cursor position (on Fabric with  [_setAttributedString](https://github.com/fabriziobertoglio1987/react-native/blob/71e7bbbc2cf21abacf7009e300f5bba737e20d17/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm#L600-L610)) after changing the text.
Issue 2) needs to be fixed in react-native.

### What changes do you think we should make in order to solve the problem?

Setting the correct TextInput scroll position after re-setting the cursor.

## Changelog:

[IOS] [FIXED] - Fix Multiline TextInput with a fixed height scrolls to the bottom when changing AttributedText

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

Test Plan:
Fabric (reproduces on controlled/not controlled TextInput example):

| Before    | After |
| ----------- | ----------- |
| <video src="https://github.com/facebook/react-native/assets/24992535/e06b31fe-407d-4897-b608-73e0cc0f224a" width="350" />      | <video src="https://github.com/facebook/react-native/assets/24992535/fa2eaa31-c616-43c5-9596-f84e7b70d80a" width="350" />       |

Paper (reproduces only on controlled TextInput example):

```javascript
function TextInputExample() {
  const [text, setText] = React.useState('');

  return (
    <View style={{marginTop: 200}}>
      <TextInput
        style={{height: 50, backgroundColor: 'white'}}
        multiline={true}
        value={text}
        onChangeText={text => {
          setText(text);
        }}
      />
    </View>
  );
}
```

| Before    | After |
| ----------- | ----------- |
| <video src="https://github.com/facebook/react-native/assets/24992535/6cb1f2de-717e-4dce-be0a-644f6a051c08" width="350" />      | <video src="https://github.com/facebook/react-native/assets/24992535/dee6edb6-76c6-48b0-b78f-99626235d30e" width="350" />       |

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D48674090

Pulled By: NickGerleman

fbshipit-source-id: 349e7b0910e314ec94b45b68c38571fed41ef117
2024-03-28 16:05:06 -07:00
Rob HoganandFacebook GitHub Bot fd1e5e7063 Inspector proxy: Fix "Buffer() is deprecated" warning (#43686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43686

Under Node 20, the use of `new Buffer(string)` is deprecated and logs a warning. This replaces it with the recommended `Buffer.from(string)`.

Changelog:
[General][Fixed] FIx "Buffer() is deprecated" warning from debugger proxy.

Reviewed By: huntie

Differential Revision: D55472025

fbshipit-source-id: 8b5af9e2d7e026cbdf6aa68f71ff0f856fb164db
2024-03-28 15:17:02 -07:00
Samuel SuslaandFacebook GitHub Bot 164815a03b return correct isAccessibilityElement from RCTViewComponentView (#43698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43698

changelog: [internal]

RCTViewComponentView was missing isAccessibilityElement override. Here I add it and use contentView to determine if element is accessible.

Reviewed By: rubennorte

Differential Revision: D55483944

fbshipit-source-id: f29c82a42d17140ae421f27871a3bf6f7f36bc12
2024-03-28 15:13:48 -07:00
Ramanpreet NaraandFacebook GitHub Bot f99dc486cd Pull react instance method impls out of ReactContext
Summary:
## Context
Prior, ReactContext used to implement bridge logic.

For bridgeless mode, we created BridgelessReactContext < ReactContext

## Problem

This could lead to failures: we could call bridge methods in bridgeless mode.

## Changes
Primary change:
- Make all the react instance methods inside ReactContext abstract.

Secondary changes: Implement react instance methods in concrete subclasses:
- **New:** BridgeReactContext: By delegating to CatalystInstance
- **New:** ThemedReactContext: By delegating to inner ReactContext
- **Unchanged:** BridgelessReactContext: By delegating to ReactHost

## Auxiliary changes
This fixes ThemedReactContext in bridgeless mode.

**Problem:** Prior, ThemedReactContext's react instance methods did not work in bridgeless mode: ThemedReactContext wasn't initialized in bridgeless mode, so all those methods had undefined behaviour.

**Solution:** ThemedReactContext now implements all react instance methods, by just forwarding to the initialized ReactContext it decorates (which has an instance).

Changelog: [Android][Removed] Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead.

Reviewed By: javache

Differential Revision: D53145010

fbshipit-source-id: 2405bc24afb00864117d3c504fc9c4cbffd7203a
2024-03-28 14:31:51 -07:00
Nicola CortiandFacebook GitHub Bot 5ceb92801e Flip explicitApi to True for everyone (#43696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43696

This just sets explicitApi to true for every module inside ReactAndroid

Changelog:
[Internal] [Changed] - Flip explicitApi to True for everyone

Reviewed By: tdn120

Differential Revision: D55478674

fbshipit-source-id: c9aeba89ad5b0f88bca7fd480c6aa66e0152a456
2024-03-28 14:22:28 -07:00
Dmitry RykunandFacebook GitHub Bot 95a881b80c Set HERMES_RELEASE_VERSION correctly (#43699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43699

This diff initializes `RELEASE_VERSION` with the value that is provided by the `get_react_native_version` job (it stores its output into `/tmp/react-native-version`).

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D55484988

fbshipit-source-id: f0b5bb473096f3691f50152beb3181a454916fdc
2024-03-28 14:17:31 -07:00
Edmond ChuiandFacebook GitHub Bot af309127a4 Add support for launch ID (#43585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43585

Changelog: [internal]

Related PR: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/27

Reviewed By: hoxyq

Differential Revision: D55164646

fbshipit-source-id: 0f25f150603a24654020093697e76d85d0d8cc02
2024-03-28 13:48:30 -07:00
Dmitry RykunandFacebook GitHub Bot 07f38ea9f1 Move IOS_DEPLOYMENT_TARGET and MAC_DEPLOYMENT_TARGET to the command body
Summary:
This diff moves IOS_DEPLOYMENT_TARGET and MAC_DEPLOYMENT_TARGET definitions to the command body.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D55478563

fbshipit-source-id: bae327edbaf88a9e8b39b304d938389e3fc56f4f
2024-03-28 13:38:53 -07:00
Ruslan LesiutinandFacebook GitHub Bot ad9368068a fix[android]: fix bridgeless configuration to include DebuggingOverlay in react packages (#43661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43661

# Changelog: [Internal]

1. Remove `BridgelessDebugReactPackage.java`, this was added in D43407534. Technically, its the same as `DebugCorePackage.java`.
2. `ReactInstance` to add `DebugCorePackage`, so `DebuggingOverlay` view manager will be included in the bridgeless build.
3. Fix `RNTesterApplication.kt` to NOT create `MyLegacyViewManager` for every possible viewManagerName, apart from `"RNTMyNativeView"`, return null instead.

Reviewed By: cortinico

Differential Revision: D55375350

fbshipit-source-id: 1d3cb6b5ad3c0248df1def9f37c8c49b308f4473
2024-03-28 11:06:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 4841373719 fix: defer ReactDevToolsOverlay import (#43690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43690

# Changelog: [Internal]

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

The issue is that once `getInspectorDataForViewAtPoint` is imported, it should throw if RDT global hook was not injected. ReactDevTools overlay imports `getInspectorDataForViewAtPoint`, this is why it did throw in testing environment.

ReactDevToolsOverlay JSX-element is already gated with RDT global hook check, adding a deferred import, same as it was already implemented for Inspector.

Still unclear to me how this didn't throw all this time while using the Catalyst / RNTester.

Reviewed By: cortinico

Differential Revision: D55474774

fbshipit-source-id: 759e5e8227cc7534193e5b95616b6099c15f5cb5
2024-03-28 10:06:53 -07:00
Chiara MooneyandFacebook GitHub Bot 8e7263a415 Add forwardRef call to Button Component (#43666)
Summary:
When RN moved Button component from a class component to a function component (https://github.com/facebook/react-native/commit/07e8ae42bed71f54bbe0e786ccad88b2f14648a4) a forwardRef call was not added to the Button control. This caused a set of tests downstream in React Native for Windows to fail because they rely on being able to pass a ref through to the Button control.

## Changelog:
[GENERAL] [FIXED] - Adds forwardRef call to new functional component implementation of Button control.

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

Test Plan: Button render remains the same.

Reviewed By: fabriziocucci

Differential Revision: D55398765

Pulled By: zeyap

fbshipit-source-id: ba32c764c16cb529ab1c92cb7888f2bae0f16f5f
2024-03-28 09:40:48 -07:00
Rubén NorteandFacebook GitHub Bot 66634be13a Dispatch notifications from MutationObserver as microtasks if available (#43664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43664

Changelog: [internal]

Now that we have the event loop, we can modify the implementation of `MutationObserver` (which is still not enabled by default) to dispatch the notifications as microtasks, making the API more spec-compliant.

Reviewed By: javache

Differential Revision: D55380178

fbshipit-source-id: f876ffba49f9744f6603053f1485e7c2f43cb230
2024-03-28 08:06:41 -07:00
Rubén NorteandFacebook GitHub Bot 5d0056b6e8 Move IntersectionObserver native module to common directory (#43672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43672

Changelog: [internal]

Small cleanup to move the last C++ native module defined in a JS directory to the new directory in `react-native/ReactCommon/react/nativemodule`.

Reviewed By: javache

Differential Revision: D55384106

fbshipit-source-id: 3bf477c2aceab6838f7f8131174b6eb74e890a23
2024-03-28 08:06:41 -07:00
Rubén NorteandFacebook GitHub Bot 368130d77b Move MutationObserver native module to common directory (#43663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43663

Changelog: [internal]

We have a new directory for built-in C++ native modules, but the native modules for `MutationObserver` and `IntersectionObserver` were created before we had it.

This moves the native module for `MutationObserver` to `react-native/ReactCommon/react/nativemodule/mutationobserver` to follow the convention.

Reviewed By: javache

Differential Revision: D55380179

fbshipit-source-id: 0c64acbec973f2e5b57a0e38a0992bba49a01a45
2024-03-28 08:06:41 -07:00
Rubén NorteandFacebook GitHub Bot 3da58585d0 Include native module for DOM APIs by default in all apps using the new architecture (#43653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43653

Changelog: [internal]

This will allow us to clean up some code in `UIManager` (using methods in the native module instead) and prepare to use the DOM APIs in OSS behind a feature flag.

This doesn't enable the DOM APIs in OSS, only the native module.

Reviewed By: javache

Differential Revision: D55365252

fbshipit-source-id: 70ec0eb022df586ad554c5b8ce6915b8ceddef5f
2024-03-28 08:06:41 -07:00
szymonrybczakandFacebook GitHub Bot 32c2322668 Upgrade @react-native-community/cli to v14.0.0-alpha.2 (#43682)
Summary:
Upgrade `react-native-community/cli` to v14.0.0-alpha.2

## Changelog:

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to v14.0.0-alpha.2

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

Test Plan: CI

Reviewed By: cortinico

Differential Revision: D55430957

Pulled By: zeyap

fbshipit-source-id: 5b715b4b1e79ee81df922be6ab2b5b8b2315456d
2024-03-28 07:40:16 -07:00
Arushi KesarwaniandFacebook GitHub Bot 41a966458c DisabledDevSupportManager -> ReleaseDevSupportManager (#43667)
Summary:
allow-large-files

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

Renaming `DisabledDevSupportManager` -> `ReleaseDevSupportManager` to avoid confusion since this is only initialized in Release variant
https://github.com/facebook/react-native/blob/bb02049a6af2c83c3fa633a5eb098bae1135b4a4/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java#L181-L187

Changelog:
[Internal] Internal

Reviewed By: fkgozali, cortinico

Differential Revision: D55388403

fbshipit-source-id: 984b54f1666ad39301cb94d2b8c19b7504c997f6
2024-03-28 05:46:41 -07:00
Rubén NorteandFacebook GitHub Bot 2af1da42ff Add legacy layout methods from Fabric to DOM native module (#43659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43659

Changelog: [internal]

This adds an implementation for the legacy layout measurement methods in React Native (`measure`, `measureInWindow` and `measureLayout`) in the DOM native module, so we can clean up the API from the `nativeFabricUIManager` binding.

Reviewed By: javache

Differential Revision: D55368141

fbshipit-source-id: 196d4d29be3b78ffc22fdc136be6e0cf5ab9dd26
2024-03-27 13:04:34 -07:00
Dmitry RykunandFacebook GitHub Bot ff392b0156 Explicitly define IOS_DEPLOYMENT_TARGET and MAC_DEPLOYMENT_TARGET on CircleCI (#43683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43683

This diff adds explicit definitions of IOS_DEPLOYMENT_TARGET and MAC_DEPLOYMENT_TARGET to `build_apple_slices_hermes` and `build_hermes_macos` jobs on CircleCI.
Eventually this will allow us to stop [interacting](https://github.com/facebook/react-native/blob/main/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh#L28) with `hermes-engine.podspec` outside of the CocoaPods execution context, and make our CI jobs less error prone.

Changelog: [Internal]

Reviewed By: fkgozali, cortinico

Differential Revision: D55432703

fbshipit-source-id: dc1cc449ba60340d13db9e4d21970e4e3783f2da
2024-03-27 12:03:15 -07:00
Tomislav NovakandFacebook GitHub Bot 13265ad636 Preserve order of elements after BoundedConsumableBuffer::clear() (#43679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43679

The current implementation of clear-with-predicate first copies unconsumed
elements and then all others. This works correctly when the buffer is full
(wraps around), but fails if size() < maxSize: add() may no longer insert
an element in the correct position (after the last unconsumed entry; see
new unit test).

Replace it with a loop that iterates over all entries in order, and adjusts
cursorStart and cursorEnd to point to the last numToConsume elements of the
vector.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D55273402

fbshipit-source-id: 647dc35faeb35c7fa99b8113cf85ce7f02f073e5
2024-03-27 11:39:06 -07:00
zhongwuzwandFacebook GitHub Bot b1047d49ff Fixes bundle url reset logic (#43680)
Summary:
Fixes bundle url reset logic

## Changelog:

[IOS] [FIXED] - [Fabric] Fixes bundle url reset logic

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

Test Plan: bundle url set works.

Reviewed By: philIip

Differential Revision: D55427061

Pulled By: arushikesarwani94

fbshipit-source-id: 2b26b1f7c51281b7555a8621b97c067eadcf2db3
2024-03-27 10:50:09 -07:00
Samuel SuslaandFacebook GitHub Bot 575507dd61 do not send onScroll event when ScrollView is reused (#43676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43676

changelog: [internal]

calling super invalidates eventEmitter. EventEmitter should be invalidated before reseting contentOffset on `_scrollView. Otherwise, UIScrollView::setContentOffset is called and it calls delegate method: `scrollViewDidScroll`.

Reviewed By: javache

Differential Revision: D55375060

fbshipit-source-id: f697805eb1ca05d15cf498ff9e5e06e90eb7ac56
2024-03-27 09:39:01 -07:00
Pieter De BaetsandFacebook GitHub Bot 59a43e6d5d Unbreak oss build due to explicit API mode (#43660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43660

Changelog: [Internal]

Reviewed By: cortinico, fabriziocucci

Differential Revision: D55375856

fbshipit-source-id: d1df4965549069979410d8b07bb2518264238c8c
2024-03-27 05:50:47 -07:00
Arushi KesarwaniandFacebook GitHub Bot b282e87729 React-Native-Restart in release (#43645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43645

https://github.com/facebook/react-native/pull/43521 & https://github.com/facebook/react-native/pull/43588 aimed to fix `react-native-restart`, however in release `handleReloadJS()` is a no-op in [DisabledDevSupportManager](https://github.com/facebook/react-native/blob/ac714b1c3300d3a169bdcfec05d556e18a7b83ff/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DisabledDevSupportManager.java#L139) which is why this should not work. Fixing it by relying on `ReactHostImpl.reload()` instead for Bridgeless.

Adding implementation of `DisabledDevSupportManager.handleReloadJS()` won't work as it would mean introducing circular dependency `devsupport` -> `runtime`

Reviewed By: cortinico

Differential Revision: D55342296

fbshipit-source-id: ee6fba68586a2bdd1163522f75e6beb1b7736f6c
2024-03-26 19:54:50 -07:00
Kevin GozaliandFacebook GitHub Bot c35630998b Keep ES6Proxy enabled in bridgeless mode (#43538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43538

The Hermes RuntimeConfig for bridgeless accidentally force-disabled ES6Proxy, resulting in https://github.com/facebook/react-native/issues/43523

Let's remove the incorrect override.

To test using RNTester, add the following change:

```
 diff --git a/packages/rn-tester/js/RNTesterAppShared.js b/packages/rn-tester/js/RNTesterAppShared.js
index 87cb6b69dfe..f2512d09c5a 100644
 --- a/packages/rn-tester/js/RNTesterAppShared.js
+++ b/packages/rn-tester/js/RNTesterAppShared.js
@@ -50,6 +50,8 @@ const RNTesterApp = ({
   );
   const colorScheme = useColorScheme();
+  new Proxy({}, {});
+
   const {
     activeModuleKey,
     activeModuleTitle,
```

Before this change, RNTester will get an error at start-up. After, the app loads correctly.

Changelog: [General][Fixed] Correctly keep ES6Proxy for bridgeless mode

Reviewed By: cortinico

Differential Revision: D55045780

fbshipit-source-id: 666b99712d35622f87d42f22a4611851df67d905
2024-03-26 19:08:07 -07:00
Alex HuntandFacebook GitHub Bot bfb0319ce0 Register CatalystInstanceImpl with modern CDP backend (2/2) (#43251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43251

Integrates the modern CDP backend with `CatalystInstanceImpl` (the React Native instance implementation) on Android.

This complete the modern CDP integration for Bridge.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D51458010

fbshipit-source-id: 6f73868da9d0d4cc5d086a4569c78444cb1b83ec
2024-03-26 17:52:52 -07:00
Sam ZhouandFacebook GitHub Bot dd03513123 Deploy 0.232.0 to xplat (#43668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43668

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D55393289

fbshipit-source-id: 069bd01ed6cb772a97c4e581d30aae8b2fd7b0f3
2024-03-26 17:30:41 -07:00
Evert EtiandFacebook GitHub Bot b2ca41eef5 Fix possible deadlock in dispatchViewUpdates (#43643)
Summary:
In https://github.com/th3rdwave/react-native-safe-area-context/issues/448 it was noticed that from 0.72 (https://github.com/facebook/react-native/commit/bc766ec7f8b18ddc0ff72a2fff5783eeeff24857 https://github.com/facebook/react-native/pull/35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](https://github.com/th3rdwave/react-native-safe-area-context/issues/448#issuecomment-1871155936))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](https://github.com/th3rdwave/react-native-safe-area-context/issues/448#issuecomment-1872121172) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

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

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

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

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
2024-03-26 15:48:19 -07:00
Nicola CortiandFacebook GitHub Bot bb02049a6a Fix header import inside ReactInstanceManagerInspectorTarget.h (#43657)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43657

This include is not correct and is breaking the OSS build

Changelog:
[Internal] [Changed] - Fix header import inside ReactInstanceManagerInspectorTarget.h

Reviewed By: rshest

Differential Revision: D55368321

fbshipit-source-id: 0530257ad5c548476beb882174d73842775b3726
2024-03-26 12:37:49 -07:00
Tomislav NovakandFacebook GitHub Bot 5ea947150e Fix name lookup in PerformanceEntryReporter (use-after-free) (#43646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43646

PerformanceEntryReporter maintains a buffer of RawPerformanceEntry objects,
as well as a set of _pointers_ to elements within that buffer, used to find
entries by name.

However, those pointers aren't stable: BoundedConsumableBuffer internally uses
a vector, and there are a few cases where existing references get invalidated:

- When the vector's capacity changes (as new entries get inserted) [1]
- After calling clear-with-predicate, which copies elements into a new vector

This causes nameLookup to contain dangling pointers, and subsequent operations
on it can result in use-after-free.

Fix this by having BoundedConsumableBuffer reserve space for maxSize entries
up front (which ensures that existing pointers remain valid after adding new
elements) and by rebuilding nameLookup after clearing entries by name.

Note that reserve() causes the buffer's memory use to be higher than before in
case where the number of elements is small relative to the max size. Given the
(only) existing usage in PerformanceEntryReporter, as well as the property that
consumed elements remain in the buffer, that cost should be minor.

Changelog: [Internal]

[1] https://en.cppreference.com/w/cpp/container/vector/push_back

Reviewed By: rshest

Differential Revision: D55273403

fbshipit-source-id: c8f33203ae32685e29afa7f8e33edf1284d66e0f
2024-03-26 12:07:55 -07:00
Marc RousavyandFacebook GitHub Bot 73bf40607e fix: Fix typo in error message (#43650)
Summary:
Small typo I encountered while trying to build custom C++ type converters :)

## Changelog:

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

[INTERNAL] [FIXED] Fixed a small typo in the "unsupported type" error message

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

Reviewed By: zeyap

Differential Revision: D55364068

Pulled By: cortinico

fbshipit-source-id: 5a1bc9443c82f2473860f379c9ae063cd6e3ceb4
2024-03-26 10:47:58 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot a4592fdc1d Expose ScrollView's persistentScrollIndicator and horizontal to the C++ side props (#43655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43655

## Changelog:
[Internal] -

The corresponding prop `ScrollBar.persistentScrollIndicator` was only passed to the Android platform code an `ScrollBar.horizontal` wasn't passed to native at all.

On other platforms we need those props to be available on the C++ side, so this exposes them to the corresponding C++ ScrollViewProps.

Reviewed By: sammy-SC

Differential Revision: D55367445

fbshipit-source-id: e8abca3a2b56a8e7c03593a6c4297f90749ac8fd
2024-03-26 10:08:24 -07:00
Rubén NorteandFacebook GitHub Bot 3a0bf7d89e Improve signature of DOM APIs (#43652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43652

This improves the signature of our existing DOM APIs in 2 ways:
1. It replaces the use of `tuples` in `DOM.{h,cpp}` with safer structs.
2. It removes some unnecessary optionals from the API, returning the default values from the C++ API directly when appropriate.

It still preserves the use of tuples in the native module because objects are not properly supported in the codegen.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D55316654

fbshipit-source-id: 16ce5ef62ca427cdcd6b9757d77db040e0ccc8b1
2024-03-26 08:39:49 -07:00
Ramanpreet NaraandFacebook GitHub Bot e69f6755c8 Make ReactContext and ReactApplicationContext classes abstract (#43625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43625

Changelog: [Android][Breaking] Make ReactApplicationContext and ReactContext abstract. Please instantiate BridgeReactContext instead (bridge mode). Or BridgelessReactContext instead (bridgeless mode).

Reviewed By: arushikesarwani94

Differential Revision: D55218590

fbshipit-source-id: d507cc47c67cb5cd6c548844c08aa9ed8fb74796
2024-03-26 07:15:29 -07:00
Ramanpreet NaraandFacebook GitHub Bot 8eb1bd1170 Scripted: Codemod ReactApplicationContext creators to BridgeReactContext (#43626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43626

The things that create ReactApplicationContext should instead create BridgeReactContext.

Long-term, ReactApplicationContext will be abstract. This diff pulls noise out from that eventual diff.

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D55218591

fbshipit-source-id: d359c794f3da4a1ecb2fa8edbed5eeeb620b137b
2024-03-26 07:15:29 -07:00
Ramanpreet NaraandFacebook GitHub Bot a984169c7d Manual: Codemod initializeWithInstance() callers to BridgeReactContext (#43627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43627

Eventaully, ReactApplicationContext.initailizeWithInstance() will be moved to BridgeReactContext.

Doing the migration up-front to remove noise from the eventual diff.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55218593

fbshipit-source-id: c542c44cf8b36b9dc2a01db2bf6173639fb8698a
2024-03-26 07:15:29 -07:00
Ramanpreet NaraandFacebook GitHub Bot 6386988de1 Introduce BridgeReactContext < ReactApplicationContext (#43624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43624

Eventually, we will move all bridge methods to BridgeReactContext.

Long-term, ReactApplicationContext and ReactContext will become abstract. And these two contexts will only contain methods common to both modes.

Changelog: [Android][Added] Introduce BridgeReactContext

Reviewed By: cortinico

Differential Revision: D55218592

fbshipit-source-id: 731d4940d492a1ed3f855c9a181d2a6f9eeb9623
2024-03-26 07:15:29 -07:00
Alex HuntandFacebook GitHub Bot fcddb16bff Register ReactInstanceManager with modern CDP backend (1/2) (#43250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43250

Integrates the modern CDP backend with `ReactInstanceManager` on Android.

`ReactInstanceManager` is equivalent to the CDP page / `HostTarget` concept, therefore we register the `addPage`/`removePage` calls with this object's lifecycle.

Implementation notes:
- `ReactInstanceManagerInspectorTarget` is created to avoid converting `ReactInstanceManager` to JNI (impacting tests).
- Its constructor receives a `TargetDelegate` object, so that we avoid passing the entire `ReactInstanceManager` class through (avoids cyclic dependency from `com.facebook.react.bridge` to `com.facebook.react`).

Changelog:
[Internal] - Register `ReactInstanceManager` with modern CDP backend

Reviewed By: motiz88

Differential Revision: D51456960

fbshipit-source-id: 942255bb2487fdc581eb4fa0903c8e68106f8b35
2024-03-26 06:23:32 -07:00
Pieter De BaetsandFacebook GitHub Bot 6f956af121 Make UIConstantsProviderManager a static method (#43615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43615

This class is used for a one-time setup of bindings into the jsi::Runtime. The lambda will retain ownership of any java components required, and we can rely on the teardown of the JS runtime to clean up any dependencies.

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D55241233

fbshipit-source-id: f7541f28277307be9b3a5f4f780c7eca1a467c57
2024-03-26 05:46:08 -07:00
Pieter De BaetsandFacebook GitHub Bot 10000936b3 Fix retain cycle in UIConstantsProviderManager (#43614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43614

Storing a global_ref to `jThis` in a JNI hybrid object leads to a reference cycle which cannot be cleaned up by Java GC. The Java object will keep the C++ object alive and vice versa.

In this class, we didn't seem to need this reference anyway.

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D55241232

fbshipit-source-id: 933521ed1483c149f693988ca17f4c53565dbfe0
2024-03-26 05:46:08 -07:00
Pieter De BaetsandFacebook GitHub Bot 8270e7b110 Make ComponentNameResolverManager a static method (#43612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43612

This class is used for a one-time setup of bindings into the jsi::Runtime. The lambda will retain ownership of any java components required, and we can rely on the teardown of the JS runtime to clean up any dependencies.

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D55241234

fbshipit-source-id: ee80ca0f91ebe95f8c44874b27912b260f70b572
2024-03-26 05:46:08 -07:00
Alex HuntandFacebook GitHub Bot 6d0f72bf0b Add changelog for 0.74.0-rc.5 (#43640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43640

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55316064

fbshipit-source-id: 90b112eeeed2a1ac079cfdcced4ae0c3bd77cfb0
2024-03-26 04:23:40 -07:00
Tomislav NovakandFacebook GitHub Bot 00725fadff Fix use-after-free in AsyncEventBeat (#43618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43618

Both common and Android implementations of AsyncEventBeat use weak_ptrs
to determine if the object is still valid before invoking the callback.
Move the write to `isBeatCallbackScheduled_` down so it's protected by
that same check.

Changelog: [Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D55226529

fbshipit-source-id: 9e2a34369346d11dcea69d120dfa5935320f9ba1
2024-03-25 17:07:53 -07:00
Rob HoganandFacebook GitHub Bot ac714b1c33 Inspector proxy: preserve ordering of messages from device (#43639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43639

Currently, the `react-native/dev-middleware` inspector proxy intercepts `Debugger.scriptParsed` notifications from the target and replaces `sourceMapURL` with a data uri, via an async fetch from Metro. During this async fetch, other notifications from the debugger may pass through the proxy, which results in the frontend receiving them before `Debugger.scriptParsed`.

This reordering causes problems in breakpoint resolution and pausing, because `Debugger.breakpointResolved` and `Debugger.paused` events may reference `scriptId`s unknown to the frontend while the corresponding `Debugger.scriptParsed` is delayed.

In particular, breakpoint UI state and backend state can fall out of sync, and breakpoints hit may open to the incorrect source location.

This diff modifies the proxy to use a simple per-target promise queue to ensure messages are handled in the order they were received from the target.

Changelog:
[General][Fixed] Fix breakpoints opening to incorrect location or disappearing from debugger frontend UI.

Reviewed By: motiz88

Differential Revision: D55200617

fbshipit-source-id: 27c95f822266875ed668d0bf8a525da49554cafd
2024-03-25 13:02:00 -07:00
Rubén NorteandFacebook GitHub Bot 152f5f4a47 Back out "Add onUserLeaveHint support to ReactActivityDelegate #43488" (#43642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43642

Changelog: [internal]

This change broke some apps at Meta. Reverting until we figure out a safe way to land this.

Reviewed By: rshest

Differential Revision: D55324557

fbshipit-source-id: 684d3dc3780fc41e2e91f367d97fa5cd392e6638
2024-03-25 12:26:55 -07:00
Andrew CoatesandFacebook GitHub Bot dbf8e3f5ba Add @types/react as optional peerDependency on packages that use it (#43509)
Summary:
Now that RN is providing TS type information, many of those .d.ts files depend on types from react.  In modern packagemanagers (Ex: pnpm) types/react will not be available to RN since it does not declare it as a dependency.

I also noticed that the types for react-native-popup-menu-android appear to be pointing to the wrong location.

Add types/react as a peerDependency on the packages that have .d.ts files that import from React.
Add types/react to peerDependencyMeta with optional:true to prevent users not using TS from requiring types/react.

## Changelog:

[GENERAL] [ADDED] Added types/react as an optional peerDependency

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

Reviewed By: cortinico

Differential Revision: D55225940

Pulled By: NickGerleman

fbshipit-source-id: 4cbab071928cb925baec45f55461559acc9a54e6
2024-03-25 12:23:16 -07:00
Rubén NorteandFacebook GitHub Bot 8a2cf6866d Disable shadow tree introspection by default (#43578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43578

Changelog: [internal]

We have a feature to do some validation of the mount operations when committing new trees in Fabric. That's very slow but it was ok before because we were only doing this in debug mode and in the JS thread. We're moving some of this work to the UI thread instead and we're seeing an impact on scroll performance.

This disables this feature by default but leaves it in code to enable it when necessary for debugging.

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D55138795

fbshipit-source-id: 45ca47ae2562cecb070691bf33d95c9108a9eca3
2024-03-25 09:50:21 -07:00
Rubén NorteandFacebook GitHub Bot f446cf6464 Enable synchronous state update dispatching behind a flag (#43580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43580

Changelog: [internal]

This introduces a new feature flag to commit state updates synchronously from the UI thread (generally) instead of dispatching them to the JS thread to be processed there. We can do this now because we introduced a UI consistency mechanism in D55024832 to JS would see a consistent revision during the execution of a specific task.

Reviewed By: sammy-SC

Differential Revision: D55083029

fbshipit-source-id: 8aa84ddaee383f098252fa679cfb07012ba29bf8
2024-03-25 09:50:21 -07:00
Rubén NorteandFacebook GitHub Bot 04562dd48a Implement UI consistency in legacy RN layout APIs (#43579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43579

Changelog: [internal]

This updates all the legacy layout APIs in React Native to make use of the UI consistency mechanism introduced in Fabric (if available, otherwise the behavior is the same we have now — we consume the latest version of the tree available).

Reviewed By: sammy-SC

Differential Revision: D55077309

fbshipit-source-id: f6ff2a4f6cd1a2040f0cfeffb1e68f4ec0240f91
2024-03-25 09:50:21 -07:00
Rubén NorteandFacebook GitHub Bot 67d6d09bce Implement UI consistency in DOM methods (#43577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43577

Changelog: [Internal]

This updates all the DOM APIs in React Native (defined in the `NativeDOM` native module) to make use of the UI consistency mechanism introduced in Fabric (if available, otherwise the behavior is the same we have now — we consume the latest version of the tree available).

As part of that work, this creates a new `DOMMethods` class that implements all methods using purely C++ APIs (not JSI), moves a lot of logic that was specific for this functionality from `UIManager` to `DOMMethods` and modifies `NativeDOM` to use this new class.

This should make it easier to add unit tests for `DOMMethods` in the future.

Reviewed By: NickGerleman

Differential Revision: D55077311

fbshipit-source-id: f96bf5f3a97236fd24dbd2315256de4ce979e151
2024-03-25 09:50:21 -07:00
Rubén NorteandFacebook GitHub Bot 332355e80f Implement UI consistency mechanism for JS thread (#43581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43581

Changelog: [internal]

This implements a mechanism to ensure that JavaScript tasks have a consistent view of the state of the UI during their execution.

## Context

Fabric allows committing new revisions of the ShadowTree from any thread, but we don't make use of this capability and instead always commit them from the JS thread (e.g.: when we schedule Fabric state updates to update the offset of a list on scroll). This was done to make sure that JS work didn't see changes in the state of the tree at random points during its execution. E.g.:

```
useEffect(() => {
  const rect = ref.current.getBoundingClientRect();
  // do something
  const newRect = ref.current.getBoundingClientRect();
  // `rect` and `newRect` should always be the same
}, []);
```

This isn't used by Reanimated at the moment, which means JS can inadvertently see the result of animations in non-specific times during execution.

You can find additional context about this in the [RFC for DOM Traversal & Layout APIs in RN](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0607-dom-traversal-and-layout-apis.md#consistency-and-updates).

This works correctly at the moment, but we introduce a limitation in the execution model to prevent updating the tree synchronously from the main thread. One of the main problems this introduces is that computing intersections (for `IntersectionObserver`) relies on the information in the shadow tree, but this is updated asynchronously on scroll.

There are 2 potential solutions for that problem:
1) Send the timestamp of the scroll even with the state update to backdate the timestamps of the intersections. This could work but introduces more complexity and possibly accuracy problems due to batching those state updates with other changes (e.g.: what happens if we update the state and commit another tree in the same task? should we use the backdated timestamp or wait for mount?).
2) (**Preferred**/ this diff) Allow committing new revisions from any thread, but lock the JS thread into seeing a specific revision, which would only update/progress in specific moments when it's safe. Some of those moments would be:
    1) When we start a new JS task.
    2) When we commit a new tree from React (JS).

## Changes

This implements the solution outlined in 2), creating a few abstractions to handle what's the current tree that should be visible to JS and to lock/unlock it in specific moments.

More specifically:
* Creates `ShadowTreeRevisionProvider` as an abstract class for APIs consuming the visible revision of the ShadowTree (mainly DOM APIs and layout methods like `measure`, etc.).
* Creates `ShadowTreeRevisionConsistencyManager` as an abstract class to handle what trees are visible (with a `lockRevision` and `unlockRevision` to be called from `RuntimeScheduler` at the beginning and end of each JS task).
* Creates 2 different implementations of these abstractions:
  * One that preserves the current behavior (`LatestShadowTreeRevisionProvider`, which just returns the last committed revision at the time of the call).
  * One that locks revisions lazily (the first time they're accessed) (`LazyShadowTreeRevisionConsistencyManager`).

Reviewed By: sammy-SC

Differential Revision: D55024832

fbshipit-source-id: b59985bc83714ae7ec915baba72bf92b3d6fa140
2024-03-25 09:50:21 -07:00
CatStudioAppandFacebook GitHub Bot 1c8751a16a Update package.json to fix ccache_enabled option, fixes #43633 (#43634)
Summary:
I found in 0.74.0-rc.x, `ccache_enabled` is introduced. However, it is not being delivered via npm.

fixes https://github.com/facebook/react-native/issues/43633

Changelog: [iOS] [Fixed] - Adding ccache_clang wrapper scripts to package.json for distribution

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

Reviewed By: cortinico

Differential Revision: D55308743

Pulled By: blakef

fbshipit-source-id: e89a4bb3a1fbf8562d880b4c9d25dc9083717ba6
2024-03-25 09:41:12 -07:00
kassens (Meta Employee)andFacebook GitHub Bot 1fe26a181d Use declare const instead of declare var (#28599)
Summary:
Use `declare const` instead of `declare var`

DiffTrain build for commit https://github.com/facebook/react/commit/67081159377b438b48e3c2f2278af8e5f56b9f64.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D55245665

Pulled By: kassens

fbshipit-source-id: 44cb1130a23f46bb5caf33e05c828d92e0344efc
2024-03-25 09:14:33 -07:00
Pieter De BaetsandFacebook GitHub Bot ee3d5f510c Fix retain cycle in ComponentNameResolverManager (#43611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43611

Storing a global_ref to `jThis` in a JNI hybrid object leads to a reference cycle which cannot be cleaned up by Java GC. The Java object will keep the C++ object alive and vice versa.

In this class, we didn't seem to need this reference anyway.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D55240490

fbshipit-source-id: 9ba6f5b4b958cb273ad1923332b7b29a75630aea
2024-03-25 08:57:07 -07:00
Pieter De BaetsandFacebook GitHub Bot 12d22e5ff1 Avoid global_ref to javaPart in TurboModuleManager (#43613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43613

Storing a global_ref to `jThis` in a JNI hybrid object leads to a reference cycle which cannot be cleaned up by Java GC. The Java object will keep the C++ object alive and vice versa.

We can replace the reference in this class by using the this pointer passed in when `installJSIBindings` is invoked.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D55241235

fbshipit-source-id: 64883752a87f363a52a9f6661d6ddaa24a56fe62
2024-03-25 07:46:45 -07:00
Moti ZilbermanandFacebook GitHub Bot 4cc3ed8b2c Update INTERNAL_CALLSITES_REGEX (#43604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43604

Changelog: [Internal]

Syncs the internal and OSS versions of `INTERNAL_CALLSITES_REGEX` in the default RN Metro config.

Reviewed By: robhogan

Differential Revision: D55237394

fbshipit-source-id: 8986a69f8beeafccbab3548d8a2137c0bf19e0b3
2024-03-25 07:12:18 -07:00
Moti ZilbermanandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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
chenlong12580andFacebook GitHub Bot 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 BahrandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 PanandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 LynnandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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
zhongwuzwandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 DonadelandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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śniewskiandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 KesarwaniandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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żandFacebook GitHub Bot 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 PuttenandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ChuiandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 KesarwaniandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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
Bruce MitchenerandFacebook GitHub Bot ebd170bec3 Fix typos.
Summary:
This fixes a variety of spelling mistakes in file names, identifiers, and comments.

X-link: https://github.com/facebook/yoga/pull/1629

Reviewed By: NickGerleman

Differential Revision: D54987359

Pulled By: yungsters

fbshipit-source-id: 6b7ca20f4855f5f654036672bc10f8b079288acd
2024-03-19 02:52:40 -07:00
Wendi DuandFacebook GitHub Bot ff5e1a605a Revert D55013623: Migrate back to chromium-edge-launcher since Windows fix was merged
Differential Revision:
D55013623

Original commit changeset: bff2aa2801dd

Original Phabricator Diff: D55013623

fbshipit-source-id: d7f19068327b5cf427750fbcae01d3c10f9c89b5
2024-03-18 14:29:02 -07:00
Alex HuntandFacebook GitHub Bot a87fb56ef5 Fix new release workflow script (#43530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43530

Fixes and changes following D54956345, encountered during the release process for 0.74 RC4 today.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55017872

fbshipit-source-id: 616b387088db00c6f076f4571b4ab1541467361c
2024-03-18 12:18:55 -07:00
Arushi KesarwaniandFacebook GitHub Bot 6dd0cc99f8 Refactor ReactDelegate to provide DevSupportManager (#43520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43520

Refactor ReactDelegate to have a private `getDevSupportManager()` that can also be re-used  by `reload()`

This method conditionally provides the correct DevSupportManager in cases of Bridge & Bridgeless

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D54967130

fbshipit-source-id: 37d585de33a50b98d01803d3080c5693a8c494b9
2024-03-18 11:54:03 -07:00
Tommy NguyenandFacebook GitHub Bot 43ffce9fb3 Migrate back to chromium-edge-launcher since Windows fix was merged (#43524)
Summary:
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

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

Test Plan: n/a

Reviewed By: robhogan

Differential Revision: D55013623

Pulled By: motiz88

fbshipit-source-id: bff2aa2801dd0dcdd6975dca0a2ec2aa9864ff6f
2024-03-18 10:45:04 -07:00
Pieter De BaetsandFacebook GitHub Bot 6014dce04c Revert D54630694: Fix duplication across and rncore and FBReactNativeComponentSpec
Differential Revision:
D54630694

Original commit changeset: 75cb961ded9f

Original Phabricator Diff: D54630694

fbshipit-source-id: 50832c934e5bcc1a92456d949995c05a33767a92
2024-03-18 10:38:35 -07:00
Blake FriedmanandFacebook GitHub Bot a380ea55fb Summary: minor fix found in nightly logs from Publish NPM job (#43519)
Summary:
Minor fix to package.json which newer version of npm warn about when publishing, after running `npm pkg fix -ws` on the workspace.

{F1470070110}

## Changelog: [Internal] npm pkg fix -ws

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

Test Plan: eyescloseddog

Reviewed By: cortinico

Differential Revision: D55012872

Pulled By: blakef

fbshipit-source-id: ff3c63a3eefaf56d369219a3d4b32d44d6d842c9
2024-03-18 08:29:10 -07:00
LluísandFacebook GitHub Bot 91d725136e eslint: Update @typescript-eslint monorepo to v7 & eslint-plugin-jest to v27 (#43406)
Summary:
This PR updates `typescript-eslint/eslint-plugin` and `typescript-eslint/parser` to `v7` and `eslint-plugin-jest` to `v27`, removing any dependencies on `typescript-eslint` `v6`, allowing projects using `react-native/eslint-config` to safely update to  `typescript-eslint` `v7` without having to worry about duplicate major versions installed

## Changelog:

- [General] [Changed]: Updated `eslint-plugin-jest` to `v27`
- [General] [Changed]: Updated `typescript-eslint` monorepo to `v7`

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

Test Plan: `yarn run lint` executed locally successfully

Reviewed By: robhogan

Differential Revision: D54749676

Pulled By: tdn120

fbshipit-source-id: f6fae92fc95333e28b36a3d2bd8470c8869d38bc
2024-03-18 07:46:35 -07:00
Pieter De BaetsandFacebook GitHub Bot ef77087293 Fix duplication across and rncore and FBReactNativeComponentSpec (#43385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43385

`rncore` and `FBReactNativeComponentSpec` contain the same symbols, which leads to conflicts when we try to merge them into a single shared library. Cleanup the duplication and standardize on `FBReactNativeComponentSpec` everywhere. I've left the Android OSS targets as is, to avoid breaking deps.

Changelog: [Internal]

Reviewed By: cortinico, dmytrorykun

Differential Revision: D54630694

fbshipit-source-id: 75cb961ded9fd75508755c0530e29409fef801cf
2024-03-18 07:30:33 -07:00
Delphine BugnerandFacebook GitHub Bot d53cc2b46d Fix/image methods mock in jest setup (#43497)
Summary:
### Context

- Since RN 0.73, in the jest.setup file, methods of the Image module (Image.getSize, Image.resolveAssetSource...) are mocked on the **JS side** (introduced in https://github.com/facebook/react-native/pull/36996)
- It causes issues like https://github.com/facebook/react-native/issues/41907 : `Image.resolveAssetSource` returns nothing in test env with the new JS mock, when some test relies on it.
- On my project, it broke the snapshots : the URL of images disappeared. I use `react-native-fast-image` which uses `Image.resolveAssetSource` to compute URLs.
- I first opened a PR to fix exclusively Image.resolveAssetSource: https://github.com/facebook/react-native/pull/41957. I will close it to focus on this new one.
- As suggested by ryancat and idrissakhi, it should be better to return to the previous mock, where no method is mocked on the JS side, and we can trust the actual JS to work in test.

This is what this PR intends to do.

### Content

Along fixing the Image module mock in jest.setup, this PR :

- adds unit test on each one of the methods, ensuring they have a consistent behavior even when the module is mocked.
- adds 3 missing native mocks for `NativeImageLoader`: `prefetchImageWithMetadata`, `getSizeWithHeaders` & `queryCache`. After this PR, no method from NativeImageLoader remains unmocked.

## Changelog:

[GENERAL][FIXED] - fix jest setup for Image methods (resolveAssetSource, getSize, prefetch, queryCache)

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

Test Plan:
See exhaustive unit tests in PR.

You can re-use the mock with all the methods mocked and see how the new unit tests fail.

I also patched those changes on my project: my snapshot did have their URL back (see demonstrative screenshots in my original PR: https://github.com/facebook/react-native/pull/41957 - NB; fixed mock was different but result was the same -> those screenshots cover only two cases, but anyway they illustrate well the case!)

Reviewed By: ryancat

Differential Revision: D54959063

Pulled By: tdn120

fbshipit-source-id: 837266bd6991eb8292d9f6af1774e897ac7a8890
2024-03-18 06:53:39 -07:00
Rubén NorteandFacebook GitHub Bot a2e22404fb Remove feature flag to skip mount hook notifications (#43504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43504

Changelog: [internal]

We identified the issue in the experiments already, so we can remove this flag.

Reviewed By: sammy-SC

Differential Revision: D54945099

fbshipit-source-id: 4d547569eb3bbfd011f5d6894d87bfa542cac07b
2024-03-18 06:15:52 -07:00
Rubén NorteandFacebook GitHub Bot ebe26c198e Improve thread safety of MountingCoordinator (#43503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43503

Changelog: [internal]

## Context

In the experiments to enable mount hooks on Android we saw some crashes that we couldn't reproduce or pinpoint accurately.

We ran another experiment excluding part of the code in one of the variants, and we found that the problem was in this block (only crashes when `skipMountHookNotifications` is false):
https://github.com/facebook/react-native/blob/121b26184acbb77ff4f2360647cb322ff560b145/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp#L726-L734

Looking more closely at the mounting coordinator code, I realized that some of the methods are not thread-safe, which is likely causing these issues.

~~We're probably only seeing these issues on Android because we have a push model there (we call `pullTransaction` from whatever thread we're committing to, JS thread or Fabric background thread) whereas in the rest of platforms we have a pull model and we always access call `pullTransaction` from the main thread, as we do to report mounts.~~

This is probably fine because both cases are protected by a mutex when accessing through `ShadowTreeRegistry::visit`. But there's a case that doesn't go through it that could be causing the issues: prerendering:
https://github.com/facebook/react-native/blob/121b26184acbb77ff4f2360647cb322ff560b145/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp#L289

## Changes

1) Make `getBaseRevision` return a copy of the revision rather than a reference.
2) Make all methods that access `baseRevision_` and `lastRevision_` thread-safe.

Reviewed By: javache

Differential Revision: D54945100

fbshipit-source-id: d8b211137d0eac02a5814cc6c376c22733290eab
2024-03-18 06:15:52 -07:00
Rubén NorteandFacebook GitHub Bot 87b73a0bad Enable event loop by default when bridgeless is enabled (#43396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43396

Changelog: [General][Changed] Enabled new event loop behavior when bridgeless (new architecture) is enabled.

Reviewed By: rshest

Differential Revision: D54682678

fbshipit-source-id: ff8c45bc1caae0e9182aa94d915d7b6f9427caf9
2024-03-18 04:51:39 -07:00
Rubén NorteandFacebook GitHub Bot a1c752cd87 Update OSS renderers with compatibility with event loop (#43507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43507

Changelog: [General][Changed] - sync React renderers to 18.3.0-canary-9372c6311-20240315

Syncs React renderers to https://github.com/facebook/react/commit/9372c63116fc1e855c51d93d83f5150661371ec3 which is canary for 18.3.0-canary-9372c6311-20240315.

This includes the necessary changes to enable the use of microtasks for scheduling in Fabric.

Reviewed By: yungsters

Differential Revision: D54947212

fbshipit-source-id: 8fd5def5107d77e6a248f653a9d0260b392fab6b
2024-03-18 04:51:39 -07:00
Alex HuntandFacebook GitHub Bot 14a7202983 Add prepare_release_new workflow, configure via flag (#43518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43518

This is a minimum approach to achieve a **single-command publish flow** for React Native, unifying the previous `yarn bump-all-updated-packages` and `yarn trigger-react-native-release` workflow entry points.

This diff aims to change as little as possible to achieve the above — introducing a new job that merges operations to create the versioning commit. The triggered publish jobs are unchanged. In future, we may follow this change with further simplifications down the workflow tree.

**Key changes**

- Adds a new CircleCI workflow, `prepare_release_new`, which versions **all packages** and writes a single release commit.
- This replaces `yarn bump-all-updated-packages`, now implemented with the newer `set-version` script.
- Wires this up as an experiment within `trigger-react-native-release.js`, conditionally running the new workflow when `--use-new-workflow` is passed.

**Not changed**

- The single release commit written will continue to trigger both of the existing CI workflows on push (`publish_release` and `publish_bumped_packages`), which are unchanged.
    - The commit summary now includes the `#publish-packages-to-npm` marker, in order to trigger `publish_bumped_packages`.
- Usage: Release Crew members will continue to use the existing local script entry point (as [documented in the releases repo](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-process.md#step-7-publish-react-native)), with the opt in flag.
    ```
    yarn trigger-react-native-release --use-new-workflow [...args]
    ```

After we're happy with the E2E behaviour of this workflow in the next 0.74 RC, I will follow up by dropping the `--use-new-workflow` flag and removing the old scripts (T182533699).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54956345

fbshipit-source-id: 35fd7af8f3e60a39507b5d978ccd97472bf03ddb
2024-03-18 02:22:46 -07:00
Samuel SuslaandFacebook GitHub Bot 06dc448d85 use structs instead of class for TextInputMetrics and KeyPressMetrics (#43510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43510

changelog: [internal]

- use designated initializers.
- make TextInputMetrics and KeyPressMetrics structs.
- move TextInputMetrics and KeyPressMetrics inside of TextInputEventEmitter.
- Utilise RCTSizeFromCGSize, RCTEdgeInsetsFromUIEdgeInsets and RCTPointFromCGPoint when creating  TextInputMetrics.

Reviewed By: rshest

Differential Revision: D54895928

fbshipit-source-id: 4afd49ffa77c5afafc794808aac7f11bb8213944
2024-03-16 12:12:46 -07:00
Jane LiandFacebook GitHub Bot f2f62cdf54 Back out "Add onUserLeaveHint support to ReactActivityDelegate"
Summary:
This is causing Twilight Android app to hang and crash on start

Original commit changeset: 3f24271405f6

Original Phabricator Diff: D54905564

Reviewed By: sammy-SC

Differential Revision: D54960053

fbshipit-source-id: 5c1063f11ae1314e71288905eb6d8da32ddbfadd
2024-03-15 13:37:22 -07:00
Fabrizio CucciandFacebook GitHub Bot e19d77828d Make rn-tester navbar follow the current theme (#43514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43514

Changelog: [Internal]

The navbar active/inactive colors were fundamentally broken on dark theme.

Reviewed By: rubennorte

Differential Revision: D54952629

fbshipit-source-id: 9cfd7d4eb904c7b6a8d7e1e900b4ff076b8aba12
2024-03-15 12:17:21 -07:00
Moti ZilbermanandFacebook GitHub Bot 0277871f77 Fix ConsoleApiTest
Summary:
Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54957923

fbshipit-source-id: 2178f2715e9c924ee58ac39b728279c914d4891d
2024-03-15 11:48:33 -07:00
Alex HuntandFacebook GitHub Bot d43cdee98c Remove dangerous "9999" version string default (#43516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43516

As titled. This seems dangerous — removing with the motivation that we'd prefer this script to fail during execution than to succeed in publishing `9999`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54956661

fbshipit-source-id: 23f8d49abd300385dde74871b6d2492ef63f058e
2024-03-15 11:48:22 -07:00
Rob HoganandFacebook GitHub Bot e180f805e5 Update eslint to ^8.57.0 (#43481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43481

Update `eslint` to `8.57.0` to satisfy the peer dependency requirements of some incoming plugin updates.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54898017

fbshipit-source-id: 39a8ac0f9653a104277a7f0054bb7e1fe3ec54f4
2024-03-15 10:33:20 -07:00
Alex HuntandFacebook GitHub Bot 6f6aaae73e Fix RNTester Podfile.lock update in release workflow (#43513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43513

The previous `update_podfile_lock.sh` script would fail as executed from the repo root (could not locate RNTester dir). Delete this and replace with direct calls in `prepare-package-for-release.js`, which will fail script on error.

 {F1469216632}

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54949214

fbshipit-source-id: 4f032069e803e84f835c279d01332d16787dfafc
2024-03-15 10:32:07 -07:00
Fabrizio CucciandFacebook GitHub Bot f2c335ac96 Fix auto-download of CMake (#43511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43511

Changelog: [Internal]

This is an attempt to fix [#39783](https://github.com/facebook/react-native/issues/39783).

It seems that when `configureBuildForHermes` runs (as part of `yarn android` in `rn-tester`) cmake may not be available and is not installed automatically:
* for 3p, even after installing the latest Android Studio, cmake 3.22.1 is not available by default but needs to be installed manually
* for Meta employees, same story when looking at the `ANDROID_HOME` set by the `setup_fb4a.sh` in the `.zshrc` file:
```
# added by setup_fb4a.sh
export ANDROID_SDK=/opt/android_sdk
export ANDROID_NDK_REPOSITORY=/opt/android_ndk
export ANDROID_HOME=${ANDROID_SDK}
export PATH=${PATH}:${ANDROID_SDK}/emulator:${ANDROID_SDK}/tools:${ANDROID_SDK}/tools/bin:${ANDROID_SDK}/platform-tools
```

This diff introduces an explicit task to install cmake.

### ALTERNATIVE 1

See D54897379.

### ALTERNATIVE 2

Suggested by cortinico:

> Create a mini module called :packages:react-native:ReactAndroid:hermes-engine:cmake-downloader which just triggers an empty cmake build via Android SDK

Reviewed By: cortinico

Differential Revision: D54859484

fbshipit-source-id: f9ecdf78ff408947b1e85e7da4f112c89d3a8c89
2024-03-15 10:16:29 -07:00
Rubén NorteandFacebook GitHub Bot fb42a55bdf Remove unnecessary enable_shared_from_this from built-in C++ TMs (#43506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43506

Changelog: [internal]

We've been making all the built-in C++ TurboModules in RN extend `enable_shared_from_this` because we copied from the same template that needed it, but none of them do. This removes that unnecessary extension.

Reviewed By: sammy-SC

Differential Revision: D54901332

fbshipit-source-id: 795c7696e70041d640399e3b9f177999e22fd90b
2024-03-15 07:48:44 -07:00
Rubén NorteandFacebook GitHub Bot 60d3b75d92 Extract user timing classes to a separate module (#43471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43471

Changelog: [internal]

Just a minor refactor

Reviewed By: sammy-SC

Differential Revision: D54854693

fbshipit-source-id: 4ba4a74cd9a2f0d96fe6259b15b348d990a66d37
2024-03-15 07:48:44 -07:00
Rubén NorteandFacebook GitHub Bot af44ba25bc Create method in NativePerformance module for performance.now (#43469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43469

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D54854692

fbshipit-source-id: cfcdbb0596ced71d9eddc39c3a6a8d8ae8d9a543
2024-03-15 07:48:44 -07:00
Rubén NorteandFacebook GitHub Bot 5f7483c7f6 Move native code for NativePerformance to ReactCommon (#43470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43470

Changelog: [internal]

This moves the native code for the Web Performance API to `ReactCommon`, to align with the other default C++ native modules we've defined there.

Reviewed By: sammy-SC

Differential Revision: D54860194

fbshipit-source-id: 32dccb080fb8ebd1e2acbdd59fa2dfe47e372c17
2024-03-15 07:48:44 -07:00
Alex HuntandFacebook GitHub Bot 3515e51856 Use Hermes CDPAgent by default (#43482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43482

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Now that we are confident that `CDPAgent` is stable, switch to it by default and remove the previous integration.

- Drop `inspectorEnableHermesCDPAgent` feature flag.
- Rename and replace `HermesRuntimeAgentDelegateNew` as `HermesRuntimeAgentDelegate`.
- Drop "Hermes integration: CDPAgent" log message.
- Update tests.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54897841

fbshipit-source-id: 8a5212d27f21c54112c0820a2a3611e05d606880
2024-03-15 07:14:40 -07:00
zhongwuzwandFacebook GitHub Bot fa8fdc7888 iOS: Change image source url encode ascii to utf8 (#43502)
Summary:
We should use utf8 to cover more characters.

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Change image source url encode ascii to utf8

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

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

Reviewed By: rshest

Differential Revision: D54944653

Pulled By: cortinico

fbshipit-source-id: 0bbd3d46c8e5c04ceffe7e0ebae46dc2ce9507df
2024-03-15 06:15:44 -07:00
Moti ZilbermanandFacebook GitHub Bot 04de21abb9 Console API tests
Summary:
TSIA

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54846940

fbshipit-source-id: f322ed9b60f35f0b01b64a74a329572a16b1d485
2024-03-15 06:09:26 -07:00
Wojciech DróżdżandFacebook GitHub Bot 3cf6c64a80 Add onUserLeaveHint support to ReactActivityDelegate (#43488)
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. The problematic `assert` has been changed to an `if` - it's not a problem if onUserLeaveHint is received from an activity different to the current one, but in that case we shouldn't emit the event.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D54905564

Pulled By: cortinico

fbshipit-source-id: 3f24271405f66bf3a9450320a484e522224eefc1
2024-03-15 05:48:59 -07:00
Nicola CortiandFacebook GitHub Bot 9c7742b7db Bump needs-attention to v2.0.0 (#43493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43493

This is a bump of one of our external GH custom action
Closes #38046

Changelog:
[Internal] [Changed] - Bump needs-attention to v2.0.0

Reviewed By: GijsWeterings

Differential Revision: D54905530

fbshipit-source-id: 1ecc25926144641bfc080b4ca7b8551a00a0caa1
2024-03-15 05:41:20 -07:00
Moti ZilbermanandFacebook GitHub Bot 121b26184a Make JsiIntegrationPortableTest reusable in other test suites
Summary:
Changelog: [Internal]

TSIA - useful for the `console` test suite I'm currently writing (D54846940) which would be awkward to fit into `JsiIntegrationTest.cpp`.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54846938

fbshipit-source-id: 9e20bfae7c518b3822da468adf484e51cdc4d0b9
2024-03-15 04:23:57 -07:00
Moti ZilbermanandFacebook GitHub Bot 949296571b Console polyfill: preserve unknown methods from originalConsole if found (#43459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43459

Changelog: [General][Changed] - Console polyfill now copies all properties from the existing `console` object

Fusebox now exposes a full WHATWG `console` object integrated directly with CDP debugging (D54826073). Some WHATWG `console` methods are missing from React Native's polyfill/shim, so let's pass those through unmodified so they can still be called.

(Long term, we shouldn't need most of `console.js`, but let's get there gradually as there are many RN users still depending on `nativeLoggingHook` etc.)

NOTE: We also update the "bundled" copy of `console.js` that lives in the jsinspector-modern C++ test suite.

Reviewed By: huntie

Differential Revision: D54827902

fbshipit-source-id: c6c9128903496810192614f4f8d80b68b02e25c4
2024-03-15 04:23:57 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 80bcdc9942 Fix broken RNTester build in OSS (Android) (#43495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43495

## Changelog:
[Internal] -

Fixes build regression of RNTester on  OSS, coming from D54764898.

NOTE: This is only Android bit for now, looking into the iOS one.

Reviewed By: cortinico

Differential Revision: D54908736

fbshipit-source-id: 70081d1378a56dd0df3f76322377f5a0e6615f80
2024-03-15 03:44:10 -07:00
Moti ZilbermanandFacebook GitHub Bot c0e84ece4f Add regression test for Hermes CDP + lazy compilation bug (#43461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43461

Adds a regression test for the duplicate `scriptParsed` bug in Hermes (T182003727). In the process, we enable Hermes lazy compilation in all our CDPAgent JSI integration tests.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54852326

fbshipit-source-id: 52e23458d3e9e21902c3659fc944ef85c68731ac
2024-03-15 03:43:28 -07:00
Janic DuplessisandFacebook GitHub Bot a9e6759bb5 Fix maintainVisibleContentPosition on Android during momentum scroll (#43425)
Summary:
When using maintainVisibleContentPosition (mvcp) on Android it doesn't work properly when items are added during a momentum scroll. This happens because the android scrollview momentum scroll animation overrides the scroll position that the mvcp implementation sets [here](https://github.com/facebook/react-native/blob/2d547a3252b328251e49dabfeec85f8d46c85411/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java#L132).

To fix this we need to cancel the momentum scroll animation, update the scroll position then restart the scroll animation with the previous animation remaining momentum.

## Changelog:

[ANDROID] [FIXED] - Fix maintainVisibleContentPosition during momentum scroll

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

Test Plan:
Tested in RNTester on Android with both vertical and horizontal scrollviews using the following code:

```ts
// packages/rn-tester/js/RNTesterAppShared.js

import {
  Button,
  SafeAreaView,
  ScrollView,
  Text,
  View,
} from 'react-native';
import React, {useLayoutEffect, useRef, useState} from 'react';

const generateUniqueKey = () => `_${Math.random().toString(36).substr(2, 9)}`

const initialData = Array.from(Array(100).keys()).map(n => ({
  id: generateUniqueKey(),
  value: n,
}))

function ListItem({item}) {
  const color = `hsl(${item.value * 10}, 75%, 85%)`;

  return (
    <View
      style={{
        backgroundColor: color,
        height: 100,
      }}>
      <Text>List item: {item.value}</Text>
    </View>
  );
}

export default function FlatListRepro() {
  const numToAdd = 10;
  const [numbers, setNumbers] = useState(initialData);
  const ref = useRef();

  const addAbove = () => {
    setNumbers(prev => {
      const additionalNumbers = Array.from(Array(numToAdd).keys())
        .map(n => ({
          id: generateUniqueKey(),
          value: prev[0].value - n - 1,
        }))
        .reverse();

      return additionalNumbers.concat(prev);
    });
  };

  useLayoutEffect(() => {
    ref.current.scrollTo({y: numbers.length * 100, animated: false});
  // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);

  return (
    <SafeAreaView style={{flex: 1}}>
      <View style={{flexDirection: 'row', alignItems: 'center'}}>
        <Button title="Add Above" onPress={addAbove} />
      </View>
      <View>
        <ScrollView
          ref={ref}
          maintainVisibleContentPosition={{
            minIndexForVisible: 0,
          }}
        >
          {numbers.map((item) => (
            <ListItem key={item.id} item={item} />
          ))}
        </ScrollView>
      </View>
    </SafeAreaView>
  )
}
```

Before:

https://github.com/facebook/react-native/assets/2677334/a7102665-991e-449e-9d0a-ef06c370dc71

After:

https://github.com/facebook/react-native/assets/2677334/5430ecb1-26a9-4c92-9f16-c762d75685db

Reviewed By: javache

Differential Revision: D54883984

Pulled By: NickGerleman

fbshipit-source-id: 95fd673a87cf5ada3bf9a7c166bba77ce557c89b
2024-03-14 20:00:56 -07:00
Dmitry RykunandFacebook GitHub Bot 5c34ce0587 Fix RNTester OSS build (#43496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43496

This diff adds another sub-sub-spec to React-Fabric pod to fix import paths in `textinput`.

Changelog: [Internal]

Reviewed By: philIip, rshest

Differential Revision: D54918454

fbshipit-source-id: 3949f8b8b201157f4c9eb256f3eb5bd5d66bc228
2024-03-14 19:24:35 -07:00
Samuel SuslaandFacebook GitHub Bot b3a8eba5a1 merge BatchedEventQueue into EventQueue (#43438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43438

changelog: [internal]

EventQueue can now be merged with BatchedEventQueue since there isn't anything else subclassing it.

Reviewed By: javache

Differential Revision: D54687859

fbshipit-source-id: f646583db0e46789b667f8d79d24d0cf9d7fc00c
2024-03-14 13:39:14 -07:00
Moti ZilbermanandFacebook GitHub Bot 7af288e523 Lazy-init HermesRuntimeTargetDelegate
Summary:
Changelog: [Internal]

We are currently eagerly constructing a `HermesRuntimeTargetDelegate` regardless of whether the Fusebox feature flags are enabled. This can interfere with the legacy CDP backend. Instead, let's lazily construct the target delegate in a code path that only runs when the modern backend is in use.

bypass-github-export-checks

Reviewed By: rozele

Differential Revision: D54907887

fbshipit-source-id: 7dc13506739866ea6690ed21d03d91ad24ef68c5
2024-03-14 12:44:44 -07:00
Pieter De BaetsandFacebook GitHub Bot a2d277f740 Flag missing DefaultHardwareBackBtnHandler interface in bridgeless too (#43487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43487

Inconsistent between bridge and bridgeless, but if you forget to implement this interface, ReactDelegate will silently not do anything in bridgeless.

Changelog: [Android] Enforce Activities using ReactDelegate implement DefaultHardwareBackBtnHandler.

Reviewed By: arushikesarwani94

Differential Revision: D54900747

fbshipit-source-id: 5dd31d4f81e4ec37e1c3ee906be836a8a9c6a944
2024-03-14 12:21:47 -07:00
Arushi KesarwaniandFacebook GitHub Bot f345fcf3e8 Support onKeyLongPress in Bridgeless (#43472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43472

Implement `onKeyLongPress` in Bridgeless

Changelog:
[Android][Breaking] Implement onKeyLongPress in Bridgeless

Reviewed By: cortinico

Differential Revision: D54876052

fbshipit-source-id: 88d572eab087d913205bdfa02dba96b169066393
2024-03-14 12:10:57 -07:00
Arushi KesarwaniandFacebook GitHub Bot b14f7d58e3 Support onKeyDown in Bridgeless (#43466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43466

Implement `onKeyDown` in Bridgeless by adding it to ReactHostImpl

Changelog:
[Android][Breaking] Implement `onKeyDown` in Bridgeless

Reviewed By: cortinico

Differential Revision: D54870966

fbshipit-source-id: 0f8e48b29679f1bca92f6ac7b6ebf1592cdc5dac
2024-03-14 12:10:57 -07:00
Dmitry RykunandFacebook GitHub Bot 9700540bec Bring back the UNSET constant to TextAttributeProps (#43491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43491

This diff brings back the `UNSET` constant to `TextAttributeProps`.
The removal of this constant was an unnecessary breaking change, that has broken several third-party libraries.

Changelog: [Android][Fixed] - Bring back the UNSET constant to TextAttributeProps.

Reviewed By: fabriziocucci

Differential Revision: D54899524

fbshipit-source-id: 368bde77d43f310fd458537d0191d09174fa5167
2024-03-14 11:10:54 -07:00
Moti ZilbermanandFacebook GitHub Bot 305c2811cf Implement native console object in RuntimeTarget (#43456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43456

Changelog: [Internal]

Implements the [WHATWG `console` spec](https://console.spec.whatwg.org/) directly in `RuntimeTarget`, based on the Hermes-powered `addConsoleMessage` method first used in D54494298.

Benefits:

* This allows the console API to work independently of the polyfill shipped in RN, including very early during JS execution.
* It also opens the door to better stack traces (once we start reporting those) and richer functionality in the `console` object itself.

Reviewed By: robhogan

Differential Revision: D54826073

fbshipit-source-id: d5b0bd004bf35c2fce91742ae84ea86225ec1c61
2024-03-14 10:33:47 -07:00
Pieter De BaetsandFacebook GitHub Bot eca4d76d81 Rollout enableBridgelessArchitectureSoftExceptions (#43485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43485

Already fully rolled out internally.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D54804177

fbshipit-source-id: 128822d408b6943f1f1536eb0101c6684cd45106
2024-03-14 10:31:37 -07:00
Pieter De BaetsandFacebook GitHub Bot 7488dc05e8 Use CopyOnWriteArrayList in MemoryPressureRouter (#43486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43486

We use `CopyOnWriteArrayList` in other places across the React Native codebase, as it assumes that reading happens more frequently than updating. This saves us from needing to synchronize and copy when we access the list of listeners.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D54806272

fbshipit-source-id: d1b54d532edb2af3391a7e4fdc758f705621227d
2024-03-14 10:31:37 -07:00
Pieter De BaetsandFacebook GitHub Bot a27e2acef4 Rollout bridgelessArchitectureMemoryPressureHackyBoltsFix (#43478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43478

This is rolled out internally already. Also exposing `memoryPressureRouter` to match the ReactInstanceManager interface.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D54802021

fbshipit-source-id: b74dcde71296d3925acfc2171d2a77d90960e15e
2024-03-14 10:31:37 -07:00
zhongwuzwandFacebook GitHub Bot 10d48134c9 iOS: Fixes textinput onscroll event payload (#43445)
Summary:
Fixes https://github.com/facebook/react-native/issues/43428 . cc cortinico .

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes textinput onscroll event payload

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

Test Plan:
```
    const onInputScroll = (e) => {
      if (Platform.OS !== "web") {
        const {
          nativeEvent: {
            contentOffset: { x, y },
          },
        } = e;
        console.log('onInputScroll ====', e?.nativeEvent)
      }
    };

<TextInput
          onScroll={onInputScroll}
          // ref={inputRef}
          multiline
  />
```

Reviewed By: cortinico

Differential Revision: D54813378

Pulled By: sammy-SC

fbshipit-source-id: 76671fbb390c2fbc67a9c29b6c2a834ba699fff4
2024-03-14 08:33:49 -07:00
Moti ZilbermanandFacebook GitHub Bot 4148a31912 Integration test for CDPAgent reentrancy bugs
Summary:
Changelog: [Internal]

Adds a regression test for a Hermes CDPAgent bug using `JsiIntegrationTest`. See details in comments.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54890188

fbshipit-source-id: 325a32b83b145d2d35f99feaef9988028f15f196
2024-03-14 07:59:31 -07:00
Bartłomiej BłoniarzandFacebook GitHub Bot 0d7a92b551 Add conditional return in handleRemoveView (#43389)
Summary:
I was recently working on an [issue](https://github.com/software-mansion/react-native-reanimated/issues/5715) in Reanimated where z-index of some views was broken after a Layout Animation was used. The issue was that in some cases we were calling the `removeView` function on a already removed view. On plain Android this wouldn't be an issue, since the `removeView` function ignores such calls. Unfortunately, the `ReactViewGroup.java` implementation maintains a counter of views with user defined z-index. This counter is decremented whenever a call to `removeView` is made, even if the view is not a child of this `ViewGroup`. This PR adds an additional check in the `handleRemoveView` function to unify the `removeView` behavior between Android and react-native.

## Changelog:
[ANDROID] [CHANGED] - Changed the `handleRemoveView` function in `ReactViewGroup.java` to ignore calls for `Views` that are not children of this `ViewGroup`

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

Test Plan: I tested if the `rn-tester` app behaves correctly after those changes.

Reviewed By: NickGerleman

Differential Revision: D54874780

Pulled By: javache

fbshipit-source-id: f1a34947419ef6106ee73b196ae99b7f8c2f7a77
2024-03-14 07:27:29 -07:00
Blake FriedmanandFacebook GitHub Bot 47a3f52007 Add RFC-0759 deprecation logging cli init
Summary:
Implements the RFC which progressively provides warnings to users of the `npx react-native init` command as we gradually deprecate.

Changelog:
[General][Deprecated] - init cli deprecation logging

Reviewed By: cortinico

Differential Revision: D54423109

fbshipit-source-id: 679b6672bdbfc42a9b82a2aad38fd3253c6ea6a2
2024-03-14 03:37:44 -07:00
Pieter VanderwerffandFacebook GitHub Bot 082decb76d Deploy 0.231.0 to xplat (#43475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43475

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D54886285

fbshipit-source-id: cc4f6eeb7986a25d2bb423dac0b7d1d5a74b9703
2024-03-13 22:23:03 -07:00
Joe VilchesandFacebook GitHub Bot 50d587b67f Fix clipping children in scroll views (#43464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43464

While working on filters I noticed that my blurred image was cropped on the scrollview. Setting `overflow: visible` for `contentContainerStyle` did not change anything. Turns out we do not call `setClipChildren(false)` like we do with [ReactViewGroup](https://www.internalfb.com/code/fbsource/[93517723586c]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java?lines=145).

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D54640466

fbshipit-source-id: 3f71af3170df8f75887d57643b84e64807856ca6
2024-03-13 19:30:54 -07:00
Joe VilchesandFacebook GitHub Bot 5c58811bd5 Add FilterHelper to get all RenderEffects needed to apply filters (#43357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43357

This diff adds a class to get the needed RenderEffects to support CSS filters on Android. This diff does not add any of the plumbing for it to actually work, that comes in the next diff, but I figured this was complicated and isolated enough to be on its own.

Note that I did not add blur or drop shadow as those are a bit more involved and I plan on adding them later.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D54603892

fbshipit-source-id: 5780d7c846fdb1116e29e0a940ee02da609b01f5
2024-03-13 19:30:54 -07:00
Eric RozellandFacebook GitHub Bot e032963727 Remove unused forward declaration of RCTMountingManager (#43453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43453

The forward declaration for RCTMountingManager doesn't appear to be used anywhere. It can be deleted.

## Changelog

[Internal]

Reviewed By: NickGerleman

Differential Revision: D54692764

fbshipit-source-id: ba8206408fdd515387a0a6aff6a3e43c51221e57
2024-03-13 16:13:52 -07:00
Arushi KesarwaniandFacebook GitHub Bot b2e1db0fbf Support onConfigurationChanged in Bridgeless (#43463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43463

Implement `onConfigurationChanged` in Bridgeless by adding it to ReactHostImpl

Changelog:
[Android][Breaking] Implement onConfigurationChanged in Bridgeless

Reviewed By: cortinico, RSNara

Differential Revision: D54792399

fbshipit-source-id: 6851daca815f486f4d839e128a1d740d3fec1996
2024-03-13 15:08:55 -07:00
kolyaVVandFacebook GitHub Bot 5807ada292 change: replace twitter with x (#43423)
Summary:
When users create a new app, there is an option: Follow us on Twitter with the description. Twitter is X now.
![twitter](https://github.com/facebook/react-native/assets/8622007/7565a692-0e83-4549-a688-08f3ba28c76b)

## Changelog: [Internal]
Replace the Twitter link, title, and description with X.

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

Test Plan: Set the environment for React Native app and then `npx react-native@latest init AwesomeProject`, `npm start`, and `npm run ios`

Reviewed By: cortinico

Differential Revision: D54850199

Pulled By: huntie

fbshipit-source-id: 424cb9212962d78a5b2d93d973f56498ba948136
2024-03-13 12:02:13 -07:00
Blake FriedmanandFacebook GitHub Bot f855de7fed Add @react-native/core-cli-utils to build script
Summary:
Changelog: [Internal]

Use our build script for packages and to generate the TypeScript types.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54428870

fbshipit-source-id: 2a1666d30ac472300979b2be078a906d390e919a
2024-03-13 11:07:12 -07:00
Blake FriedmanandFacebook GitHub Bot 62acc29896 Port: @react-native-community/cli#android → @react-native/core-cli-utils#android (#43289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43289

Move react-native-community/cli build-android into core per RFC0759.  Provides:

- assemble
- build (assemble + tests)
- install

Changelog:
[General][Added] RFC-0759 Move cli Android build into core

Reviewed By: cortinico, cipolleschi

Differential Revision: D54112210

fbshipit-source-id: 2c9016dd3abd4d382a3d73abd90ba4b0eca7728c
2024-03-13 11:07:12 -07:00
Nicola CortiandFacebook GitHub Bot e9f66d9c0c Properly handle RR and CMD+M in Bridgeless Mode (#43460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43460

Currently pressing the menu button (or CMD+M) is broken on Bridgeless mode.
Also pressing RR is not reloading the App.
That's because some Bridgeless API haven't been reimplemented correctly on Android. I'm fixing them here.

Fixes #43451

Changelog:
[Android] [Fixed] - Properly handle RR and CMD+M in Bridgeless Mode

Reviewed By: huntie

Differential Revision: D54852959

fbshipit-source-id: 8fbbdab6818da9177e6db40e45d35258c7f5e236
2024-03-13 10:55:36 -07:00
Blake FriedmanandFacebook GitHub Bot 98f0893f39 Port: @react-native-community/cli#ios → @react-native/core-cli-utils#ios (#43288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43288

Move react-native-community/cli build-ios into core per RFC0759.  This provides:

- boostrap (triggers pod install & autolinking)
- build
- install

Changelog:
[General][Added] RFC-0759 Move cli iOS build into core

Reviewed By: cortinico

Differential Revision: D54112211

fbshipit-source-id: 325ee1a2f2f38077559767264f3bee1e2837591a
2024-03-13 10:34:06 -07:00
Moti ZilbermanandFacebook GitHub Bot 51e0b3a546 Integrate Hermes CDPDebugAPI with RN console polyfill (#43454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43454

Changelog: [Internal]

1. Introduces the `RuntimeTargetDelegate::addConsoleMessage` method, which is a 1:1 wrapper around the Hermes `CDPDebugAPI` [method of the same name](https://github.com/facebook/hermes/blob/33cf8cfe781aabcad6b3d39821d815fe5317f977/API/hermes/cdp/CDPDebugAPI.h#L43-L47).
2. Installs a global `__inspectorLog` function callable from JS, matching [this existing call](https://github.com/facebook/react-native/blob/4f10f3069fff9090d700d9bcfbf49da1aa85f272/packages/polyfills/console.js#L430-L437) in React Native's `console` polyfill.

NOTE: We'll almost immediately replace `__inspectorLog` with a standalone native implementation of the `console` API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full `console` spec, which requires some more C++ code and boilerplate.

Reviewed By: huntie

Differential Revision: D54494298

fbshipit-source-id: 2e04935712ff0aa31dac6c59837c47b6af6e447a
2024-03-13 10:27:29 -07:00
Rubén NorteandFacebook GitHub Bot dceda565bd Fix RN tests in preparation for D54783723 (#43458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43458

The React sync in D54783723 was failing because some tests were relying on `console.error` being called as `console.error('Some message')` but it was refactored as `console.error('%s..', 'Some message')`, making them fail.

This fixes the tests by formatting the arguments passed to the console functions and checking against that instead.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D54849485

fbshipit-source-id: 0648263614725ea3f9c95b9f9bb13005adae46eb
2024-03-13 08:51:03 -07:00
Samuel SuslaandFacebook GitHub Bot 16fd5f0ff7 delete UnbatchedEventQueue (#43457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43457

changelog: [internal]

UnbatchedEventQueue is no longer used.

Reviewed By: javache

Differential Revision: D54687451

fbshipit-source-id: 28fe2aea25d7fd98bff488197959968e24244c6e
2024-03-13 08:21:57 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 71cf093aa3 Factor out common parts of TextInputProps between Android/iOS (#43431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43431

## Changelog:
[Internal] -

This takes all the common props for TextInput between Android and iOS and factors them out into a single, platform independent props data structure, `BaseTextInputProps`.

This way it's both easier to manage the corresponding props, but also making this easier to be used on other platforms.

Reviewed By: sammy-SC

Differential Revision: D54764898

fbshipit-source-id: 224b01c5a67ba5d5216cd5c482bf650a1c2453d5
2024-03-13 08:15:51 -07:00
Rubén NorteandFacebook GitHub Bot 6c50418474 Remove getIsSynchronous method from RuntimeScheduler (#43441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43441

`RuntimeScheduler::getIsSynchronous` is currently used to check if the current task is being executed on the main thread, to avoid using the background executor. This was part of a test to dispatch events synchronously in an app using background executor.

We're not running that test anymore and this method doesn't make a lot of sense in the first place (it's not checking if the current task is running on the main thread, only if the caller of the task scheduled it synchronously from whatever thread they called from), so we can remove the method.

If this is necessary in the future we should create a method that actually does something useful (like `isCurrentTaskOnMainThread()`).

Changelog: [internal]

I consider this change not to be a breaking change because runtime scheduler wasn't an official public API, and what we want to make public doesn't include this method.

Reviewed By: sammy-SC

Differential Revision: D54804805

fbshipit-source-id: 54b3a6586e08bccc201df848b942fb1fcae29f30
2024-03-13 08:07:32 -07:00
Pieter De BaetsandFacebook GitHub Bot 38cbc082db Apply pointerEvents dispatch check in dispatchGenericMotionEvent (#43433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43433

Changelog: [Android][Fixed] Views would still receive hover events when nested in a view with pointer-events: "none"

`View` calls `dispatchGenericPointerEvent` from `dispatchGenericMotionEvent` (https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r2.1/core/java/android/view/View.java#7439), so this is the better method to override.

Reviewed By: markv

Differential Revision: D54799820

fbshipit-source-id: 896572b86a0e9053b0138a18ced938a9dc3e60fc
2024-03-13 04:43:12 -07:00
Alex HuntandFacebook GitHub Bot 4f10f3069f Update test to validate Debugger domain persistence (#43446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43446

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Following D54712525, add a test case that validates `"Debugger.enable"` is persisted between reloads. This has been actioned by creating a further test group, `ModernHermesVariants`, and scoping the existing `ResolveBreakpointAfterReload` to this, with the removed second `"Debugger.enable"` message.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54808212

fbshipit-source-id: 0775beb85a0907cca4dccbc77ec461d9515ab078
2024-03-13 01:06:50 -07:00
Arushi KesarwaniandFacebook GitHub Bot 5d711f83b5 Support onNewIntent in Bridgeless (#43401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43401

Implement `onNewIntent` in Bridgeless by adding it to ReactHostImpl

Changelog:
[Android][Breaking] Implement `onNewIntent` in Bridgeless

Reviewed By: fkgozali, RSNara

Differential Revision: D54703159

fbshipit-source-id: fd8589d8131f4fa57188d493331dc68fb38c4520
2024-03-12 19:00:35 -07:00
Moti ZilbermanandFacebook GitHub Bot 1150f21404 Persist Debugger and Runtime domain state for Hermes CDPAgent (#43443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43443

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54712525

fbshipit-source-id: 34b1804088f15a2524607ebce81bceb82170feab
2024-03-12 16:45:36 -07:00
Moti ZilbermanandFacebook GitHub Bot d2c5db59cd Identify Hermes CDPAgent/CDPHandler via log message (#43442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43442

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D54630591

fbshipit-source-id: ef3c9f871a5c7150b1b890b6afb0f07bb77968fd
2024-03-12 16:45:36 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 3bbe193ab1 Add missing dependency from AndroidTextInput (#43448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43448

## Changelog:
[Internal] -

This adds a stub for `TextLayoutManager.measureCachedSpannableById`, as well as a missing explicit dependency to `jni/react/jni` from the `TextInput` implementation on the Android platform.

This is required in order for certain build configurations to compile.

Reviewed By: andrewdacenko

Differential Revision: D54807518

fbshipit-source-id: 206f0edb03a4ed328a962e57d1e791614eb7f851
2024-03-12 15:24:50 -07:00
Samuel SuslaandFacebook GitHub Bot 255d1cebf2 delete passthroughAnimatedPropExplicitValues from animated component (#43407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43407

changelog: [internal]

`passthroughAnimatedPropExplicitValues` is not used. Let's remove it.

Reviewed By: yungsters

Differential Revision: D54583470

fbshipit-source-id: 9e480e4bf3216d4d6c9d7eac99a6b4d5a2e9583f
2024-03-12 15:05:51 -07:00
Fabrizio CucciandFacebook GitHub Bot 41b6371940 Synchronize access to LongLivedObjectCollection instances (#43450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43450

Changelog: [Internal]

This is just to make sure that all instances of `LongLivedObjectCollection` map can be safely accessed by multiple threads.

Reviewed By: RSNara

Differential Revision: D54801015

fbshipit-source-id: e0b15bfbeac9ce3a1051f83a59c5513a90ba2a4b
2024-03-12 13:18:25 -07:00
Alex HuntandFacebook GitHub Bot eef87ca59e Implement previouslyExportedState on HermesRuntimeAgentDelegateNew (#43392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43392

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Wires up `previouslyExportedState` with `CDPAgent`, and re-enables the `ResolveBreakpointAfterReload` integration test.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54369985

fbshipit-source-id: 5dcb4fe59b8b36b2db9f0385e8487097822e5704
2024-03-12 13:03:13 -07:00
Samuel SuslaandFacebook GitHub Bot 55ed1c26ab delete EventPriority and its uses (#43437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43437

## Changelog:
[iOS][Removed] - remove EventPriority class and always use the default EventPriority::AsynchronousBatched. This is potentially a breaking change if something in OSS sets a different priority. If a build fails because of this, simply remove the use of EventPriority.

EventPriority::AsynchronousBatched is the default and none of the other priorities are used anymore. This is the first step of removing this concept from the codebase.

Reviewed By: NickGerleman

Differential Revision: D54684311

fbshipit-source-id: 18240e5ee84f489f43b15fd9aab43f3b1b1b4963
2024-03-12 12:08:00 -07:00
Arushi KesarwaniandFacebook GitHub Bot 7b40c8ee5f Support onWindowFocusChange in Bridgeless (#43398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43398

Implement onWindowFocusChange in Bridgeless by adding it to the ReactHostImpl

Changelog:
[Android][Breaking] Implement onWindowFocusChange in Bridgeless

Reviewed By: javache

Differential Revision: D54670119

fbshipit-source-id: 71f560e5a3bf0e853ac06955e67b8035f1ec0468
2024-03-12 11:52:52 -07:00
Pieter De BaetsandFacebook GitHub Bot 9af98ccd71 Prevent OSS build breakage due to unused-local-typedef (#43449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43449

Error:

```
react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp:162:5: error: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Werror,-Wunused-local-typedef]
      LOG_EVERY_N(INFO, 10) << "instanceHandle is null, event of type " << type
      ^
  react-native/packages/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                               INVALID_REQUESTED_LOG_SEVERITY);           \
                               ^
  1 error generated.
  ninja: build stopped: subcommand failed.
```

This has been fixed upstream (https://github.com/google/glog/commit/8b3023f7e4ca46e0ecf5f660dd7340c79139bc34) but we're on an older glog version, so ignore the error.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D54811655

fbshipit-source-id: a00c23528d457ae365b0a27e680bb46afabb152f
2024-03-12 11:17:40 -07:00
Joe VilchesandFacebook GitHub Bot 3341ab7cc0 Fix bug where absolute nodes were not insetted correctly in certain cases (#43417)
Summary:
X-link: https://github.com/facebook/yoga/pull/1593

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

There was a bug where we did not position absolute nodes correctly if the static node had a different main/cross axis from the containing node. This fixes that. The change is somewhat complicated unfortunately but I tried to add sufficient comments to explain what is happening

Reviewed By: NickGerleman

Differential Revision: D54703955

fbshipit-source-id: 096c643f61d4f9bb3ee6278d675ebd69b57350d7
2024-03-12 11:08:43 -07:00
Samuel SuslaandFacebook GitHub Bot 92540a618d do not synchronise native animated in paper
Summary:
## Changelog:
[General][Fixed] - Fix broken native animation in Paper

In Native Animated Paper, `scheduleUpdate` must not be called. In Fabric, the synchronisation between Fiber and Shadow trees is a must but in Paper it sets undesired state.

Reviewed By: javache

Differential Revision: D54799237

fbshipit-source-id: f6b07dc377111ed2f8253ea0c7c7e312168166e8
2024-03-12 10:19:56 -07:00
Rob HoganandFacebook GitHub Bot 00d8f497ea Re-enable stale execution context test under new Hermes CDP Agent (#43444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43444

Re-enable a test now that D54649943 added correct handling of stale execution context IDs.

NOTE: There's a minor difference in returned error code. The test now allows either, though note that the old implementation is more consistent with Chrome itself which returns -32000 (server error). Semantically -32600 (invalid request) seems more appropriate.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54805777

fbshipit-source-id: eb2baadf6b35319f5331462425eaa38b4edfab28
2024-03-12 10:04:40 -07:00
Cedric van PuttenandFacebook GitHub Bot 3f41fb5d5b feature(dev-middleware): add custom message handlers to extend CDP capabilities (#43291)
Summary:
This is a proposal for the `react-native/dev-middleware` package, to allow implementers to extend the CDP capabilities of the `InspectorProxy`. It's unfortunately needed until we can move to the native Hermes CDP layer.

At Expo, we extend the CDP capabilities of this `InspectorProxy` by injecting functionality on the device level. This proposed API does the same, but without having to overwrite internal functions of both the `InspectorProxy` and `InspectorDevice`.

A good example of this is the network inspector's capabilities. This currently works through the inspection proxy, and roughly like:
- Handle any incoming `Expo(Network.receivedResponseBody)` from the _**device**_, store it, and stop event from propagating
- Handle the incoming `Network.getResponseBody` from the _**debugger**_, return the data, and stop event from propagating.

This API brings back that capability in a more structured way.

## API:

```ts
import { createDevMiddleware } from 'react-native/dev-middleware';

const { middleware, websocketEndpoints } = createDevMiddleware({
  unstable_customInspectorMessageHandler: ({ page, deviceInfo, debuggerInfo }) => {
    // Do not enable handler for page other than "SOMETHING", or for vscode debugging
    // Can also include `page.capabilities` to determine if handler is required
    if (page.title !== 'SOMETHING' || debuggerInfo.userAgent?.includes('vscode')) {
      return null;
    }

    return {
      handleDeviceMessage(message) {
        if (message.type === 'CDP_MESSAGE') {
          // Do something and stop message from propagating with return `true`
          return true;
        }
      },
      handleDebuggerMessage(message) {
        if (message.type === 'CDP_MESSAGE') {
          // Do something and stop message from propagating with return `true`
          return true;
        }
      },
    };
  },
});
```

## Changelog:

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

[GENERAL] [ADDED] - Add inspector proxy device message middleware API

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

Test Plan: See added tests and code above

Reviewed By: huntie

Differential Revision: D54804503

Pulled By: motiz88

fbshipit-source-id: ae918dcd5b7e76d3fb31db4c84717567ae60fa96
2024-03-12 09:58:51 -07:00
Rubén NorteandFacebook GitHub Bot 5833eb59e3 Implement microtasks using new JSI method (#43397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Reviewed By: sammy-SC

Differential Revision: D54687056

fbshipit-source-id: b077ba47b80f7b31c77b7e449def8a56061b0b69
2024-03-12 09:54:11 -07:00
Rubén NorteandFacebook GitHub Bot 4799d0cc5c Move spec files to specs directories in react-native/src/private (#43395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43395

Changelog: [internal]

This moves native module specs to `specs` directory to align with the general convention.

Reviewed By: cortinico

Differential Revision: D54680056

fbshipit-source-id: 8b6ae6187e2ffa9120159b7d1fa25957677e0f4f
2024-03-12 09:54:11 -07:00
Rubén NorteandFacebook GitHub Bot 9c9c7edeb3 Allow accessing common feature flags before setting overrides for JS-only overrides (#43394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43394

Changelog: [internal]

When we built the new feature flag system we added a constraint in the JS API to prevent calling `override` if any of the flags was already accessed from JS.

This is very restrictive because it doesn't allow us to access common flags (like `enableMicrotasks`) set up from native during the initialization of the framework because then applications wouldn't be able to set JS-only overrides.

This relaxes the constraint to disallow accessing JS-only flags before setting JS-only overrides, but accessing common (native) flags before that is ok.

Reviewed By: rshest

Differential Revision: D54687055

fbshipit-source-id: b0716f24baf7d12a5e4a61fba79e6b50ef0ad10a
2024-03-12 09:54:11 -07:00
Rubén NorteandFacebook GitHub Bot 2830066b7c Update feature flag generator to create directories for generated files before writing (#43393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43393

Changelog: [internal]

The generator doesn't create intermediate directories, which is causing issues now that we're moving the generated native module spec to a new directory.

This fixes that.

Reviewed By: rshest

Differential Revision: D54690126

fbshipit-source-id: 1ba0d821872da7bbe1f6120ef6d0c1f800326778
2024-03-12 09:54:11 -07:00
Cedric van PuttenandFacebook GitHub Bot c62be78d99 feature(dev-middleware): use userAgent query parameter as fallback when header is unset (#43364)
Summary:
At Expo, we use [Expo Tools](https://github.com/expo/vscode-expo/blob/main/src/expoDebuggers.ts) to connect the [built-in vscode-js-debug](https://github.com/microsoft/vscode-js-debug) to Hermes.

Since there are a few differences in vscode vs chrome devtools, we need to enable a couple of modifications through the [`customMessageHandler` API](https://github.com/facebook/react-native/pull/43291). Unfortunately, vscode itself doesn't set the `user-agent` header when connecting to the inspector proxy. Becuase of that, we'd need a fallback to "manually" mark the debugger as being vscode ([we use this query parameter here](https://github.com/expo/vscode-expo/blob/main/src/expoDebuggers.ts#L208)).

This PR supports setting the `user-agent` through `?userAgent=` when the header is not set.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL] [ADDED] - Fallback to query parameter based `user-agent` when header is unset

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

Test Plan:
- Install [Expo Tools](https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools)
- Start Metro with this change.
- Connect a device.
- Run the vscode command `"Expo: Debug Expo app ..."`
- Debugger should connect, and have it's user-agent marked as:
    `vscode/1.87.0 vscode-expo-tools/1.3.0`

Reviewed By: huntie

Differential Revision: D54804556

Pulled By: motiz88

fbshipit-source-id: 1ff558ba5350811ad042d08a713438e046759feb
2024-03-12 09:39:00 -07:00
Alfonso CurbeloandFacebook GitHub Bot 032873a84c Add missing commit to 0.72.12 changelog (#43434)
Summary:
## Changelog:

[INTERNAL] - Add missing commit to 0.72.12 changelog

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

Reviewed By: huntie

Differential Revision: D54805620

Pulled By: tdn120

fbshipit-source-id: c3bc31842b57c85fa584894132015f9856086876
2024-03-12 09:18:08 -07:00
Rubén NorteandFacebook GitHub Bot d456e50bb0 Add new systrace sections in MountingCoordinator (#43408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43408

Changelog: [internal]

I think mount operations are taking longer than expected because of a debugging block (that we might remove). This adds some systrace sections to distinguish that from the overall time and confirm this only happens in debug builds.

Reviewed By: sammy-SC

Differential Revision: D54746491

fbshipit-source-id: 317b22b6dcd1ae117ed4a013180df8842bf712f0
2024-03-12 08:59:30 -07:00
Alex HuntandFacebook GitHub Bot e2c5a36ec7 Add enableHermesCDPAgent case to ReactInstanceIntegrationTest (#43436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43436

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Expands test coverage for the Hermes `CDPAgent` implementation by enabling in `ReactInstanceIntegrationTest`.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D54801168

fbshipit-source-id: 9b71f8e697c7ab24c1383100938b3f648774a106
2024-03-12 08:19:49 -07:00
szymonrybczakandFacebook GitHub Bot 7a00623947 Update @react-native-community/cli to 14.0.0-alpha.0 (#43415)
Summary:
Updates CLI to 14.0.0-alpha.0

## Changelog:

[GENERAL] [CHANGED] - Update `react-native-community/cli` to 14.0.0-alpha.0

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

Test Plan: CI

Reviewed By: cortinico

Differential Revision: D54760054

Pulled By: huntie

fbshipit-source-id: c4e29e2122c5de0ff60f9c52bd6f9a86ce0a5560
2024-03-12 06:18:30 -07:00
Pieter De BaetsandFacebook GitHub Bot 276fdc414b Reduce logspam of missing instanceHandle (#43432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43432

Changelog: [Internal]

Reviewed By: sammy-SC, fabriziocucci

Differential Revision: D54798889

fbshipit-source-id: 19cbac6b6bbb19242227ad9357cd9e8b86cdd331
2024-03-12 05:38:45 -07:00
Alfonso CurbeloandFacebook GitHub Bot 81d39d9e16 Changelog: 0.72.12 (#43419)
Summary:
## Changelog:
Changelog: [INTERNAL] Generated changelog

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

Reviewed By: cortinico

Differential Revision: D54799352

Pulled By: huntie

fbshipit-source-id: ad777f8804e14da4b4ed77ea0742560c1d01c7b5
2024-03-12 04:36:57 -07:00
Samuel SuslaandFacebook GitHub Bot 2ed1e9ad28 remove sync events from TextInput (#43429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43429

changelog: [internal]

these experimental props have served their purpose and can be deleted.

Reviewed By: rubennorte

Differential Revision: D54682805

fbshipit-source-id: aee5072e2aa056c862f369426617d0d51c98997f
2024-03-12 04:32:01 -07:00
Pieter De BaetsandFacebook GitHub Bot 9e2bb4efc3 Fix TimingModuleTest in OSS (#43422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43422

After my changes in D54496604, this test now requires the main looper to progress as well, to dispatch the right callback.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D54776392

fbshipit-source-id: ba272a08d4b88d1c3301618eed1a03253e615b84
2024-03-12 04:25:17 -07:00
Arushi KesarwaniandFacebook GitHub Bot bdca260679 Fix Bridgeless React Context test in OSS (#43424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43424

https://github.com/facebook/react-native/pull/43400/ caused a `getCatalystInstanceTest` to fail in OSS due to `bridgelessReactContext` not being a Mock object.

Reviewed By: fkgozali

Differential Revision: D54781539

fbshipit-source-id: 1c784804c31d4b57fe438d49f3ee3eb7034dd7a6
2024-03-11 23:21:05 -07:00
Phillip PanandFacebook GitHub Bot 5522d522bb support jsCallInvoker in RCTBridgeProxy (#43314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43314

Changelog: [Internal]

making call invoker a breaking change to runtime executor in 0.74 seems to be causing a lot of discourse. let's simplify things and first add the callinvoker to the backwards compat layer

Reviewed By: cipolleschi

Differential Revision: D54404845

fbshipit-source-id: 983e86829030557033b95625dab9068492739417
2024-03-11 21:55:42 -07:00
Phillip PanandFacebook GitHub Bot 620459a07e change import to RCTBridgeProxy to forward declaration (#43313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43313

Changelog: [Internal]

we can simplify the build graph here

Reviewed By: cipolleschi

Differential Revision: D54404844

fbshipit-source-id: 52dfbd05106e72687b969357e274d2c4cdd9ca34
2024-03-11 21:55:42 -07:00
Fabrizio CucciandFacebook GitHub Bot 86a52cc2dc Scope LongLivedObjectCollection per runtime [3/n] (#43410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43410

Changelog:
[General] [Breaking] - Make `LongLivedObjectCollection::get` accept a Runtime reference as parameter.

# Context

Approach 1 as described in [RFC post](https://fb.workplace.com/groups/615693552291894/permalink/1693347124526526/).

# This diff

* Replace the `LongLivedObjectCollection` singleton with a map from `Runtime -> LongLivedObjectCollection` so that each RN instance has its own collection.
* Update MSFT fork accordingly

Reviewed By: javache, RSNara

Differential Revision: D54649209

fbshipit-source-id: ecd2ab3917843ca82388b7b9cce06c05679f2d60
2024-03-11 15:55:45 -07:00
Pieter De BaetsandFacebook GitHub Bot da21799ca3 Fix stack overflow in createRootView (#43420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43420

Calling `mReactDelegate.createRootView` just ends up calling the overridden method in the anonymous inner class. Instead have the base implementation return null, and call super.

Changelog: [Internal]

Reviewed By: jessebwr, janeli-100005636499545

Differential Revision: D54772205

fbshipit-source-id: fc90e6718f9c287e8b86e5768cf7f74d0db06c49
2024-03-11 14:49:52 -07:00
Fabrizio CucciandFacebook GitHub Bot 3706bf077e Scope LongLivedObjectCollection per runtime [2/n] (#43409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43409

Changelog:
[General] [Breaking] - Make `LongLivedObject` constructor accept a `Runtime` reference.

# Context

Approach 1 as described in [RFC post](https://fb.workplace.com/groups/615693552291894/permalink/1693347124526526/).

# This diff

* Embed `Runtime` reference in `LongLivedObject` to keep supporting `allowRelease` method (and update extending classes accordingly)
* Update MSFT fork accordingly

Reviewed By: RSNara

Differential Revision: D54638813

fbshipit-source-id: 0d58d1c32b3689bdd1223c13f5d5ee2f2e15f223
2024-03-11 13:01:09 -07:00
Arushi KesarwaniandFacebook GitHub Bot c6076bca97 Implement getJSCallInvokerHolder for BridgelessCatalystInstance (#43400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43400

Implement `getJSCallInvokerHolder()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getJSCallInvokerHolder()` for Bridgeless Catalyst Instance

Reviewed By: cortinico

Differential Revision: D54650305

fbshipit-source-id: effac3daaad5173c2fd78ab11bbe3f3156a9c07b
2024-03-11 12:19:49 -07:00
Alex HuntandFacebook GitHub Bot a7fde7c885 Enable JSI integration tests for Hermes CDPAgent (#43391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43391

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Bootstraps `HermesRuntimeAgentDelegateNew` within `JsiIntegrationTest.cpp`.

Test cases which currently do not pass with `HermesRuntimeAgentDelegateNew` are selectively matched against a new alias to exclude them: `JsiIntegrationHermesLegacyTest`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53810357

fbshipit-source-id: 2d7d7446038530d19d93add71361b4bf581cff18
2024-03-11 11:03:58 -07:00
Alex HuntandFacebook GitHub Bot c6ca7d61af Add changelog for 0.74.0-rc3
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54755786

fbshipit-source-id: 76dfac43143d95a8765d67c93a2d8a30edec4259
2024-03-11 10:39:52 -07:00
Nick GerlemanandFacebook GitHub Bot b696a7dc5e Reduce warning level of distributed Yoga builds (#43405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43405
X-link: https://github.com/facebook/yoga/pull/1592

Fixes https://github.com/facebook/yoga/issues/1590

Yoga may be built with a high warning level. This is helpful in letting Yoga be used in more places, and finding defects. We currently set these in the internal BUCK build, the CMake reference build, and the Yoga Standalone (not RN) CocoaPods build.

Yoga's reference CMake build and spec are consumed today by users of Yoga, instead of just Yoga developers. Here, it makes more sense to avoid anything that could break compiler-to-compiler compatibility.

We default these to a less intense (`-Wall -Werror`). I kept `/W4`, for pragmatic reasons, and since it is relatively standard for MSVC.

We continue to build with strict flags on Buck build on Clang.

Reviewed By: cortinico

Differential Revision: D54735661

fbshipit-source-id: 130e35ac9dcffa2f7e70e48d18770f1275864e2a
2024-03-11 10:38:55 -07:00
Rick HanlonandFacebook GitHub Bot e9e668f0ec Symbolicate component stacks (#43166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43166

# Overview
This diff adds support for symbolicating component stacks that provide the new stack frame formatting. It currently switches between a `componentStackType` value to enable stack frame parsing, but once the feature flag lands we can clean this up so that the type of `ComponentStack` is always just `Array<StackFrame>`

## Screen

### With stack frame component stacks
{F1459181398}

## Legacy version
 {F1463451637}

Changelog:
[General][Fixed] - Support component stacks without source info.

Reviewed By: yungsters

Differential Revision: D53984570

fbshipit-source-id: 68afbe70b65c7a8861d049bebe0659dbe1db146f
2024-03-11 10:29:06 -07:00
hurali97andFacebook GitHub Bot d66b9a5b28 Changelog: 0.73.6 (#43412)
Summary:
## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

Changelog: [Internal] Generated changelog

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

Reviewed By: cortinico

Differential Revision: D54753626

Pulled By: huntie

fbshipit-source-id: c0a2348601b3d78b08ccaab570f346716d3793e6
2024-03-11 10:18:36 -07:00
Pieter De BaetsandFacebook GitHub Bot 3283202248 Remove createRootView(initialProps) from ReactDelegate (#43365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43365

Changelog: [Android][Changed] Simplified ReactActivityDelegate to expose a single createRootView method.

Reviewed By: cortinico

Differential Revision: D54434648

fbshipit-source-id: 305c54910a1eac25664507972879c7c6bd633466
2024-03-11 09:40:33 -07:00
Moti ZilbermanandFacebook GitHub Bot aeb250430d Make FallbackRuntimeAgentDelegate private (#43348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43348

Changelog: [Internal]

Followup from D54585658. Moves the branching on `HERMES_DEBUGGER_ENABLED` into `HermesRuntimeTargetDelegate`, and correspondingly makes `FallbackRuntimeAgentDelegate` private (not exposed directly to integrators).

Reviewed By: huntie

Differential Revision: D54587558

fbshipit-source-id: 554b41356c1421a508c1a788d7c27f53445ecb6b
2024-03-11 09:30:53 -07:00
Pieter De BaetsandFacebook GitHub Bot 641a9c468f Move lifecycle listener inside JavaTimerManager (#43338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43338

Reafactor JavaTimerManager so more code is shared between bridge and bridgeless.

Note that HeadlessJSTaskContext is not currently configured when using bridgeless.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D54496604

fbshipit-source-id: 2a61294267df372e69f8316dd8f8059625d0a2bd
2024-03-11 09:09:52 -07:00
Moti ZilbermanandFacebook GitHub Bot 7c5a014c0d Pass whole RuntimeTargetDelegate from RN instead of aggregating its methods (#43346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43346

Changelog: [Internal]

(Continuing the theme of reducing integration boilerplate from D54537844.)

This diff changes both `JSExecutor` (Bridge) and `JSRuntime` (Bridgeless) to no longer implement `RuntimeTargetDelegate`. Instead, each of them exposes a `getRuntimeTargetDelegate()` method that returns a stable reference to a target delegate that it *owns*.

To facilitate this, we create a new `FallbackRuntimeTargetDelegate` for use in non-Hermes cases. This replaces *almost* all direct uses of `FallbackRuntimeAgentDelegate` outside of `jsinspector`. I'll follow up in a separate diff to deal with the last case and make the fallback agent delegate fully private.

As a result, changing the `RuntimeTargetDelegate` interface (which we'll need to do for console support) becomes much easier: we only have unit test mocks + two concrete `RuntimeTargetDelegate` implementations (one fallback, one Hermes) to update for each API change.

Reviewed By: huntie

Differential Revision: D54585658

fbshipit-source-id: 08b61c74008ddc36c2b134a40755ef8e43ab21ed
2024-03-11 06:29:32 -07:00
D NandFacebook GitHub Bot 1ea269f42c fix: [TypeScript] Allow to pass empty string as style (#43404)
Summary:
```tsx
import {Text} from 'react-native'

interface Props {
  foregroundColor?: string | undefined | null
}

function Test({foregroundColor}: Props){
  return <Text style=[styles.icon, foregroundColor && { color: foregroundColor }] />
  // ^^^ Error: Type "" is not assignable to type TextStyle | Falsy | RegisteredStyle<TextStyle> | RecursiveArray<TextStyle...
}
```

## Changelog:

[GENERAL] [ADDED] - [TypeScript] Allow to pass empty string as style

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

Test Plan:
Change `Falsy` type locally and test it on the next code

```tsx
const styles = StyleSheet.create({
  text: {
    color: 'red',
  },
});
export const a = <Text style={[styles.text, null, '', undefined, false]} />;
```

Reviewed By: rshest

Differential Revision: D54744517

Pulled By: javache

fbshipit-source-id: c5b934616cc0501c2b6a7907e6be522187a2cc20
2024-03-11 06:00:36 -07:00
Alex HuntandFacebook GitHub Bot 80891468d2 Update InspectorFlags to lazily pull upstream values (#43390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43390

Refactor after D54639775. This avoids the unfortunate side effect where `InspectorFlags::dangerouslyResetFlags()` would immediately reread `ReactNativeFeatureFlags `. This call is now relocated in our test util.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54684692

fbshipit-source-id: 962c7d78bbf71b1d81af412081d3ef5cfe443fa1
2024-03-11 05:29:07 -07:00
Cedric van PuttenandFacebook GitHub Bot 3dee6d31b9 fix(dev-middleware): allow inspector proxy to fetch sourcemaps on lan connections (#43307)
Summary:
The inspector proxy is inlining source maps on `Debugger.scriptParsed` CDP events. The inlining prevents Chrome DevTools from downloading this remotely, as that's not supported in newer versions anymore.

The current implementation locks this inlining mechanism to just `localhost` and/or `127.0.0.1` addresses, making it incompatible with LAN or tunnel device connections.

This PR removes that limitation to allow source map inlining on these LAN and tunnel connections.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL][FIXED] Allow Inspector proxy to inline source maps on LAN connections

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

Test Plan:
- See added test
- Start Metro and connect a device over LAN, open the chrome devtools

Reviewed By: huntie

Differential Revision: D54485247

Pulled By: robhogan

fbshipit-source-id: 6fcb0c6dd762d2f0a013497ba0a1126095b9130b
2024-03-11 03:48:49 -07:00
Ruslan LesiutinandFacebook GitHub Bot e2157f063a bump react-devtools-* packages to ^5.0.2 (#43384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43384

Changelog: [Internal]

via `js1 upgrade react-devtools -v ^5.0.2`

5.0.1 and 5.0.2 mostly include fixes, biggest change is the way how we find source location of the element and the symbolication.

Backend from `react-devtools-core` 5.0.2 is required for symbolication.

allow-large-files

Reviewed By: huntie

Differential Revision: D54679238

fbshipit-source-id: 13656b2d9bad106246c019e1627b87ffbc2735fe
2024-03-08 13:07:49 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 6c28c87c4d TurboModule::emitDeviceEvent doesn't require jsi::Runtime argument anymore (#43376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43376

## Changelog:
[Internal] -

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903

fbshipit-source-id: 25cea413e66c6e76c958395879db1169899e3bc9
2024-03-08 10:28:45 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 76ce789014 Pass jsi::Runtime reference into CallInvoker::invoke* callbacks (#43375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43375

## Changelog:
[Internal] -

As discussed with the team, it makes more sense to pass the reference to the correct `jsi::Runtime` object as an argument to the ` CallInvoker::invoke*` callbacks, that are provided by the user.

There are various use cases when user would like to get a hold of the `jsi::Runtime` in the callback, and it makes sense, since it is guaranteed to run on the JS thread.

So far people have been coming up with all kinds of workarounds for that, none of them safe enough.

Reviewed By: rubennorte

Differential Revision: D54643171

fbshipit-source-id: 2f6015426a9e29cb9fcf5a9a3e2f6f33ff692538
2024-03-08 10:28:45 -08:00
Luna WeiandFacebook GitHub Bot 208be50000 Try renaming build_npm_package for nightly job (#43379)
Summary:
Changelog: [Internal] Try renaming nightly job so we can automate if there are failures
See https://circleci.com/docs/configuration-reference/#name

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

Reviewed By: cortinico

Differential Revision: D54670307

Pulled By: lunaleaps

fbshipit-source-id: 85a26f92d7789f6195c9cf07909dd12850010a4b
2024-03-08 09:46:48 -08:00
Alexey LitvinovandFacebook GitHub Bot eadcebbb3e add support for text highlighting (#43386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43386

Changes:
- fixes `RCTAttributedTextUtils` to set `RCTAttributedStringIsHighlightedAttributeName` attribute according to `isHighlighted` textAttribute value.
- adds block to `drawAttributedString` and passed highlighted bezier curve to it.
- updates `drawRect` to visually highlight selected text.

## Changelog:
[iOS][Fixed] - Fixed text highlighting in the New Architecture

Reviewed By: sammy-SC

Differential Revision: D54594472

fbshipit-source-id: ed454e3a1660fa76d96cb131e33fba1c05f47776
2024-03-08 09:24:45 -08:00
Rick HanlonandFacebook GitHub Bot 7bb204a160 Fix public-api-test "expected parse error" assertion (#43378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43378

## Overview
I noticed while running this test, that there's an existing `console.error` to remove a file from the `FILES_WITH_KNOWN_ERRORS` list, but the tests pass despite the error. This happens because the `console.error` throws to fail the test, but this `console.error` is inside a try/catch, so the error is swallowed.

This diff moves the check to a finally, which fails the test.

I also fixed the `FILES_WITH_KNOWN_ERRORS` list.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D54587062

fbshipit-source-id: c46e98326ef6654452871337364d7e66ff204e2c
2024-03-08 08:53:49 -08:00
Alex HuntandFacebook GitHub Bot cfa39c0a69 Integrate CDPAgent into HermesRuntimeTargetDelegate behind flag (#43353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43353

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Integrates `HermesRuntimeAgentDelegateNew` (using the new Hermes `CDPAgent` setup) into `HermesRuntimeTargetDelegate` behind a new feature flag, `inspectorEnableHermesCDPAgent`. This completes the initial integration for all platforms.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54586162

fbshipit-source-id: 5f26c28af4414d961b1c8c9cb4cd7135bd00b410
2024-03-08 07:29:22 -08:00
Alex HuntandFacebook GitHub Bot 166fdc5125 Create wrapper class for Hermes CDPAgent + CDPDebugAPI (#43352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43352

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Adds the `HermesRuntimeAgentDelegateNew` class to provide a swap-in replacement for the existing `HermesRuntimeAgentDelegate` when we enable this via an incoming feature flag.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53810356

fbshipit-source-id: c63684252230a747ecf0bd8cbb6f4e22052ed9bf
2024-03-08 07:29:22 -08:00
Alex HuntandFacebook GitHub Bot 52bd8418d8 Create InspectorFlagOverridesGuard util, substitute in tests (#43372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43372

Create a shared `InspectorFlagOverridesGuard` util for our `jsinspector-modern` tests, update `ReactInstanceIntegrationTestWithFlags` to reuse this.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54639775

fbshipit-source-id: 9b23e4c05bcdbb8ebc2a02a6e69326eb749d1cfd
2024-03-08 07:29:22 -08:00
Pieter De BaetsandFacebook GitHub Bot 5ed3057822 Make ReactActivityDelegate methods public (#43367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43367

Enable `ReactActivityDelegate` to be used outside of `ReactActivity` as well.

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D54634339

fbshipit-source-id: 977e0da689d5a827feca89a5dcc9416ad5178334
2024-03-08 07:04:12 -08:00
Samuel SuslaandFacebook GitHub Bot da913236ab add missing synchronisation call for native animated (#43374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43374

changelog: [internal]

when animation that uses native driver finishes, it must synchronise the end state with shadow tree.

`onUpdateRef` for native animated is only called when the animation finishes.

Reviewed By: javache, yungsters

Differential Revision: D54582987

fbshipit-source-id: 4320ed172b8bb4b22f82c6e24b47f88f1603e4fb
2024-03-08 06:48:58 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 4adef35e97 fix(iOS) [0.74]: RCTRedBox not appearing in Bridgeless when metro is not running (#43147)
Summary:
When testing out `0.74.0-rc0` I found that when the metro is not running we are not displaying RedBox which bumps users to start the packager and reload the app. It also fixes the case where users try to reload by clicking the "Reload" button on RedBox.

## Before

https://github.com/facebook/react-native/assets/52801365/086c557f-ea1f-4a97-b4c7-df8a945cc7a0

## After

https://github.com/facebook/react-native/assets/52801365/9f8421b3-5e83-466f-8cdb-38f97981275d

## Changelog:

[IOS] [FIXED] - RCTRedBox not appearing in Bridgeless when metro is not running

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

Test Plan: Build the app without metro running check if RedBox is shown

Reviewed By: javache

Differential Revision: D54632056

Pulled By: dmytrorykun

fbshipit-source-id: fb6742898d3bd82545bfffd9175208e1a5984cb6
2024-03-08 04:53:42 -08:00
Tomek ZawadzkiandFacebook GitHub Bot 642b4e5c2c Expose react_render_textlayoutmanager via prefab (#43381)
Summary:
The `react_render_textlayoutmanager` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[ANDROID] [CHANGED] - Expose `react_render_textlayoutmanager` via prefab.

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

Reviewed By: javache

Differential Revision: D54676207

Pulled By: cortinico

fbshipit-source-id: 90e3b90ff842250bf1e3abcc0c54f057b68a82fd
2024-03-08 04:32:44 -08:00
Kudo ChienandFacebook GitHub Bot 6bc95b2074 Add registerCallableModule types (#43366)
Summary:
`registerCallableModule()` was added from 7f549ec7be but no typescript types there. this pr tries to add the corresponding types.

## Changelog:

[GENERAL] [FIXED] - Add missing `registerCallableModule` TypeScript definitions

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

Test Plan: patch locally and try to `import { registerCallableModule } from 'react-native';` in a 0.74.0-rc.2 project

Reviewed By: fabriziocucci

Differential Revision: D54676151

Pulled By: cortinico

fbshipit-source-id: cd01f2ebe2d2516b458fae5b2e83cba3d3794455
2024-03-08 02:30:17 -08:00
Rick HanlonandFacebook GitHub Bot 5126bace65 Fix VirtualizedList-test.js (#43377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43377

Fixes `VirtualizedList-test.js`, which assumes fake timers (e.g. using `jest.runAllTimers()` and `jest.runOnlyPendingTimers()`) but did not actually use fake timers.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D54668281

fbshipit-source-id: b14757744bb7a21a4e5573053549c36178826021
2024-03-07 23:19:27 -08:00
Rick HanlonandFacebook GitHub Bot ed32b4ba0a Organize component stack regexes better (#43371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43371

This file has a lot of regexes, let's organize and comment them all.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D54638520

fbshipit-source-id: eed61133758ccefd2a640f121c4da214bcad4880
2024-03-07 23:15:55 -08:00
Rick HanlonandFacebook GitHub Bot adaf5eba3e Fix component stacks for tsx, ts, and jsx files (#43370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43370

Component stacks with files ending in .ts, .tsx, or .jsx were skipped in LogBox reporting. This diff fixes the regex.

Changelog:
[General][Fixed] - Support .tsx, .ts, and .jsx in component stacks

Reviewed By: yungsters

Differential Revision: D54638526

fbshipit-source-id: a5271daaa7b687e8e075be3f94ab9b9c03f79b66
2024-03-07 23:15:55 -08:00
Vojtech NovakandFacebook GitHub Bot 2d547a3252 feat: RCTConvert to support UIModalPresentationStyle (#43297)
Summary:
Currently, the ability to convert JS values to `UIModalPresentationStyle` is not present directly on `RCTConvert`.

In the RN code base itself, there's not a lot of need to do this type of conversion, but in community modules, presenting ViewControllers can be a fairly common scenario and it'd be nice to be able to use this conversion directly from `RCTConvert`, rather than from `RCTModalHostViewManager`, as it'd improve its "discoverability" and consistency.

If someone relied on this, then it's technically speaking a breaking change but I'd say it's for the better, and searching `#import <React/RCTModalHostViewManager.h>` on github doesn't reveal a lot of results.

## Changelog:

[IOS] [ADDED] - RCTConvert to support UIModalPresentationStyle

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

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

Test Plan:
Tested using RN Tester

https://github.com/facebook/react-native/assets/1566403/6e62df86-dde3-47b0-b2e9-bb6b483cadf6

Reviewed By: fkgozali

Differential Revision: D54635896

Pulled By: dmytrorykun

fbshipit-source-id: c6747857830762cd0333c31c287954f3f10d4954
2024-03-07 18:05:34 -08:00
Alex Taylor (alta)andFacebook GitHub Bot 9b1c486e40 Deploy 0.230.0 to xplat (#43373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43373

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D54640661

fbshipit-source-id: 6d09ec126ea55bbe0d7a6b3a2823b1a0ffef7d21
2024-03-07 15:27:50 -08:00
Dmitry RykunandFacebook GitHub Bot ff03b149e7 Use fs.cpSync instead of execSync('cp ... (#43368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43368

This diff replaces direct invocation of the `cp` command with the platform agnostic `fs.cpSync`.
Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54634108

fbshipit-source-id: 41fe7b44b6534026ef1b930da85725bf3eb1e7bb
2024-03-07 09:19:09 -08:00
Adam ErnstandFacebook GitHub Bot f7bbaffdc3 Apply RN_EXPORT to ReactNativeFeatureFlags functions (#43356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43356

To make it accessible across different dylib/bundle.

Changelog: [Internal]

Reviewed By: d16r

Differential Revision: D54601288

fbshipit-source-id: e65b724b228a680784e81b8c51ecd3f4df3fd668
2024-03-06 20:09:49 -08:00
Arushi KesarwaniandFacebook GitHub Bot c771011fed Support onActivityResult in Bridgeless (#43351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43351

Implement `onActivityResult` on Bridgeless

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D54574139

fbshipit-source-id: f2369077199186ac6ef0187b5dfe7ed95f3b87fc
2024-03-06 13:19:55 -08:00
Rubén NorteandFacebook GitHub Bot c645646a20 Create new flag to disable the last part of the notifications for mount hooks on Android (#43349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43349

Changelog: [internal]

We still haven't found the root cause of some of the crashes we're seeing in the experiments to enable mount hooks on Android.

This adds a new feature flag to skip part of the mount hooks pipeline to see if we can scope the investigation to that specific part (where we query the root tree in the base revision from the mounting coordinator).

Reviewed By: sammy-SC

Differential Revision: D54587739

fbshipit-source-id: 792aa8b06808e96638d1bba072bf4060ec492bd2
2024-03-06 12:41:49 -08:00
Rubén NorteandFacebook GitHub Bot fafd64e9c3 Migrate mount hooks flag to new system (#43350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43350

Changelog: [internal]

Mount hooks have been shipped on iOS, so this removes the flag for them.

On Android, we're still testing them so it's worth moving them to the new system and scoping them to that platform.

Reviewed By: sammy-SC

Differential Revision: D54587740

fbshipit-source-id: d074927fee1a967bd3928970c31975d07cd393bb
2024-03-06 12:41:49 -08:00
Rubén NorteandFacebook GitHub Bot a66f4450e5 Improve logic to report mounted surfaces (#43337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43337

Changelog: [internal]

Mount instructions and listeners are only called from the UI thread, so there's no need to have synchronization mechanisms for concurrency.

We're also scheduling mount hooks notifications once, but subsequent calls are ignored instead of accumulated to be notified together. This also changes that to collect all the surface IDs in the array that is read on notification.

Reviewed By: sammy-SC

Differential Revision: D54547194

fbshipit-source-id: a861e3b0113914aae5325c1486bcf8acd50eef79
2024-03-06 12:41:49 -08:00
D NandFacebook GitHub Bot 028615180b Add missing Headers methods (#43279)
Summary:
```tsx
// Hermes runtime (RN 73.x)
console.log({...Headers.prototype})
// result:
{
  "append": [Function anonymous],
  "delete": [Function anonymous],
  "entries": [Function anonymous],
  "forEach": [Function anonymous],
  "get": [Function anonymous],
  "has": [Function anonymous],
  "keys": [Function anonymous],
  "set": [Function anonymous],
  "values": [Function anonymous],
  Symbol(Symbol.iterator): [Function anonymous]
}
```

But in typescript

```tsx
new Headers().entries()
// ^^^ Error: Property entries does not exist on type Headers
Object.fromEntries(new Headers())
// ^^^ Error: Property [Symbol.iterator] is missing in type Headers but required in type Iterable<readonly any[]>
```

## Changelog:

[GENERAL] [ADDED] - [TypeScript] Add missing `Header` methods

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

Test Plan: Use code above in your RN project and run `yarn tsc --noEmit`

Reviewed By: rshest

Differential Revision: D54554523

Pulled By: arushikesarwani94

fbshipit-source-id: ae7f05f9526771ff003aaf22f786b5503661c739
2024-03-06 11:07:48 -08:00
Rob HoganandFacebook GitHub Bot 3ed0ff34b3 Add helpers for formatting JSON CDP responses (#43340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43340

Adds convenience methods `jsonResult`, `jsonError` and `jsonNotification` for more ergonomic construction of CDP JSON responses. Note that CDP is *loosely* based on [JSON-RPC 2.0](https://www.jsonrpc.org/specification), but differs for example in the  omission of `"jsonrpc": "2.0"`.

Before:
```
frontendChannel_(folly::toJson(folly::dynamic::object("id", req.id)(
            "error",
            folly::dynamic::object("code", -32602)(
                "message",
                "executionContextName is mutually exclusive with executionContextId"))));
```

After:
```
frontendChannel_(cdp::jsonError(
            req.id,
            cdp::ErrorCode::InvalidParams,
            "executionContextName is mutually exclusive with executionContextId"));
```

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54202854

fbshipit-source-id: 76a407ae39ff9c2ec79bcaddb6cd4d494afb7693
2024-03-06 09:27:50 -08:00
Samuel SuslaandFacebook GitHub Bot 9426d249cb delete butter module (#43300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43300

changelog: [internal]

not used, let's delete

Reviewed By: fkgozali

Differential Revision: D54462125

fbshipit-source-id: f6cb5199e00e139c0340ad5c7b338acfb99f0d15
2024-03-06 08:38:55 -08:00
Rick HanlonandFacebook GitHub Bot 82db330360 Fix parseLogBoxLog test that test hermes component stacks (#43281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43281

## Overview
This diff fixes a bug in the hermes component stack location parser, and fixes the hermes component stack tests which were not using hermes stack parsing, which is why the bug wasn't caught.

The bug fix is that React component stacks may not all have stack frame locations. For example, this stack:

```
at MyComponent (/path/to/filename.js:1:2)
at MyOtherComponent                         <-- no location
at MyAppComponent (/path/to/app.js:100:20)
```

This can happen when we're unable to make a component throw (e.g. it doesn't use a hook or access props). We have plans to fix these frames, but currently they can exist.

The bug was when `parseHermesStack` finds a frame without an `entry`, it would reset the `entries`. But if entries is already non-null, or if the current frame is a frame without a source, we should continue.

### Caveats

The handling here fixes the behavior to go back to skipping these frames. I'm not sure what the best way to handle these cases are, since these frames do not have source location and should skip symbolication. We should follow up with handling for these frames.

## Why it wasn't caught

In D18627930 we changed the hermes component stack parsing to check `global.HermesInternal`, but the tests for the hermes component stacks were still using the `stacktrace-parser`. I updated the tests to set/reset the global, which caught the bug.

Changelog:
[General][Fixed] - Support hermes component stacks with missing source info.

Reviewed By: yungsters

Differential Revision: D54423252

fbshipit-source-id: 80ded8b99eab919e60f847369dcb1f3afa72b6be
2024-03-06 07:44:01 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot b2fba371df feat: optimize RCTKeyWindow() for iOS 15+ (#43066)
Summary:
This PR further optimizes RCTKeyWindow() for iOS 15+ removing the need for additional loop
bypass-github-export-checks
## Changelog:

[IOS] [ADDED] - optimize RCTKeyWindow() for iOS 15+

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

Test Plan: Launch RNTester, check if proper keyWindow is returned for iOS 15+

Reviewed By: javache

Differential Revision: D54541838

Pulled By: cipolleschi

fbshipit-source-id: be79ff48f825d10c8fd71efc18629377aadc29fd
2024-03-06 07:07:53 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 7c953698b4 Allow importing RCTAppDelegate in Swift (#43339)
Summary:
This PR fixes importing RCTAppDelegate, cleans up the imports, and properly sets the background color for bridgeless mode when using `RCTRootViewFactory`.

The issue with importing to Swift was that `RCTTurboModuleManager` has C++ in headers which caused Swift to error out.

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Allow importing RCTAppDelegate in Swift
[INTERNAL] [REMOVED] - Remove unnecessary imports in AppDelegate
[INTERNAL] [FIXED] - Properly set background color for bridgeless

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

Test Plan:
- CI Green
- Check if background color is correct

Reviewed By: dmytrorykun

Differential Revision: D54584489

Pulled By: cipolleschi

fbshipit-source-id: cb4b947ca9d0f375b1852dbf5a7d889e920562f7
2024-03-06 06:51:31 -08:00
Tomek ZawadzkiandFacebook GitHub Bot 1c69100a2b Expose rrc_text via prefab (#43275)
Summary:
The `rrc_text` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[ANDROID] [CHANGED] - Expose `rrc_text` via prefab.

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

Reviewed By: cipolleschi

Differential Revision: D54536468

Pulled By: cortinico

fbshipit-source-id: 8c4ef983467bfc46930f10bf7bd95761c2d11788
2024-03-06 03:54:46 -08:00
Nicola CortiandFacebook GitHub Bot e1702f44c9 Do not publish src/**/__tests__ folder for react-native (#43261)
Summary:
We should not be publishing the `__tests__` folder to the npm package.
Fixes https://github.com/facebook/react-native/issues/43242

## Changelog:

[INTERNAL] [CHANGED] - Do not publish src/**/__tests__ for react-native

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

Test Plan: Nothing to test

Reviewed By: cipolleschi

Differential Revision: D54540896

Pulled By: cortinico

fbshipit-source-id: 10b557a911b9b17d64c4697724825248a597feae
2024-03-06 03:21:44 -08:00
Pieter De BaetsandFacebook GitHub Bot fb9872d4fe Fix DefaultReactNativeHost assuming lazyViewManagers are always available (#43334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43334

cortinico flagged that bridge + fabric regressed in 0.74, likely due to D53406841.

Changelog: [Android][Fixed] Fix registration of ViewManagers in new renderer when not using lazyViewManagers.

Reviewed By: fkgozali

Differential Revision: D54551645

fbshipit-source-id: 0783030cd0d2900a3a254ae04c9ea4e51035272a
2024-03-06 03:11:33 -08:00
Pieter De BaetsandFacebook GitHub Bot e4f3338069 Remove deprecated Pressability methods (#43328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43328

These have been deprecated since 2019 (D18742620), probably time we remove them.

Changelog: [General][Removed] Removed deprecated methods from Pressability.

Reviewed By: NickGerleman

Differential Revision: D54535029

fbshipit-source-id: 45f85fb002824c94363c839fee2f831c01ad4dbd
2024-03-06 02:53:17 -08:00
Moti ZilbermanandFacebook GitHub Bot 396475a26d Use RuntimeExecutor consistently throughout the modern CDP backend (#43332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43332

Changelog: [Internal]

The Hermes debugger integrations in Bridge/Bridgeless have so far used `MessageQueueThread` directly to schedule work on the JS thread, instead of the Instance-managed executor.

This was always a smell, but is now actively unsafe since the modern CDP backend requires `JSExecutor` / `JSRuntime` to remain alive while work is ongoing on the JS thread. This is not guaranteed when using `MessageQueueThread` directly like we do now, but *is* guaranteed by the Instance-managed `RuntimeExecutor` (see reasoning in D54493456).

We already have access to that executor in `RuntimeTarget`, so here we ensure that it's the one used by the AgentDelegate too and eliminate the direct use of `MessageQueueThread`.

NOTE: It would have been, perhaps, nice to just house the executor inside `JSExecutor` / `JSRuntime` to begin with, instead of adding a parameter to `createAgentDelegate()`. This would require some broader refactoring which I'm choosing to avoid for now.

Reviewed By: huntie

Differential Revision: D54539429

fbshipit-source-id: 6a5ad1c56642d809f6193b230301fa268318bbce
2024-03-06 02:18:48 -08:00
Moti ZilbermanandFacebook GitHub Bot 1caa0a9ea9 Refactor Hermes CDP integrations into HermesRuntimeTargetDelegate (#43326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43326

Changelog: [Internal]

Extracts the common parts of `HermesJSRuntime` (Bridgeless) and `HermesExecutor` (Bridge) that pertain to integration with the modern CDP backend into a new `HermesRuntimeTargetDelegate` class. This also makes the `HermesRuntimeAgentDelegate` class fully private.

As a followup, we *might* want to change `JSRuntime` and `JSExecutor` so they don't *implement* `RuntimeTargetDelegate` but are required to expose a `RuntimeTargetDelegate& getRuntimeTargetDelegate()` method instead. That would remove some of the boilerplate required for our current "aggregation" approach.

Reviewed By: huntie

Differential Revision: D54537844

fbshipit-source-id: f8c51fda0dbf28add1daeb95c991a34670f6854f
2024-03-06 02:18:48 -08:00
Moti ZilbermanandFacebook GitHub Bot 702aa25870 JsiIntegrationTest: Assert that optionals have values before dereferencing them
Summary:
Changelog: [Internal]

Use a gtest assertion to avoid running into an exception (which has worse diagnostics) when dereferencing an `optional` value that's expected to be non-empty.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54578843

fbshipit-source-id: e0269542f80045f02876bda06cb584b6c68e50cd
2024-03-06 02:12:50 -08:00
Alex HuntandFacebook GitHub Bot b5117520fc Enforce sorting of feature flag definitions (#43329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43329

Improve maintainability of this file, in particular reducing the probability of a merge conflict for new entries.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D54539469

fbshipit-source-id: dc2fca42b4490d87c532b21043b0855d8d1a894d
2024-03-05 17:27:23 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9aeb9f2f94 Allow the app to control the Activity Indicator in Bridgeless mode (#43195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43195

Right now, the activity indicator is automatically hidden when the view is ready to be shown in bridgeless mode.
There is no way to prevent that the activity indicator is automatically removed.

In OSS, we have libraries (e.g.: `react-native-bootsplash`) that will allow the app to control when and how dismiss the splashscreen, but due to the current automatic behavior on Bridgeless, they stopped working.

***Note:** In the previous implementation, they were working because instead of using the `loadingView` property, they were adding the splashscreen view on top of the existing one. However, with the lazy behavior of the bridgeless mode, this is not working anymore because the RCTMountingManager [expect not to have any subview](https://www.internalfb.com/code/fbsource/[6962fa457dbc74ab3a760cf6090d9643c6748781]/xplat/js/react-native-github/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm?lines=176) when the first surface is mounted.*

## Changelog
[iOS][Added] - Allow the activityIndicator to be controlled from JS in bridgeless mode

Reviewed By: philIip

Differential Revision: D54191856

fbshipit-source-id: 14738032f04adf7eaf7d200d889acd752aed0ed3
2024-03-05 09:37:26 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 1387725aab fix: add compiler conditional to hover style (#43331)
Summary:
Commit https://github.com/facebook/react-native/commit/73664f576aaa472d5c8fb2a02e0ddd017bbb2ea4 broke two jobs in CircleCI that we run using Xcode 14.3.1 because the commit introduced some types that are available only to iOS 17.
The code was wrapped around if(available()) statement, but this does not compile out the code. It is a runtime check and the code needs to build anyway.

This takes effect at compile time as well. However, unlike with #available, the method must type check and compile. The code will always be emitted into your binary: however, it will only be used when the binary is executed on platforms that meet the availability requirements.

source: [forums.swift.org/t/if-vs-available-vs-if-available/40266/2](https://forums.swift.org/t/if-vs-available-vs-if-available/40266/2)

This change should fix it, introducing some compile time pragmas that removes the code if we build with older versions of Xcode

## Changelog:

[IOS] [ADDED] - Compiler conditionals for hover style (cursor: pointer)

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

Test Plan: CI Green

Reviewed By: dmytrorykun

Differential Revision: D54540520

Pulled By: cipolleschi

fbshipit-source-id: 943ac479062e11969efa7645ec0ead26c6866374
2024-03-05 07:58:47 -08:00
Marc RousavyandFacebook GitHub Bot 8769245477 Allow ReactCommon/Folly to be used in Swift libraries (DEFINES_MODULE) (#43327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43327

<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. -->

## Summary

Swift Pods require the use of [modular headers](https://blog.cocoapods.org/CocoaPods-1.5.0/) to be statically linked. To interop with Objective-C modules, you need to make the Objective-C module "define a Module", that is modular header export.

This is already the case for a few podspecs so they can be consumed in Swift libraries, but `ReactCommon` and `RCT-Folly` don't do this yet and therefore this breaks in a few libraries of mine, for example see this issue: https://github.com/mrousavy/react-native-vision-camera/issues/195.

If I were to include `ReactCommon` or `RCT-Folly` in my Swift library's podspec, the following error arises:

```
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `VisionCamera` depends upon `RCT-Folly`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift
when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or
specify `:modular_headers => true` for particular dependencies.
```

So this PR fixes this issue by allowing Swift libraries to consume the `ReactCommon` and `RCT-Folly` podspecs since they now export modular headers.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Expose Modular Headers for `ReactCommon` podspec
[General] [Fixed] - Expose Modular Headers for `RCT-Folly` podspec

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

Test Plan: * Add s.dependency "ReactCommon" or RCT-Folly to a Swift pod and see what happens. (See https://github.com/mrousavy/react-native-vision-camera/pull/273)

Reviewed By: dmytrorykun

Differential Revision: D54539127

Pulled By: cipolleschi

fbshipit-source-id: 2291cc0c8d6675521b220b02ef0c3c6a3e73be38
2024-03-05 07:31:22 -08:00
Blake FriedmanandFacebook GitHub Bot cdb2ff9cfe chore: bump @react-native/core-cli-utils @ 0.75.0-main
Summary:
Bump the version to match RN.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54538812

fbshipit-source-id: a2e8225ea02fb1e7a69b3b20436c821a857ca1e2
2024-03-05 07:11:51 -08:00
Moti ZilbermanandFacebook GitHub Bot 1df3812933 Document extended RuntimeTargetDelegate lifetime requirements
Summary:
Changelog: [Internal]

NOTE: This is a documentation-only diff.

Documents that the caller of `InstanceTarget::registerRuntime()` is required to keep the `RuntimeTargetDelegate&` valid longer than previously stated. Rather than merely outliving the `RuntimeTarget` object ( = past `unregisterRuntime()`), the delegate must also remain valid while any JS is being executed in the underlying runtime.

Proof that this requirement is already met by the existing integrations:
* In Bridgeless, `RuntimeTargetDelegate` is implemented by [`JSRuntime`](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/react/runtime/JSRuntimeFactory.h#L20). JS execution via the `RuntimeExecutor` happens [here](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L70), while a [strong reference to the `JSRuntime`](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L66) is in scope.
* In Bridge, `RuntimeTargetDelegate` is implemented by [`JSExecutor`](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/cxxreact/JSExecutor.h#L58). JS execution via the `RuntimeExecutor` happens [here](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/cxxreact/Instance.cpp#L253), while a (necessarily valid) non-owning [pointer to the `JSExecutor`](https://github.com/facebook/react-native/blob/9f85a249fa9e18eae745f103e390b2a8542e8ee9/packages/react-native/ReactCommon/cxxreact/Instance.cpp#L247) is in scope.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54493456

fbshipit-source-id: c8dc11b0696e20b5fe9f3e16bb7591be0b3b6157
2024-03-05 06:32:45 -08:00
Alex HuntandFacebook GitHub Bot 42cab1488c Fix E2E template install in CI jobs (#43323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43323

This fixes a seemingly pre-existent misconfiguration within our `test_ios_template` E2E test setup in CircleCI.

**Background**

We call `npx react-native-community/cli init` with the `--skip-install` flag, as part of the bootstrapping logic in `scripts/e2e/init-template-e2e.js`. This is necessary because we later want to explicitly call `npm install` with a custom `--registry` for our locally mirrored packages (via Verdaccio).

For some reason, we were observing unexpected differences when this was run under CircleCI:

1. Runs `yarn init`
2. Runs a `yarn add` (unknown pkg)

 {F1464781818}

https://app.circleci.com/pipelines/github/facebook/react-native/42725/workflows/f648468b-e916-4501-887d-ad293aa6fccf/jobs/1398950

This is causing a Yarn-based install ahead of where we want — ignoring the `--skip-install` flag.

*I'm still unsure on the exact LOC cause in CLI* (but most likely, it's around the Yarn v3 move).

**Impact of this fix**

- The above meant that, when we were bootstrapping `test_ios_template` previously, packages weren't being read from Verdaccio, but **instead from npm** — using the `"0.74.0"` versions from the *previous branch cut* .
- After D54006327, this behaviour became breaking 💀 — since for the 0.74 -> 0.75 cut, we no longer physically published `"0.75.0-main"` (new format) packages to npm.

**This change**

I'm passing `--pm npm` to `npx react-native-community/cli init` to skip around any Yarn behaviour. This appears to have removed the erroneous `yarn` invocations .

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: cortinico, cipolleschi

Differential Revision: D54536848

fbshipit-source-id: 473b11924955f5787c82a6c81d4527d77b810aa5
2024-03-05 06:18:37 -08:00
Rubén NorteandFacebook GitHub Bot 3222805b4f Simplify logic in queueMicrotask (#43324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43324

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D54537050

fbshipit-source-id: b7400fd5f39817e6cdcd791beea192919d79b3b0
2024-03-05 06:02:38 -08:00
Rubén NorteandFacebook GitHub Bot 74595907a2 Add JSI test for queueMicrotask and drainMicrotasks (#43309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43309

Changelog: [internal]

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

Add JSI test verifying the behavior of `queueMicrotask` and `drainMicrotasks` in the runtimes that support them.

Reviewed By: neildhar

Differential Revision: D54484771

fbshipit-source-id: e8c0c8e05215d59a0a8c86161452642c41bcdbd7
2024-03-05 04:10:44 -08:00
Rubén NorteandFacebook GitHub Bot 244fe286a0 Make queueMicrotask pure virtual (#43311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43311

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

Changelog: [internal]

We've done this in a separate diff because the changes in Hermes don't propagate immediately to the React Native repository. We need to land the changes in JSI and Hermes first (in a backwards-compatible way) and then land this in a separate commit to make the method mandatory.

Reviewed By: neildhar

Differential Revision: D54413830

fbshipit-source-id: 3b89fe0e6697b0019544b73daa89d932db97b63a
2024-03-05 04:10:44 -08:00
Cedric van PuttenandFacebook GitHub Bot f3ce7cd76e feature(dev-middleware): add inspector proxy nativeNetworkInspection target capabilty flag (#43310)
Summary:
This adds the `nativeNetworkInspection` target capability flag, to enable/disable the proxy-side network inspection handling.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL][ADDED] Add inspector proxy `nativeNetworkInspection` target capability flag

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

Test Plan:
Once this lands, and is published through `react-native/dev-middleware`, we (Expo) can disable the proxy-side network inspection handling.

See https://github.com/expo/expo/pull/27425/commits/1a1b601a29fbc5766628238db7259121689f6cd6 on PR expo/expo#27425

Reviewed By: christophpurrer, motiz88

Differential Revision: D54486516

Pulled By: huntie

fbshipit-source-id: cc151349c816fb3866d3ec07af1a29a5f4ff9b00
2024-03-05 04:03:30 -08:00
D NandFacebook GitHub Bot f043c832d1 chore: [Github Actions] Update actions/stale to the latest version (#43312)
Summary:
- Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/stale@v5. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
  - from last run: https://github.com/facebook/react-native/actions/runs/8136278191

## Changelog:

[INTERNAL] [CHANGED] - [Github Actions] Update actions/stale to the latest version

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

Test Plan: Run workflow once

Reviewed By: cortinico

Differential Revision: D54506678

Pulled By: arushikesarwani94

fbshipit-source-id: 530ed1f0ff5571ee124bc78bac11c6584a9af60c
2024-03-05 03:43:32 -08:00
Luna WeiandFacebook GitHub Bot bd6550192d Changelog for 0.74.0-rc.2 (#43315)
Summary:
Changelog: [Internal] - Changelog for 0.74.0-rc.2

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

Reviewed By: christophpurrer

Differential Revision: D54511031

Pulled By: lunaleaps

fbshipit-source-id: d82144b1f828462ee483ffdcbb8d1c0d1d83ee50
2024-03-04 21:52:16 -08:00
Ryan LintonandFacebook GitHub Bot 0dc5c5f1f4 Update bridge to handle long values (#43158)
Summary:
This adds support for 64 bit integer (long) values to the Android bridge. Per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738) Android encodes wide gamut colors as long values so we need to update the bridge to support 64 bit integers as well since these classes will soon receive those values from native.

## Changelog:

[ANDROID] [ADDED] - Update bridge to handle long values

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

Test Plan: I added tests where I could for long types and truncation. I would like to add tests for ReadableNativeArray and ReadableNativeMap but I'm not sure how to go about mocking HybridData.

Reviewed By: cipolleschi

Differential Revision: D54276496

Pulled By: NickGerleman

fbshipit-source-id: 1e71b5283f662748beef1bdb34d9c86099baecb0
2024-03-04 19:07:53 -08:00
Saad NajmiandFacebook GitHub Bot 73664f576a feat(iOS): Implement cursor style prop (#43078)
Summary:
Implement the cursor style prop for iOS (and consequently, visionOS), as described in this RFC: https://github.com/react-native-community/discussions-and-proposals/pull/750

See related PR in React Native macOS, where we target macOS and visionOS (not running in iPad compatibility mode) with the same change: https://github.com/microsoft/react-native-macos/pull/2080

Docs update: https://github.com/facebook/react-native-website/pull/4033

## Changelog:

[IOS] [ADDED] - Implement cursor style prop

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

Test Plan:
See the added example page, running on iOS with the new architecture enabled. This also runs the same on the old architecture.

https://github.com/facebook/react-native/assets/6722175/2af60a0c-1c1f-45c4-8d66-a20f6d5815df

See the example page running on all three apple platforms. The JS is slightly different because:
1. The "macOS Cursors" example is not part of this PR but the one in React Native macOS.
2. This PR (and exapmple) has went though a bunch of iterations and It got hard taking videos of every change 😅

https://github.com/facebook/react-native/assets/6722175/7775ba7c-8624-4873-a735-7665b94b7233

## Notes

- React Native macOS added the cursor prop to View with https://github.com/microsoft/react-native-macos/pull/760 and Text with https://github.com/microsoft/react-native-macos/pull/1469 . Much of the implementation comes from there.

- Due to an Apple bug, as of iOS 17.4 Beta 4, the shape of the iOS cursor hover effect doesn't render in the correct bounds (but it does on visionOS). I've worked around it with an ifdef. The result is that the hover effect will work on iOS and visionOS, but not iPad apps running in compatibility mode on visionOS.

Reviewed By: NickGerleman

Differential Revision: D54512945

Pulled By: vincentriemer

fbshipit-source-id: 699e3a01a901f55a466a2c1a19f667aede5aab80
2024-03-04 18:51:17 -08:00
Sam ZhouandFacebook GitHub Bot 923d4abd7b Update hermes-parser and related packages in fbsource to 0.20.1 (#43317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43317

Bump hermes-parser and related packages to [0.20.1](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D54510131

fbshipit-source-id: 064d2078e85e465552dccf5c1368e49707c3aeef
2024-03-04 17:10:51 -08:00
D NandFacebook GitHub Bot 09c903c439 fix: [TypeScript] Remove non-existent methods from <ImageBackground/> (#43290)
Summary:
Using the code from `Test Plan` you will see that `ImageBackground` component doesn't have methods that declared on TypeScript side.

I checked the source code and there is also nothing:

https://github.com/facebook/react-native/blob/d9b0f15c844abce5e97edfd401656d84d0c84133/packages/react-native/Libraries/Image/ImageBackground.js#L47-L69

```tsx
// runtime (React Native 0.73)
 {
  "abortPrefetch": undefined,
  "getSize": undefined,
  "prefetch": undefined,
  "queryCache": undefined,
  "resizeMode": undefined
}
```

## Changelog:

[GENERAL] [REMOVED] - Remove non-existent methods from `<ImageBackground/>` component

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

Test Plan:
```tsx
      <ImageBackground
        resizeMode={'contain'}
        ref={ref => {
          if (ref) {
            console.log(' --- xdebug', {
              resizeMode: ref.resizeMode,
              queryCache: ref.queryCache,
              getSize: ref.getSize,
              prefetch: ref.prefetch,
              abortPrefetch: ref.abortPrefetch,
            });
          }
        }}
        style={{
          width: '100%',
          height: '100%',
        }}
        source={{
          uri: 'https://upload.wikimedia.org/wikipedia/commons/8/87/Arturo_Nieto-Dorantes.webp',
        }}
      />
```

Reviewed By: cipolleschi

Differential Revision: D54466918

Pulled By: NickGerleman

fbshipit-source-id: 39bb555954fd6146f0e99106dbe9c13353191081
2024-03-04 14:26:51 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot ec928d7a66 feat(RCTAppDelegate): Implement RCTRootViewFactory (#42263)
Summary:
This PR implements `RCTRootViewFactory` a utility class (suggested by cipolleschi) that returns proper RCTRootView based on the current environment state (new arch/old arch/bridgeless). This class aims to preserve background compatibility by implementing a configuration class forwarding necessary class to RCTAppDelegate.

### Brownfield use case

This PR leverages the `RCTRootViewFactory` in `RCTAppDelegate` for the default initialization of React Native (greenfield).

Here is an example of creating a Brownfield integration (without RCTAppDelegate) using this class (can be later added to docs):

1. Store reference to `rootViewFactory` and to `UIWindow`

`AppDelegate.h`:
```objc
interface AppDelegate : UIResponder <UIApplicationDelegate>

property(nonatomic, strong) UIWindow* window;
property(nonatomic, strong) RCTRootViewFactory* rootViewFactory;

end
```

2. Create an initial configuration using `RCTRootViewFactoryConfiguration` and initialize `RCTRootViewFactory` using it. Then you can use the factory to create a new `RCTRootView` without worrying about old arch/new arch/bridgeless.

 `AppDelegate.mm`
```objc
implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {

  // Create configuration
 RCTRootViewFactoryConfiguration *configuration = [[RCTRootViewFactoryConfiguration alloc] initWithBundleURL:self.bundleURL
                                                                                                 newArchEnabled:self.fabricEnabled
                                                                                             turboModuleEnabled:self.turboModuleEnabled
                                                                                              bridgelessEnabled:self.bridgelessEnabled];

  // Initialize RCTRootViewFactory
  self.rootViewFactory = [[RCTRootViewFactory alloc] initWithConfiguration:configuration];

  // Create main root view
  UIView *rootView = [self.rootViewFactory viewWithModuleName:@"RNTesterApp" initialProperties:@{} launchOptions:launchOptions];

  // Set main window as you prefer for your Brownfield integration.
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  // Later in the codebase you can initialize more rootView's using rootViewFactory.

  return YES;
}
end
```
bypass-github-export-checks

## Changelog:

[INTERNAL] [ADDED] - Implement RCTRootViewFactory

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

Test Plan: Check if root view is properly created on app initialization

Reviewed By: dmytrorykun

Differential Revision: D53179625

Pulled By: cipolleschi

fbshipit-source-id: 9bc850965ba30d84ad3e67d91dd888f0547c2136
2024-03-04 10:14:44 -08:00
Luna WeiandFacebook GitHub Bot 9f85a249fa Link to releases repo for upgrade issues (#43295)
Summary:
Changelog: [Internal]

We're moving upgrade issues to https://github.com/reactwg/react-native-releases/issues/new/choose

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D54442540

Pulled By: lunaleaps

fbshipit-source-id: a079935a290f56d2932c5fc588e96a68e1c13f9a
2024-03-04 08:55:00 -08:00
Samuel SuslaandFacebook GitHub Bot 881942a958 avoid merging unrelated props into ShadowNodeFamily::nativeProps (#43305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43305

changelog: [internal]

Originally when I built setNativeProps, I assumed a node is either controlled by handled directly or it is controlled by React. But we can't make sure that's the case, users can do both and control one prop with setNativeProps and the others with React. Additionally, Suspense uses display: none to hide a subtree.

Therefore, React controlled props must not be copied into `ShadowNodeFamily::nativeProps_DEPRECATED`

Reviewed By: javache

Differential Revision: D54453820

fbshipit-source-id: 5b4038f0dd366621d26a92f668d33f27ce60f4b4
2024-03-04 08:27:46 -08:00
Alex HuntandFacebook GitHub Bot f57be12977 Bump packages for next major release (#43132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43132

Command run:

```
node scripts/releases/set-version 0.75.0-main --skip-react-native-version
```

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54006327

fbshipit-source-id: 7afe9e7ca3020faf399fdba2221fab8a102c56c7
2024-03-04 07:54:37 -08:00
Rubén NorteandFacebook GitHub Bot dc254acace Use new JSI method to queue microtasks in RuntimeSchedulerTest
Summary:
Changelog: [internal]

Now that `jsi::Runtime::queueMicrotask` is available, we can use it instead of calling an internal Hermes API in `RuntimeSchedulerTest`.

Reviewed By: christophpurrer

Differential Revision: D54416245

fbshipit-source-id: c9cbd3783d9dc1c3df499a7fec7acb6c229ec571
2024-03-04 05:03:39 -08:00
Rubén NorteandFacebook GitHub Bot bd89afa284 Implement queueMicrotask and drainMicrotasks in JSC
Summary:
Changelog: [internal]

## Context

We want to enable the new React Native event loop by default for all users on the new RN architecture (on the bridgeless initialization path more concretely), which requires support for microtasks in all the JS engines that the support (Hermes already has it, JSC doesn't).

## Changes

This adds initial support for microtasks in JSC, so we can schedule and execute microtasks in this runtime.

One limitation about this approach is that, AFAIK, the public API for JSC doesn't allow us to customize its internal microtask queue or specify the method to be used by its built-in `Promise` or native `async function`, so we're forced to continue using a polyfill in that case (which uses `setImmediate` that will be mapped to `queueMicrotask`).

Reviewed By: NickGerleman

Differential Revision: D54302534

fbshipit-source-id: 47f71620344a81bc6624917f77452106ffbf55a3
2024-03-04 05:03:39 -08:00
Rubén NorteandFacebook GitHub Bot 036f47ebc4 Add queueMicrotask method to JSI
Summary:
Changelog: [internal]

## Context

Microtasks are an important aspect of JavaScript and they will become increasingly important in the hosts where we're currently using JSI.

For example, React Native is going to adopt an event loop processing model similar to the one on the Web, which means it would need the ability to schedule and execute microtasks in every iteration of the loop. See https://github.com/react-native-community/discussions-and-proposals/pull/744 for details.

JSI already has a method to execute all pending microtasks (`drainMicrotasks`) but without a method to schedule microtasks this is incomplete.

We're currently testing microtasks with Hermes using an internal method to schedule microtasks (`HermesInternal.enqueueJob`) but we need a method in JSI so this also works in other runtimes like JSC and V8.

## Changes

This adds the `queueMicrotask` to the Runtime API in JSI so we have symmetric API for microtasks and we can implement the necessary functionality.

The expectation for JSI implementations is to queue microtasks from this method and from built-ins like Promises and async functions in the same queue, and not drain that queue until explicitly done via `drainMicrotasks` in JSI.

This also modifies Hermes and JSC to provide stubs for those methods, and the actual implementation will be done in following diffs.

Reviewed By: neildhar

Differential Revision: D54302536

fbshipit-source-id: 25f52f91d7ef1a51687c431d2c7562c373dc72a5
2024-03-04 05:03:39 -08:00
Blake FriedmanandFacebook GitHub Bot 58b45e86a6 Remove RFC-0759 ram-bundle command from cli (#43292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43292

The ram-bundle command isn't necessary now that Hermes is our default VM.  The RFC specifically calls for the CLI command to be removed [1].

[1] https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#commands-to-be-removed

Changelog:
[General][Removed] - RFC-0759 remove ram-bundle command.

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D54430289

fbshipit-source-id: 49d519c007b739f89ffe9032fec905c56ea49f4a
2024-03-04 04:47:34 -08:00
Blake FriedmanandFacebook GitHub Bot 6461dcd07b Port: @react-native-community/cli#clean → @react-native/core-cli-utils#clean (#43287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43287

Move react-native-community/cli clean into core per RFC-0759.  Provides:

- android
- metro
- npm
- bun
- watchman
- yarn
- cocoapods

These tasks are used to clear up caching artefacts in React Native projects.  This is going to be called by the `react-native-community/cli` once we publish these in an npm package.

Changelog:
[General][Added] RFC-0759 Move cli clean into core

Reviewed By: cipolleschi

Differential Revision: D53997878

fbshipit-source-id: 56907be714184abecc8e3ef677ffc83e9ee7b54d
2024-03-04 04:41:41 -08:00
Pieter De BaetsandFacebook GitHub Bot 5f45700bd0 Fix NullPointerException thrown on startup (#43293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43293

Was debugging this, and found that this exception was being thrown due to `DefaultBindingsInstaller`, which was an invalid hybrid object. The ReactInstance initializer fully supports this being null, so let's use that as default.

Changelog: [Android][Fixed] NullPointerException is no longer ignored in MessageQueueThreadHandler

Reviewed By: sammy-SC

Differential Revision: D54434417

fbshipit-source-id: 52417b390061eface0f0578e32796d3a85303e03
2024-03-04 04:26:36 -08:00
Tomek ZawadzkiandFacebook GitHub Bot adc9e5b0fa Expose rrc_textinput via prefab (#43274)
Summary:
The `rrc_textinput` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[ANDROID] [CHANGED] - Expose `rrc_textinput` via prefab.

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

Reviewed By: cipolleschi

Differential Revision: D54482657

Pulled By: cortinico

fbshipit-source-id: ca7f4127f1808f841d88925238666e837de75bd0
2024-03-04 04:23:20 -08:00
Pieter De BaetsandFacebook GitHub Bot 43c55e98d4 Allow moving SyncCallback (#43268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43268

We previously restricted all copies and moves of SyncCallback, but that led to unsafe calling paths being added instead to AsyncCallback. Instead, allowing moving of SyncCallback, and document the need for the caller to invoke it safely, so can we remove the unsafe path from AsyncCallback.

Changelog: [General][Changed] Allow moving SyncCallback for advanced use-cases

Reviewed By: christophpurrer

Differential Revision: D54381734

fbshipit-source-id: 5fd797cd4541e507aa68f1e4e76a1be5cae20fbe
2024-03-04 04:11:36 -08:00
Pieter De BaetsandFacebook GitHub Bot 24e6722cb4 Add TODOs for missing ReactActivityDelegate methods (#43294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43294

These are gated by `ReactFeatureFlags.enableBridgelessArchitecture` and are missing support. They should be evaluated for backwards compatibility

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D54422143

fbshipit-source-id: b35b60f17d68d412a354b20e02fb6bbf591c40b0
2024-03-04 03:53:42 -08:00
Alex HuntandFacebook GitHub Bot 6cacc6d5df Relocate and export updatePackageJson script util
Summary: Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D54423651

fbshipit-source-id: e6705b055bf1f1d70d86d2c6978b837bd0807081
2024-03-04 02:54:44 -08:00
Alex HuntandFacebook GitHub Bot b919ff606a Update set-version script to version private packages and workspace deps
Summary:
Addresses a gap when using the `set-version` script to update all packages on `main` (i.e. post branch cut):
- Package versions were not being set consistently. It is safe to version all workspace packages, including `"private"`.
    - Our publishing workflow is independent from this, and only considers public packages for submission to npm.
- We also need to update the root `package.json`, which includes `devDependencies` referencing workspace dependencies.

Unblocks https://github.com/facebook/react-native/pull/43132.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D54419456

fbshipit-source-id: 93eee669c5cf7c2f16b68a2bf41e9a8ace5521bf
2024-03-04 02:54:44 -08:00
Alex HuntandFacebook GitHub Bot 79d1706b50 Omit source/build file snapshots from set-version script tests
Summary:
Make the snapshot output of this test terser (since `set-version` is a superset of the fully tested `set-rn-version` script). Notably, this removes any instances of `generated` from the snapshot file, which would hide the diff in PRs.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D54420338

fbshipit-source-id: e4a94b1fda34efaedf1b309496954be35acd5f98
2024-03-04 02:54:44 -08:00
Nick GerlemanandFacebook GitHub Bot 9ce360be7e Enable Clang Tidy (#43299)
Summary:
X-link: https://github.com/facebook/litho/pull/976

X-link: https://github.com/facebook/yoga/pull/1586

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

Add the React Clang Tidy config to Yoga, run the auto fixes, and make some manual mechanical tweaks.

Notably, the automatic changes to the infra for generating a Yoga tree from JSON capture make it 70% faster.

Before:
{F1463947076}

After:
{F1463946802}

This also cleans up all the no-op shallow const parameters in headers.

{F1463943386}

Not all checks are available in all environments, but that is okay, as Clang Tidy will gracefully skip them.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D54461054

fbshipit-source-id: dbd2d9ce51afd3174d1f2c6d439fa7d08baff46f
2024-03-04 02:28:02 -08:00
Samuel SuslaandFacebook GitHub Bot f5c8bc1e8e delete timeline module (#43301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43301

changelog: [internal]

unused, let's delete it.

Reviewed By: fabriziocucci

Differential Revision: D54462220

fbshipit-source-id: 7a3f737b8359ccf438738e0473f3846be7df47f5
2024-03-04 01:38:26 -08:00
David VaccaandFacebook GitHub Bot 1d8dea54b6 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027179

fbshipit-source-id: 4840becb8374ddbf8091be1e5e593289d18c78e0
2024-03-03 17:38:19 -08:00
Arushi KesarwaniandFacebook GitHub Bot 7d47781046 Fix CI by adding explicit visibility modifier to BridgelessCatalystInstance (#43296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43296

Fix CI by adding explicit visibility modifier to the newly added `BridgelessCatalystInstance` class. In Kotlin, in explicit API mode, which is usually the default mode for Kotlin, we must explicitly specify one of the modifiers for every declaration to make it clear and explicit.

Changelog:
[Internal] internal

Reviewed By: makovkastar

Differential Revision: D54442485

fbshipit-source-id: 4409ff810a09cc4fadcd2ccf21f7fbac3015f413
2024-03-01 18:13:28 -08:00
Nick GerlemanandFacebook GitHub Bot 9c0edaec92 Clang Tidy in more places, running more checks
Summary:
Inspired by some new C++ code in `RKJSModules` where Clang Tidy  could have caught some C++ quirks and shown them in Phabricator, this enables Fabric's Clang Tidy checks in more places, and enables more checks.

1. Hoist the renderer `.clang-tidy` to `xplat/js`, and duplicate to `xplat/ReactNative`
2. Remove all the scattered `.clang-tidy` files in RN which are less aggressive
3. Sort the list of checks
4. Add the following new checks:
    1. `bugprone-incorrect-enable-if`
    1. `bugprone-infinite-loop`
    1. `bugprone-optional-value-conversion`
    1. `bugprone-redundant-branch-condition`
    1. `bugprone-shared-ptr-array-mismatch`
    1. `bugprone-signed-char-misuse`
    1. `bugprone-too-small-loop-variable`
    1. `bugprone-unique-ptr-array-mismatch`
    1. `bugprone-unsafe-functions`
    1. `bugprone-unused-raii`
    1. `cppcoreguidelines-avoid-const-or-ref-data-members`
    1. `cppcoreguidelines-avoid-non-const-global-variables`
    1. `cppcoreguidelines-init-variables`
    1. `cppcoreguidelines-interfaces-global-init`
    1. `cppcoreguidelines-missing-std-forward`
    1. `cppcoreguidelines-prefer-member-initializer`
    1. `facebook-hte-BadEnum`
    1. `facebook-hte-MissingStatic`
    1. `misc-header-include-cycle`
    1. `misc-misplaced-const`
    1. `modernize-use-constraints`
    1. `modernize-use-designated-initializers`
    1. `modernize-use-starts-ends-with`

I did not auto apply fixes, since even the existing set can sometimes (rarely) generate invalid code.

Changelog: [Internal]

Reviewed By: ksheedlo

Differential Revision: D54411398

fbshipit-source-id: 4958d880969ae07a03fa4f62ba68ee44790487ca
2024-03-01 15:21:48 -08:00
Rick HanlonandFacebook GitHub Bot 1b53051b8c Support component stacks without debug source in LogBox (#43165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43165

Fixes component stacks without source info, and duplication in the error message string.

## Before
No component stacks, and error message duplication:

 {F1459400803}

## After
Back to normal, albeit without the component source location:

 {F1459401148}

Changelog:
[General][Fixed] - Support component stacks without source info.

Reviewed By: yungsters

Differential Revision: D53981672

fbshipit-source-id: c83455673ce327ed1a4c6cfeb3247e97da9b6a2e
2024-03-01 13:48:25 -08:00
Thomas NardoneandFacebook GitHub Bot 30463fb007 Trim invalid response blob msg
Summary:
Small tweak to #43069 - trim the message to avoid ending with a newline.

Changelog:
[General][Changed] - Trim invalid blob response error message

Reviewed By: christophpurrer

Differential Revision: D54422284

fbshipit-source-id: 53a4e963f8aba36c55e16ad7539b2f2d98c781f8
2024-03-01 13:32:15 -08:00
jayshahandFacebook GitHub Bot d9b0f15c84 fix(iOS): add extended check for content typeapplication/javascript (#43262)
Summary:
When used with expo, JS code content type is `application/javascript; charset=UTF-8` instead of just `application/javascript`, We have a really large bundle and the application shows stuck at "Bundling 100%" and does not show "Downloading 1..100%".

Here we improve the check for the content type to correctly show the progress.

## Changelog:

[IOS] [FIXED] - Fixed headers content type check for iOS bundle download

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

Reviewed By: huntie

Differential Revision: D54412657

Pulled By: robhogan

fbshipit-source-id: f12e260f1bda36495eb5e6ecd0f66c86f26d4747
2024-03-01 04:59:32 -08:00
Samuel SuslaandFacebook GitHub Bot 571ef5660a introduce experimental props to ScrollView - JS part (#43265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43265

changelog: [internal]

Add experimental props to control scroll speed on iOS.

Reviewed By: rubennorte

Differential Revision: D53757138

fbshipit-source-id: e4d9787240ad421d3e4a1d50c860d7bcb26f43b5
2024-03-01 04:11:40 -08:00
Pieter De BaetsandFacebook GitHub Bot d6a44e632a getChildAtWithSubviewClippingEnabled should be @Nullable
Summary:
The RemoveDeleteTree operation assumes it can safely call getChildAt with indices that are out of bounds to find all the children. `getChildAtWithSubviewClippingEnabled` was unnecessarily stricter than `getChildAt` and would crash in such cases.

Changelog: [Android][Fixed] - Fix crash in `getChildAtWithSubviewClippingEnabled`

Reviewed By: NickGerleman

Differential Revision: D54380975

fbshipit-source-id: 17e93c685cd07b02dc20efa2fae89090d6e38457
2024-03-01 03:59:08 -08:00
Dmitry RykunandFacebook GitHub Bot 4d2262b8d2 Add scrollEventThrottle to validAttributes to ScrollView view config on Android
Summary:
The `scrollEventThrottle` prop is missing in the ViewConfig for ScrollView for the Android platform. Because of that it was ignored by native in the New Architecture.
This diff fixes that.

Changelog: [Android][Fixed] - Add support for scrollEventThrottle for ScrollView on the New Architecture.

Reviewed By: fkgozali

Differential Revision: D54303157

fbshipit-source-id: 824f32c2f9fb3958271b094bbfc770992a4335e1
2024-03-01 03:12:08 -08:00
Moti ZilbermanandFacebook GitHub Bot 4cfac8eea6 Restore Content-Length header in inspector-proxy JSON responses
Summary:
Changelog: [General][Fixed] Re-enable listing Hermes debugger targets in chrome://inspect, broken in 0.74 RC

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

Reverts D52958725 and fixes the original `Content-Length` Unicode bug using a different approach.

Reviewed By: fabriziocucci

Differential Revision: D54409847

fbshipit-source-id: ed5bb464ab67f37535947646b124814d8bbf797c
2024-03-01 02:38:48 -08:00
Arushi KesarwaniandFacebook GitHub Bot 64b0c9cba4 Add BridgelessCatalystInstance as a placeholder for backwards comptability of legacy APIs of CatalystInstance
Summary:
In order to make the legacy APIs of Catalyst Instance backwards compatible, introducing a regular class that implements CatalystInstance so as to make these APIs available for folks in Bridgeless mode as well.

Changelog:
[Internal] internal

Reviewed By: RSNara

Differential Revision: D54093013

fbshipit-source-id: f494c05e79f570883f9b5374cd177862970304c0
2024-02-29 15:46:43 -08:00
Sam ZhouandFacebook GitHub Bot 2053364e5a Update hermes-parser and related packages in fbsource to 0.20.0
Summary:
Bump hermes-parser and related packages to [0.20.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: alexmckenley

Differential Revision: D54368487

fbshipit-source-id: a5a05f1e499ff5d8bda4649433bd285f7215d3da
2024-02-29 14:19:29 -08:00
Rubén NorteandFacebook GitHub Bot 67b9628af5 Modify native module codegen to throw JS errors when passing null values for non-nullable arguments
Summary:
Changelog: [General][Breaking] Native modules using the codegen now throw an error when called with `null` for optional but not nullable arguments.

## Context

Right now, if you have a native module using the codegen with a method like this:

```
someMethod(value?: number): void;
```

And you call it like this:

```
NativeModule.someMethod(null);
```

The app doesn't throw an error, but it should because this method shouldn't accept `null` according to its type definition.

## Changes

This modifies the codegen to only check for `undefined` in those cases, otherwise trying to cast the value to the expected type and failing if it's `null`.

NOTE: this is technically a breaking change, but if people are using Flow or TypeScript in their projects they're very unlikely to hit this case, because they would've complained if you tried to pass `null` in these cases.

Reviewed By: cipolleschi

Differential Revision: D54206289

fbshipit-source-id: 58f2f2f3009d203b96189d3c66d1ae98a9e4fb36
2024-02-29 13:12:49 -08:00
Rubén NorteandFacebook GitHub Bot 21171222eb More spec-compliant execution of microtasks
Summary:
Changelog: [internal]

This modifies the method to run microtasks in `RuntimeScheduler_Modern` to align a bit better with the spec. In this case, we'll check if we're already running microtasks when we call that method, and skip if that's the case.

We're not currently calling this method recursively so this shouldn't really be a change with the current logic.

Reviewed By: javache

Differential Revision: D54302537

fbshipit-source-id: ef5e12e68e0c7f8c9258929609c050ef78e4cde5
2024-02-29 11:38:30 -08:00
Nicola CortiandFacebook GitHub Bot 4d982dcdae Undo moving of TurboModule to internal and expose utility function for TurboModule.class.isAssignableFrom (#43219)
Summary:
After discussing with mdvacca, we prefer to undo the change of `TurboModule` package to `.internal` as this is a quite aggressive breaking change for the ecosystem.

Moreover: users should not invoke `TurboModule.class.isAssignableFrom` because `TurboModule` is `.internal`. Therefore I'm exposing another API to check if a class is a TurboModule as a static field of `ReactModuleInfo`.

## Changelog:

[INTERNAL] - Do not use TurboModule.class.isAssignableFrom

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

Test Plan: Tests are attached

Reviewed By: mdvacca, cipolleschi

Differential Revision: D54280882

Pulled By: cortinico

fbshipit-source-id: 9443c8aa23cf70dd5cfe574fe573d83313134358
2024-02-29 10:23:09 -08:00
Alex HuntandFacebook GitHub Bot d889d77aed Add changelog for 0.72.11
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D54356952

fbshipit-source-id: dadfeaa1208c00055baad2b8cd704723a530742e
2024-02-29 09:29:19 -08:00
Rubén NorteandFacebook GitHub Bot 0555fdd93a Gate inspector target creation and destruction behind inspector feature flags
Summary:
Changelog: [internal]

This fixes a crashes during logout on Android and iOS caused by trying to unregister the inspector from instances that were not previously registered. This is because I removed a check in D51459050 that was necessary when the inspector was disabled via the flag (and we call the `unregisterFromInspector` method unconditionally).

This also gates the registration/unregistration on Android properly.

Reviewed By: huntie

Differential Revision: D54357554

fbshipit-source-id: 945288acdabdface324884bee1e832870ec8806f
2024-02-29 07:43:09 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5d72e1115e Extract prepack tasks in a JS script and add codegen generation
Summary:
This change moves the prepack script of react-native in a separate script, so we can make sure we execute all the preprocessing we need before packing and publishing React Native to OSS.

## Changelog:
[General][Changed] - Moved the tasks of prepack in a separate node script

Reviewed By: huntie

Differential Revision: D54308411

fbshipit-source-id: 989c2b8c6cf88a1e9d87cf34e43351b5c0e7ea73
2024-02-29 07:17:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 03ba46f7e6 Avoid generation of RNCore component if they have been generated already
Summary:
Added a check to avoid the regeneration of RNCore components in case they have been generated already.
In order to maintain backward compatibility and to make sure not to break internal use cases, I think we should still keep the possibility to generate these components at `pod install` time.

Internal users of RNTester, for example, will not run `yarn prepack` before building react-native using OSS technology.
Notice that, in this specific case, the Codegen generates the file in a path that is not `node_modules`.

## Changelog:
[General][Added] - Skip generation of RNCore if the files have been already generated

Reviewed By: dmytrorykun

Differential Revision: D54308832

fbshipit-source-id: 0b5822a367eb0b191c42bc92f8bff20d541c5b29
2024-02-29 07:17:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9a27c08fb9 Add script to generate RNCore components only
Summary:
This change extracts the function to create RNCore components in a separate reusable unit.
RNCore is now generate in the `node_modules` folder when the app runs pod install, which is a problem because there are use cases where it's not possible to modify the `node_modules` folder or the generated files might be lost.

The goal is to:
- extract this function
- execute this function before packing react-native during the release. (see D54308411)

In this way, we are going to generate the RNCore files in the react-native path that will be packaged and then released.

Users of react-native will have the generated code directly in the node_modules with no need to generate it.

## Changelog:
[General][Added] - Add function to only generate RNCore components

Reviewed By: huntie

Differential Revision: D54308713

fbshipit-source-id: 0fa9ab4ba7b66c577663f0c736742c4d5583f617
2024-02-29 07:17:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 23c541046c Extract libraryName in a seprate variable
Summary:
This change factor out in a variable the `libraryName` to avoid verbosity.

## Changelog:
[Internal] - factor out libraryName

Reviewed By: dmytrorykun

Differential Revision: D54308601

fbshipit-source-id: 1a64a6b960cc86a1cff059e3ba6a45c33bf3150e
2024-02-29 07:17:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 77cbe6d76d Extract RNCORE_CONFIG in a separate variable
Summary:
This change refactor the RNCORE_CONFIGS in a separate variable to simplify reuse.

## Changelog:
[Internal] - Refactor code

Reviewed By: dmytrorykun

Differential Revision: D54308346

fbshipit-source-id: b9d7c8e0a9b4042f2ab1adeb7aae875264d22499
2024-02-29 07:17:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6a1509f318 Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE
Summary:
In OSS we have reports like [this one](https://github.com/facebook/react-native/issues/43241) where env variables from different settings might clash together, making react native apps fail to build hermes.

For example, a team might have defined a BUILD_FROM_SOURCE env variable to build their specific project from source and that will clash with how react native apps installs Hermes.

This change disambiguate the BUILD_FROM_SOURCE flag we have internally, moving to a less likely to clash RCT_BUILD_HERMES_FROM_SOURCE.

## Changelog:
[iOS][Breaking] - Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE

Reviewed By: huntie

Differential Revision: D54356337

fbshipit-source-id: 1115e3c22cbcf1d64b7edae30da614d52423123b
2024-02-29 03:06:52 -08:00
Biki-dasandFacebook GitHub Bot 6204ea36d3 - fixes component unmounting behaviour in itemSeperatorComponent (#43223)
Summary:
Reopen in reference to https://github.com/facebook/react-native/issues/42435 , as it had a lot of commits and fixes making it messed up.
Weirdly when using a [Section List](https://reactnative.dev/docs/sectionlist) specifically when using the [SectionSeperatorComponent](https://reactnative.dev/docs/sectionlist#sectionseparatorcomponent), and adding additional Data on the renderItem List, there is a unmount occurring as the new Data is added, this only happens while using the `SectionSeparatorComponent` and limited to the same

**Here is the Current Behaviour**

https://github.com/facebook/react-native/assets/72331432/0622e789-ddbc-4038-8ccc-a421050eecbf

**Here is the Expected Behaviour After Fixes**

https://github.com/facebook/react-native/assets/72331432/2f0cc3a9-da97-43f5-8a4b-3faca74ae834

The issues is happening because the Parent View gets removed, as we add Data, the separator moves causing the unmount, the solution that i proposed here is to conditionally render to make sure that our separator renders correctly which required to add an empty view as the `itemSeparatorComponent`.

## Changelog:
[General] [Added] - Fixes SectionList Unmounting issue with separatorComponent on data addition and removal.

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

Test Plan:
i used the `rn-tester` App to test out the changes below is the code to test the same.
Update the snapshots to align with the changes.

```
import React, {useEffect, useState} from 'react';
import {
  StyleSheet,
  Text,
  View,
  SafeAreaView,
  StatusBar,
  SectionList,
  Image,
} from 'react-native';

interface Item {
  id: string;
  title: string;
  imgSrc: string;
}

interface Section {
  title: string;
  data: Item[];
}

const keyExtractor = (item: Item, index: number) => `${item.title}-${index}`;

const renderItem = ({item, index}: {item: Item; index: number}) => {
  return <ItemComponent item={item} index={index} />;
};

const additionalFruits = [
  {
    id: '7',
    title: 'Sandwich',
    imgSrc:
      'https://img.freepik.com/premium-vector/sanwich-vector-isolated-fast-food_484148-2.jpg',
  },
  {
    id: '8',
    title: 'Burger',
    imgSrc:
      'https://static.vecteezy.com/system/resources/thumbnails/033/494/666/original/animated-illustration-of-burger-cartoon-for-foods-menu-animation-free-video.jpg',
  },
  {
    id: '9',
    title: 'Juice',
    imgSrc:
      'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQHg9yLXE7Jlq4OM9ey64TW4D9qUFaeGU76rg&usqp=CAU',
  },
  {
    id: '10',
    title: 'Milkshake',
    imgSrc:
      'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROpBez3eZKvEVdxBce9XyG6j6caDFMjV_xUQ&usqp=CAU',
  },
];
const DATA: Section[] = [
  {
    title: 'Items',
    data: [
      {
        id: '1',
        title: 'Cake',
        imgSrc:
          'https://static.vecteezy.com/system/resources/previews/012/132/227/original/cute-cake-cartoon-icon-illustration-food-recreation-icon-concept-isolated-premium-flat-cartoon-style-vector.jpg',
      },
      {
        id: '2',
        title: 'Pizza',
        imgSrc:
          'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2kYjlsayzKZx4hFo6fbH7S8pde2JRo2a0hfaeoz3O7bjqdJjhI0tFiSROM8G4UbdbwXU&usqp=CAU',
      },
      {
        id: '3',
        title: 'Coke',
        imgSrc:
          'https://png.pngtree.com/png-clipart/20220116/original/pngtree-cartoon-hand-painted-coke-bottle-png-image_7106844.png',
      },
      {
        id: '4',
        title: 'Noodles',
        imgSrc:
          'https://thumbs.dreamstime.com/z/cute-cartoon-vector-bowl-noodle-isolated-white-background-115120959.jpg',
      },
      {
        id: '5',
        title: 'Pasta',
        imgSrc:
          'https://t4.ftcdn.net/jpg/02/65/00/69/360_F_265006936_2dlz2VtcqZZUbco1VnDpU2diyd8OagFS.jpg',
      },
      {
        id: '6',
        title: 'Fries',
        imgSrc:
          'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEBUQEBAVFRMTERkVFRISDw8PEBIVFRcWFhcSFRYYHSggGBolGxgVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGismICYwLS4vLS0tLS0tLTUvLS0tLS0tLS0vLS0tLS0tLy0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOMA3gMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYCBAcDAQj/xABEEAACAQIBBwgEDAUEAwAAAAAAAQIDEQQFEiExQVGRBhMiYXGBscFSkqHRBxcjMkJygrLC0uHwJDNiY6IUNFPxFUOT/8QAGwEBAAIDAQEAAAAAAAAAAAAAAAQFAQIDBgf/xAAzEQACAQICBwcDBAMBAAAAAAAAAQIDEQQhBRIxQVFhkRNxgaGx0fAUIuEVI2LBJDLxBv/aAAwDAQACEQMRAD8A7iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYZ63riYuDMHxHji62ZByMVJKEXKWxGUruyPcGjhsoQm1FtKbTtFvXbXbebxrSqwqx1oO6EouLswADoYAAAAAAAAAAAAAAAAAAAAAAAAAAAABq4nFZjStfRfXY51asKUdabsjMYuTsjaILKVFZ0otaJL2PX5m9QylCdTmrNSzc7TazV7aGYZYp9FS3Oz7H+viV2kVDEYZzhnq5+/kd6N4VEnv+IrfJzGOjiOZk+jN5vUpfRl36u9FnyvLoLrfkyl5bp2mqi0X2rZJanw8Cw4jKCq0aM9s02/rRspLjcraGK/w6tN7ll4tJ+vmTq9LWqQqLft7188iFyhP5ehb/kX3ol8Od46pfE0ktjg+/P8A0RboZUfO06Uo/wAzOtJO1nFX0o6aHxMIJwltbVjXG05OMLbk/VslgYTnZNvYrkDlDK06UHNNN3Vk0rPTpXC5c4nGU8O0p3z4ECnSlUdolhBhTldJrar8TMlHIAAAAAAAAAAAAAAAAAAAAAGKknqZqY+epX62V/A5SccbKP0ZLMt1xTafHO4kCrj4wrKm1lvd9h3p4eU4uS3K5bSOyqvmvtXgamUcqukoye2ola2y95ey/E3sqroJ7mcsTXhiMNU1N1n5p/0ZhCUJRb3kG6mZiaEt8nB/asl4kzlGs/maLNad+kreXJNQjJa41E1wb8iVxuITk57LJ91kVFPFOGGlBPa15p39LeJLnT1nF8n6/kr+Mq85zlO3zW3D7Ozx4mjhcQ83Mvoi3JdTla/gj3yY71HJ7m+9tEfPoVJLYm+Gsrm7NpcCzhFf68MyZyZk2VSp/qKzsk06cdTlm6py6ty2+O9HFRli6MYu7hUafere888jYzncPCT1pZsu2Ojws+81cHG2Ph11E+Kv7yTh2lVhHmvVEaSlJz1tyeRcco10oON9L0FUytJSnTpN2Td5Pcm7X4ZxJ4qtd6e3iVrHVr1KkvQi0u22b4tm2Lxnb1dfcti+cbnLCUdX54HRKVeDgpxknBq6kmnG3aeeJxShG+u+q20qHJnEy5iVNvoqpdcNKXVezMMp4+UalovRGLbWxtq/u4llV0xJq0I5tbeD395w+gtUcb7PQ9sPyqqqu4SipwlUzUklGSu7LNe3v4l2OZ8lMNzmMp7oXm/srR/lmnTCZoqdWdJym287K/dnn3mNIU6dOajBWyz/AKAALMrwAAAAAAAAAAAAAACOyrDQpdz8isY75OvTrbG7Pq0WvwfsLnWp50XF7UVTKNHOhKD17OqSPNaWpdnWVRbJeqy9LFjgp5WfxM1uUKbUJbm1xt7iy85n4WM99OD79F/MrVSXO4a+1Rv3x1+D4kvkPEKeCtfTC8Xxzl7GjTR801Vg98X5f9OmIi1Tjyl6kXlr+V2SXu8zCdb+Gv8A27cVYzyy/kn2rxNKd5UKdNa5yjFcf0KpvJd5KhH7V3mvkypZu/V5kdleXTnZ7Pwot2HyVQpQbm77XJtxXckVvlDToaZUs/ObtpazHo2Jq+w3dFqTndHajWjOpkn32yPTkfXdqkNmiS7XofguBJOWZjKE98lHi838RFcmYNRuk25S2LYlb3m3liXRjOL+bJNNePFIwp9nWjLg15CpG9VrjddVYlMRWteWxK/BFcqP5GT2zml220+NzYxGNvRenTJ+yTu/Mzo0LypQeqN5vut5sjXtlz9MzNOOorv5YlMDTVKkovYry7dbIPFVG4SqPXUnZdi6T/CiSytXtTzVrk7d233d5A4xylUp0IvctGxzelnenmKMbvWfy2fsWvk1hI0qfOuVpzjdu9lGOtLwbJ3JGUuelNR0wgl03tbvoXVoK7lqtm01BbX/AIx/aLHyfwfNUIprpS6cu16l3KyLvRTnKpZPJLP5zeZV4pJwdSW1vL5yRKgA9EVoAAAAAAAAAAAAAABpV8U4ysrWRCY/EwlWko/OUU5Ldf8Aa4m9jm4zd1r0p7yjyxU41nOXzs55y8YnlcfXnUcqUtz2cPi8mWuEoKX3Lh1JvDdGc4bJfKLv0SXG3E1Mk4t0as6X0al423P6Ev3vMqldPMqxejOs+yWiz7HY8MbG2Ipy9Jx4ppeFirpVZRldbc/RomqKd1LevNG3luXyX2l4M0cnV86tQp+i87xa8GbWW38mvr+TIrITvjF/TB/dt5mYZo2gv2m+8sOX61qaj6UvYv1sVHKM9Nty8SwZdqXqKO6Ptb/6K/lJdP7KN5S2I3wkbJFvVCMcKqdHQnSTutcrq7b7fMg6M86nOnuV4+NuPiS+T694Zno6uwhsQubxHU37Jft8DlVlrJrxOdFPOPiRc3nSpxerOu+taPK5Y8O7zk9yUV95+KITm7VGt0nb2krh5ZlLOe5y9y4WRxrPJW+XJFXNKx4Yipn1uqGjvX6+BrZCjzmMc9kc6X4Y+N+4xc8yjKe2Wrv0LzZIcjMP0ZTf0pW7oq/i3wJMVaPka1Ptpyfh7knQo8/jYwemMPnbrR6Vu9tIu5WcZjo0Y3zdb0JWjd67mzyfx1Ss5SkkqcdC1tuWvX1LxL/RdaMP2krt538PQpcTGU4qexLInQAXpAAAAAAAAAAAAAAAANfFYdTjZ69j3MofKLAtNztaUdE14S/fUX3FqXNzzHaWY817pWdnxOUYnL+JqPp1U9FtMKS0btESi0vRi3GS/wBvJrnzV8snw4FzomhVquTi1ZW23334J8D0w+JzU4v5slp6nskjerVtFN7qkbPcm1+hX6WItJOWmN1ddW32G5UrOClCT1PQ9zi78HYoqlFpplxVw7jJX3k9lv8Alr6/kzR5NU/4ipL0YW75ZvuZM43CZ2HnUldWpupFandRb0kfybh0ak/Skl6sV72c4pxhmQozTpSS7jHKUr133eCI3FYaVSvGnG2dJJK7stulm9jn/EPtX3UfMEv42m90G/ZMxf713HWL1YXXAka2DjQlCbq3bTjmKOluTjpvfUrI0Msq86e9u3tXvNrlBPp0n1vxiRmKxGfiacY6k03xbt7DFTOSaW5mlFN2k+ZjUjfENb5G3lSdoKK+k7dy/aNWH+5+2/BkbyoyjKNWMIStmRu9CfSenb1W4nOnTdSpGK4XJNKk6tSMVwueuWKls2mtiv5LzLXyeo5lKMfRWntbu/M5hWylVc87O6StpzVrXcK3KrGU7KFe19L6FJ+MSyWEm7JNefsd62jqkoaqcfP2Oj5UnKrXVKGlpqKX9T1+XAu2AwqpU4046orXve197OPfBtlTE18pQU6zlFRnOacIaVmta0tHSlE7WX2jMN2cXN7Xl4flnndKQlRlGi3sV8vEAAtCrAAAAAAAAAAAAAAABxTK1Hm61Wn6FWUe5SaXsO1nI+XdHMxtTdLNkvtRV/amVuk43hGXB+qL/wD8/L96cOKv0fsyDlImsi4iLq0ZySdpxhJNXWnown4d8SvuR9o4hwd12NbGtxS6qkeoxGH7Wm47zq2PrRzZQ1uUXF22XVir5Lqyo1HQnqbvF7L9Xb4o8clcoaclm1ZZstkpan2vf1m9j8Oq0M6DTlHTGUWnfquiHUvnGew84qEsO3TqK1/lzUxUvl39ZeCPbB/7qL/tvz95HUqzlNOWvOV9mnUSeDj8vnbqT9sl+pFl9slfgztNWi1yGX5dOn3+KIvJ3SxTfo39izfM2sr1b1lujH3v3EZkzKNOlKc6ktNrJLpSbbu7cNpsk5Qeqru3qb0oSdO0Vd29Tbq4qNOpKpLVFydtrelJLtZUsXXcpSqS+c22+1mxlDGurJvVG7aj27X1kbWlptuLPD0OzV3taLrC4fso3e1+XIwNHGPpdiN0jqzvJ9pNhtO09h0b4EsNfEV6uyFFQ9eSl+A7Ec5+BbC2wlWrb59ZRvvUIR08ZS4HRi5wytTR4PS09fGT5WXRe9wADuVwAAAAAAAAAAAAAAAObfCnQtVpVfSp5vqSv+M6SUz4T8PfCRqL/wBdVX+rJNeOaRcZHWoy69Cz0NU1MbDnddVZedjlzkYOQcjC5Qn0BINn2E5LSm+1Npny58NrGT1WKmndTlffzkr+J6f+Tr/81TuqVF5msfDVwi9qXQ01I8F0M6laUneUm3vlJyftMDEXNjKyVj5OVkazZlUldmBukYYbI5G7Xdos06cG5RjFXblZJa23oSOsDlLaj9A/BvguZyZQT1yi6j+221/i4loNXJ2EVKjTpLVTpxguyMVHyNovIq0Uj5vWqdpUlN7231YABscwAAAAAAAAAAAAAAAQ/KnB87g69NK7dJuK/qh04+2KJg+MxKKknF7zenN05qcdqafQ/O20+NkjyjwPMYqtRSsozeb9WWmH+LRGnmrNOzPp0ZqcVKOx2a7nmj4AfLgyBcHy4APKrPYfZzseLNkjDADZ8ubGDwxctCXWS3ILA89lLDwtdKopy3Wppz0+ql3kJiJXl2HSfgUyZ8rXxTWiMFTi9nTec+9KMfWJWHjrSSK3SVbssPUlyt1yR10AFweBAAAAAAAAAAAAAAAAAAAAAOXfCvk7Nq0sQlonHm5bs6Oni4t+oUK523lvk3n8FVileUFzkd94aWl2xzl3nEeopcbT1at+OZ7nQOI7XCKL2xy8Nq9vA+ny5g5GLqESxcnoecqh5ymY3MpGGw2LmINzUCTsrg8sTLRbeErsw3Y1us/QXwdZL/0+T6UWrSqLnpbHepa1+tQUF3HE+SuSv9VjKNG3RlVTlr0Qh0pdnRT4o/SSVtCLLBwzcjy+n69lCiu9+i/vyMgATzzIAAAAAAAAAAAAAAAAAAAAB8scA5X5NeGxdWl9HPzobsyXSjbsTt9ln6AK7yh5JYbGTjUrZ6lGGZenKKvFNtJ3TvZt8WRsTQdWKttRa6Jx8cJVbnfVas7Z93t3M4PcXOy/Flgd9b16f5D58WOB31vXp/kIP0VTl1PQfr+D/l0/JxkHZviywO+t69P8g+LLA763r0/yD6Kpy6j9ewn8un5OMg7N8WWB31vXp/kHxZYHfW9en+QfRVOXUfr2E/l0/Jxo0687vs0HcfiywO+t69P8h5fFVgPSrf8A1h+Q2jg6nI1lp7CPZrdPyQfwLZH/AJuMkv7UPZKb+4r9p1cjsiZJpYWhGhRTzIX+c86Tcm5Nt7XdkiWNKGpBI8tjcR9RXlU3PZ3LYAAdCKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/Z',
      },
    ],
  },
];

const ItemComponent = ({item, index}: {item: Item; index: number}) => {
  useEffect(() => {
    console.log('Mount of', index, item.title);
    return () => {
      console.log('Unmount of', index, item.title);
    };
  }, []);

  return (
    <View style={styles.card}>
      <Text style={styles.cardText}>{item.title}</Text>
      <Image source={{uri: item.imgSrc}} style={styles.imageStyles} />
    </View>
  );
};

const App = () => {
  const [data, setData] = useState(DATA);
  const fetchNextPage = () => {
    const newInnerData = [...data[0].data, ...additionalFruits];
    setData([{...data[0], data: newInnerData}]);
  };

  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.scrollView}>
        <SectionList
          keyExtractor={keyExtractor}
          onEndReachedThreshold={0.5}
          onEndReached={fetchNextPage}
          sections={data}
          renderItem={renderItem}
          ItemSeparatorComponent={() => <View style={{height: 16}} />}
          renderSectionHeader={({section}) => (
            <Text style={styles.sectionHeaderText}>{section.title}</Text>
          )}
        />
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#F5F5F5',
    paddingTop: StatusBar.currentHeight,
  },
  scrollView: {
    paddingHorizontal: 16,
  },
  card: {
    backgroundColor: '#FFFFFF',
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    gap: 8,
    height: 200,
    padding: 16,
    borderRadius: 8,
    marginBottom: 16,
    borderWidth: 1,
  },
  cardText: {
    fontSize: 30,
  },
  headerText: {
    fontSize: 24,
    textAlign: 'center',
    marginBottom: 12,
  },
  footerText: {
    fontSize: 24,
    textAlign: 'center',
    marginTop: 12,
  },
  sectionHeaderText: {
    backgroundColor: '#FFFFFF',
    fontSize: 24,
    fontWeight: 'bold',
  },
  imageStyles: {
    height: '100%',
    width: 100,
  },
});

export default App;
```

Reviewed By: yungsters

Differential Revision: D54301991

Pulled By: javache

fbshipit-source-id: d2cfafb1b4eb868761d849111b5abb7e9d584a46
2024-02-29 02:38:46 -08:00
David VaccaandFacebook GitHub Bot e1b0914e09 Mark UIManagerModuleConstantsHelper.normalizeEventTypes as Nullable
Summary:
Mark UIManagerModuleConstantsHelper.normalizeEventTypes as Nullable

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54327799

fbshipit-source-id: 66dd42c8ed220e76c62e3d215c59d6547c374265
2024-02-28 17:45:27 -08:00
David RickardandFacebook GitHub Bot 252ef19c8d Allow partially visible items to be picked as scroll anchors for maintainVisibleContentPosition
Summary:
The current behavior for `maintainVisibleContentPosition` on ScrollView is to pick the first fully visible item as the scroll anchor. This has a number of disadvantages:

* It causes problems for lists with loading indicators and large items. The loading glimmer can be picked as the anchor and pull the scroll down too quickly. This is the case for Marketplace.
* It's inconsistent with the [CSS Scroll Anchoring](https://www.w3.org/TR/css-scroll-anchoring-1/) behavior, which is to pick the first partially visible view.

This change will switch to picking the first partially visible view as the anchor, to align with the CSS implementation.

Discussed the change with yungsters, NickGerleman, and cipolleschi and agreed about the change in behavior.

This also enables `maintainVisibleContentPosition` for Android. After adding it to `validAttributes` for Android it appears to be working well. Previously it was not functional at all on Android, as the property change from React was not passed to ReactScrollViewManager.java.

## Changelog:
[General] [Changed] - maintainVisibleContentPosition property on ScrollView now selects the first partially visible view as the anchor, rather than the first fully visible view.

Reviewed By: NickGerleman

Differential Revision: D54223244

fbshipit-source-id: 05ddfc0bbf16d61f9599b9d8066c0bd21b086301
2024-02-28 12:26:14 -08:00
Moti ZilbermanandFacebook GitHub Bot 32c74fbc59 Explicitly init InspectorFlags::inconsistentFlagsStateLogged_ to avoid UB
Summary:
Changelog: [Internal]

TSIA (bug found by UBSAN)

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54305549

fbshipit-source-id: e9c69d7922337c77d4503c5862637040a885eb0e
2024-02-28 11:55:14 -08:00
Moti ZilbermanandFacebook GitHub Bot 659712b475 Destroy SessionState only after destroying HostAgent
Summary:
Changelog: [Internal]

Fixes a bug detected by LeakSanitizer: `HostAgent`'s destructor writes to session state, but when the containing `HostTargetSession` is being torn down, the `SessionState` object currently gets destroyed first, resulting in a dangling reference. Reordering the members of `HostTargetSession` results in the correct destruction order.

bypass-github-export-checks

Reviewed By: robhogan

Differential Revision: D54305545

fbshipit-source-id: e91a6f3de5eed327b811524548d01565e26234fa
2024-02-28 11:33:54 -08:00
Moti ZilbermanandFacebook GitHub Bot 7cfd686214 Use standard (lowercase) assert in ReactInstanceIntegrationTest
Summary:
Changelog: [Internal]

TSIA; `ASSERT` isn't universally defined so let's switch to `assert`.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54305583

fbshipit-source-id: ee80b462f1372e53301f1bb66eb589e4f7da89c6
2024-02-28 10:03:15 -08:00
David VaccaandFacebook GitHub Bot 798903a3a2 Mark ViewGroupManager.getChildAt() as Nullable
Summary:
ViewGroup.getChildAt() is nullable, we should make ViewGroupManager.getChildAt() as well.

see https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#6939

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54271529

fbshipit-source-id: 10170031ec560d3f2956474e3a82ffe41bc5dc36
2024-02-28 09:53:21 -08:00
Rubén NorteandFacebook GitHub Bot 11394e7c88 Register ReactInstance with modern CDP backend
Summary:
Changelog: [Internal]

This implements the integration of `ReactInstance` with the modern CDP backend.

This is the last missing piece to complete the integration of bridgeless with the modern CDP backend, and now we can test it end to end.

Reviewed By: huntie

Differential Revision: D51459050

fbshipit-source-id: 54e8972ee199cbcc8e5e73d7215a34f008feeaa3
2024-02-28 09:53:18 -08:00
Rubén NorteandFacebook GitHub Bot 65c394f33a Register ReactHostImpl with modern CDP backend
Summary:
Changelog: [Internal]

This implements the integration of `ReactHost` with the modern CDP backend. It handles the registration of pages in CDP when we create new instances of `ReactHost` (which is the equivalent concept in React Native).

The next PR will handle the registration of `ReactInstance` to complete the integration on bridgeless.

Reviewed By: huntie

Differential Revision: D51459049

fbshipit-source-id: 9576c8d8e38ca925035d90f2871bcd7aa534f725
2024-02-28 09:53:18 -08:00
Rubén NorteandFacebook GitHub Bot a861a66d71 Add uiThreadConditionalSync executor to AndroidExecutors
Summary:
Changelog: [internal]

This adds a new type of executor in AndroidExecutors to execute runnables on the UI thread.

If the caller is already on the UI thread it'd call the runnable immediately. Otherwise it'd be scheduled in the UI thread to execute asynchronously.

Reviewed By: huntie

Differential Revision: D53941120

fbshipit-source-id: b68c7a4540be2a12df930e4e52eeb7b7a1aa91d8
2024-02-28 09:53:18 -08:00
David VaccaandFacebook GitHub Bot eff28ae113 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027184

fbshipit-source-id: 722a7e398849f5d935894f321aa0177167eebaef
2024-02-28 08:47:35 -08:00
David VaccaandFacebook GitHub Bot 2e708c9c2c Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027180

fbshipit-source-id: bf8875c06c8990172e6b449e12902691131b9cef
2024-02-28 08:47:35 -08:00
David VaccaandFacebook GitHub Bot becb9a3df6 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027186

fbshipit-source-id: 2cee2b598c3ef15641222018703a7d6a467ba30c
2024-02-28 08:47:35 -08:00
David VaccaandFacebook GitHub Bot 779e3be106 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54027177

fbshipit-source-id: 13b4352f0b61eec69bfdcb6a3e369faa4dfcc750
2024-02-28 08:47:35 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot a1197695fc fix(iOS) [0.74]: properly warn about createRootViewWithBridge (#43146)
Summary:
This PR fixes an issue that `_logWarnIfCreateRootViewWithBridgeIsOverridden` was called in wrong place.

Assuming user overrides this method and call to `[super]`:

```objc
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
  UIView *view = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
  view.backgroundColor = [UIColor redColor];
  return view;
}
```

This method still wasn't called in bridgeless (and not showing the error).

Checking if user overrides this method in `appDidFinishWithLaunching` works every time

![simulator_screenshot_0E22557C-CE37-4617-A25A-F39A6ED4D3D0](https://github.com/facebook/react-native/assets/52801365/d7865f37-32f0-40ad-a252-74ab7c5b7757)

## Changelog:

[IOS] [FIXED] - Properly warn about `createRootViewWithBridge` being deprecated

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

Test Plan: Check if warning is shown when message is overridden

Reviewed By: huntie

Differential Revision: D54303506

Pulled By: cipolleschi

fbshipit-source-id: cf30555c791493f28b3015a189cf93b60cace8f8
2024-02-28 08:37:26 -08:00
Riccardo CipolleschiandFacebook GitHub Bot c3b0a8f162 Deprecate getSurfacePresenter and getModuleRegistry in favor of their props
Summary:
This change align the `getSurfacePresenter` and `getModuleRegistry` to the iOS convention for which these should be computed properties with no `get` prefix in their name.

We want to land this change and to pick it in 0.74 so we can remove the `get` versions in 0.75.

## Changelog:
[iOS][Deprecated] - Deprecate `getSurfacePresenter` and `getModuleRegistry` for `surfacePresenter` and moduleRegistry` props.

Reviewed By: javache

Differential Revision: D54253805

fbshipit-source-id: e9ff7db744a73a3bd0f8ae1d87875e54ddd9a1a4
2024-02-28 06:09:38 -08:00
Ryan LintonandFacebook GitHub Bot 57ed0fb309 MapBuffer long support (#43030)
Summary:
This adds support for 64 bit integer (long) values to MapBuffer. Per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738) Android encodes wide gamut colors as long values so we need to update MapBuffer to support 64 bit integers as well.

## Changelog:

[ANDROID] [ADDED] - Add 64 bit integer (long) value support to MapBuffer

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

Test Plan: I've added a test to the MapBuffer test suite. This new API is otherwise currently unused but will be used in subsequent PRs as part of wide gamut color support changes.

Reviewed By: mdvacca

Differential Revision: D53881809

Pulled By: NickGerleman

fbshipit-source-id: 39c20b93493a2609db9f66426640ef5e97d6e1a8
2024-02-27 17:33:40 -08:00
Luna WeiandFacebook GitHub Bot 8317325fb2 Changelog for 0.73.5 and 0.71.17 (#43216)
Summary:
Changelog: [Internal] - Changelog for 0.73.5 and 0.71.17

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

Reviewed By: hezi

Differential Revision: D54270560

Pulled By: lunaleaps

fbshipit-source-id: 34167f5ba44c230c86896e61bff733e2be11367f
2024-02-27 12:28:49 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 50c9a47f55 Add missing #pragma once's in ReactCommon
Summary:
## Changelog:
[Internal] -

Was writing some unit tests, accidentally included `ImageProps.h` twice (once directly and once transitively) and realized that we have a handful of files without `#pragma once`.

This fixes it for header files inside `ReactCommon`.

Reviewed By: zeyap

Differential Revision: D54258058

fbshipit-source-id: 70f4e9935304803187d1affd72ed44157b1d8fb3
2024-02-27 09:41:24 -08:00
Rubén NorteandFacebook GitHub Bot 179b684e76 Modify native module codegen to throw JS errors instead of crashing when not passing required parameters
Summary:
Changelog: [General][Fixed] Fixed crash when passing fewer arguments than expected in native modules using codegen

## Context

Right now, if you have a native module using the codegen with a method like this:

```
someMethod(value: number): void;
```

And you call it like this:

```
NativeModule.someMethod();
```

The app crashes.

This happens because the codegen tries to cast the value to the expected type without checking if the argument is within the bounds of the arguments array.

## Changes

This fixes that issue with a change in the codegen to guard against this in the generated code (see changes in the snapshot tests).

Reviewed By: RSNara

Differential Revision: D54206287

fbshipit-source-id: 575af462725515928f8634fccc7a9cb51ca0ce4f
2024-02-27 09:29:53 -08:00
Rubén NorteandFacebook GitHub Bot abbc6eb022 Modify codegen to throw JS errors instead of crashing when passing non-number arguments where RootTags are expected
Summary:
Changelog: [General][Fixed] Fixed crash when passing non-numeric values where RootTag is expected to methods in native modules using codegen

## Context

Right now, if you have a native module using the codegen with a method like this:

```
someMethod(value: RootTag): void;
```

And you call it like this:

```
NativeModule.someMethod('');
```

The app crashes.

This happens because we cast the JS value to a C++ value using the method that asserts (`toNumber`) instead of the one that throws a JS error (`asNumber`).

## Changes

This fixes the crash by using `asNumber` instead of `toNumber`.

Reviewed By: RSNara

Differential Revision: D54206288

fbshipit-source-id: 9398112667e0f26edaf4f8f3b32e79fa8aafde62
2024-02-27 09:29:53 -08:00
Luna WeiandFacebook GitHub Bot fadcf7bf83 set to public access by default
Summary: Changelog: [Internal] - Specify `access` flag in publishing nightlies

Reviewed By: cipolleschi

Differential Revision: D54230208

fbshipit-source-id: 7711eee62e8e01a12d6604831754d36a5cd5dc13
2024-02-27 09:09:50 -08:00
Alex HuntandFacebook GitHub Bot 3eaf9658a4 Add changelog for 0.74.0-rc.1
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D54261247

fbshipit-source-id: 5f34372c8ccd2132f59c8369a820a5e877b2ec08
2024-02-27 09:01:12 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 15f0895b85 Optimize RCTUIManager to avoid too many calls to viewForReactTag
Summary:
This change fixes a couple of issues within the RCTUIManager:
* it calls the right method in the `super` branches (although they should neve be executed)
* it invert the call order between the `_registry` and the `uiManager` to avoid extra calls into the `viewForReactTag`.

## Changelog:
[Internal] - Use the right method in super and invert the order of where we search for views.

## Facebook:
See S397861 and T180527210 for more information.

Reviewed By: javache

Differential Revision: D54246220

fbshipit-source-id: 1c7503ad3e80cf50ecc016a984ca180a19b73cc0
2024-02-27 05:52:51 -08:00
Dmitry RykunandFacebook GitHub Bot f5d5d9d284 Fix findLibrariesFromReactNativeConfig
Summary:
This diff removes extra argument from the `extractLibrariesFromJSON` call inside `findLibrariesFromReactNativeConfig`.
This should fix the iOS failurte discribed in https://github.com/facebook/react-native/issues/43204
Changelog: [iOS][Fixed] - Codegen correctly handles react-native.config.js.

Reviewed By: cipolleschi

Differential Revision: D54248400

fbshipit-source-id: 2ae5d0d29f49725877559a5b0edd7d59f8bdefaa
2024-02-27 05:44:08 -08:00
Ryan LintonandFacebook GitHub Bot a40bd8e34a Add basic DisplayP3 color support (#42830)
Summary:
This adds initial support for wide gamut (DisplayP3) colors to React Native iOS per the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738). It provides the ability to set the default color space to sRGB or DisplayP3 and provides the native code necessary to support `color()` function syntax per the [W3C CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#color-function) spec. It does _not_ yet support animations and requires additional JS code before fully supporting the `color()` function syntax.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Add basic DisplayP3 color support

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

Test Plan:
![Screenshot_20240131-100112](https://github.com/facebook/react-native/assets/1944151/bbd011b1-dab0-47d6-b341-74fa8fac6757)

Follow test steps from https://github.com/facebook/react-native/issues/42831 to test support for `color()` function syntax.

To globally change the default color space to DisplayP3 make the following changes to RNTester AppDelegate.mm:
```diff
+ #import <React/RCTConvert.h>

   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
   {
     // ...
+    RCTSetDefaultColorSpace(RCTColorSpaceDisplayP3);
     return [super application:application didFinishLaunchingWithOptions:launchOptions];
   }
```

Reviewed By: javache

Differential Revision: D53380407

Pulled By: cipolleschi

fbshipit-source-id: 938523958f9021e8d98bdb1d4e254047e3ecdad7
2024-02-27 05:16:34 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 3b93f0e3c1 Correctly initialize default transformOrigin prop value to "center"
Summary:
## Changelog:
[Internal] -

`view.transformOrigin` prop should be initialized to "center", since this is default [per documentaion](https://reactnative.dev/docs/next/transforms#transform-origin), and it should be treated this way even if the prop is not explicitly set from JS.

Reviewed By: christophpurrer

Differential Revision: D54229772

fbshipit-source-id: 5212792c8dc5db6f4c17d1b2980ac2564c986cd8
2024-02-27 02:09:11 -08:00
D NandFacebook GitHub Bot 2c1bcbac81 feature: Update Image.getSize/getSizeWithHeaders methods to return a promise (#42895)
Summary:
`Image.getSize/getSizeWithHeaders` are still working in old fashioned "callback" way

```tsx
Image.getSize(uri, function success(width,height) {  }, function failure(){   } ); // undefined
Image.getSizeWithHeaders(uri, headers, function success(width,height) {  }, function failure(){   } ); // undefined
```

But in 2024 more developers prefer use async/await syntax for asynchronous operations

So, in this PR I added support for Promise API with **backward compatibility**, modern way:

```tsx
Image.getSize(uri).then(({width,height}) => {    }); // Promise
Image.getSizeWithHeaders(uri, headers).then(({width,height}) => {    }); // Promise
```
bypass-github-export-checks
## Changelog:

[GENERAL] [ADDED] - `Image.getSize/getSizeWithHeaders` method returns a promise if you don't pass a `success` callback

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

Test Plan:
1. ts: New test cases added in typescript tests
2. runtime: you can create a new project and put code from this PR into the next files
  a. `node_modules/react-native/Libraries/Image/Image.android.js`
  b. `node_modules/react-native/Libraries/Image/Image.ios.js`

Reviewed By: javache

Differential Revision: D53919431

Pulled By: cipolleschi

fbshipit-source-id: 508b201e17e0ffda2e67aa5292bf9906b88d09c5
2024-02-27 01:54:30 -08:00
Thomas NardoneandFacebook GitHub Bot 489df722b3 Better error message for invalid response blob (#43069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43069

Changelog:
[General][Changed] - Add info to invalid blob response error

Reviewed By: christophpurrer

Differential Revision: D53829400

fbshipit-source-id: 17b1dbb3cacf8368098b0b639e8d10aa9bd28d03
2024-02-26 14:23:21 -08:00
Kacper RozniataandFacebook GitHub Bot cb2b265c20 fix(rn-tester): prevent alert example from crashing (#43084)
Summary:
This small PR fixes issue causing `AlertExample` to crash on `login-password` prompt example, as it was trying to render object in `<Text>`

## Changelog:

[INTERNAL] [FIXED] - Prevent alert example from crashing

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

Test Plan: `login-password` prompt example in `AlertExample` doesn't crash when pressing `OK`

Reviewed By: cipolleschi

Differential Revision: D53964494

Pulled By: lunaleaps

fbshipit-source-id: 16a0364d3d65a33956c21a68b121e6c26b41d123
2024-02-26 13:17:53 -08:00
Riccardo CipolleschiandFacebook GitHub Bot fcabb2ad21 Rename PopupMenuAndroidNativeComponent.js to PopupMenuAndroidNativeComponent.android.js to fix CI
Summary:
This change renames `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`.

The reason is that, without the suffix, Codegen was reading the NativeComponent spec also for iOS, generating some invalid specs and making RNTester fail.

## Changelog:
[Android][Changed] - Rename `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`

Reviewed By: cortinico, dmytrorykun

Differential Revision: D54199736

fbshipit-source-id: 7fd67c4d38a69fe3a84c800c8ee5dcbd8c4f9a6c
2024-02-26 11:34:05 -08:00
Sam ZhouandFacebook GitHub Bot 8003189bd9 Deploy 0.229.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D54166486

fbshipit-source-id: 204102267edb9d975b166ecd27b17650f554d24a
2024-02-26 08:05:06 -08:00
Rob HoganandFacebook GitHub Bot f0363f5cf0 Enable varying feature flags in ReactInstanceIntegrationTest, use modern CDP registry by default (#43101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43101

Extends `ReactInstanceIntegrationTest` to allow varying feature flags in tests, using gtest's parameterised tests.

Exercise this in `ConsoleLogTest` to test against the modern CDP registry, for which we also needed to modify some initialisation logic to account for the fact that under the modern registry, the page is added by the host, rather than by Hermes `DecoratedRuntime`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53919148

fbshipit-source-id: 4eb87abf548f30b5483b819a2dadd444d1d5c80d
2024-02-26 07:06:02 -08:00
Moti ZilbermanandFacebook GitHub Bot 451fffbb59 Use host-relative WebSocket URLs when launching new debugger
Summary:
Changelog: [Internal]

Uses the capability introduced in https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/4 to avoid repeating the dev server's host:port in the `ws` / `wss` parameter we pass to the Chrome DevTools frontend. This gives us more flexibility to handle port forwarding and redirects outside of `dev-middleware`. This is mostly useful in Meta's internal VS Code remoting setup, but this particular change should work equally well in open source.

Reviewed By: huntie

Differential Revision: D54107316

fbshipit-source-id: 68d4dbf4849ca431274bfb0dc8a4e05981bdd5b5
2024-02-26 05:33:18 -08:00
Moti ZilbermanandFacebook GitHub Bot 0f3018d6af Update debugger-frontend from 12a45e0...9ceb0ad
Summary:
Changelog: [Internal]

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

Reviewed By: huntie

Differential Revision: D54107317

fbshipit-source-id: 59e670d107e4c0f30900b11df2ad423004e05997
2024-02-26 05:33:18 -08:00
David VaccaandFacebook GitHub Bot 12f2c3cd2b Fix Build of RNLog in CI
Summary:
Fix Build of RNLog in CI

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D54167011

fbshipit-source-id: 7e1ea21860b479e9fe00df5951fe266f2e342eda
2024-02-25 03:40:11 -08:00
David VaccaandFacebook GitHub Bot 1947fef35c Fix InteropModuleRegistryTest
Summary:
Fix CI build for InteropModuleRegistryTest

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D54166759

fbshipit-source-id: 277c0a34dd4689eff8ef99afaf147efdfd36caa4
2024-02-25 03:40:11 -08:00
Cedric van PuttenandFacebook GitHub Bot a6397afb7f feat(cli): warn underlying command when using npx react-native init (#43127)
Summary:
This adds a new warning for React Native 0.74, implementing the [RFC 0759](https://github.com/react-native-community/discussions-and-proposals/blob/nc/rnf/proposals/0759-react-native-frameworks.md#the-init-command) init command changes.

- It's added inside `react-native/cli.js` to avoid warning users when actually executing `npx react-native-community/cli` commands.
- The check is fairly simple: `process.argv[2] === 'init'`. The first two args are the Node bin and the actual script bin paths.
- The message is sent over `console.warn` to avoid potentially mixing JSON with non-JSON output.

## Changelog:

[GENERAL] [ADDED] - Warn with future command when using `npx react-native init`

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

Test Plan:
Any command other than `init` must not warn.

- `$ node ./path/to/react-native/cli.js init`
- `$ node ./path/to/react-native/cli.js init --help`
  - Should warn with `Running: npx react-native-community/cli init`
    ![image](https://github.com/facebook/react-native/assets/1203991/a3f5e3d2-7b59-41fe-9a53-bc9ce5a21fd1)
- `$ node ./path/to/react-native/cli.js --help`
  - Must not warn
    ![image](https://github.com/facebook/react-native/assets/1203991/97679429-db35-47f8-bdeb-33187bb167cf)

Reviewed By: cipolleschi

Differential Revision: D54063131

Pulled By: cortinico

fbshipit-source-id: c60b8b6034087b584e98b51f5bedf68a46caf44c
2024-02-24 02:16:55 -08:00
Nicola CortiandFacebook GitHub Bot 48a723366a Convert RNLog to Kotlin
Summary:
Convert RNLog to Kotlin

Changelog:
[Internal] [Changed] - Convert RNLog to Kotlin

Reviewed By: mdvacca

Differential Revision: D54010172

fbshipit-source-id: eff124f094248563a2b80575d5ca9e8dae2563f7
2024-02-24 01:50:24 -08:00
Ramanpreet NaraandFacebook GitHub Bot 8bced4b29d Pull PopupMenuAndroid out of React Native core
Summary:
**History:** This component was originally introduced into React Native core in D52712758, to replace UIManagerModule.showPopupMenu().

**Problem:** But, React Native core should be lean. Adding this component to React Native bloats the core.

**Changes:** So, this diff pulls PopupMenuAndroid out into its own package in the react-native GitHub repository.

In the future, this will be migrated to a community package!

Changelog: [Android][Removed] Move PopupMenu out of React Native core

Reviewed By: NickGerleman

Differential Revision: D53328110

fbshipit-source-id: 469d8dc3e756c06040c72e08fa004aafa1bd6e18
2024-02-23 16:43:18 -08:00
David VaccaandFacebook GitHub Bot e6e5822d07 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54027183

fbshipit-source-id: b87e3931642abaa22b84fd48f0504f36e9c3621f
2024-02-23 15:27:17 -08:00
David VaccaandFacebook GitHub Bot 51088c9b90 Mark classes of package uimanager as @Nullsafe (#43162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43162

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027181

fbshipit-source-id: af9f022d36a2e60788d6790525736d1b6cfdf6fa
2024-02-23 15:27:17 -08:00
David VaccaandFacebook GitHub Bot e69faff265 Mark classes of package uimanager as @Nullsafe (#43161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43161

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027187

fbshipit-source-id: a25024ba7f7d4893a2b7d083e2ba10c5f2e3a035
2024-02-23 15:27:17 -08:00
David VaccaandFacebook GitHub Bot 9f58b1a0fc Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027182

fbshipit-source-id: 946dbf484119890658c68767916fcbf7c66996bc
2024-02-23 15:27:17 -08:00
David VaccaandFacebook GitHub Bot a15e8f318d Mark interop classes and interfaces as Unstable
Summary:
Mark interop classes and interfaces as Unstable

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: fkgozali, arushikesarwani94

Differential Revision: D54128912

fbshipit-source-id: 56956fc38bac01f461bf686fda0f05a7a105008e
2024-02-23 15:22:45 -08:00
David VaccaandFacebook GitHub Bot 0274ad076d Mark UIManagerListener interface as UnstableReactNativeAPI
Summary:
UIManagerListener interface is unstable and not recommended to be consumed externally, this API is likely to change in the future

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D54028407

fbshipit-source-id: c8601451f117226f9e5a4d291307f4a0ac04a10f
2024-02-23 15:22:45 -08:00
Nicola CortiandFacebook GitHub Bot c7bacf610d Remove accidental files included inside the template.
Summary:
Those files should not stay in the root `/app` folder but inside the `/app/gradle/wrapper` folder.
I've noticed this in the Upgrade Helper UI hence I'm removing them.

Changelog:
[Internal] [Changed] - Remove accidental files included inside the template

Reviewed By: mdvacca

Differential Revision: D54122995

fbshipit-source-id: 8873a91ffbea20f609c7aabd428a815c77a38db5
2024-02-23 11:46:14 -08:00
Nicola CortiandFacebook GitHub Bot 44e5bc9e2c Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode
Summary:
RN-Tester is currently instacrashing on fast-refresh (pressing r on Metro) as it ends up on `onJSBundleLoadedFromServer`
which throws an exception on Bridgeless mode. I'm fixing it by following the same logic as `onReloadWithJSDebugger`.

Changelog:
[Android] [Fixed] - Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode

Reviewed By: huntie

Differential Revision: D54121838

fbshipit-source-id: 82d98ec0c5b2295f5751525368c956574dd7f3a0
2024-02-23 10:44:53 -08:00
Nicola CortiandFacebook GitHub Bot 2647dc8c39 Bump CLI to 13.6.1 (#43153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43153

This contains an hotfix for the CLI needed for 0.74

Changelog:
[Internal] [Changed] - Bump CLI to 13.6.1

Reviewed By: huntie

Differential Revision: D54073715

fbshipit-source-id: a5fdf02f47c5e144efc58e6b7fd355669a21e07b
2024-02-23 06:14:29 -08:00
Alex HuntandFacebook GitHub Bot 30b088d245 Adjust output package.json formatting in scripts (#43133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43133

I noticed inconsistent handling of terminating newlines in D54006327@V1, and had also been noticing `yarn build` reformatting unrelated sections of `package.json` files.

For now, this logic isn't moved to a shared util, since there will likely be a higher level abstraction for the release scripts in the next batch of improvements.

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54007565

fbshipit-source-id: 74d58362a85be4fae2f9e058b6c6622a026ff0a0
2024-02-23 02:44:10 -08:00
David VaccaandFacebook GitHub Bot 52a70d7832 Mark IViewGroupManager interface as @Nullsafe (#43157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43157

IViewGroupManager is NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54034058

fbshipit-source-id: ad317c73d45fdd801aeee65d5308400e2e1c8552
2024-02-23 02:42:20 -08:00
David VaccaandFacebook GitHub Bot c77c13ab7c Mark classes of package uimanager as @Nullsafe (#43156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43156

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027185

fbshipit-source-id: f3c337def2d42cf1f6fed2e2eb4938a84a51f8d4
2024-02-23 02:42:20 -08:00
David VaccaandFacebook GitHub Bot ed3eacb8b9 Mark classes of package uimanager as @Nullsafe (#43155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43155

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54027178

fbshipit-source-id: 37940ecec4d42f9f5ae7784a865564b0ef80f4a7
2024-02-23 02:42:20 -08:00
David VaccaandFacebook GitHub Bot 93b4ec3472 Validate textAttributeProps is created with a non-null textAttributes map (#42932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42932

Validate textAttributeProps is created with a non-null textAttributes map

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D53558784

fbshipit-source-id: 2f7521a7f0a1cfdf67c0ab8ea0048e7f5da365b8
2024-02-23 02:42:20 -08:00
Rubén NorteandFacebook GitHub Bot 0eac4181cc Enable the native module for feature flags by default for iOS apps in OSS (#43159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43159

Changelog: [internal]

This modifies the default `RCTAppDelegate` for iOS apps in OSS to provide an implementation for the C++ native module for feature flags.

In a following diff I'll replace the `React-featureflagsnativemodule.podspec` file with one that includes all built-in C++ native modules.

Reviewed By: RSNara

Differential Revision: D54082349

fbshipit-source-id: 8c4ed7499c6fd35916ba105edcae0e2c85961e1c
2024-02-23 01:14:03 -08:00
Zeya PengandFacebook GitHub Bot 073ca1aa03 extract constants type in BlobModule + add stub impl (#43160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43160

## Changelog:

[Internal] - extract constants type in BlobModule

Reviewed By: christophpurrer, rshest

Differential Revision: D54073162

fbshipit-source-id: ba783fd4592feb7ecd65c65ad646e681b2f26a17
2024-02-22 18:10:40 -08:00
Pieter De BaetsandFacebook GitHub Bot 2584bcb6c8 Stop catching IllegalArgumentException in ReactPackageTurboModuleManagerDelegate (#43152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43152

Now that 0.74 has been cut, we can drop this warning and let the exception bubble up.

In https://github.com/facebook/react-native/pull/41509 we stopped masking this.

Changelog: [Android][Changed] Throwing IllegalArgumentException from ReactPackage is no longer suppressed

Reviewed By: cortinico, cipolleschi

Differential Revision: D54068429

fbshipit-source-id: c2f780ccfefabf2334c94b632bca93242af86008
2024-02-22 15:51:17 -08:00
Alex HuntandFacebook GitHub Bot 2dc39c26ed Add fbjni wrapper for java.util.concurrent.Executor (#43154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43154

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54072449

fbshipit-source-id: 02a6fe6a95fd8e4b3bacab7a21f8480509d6c90c
2024-02-22 11:39:18 -08:00
Dmitry RykunandFacebook GitHub Bot 6549216b76 Rename React-Codegen to ReactCodegen
Summary:
This diff renames React-Codegen to ReactCodegen. This way we'll no longer have to try both
```
#include <React-Codegen/MyModule.h>
```
and additionally
```
#include <React_Codegen/MyModule.h>
```
for cases with `use_frameworks`.

Changelog: [iOS][Breaking] - Rename React-Codegen to ReactCodegen

Reviewed By: cipolleschi

Differential Revision: D54068492

fbshipit-source-id: dab8ea2034d299266482929061caa14397421445
2024-02-22 09:52:48 -08:00
Diego SeguraandFacebook GitHub Bot e33767a36d fix flatlist props being undefined in ios (#43141)
Summary:
When using Flatlist on iOS and Android its failing because props are undefined

The problem is described on https://github.com/facebook/react-native/issues/34783

![Captura de pantalla 2024-02-22 a las 4 13 11](https://github.com/facebook/react-native/assets/1161455/325738d9-2e49-44a0-bb6a-077b2e02e9cd)

![Captura de pantalla 2024-02-22 a las 4 14 58](https://github.com/facebook/react-native/assets/1161455/118f76e1-a818-428e-938e-123b55536b49)

Fixed by setting constructor before any statement and removing unnecessary props declaration at the top of the class.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Fix undefined props crash in FlatList

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

Reviewed By: javache

Differential Revision: D54069559

Pulled By: robhogan

fbshipit-source-id: b39cd9a273eb0279ed353f9efcb66a3c4ccf93b4
2024-02-22 09:03:03 -08:00
Alex Taylor (alta)andFacebook GitHub Bot b857a6eb54 Update hermes-parser and related packages in fbsource to 0.19.2 (#43140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43140

Bump hermes-parser and related packages to [0.19.2](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D54044847

fbshipit-source-id: ce6830c6cdae8f9cb7225a86c0a1ff23a6929796
2024-02-22 08:56:32 -08:00
Rubén NorteandFacebook GitHub Bot 71ee246183 Include native module for ReactNativeFeatureFlags by default in all apps using TurboModules (#42431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42431

Changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D52905704

fbshipit-source-id: df1a0ec71ba468d8352f2af92bf87b5175c0d72c
2024-02-22 08:39:12 -08:00
Rubén NorteandFacebook GitHub Bot d979452d24 Log an error when trying to access native feature flags from JS if the native module is not available (#43149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43149

Changelog: [internal]

At the moment we're silently falling back to default values when trying to use common feature flags from JS when the native module isn't available. This could lead to unexpected behaviors and it's not immediately obvious, so this logs an error when it happens.

Reviewed By: javache

Differential Revision: D54063391

fbshipit-source-id: 5886754958930b88ef63c24d77a9e8486d92c731
2024-02-22 08:35:25 -08:00
Kesha AntonovandFacebook GitHub Bot 767330f218 Update Yoga.podspec: fixes archiving for Mac Catalyst (#42847)
Summary:
Hi

When I tried to archive macos catalyst app in Xcode I got errors:

<img width="977" alt="Screenshot 2024-02-05 at 00 03 32" src="https://github.com/kesha-antonov/react-native/assets/11584712/b83f75a5-b42f-42e4-9afa-1e2527501baa">

This PR fixes archiving by linking PrivateHeaders in yoga.framework

<img width="399" alt="Screenshot 2024-02-05 at 01 03 48" src="https://github.com/kesha-antonov/react-native/assets/11584712/089080ad-b1dc-4703-9273-d8aa3253205e">

<img width="1404" alt="Screenshot 2024-02-05 at 01 05 18" src="https://github.com/kesha-antonov/react-native/assets/11584712/5263cb80-8a53-4a51-bcfc-9d3a2ba739b4">

Prev PR here https://github.com/facebook/react-native/pull/42159

## Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

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

Test Plan: Try archive react-native tester app for macos catalyst in Xcode

Reviewed By: NickGerleman

Differential Revision: D53920474

Pulled By: cipolleschi

fbshipit-source-id: 0534d9aa9d249e4e0c35ada0464c38c291be7f84
2024-02-22 06:00:12 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b9f3186ee6 Make the New Architecture the default (#43135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43135

This change makes the New Architecture the default on both iOS and Android.
This means that new application will be created using the New Architecture by default.

It is still possible to opt out from it.

## Changelog
[General][Changed] - Make the new architecture the default

Reviewed By: cortinico, sammy-SC, dmytrorykun

Differential Revision: D54006751

fbshipit-source-id: bd7de0814925b65ab180105e18c1f6f275ba2672
2024-02-22 05:10:57 -08:00
Rob HoganandFacebook GitHub Bot 8cbf46a5f4 Move integration tests to OSS (#43094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43094

Merge the internal `cxxcdp-tester` project into `jsinspector-modern/tests`.

Note: These tests still use RN default feature flags and therefore test against the legacy CDP registry - that's addressed in the next diff.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53766994

fbshipit-source-id: eec144124b20a4500e28398e98763febaed52748
2024-02-22 04:21:35 -08:00
Nikita LutsenkoandFacebook GitHub Bot 765e542c8d react-native | Allow invoking a sync callback under AsyncCallback via 'unsafeCallSync'. (#43143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43143

AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850

fbshipit-source-id: f6729819f791f1d58d2ca655d4082547f18bdd2d
2024-02-22 00:58:29 -08:00
Tommy NguyenandFacebook GitHub Bot a1171f79f8 fix(android): fix ndkVersion is unset when building from source (#43131)
Summary:
`ndkVersion` is unset when building from source using this guide: https://reactnative.dev/contributing/how-to-build-from-source

## Changelog:

[ANDROID] [FIXED] - Fix `ndkVersion` is unset when building from source

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

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
yarn

# Manually apply the patch in node_modules/react-native/ReactAndroid/build.gradle.kts
# Enable building from source
sed -i '' 's/#react.buildFromSource/react.buildFromSource/' example/android/gradle.properties

# Build
cd example/android
./gradlew assembleDebug
```

Reviewed By: christophpurrer

Differential Revision: D54006425

Pulled By: cortinico

fbshipit-source-id: 9ede64bc14af4cf609b7a4c12c5a1082bbc31f09
2024-02-21 10:09:53 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot f3e132bb0b Correctly pass Image.source attribute to the C++ side (#43129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43129

## Changelog:
[Internal] -

C++ side expects "source" property to be an up to date, correctly resolved Image source inside `ImageProps`.

Incidentally, it wasn't the case when:
* we build for an Android platform
* the asset is a "packager asset", i.e. bundled by Metro and included in APK

It hasn't been an issue in the case of "pure" Android platform, as it instead uses "src" prop, instead of source on the Java implementation side, ignoring "source" completely, so the fact that "source" wasn't propagated correctly to C++ in some cases didn't affect Android.

However, there are some new use cases where we'd like to have correct "source" value in C++ as well (and ultimately align this between all the platforms, so it's "source" everywhere, but this is a matter of a separate discussion).

Differential Revision: D54000899

fbshipit-source-id: 9bfb9e7c157cf19ddf396c141b03b75f3b2022e8
2024-02-21 08:26:57 -08:00
Alex HuntandFacebook GitHub Bot ee2bc59dfe Add changelog for 0.74.0-rc0
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D53949080

fbshipit-source-id: 8740e4aa4e446c27659440487141d1335df80608
2024-02-21 07:52:20 -08:00
Alex HuntandFacebook GitHub Bot 8c51cbec94 Fix release testing script (#43130)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43130

Various fixes/tweaks to the `test-e2e-local` script, impacted by recent changes, found during the release process:

- Fix typo in variable name for `circleciToken` arg.
- Relocate erroneously positioned `process.exit` call (a force exit around Verdaccio, which we will remove in future).
- Add notice on exit around Verdaccio server not being killed successfully (to do in T179377112).
- Switch from Yarn to npm for test project installation — Yarn 3 is not respecting `npmRegistryServer`, see https://github.com/yarnpkg/yarn/issues/2508.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53951606

fbshipit-source-id: f6e29ef6c9ab33ebf60124757576fcb54219f339
2024-02-21 07:51:10 -08:00
Ingrid WangandFacebook GitHub Bot 7fffe692e7 Delete deprecated didReceiveLocal/RemoteNotification (#43117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43117

Changelog:
[iOS][Breaking] Deleting deprecated didReceiveLocalNotification & didReceiveRemoteNotification callbacks on RCTPushNotificationManager

Reviewed By: philIip

Differential Revision: D52883365

fbshipit-source-id: b7136ecaf73263b8f8b633c8861a673868ac252e
2024-02-20 22:23:54 -08:00
Ingrid WangandFacebook GitHub Bot 410e3b5ebd Remove deprecated alertAction and repeatInterval properties (#43116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43116

Changelog:
[iOS][Breaking] Deleting deprecated alertAction and repeatInterval in PushNotificationIOS

Reviewed By: philIip

Differential Revision: D53734569

fbshipit-source-id: 20b2cd304443f27987f336e768eb44e6c5d7c2b9
2024-02-20 21:33:27 -08:00
Dustin ShahidehpourandFacebook GitHub Bot 46f53e97f0 Fix missing imports in React Native files. (#43118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43118

While debugging issues with precompiled_headers in Instagram, it became apparent that these RN files don't correctly import the necessary files to make them build on their own. Fix that!

Changelog: [iOS][Fixed] Fixed missing header imports

Reviewed By: fkgozali

Differential Revision: D53963676

fbshipit-source-id: 74e9758153f6176133475e45d27f7644d1a6dece
2024-02-20 15:33:28 -08:00
Sam ZhouandFacebook GitHub Bot bdab8700ef Deploy 0.229.0 to xplat (#43115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43115

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D53955506

fbshipit-source-id: bfccb5674ece70dbe6b6d6d9a4982592bdff645a
2024-02-20 15:06:24 -08:00
Pieter De BaetsandFacebook GitHub Bot b164302bf6 Cleanup ios_hermes:rn_heap_size_mb (#43023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43023

Unused mobile config, and is not consistently used across all the many places we can initialize a Hermes instance.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53761942

fbshipit-source-id: a3e1adae87e41142c337a27b33750f82774cf92c
2024-02-20 14:44:59 -08:00
Phillip PanandFacebook GitHub Bot 916dde4c60 delete access to UIApplicationLaunchOptionsLocalNotificationKey (#43114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43114

Changelog: [iOS][Breaking]

PR#42628 introduced new behavior on how the react native infra tracks local notifications that start the app. in this PR, we are officially deleting the old implementation.

Reviewed By: ingridwang

Differential Revision: D52931617

fbshipit-source-id: 3b77479b0aacf239e45cfcc7d7c4b20e82e0b786
2024-02-20 13:11:17 -08:00
Moti ZilbermanandFacebook GitHub Bot e9351f0f8a PageTarget → HostTarget (#43113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43113

Changelog: [Internal]

Renames the "Page" concept in the modern CDP backend to "Host". Now all the Target types we have are named consistently after React Native concepts (ReactHost, ReactInstance, JSI Runtime) rather than CDP/browser concepts (Page).

Reviewed By: robhogan

Differential Revision: D53945333

fbshipit-source-id: 90e8b914ba8b4927806cbdd072ca36c78fd2093f
2024-02-20 10:39:44 -08:00
Alex HuntandFacebook GitHub Bot d6bf51cad9 Refactor remaining forEachPackage call sites (#43112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43112

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53942028

fbshipit-source-id: 335bff3c3a31026bae7140fac1d1a6aae23a0f1e
2024-02-20 09:55:46 -08:00
Nicola CortiandFacebook GitHub Bot 4ecf57ead2 Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI (#43049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43049

This connects the OnLoad.cpp file used by OSS apps with the `rncli_cxxModuleProvider`.
This method is created by the CLI and takes care of querying all the TM CXX Modules discovered and returning them.

This PR is currently waiting on https://github.com/react-native-community/cli/pull/2296

Changelog:
[Internal] [Changed] - Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI

Reviewed By: cipolleschi

Differential Revision: D53812109

fbshipit-source-id: 47bc0ea699516993070cfa0127de97853acf8890
2024-02-20 08:30:38 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 488dd78d7c Unmount view from the reactsubviews in the Interop Layer (#43111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43111

When mounting views in the interop layer, we register them in an array `reactSubview` that is added to `UIView`. However, when unmounting them, we were just removing them from the parent view.

This worked fine while the view we were adding to reactSubview was the same that we were adding to hierarchy. However, there are instances where libraries might wrap those views in some custom wrappers. This break the assumption that the same view we are adding to the UI hierarchy is the same view we will remove.

With this change, we make sure to use the same semantic when we add some view and when we remove it.

This also fixes a crash that happens with Mobile home when navigating away from the Ride's Map, using Fabric.

## Changelog
[internal] - Remove views from hierarchy using the view that is added to the `reactSubviews`

Reviewed By: sammy-SC

Differential Revision: D53943728

fbshipit-source-id: 56e669c14db74b6af683384b6ca72ad3f5cfdafe
2024-02-20 08:09:09 -08:00
Rubén NorteandFacebook GitHub Bot 1fc2a5a4c9 Prevent reporting mount when FabricUIManager has been destroyed (#43099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43099

In all methods of FabricUIManager we check whether it's been destroyed before doing any logic, but we don't in this asynchronous method we're scheduling to report mounts.

This adds the check in that case as well to potentially fix some crashes we're seeing in current experiments for mount hooks on Android.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D53920863

fbshipit-source-id: 3cc18cf5237d4866940739de80cc00604bcd0fb6
2024-02-20 07:37:29 -08:00
2656 changed files with 141838 additions and 118155 deletions
-1
View File
@@ -63,7 +63,6 @@ These workflows are:
* `testAll.yml` => runs all the possible tests. This workflow is executed on main and on PRs which change set touches both iOS and Android
* `testAndroid.yml` => runs all the build steps and Android tests. This is used on changes that happens on the Android codebase and infra (`ReactAndroid` folder)
* `testIOS.yml` => runs all the build steps and iOS tests. This is used on changes that happens on the iOS codebase and infra (`React` folder)
* `testE2E.yml` => runs the E2E tests. As of today, E2E tests can be triggered if the commit message contains the `#run-e2e-tests` tag.
* `testJS.yml` => For all the changes that do not touch native/platform code, we only run JS tests.
Notice that if there are changes on files that do not represents code (for example `.md` files like this one or the `Changelog`) we don't run any CI.
+11 -3
View File
@@ -12,15 +12,23 @@ parameters:
default: false
type: boolean
release_latest:
run_nightly_workflow:
default: false
type: boolean
release_version:
default: "9999"
default: ""
type: string
run_nightly_workflow:
release_monorepo_packages_version:
default: ""
type: string
release_tag:
default: ""
type: string
release_dry_run:
default: false
type: boolean
+6 -18
View File
@@ -31,7 +31,7 @@ commands:
- restore_cache:
key: *rbenv_cache_key
- run:
name: Bundle Install
name: Install the proper Ruby and run Bundle install
command: |
# Check if rbenv is installed. CircleCI is migrating to rbenv so we may not need to always install it.
@@ -58,8 +58,12 @@ commands:
# Set ruby dependencies
rbenv global << parameters.ruby_version >>
if [[ << parameters.ruby_version >> == "2.6.10" ]]; then
# RubyGems 3.0.3.1 breaks Bundler
gem update --system 3.2.3
rbenv rehash
gem install bundler -v 2.4.22
else
rbenv rehash
gem install bundler
fi
bundle check || bundle install --path vendor/bundle --clean
@@ -153,22 +157,6 @@ commands:
- packages/react-native/ReactAndroid/build/third-party-ndk
key: *gradle_cache_key
run_e2e:
parameters:
platform:
description: Target platform
type: enum
enum: ["android", "ios", "js"]
default: "js"
retries:
description: How many times the job should try to run these tests
type: integer
default: 3
steps:
- run:
name: "Run Tests: << parameters.platform >> End-to-End Tests"
command: node ./scripts/e2e/run-ci-e2e-tests.js --<< parameters.platform >> --retries << parameters.retries >>
report_bundle_size:
parameters:
platform:
@@ -559,7 +547,7 @@ commands:
steps:
- run:
name: "Run Tests: iOS Unit and Integration Tests"
command: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios
command: yarn test-ios
- run:
name: Zip Derived data folder
when: always
+2 -9
View File
@@ -33,13 +33,6 @@ executors:
<<: *defaults
macos:
xcode: *xcode_version
resource_class: macos.x86.medium.gen2
resource_class: macos.m1.medium.gen1
environment:
- BUILD_FROM_SOURCE: true
reactnativeios-lts:
<<: *defaults
macos:
xcode: '14.3.1'
resource_class: macos.x86.medium.gen2
environment:
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
+107 -212
View File
@@ -96,8 +96,6 @@ jobs:
- run:
name: "Run Tests: JavaScript Tests"
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
- run_e2e:
platform: js
# Optionally, run disabled tests
- when:
@@ -109,140 +107,6 @@ jobs:
- store_test_results:
path: ./reports/junit
# -------------------------
# JOBS: iOS E2E Tests
# -------------------------
test_e2e_ios:
executor: reactnativeios
parameters:
ruby_version:
default: "2.7.7"
description: The version of ruby that must be used
type: string
steps:
- checkout_code_with_cache
- run_yarn
- setup_hermes_version
- run:
name: Install appium
command: npm install appium@2.0.0 -g
- run:
name: Install appium drivers
command: |
appium driver install uiautomator2
appium driver install xcuitest
- run:
name: Start Appium server
command: appium --base-path /wd/hub
background: true
- run:
name: Start Metro
command: |
cd packages/rn-tester
yarn start
background: true
- brew_install:
package: cmake
- setup_ruby:
ruby_version: << parameters.ruby_version >>
- run:
name: Boot iOS Simulator
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
- with_xcodebuild_cache:
steps:
- run:
name: Install Bundler
command: |
cd packages/rn-tester
bundle check || bundle install
bundle exec pod setup
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose
- run:
name: Build app
command: |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-configuration Debug \
-scheme RNTester \
-sdk iphonesimulator \
-derivedDataPath /tmp/e2e/
- run:
name: Move app to correct directory
command: mv /tmp/e2e/Build/Products/Debug-iphonesimulator/RNTester.app packages/rn-tester-e2e/apps/rn-tester.app
- run:
name: Check Appium server status
command: scripts/circleci/check_appium_server_status.sh
- run:
name: Run E2E tests
no_output_timeout: 30m
command: |
cd packages/rn-tester-e2e
(yarn test-e2e ios 2>&1 | tee /tmp/test_log) || true
- store_artifacts:
path: /tmp/test_log
# -------------------------
# JOBS: Android E2E Tests
# -------------------------
test_e2e_android:
executor:
name: android/android-machine
tag: 2023.07.1
steps:
- checkout_code_with_cache
- run_yarn
- android/create-avd:
avd-name: e2e_emulator
system-image: system-images;android-34;google_apis;x86_64
install: true
- android/start-emulator:
avd-name: e2e_emulator
no-window: true
restore-gradle-cache-prefix: v1a
post-emulator-launch-assemble-command: ""
- run:
name: Install appium
command: npm install appium@2.0.0 -g
- run:
name: Install appium drivers
command: |
appium driver install uiautomator2@2.29.1
appium driver install xcuitest@4.32.10
- run:
name: Start Appium server
command: appium --base-path /wd/hub
background: true
- run:
name: Start Metro
command: |
cd packages/rn-tester
yarn start
background: true
- with_gradle_cache:
steps:
- run:
name: Build app
command: |
./gradlew :packages:rn-tester:android:app:assembleHermesDebug -PreactNativeArchitectures=x86_64
- run:
name: Move app to correct directory
command: mv packages/rn-tester/android/app/build/outputs/apk/hermes/debug/app-hermes-x86_64-debug.apk packages/rn-tester-e2e/apps/rn-tester.apk
- run:
name: Check Appium server status
command: |
if ! nc -z 127.0.0.1 4723; then
echo Could not find Appium server
exit 1
fi
- run:
name: Run E2E tests
no_output_timeout: 30m
command: |
cd packages/rn-tester-e2e
(yarn test-e2e android 2>&1 | tee /tmp/test_log) || true
- store_artifacts:
path: /tmp/test_log
# -------------------------
# JOBS: Build Android
# -------------------------
@@ -327,9 +191,9 @@ jobs:
destination: rntester-apk
# -------------------------
# JOBS: Test Android Template
# JOBS: Test Android HelloWorld
# -------------------------
test_android_template:
test_android_helloworld:
executor: reactnativeandroid-large
parameters:
flavor:
@@ -348,45 +212,45 @@ jobs:
type: enum
enum: ["Hermes", "JSC"]
environment:
- LC_ALL: C.UTF8
- PROJECT_NAME: "AndroidTemplateProject"
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
- TARGET_ARCHITECTURE: "arm64-v8a"
steps:
- checkout_code_with_cache
- run_yarn
- attach_workspace:
at: .
- run:
name: Create Android template project
name: Build codegen js scripts from flow -> JS
command: |
REPO_ROOT=$(pwd)
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}"
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
cd packages/react-native-codegen
yarn run build
- with_gradle_cache:
steps:
- run:
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
name: Build the Helloworld application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
command: |
cd /tmp/$PROJECT_NAME/android/
if [[ << parameters.architecture >> == "NewArch" ]]; then
export ORG_GRADLE_PROJECT_newArchEnabled=true
else
export ORG_GRADLE_PROJECT_newArchEnabled=false
cd packages/helloworld/android
args=()
if [[ << parameters.architecture >> == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ << parameters.jsengine >> == "Hermes" ]]; then
export ORG_GRADLE_PROJECT_hermesEnabled=true
else
export ORG_GRADLE_PROJECT_hermesEnabled=false
if [[ << parameters.jsengine >> == "JSC" ]]; then
args+=(--jsvm jsc)
fi
./gradlew assemble<< parameters.flavor >> -Preact.internal.mavenLocalRepo=/root/react-native/maven-local
if [[ << parameters.flavor >> == "Release" ]]; then
args+=(--prod)
fi
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
- store_artifacts:
path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/
destination: template-apk
# -------------------------
# JOBS: Test iOS Template
# JOBS: Test iOS HelloWorld
# -------------------------
test_ios_template:
test_ios_helloworld:
parameters:
flavor:
default: "Debug"
@@ -412,25 +276,18 @@ jobs:
default: "2.6.10"
description: The version of ruby that must be used
type: string
podfile_lock_path:
type: string
default: "/tmp/iOSTemplateProject/ios/Podfile.lock"
pods_build_folder:
type: string
default: "/tmp/iOSTemplateProject/ios/Pods"
podfile_lock_cache_key:
type: string
default: *template_podfile_lock_cache_key
default: *helloworld_podfile_lock_cache_key
cocoapods_cache_key:
type: string
default: *template_cocoapods_cache_key
default: *helloworld_cocoapods_cache_key
executor:
description: The executor to use
default: reactnativeios
type: string
executor: << parameters.executor >>
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
- YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
@@ -451,48 +308,37 @@ jobs:
BUILD_TYPE="<< parameters.flavor >>"
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $BASH_ENV
- run:
name: Create iOS template project
command: |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}"
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
- with_xcodebuild_cache:
podfile_lock_path: << parameters.podfile_lock_path >>
pods_build_folder: << parameters.pods_build_folder >>
podfile_lock_path: packages/helloworld/ios/Podfile.lock
pods_build_folder: packages/helloworld/ios/Pods
cocoapods_cache_key: << parameters.cocoapods_cache_key >>
podfile_lock_cache_key: << parameters.podfile_lock_cache_key >>
steps:
- run:
name: Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.architecture >>; JS Engine << parameters.jsengine>>
command: |
cd /tmp/$PROJECT_NAME/ios
if [[ << parameters.architecture >> == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
cd packages/helloworld
args=()
if [[ << parameters.architecture >> == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ << parameters.jsengine >> == "JSC" ]]; then
export USE_HERMES=0
args+=(--jsvm jsc)
fi
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
export USE_FRAMEWORKS=dynamic
args+=(--frameworks dynamic)
fi
cd ..
bundle install
bundle exec pod install --project-directory=ios
yarn bootstrap ios "${args[@]}" | cat
- run:
name: Build template project
name: Build helloworld project
command: |
xcodebuild build \
-configuration << parameters.flavor >> \
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
-scheme $PROJECT_NAME \
-sdk iphonesimulator
cd packages/helloworld
args=()
if [[ << parameters.flavor >> == "Release" ]]; then
args+=(--prod)
fi
yarn build ios "${args[@]}" | cat
yarn bundle ios "${args[@]}" | cat
# -------------------------
# JOBS: Test iOS RNTester
@@ -599,7 +445,7 @@ jobs:
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- HERMES_VERSION_FILE: "packages/react-native/sdks/.hermesversion"
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
steps:
- run:
name: Install dependencies
@@ -780,7 +626,7 @@ jobs:
default: "iphoneos"
description: The Hermes Slice that this job has to build
type: enum
enum: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
enum: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
executor: reactnativeios
environment:
- HERMES_WS_DIR: *hermes_workspace_root
@@ -813,13 +659,19 @@ jobs:
exit 0
fi
export RELEASE_VERSION=$(cat /tmp/react-native-version)
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
export MAC_DEPLOYMENT_TARGET=10.13
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
unset MAC_DEPLOYMENT_TARGET
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
export IOS_DEPLOYMENT_TARGET=13.4
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-ios-framework.sh "$SLICE"
unset IOS_DEPLOYMENT_TARGET
fi
unset RELEASE_VERSION
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
@@ -879,6 +731,10 @@ jobs:
key: << parameters.slice_base_cache_key >>-iphonesimulator-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-catalyst-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-xros-<< parameters.flavor >>
- restore_cache:
key: << parameters.slice_base_cache_key >>-xrsimulator-<< parameters.flavor >>
- run:
name: "Move back build folders"
command: |
@@ -887,6 +743,8 @@ jobs:
mv build_iphoneos_<< parameters.flavor >> build_iphoneos
mv build_iphonesimulator_<< parameters.flavor >> build_iphonesimulator
mv build_catalyst_<< parameters.flavor >> build_catalyst
mv build_xros_<< parameters.flavor >> build_xros
mv build_xrsimulator_<< parameters.flavor >> build_xrsimulator
- run:
name: "Prepare destroot folder"
command: |
@@ -898,7 +756,11 @@ jobs:
command: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
export IOS_DEPLOYMENT_TARGET=13.4
export RELEASE_VERSION=$(cat /tmp/react-native-version)
./utils/build-ios-framework.sh build_framework
unset RELEASE_VERSION
unset IOS_DEPLOYMENT_TARGET
- run:
name: Package the Hermes Apple frameworks
command: |
@@ -933,6 +795,8 @@ jobs:
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
@@ -941,6 +805,8 @@ jobs:
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
@@ -1025,7 +891,7 @@ jobs:
name: Build HermesC for Windows
command: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7 -y
choco install --no-progress cmake -y
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
@@ -1076,36 +942,65 @@ jobs:
# -------------------------
# JOBS: Releases
# -------------------------
prepare_package_for_release:
# Writes a new commit and tag(s), which will trigger the `publish_release`
# and `publish_bumped_packages` workflows.
prepare_release:
parameters:
version:
type: string
latest:
# TODO(T182538198): Required for 0.74.x, where workspace packages are out
# of sync with react-native. This will be removed for 0.75+.
monorepo_packages_version:
type: string
tag:
type: string
dry_run:
type: boolean
default: false
dryrun:
type: boolean
default: false
executor: reactnativeios
executor: nodelts
steps:
- checkout_code_with_cache
- run_yarn
- add_ssh_keys:
fingerprints:
- "1f:c7:61:c4:e2:ff:77:e3:cc:ca:a7:34:c2:79:e3:3c"
- brew_install:
package: cmake
- run:
name: "Set new react-native version and commit changes"
name: Versioning workspace packages
command: |
VERSION=<< parameters.version >>
node scripts/releases/set-version "<< parameters.monorepo_packages_version >>" --skip-react-native-version
- run:
name: Versioning react-native package
command: |
node scripts/releases/set-rn-version.js -v "<< parameters.version >>" --build-type "release"
- run:
name: Creating release commit
command: |
# I'm seeing failures in automatically detect the email for the
# agent that should push the commit.
git config --global user.name "Distiller"
git config --global user.email "distiller@circleci.com"
if [[ -z "$VERSION" ]]; then
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -1)
echo "Using the version from the package.json: $VERSION"
fi
node ./scripts/releases-ci/prepare-package-for-release.js -v "$VERSION" -l << parameters.latest >> --dry-run << parameters.dryrun >>
git commit -a -m "Release << parameters.version >>" -m "#publish-packages-to-npm&<< parameters.tag >>"
git tag -a "v<< parameters.version >>" -m "v<< parameters.version >>"
GIT_PAGER=cat git show HEAD
- when:
condition:
equal: ["latest", << parameters.tag >>]
steps:
- run:
name: Updating "latest" tag
command: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
- unless:
condition: << parameters.dry_run >>
steps:
run:
name: Pushing release commit
command: |
git push origin $CIRCLE_BRANCH --follow-tags
build_npm_package:
parameters:
@@ -4,11 +4,12 @@
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_package_for_release:
name: prepare_package_for_release
version: ''
latest : false
dryrun: true
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
@@ -24,7 +25,7 @@
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
@@ -45,59 +46,47 @@
- test_android:
requires:
- build_android
- test_android_template:
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
- test_ios_helloworld:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
- test_ios_template:
requires:
- build_npm_package
name: "Test Template with Ruby 3.2.0"
ruby_version: "3.2.0"
- build_hermes_macos
name: "Test Template with Ruby 3.2.2"
ruby_version: "3.2.2"
architecture: "NewArch"
flavor: "Debug"
executor: reactnativeios-lts
- test_ios_template:
architecture: "OldArch"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_helloworld:
requires:
- build_npm_package
- build_hermes_macos
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
exclude:
# This config is tested with Ruby 3.2.0. Let's not double test it.
# This config is tested with Ruby 3.2.2. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_rntester:
requires:
- build_hermes_macos
name: "Test RNTester with Ruby 3.2.0"
ruby_version: "3.2.0"
executor: reactnativeios-lts
- test_ios_rntester:
requires:
- build_hermes_macos
use_frameworks: "DynamicFrameworks"
architecture: "NewArch"
ruby_version: "3.2.2"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
exclude:
# Tested by test_ios-Hermes
- jsengine: "Hermes"
use_frameworks: "StaticLibraries"
# Tested by test_ios-JSC
- jsengine: "JSC"
use_frameworks: "StaticLibraries"
# Tested with Ruby 3.2.0, do not test this twice.
- jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_rntester:
run_unit_tests: true
use_frameworks: "StaticLibraries"
@@ -4,11 +4,12 @@
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_package_for_release:
name: prepare_package_for_release
version: ''
latest : false
dryrun: true
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
@@ -24,7 +25,7 @@
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
@@ -42,15 +43,16 @@
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- test_android:
requires:
- build_android
# - test_e2e_android
- test_android_template:
requires:
- build_npm_package
matrix:
parameters:
architecture: ["NewArch", "OldArch"]
jsengine: ["Hermes", "JSC"]
flavor: ["Debug", "Release"]
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android:
# requires:
# - build_android
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
@@ -1,9 +0,0 @@
tests_e2e:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- test_e2e_ios:
ruby_version: "2.7.7"
- test_e2e_android
@@ -4,11 +4,12 @@
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_package_for_release:
name: prepare_package_for_release
version: ''
latest : false
dryrun: true
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
@@ -24,7 +25,7 @@
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
@@ -42,46 +43,38 @@
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
# - test_e2e_ios:
# ruby_version: "2.7.7"
- test_ios_template:
- test_ios_helloworld:
requires:
- build_npm_package
name: "Test Template with Ruby 3.2.0"
ruby_version: "3.2.0"
- build_hermes_macos
name: "Test Template with Ruby 3.2.2"
ruby_version: "3.2.2"
architecture: "NewArch"
flavor: "Debug"
executor: reactnativeios-lts
- test_ios_template:
architecture: "OldArch"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_helloworld:
requires:
- build_npm_package
- build_hermes_macos
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
exclude:
# Tested with Ruby 3.2.0, let's not double test this
# This config is tested with Ruby 3.2.2. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_rntester:
requires:
- build_hermes_macos
name: "RNTester on Ruby 3.2.0"
ruby_version: "3.2.0"
executor: reactnativeios-lts
- test_ios_rntester:
name: "RNTester with Dynamic Frameworks"
use_frameworks: "DynamicFrameworks"
requires:
- build_hermes_macos
ruby_version: "3.2.2"
architecture: "NewArch"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
- test_ios_rntester:
name: "RNTester Integration Tests"
run_unit_tests: true
use_frameworks: "StaticLibraries"
ruby_version: "2.6.10"
+28 -21
View File
@@ -59,7 +59,7 @@ references:
# Dependency Anchors
# -------------------------
dependency_versions:
xcode_version: &xcode_version "15.0.1"
xcode_version: &xcode_version "15.2"
nodelts_image: &nodelts_image "cimg/node:20.2.0"
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
@@ -71,32 +71,31 @@ references:
cache_keys:
checkout_cache_key: &checkout_cache_key v1-checkout
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
gems_cache_key: &gems_cache_key v2-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}
gradle_cache_key: &gradle_cache_key v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }}
yarn_cache_key: &yarn_cache_key v6-yarn-cache-{{ .Environment.CIRCLE_JOB }}
rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ checksum "/tmp/required_ruby" }}
rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ arch }}-{{ checksum "/tmp/required_ruby" }}
hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_linux_cache_key: &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
# Hermes iOS
hermesc_apple_cache_key: &hermesc_apple_cache_key v3-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v4-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v5-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v4-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v2-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v2-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v2-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v2-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermesc_apple_cache_key: &hermesc_apple_cache_key v4-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v8-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v6-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v5-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v5-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v3-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v3-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v3-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
# Cocoapods - RNTester
pods_cache_key: &pods_cache_key v11-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
cocoapods_cache_key: &cocoapods_cache_key v11-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v9-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
# Cocoapods - Template
template_cocoapods_cache_key: &template_cocoapods_cache_key v6-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile.lock" }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock" }}
template_podfile_lock_cache_key: &template_podfile_lock_cache_key v6-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock" }}
pods_cache_key: &pods_cache_key v12-pods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
cocoapods_cache_key: &cocoapods_cache_key v12-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v11-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
# Cocoapods - HelloWorld
helloworld_cocoapods_cache_key: &helloworld_cocoapods_cache_key v2-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile.lock" }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
helloworld_podfile_lock_cache_key: &helloworld_podfile_lock_cache_key v2-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
cache_paths:
hermes_workspace_macos_cache_paths: &hermes_workspace_macos_cache_paths
@@ -129,14 +128,22 @@ parameters:
default: false
type: boolean
release_latest:
run_nightly_workflow:
default: false
type: boolean
release_version:
default: "9999"
default: ""
type: string
run_nightly_workflow:
release_monorepo_packages_version:
default: ""
type: string
release_tag:
default: ""
type: string
release_dry_run:
default: false
type: boolean
-105
View File
@@ -15,66 +15,6 @@
workflows:
version: 2
# This workflow should only be triggered by release script
package_release:
when: << pipeline.parameters.run_release_workflow >>
jobs:
# This job will push a tag that will trigger the publish_release workflow
- prepare_package_for_release:
name: prepare_package_for_release
version: << pipeline.parameters.release_version >>
latest : << pipeline.parameters.release_latest >>
# This job will run only when a tag is published due to all the jobs being filtered.
publish_release:
jobs:
- prepare_hermes_workspace:
filters: *only_release_tags
- build_android:
filters: *only_release_tags
name: build_android_for_release
release_type: "release"
- build_hermesc_linux:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
filters: *only_release_tags
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
- build_hermesc_windows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermes_macos:
filters: *only_release_tags
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
# This job will trigger when a version tag is pushed (by package_release)
- build_npm_package:
name: build_and_publish_npm_package
release_type: "release"
filters: *only_release_tags
requires:
- build_android_for_release
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- poll_maven:
requires:
- build_and_publish_npm_package
analysis:
when:
and:
@@ -86,48 +26,3 @@ workflows:
# Run code checks on PRs
- analyze_pr
nightly:
when: << pipeline.parameters.run_nightly_workflow >>
jobs:
- prepare_hermes_workspace
- build_android:
release_type: "nightly"
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_hermes_macos:
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
- build_npm_package:
release_type: "nightly"
requires:
- build_android
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
publish_bumped_packages:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- find_and_publish_bumped_packages:
<<: *main_or_stable_only
+1
View File
@@ -84,6 +84,7 @@ SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
QualifierAlignment: Left
---
Language: ObjC
ColumnLimit: 120
+2
View File
@@ -2,6 +2,8 @@
**/staticBundle.js
docs/generatedComponentApiDocs.js
packages/react-native/flow/
packages/react-native/sdks/
packages/react-native/ReactAndroid/hermes-engine/build/
packages/react-native/Libraries/Renderer/*
packages/react-native/Libraries/vendor/**/*
node_modules/
+2 -1
View File
@@ -24,7 +24,7 @@ module.exports = {
// overriding the JS config from @react-native/eslint-config to ensure
// that we use hermes-eslint for all js files
{
files: ['*.js', '*.js.flow'],
files: ['*.js', '*.js.flow', '*.jsx'],
parser: 'hermes-eslint',
rules: {
// These rules are not required with hermes-eslint
@@ -113,6 +113,7 @@ module.exports = {
files: ['**/*.d.ts'],
plugins: ['redundant-undefined'],
rules: {
'no-dupe-class-members': 'off',
'redundant-undefined/redundant-undefined': [
'error',
{followExactOptionalPropertyTypes: true},
+8 -2
View File
@@ -1,6 +1,10 @@
[ignore]
; Ignore templates for 'react-native init'
<PROJECT_ROOT>/packages/react-native/template/.*
<PROJECT_ROOT>/packages/react-native/sdks/.*
; Ignore the codegen e2e tests
<PROJECT_ROOT>/packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
; Ignore the Dangerfile
<PROJECT_ROOT>/packages/react-native-bots/dangerfile.js
@@ -20,6 +24,9 @@
; Generated build output
<PROJECT_ROOT>/packages/.*/dist
; helloworld
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
@@ -34,7 +41,6 @@ packages/react-native/interface.js
packages/react-native/flow/
[options]
experimental.global_find_ref=true
enums=true
casting_syntax=both
@@ -85,4 +91,4 @@ untyped-import
untyped-type-import
[version]
^0.228.0
^0.238.0
+4
View File
@@ -1,5 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: ⬆️ Upgrade - Build Regression
url: https://github.com/reactwg/react-native-releases/issues/new/choose
about: |
If you are upgrading to a new React Native version (stable or pre-release) and encounter a build regression.
- name: 🚀 Expo Issue
url: https://github.com/expo/expo/issues/new
about: |
@@ -1,133 +0,0 @@
name: ⬆️ Upgrade - Build Regression
description: If you are upgrading to a new React Native version (stable or pre-release) and encounter a build regression.
labels: ["Needs: Triage :mag:", "Type: Upgrade Issue"]
body:
- type: markdown
attributes:
value: "## Upgrade Issues"
- type: markdown
attributes:
value: |
Please use this form to file an issue if you have upgraded or are upgrading to [latest stable release](https://github.com/facebook/react-native/releases/latest) and have experienced a regression (something that used to work in previous version).
If you're **NOT** upgrading the React Native version, please use this [other bug type](https://github.com/facebook/react-native/issues/new?template=bug_report.yml).
Before you continue:
* If you're using **Expo** and having problems updating it, [report it here](https://github.com/expo/expo/issues).
* If you're found a problem with our **documentation**, [report it here](https://github.com/facebook/react-native-website/issues/).
* If you're having an issue with **Metro** (the bundler), [report it here](https://github.com/facebook/metro/issues/).
* If you're using an external library, report the issue to the **library first**.
* Please [search for similar issues](https://github.com/facebook/react-native/issues) in our issue tracker.
Make sure that your issue:
* Have a **valid reproducer** with an [empty project from template](https://github.com/react-native-community/reproducer-react-native).
* Is upgrading to the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
Due to the extreme number of bugs we receive, we will be looking **ONLY** into issues with a reproducer, and on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) of React Native.
- type: input
id: old-version
attributes:
label: Old Version
description: The version of react-native that you're upgrading from.
placeholder: "0.72.0"
validations:
required: true
- type: input
id: new-version
attributes:
label: New Version
description: The version of react-native that you're upgrading to. Bear in mind that only issues that are upgrading to the [latest stable](https://github.com/facebook/react-native/releases/) will be looked into.
placeholder: "0.73.0"
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: The list of steps and commands to reproduce the issue.
placeholder: |
1. Install the application with `yarn android`
2. Click on the button on the Home
3. Notice the crash
validations:
required: true
- type: dropdown
id: platforms
attributes:
label: Affected Platforms
description: Please select which platform you're developing to, and which OS you're using for building.
multiple: true
options:
- Runtime - Android
- Runtime - iOS
- Runtime - Web
- Runtime - Desktop
- Build - MacOS
- Build - Windows
- Build - Linux
- Other (please specify)
validations:
required: true
- type: textarea
id: react-native-info
attributes:
label: Output of `npx react-native info`
description: Run `npx react-native info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
...
System:
OS: macOS 14.1.1
CPU: (10) arm64 Apple M1 Max
Memory: 417.81 MB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
...
render: text
validations:
required: true
- type: textarea
id: stacktrace
attributes:
label: Stacktrace or Logs
description: Please provide a stacktrace or a log of your crash or failure
render: text
placeholder: |
Paste your stacktraces and logs here. They might look like:
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfabricjni.so caused by: com.facebook.react.fabric.StateWrapperImpl result: 0
at com.facebook.soloader.SoLoader.g(Unknown Source:341)
at com.facebook.soloader.SoLoader.t(Unknown Source:124)
at com.facebook.soloader.SoLoader.s(Unknown Source:2)
at com.facebook.soloader.SoLoader.q(Unknown Source:42)
at com.facebook.soloader.SoLoader.p(Unknown Source:1)
...
validations:
required: true
- type: input
id: reproducer
attributes:
label: Reproducer
description: A link to a Expo Snack or a public repository that reproduces this bug, using [this template](https://github.com/react-native-community/reproducer-react-native). Reproducers are **mandatory**.
placeholder: "https://github.com/<myuser>/<myreproducer>"
validations:
required: true
- type: textarea
id: extra
attributes:
label: Screenshots and Videos
description: |
Please provide screenshot or a video of your bug if relevant.
Issues with videos and screenshots are more likely to **get prioritized**.
+88
View File
@@ -0,0 +1,88 @@
name: cache_setup
description: "Cache setup"
inputs:
hermes-version:
description: "Hermes version"
required: true
react-native-version:
description: "React Native version"
required: true
outputs:
cache-hit-hermes-tarball-release:
description: "Whether the hermes tarball release cache was hit"
value: ${{ steps.cache_hermes_tarball_release.outputs.cache-hit }}
cache-hit-hermes-tarball-debug:
description: "Whether the hermes tarball debug cache was hit"
value: ${{ steps.cache_hermes_tarball_debug.outputs.cache-hit }}
cache-hit-macos-bin-release:
description: "Whether the macos bin release cache was hit"
value: ${{ steps.cache_macos_bin_release.outputs.cache-hit }}
cache-hit-macos-bin-debug:
description: "Whether the macos bin debug cache was hit"
value: ${{ steps.cache_macos_bin_debug.outputs.cache-hit }}
cache-hit-dsym-release:
description: "Whether the dsym release cache was hit"
value: ${{ steps.cache_dsym_release.outputs.cache-hit }}
cache-hit-dsym-debug:
description: "Whether the dsym debug cache was hit"
value: ${{ steps.cache_dsym_debug.outputs.cache-hit }}
runs:
using: composite
steps:
- name: Cache hermes tarball release
id: cache_hermes_tarball_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Release.tar.gz
key: v4-hermes-tarball-release-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
enableCrossOsArchive: true
- name: Cache hermes tarball debug
id: cache_hermes_tarball_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Debug.tar.gz
key: v4-hermes-tarball-debug-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
enableCrossOsArchive: true
- name: Cache macos bin release
id: cache_macos_bin_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/osx-bin/Release
key: v2-hermes-release-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache macos bin debug
id: cache_macos_bin_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/osx-bin/Debug
key: v2-hermes-debug-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache dsym release
id: cache_dsym_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/dSYM/Release
key: v2-hermes-release-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache dsym debug
id: cache_dsym_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/dSYM/Debug
key: v2-hermes-debug-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: HermesC Apple
id: hermesc_apple
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermesc-apple
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
+29
View File
@@ -0,0 +1,29 @@
name: create_release
description: Creates a new React Native release
runs:
using: composite
steps:
- name: Yarn install
shell: bash
run: yarn install --non-interactive
- name: Creating release commit
shell: bash
run: |
node scripts/releases/create-release-commit.js \
--reactNativeVersion "${{ inputs.version }}" \
--tagAsLatestRelease "${{ inputs.is_latest_on_npm }}" \
--dryRun "${{ inputs.dry_run }}"
GIT_PAGER=cat git show HEAD
- name: Update "latest" tag if needed
shell: bash
if: ${{ inputs.tag == 'latest' }}
run: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
- name: Pushing release commit
shell: bash
if: ${{ inputs.dry_run == false }}
run: |
CURR_BRANCH="$(git branch --show-current)"
git push origin "$CURR_BRANCH" --follow-tags
@@ -0,0 +1,25 @@
name: prepare_ios_tests
description: Prepare iOS Tests
runs:
using: composite
steps:
- name: brew install xcbeautify
run: brew install xcbeautify
shell: bash
- name: Run Ruby Tests
shell: bash
run: |
cd packages/react-native/scripts
sh run_ruby_tests.sh
- name: Boot iPhone Simulator
shell: bash
run: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
- name: "Brew: Tap wix/brew"
shell: bash
run: brew tap wix/brew
- name: brew install applesimutils watchman
shell: bash
run: brew install applesimutils watchman
- name: Configure Watchman
shell: bash
run: echo "{}" > .watchmanconfig
@@ -0,0 +1,12 @@
name: report_bundle_size
description: Report bundle size
inputs:
platform:
description: Platform. Either ios or android
default: ios
runs:
using: composite
steps:
- name: Report size of RNTester.app (analysis-bot)
shell: bash
run: GITHUB_TOKEN=${{ secrets.PUBLIC_ANALYSISBOT_GITHUB_TOKEN }} scripts/circleci/report-bundle-size.sh ${{ inputs.platform }} || true
+19
View File
@@ -0,0 +1,19 @@
name: run_e2e
description: "Run End-to-End Tests"
inputs:
platform:
description: "Platform to run tests on"
required: true
default: "js"
retries:
description: "Number of times to retry failed tests"
required: true
default: "3"
runs:
using: composite
steps:
- name: "Run Tests: ${{ inputs.platform }} End-to-End Tests"
# Disabled to remove the template from react-native
if: false
run: node ./scripts/e2e/run-ci-e2e-tests.js --${{ inputs.platform }} --retries ${{ inputs.retries }}
shell: bash
+9
View File
@@ -0,0 +1,9 @@
name: Setup gradle
description: "Set up your GitHub Actions workflow with a specific version of gradle"
runs:
using: "composite"
steps:
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
+19
View File
@@ -0,0 +1,19 @@
name: Setup node.js
description: 'Set up your GitHub Actions workflow with a specific version of node.js'
inputs:
node-version:
description: 'The node.js version to use'
required: false
default: '18'
cache:
description: 'The package manager to use for caching dependencies'
required: false
default: 'yarn'
runs:
using: "composite"
steps:
- name: Setup node.js
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.cache }}
+14
View File
@@ -0,0 +1,14 @@
name: Setup xcode
description: 'Set up your GitHub Actions workflow with a specific version of xcode'
inputs:
xcode-version:
description: 'The xcode version to use'
required: false
default: '15.2'
runs:
using: "composite"
steps:
- name: Setup xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: ${{ inputs.xcode-version }}
@@ -0,0 +1,11 @@
name: setup_hermes_workspace
description: "Setup hermes workspace"
runs:
using: composite
steps:
- name: Set up workspace
shell: bash
run: |
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
@@ -0,0 +1,28 @@
name: setup_xcode_build_cache
description: Add caching to iOS jobs to speed up builds
inputs:
hermes-version:
description: The version of hermes
required: true
runs:
using: composite
steps:
- name: See commands.yml with_xcodebuild_cache
shell: bash
run: echo "See commands.yml with_xcodebuild_cache"
- name: Prepare Xcodebuild cache
shell: bash
run: |
WEEK=$(date +"%U")
YEAR=$(date +"%Y")
echo "$WEEK-$YEAR" > /tmp/week_year
- name: Cache podfile lock
uses: actions/cache@v4.0.0
with:
path: packages/rn-tester/Podfile.lock
key: v9-podfilelock-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile') }}-{{ hashfiles('/tmp/week_year') }}-${{ inputs.hermes-version}}
- name: Cache cocoapods
uses: actions/cache@v4.0.0
with:
path: packages/rn-tester/Pods
key: v11-cocoapods-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-{{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
@@ -0,0 +1,95 @@
name: test_ios_helloworld
description: Test iOS Hello World
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: choice
default: Hermes
options:
- JSC
- Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
type: choice
default: StaticLibraries
options:
- StaticLibraries
- DynamicFrameworks
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
type: choice
default: OldArch
options:
- OldArch
- NewArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
type: choice
default: Debug
options:
- Debug
- Release
hermes-version:
description: The version of hermes
required: true
react-native-version:
description: The version of react-native
required: true
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
args+=(--frameworks dynamic)
fi
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
args+=(--jsvm jsc)
yarn bootstrap ios "${args[@]}" | cat
else
BUILD_TYPE="${{ inputs.flavor }}"
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
HERMES_ENGINE_TARBALL_PATH="$HERMES_PATH" yarn bootstrap ios "${args[@]}" | cat
fi
- name: Build HelloWorld project
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
args+=(--prod)
fi
yarn build ios "${args[@]}" | cat
yarn bundle ios "${args[@]}" | cat
@@ -0,0 +1,152 @@
name: test_ios_rntester
description: Test iOS RNTester
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
default: Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
default: NewArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
run-unit-tests:
description: whether unit tests should run or not.
default: false
hermes-tarball-artifacts-dir:
description: The directory where the hermes tarball artifacts are stored
default: /tmp/hermes/hermes-runtime-darwin
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
default: Debug
hermes-version:
description: The version of hermes
required: true
react-native-version:
description: The version of react-native
required: true
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Prepare IOS Tests
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/prepare_ios_tests
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
shell: bash
run: |
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
exit 0
fi
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
echo "$TARBALL_PATH"
if [ ! -f $TARBALL_PATH ]; then
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
exit 0
fi
echo "Found Hermes tarball at $TARBALL_PATH"
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
- name: Print Hermes version
shell: bash
run: |
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
else
echo 'No Hermes tarball found.'
fi
- name: Setup xcode build cache
uses: ./.github/actions/setup_xcode_build_cache
with:
hermes-version: ${{ inputs.hermes-version }}
- name: Install CocoaPods dependencies
shell: bash
run: |
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
export USE_HERMES=0
else
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
fi
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
export USE_FRAMEWORKS=dynamic
fi
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
cd packages/rn-tester
bundle install
bundle exec pod install
- name: Build RNTester
if: ${{ inputs.run-unit-tests != true }}
shell: bash
run: |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == true }}
shell: bash
run: yarn test-ios
- name: Zip Derived data folder
if: ${{ inputs.run-unit-tests == true }}
shell: bash
run: |
echo "zipping tests results"
cd /Users/distiller/Library/Developer/Xcode
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
if: ${{ inputs.run-unit-tests == true }}
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- name: Report bundle size
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/report_bundle_size
with:
platform: ios
- name: Store test results
if: ${{ inputs.run-unit-tests == true }}
uses: actions/upload-artifact@v2.2.4
with:
name: test-results
path: ./reports/junit
@@ -149,6 +149,5 @@ const topics = {
'react-native-cli': labelCli,
'react-native upgrade': labelCli,
'react-native link': labelCli,
'local-cli': labelCli,
regression: labelRegression,
};
@@ -1,22 +0,0 @@
name: Apply version label to issue
on:
issues:
types: [opened, edited]
permissions:
contents: read
jobs:
add-version-label-issue:
permissions:
issues: write # for react-native-community/actions-apply-version-label to label issues
runs-on: ubuntu-latest
continue-on-error: true
if: github.repository == 'facebook/react-native'
steps:
- uses: react-native-community/actions-apply-version-label@v0.0.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
required-label: "Type: Upgrade Issue"
@@ -42,19 +42,19 @@ jobs:
repo: context.repo.repo,
})).data;
// If the PR has already been processed (labeled as Merged), skip it
const mergedLabel = "Merged";
if(pr.labels && pr.labels.some(label => label.name === mergedLabel)) return;
const authorName = author?.login ? `@${author.login}` : commit.author.name;
github.rest.issues.createComment({
issue_number: closedPrNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request was successfully merged by ${authorName} in **${sha}**.\n\n<sup>[When will my fix make it into a release?](https://github.com/facebook/react-native/wiki/Release-FAQ#when-will-my-fix-make-it-into-a-release) | [Upcoming Releases](https://github.com/reactwg/react-native-releases/discussions/categories/releases)</sup>`
body: `This pull request was successfully merged by ${authorName} in **${sha}**.\n\n<sup>[When will my fix make it into a release?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#when-will-my-fix-make-it-into-a-release) | [How to file a pick request?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#how-to-open-a-pick-request)</sup>`
});
// If the PR has already been processed (labeled as Merged), skip it
const mergedLabel = "Merged";
if(pr.labels && pr.labels.some(label => label.name === mergedLabel)) return;
github.rest.issues.addLabels({
issue_number: closedPrNumber,
owner: context.repo.owner,
+48
View File
@@ -0,0 +1,48 @@
name: Create release
on:
workflow_dispatch:
inputs:
version:
description: 'The version of React Native we want to release. For example 0.75.0-rc.0'
required: true
type: string
is_latest_on_npm:
description: 'Whether we want to tag this release as latest on NPM'
required: true
type: boolean
default: false
dry_run:
description: 'Whether the job should be executed in dry-run mode or not'
type: boolean
default: false
jobs:
prepare_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Check if on stable branch
id: check_stable_branch
run: |
BRANCH="$(git branch --show-current)"
PATTERN='^0\.[0-9]+-stable$'
if [[ $BRANCH =~ $PATTERN ]]; then
echo "On a stable branch"
echo "ON_STABLE_BRANCH=true" >> $GITHUB_OUTPUT
fi
- name: Print output
run: echo "ON_STABLE_BRANCH ${{steps.check_stable_branch.outputs.ON_STABLE_BRANCH}}"
- name: Check if tag already exists
id: check_if_tag_exists
run: |
TAG="v${{ inputs.version }}"
TAG_EXISTS=$(git tag -l "$TAG")
if [[ -n "$TAG_EXISTS" ]]; then
echo "Version tag already exists!"
echo "TAG_EXISTS=true" >> $GITHUB_OUTPUT
fi
- name: Execute Prepare Release
if: ${{ steps.check_stable_branch.outputs.ON_STABLE_BRANCH && !steps.check_if_tag_exists.outputs.TAG_EXISTS }}
uses: ./.github/actions/create-release
@@ -0,0 +1,13 @@
name: "Validate Gradle Wrapper"
on:
push:
pull_request:
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
-48
View File
@@ -1,48 +0,0 @@
name: ios-tests
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
test_ios_rntester-Hermes:
runs-on: macos-latest-large
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Yarn Install
run: yarn install
- name: Get latest commit from Hermes
run: |
mkdir -p tmp/hermes
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo $HERMES_TAG_SHA > tmp/hermes/hermesversion
echo "Latest Commit is:"
cat tmp/hermes/hermesversion
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.2'
- name: Cache cocoapods
uses: actions/cache@v3
with:
path: packages/rn-tester/Pods
key: v1-${{ runner.os }}-RNTesterPods-${{ hashFiles('packages/rn-tester/Podfile.lock') }}-${{ hashFiles('packages/rn-tester/Podfile') }}-${{ hashFiles('tmp/hermes/hermesversion') }}
- name: Pod Install
run: |
cd packages/rn-tester
bundle install
bundle exec pod install
- name: Install XCBeautify
run: brew install xcbeautify
- name: Build iOS
run: ./scripts/objc-test.sh
+4 -4
View File
@@ -2,7 +2,7 @@ name: Issue Needs Attention
# This workflow is triggered on issue comments.
on:
issue_comment:
types: created
types: [created]
permissions:
contents: read
@@ -10,15 +10,15 @@ permissions:
jobs:
applyNeedsAttentionLabel:
permissions:
contents: read # for actions/checkout to fetch code
issues: write # for hramos/needs-attention to label issues
contents: read # for actions/checkout to fetch code
issues: write # for react-native-community/needs-attention to label issues
name: Apply Needs Attention Label
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- uses: actions/checkout@v4
- name: Apply Needs Attention Label
uses: hramos/needs-attention@v1
uses: react-native-community/needs-attention@v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
response-required-label: "Needs: Author Feedback"
-52
View File
@@ -1,52 +0,0 @@
name: Nightlies Partners Feedback
env:
# Add accounts for users who are part of the nightlies program
allowed_users: >
[
"blakef",
"alanjhughes"
]
on:
workflow_dispatch:
inputs:
project:
description: 'What project is running against the nighties build?'
required: true
type: string
outcome:
description: 'Did the CI run: ["pass", "fail"]?'
required: true
type: string
stage:
description: 'Stage in the run that failed: ["build", "test"]?'
required: true
type: string
link:
description: 'URL to the failing test'
required: true
type: string
version:
description: 'What is the Nightlies version this was run against?'
required: true
type: string
jobs:
share-nightlies-feedback:
name: ${{ inputs.project}} 💨 Nightlies CI
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- if: ${{ !contains(fromJSON(env.allowed_users), github.actor) }}
run: |
echo "Request from actor's login wasn't on the allowed_users list."
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
- run: |
echo "Project: ${{ inputs.project }}"
echo "Outcome: ${{ inputs.outcome }}"
echo "Stage: ${{ inputs.stage }}"
echo "Link: ${{ inputs.link }}"
echo "Version: ${{ inputs.version }}"
[[ "${{ inputs.outcome }}" == "pass" ]] && { exit 0; } || { exit 1; }
+709
View File
@@ -0,0 +1,709 @@
name: Nightly
on:
workflow_dispatch:
# nightly build @ 2:15 AM UTC
schedule:
- cron: '15 2 * * *'
jobs:
set_release_type:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
outputs:
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
steps:
- id: set_release_type
run: |
echo "Setting release type to nightly"
echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT
prepare_hermes_workspace:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Build HermesC Apple
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
FLAVOR=${{ matrix.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ matrix.flavor }} build_macosx
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
mv build_catalyst_${{ matrix.flavor }} build_catalyst
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
./utils/build-ios-framework.sh build_framework
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Linux cache
uses: actions/cache@v4.0.0
with:
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Windows cache
uses: actions/cache@v4.0.0
with:
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
run: |
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- name: Build HermesC for Windows
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
build_android:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
run: |
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
build_npm_package:
runs-on: 8-core-ubuntu
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
HERMES_WS_DIR: /tmp/hermes
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Build packages
run: yarn build
# Continue with publish steps
- name: Set npm credentials
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
- name: Publish NPM
run: |
git config --global --add safe.directory /__w/react-native/react-native
echo "GRADLE_OPTS = $GRADLE_OPTS"
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
node ./scripts/releases-ci/publish-npm.js -t nightly
- name: Zip Maven Artifacts from /tmp/maven-local
working-directory: /tmp
run: zip -r maven-local.zip maven-local
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: maven-local
path: /tmp/maven-local.zip
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.1
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv packages/react-native/$FILENAME build/
echo $FILENAME > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.1
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
with:
name: react-native-package
path: build
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
+1 -1
View File
@@ -2,7 +2,7 @@ name: On Issue Labeled
# This workflow is triggered when a label is added to an issue.
on:
issues:
types: labeled
types: [labeled]
permissions:
contents: write
@@ -0,0 +1,26 @@
name: Publish Bumped Packages
on:
push:
branches:
- "main"
- "*-stable"
jobs:
publish_bumped_packages:
runs-on: ubuntu-latest
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run Yarn Install
run: yarn install
- name: Build packages
run: yarn build
- name: Set NPM auth token
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
- name: Find and publish all bumped packages
run: node ./scripts/releases-ci/publish-updated-packages.js
+707
View File
@@ -0,0 +1,707 @@
name: Publish Release
on:
push:
tags:
- "v0.*.*" # This should match v0.X.Y
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
jobs:
set_release_type:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
outputs:
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
steps:
- id: set_release_type
run: |
echo "Setting release type to release"
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT
prepare_hermes_workspace:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Build HermesC Apple
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
FLAVOR=${{ matrix.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ matrix.flavor }} build_macosx
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
mv build_catalyst_${{ matrix.flavor }} build_catalyst
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
./utils/build-ios-framework.sh build_framework
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Linux cache
uses: actions/cache@v4.0.0
with:
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Windows cache
uses: actions/cache@v4.0.0
with:
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
run: |
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- name: Build HermesC for Windows
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
build_android:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
run: |
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
build_npm_package:
runs-on: 8-core-ubuntu
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
HERMES_WS_DIR: /tmp/hermes
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Build packages
run: yarn build
# Continue with publish steps
- name: Set npm credentials
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
- name: Publish NPM
run: |
git config --global --add safe.directory /__w/react-native/react-native
echo "GRADLE_OPTS = $GRADLE_OPTS"
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
node ./scripts/releases-ci/publish-npm.js -t release
- name: Zip Maven Artifacts from /tmp/maven-local
working-directory: /tmp
run: zip -r maven-local.zip maven-local
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: maven-local
path: /tmp/maven-local.zip
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.1
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv packages/react-native/$FILENAME build/
echo $FILENAME > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.1
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
with:
name: react-native-package
path: build
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
-26
View File
@@ -1,26 +0,0 @@
name: Run E2E Tests
# This workflow is used to trigger E2E tests on a PR when a comment is made
# containing the text "#run-e2e-tests".
on:
issue_comment:
types: [created]
permissions:
contents: read
jobs:
rebase:
name: Trigger E2E Tests
permissions:
contents: write # for cirrus-actions/rebase to push code to rebase
pull-requests: read # for cirrus-actions/rebase to get info about PR
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '#run-e2e-tests')
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Push empty commit
run: |
git commit -m "#run-e2e-tests" --allow-empty
git push origin $(git branch --show-current)
+5 -5
View File
@@ -1,4 +1,4 @@
name: Mark stale issues and pull requests
name: Stale bot
on:
schedule:
- cron: "*/10 5 * * *"
@@ -10,7 +10,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 180
@@ -27,7 +27,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
ascending: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -45,7 +45,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
any-of-labels: 'Needs: Author Feedback'
@@ -63,7 +63,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
- uses: actions/stale@v9
with:
ascending: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
+926
View File
@@ -0,0 +1,926 @@
name: Test All
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- "*-stable"
jobs:
set_release_type:
runs-on: ubuntu-latest
outputs:
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
steps:
- id: set_release_type
run: |
if [[ $EVENT_NAME == "schedule" ]]; then
echo "Setting release type to nightly"
echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT
elif [[ $EVENT_NAME == "push" && $REF == refs/tags/v* ]]; then
echo "Setting release type to release"
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT
else
echo "Setting release type to dry-run"
echo "RELEASE_TYPE=dry-run" >> $GITHUB_OUTPUT
fi
prepare_hermes_workspace:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Build HermesC Apple
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
fi
- name: Build the Hermes ${{ matrix.slice }} frameworks
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
FLAVOR=${{ matrix.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Save slice cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ matrix.flavor }} build_macosx
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
mv build_catalyst_${{ matrix.flavor }} build_catalyst
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
./utils/build-ios-framework.sh build_framework
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
test_ios_rntester_ruby_3_2_0:
runs-on: macos-13
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Run it
uses: ./.github/actions/test_ios_rntester
with:
ruby-version: "3.2.0"
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_rntester_dynamic_frameworks:
runs-on: macos-13
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Run it
uses: ./.github/actions/test_ios_rntester
with:
jsengine: ${{ matrix.jsengine }}
use-frameworks: DynamicFrameworks
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_rntester:
runs-on: macos-13
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
architecture: [NewArch, OldArch]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Run it
uses: ./.github/actions/test_ios_rntester
with:
jsengine: ${{ matrix.jsengine }}
architecture: ${{ matrix.architecture }}
run-unit-tests: true
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Linux cache
uses: actions/cache@v4.0.0
with:
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Windows cache
uses: actions/cache@v4.0.0
with:
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
run: |
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- name: Build HermesC for Windows
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
build_android:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
run: |
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
build_npm_package:
runs-on: 8-core-ubuntu
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
HERMES_WS_DIR: /tmp/hermes
steps:
- name: Add github.com to SSH known hosts
run: |
mkdir -p ~/.ssh
echo '|1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Use Node.js 18
uses: actions/setup-node@v4.0.0
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --non-interactive
- name: Build packages
run: yarn build
# Continue with publish steps
- name: Set npm credentials
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release' ||
needs.set_release_type.outputs.RELEASE_TYPE == 'nightly'
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.CIRCLE_NPM_TOKEN }}" > ~/.npmrc
- name: Publish NPM
shell: bash
run: |
# The checkout command puts react-native in a folder that is not "safe" for git
# Every git command run in an unsafe folder fails. We need to pick the current commit to use it as part of the version
# The following line marks the folder where react-native lives as "safe"
git config --global --add safe.directory /__w/react-native/react-native
echo "GRADLE_OPTS = $GRADLE_OPTS"
# We can't have a separate step because each command is executed in a separate shell
# so variables exported in a command are not visible in another.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
node ./scripts/releases-ci/publish-npm.js -t ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Zip Maven Artifacts from /tmp/maven-local
working-directory: /tmp
run: zip -r maven-local.zip maven-local
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: maven-local
path: /tmp/maven-local.zip
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.1
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv packages/react-native/$FILENAME build/
echo $FILENAME > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.1
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
with:
name: react-native-package
path: build
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
test_android_helloworld:
runs-on: 4-core-ubuntu
needs: prepare_hermes_workspace
container:
image: reactnativecommunity/react-native-android:latest
env:
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in conatiners
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127
LC_ALL: C.UTF8
YARN_ENABLE_IMMUTABLE_INSTALLS: false
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
TARGET_ARCHITECTURE: "arm64-v8a"
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
architecture: [NewArch, OldArch]
jsengine: [Hermes, JSC]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build CodeGen JS scripts
shell: bash
run: |
cd packages/react-native-codegen
yarn run build
- name: Monitor Disk utilization (before build)
shell: bash
if: always()
run: |
echo "On Runner:"
df -h
echo "Root:"
du -hs *
echo "Projects folder:"
du -hs ./packages/*
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine.
shell: bash
run: |
cd packages/helloworld/android
args=()
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then
args+=(--jsvm jsc)
fi
if [[ ${{ matrix.flavor }} == "Release" ]]; then
args+=(--prod)
fi
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
- name: Monitor Disk utilization (after build)
shell: bash
if: always()
run: |
echo "On Runner:"
df -h
echo "Root:"
du -hs *
echo "Projects folder:"
du -hs ./packages/*
- name: Upload artifact
uses: actions/upload-artifact@v4.3.1
with:
name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }}
path: packages/helloworld/app/build/outputs/apk/
compression-level: 0
test_ios_helloworld_with_ruby_3_2_0:
runs-on: macos-13
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
env:
PROJECT_NAME: iOSTemplateProject
HERMES_WS_DIR: /tmp/hermes
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- uses: ./.github/actions/test_ios_helloworld
with:
ruby-version: 3.2.0
architecture: NewArch
flavor: Debug
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_helloworld:
runs-on: macos-13
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
strategy:
matrix:
flavor: [Debug, Release]
jsengine: [Hermes, JSC]
use_frameworks: [StaticLibraries, DynamicFrameworks]
exclude:
# This config is tested with Ruby 3.2.0. Let's not double test it.
- flavor: Debug
jsengine: Hermes
use_frameworks: StaticLibraries
env:
PROJECT_NAME: iOSTemplateProject
HERMES_WS_DIR: /tmp/hermes
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- uses: ./.github/actions/test_ios_helloworld
with:
flavor: ${{ matrix.flavor }}
jsengine: ${{ matrix.jsengine }}
use-frameworks: ${{ matrix.use_frameworks }}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
+13 -7
View File
@@ -24,7 +24,6 @@ project.xcworkspace
# Gradle
/build/
/packages/react-native-gradle-plugin/build/
/packages/rn-tester/build
/packages/rn-tester/android/app/.cxx/
/packages/rn-tester/android/app/build/
@@ -42,6 +41,10 @@ project.xcworkspace
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
/packages/react-native/template/android/app/build/
/packages/react-native/template/android/build/
/packages/helloworld/android/app/build/
/packages/helloworld/android/build/
/packages/react-native-popup-menu-android/android/build/
/packages/react-native-test-library/android/build/
# Buck
.buckd
@@ -106,6 +109,7 @@ package-lock.json
# Ruby Gems (Bundler)
/packages/react-native/vendor
/packages/react-native/template/vendor
/packages/helloworld/vendor
.ruby-version
/**/.ruby-version
vendor/
@@ -114,6 +118,9 @@ vendor/
/packages/react-native/template/ios/build/
/packages/react-native/template/ios/Pods/
/packages/react-native/template/ios/Podfile.lock
/packages/helloworld/ios/build/
/packages/helloworld/ios/Pods/
/packages/helloworld/ios/Podfile.lock
/packages/rn-tester/Gemfile.lock
/packages/**/RCTLegacyInteropComponents.mm
@@ -139,8 +146,11 @@ vendor/
/packages/react-native/sdks/hermesc
/packages/react-native/sdks/hermes-engine/hermes-engine-from-local-source-dir.tar.gz
# Visual studio
.vscode
# Visual Studio Code (config dir - if present, this merges user defined
# workspace settings on top of react-native.code-workspace)
/.vscode
# Visual Studio
.vs
# Android memory profiler files
@@ -149,9 +159,5 @@ vendor/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# E2E files
/packages/rn-tester-e2e/apps/*.apk
/packages/rn-tester-e2e/apps/*.app
# CircleCI
.circleci/generated_config.yml
+2
View File
@@ -7,3 +7,5 @@
packages/*/dist
vendor
packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
+6
View File
@@ -7,6 +7,12 @@
"trailingComma": "all",
"endOfLine": "lf",
"overrides": [
{
"files": ["*.code-workspace"],
"options": {
"parser": "json"
}
},
{
"files": [
"*.js",
+777
View File
@@ -1,5 +1,669 @@
# Changelog
## v0.74.2
### Changed
- Updated `typescript-eslint` monorepo to `v7`
([91d725136e](https://github.com/facebook/react-native/commit/91d725136e8fe0fd55fdfca5a4f5bd8ab527f94e) by [@huntie](https://github.com/huntie))
- Upgrade CLI to `13.6.8` ([335f6ed833](https://github.com/facebook/react-native/commit/335f6ed83306bfa150c818d26dce4b279de4869f) by [@szymonrybczak](https://github.com/szymonrybczak))
### Fixed
- Warn only in `init` command when CLI uses cached `npx` version ([b98c5b960c](https://github.com/facebook/react-native/commit/b98c5b960ccc4fe9d2792c35994c414c709a3d7a) by [@szymonrybczak](https://github.com/szymonrybczak))
- `selection` prop in `TextInput` was not being applied at component creation ([be09d12667](https://github.com/facebook/react-native/commit/be09d12667044f237f08af410b2838062eb8e657) by [@alanleedev](https://github.com/alanleedev))
#### Android specific
- Fixed dangling `mAttachedSurfaces` after `ReactHost.destroy()` ([c70d791036](https://github.com/facebook/react-native/commit/c70d7910361f56bc361ad825fe13fb2178edfeba) by [@Kudo](https://github.com/Kudo))
- ReactSoftExceptions in ReactHostImpl only when Context is null ([ac3261ff60](https://github.com/facebook/react-native/commit/ac3261ff608768ff43736b413c5a5ad67668af61) by [@arushikesarwani94](https://github.com/arushikesarwani94))
#### iOS specific
- Privacy Manifest aggregation failing due to no `NSPrivacyAccessedAPITypes` key ([fc4e099920](https://github.com/facebook/react-native/commit/fc4e0999206ec7c1f465bb2b1fea987e43485a82) by [@renchap](https://github.com/renchap))
- In privacy manifest post install script, handle the case where the file reference doesn't have a path ([4ad65ac59a](https://github.com/facebook/react-native/commit/4ad65ac59a2491db598abb7b32fb793e9693d5ac) by [@robertying](https://github.com/robertying))
- Fixed an issue where the `selectionColor` prop was not being applied on the `TextInput` component. ([2bde626a9f](https://github.com/facebook/react-native/commit/2bde626a9fa2f782864937a5258ac494afe27f9f) by [@robinshin](https://github.com/robinshin))
## 0.74.1
### Added
#### iOS Specific
- Implement privacy manifest aggregation ([4be1fafec8](https://github.com/facebook/react-native/commit/4be1fafec8edca5da5ebe515ad359d4178db7d23) by [@aleqsio](https://github.com/@aleqsio))
### Changed
- Align debugger Chrome launch flags with Meta-internal version ([93956e267c](https://github.com/facebook/react-native/commit/93956e267cd4f1a77adaa842a55ca6f2d0d1b9c5) by [@motiz88](https://github.com/@motiz88))
- Update "Open Debugger" to print extended Flipper guidance ([261a58761c](https://github.com/facebook/react-native/commit/261a58761c2e7e10cc5cf0a63ed9785e1cdf097c) by [@huntie](https://github.com/@huntie))
- Enable event loop by default when bridgeless is enabled ([b440672468](https://github.com/facebook/react-native/commit/b440672468b6d1d99cd322a4348dd90150703f24) by [@rubennorte](https://github.com/@rubennorte))
- Upgrade `@react-native-community/cli` to 13.6.6 ([58b1f9b2d4](https://github.com/facebook/react-native/commit/58b1f9b2d4f617290a3a535153ff1e93a4672038) by [@szymonrybczak](https://github.com/@szymonrybczak))
#### Android specific
- Support more stubbed methods in `BridgelessCatalystInstance` ([cc1c69799e](https://github.com/facebook/react-native/commit/cc1c69799e284b368e3eaaac0ccd8e238384857f) by [@javache](https://github.com/@javache))
### Fixed
- Reset animation state in TouchableOpacity and TouchableBounce ([165cabb21f](https://github.com/facebook/react-native/commit/165cabb21f2419bde63acb4b52be2f4fb7a2ec2e) by [@sammy-SChttps://github.com/@sammy-]())
- Add missing struct member initialization in Props.h ([13739510fb](https://github.com/facebook/react-native/commit/13739510fb1c2400fbae1df1635fb93dae55abaa) by [@alanleedev](https://github.com/@alanleedev))
#### Android Specific
- Split scheduler commit and flush delegate methods ([ff4b20e823](https://github.com/facebook/react-native/commit/ff4b20e823d2838b3f72e550e7a89daa08551a72) by [@javache](https://github.com/@javache))
- Fixing exposing ReactDelegate through ReactActivity for reload ([7a841dbcd1](https://github.com/facebook/react-native/commit/7a841dbcd1b4eead77827eda2bd307f11babec1f) by [@arushikesarwani94](https://github.com/@arushikesarwani94))
- Fix ReactActivity.getReactDelegate().reload() ([56631cd471](https://github.com/facebook/react-native/commit/56631cd471008c39fe6f771052c3f1af7085bd63) by [@kudo](https://github.com/@kudo))
#### iOS Specific
- Fix Symbol not found: (_JSGlobalContextSetInspectable) which crashed iOS <16.4 with JSC ([0a4d97362f](https://github.com/facebook/react-native/commit/0a4d97362f5a40cff62edce5200c3e7e8622d912) by [@cipolleschi](https://github.com/@cipolleschi))
- Fallback to the first foregroundInactive window when there are no `foregroundActive` windows in RCTKeyWindow ([eaaf865449](https://github.com/facebook/react-native/commit/eaaf865449e6b89cc2794b68f314d01aa775748e) by [@cipolleschi](https://github.com/@cipolleschi))
- Fix enable hermes debugger in Bridgeless mode ([3467f2f3a3](https://github.com/facebook/react-native/commit/3467f2f3a3319cc695bd729a8789c46d15ac8314) by [@Cipolleschi](https://github.com/@Cipolleschi))
- Maintain correct content offset when scroll view is suspended ([305249f964](https://github.com/facebook/react-native/commit/305249f9642da50bf680b1401644eaba9d5dce50) by [@sammy-SChttps://github.com/@sammy-]())
- Avoid calling abstract methods in RCTComposedViewRegistry ([59e7ed5038](https://github.com/facebook/react-native/commit/59e7ed50386cdae8f4a10d9ebc70566b9b36d01c) by [@cipolleschi](https://github.com/@cipolleschi))
- Honor requiresMainQueueSetup in bridgeless mode for ViewManagers ([8813061286](https://github.com/facebook/react-native/commit/88130612864b40adf9001efed9fae2d1ab80b30c) by [@cipolleschi](https://github.com/@cipolleschi))
## 0.74.0
### Breaking
- OnLayout event batching changes ([57e49b584d](https://github.com/facebook/react-native/commit/57e49b584d60a7238b113b255898250a7d03a70d) by [@sammy-SC](https://github.com/sammy-SC))
- Delete traitCast and identifier traits ([1170a68755](https://github.com/facebook/react-native/commit/1170a68755f953c16c85ce784aef476e6970fa7c) by [@NickGerleman](https://github.com/NickGerleman))
- Remove static-behaves-like-relative errata ([56b9b990de](https://github.com/facebook/react-native/commit/56b9b990de1fbe6ee78a5116e404259e849a07a7) by [@joevilches](https://github.com/joevilches))
- Make `start/end` in styles always refer to writing direction ([e859f6c773](https://github.com/facebook/react-native/commit/e859f6c773b85be8945f33e0a64ce042e3b2ab7a) by [@NickGerleman](https://github.com/NickGerleman))
- Remove APIs for reporting bundle download status to inspector-proxy, which does not use this information. ([cfa02eec50](https://github.com/facebook/react-native/commit/cfa02eec50469059542ccbacbc51643b525ad461) by [@motiz88](https://github.com/motiz88))
- Delete `configFilename` and `configKey` arguments from iOS codegen CLI. Now we always expect them to be `package.json` and `codegenConfig` respectively. ([33a44e68fc](https://github.com/facebook/react-native/commit/33a44e68fc4c53d48a4cf6c62337ffd13a0197ab) by [@dmytrorykun](https://github.com/dmytrorykun))
- Add errata for fix to marginStart/End for row-reverse flex direction ([2dad663c28](https://github.com/facebook/react-native/commit/2dad663c2870e0c098649854c8c9333e07be1793) by [@joevilches](https://github.com/joevilches))
- Remove web performance logging from GlobalPerformanceLogger ([53a2742e13](https://github.com/facebook/react-native/commit/53a2742e13f55c3e412bde2ac7b56f6950e44b17) by [@rshest](https://github.com/rshest))
- Rename AbsolutePositioning errata ([08eb985c33](https://github.com/facebook/react-native/commit/08eb985c333bca4fc47c854b51ad84f1353d344c) by [@joevilches](https://github.com/joevilches))
- Refactor React to get rid of JSIModule and its dependencies ([6555205539](https://github.com/facebook/react-native/commit/65552055392a5996bf50548018953875dde4560b) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Get rid of old APIs in FabricUIManagerProvider ([c2c346ccaf](https://github.com/facebook/react-native/commit/c2c346ccaf9912f129b945944575c818eac99a6d) by [@arushikesarwani94](https://github.com/arushikesarwani94))
#### Android specific
- Make bridgeless the default when the New Arch is enabled ([fe337f25be](https://github.com/facebook/react-native/commit/fe337f25be65b67dc3d8d99d26a61ffd26985dd8) by [@cipolleschi](https://github.com/cipolleschi))
- Codegen: mapping for numeric types is changed for Android native modules. `Float` -> `float`; `Int32` -> `int`. ([ccd3b04770](https://github.com/facebook/react-native/commit/ccd3b047709fda00123e8aec4294dce024b80244) by [@dmytrorykun](https://github.com/dmytrorykun))
- Delete ReactInstancePackage ([7141c475bf](https://github.com/facebook/react-native/commit/7141c475bf29652d02d915ff70ebe9af439826f4) by [@mdvacca](https://github.com/mdvacca))
- Delete deprecated method LazyReactPackage.getReactModuleInfoProviderViaReflection ([118e651bc2](https://github.com/facebook/react-native/commit/118e651bc28d089f72e2ea3696ca711f21d7ada6) by [@mdvacca](https://github.com/mdvacca))
- Reduce visibility of CoreModulesPackage class ([30b9b01e68](https://github.com/facebook/react-native/commit/30b9b01e68929b4d0d839c98e91fefe99319ec50) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of DebugCorePackage ([5ad4bdbad8](https://github.com/facebook/react-native/commit/5ad4bdbad8e3cfc33fbec14535c15985d579b7e2) by [@mdvacca](https://github.com/mdvacca))
- Mark NativeModule.onCatalystInstanceDestroy() method as deprecated in new architecture ([b13ea1786f](https://github.com/facebook/react-native/commit/b13ea1786f9e0076654a04daaf9a626559f59194) by [@mdvacca](https://github.com/mdvacca))
- Deprecate CompositeReactPackage from RN Android ([294c0fa208](https://github.com/facebook/react-native/commit/294c0fa208a5eac201c9b9b79dee73a852b62aa8) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactViewManager ([cb46f4cff8](https://github.com/facebook/react-native/commit/cb46f4cff8964a440aedb9ffe9c4ba7fc4a1d930) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactDrawableHelper ([120aab2e99](https://github.com/facebook/react-native/commit/120aab2e995d341e5f620475c7f2beaf61e47f5e) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactTextInputShadowNode ([dc3fc16ce5](https://github.com/facebook/react-native/commit/dc3fc16ce597dd6c24dc5dd26cf1ae9556c76848) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactTextInputLocalData ([b968cb6f97](https://github.com/facebook/react-native/commit/b968cb6f97f6779c9acd037738240b95013fe7ce) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in TextLayoutManagerMapBuffer ([c35dcb3c04](https://github.com/facebook/react-native/commit/c35dcb3c0412eb90121a9f294a049574e80c67c5) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in TextLayoutManager ([4a563f30d2](https://github.com/facebook/react-native/commit/4a563f30d2de89eee1459d8ee79c9ac042a86a96) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in TextAttributeProps ([9454587316](https://github.com/facebook/react-native/commit/94545873169314f04c00fe6e09ad0c1d504635d2) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactTextView ([31e16ee90c](https://github.com/facebook/react-native/commit/31e16ee90c42006b755aa53f0fdf8949f6b16896) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactTextShadowNode ([07e885232b](https://github.com/facebook/react-native/commit/07e885232b409d4a6e2ec48251e4cfba16d2b689) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactTextAnchorViewManager ([b138a4f72d](https://github.com/facebook/react-native/commit/b138a4f72d8d2d58b00437c93fcc8cdd325228b2) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactBaseTextShadowNode ([0505f5c28c](https://github.com/facebook/react-native/commit/0505f5c28c39d746ee19d7ce84bcee49c906f74b) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in StatusBarModule ([6eb4f1e997](https://github.com/facebook/react-native/commit/6eb4f1e997f8412b3dc9238b0068e0db874a6fd2) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in PermissionsModule ([0384e3cf1f](https://github.com/facebook/react-native/commit/0384e3cf1faec1e1cd3782a32cbb3728ac92e06e) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in RequestBodyUtil ([52ec1d87e9](https://github.com/facebook/react-native/commit/52ec1d87e927efb933fade3de2411d3884d00c1b) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in WindowOverlayCompat ([c359a44676](https://github.com/facebook/react-native/commit/c359a44676db917d7fe62b8205ee76653fe529b0) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in DebugOverlayController ([2286c123b7](https://github.com/facebook/react-native/commit/2286c123b7c405a280648ea119c881fd2f97377e) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ReactFragment ([414b25b125](https://github.com/facebook/react-native/commit/414b25b1257804ae7f1d1ae02679bb50d3213140) by [@mdvacca](https://github.com/mdvacca))
- Remove support for Android API < 23 in ([3664b8aa22](https://github.com/facebook/react-native/commit/3664b8aa221bfc232b0f737ea97b2672a5509e35) by [@mdvacca](https://github.com/mdvacca))
- Increase min sdk version of RN Android to 23 ([70fcb1ebf6](https://github.com/facebook/react-native/commit/70fcb1ebf664203ca9934fa12376cfa8a32d373b) by [@mdvacca](https://github.com/mdvacca))
- Rename onCatalystInstanceDestroy -> invalidate ([5f215cdde2](https://github.com/facebook/react-native/commit/5f215cdde2485110b08940f685a8ea31a6327528) by [@mdvacca](https://github.com/mdvacca))
- Implement `getJSCallInvokerHolder()` for Bridgeless Catalyst Instance ([c6076bca97](https://github.com/facebook/react-native/commit/c6076bca974b74b8456806cd06e0c1c63c58aaf9) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `onKeyLongPress` in Bridgeless ([f345fcf3e8](https://github.com/facebook/react-native/commit/f345fcf3e8331b76a72989645bd60b82ba9aa19a) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `onKeyDown` in Bridgeless ([b14f7d58e3](https://github.com/facebook/react-native/commit/b14f7d58e3537b9bfa2638d1d71ec3dc908f4b8d) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `onConfigurationChanged` in Bridgeless ([b2e1db0fbf](https://github.com/facebook/react-native/commit/b2e1db0fbf845c48878c4a0ea9cb5755a85a6f0e) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `onNewIntent` in Bridgeless ([5d711f83b5](https://github.com/facebook/react-native/commit/5d711f83b5f1e8053b5b19d0a864a1d8fc27a235) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `onWindowFocusChange` in Bridgeless ([7b40c8ee5f](https://github.com/facebook/react-native/commit/7b40c8ee5fc4073cdf83060cf81e16fa282899ee) by [@arushikesarwani94](https://github.com/arushikesarwani94))
#### iOS specific
- Removing unused `handler` param on PushNotificationIOS.removeEventListener ([fdf4ec3297](https://github.com/facebook/react-native/commit/fdf4ec32975eeec41e0b4b8145c4e45798c82607))
- Make bridgeless the default when the New Arch is enabled ([c91af773fa](https://github.com/facebook/react-native/commit/c91af773fa2fafdc0fb8e19ccf503ee203efe0c5) by [@cipolleschi](https://github.com/cipolleschi))
- CocoaPods: remove the `ios_folder` argument from the `use_react_native` function. ([be0c353e18](https://github.com/facebook/react-native/commit/be0c353e18da3a0996f6e2fd3fecbe3852d3d240) by [@dmytrorykun](https://github.com/dmytrorykun))
- Codegen: mapping for numeric types is changed for Objective-C native modules. `Float` -> `float`; `Int32` -> `NSInteger`. ([5aa425c086](https://github.com/facebook/react-native/commit/5aa425c0867e1e737cce9b7de9752cd9518b95ac) by [@dmytrorykun](https://github.com/dmytrorykun))
- Defining external codegen targets in `react-native.config.js` is not supported anymore. Define them as normal dependencies in `package.json`. ([ca39a11b27](https://github.com/facebook/react-native/commit/ca39a11b27bf9f90c3a792974910bb9060b2990f) by [@dmytrorykun](https://github.com/dmytrorykun))
- Delete configFileDir CLI argument. ([8a62d6135f](https://github.com/facebook/react-native/commit/8a62d6135f5ac8c01aa8103ddd91f94973dd6cd3) by [@dmytrorykun](https://github.com/dmytrorykun))
- ([072a2006e0](https://github.com/facebook/react-native/commit/072a2006e0bd8bd8cc9a75385cc03759bcf63c61) by [@philIip](https://github.com/philIip))
- Remove some usages of RCT_NEW_ARCH_ENABLED. The change should be transparent BUT some **Swift** libraries might get broken by this change. ([951efc8ce2](https://github.com/facebook/react-native/commit/951efc8ce2a6d34aa6df6d1ad205db2661143855) by [@cipolleschi](https://github.com/cipolleschi))
- You cannot call methodQueue on RCTHTTPRequestHandler ([7503dbd784](https://github.com/facebook/react-native/commit/7503dbd7849dddbc235b42eb75be0f446bd9cf62) by [@philIip](https://github.com/philIip))
- RepeatInterval is deprecated in PushNotificationIOS. Use fireDate and the new fireIntervalSeconds. ([a1299938a9](https://github.com/facebook/react-native/commit/a1299938a9fae9cc5b7a2dd49ab6dcb82001d5ef))
- AlertAction is deprecated in PushNotificationIOS. getScheduledLocalNotifications now uses new iOS APIs which do not expose this property. ([9f4d66d283](https://github.com/facebook/react-native/commit/9f4d66d283905fe04900b012c58e43f5f0f2955d))
- Make TextInput.onContentSizeChange a direct event ([744fb4a0d2](https://github.com/facebook/react-native/commit/744fb4a0d23d15a40cd591e31f6c0f6cb3a7f06b) by [@sammy-SC](https://github.com/sammy-SC))
- Remove the Flipper integration ([899e7cdb55](https://github.com/facebook/react-native/commit/899e7cdb55197fc17a96a93af4f8bcc7519553c2) by [@cipolleschi](https://github.com/cipolleschi))
- Deleted the no-op didRegisterUserNotificationSettings: callback in RCTPushNotificationManager ([3bea8e1bd4](https://github.com/facebook/react-native/commit/3bea8e1bd41cf019bcd01acaef8256e2b3dbd742))
### Added
- Experimental macro to autolink C++ turbomodules ([01d704dd45](https://github.com/facebook/react-native/commit/01d704dd459a05208153d41e512f8be6af924ca3) by [@philIip](https://github.com/philIip))
- Added a folder inside the `exclude` array inside `tsconfig` ([40bb425f48](https://github.com/facebook/react-native/commit/40bb425f48a65641b4882c08cf84be123b333bd6) by [@bartlomein](https://github.com/bartlomein))
- Gradle plugin for resolving node_modules packages. ([8456ccad78](https://github.com/facebook/react-native/commit/8456ccad78dab2b0982439f8f45ea1242eb90908) by [@robhogan](https://github.com/robhogan))
- Added missing typings for fontVariant style prop. ([8fca1c5854](https://github.com/facebook/react-native/commit/8fca1c58542a560d99adaf1408733ef95cc17797) by [@ankit-tailor](https://github.com/ankit-tailor))
- Added missing typings for fontWeight style prop. ([fb5f79ceb5](https://github.com/facebook/react-native/commit/fb5f79ceb5ececc0ae7f22fa933eca0ac64f3e70) by [@ankit-tailor](https://github.com/ankit-tailor))
- Enable setNativeProps in animations in the New Architecture ([a5aed1294f](https://github.com/facebook/react-native/commit/a5aed1294f91cfc58e20439ce8eee5a183f899d6) by [@sammy-SC](https://github.com/sammy-SC))
- Fix flooring of border ([e27452a670](https://github.com/facebook/react-native/commit/e27452a670c45f4c919c9d46e08145723a2235a0) by [@NickGerleman](https://github.com/NickGerleman))
- Add Yarn files to `.gitignore` in template ([965f2eb1fb](https://github.com/facebook/react-native/commit/965f2eb1fb4d8e9a6bf730925658f3a6baf50654) by [@szymonrybczak](https://github.com/szymonrybczak))
- Fix missing assignment in Node move constructor ([90df90efca](https://github.com/facebook/react-native/commit/90df90efca35612be27049f7dba9650a289c12e3) by [@NickGerleman](https://github.com/NickGerleman))
- Introduce "npx react-native codegen" command. ([a612053510](https://github.com/facebook/react-native/commit/a612053510847b7c41135a88db2dcd11d44fa77f) by [@dmytrorykun](https://github.com/dmytrorykun))
- Introduce the "platform" option to generate-codegen-artifacts.js ([7b10609276](https://github.com/facebook/react-native/commit/7b1060927690d48302dfdcb99bf8c651fd137871) by [@dmytrorykun](https://github.com/dmytrorykun))
- Introduce "headerPrefix" codegen option. ([dae4a11e90](https://github.com/facebook/react-native/commit/dae4a11e901696f7c205e19df6f0b306319be43a) by [@dmytrorykun](https://github.com/dmytrorykun))
- Introduce "codegenConfig.includesGeneratedCode" property. ([21784e2ce5](https://github.com/facebook/react-native/commit/21784e2ce5dbf361511a77e9546c8839321e5b74) by [@dmytrorykun](https://github.com/dmytrorykun))
- Introduce "outputDir" property of "codegenConfig" ([d45a01d6d1](https://github.com/facebook/react-native/commit/d45a01d6d15530e356065704adb869b1cbbb2576) by [@dmytrorykun](https://github.com/dmytrorykun))
- Fix issues with aligning absolute nodes ([31005b7fd9](https://github.com/facebook/react-native/commit/31005b7fd9a9579920b55f921c477a90fb3f6d10) by [@joevilches](https://github.com/joevilches))
- Fix bug with align start not taking into account parent padding ([ea3dd6b4f2](https://github.com/facebook/react-native/commit/ea3dd6b4f2ecaac79476796ed2a11fe198299506) by [@joevilches](https://github.com/joevilches))
- Fix issue where percentages were off of the border box, not padding box ([e826d1c336](https://github.com/facebook/react-native/commit/e826d1c33695c9901e1070d7dd7231de4e79a8d4) by [@joevilches](https://github.com/joevilches))
- New file for layout methods related to absolute children ([0cc09f207f](https://github.com/facebook/react-native/commit/0cc09f207fc93b18e25cce3fed568647e8ad896f) by [@joevilches](https://github.com/joevilches))
- Fix issue where start/end would not be respected in flex edge getters ([aa31c6cd75](https://github.com/facebook/react-native/commit/aa31c6cd754ca798c879bd04f955d72051906f95) by [@joevilches](https://github.com/joevilches))
- Added JSI method for reporting native memory to the GC. ([cfe129c832](https://github.com/facebook/react-native/commit/cfe129c8329ef62c7fcd3ed25c17656b0e218d95) by [@neildhar](https://github.com/neildhar))
- Allowing `cursorColor` and `selectionHandleColor` to override `selectionColor` on Android ([1e68e48534](https://github.com/facebook/react-native/commit/1e68e48534aedf1533327bf65f26e5cf5b80127b) by [@jakex7](https://github.com/jakex7))
- Introduce APIs for FabricUIManager ([16fb64a9ef](https://github.com/facebook/react-native/commit/16fb64a9ef97e7ff0b8fe718d310705fa5fe6066))
- Missing typings for the props `tabIndex` for **View** and `userSelect` in the **Text** props were added. ([b36505bf06](https://github.com/facebook/react-native/commit/b36505bf06d023472f5bee5b3b0a6db4e1ca428f) by [@wootsbot](https://github.com/wootsbot))
- Turbo Modules Promise-returning functions reject with JS and platform stack traces information ([7612e6601a](https://github.com/facebook/react-native/commit/7612e6601a1c402c548dfe2fe548b1c481659993) by [@krystofwoldrich](https://github.com/krystofwoldrich))
- Bindings for `alignContent: "space-evenly"` ([c9d0a006fd](https://github.com/facebook/react-native/commit/c9d0a006fd14b428b844a68e73a57986a4abb3b1) by [@NickGerleman](https://github.com/NickGerleman))
- Support "align-content: space-evenly" ([d66ab59570](https://github.com/facebook/react-native/commit/d66ab59570a4d7542aea595e2dad4a0b5d0654d3) by [@nicoburns](https://github.com/nicoburns))
- Rename ambiguous leading/trailingEdge functions ([594b586c7d](https://github.com/facebook/react-native/commit/594b586c7d6e90658cc72423d4cf77c4c9d68b9a) by [@joevilches](https://github.com/joevilches))
- JSC support for the NativeState API in JSI ([7b7f128968](https://github.com/facebook/react-native/commit/7b7f128968310c466ce0a929e9964b08fe098503) by [@javache](https://github.com/javache))
- Fixed issue with first line element gap handling. ([c7c7831ec6](https://github.com/facebook/react-native/commit/c7c7831ec64da0a5e31d90c3fa1730e4bee87265) by [@jlmip](https://github.com/jlmip))
- Add onPress prop to TextInput ([8e36cc0293](https://github.com/facebook/react-native/commit/8e36cc02931d121832ed89efb02092125a728315))
- Cxx TurboModules > Add example to return a JS function from Cxx to JS ([9320174df4](https://github.com/facebook/react-native/commit/9320174df4239058125b8876a0623230f6e03b02) by [@christophpurrer](https://github.com/christophpurrer))
- Adding getFabricUIManager() APIs to ReactContext ([f941f939bf](https://github.com/facebook/react-native/commit/f941f939bfea5a5619ecabe6a0d401037e8df6f1))
- Warn with future command when using `npx react-native init` ([a6397afb7f](https://github.com/facebook/react-native/commit/a6397afb7f4279e70afa025fe6f9fa0b8e3de3fd) by [@byCedric](https://github.com/byCedric))
- Add inspector proxy `nativeNetworkInspection` target capability flag ([f3ce7cd76e](https://github.com/facebook/react-native/commit/f3ce7cd76ee4f1772e2623c87b21bbbcb1edbc27) by [@byCedric](https://github.com/byCedric))
- Add inspector proxy device message middleware API ([3f41fb5d5b](https://github.com/facebook/react-native/commit/3f41fb5d5b5dfd6d69b00e104f9eb05b98671fa6) by [@byCedric](https://github.com/byCedric))
- Fallback to query parameter based `user-agent` when header is unset ([c62be78d99](https://github.com/facebook/react-native/commit/c62be78d99939e33b5b2bc3cee5be2a030f0640b) by [@byCedric](https://github.com/byCedric))
- Added @types/react as an optional peerDependency ([dbf8e3f5ba](https://github.com/facebook/react-native/commit/dbf8e3f5ba8636560898803f5c5973432bf61d1e) by [@acoates-ms](https://github.com/acoates-ms))
- Implement `getJavaScriptContextHolder()` for Bridgeless Catalyst Instance ([b72f5e9982](https://github.com/facebook/react-native/commit/b72f5e9982525712f0fd845979ce7142c5de3098) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement `getRuntimeExecutor()` for Bridgeless Catalyst Instance ([6a5aaad9e0](https://github.com/facebook/react-native/commit/6a5aaad9e0a7dfe001e75054f0d1b1731aa9e19e) by [@arushikesarwani94](https://github.com/arushikesarwani94))
#### Android specific
- ([315be8290d](https://github.com/facebook/react-native/commit/315be8290d6c6524289abc9cf201f32a56e72c13) by [@philIip](https://github.com/philIip))
- Introduce native api to access RuntimeExecutor ([d7dce975f9](https://github.com/facebook/react-native/commit/d7dce975f91255c6383f9cc6d3b8f818f6e0420b) by [@philIip](https://github.com/philIip))
- Added `onUserLeaveHint` support into `ReactActivityDelegate` ([3b6c522942](https://github.com/facebook/react-native/commit/3b6c522942ca1b3d3f5e2115e0a4e781063747d0) by [@behenate](https://github.com/behenate))
- Introduce PopupMenuAndroid to replace UIManager.showPopupMenu() ([35308a73a5](https://github.com/facebook/react-native/commit/35308a73a5e0f69bf32d687be52a8f739fbf2e50) by [@RSNara](https://github.com/RSNara))
- Added `removeAllViews` to IViewGroupManager. ([3cd85dc933](https://github.com/facebook/react-native/commit/3cd85dc9331fee18ecbe1d0eb4f0f217fc803070) by [@javache](https://github.com/javache))
- The public API of Modal has changed. We don't have anymore a NativeModalManger turbomodule; RCTModalHostViewNtiveComponent's Prop does not require to pass an identifier anymore. ([314cfa8c91](https://github.com/facebook/react-native/commit/314cfa8c9108581e027b71139c005ab3385acf1e) by [@bernhardoj](https://github.com/bernhardoj))
- Fix static view config not to filter out "onClick" events on Android ([342041e9ee](https://github.com/facebook/react-native/commit/342041e9ee0f4c72b70a19f290a79040c200f859) by [@rshest](https://github.com/rshest))
- ReactChoreographer can now use an implementation substitution instead of relying on android.view.Choreographer directly. ([37e509f2b6](https://github.com/facebook/react-native/commit/37e509f2b695818d19358fcd3eaf8fa0452adce3) by [@nlutsenko](https://github.com/nlutsenko))
- ReactChoreographer can now use an implementation substitution instead of relying on android.view.Choreographer directly. ([751f7e97ba](https://github.com/facebook/react-native/commit/751f7e97ba299eb8f06231126df0a7ecbc41d607) by [@nlutsenko](https://github.com/nlutsenko))
- Expose ReactDelegate in ReactActivity ([62ebe557b8](https://github.com/facebook/react-native/commit/62ebe557b8efbfb025f6187ef08a9c2223f4f3c3) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Support reload() in ReactDelegate ([d97741af60](https://github.com/facebook/react-native/commit/d97741af60e3af598d71894800d928b61c5782b4) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Implement multiple view manager lookup for the interop layer ([15a5638c62](https://github.com/facebook/react-native/commit/15a5638c621cbec4a9fcb5ae94938120cdc32fae) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Copy boost headers needed by `rrc_text` and `rrc_textinput` ([ad9f0b0ab8](https://github.com/facebook/react-native/commit/ad9f0b0ab88218beb214859e0d85d50f9caa7bb5) by [@j-piasecki](https://github.com/j-piasecki))
#### iOS specific
- Add error message if codegen has not run properly ([10edb9f545](https://github.com/facebook/react-native/commit/10edb9f545e3b043ed0316933f8e96509934e3a4) by [@cipolleschi](https://github.com/cipolleschi))
- ([16276ce0f6](https://github.com/facebook/react-native/commit/16276ce0f6115fd4decaccaf33cf3364bbd2d469) by [@philIip](https://github.com/philIip))
- Allow libraries to provide module which conforms to protocols meant to be extension points. ([46d7f8a669](https://github.com/facebook/react-native/commit/46d7f8a66925ebfad9c8474028fcb69e9735def4) by [@cipolleschi](https://github.com/cipolleschi))
- Add nullable annotations to RCTBundleURLProvider ([12e4a5745d](https://github.com/facebook/react-native/commit/12e4a5745d54a7be86c005e4ed954c42171541b2) by [@okwasniewski](https://github.com/okwasniewski))
- Remove unused getHeight method from StatusBar ([3dfedbc1ae](https://github.com/facebook/react-native/commit/3dfedbc1aec18a4255e126fde96d5dc7b1271ea7) by [@okwasniewski](https://github.com/okwasniewski))
- Introduce native api to access RuntimeExecutor ([343a0d3cd8](https://github.com/facebook/react-native/commit/343a0d3cd82770bcb00bad30fdf353acf148057a) by [@philIip](https://github.com/philIip))
- Make codegen take OOT Apple platforms into account ([ebb2b9c3fc](https://github.com/facebook/react-native/commit/ebb2b9c3fce227135f437bd86db71125eebcf21f) by [@okwasniewski](https://github.com/okwasniewski))
- Introduce `vision` interfaceIdiom ([258d8e51b4](https://github.com/facebook/react-native/commit/258d8e51b451b221e557dad4647cbd210fe37392) by [@okwasniewski](https://github.com/okwasniewski))
- Provide better Swift types for RCTAppDelegate and RCTBridgeDelegate ([a7c5c2821c](https://github.com/facebook/react-native/commit/a7c5c2821c39a7bf653919353897d27d29a64068) by [@okwasniewski](https://github.com/okwasniewski))
- Add `shouldBeRecycled` method on `iOS`. ([613a5a7597](https://github.com/facebook/react-native/commit/613a5a75977d84333df7cbd5701e01a7ab5a3385) by [@WoLewicki](https://github.com/WoLewicki))
- Added the `RCTIsNewArchEnabled()` to check whether the New Arch is enabled at runtime. ([f1a7f08feb](https://github.com/facebook/react-native/commit/f1a7f08feb2a63926e91d37b5d85130c7b74ee31) by [@cipolleschi](https://github.com/cipolleschi))
- Added the customiseRootView method which is called in both bridge and bridgeless. Added also a warning for 0.74 with instructions on how to migrate. ([db9c9eacac](https://github.com/facebook/react-native/commit/db9c9eacac301c4a684130413423eab50bbb1d72) by [@cipolleschi](https://github.com/cipolleschi))
- Added better support for `ccache`, to speed up subsequent builds of native code. After installing `ccache` and running `pod install`, the Xcode project is injected with compiler and linker build settings pointing scripts that loads a default Ccache configuration and invokes the `ccache` executable. ([e85d51c6f1](https://github.com/facebook/react-native/commit/e85d51c6f161c709706044c5955ac5397e746fa1) by [@kraenhansen](https://github.com/kraenhansen))
- Add use of the `REACT_NATIVE_PATH` in the "Bundle React Native code and images" shell script build phase. This will help apps initialized into a mono-repo which hoists the `react-native` package. ([289e78388a](https://github.com/facebook/react-native/commit/289e78388a87408e215a25108cb02511a05f5c80) by [@kraenhansen](https://github.com/kraenhansen))
- Support "highlighting updates when components render" feature from React DevTools ([758e59f1d9](https://github.com/facebook/react-native/commit/758e59f1d9752cf051b2dee900c5182ee52c4189) by [@hoxyq](https://github.com/hoxyq))
- ([e9ecc65652](https://github.com/facebook/react-native/commit/e9ecc656528ec54e93a9bcd43e39e0b6888a6ed5) by [@philIip](https://github.com/philIip))
- Make build-hermes-xcode.sh more extensible for out-of-tree platforms ([7bcfd02a60](https://github.com/facebook/react-native/commit/7bcfd02a60667e74041c8172e5499cfc75759da1) by [@okwasniewski](https://github.com/okwasniewski))
- Add console.log notification in DevTools if app transitions between back/foreground. ([05967e471e](https://github.com/facebook/react-native/commit/05967e471e52512bb52108bd821edad824c98705) by [@blakef](https://github.com/blakef))
- Add TypeScript typings for the `dismissActionSheet` function in `ActionSheetIOS`. ([89c7be890b](https://github.com/facebook/react-native/commit/89c7be890b0dcef72e465b70314ac47ca5ca0280) by [@LRNZ09](https://github.com/LRNZ09))
- Add support for `Platform.isMacCatalyst` ([027d520d65](https://github.com/facebook/react-native/commit/027d520d657ab0c3dd30913c589692a496ad36da) by [@jacobp100](https://github.com/jacobp100))
- Warn users during "pod install" if XCode is too old ([1021448d7c](https://github.com/facebook/react-native/commit/1021448d7cf462d5280ce82f484f029fd29e40a6) by [@NickGerleman](https://github.com/NickGerleman))
- Allow the activityIndicator to be controlled from JS in bridgeless mode ([9aeb9f2f94](https://github.com/facebook/react-native/commit/9aeb9f2f94536155c2f1e1c815e0b5fa18a2b9f3) by [@cipolleschi](https://github.com/cipolleschi))
- Implement cursor style prop ([73664f576a](https://github.com/facebook/react-native/commit/73664f576aaa472d5c8fb2a02e0ddd017bbb2ea4) by [@Saadnajmi](https://github.com/Saadnajmi))
- Add privacy manifest to pod install ([d39712f54a](https://github.com/facebook/react-native/commit/d39712f54a95e6dcdf1d2f80d9581211ab03c157) by [@philIip](https://github.com/philIip))
- Add privacy manifest to hello world template ([520d120375](https://github.com/facebook/react-native/commit/520d120375c6b24bc161adea4f48d76537a34abc) by [@philIip](https://github.com/philIip))
### Changed
- Upgrade `@react-native-community/cli` to 13.6.4 ([4f50089da2](https://github.com/facebook/react-native/commit/4f50089da2e9d96c8b986c3b359a542537d34d3a) by [@szymonrybczak](https://github.com/szymonrybczak))
#### iOS specific
- Bump CLI to 13.6.0 ([c99d96b7a1](https://github.com/facebook/react-native/commit/c99d96b7a1a4dc905ce642966633b4d3c78bd3c9) by [@szymonrybczak](https://github.com/szymonrybczak))
- CodegenNativeComponent show warning and not error if not code generated at build time. ([de5619ed8c](https://github.com/facebook/react-native/commit/de5619ed8cf4a07d9a23a7714e25611e970ed46e) by [@dmytrorykun](https://github.com/dmytrorykun))
- Make template's .gitignore file universal for OOT platforms ([c5f48ac612](https://github.com/facebook/react-native/commit/c5f48ac61279d9af12d7aea0b0a6177ce5f54397) by [@okwasniewski](https://github.com/okwasniewski))
- Sync React renderers to 18.3.0-canary-03d6f7cf0-20240209 ([3272b05c3d](https://github.com/facebook/react-native/commit/3272b05c3d148a814e8639e2b9784d5190f4feea) by [@sammy-SC](https://github.com/sammy-SC))
- React@18.3.0-canary-b2d637128-20240123 ([29df29f5e2](https://github.com/facebook/react-native/commit/29df29f5e297ea46543303c28f2487dba53e243f) by [@sammy-SC](https://github.com/sammy-SC))
- Changed community cli plugin homepage url. ([6f7e8e17e2](https://github.com/facebook/react-native/commit/6f7e8e17e28c73ba5511332bcdd8abf4122de7f6) by [@hoonjoo-park](https://github.com/hoonjoo-park))
- Bump CLI to 13.5.1 ([78967b33c0](https://github.com/facebook/react-native/commit/78967b33c0562a07ff7b38c48056532cbf9321b4) by [@szymonrybczak](https://github.com/szymonrybczak))
- Update API docs for scrollEventThrottle ([3ea0598341](https://github.com/facebook/react-native/commit/3ea059834145c48d2f9d4a8ecdf73adfaf0c684e) by [@NickGerleman](https://github.com/NickGerleman))
- Updated Pressability/usePressability Docblocks ([0fd7bd3a7f](https://github.com/facebook/react-native/commit/0fd7bd3a7f62b72f70da42608ff933a9fb1a63d9) by [@yungsters](https://github.com/yungsters))
- Bump folly version to 2024.01.01.00 ([cfeb43eaa2](https://github.com/facebook/react-native/commit/cfeb43eaa2fa99454de67c88a3a461de6ebdfe88) by [@Kudo](https://github.com/Kudo))
- Update monorepo dependency versions to remove ^ ([6e5bc33b3c](https://github.com/facebook/react-native/commit/6e5bc33b3c9cd0ce2c30c7689982c6fb16ef4e3b) by [@lunaleaps](https://github.com/lunaleaps))
- Be explicit about what monorepo versions we are using ([b5e08e80d9](https://github.com/facebook/react-native/commit/b5e08e80d90b6d03d1f49f0674c01f03ee300c46) by [@lunaleaps](https://github.com/lunaleaps))
- Bump CLI to v13.0.0 ([6e88d67b8c](https://github.com/facebook/react-native/commit/6e88d67b8c4631431bd04c1a23ae7cb520b9c0bd) by [@thymikee](https://github.com/thymikee))
- Fix issue where we were not applying flex end correctly when justifying ([579ef2b3fb](https://github.com/facebook/react-native/commit/579ef2b3fbeb2b475ea9c6d426b1e84a964c25f1) by [@joevilches](https://github.com/joevilches))
- Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. ([5abaf388cd](https://github.com/facebook/react-native/commit/5abaf388cde499747e81ecb73aa01fa819dbbd47) by [@motiz88](https://github.com/motiz88))
- Fix issue where absolute children of row-reverse containers would inset on the wrong side ([9847bcab51](https://github.com/facebook/react-native/commit/9847bcab514142d9132dca36544fc7628ddbf437) by [@joevilches](https://github.com/joevilches))
- Upgrade CLI to v12.0.0 ([d077239fff](https://github.com/facebook/react-native/commit/d077239fff600d41d093dfeca87f6744bd7f1cd3) by [@szymonrybczak](https://github.com/szymonrybczak))
- Apply Babel arrow transform only on non-Hermes ([9a3b75c782](https://github.com/facebook/react-native/commit/9a3b75c7824e1b8896ffc4f05c3386587513f2be) by [@gaearon](https://github.com/gaearon))
- Update Metro to ^v0.80.0, stop pinning to an exact version ([7853b06929](https://github.com/facebook/react-native/commit/7853b06929ea6186dbc5923393b5521c2d6ae09d) by [@robhogan](https://github.com/robhogan))
- Use ImageRequireSource instead of number for the defaultSource prop typing of the Image component ([2be1c71cb7](https://github.com/facebook/react-native/commit/2be1c71cb7be18906c89ab8706551ce260f77f51) by [@ellouzeskandercs](https://github.com/ellouzeskandercs))
- Gate new debugger frontend behind `--experimental-debugger` flag, restore Flipper as base launch flow ([9e068ac163](https://github.com/facebook/react-native/commit/9e068ac163db057cc76bac2caba76136d19bcf49) by [@huntie](https://github.com/huntie))
- Make layout events top-down on Android classic renderer ([25478321f9](https://github.com/facebook/react-native/commit/25478321f9d88730d006221a90f5d84f32d3ffcd) by [@NickGerleman](https://github.com/NickGerleman))
- UIManagerModule: Make reactTags required ([fafd00ab1a](https://github.com/facebook/react-native/commit/fafd00ab1ad8e78fb0b992f5ce1b35211d4089ee) by [@RSNara](https://github.com/RSNara))
- Make ImageManager implementation overridable ([ac1cdaa716](https://github.com/facebook/react-native/commit/ac1cdaa71620d5bb4860237cafb108f6aeae9aef) by [@rshest](https://github.com/rshest))
- Share ImageRequest implementation across the platforms ([7625a50296](https://github.com/facebook/react-native/commit/7625a502960e6b107e77542ff0d6f40fbf957322) by [@rshest](https://github.com/rshest))
- Support for (de)serializing config values ([e1afa023aa](https://github.com/facebook/react-native/commit/e1afa023aa434cf8df5af70e85d6352e1abe7ca0) by [@joevilches](https://github.com/joevilches))
- Fix mismatched cases of inlineStart/End and flexStart/End ([64d81905ac](https://github.com/facebook/react-native/commit/64d81905acbdbef01f9bc5818a20367917372be4) by [@joevilches](https://github.com/joevilches))
- Replace CompactValue with StyleValueHandle and StyleValuePool ([92b889b89e](https://github.com/facebook/react-native/commit/92b889b89e92bb52ba2d6868bf6de4d7c3972368) by [@NickGerleman](https://github.com/NickGerleman))
- Simplify Edge Resolution ([40c4552d02](https://github.com/facebook/react-native/commit/40c4552d0227ba5d213139c3c4e0b88743b7b4e1) by [@NickGerleman](https://github.com/NickGerleman))
- Make position static behave like position static ([475036d2cd](https://github.com/facebook/react-native/commit/475036d2cd9852335da5c22a67700e9243b35024) by [@joevilches](https://github.com/joevilches))
- Make positionAbsoluteChild the sole place that matters when determining absolute node's position ([6025d50925](https://github.com/facebook/react-native/commit/6025d50925b4e35b3bdfb2165e6466862544865c) by [@joevilches](https://github.com/joevilches))
- Introduce positionAbsoluteChild ([7459529ee4](https://github.com/facebook/react-native/commit/7459529ee46cf4a9aaa3251887bf67dbc1fa3f7f) by [@joevilches](https://github.com/joevilches))
- Use containing block to adjust absolute child position ([a48e0d590e](https://github.com/facebook/react-native/commit/a48e0d590e9e62caf14cc833d3abf41e5882b571) by [@joevilches](https://github.com/joevilches))
- Allow the containing block to set trailing position of absolute descendants ([43ab5fe38c](https://github.com/facebook/react-native/commit/43ab5fe38ccc8a5eaa6d885b216cc45d0a9c833d) by [@joevilches](https://github.com/joevilches))
- Let containing blocks layout their absolute descendants, not parents ([33d6a59bea](https://github.com/facebook/react-native/commit/33d6a59bea4cdc2eea116786267b4768277731c8) by [@joevilches](https://github.com/joevilches))
- Insets no longer apply to statically positioned nodes ([e48da2aff3](https://github.com/facebook/react-native/commit/e48da2aff33b5d7831e0946b6e492b849de43344) by [@joevilches](https://github.com/joevilches))
- Change default back to `position: "relative"` ([88a55baeaa](https://github.com/facebook/react-native/commit/88a55baeaaa68619d815f53a51e32edb937e291f) by [@NickGerleman](https://github.com/NickGerleman))
- Remove NumericBitfield ([9078db77a9](https://github.com/facebook/react-native/commit/9078db77a900aa417c3cdf6e8e5b4217061cc442) by [@NickGerleman](https://github.com/NickGerleman))
- Introduce isDefined() and remove cases of !isUndefined() ([3b13d3c7d0](https://github.com/facebook/react-native/commit/3b13d3c7d0ff128f766e37b630687eb52a2cce5a) by [@joevilches](https://github.com/joevilches))
- Simplify getting padding + border for cross axis in algorithm ([1984bcc0c1](https://github.com/facebook/react-native/commit/1984bcc0c100fe24ad4d44e4bb61d8f288c1d40c) by [@joevilches](https://github.com/joevilches))
- Add errata supporting changes to position: static ([60297d50dc](https://github.com/facebook/react-native/commit/60297d50dcb4a97d4d4d68f46047288014df5b79) by [@joevilches](https://github.com/joevilches))
- Fix issue where position insets were not working with row reverse ([25575e57cb](https://github.com/facebook/react-native/commit/25575e57cb430bfb1e237bbe1700c2f67846f374) by [@joevilches](https://github.com/joevilches))
- Build with MSVC /W4 ([8eb0617d95](https://github.com/facebook/react-native/commit/8eb0617d95e709ed88e36a2b0eb52d8fbea331b8) by [@NickGerleman](https://github.com/NickGerleman))
- Rename ambiguous getLeading/Trailing... functions in Node.cpp ([ef32905172](https://github.com/facebook/react-native/commit/ef32905172aa7b559d9a677751260fd5898e5b97) by [@joevilches](https://github.com/joevilches))
- FloatOptional GCC build fix and more constexpr ([5e5019c723](https://github.com/facebook/react-native/commit/5e5019c723db9eba5271845361e0cd46f088deab) by [@NickGerleman](https://github.com/NickGerleman))
- Make all annotation processors derive from ProcessorBase ([fea445ee2d](https://github.com/facebook/react-native/commit/fea445ee2dfa1bf64b99f7bc1e12be0a8bcd7e71) by [@ianlevesque](https://github.com/ianlevesque))
- Remove usage of Gutters arrays and YGGutter as index ([4da0d44e55](https://github.com/facebook/react-native/commit/4da0d44e55485bf622aae85a6b7a92e342f3eaf2) by [@NickGerleman](https://github.com/NickGerleman))
- Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE ([f7644be6d4](https://github.com/facebook/react-native/commit/f7644be6d4d79b72c26f740cf5ac021dfd5fedc0) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Kotlin to 1.9.22 ([3c2b2b181c](https://github.com/facebook/react-native/commit/3c2b2b181c593f48a870d6d2211875590aa3da29) by [@cortinico](https://github.com/cortinico))
- Android NDK to 26.1 ([5f75e9b90d](https://github.com/facebook/react-native/commit/5f75e9b90d4f998403101ae92924778df31d36fb) by [@cortinico](https://github.com/cortinico))
- Fix "Show Perf Monitor" crash in Catalyst ([6f115110c4](https://github.com/facebook/react-native/commit/6f115110c4bc7c44f84446304cc5b658a5d9449a))
- Fix dev menu not open for Bridgeless ([e4887a587a](https://github.com/facebook/react-native/commit/e4887a587a51478dc0302701f48675e8f7175b72))
- NetworkingModuleTest.java -> NetworkingModuleTest.kt ([852f2b1758](https://github.com/facebook/react-native/commit/852f2b17587c0998ba2c5b1bfa44a2ce59239cff) by [@KrzysztofMoch](https://github.com/KrzysztofMoch))
- Integrate binary-compatibility-validator into RN Android build system ([e9b80971c7](https://github.com/facebook/react-native/commit/e9b80971c7f510d7101998a7985e871481dc1bc6) by [@mdvacca](https://github.com/mdvacca))
- Use null to signal a missing TurboModule instead of IllegalArgumentException. ([228193dad5](https://github.com/facebook/react-native/commit/228193dad5369cdb5e13ba8a926e0ab9d12429e7) by [@javache](https://github.com/javache))
- Fix backward compatibility breakage ([1891d9e647](https://github.com/facebook/react-native/commit/1891d9e6470ef90dcfcf27ce05944737c235310e) by [@mdvacca](https://github.com/mdvacca))
- Continuation of PR: 36263 ([a337f6eda7](https://github.com/facebook/react-native/commit/a337f6eda71424e2eaa765aabef2a932bfac221f) by [@ricku44](https://github.com/ricku44))
- Bridgeless: Add support for legacy UIManager in UIManagerHelper ([10c3292694](https://github.com/facebook/react-native/commit/10c32926949aa5c6432be2d949d8412af5c3a1f2))
- Fall back to eager view manage loading for Bridgeless ([6b3289bc73](https://github.com/facebook/react-native/commit/6b3289bc731eb5c4855dbd349d926fa2e4e3595b))
- Ensure namespace is specified for all the 3rd party libraries ([13ae11152a](https://github.com/facebook/react-native/commit/13ae11152a51444c0d8494faa1fcd221d0d89f2f) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Fix RNTester not showing Redbox when Metro is not connected ([b67bc3ffd3](https://github.com/facebook/react-native/commit/b67bc3ffd3fe6db3d2fd9e5796bf02815cb29408))
- Deprecate CompositeReactPackageTurboModuleManagerDelegate ([6f11334c42](https://github.com/facebook/react-native/commit/6f11334c42169b64964bb48c2839c9d563045259) by [@mdvacca](https://github.com/mdvacca))
- Enable fast refresh banner for Bridgeless ([66fbab2586](https://github.com/facebook/react-native/commit/66fbab258638f189734da3533ff83388be57e84e))
- Add DoNotStripAny to JSTimerExecutor ([56683b0c77](https://github.com/facebook/react-native/commit/56683b0c777413e6d76fdb6494295922ae3d4a13))
- Enabling Explicit API warning, this will be changed as Strict in a future version ([490b51c7c3](https://github.com/facebook/react-native/commit/490b51c7c38884f13c4b5d15ab0b7cad473a48d8) by [@mdvacca](https://github.com/mdvacca))
- Add Add ExceptionsManagerModule to CoreReactPackage ([4d70337fb5](https://github.com/facebook/react-native/commit/4d70337fb52bb66b0f749ac9958a3da1b24f6b54))
- Reducing visibility of FrescoBasedReactTextInlineImageSpan ([be1c3cb3ca](https://github.com/facebook/react-native/commit/be1c3cb3caf427cdf2b7a7517370af70852c0465) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of FrescoBasedReactTextInlineImageShadowNode ([f158939efa](https://github.com/facebook/react-native/commit/f158939efa544567ce37226f3b78714978b02286) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of RefreshEvent ([e96cbcc4dc](https://github.com/facebook/react-native/commit/e96cbcc4dc709ec5b7687018c06a0dc38bf967e0) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of VelocityHelper ([05064dc660](https://github.com/facebook/react-native/commit/05064dc66093974f6cd7a126bc23b72b337a4cf1) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactScrollViewAccessibilityDelegate ([a81481cb0c](https://github.com/facebook/react-native/commit/a81481cb0c02b40229af0ac83531bdbcbae2ae60) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of MaintainVisibleScrollPositionHelper ([88a4be378f](https://github.com/facebook/react-native/commit/88a4be378f47fc45e3e4f625a9be2d9662f93897) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ScaleTypeStartInside ([0d0e0e1b53](https://github.com/facebook/react-native/commit/0d0e0e1b53e17cd9844e4267ff96c9903369e226) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactImageDownloadListener ([9582f98099](https://github.com/facebook/react-native/commit/9582f98099709f1097544515e30f938b56dbf9f6) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactEventEmitter ([fa1a29bdc0](https://github.com/facebook/react-native/commit/fa1a29bdc0f29980424eaf7f788c5d85aa01fae5) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of YogaNodePool ([aa4490df11](https://github.com/facebook/react-native/commit/aa4490df11213c31749785789b39a24d13b7ec64) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ViewHierarchyDumper ([0316f8d117](https://github.com/facebook/react-native/commit/0316f8d117623167e38127d5adc9c6a647b1abd9) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ShadowNodeRegistry ([e2aae65dd4](https://github.com/facebook/react-native/commit/e2aae65dd4d6cbe57c1f1dee6c8cc6738a8cddc3) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of NoSuchNativeViewException ([4f6a74438d](https://github.com/facebook/react-native/commit/4f6a74438d38f2a82dc674b3d3c3bfac2a1e845c) by [@mdvacca](https://github.com/mdvacca))
- Bump Gradle to 8.4 ([81213f6524](https://github.com/facebook/react-native/commit/81213f652427d35219bf491bb84418d8c9faa2cb) by [@cortinico](https://github.com/cortinico))
- Bump AGP to 8.1.2 ([22388fe938](https://github.com/facebook/react-native/commit/22388fe938a38e0b50dbe42da688cb2e7521e637) by [@cortinico](https://github.com/cortinico))
- Reducing visibility of UnobservedTaskException ([f4023129be](https://github.com/facebook/react-native/commit/f4023129beae7835d92ef2d968f06b180538f391) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ExecutorException ([9d3fa2715d](https://github.com/facebook/react-native/commit/9d3fa2715d6966842a17af66e5b15dbaba9bbe8f) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of Capture ([456335a7eb](https://github.com/facebook/react-native/commit/456335a7eb9b2ffd809b5f5af6a2963ac7683cf4) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of CancellationTokenRegistration ([22a3aeafcf](https://github.com/facebook/react-native/commit/22a3aeafcf80e5d29de49811cd6c93d04157d01d) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of AggregateException ([2c5d976000](https://github.com/facebook/react-native/commit/2c5d9760002d1a2d66e2afcbf3bd9f7f00e15bd2) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ProgressiveStringDecoder ([8c862f6cc4](https://github.com/facebook/react-native/commit/8c862f6cc4a01fb7f90bfdf8f0a7aaf90da824ba) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ProgressRequestBody ([4240eb06ab](https://github.com/facebook/react-native/commit/4240eb06abec070cc2cbc0ca67bdf0a79de386fb) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of HeaderUtil ([fd57f669ff](https://github.com/facebook/react-native/commit/fd57f669ff60e691e1d94460a4b30cde19613652) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of CountingOutputStream ([c5c6954596](https://github.com/facebook/react-native/commit/c5c6954596f0914fcb2057c8e5624c6e4ebf4c39) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of DidJSUpdateUiDuringFrameDetector ([366bcef631](https://github.com/facebook/react-native/commit/366bcef631e4b73fdb2489cb0683f2a4e97f72d2) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of AnimationsDebugModule ([9c8ba251a1](https://github.com/facebook/react-native/commit/9c8ba251a1a278a24556e64aac736e0240100d92) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of NoRetryPolicy ([26c5cba6a9](https://github.com/facebook/react-native/commit/26c5cba6a918327c711e5686ac692673c83e1c4a) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of SendAccessibilityEvent ([90436bb3f8](https://github.com/facebook/react-native/commit/90436bb3f868be7cb5e2f9dd0c65d110cd9d2b9d) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ViewHierarchyUtil ([6464acab36](https://github.com/facebook/react-native/commit/6464acab360565d4693a8ead44c14af6583cda47) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of RedBoxDialogSurfaceDelegate ([3e594ea3dc](https://github.com/facebook/react-native/commit/3e594ea3dc7d9d55e5afe3346b411f9b34f2ce73) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of MultipartStreamReader ([b8cded3df6](https://github.com/facebook/react-native/commit/b8cded3df63818c06df7a0e7a7a0ae79a4ac475a) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of LogBoxDialogSurfaceDelegate ([f46bc717cd](https://github.com/facebook/react-native/commit/f46bc717cd4a37140f5b96b8753f0a40c5559742) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of LogBoxDialog ([c9417ff5f4](https://github.com/facebook/react-native/commit/c9417ff5f42946ddda08df401625b9088285efce) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of FpsView ([55d0ac6ab3](https://github.com/facebook/react-native/commit/55d0ac6ab3ed8ac3440c5891fdd9ef92eca1635f) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of UIManagerProvider ([0939908f67](https://github.com/facebook/react-native/commit/0939908f670b2da68a13448f07099d32a274d6e7) by [@mdvacca](https://github.com/mdvacca))
- Use NDK 26 ([9ce7b56413](https://github.com/facebook/react-native/commit/9ce7b564131c5b2075489c09ff05325ddc28014a) by [@NickGerleman](https://github.com/NickGerleman))
- Rewrite RNTesterApplication to Kotlin, add AnnotationTarget property. ([c4110d0475](https://github.com/facebook/react-native/commit/c4110d0475c27da9fac4161ed8ee376757b47429) by [@Mod3rnx](https://github.com/Mod3rnx))
- Rewrite ReactPropAnnotationSetterTest to Kotlin, ([ea88338d75](https://github.com/facebook/react-native/commit/ea88338d75d38e6639636eca58e824ed7e796403))
- Reducing visibility of PerformanceCounter ([614afb5983](https://github.com/facebook/react-native/commit/614afb598335de388d15f9d9f2ec67d1b6db2790) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of NativeArrayInterface ([e46372ffa4](https://github.com/facebook/react-native/commit/e46372ffa4e614e903717c3c5e57a30d444ec4a4) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of NativeArgumentsParseException ([970ea5e476](https://github.com/facebook/react-native/commit/970ea5e476738399e06221fe729044e2137e0f8b) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of JSInstance ([d224816ed1](https://github.com/facebook/react-native/commit/d224816ed1095f5daf844f689d683c61c6f1a3a8) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of JSIModuleRegistry. ([e3e9b1388f](https://github.com/facebook/react-native/commit/e3e9b1388f9805636afc354032d3f7bf3ad4eb1f) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of JSIModuleHolder ([9ba05493b8](https://github.com/facebook/react-native/commit/9ba05493b82896250547499bb02529b4082b7836) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of JSCJavaScriptExecutorFactory ([11d51fe395](https://github.com/facebook/react-native/commit/11d51fe39596ad6fde37e5e3feca06dcef137fa5) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of DynamicFromMap ([7a5824b416](https://github.com/facebook/react-native/commit/7a5824b4167c8f56620e5efc89b8c1f1a4cbd96d) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of DynamicFromArray ([d6cd496c44](https://github.com/facebook/react-native/commit/d6cd496c440e038053e8b5ef84092f558d242ca1) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of DecayAnimation ([5d386b795e](https://github.com/facebook/react-native/commit/5d386b795e9962217cd1571b33550bf5cac392df) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of AnimatedNodeWithUpdateableConfig ([5bbc89e4be](https://github.com/facebook/react-native/commit/5bbc89e4be6b0ccf9fda2ce1510f52839182c73d) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of AnimatedNodeValueListener ([f202d1b44b](https://github.com/facebook/react-native/commit/f202d1b44b0253e5680f72150e10fc7cbf7ba0da) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactPackageHelper ([7e00f536b3](https://github.com/facebook/react-native/commit/7e00f536b37890bc2503750468c7db7b4a9f502e) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactTextInputKeyPressEvent ([c7564c76f3](https://github.com/facebook/react-native/commit/c7564c76f3c77769629b8ae720a9d3a8417c117f) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of ReactAndroidHWInputDeviceHelper ([93b1dc9633](https://github.com/facebook/react-native/commit/93b1dc9633e9e28c24c6f20dc82e8699b430bf6b) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of EagerModuleProvider ([78097648d3](https://github.com/facebook/react-native/commit/78097648d305b35b17cbc11626a5b25a2ea77292) by [@mdvacca](https://github.com/mdvacca))
- Reducing visibility of CanvasUtil ([aad82f5032](https://github.com/facebook/react-native/commit/aad82f50325869eeb906273e554a242ea85f715f) by [@mdvacca](https://github.com/mdvacca))
- Fully rollout FabricSharedEventPipeline ([91fe3b484b](https://github.com/facebook/react-native/commit/91fe3b484b8e0807e4edaaa6ed4bb5c2f540e9fd) by [@mdvacca](https://github.com/mdvacca))
- Support grouped focus for switch ([06c295c58f](https://github.com/facebook/react-native/commit/06c295c58fe5449ecbf69bfb52bb8e52cd64308b) by [@carmenvkrol](https://github.com/carmenvkrol))
- Expose `react_render_textlayoutmanager` via prefab. ([642b4e5c2c](https://github.com/facebook/react-native/commit/642b4e5c2c80b6f46429b41f36489eb81ac8a06e) by [@tomekzaw](https://github.com/tomekzaw))
- Expose `rrc_text` via prefab. ([1c69100a2b](https://github.com/facebook/react-native/commit/1c69100a2b822309c210733a33a57ebb560a1c71) by [@tomekzaw](https://github.com/tomekzaw))
- Expose `rrc_textinput` via prefab. ([adc9e5b0fa](https://github.com/facebook/react-native/commit/adc9e5b0faaf8c997fe0d09aecd56747026f8b01) by [@tomekzaw](https://github.com/tomekzaw))
- Rename `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js` ([fcabb2ad21](https://github.com/facebook/react-native/commit/fcabb2ad21b2c17f4e0d40b0637c22ba84568038) by [@cipolleschi](https://github.com/cipolleschi))
#### iOS specific
- Make RCTConvert an Objective-C++ (`.mm`) file in prep for DisplayP3 changes ([267ea2661a](https://github.com/facebook/react-native/commit/267ea2661aa1fb434422c39094c98713d9853be7) by [@cipolleschi](https://github.com/cipolleschi))
- Migrated RNTester/AppDelegate to the new notification callback ([ccff2bb8d1](https://github.com/facebook/react-native/commit/ccff2bb8d19b2db244f30293b4e8d68a524c2059))
- Add the for the dismissal snapshot only when we need it. ([7c4afa1006](https://github.com/facebook/react-native/commit/7c4afa1006ac07e07345682d91fd36ac0025b8a9) by [@cipolleschi](https://github.com/cipolleschi))
- Use less verbose Auto Layout API for RCTRedBox constraints ([b311c3e0a0](https://github.com/facebook/react-native/commit/b311c3e0a00bf8051194bbb5072a9341cf3f6e10) by [@okwasniewski](https://github.com/okwasniewski))
- Refactor `RCTKeyWindow` to be more resilient and work in multi-window apps ([782e9eace9](https://github.com/facebook/react-native/commit/782e9eace974baefba7d8978739f11fe1ea70dc9) by [@okwasniewski](https://github.com/okwasniewski))
- Add `NDEBUG` flag for Release builds for both architectures ([1a0e1741c0](https://github.com/facebook/react-native/commit/1a0e1741c0ab4f22b57a6a7ee86ff4287fa09103) by [@tjzel](https://github.com/tjzel))
- ScrollEventThrottle no longer needs to be set for continuous scroll events ([10b3e0e868](https://github.com/facebook/react-native/commit/10b3e0e8688a7a140578fe25e799d4b379595e69) by [@NickGerleman](https://github.com/NickGerleman))
- `scrollEventThrottle` no longer needs to be set for continuous scroll events when using the new architecture. ([56b57e2db4](https://github.com/facebook/react-native/commit/56b57e2db4d75b32706ebbaa5bee02d48beab945) by [@NickGerleman](https://github.com/NickGerleman))
- Update 'cannot calculate shadow efficiently' log message to explicitly say solid background ([94c7661206](https://github.com/facebook/react-native/commit/94c76612062c548782cb9b033398467cb8a079e4) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Retrieve screen scale from trait collection instead of UIScreen mainScreen ([ace81ff7d8](https://github.com/facebook/react-native/commit/ace81ff7d81b2eb547ad93b8000c5906dfefd9d3) by [@okwasniewski](https://github.com/okwasniewski))
- Migrate RCTTextView to UIEditMenuInteraction ([e08a1973f6](https://github.com/facebook/react-native/commit/e08a1973f67d85acc157111c749c43572469e4c2) by [@okwasniewski](https://github.com/okwasniewski))
- Update SocketRocket to 0.7.0 ([bab9c839ea](https://github.com/facebook/react-native/commit/bab9c839eaad1ffc358fa5c87440a6de7cbe981b) by [@Saadnajmi](https://github.com/Saadnajmi))
- Align all pods to 13.4 ([c852955e4b](https://github.com/facebook/react-native/commit/c852955e4bb8454e44507c34653c5f76f4f1f130) by [@cipolleschi](https://github.com/cipolleschi))
- Rename `RCTRootViewFrameDidChangeNotification` as it's not tracking root view frame changes ([625d0ece6d](https://github.com/facebook/react-native/commit/625d0ece6da80df6e3e3ee7daa1f7f59ddbbf387) by [@Saadnajmi](https://github.com/Saadnajmi))
- Matched behaviour for allowsEdgeAntialiasing to old architecture. ([6fb0fbadc0](https://github.com/facebook/react-native/commit/6fb0fbadc0a39ab95f22fdb5101dc55596aa2114) by [@javache](https://github.com/javache))
- Bump SocketRocket to 0.6.1 ([8b88883071](https://github.com/facebook/react-native/commit/8b88883071693cf67db41fec79d4068392e77f2a) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Deterministic onLayout event ordering for iOS Paper ([56ddace9c8](https://github.com/facebook/react-native/commit/56ddace9c8ffdde5485f1dbe4c5004070cf78262) by [@NickGerleman](https://github.com/NickGerleman))
- Rearrange RNComponentViewUpdateMask value ([476a323e0d](https://github.com/facebook/react-native/commit/476a323e0d5c7c0876899e9de6460c069720655e) by [@zhongwuzw](https://github.com/zhongwuzw))
- Move `[RCTConvert RCTTransformOrigin:]` out of UIAccessibilityTraits category ([c7aa3954e3](https://github.com/facebook/react-native/commit/c7aa3954e347352b9e800cb9ec3b4e9800366250) by [@Saadnajmi](https://github.com/Saadnajmi))
- Remove `<Webkit/Webkit.h>` import in `RCTConvert.h` ([452bf0ff06](https://github.com/facebook/react-native/commit/452bf0ff069b77fc880c57fcb86dbe44ac7285fc) by [@Saadnajmi](https://github.com/Saadnajmi))
### Deprecated
- Deprecate BatchedBridge.registerCallableModule. Please use registerCallableModule instead ([7f549ec7be](https://github.com/facebook/react-native/commit/7f549ec7bebecddcb13087ab132f38c4eb68ef97) by [@RSNara](https://github.com/RSNara))
- Warn when fabric is used without concurrent root ([c06807154b](https://github.com/facebook/react-native/commit/c06807154b309bd85626a5e9ca2f23ac7a7750b6) by [@javache](https://github.com/javache))
- Replace RAIICallbackWrapperDestroyer with AsyncCallback (re-land) ([fbd8504cc0](https://github.com/facebook/react-native/commit/fbd8504cc0df8d65fd1782eafcab7b9d464d539b) by [@javache](https://github.com/javache))
- Deprecated RAIICallbackWrapperDestroyer. Use AsyncCallback instead for safe jsi::Function memory ownership. ([8dd89cee1b](https://github.com/facebook/react-native/commit/8dd89cee1b69c953fa01818c588b86fd96f1ce4d) by [@javache](https://github.com/javache))
- Refactor BaseJavaModule and ReactContextBaseJavaModule ([5af7b7038c](https://github.com/facebook/react-native/commit/5af7b7038c730289cd8420060c039197f45e7397) by [@mdvacca](https://github.com/mdvacca))
#### Android specific
- Deprecate UIManager.showPopupMenu, and UIManager.dismissPopupMenu ([8a8f74b7b2](https://github.com/facebook/react-native/commit/8a8f74b7b2355b78bcdc7d8a23bf5ef5f0b93926) by [@RSNara](https://github.com/RSNara))
- Deprecate FabricViewStateManager ([4fdc5945b1](https://github.com/facebook/react-native/commit/4fdc5945b1e00d23b6b149070b9403b436fd48ff) by [@sammy-SC](https://github.com/sammy-SC))
#### iOS specific
- **Un-deprecates** `RCTAppSetupPrepareApp` (reverts #41976) ([ce3ce1194b](https://github.com/facebook/react-native/commit/ce3ce1194baacb62dbac50f59444618921d03316) by [@huntie](https://github.com/huntie))
- Retrieving initial notification requires UNUserNotificationCenterDelegate setup instead of reading UIApplicationLaunchOptionsLocalNotificationKey ([c8ab44cf0b](https://github.com/facebook/react-native/commit/c8ab44cf0b1e63ac7224147f3df1f414a29b65a0) by [@philIip](https://github.com/philIip))
- Deprecating RCTPushNotificationManager's didReceiveLocalNotification: and didReceiveRemoteNotification: ([1b85ed94a1](https://github.com/facebook/react-native/commit/1b85ed94a1a8b9d4c53d2129b8d5f5329fef35c5))
- Deprecate `[RCTConvert UIBarStyle:]` ([157cb0e02b](https://github.com/facebook/react-native/commit/157cb0e02b6328e8b640f2b302a11c298a240493) by [@Saadnajmi](https://github.com/Saadnajmi))
- Deprecate `RCTAppSetupPrepareApp`, replaced with C++ overload ([7a4950b366](https://github.com/facebook/react-native/commit/7a4950b366ab20c1064c849a3739a3d455400d16) by [@huntie](https://github.com/huntie))
- ([a0efa26065](https://github.com/facebook/react-native/commit/a0efa26065a4833d3f950f6ad8fd7a7deee432a3) by [@philIip](https://github.com/philIip))
- ([9b1f8a81e9](https://github.com/facebook/react-native/commit/9b1f8a81e9af971af6ddc1dc4ef96302bf4a08d7) by [@philIip](https://github.com/philIip))
- Deprecate RCTGetMultiplierForContentSizeCategory ([f174f028cf](https://github.com/facebook/react-native/commit/f174f028cfae29735e3f04ad5f42079b67658642) by [@Saadnajmi](https://github.com/Saadnajmi))
- Deprecate `getSurfacePresenter` and `getModuleRegistry` for `surfacePresenter` and moduleRegistry` props. ([c3b0a8f162](https://github.com/facebook/react-native/commit/c3b0a8f1626939cf5c7b3864a5acf9d3dad26fb3) by [@cipolleschi](https://github.com/cipolleschi))
### Removed
### Fixed
- Fix JSExecutor build error on Windows ([1c4ed12370](https://github.com/facebook/react-native/commit/1c4ed12370101c12e9c5390733ec42469ca9cfd7))
- Declare missing peer dependency `react` ([62c15bacaa](https://github.com/facebook/react-native/commit/62c15bacaac160d0858a76946217a2bfffb08b6d) by [@jbroma](https://github.com/jbroma))
- Log Codegen supported platforms if any are available ([2ca7bec0c2](https://github.com/facebook/react-native/commit/2ca7bec0c2a7d821ceaaf39840a6cdc5eceb8678) by [@okwasniewski](https://github.com/okwasniewski))
- Call onStartReached initially when list is small and `onEndReached` is called ([4dcc1d3efb](https://github.com/facebook/react-native/commit/4dcc1d3efbd86a4ac42c801af3303e4dae4c0418) by [@janicduplessis](https://github.com/janicduplessis))
- Fix order of Metro hotkey console messages ([635732aa8f](https://github.com/facebook/react-native/commit/635732aa8fedc241d94eb1610dd58635f597b07d) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- Fix `react-native config` failing in pnpm setups ([8f4f09bf70](https://github.com/facebook/react-native/commit/8f4f09bf704fbe5851d72bc5152ada0ab8c733b2) by [@tido64](https://github.com/tido64))
- Fix `react-native/community-cli-plugin` is unable to resolve out-of-tree platforms in monorepos ([e350859d72](https://github.com/facebook/react-native/commit/e350859d72b08ec1367dd98f89a313786171c8b9) by [@tido64](https://github.com/tido64))
- Add type information for items of FlatList in `onViewableItemsChanged` signature ([35f5c3a204](https://github.com/facebook/react-native/commit/35f5c3a204375c2e716cdaa624f6c931ad62520e) by [@miallo](https://github.com/miallo))
- Update typescript definition of `translateX` & `translateX` to be able to use percentage values ([b133bf6024](https://github.com/facebook/react-native/commit/b133bf60245f2b497fecf464c8a8f491294a750f) by [@retyui](https://github.com/retyui))
- Fix UIManagerBinding's findNodeAtPoint ([62e5980954](https://github.com/facebook/react-native/commit/62e59809548034611fdce387e5b72d6bc6b9e6ea) by [@RSNara](https://github.com/RSNara))
- Fix issue with debugger not working when device name contain two-byte UTF characters ([d16531e8a4](https://github.com/facebook/react-native/commit/d16531e8a4c20b848fd71dcca53d11aa8e1a6ac3) by [@kmagiera](https://github.com/kmagiera))
- Inspected elements from React DevTools are now correctly highlighted on a relevant surfaces ([9d846f47c2](https://github.com/facebook/react-native/commit/9d846f47c28089b357e52e428173978df7ee34f1) by [@hoxyq](https://github.com/hoxyq))
- Fix `compose-source-maps.js` failing if `-o` is not specified when it should output the composed source map ([ab192ced69](https://github.com/facebook/react-native/commit/ab192ced6938e647819eaaed983158a1feb3ff81) by [@tido64](https://github.com/tido64))
- Fix remount of header and footer in `SectionList` while transiting between empty and filled state ([0c37f8c85c](https://github.com/facebook/react-native/commit/0c37f8c85cd0db1726fe8269aa0781d27c72c42b) by [@MateWW](https://github.com/MateWW))
- Updated docs to match Android 6.0 (API 23) minimum requirement. ([192a88d522](https://github.com/facebook/react-native/commit/192a88d522befa3b5cc073d441210f8148e8ac69) by [@dcangulo](https://github.com/dcangulo))
- Fix align-content of cross-stretched container ([b7eb0c85a2](https://github.com/facebook/react-native/commit/b7eb0c85a20ff01ae400df786fa238f362854cb6) by [@NickGerleman](https://github.com/NickGerleman))
- Fix Yoga sizing and alignment issues with multi-line containers ([b221265f41](https://github.com/facebook/react-native/commit/b221265f4156992fea932ca74f09ac04662a4a37) by [@NickGerleman](https://github.com/NickGerleman))
- Allow source map fetching in the inspector proxy from 127.0.0.1 ([46d304a101](https://github.com/facebook/react-native/commit/46d304a101f19f214607ac8fb93aacec4bfdbc6b))
- Message ([da3ba74240](https://github.com/facebook/react-native/commit/da3ba742404cc71c46cf32d15c92bbd3dd62e89b) by [@Spice-Z](https://github.com/Spice-Z))
- Lint source files, sort imports, remove unused ones ([7d1a98c43b](https://github.com/facebook/react-native/commit/7d1a98c43bc06af602f798c813cb56991447a26e) by [@okwasniewski](https://github.com/okwasniewski))
- Allow Out Of Tree platforms to pass custom resolvers ([4ccd6e1242](https://github.com/facebook/react-native/commit/4ccd6e124278abf3c63765195715ee3ae39a769e) by [@okwasniewski](https://github.com/okwasniewski))
- Update AcitvityIndicator spec default value ([03a840e0a9](https://github.com/facebook/react-native/commit/03a840e0a9ff6c0591557e1bac8e44dcdc72d3a9) by [@zhongwuzw](https://github.com/zhongwuzw))
- Update pkg/repo names in deprecation messages ([fd35c1db28](https://github.com/facebook/react-native/commit/fd35c1db2810c7c147c28ad067194744bf378069) by [@friederbluemle](https://github.com/friederbluemle))
- "yogalayout.com" to "yogalayout.dev" ([99ebcfd3a9](https://github.com/facebook/react-native/commit/99ebcfd3a9c0907e51e8a22b8ff3169a3700747c) by [@NickGerleman](https://github.com/NickGerleman))
- Fix `react-native/codegen` not being able to resolve dependencies in pnpm setups ([c58e19e89a](https://github.com/facebook/react-native/commit/c58e19e89aadcc01c2ac8ead876831ed8a2f6c5d) by [@tido64](https://github.com/tido64))
- Flow syntax errors in Codegen specs are no longer ignored. ([a74765eb0a](https://github.com/facebook/react-native/commit/a74765eb0aaeba7154359ef77f31cc34ecc4b709) by [@motiz88](https://github.com/motiz88))
- Add missing `ping()` method into `WebSocket` interface ([016b62c549](https://github.com/facebook/react-native/commit/016b62c54985e92ce43a97a07b7830b546688221) by [@alexzel](https://github.com/alexzel))
- Add detection of logical assignment operators to `react-native-babel-preset` ([c90485eb10](https://github.com/facebook/react-native/commit/c90485eb10520f969c956b1381eba89e5cc9e072) by [@jonthysell](https://github.com/jonthysell))
- Eslint config global vars redefine there is no message tip ([a2a219c27e](https://github.com/facebook/react-native/commit/a2a219c27ec607190b1c390190026d5166a51f1a) by [@rick-ast](https://github.com/rick-ast))
- Fix windows 4018 and 4244 compiler warnings ([695a30d6b4](https://github.com/facebook/react-native/commit/695a30d6b4d03da02d02a5784f5f30ae6adb6e35) by [@TatianaKapos](https://github.com/TatianaKapos))
- Rollout enableCloseVisibleGapBetweenPaths ([285629922c](https://github.com/facebook/react-native/commit/285629922cafd86914af9ed95ff1fbbd2c5a7c79) by [@javache](https://github.com/javache))
- Move iOS/Android specific prop types appropriate types ([755a7dbf56](https://github.com/facebook/react-native/commit/755a7dbf5644d4f8ee08cba18bfa73a115c8d849) by [@Saadnajmi](https://github.com/Saadnajmi))
- Add `number | null` to `ViewProps['hitSlop']` TypeScript type ([bc16bc5b01](https://github.com/facebook/react-native/commit/bc16bc5b01c50fcfedbc3d32eed5591d9dd7cfce) by [@DimitarNestorov](https://github.com/DimitarNestorov))
- JS Debugging: Fix inspector-proxy to allow for DevTools requests with query strings ([ab81c16b65](https://github.com/facebook/react-native/commit/ab81c16b6507000139d1af52c622e320629750ec))
- Normalize-colors should not impose node >= 18 ([6f1b8edc7a](https://github.com/facebook/react-native/commit/6f1b8edc7a586a3e4c5408d14da1e13c1d88288a) by [@cortinico](https://github.com/cortinico))
- Fixes type casting warnings that are treated as errors downstream in React Native Windows. ([570655d80f](https://github.com/facebook/react-native/commit/570655d80fcb1f213de07af05798897e5dbe42b9) by [@chiaramooney](https://github.com/chiaramooney))
- - [GENERAL] [FIXED] Updated ESLint version to fix `originalKeywordKind` deprecation error ([5de0ddae30](https://github.com/facebook/react-native/commit/5de0ddae302ae1768d5ba40d09afc4ffce9ab5c1) by [@mrousavy](https://github.com/mrousavy))
- JS debugging: prevent dev server crash when a large CDP payload is returned from the device ([d0f750e15d](https://github.com/facebook/react-native/commit/d0f750e15d1fb2e75e1263c66ac5f5be31aa0dc5) by [@motiz88](https://github.com/motiz88))
- Fix new arch example not render in RNTester ([48dcfa1718](https://github.com/facebook/react-native/commit/48dcfa1718d088c44f925814de59ca6ad35d44f2))
- JS debugging: prevent dev server crash when a large CDP payload is returned from the device ([2000acc6c6](https://github.com/facebook/react-native/commit/2000acc6c6cbfd3942062b33c8285e155d404d4a) by [@motiz88](https://github.com/motiz88))
- Update stale ReactAndroid.api values after CI breakage ([a5fbe28c29](https://github.com/facebook/react-native/commit/a5fbe28c2902f0a312175ce366ee204e185efc52) by [@GijsWeterings](https://github.com/GijsWeterings))
- Fix issue where we were not centering absolute nodes correctly when justifying ([983e784a3e](https://github.com/facebook/react-native/commit/983e784a3e7f8c2529a17dcd5850e79e17d00da3) by [@joevilches](https://github.com/joevilches))
- Fix bug where we used border box for size of containing block in a certain case ([5b05c79d8c](https://github.com/facebook/react-native/commit/5b05c79d8cd32c25c53b195999b3866dac5a5600) by [@joevilches](https://github.com/joevilches))
- Make runtime reference thread safe on tickleJs call ([067c989b48](https://github.com/facebook/react-native/commit/067c989b4841d55c521d7b21534e9609d9d2a0a7) by [@blakef](https://github.com/blakef))
- Fix issue where paddingStart and paddingEnd were swapped with row reverse ([2bf1a8f4e0](https://github.com/facebook/react-native/commit/2bf1a8f4e05313287e1d81a460138f4875282e9f) by [@joevilches](https://github.com/joevilches))
- Fix issue where borderStart and borderEnd were swapped with row reverse ([24169e28cf](https://github.com/facebook/react-native/commit/24169e28cf0477bb55be92740bb2c402d8c3eff5) by [@joevilches](https://github.com/joevilches))
- Fix issue where marginStart and marginEnd were not working with rowReverse flex direction ([53279ba426](https://github.com/facebook/react-native/commit/53279ba4267c573d0c471380265a8e4e8fbd6f86) by [@joevilches](https://github.com/joevilches))
- Fix style resolution functions returning FloatOptional ([72d0fed272](https://github.com/facebook/react-native/commit/72d0fed272a84f34294f59d86c79223cea880e6d) by [@NickGerleman](https://github.com/NickGerleman))
- Fix handling of negative flex gap ([aa65e92121](https://github.com/facebook/react-native/commit/aa65e92121e86fbe978e10db80e04fb4999479ef) by [@NickGerleman](https://github.com/NickGerleman))
- Fix ReactInstanceManager to initialize the UIManager ([0f239d3301](https://github.com/facebook/react-native/commit/0f239d3301cce409476370294f782e76cc59a1ec))
- Fix ReactInstanceManager to add getJSIModule() as an alternate path ([e8323781fa](https://github.com/facebook/react-native/commit/e8323781fac8b19bb8a4faa53461c33ff201817b))
- Fixing Bridgeless Exception caused by the UIManager changes ([5e406ccea0](https://github.com/facebook/react-native/commit/5e406ccea023e87a35d939b0f865aec760703035))
- Fix warm start logging for ReactMarker ([44109dc2c0](https://github.com/facebook/react-native/commit/44109dc2c01a76baf37b836a378e6a28d96ea66c))
- Create custom message handler for synthetic page ([652c74104a](https://github.com/facebook/react-native/commit/652c74104af9844bf88dff8eb96d02b4e172720c) by [@byCedric](https://github.com/byCedric))
- Fix undefined props crash in FlatList ([e33767a36d](https://github.com/facebook/react-native/commit/e33767a36daf7901cb46854b6612dd52b0dbdeec) by [@dieguezz](https://github.com/dieguezz))
- Correctly keep ES6Proxy for bridgeless mode ([c35630998b](https://github.com/facebook/react-native/commit/c35630998b73ef7573bd04caf7b9b75d26223283) by [@fkgozali](https://github.com/fkgozali))
- Add missing `registerCallableModule` TypeScript definitions ([6bc95b2074](https://github.com/facebook/react-native/commit/6bc95b2074a794607a34eae201f07dae110c2832) by [@Kudo](https://github.com/Kudo))
- Allow Inspector proxy to inline source maps on LAN connections ([3dee6d31b9](https://github.com/facebook/react-native/commit/3dee6d31b9059e319bf4849797e3ed21c298be70) by [@byCedric](https://github.com/byCedric))
- Fix Bridgeless React Context test in OSS ([bdca260679](https://github.com/facebook/react-native/commit/bdca2606797f50f9ccb064bc7b25cd849ffe5e6c) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Fix bug where absolute nodes were not insetted correctly in certain cases ([3341ab7cc0](https://github.com/facebook/react-native/commit/3341ab7cc0ba7a8460069cd39ff3060154d96e1a) by [@joevilches](https://github.com/joevilches))
#### Android specific
- Disable the "Open Debugger" item from dev menu if the bundler is disconnected ([7afc8b8623](https://github.com/facebook/react-native/commit/7afc8b8623cc499c3054b9fb5b08cc2b65edb19c) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- Fix linking of local app modules turbomodules ([eb619468c1](https://github.com/facebook/react-native/commit/eb619468c1b61b7261846e62e33f94d89e121455) by [@cortinico](https://github.com/cortinico))
- Fix Reload behavior being different on Bridgeless ([85257a993f](https://github.com/facebook/react-native/commit/85257a993fce5e37e19f03c563bd134982302f51) by [@cortinico](https://github.com/cortinico))
- Fixes Android compile failed. ([aefca27c67](https://github.com/facebook/react-native/commit/aefca27c67df4ab19733e33e26f5457e297e0b5f) by [@zhongwuzw](https://github.com/zhongwuzw))
- Fix delivery of events during initial rendering in new architecture ([7b36233ae1](https://github.com/facebook/react-native/commit/7b36233ae19ba7c1fbedc42c15103ea1cfa55ee3) by [@mdvacca](https://github.com/mdvacca))
- Restore missing call to `convertRawPropAliases` ([5e37c1f219](https://github.com/facebook/react-native/commit/5e37c1f2191f1c4886f55a63e931979847cf49a4) by [@NickGerleman](https://github.com/NickGerleman))
- [Android][Fixed] - Fix incorrect measurement of TextInput when new architecture is enabled ([dc2ce9e66e](https://github.com/facebook/react-native/commit/dc2ce9e66e337ef90a179853467dbb8b09b9d24c) by [@mdvacca](https://github.com/mdvacca))
- Make Android respect metro location from shared preferences for the debugger workflow ([0ea16fd3f7](https://github.com/facebook/react-native/commit/0ea16fd3f748dd239cac6f19f80b007cb2b008f9) by [@kmagiera](https://github.com/kmagiera))
- Assert `DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint` is set ([8474e239df](https://github.com/facebook/react-native/commit/8474e239df9de41da2b7a12b15d38871bebdd97f) by [@tido64](https://github.com/tido64))
- Fixed unexpected resizing of ReactRootView for dev bundles in brownfield apps ([5d68c908f1](https://github.com/facebook/react-native/commit/5d68c908f1de52cfe5d6f8b50774ba44c3dcc9be) by [@hoxyq](https://github.com/hoxyq))
- Fix: prevent scroll event in nested scroll when scrollEnabled={false} ([c7873b77b8](https://github.com/facebook/react-native/commit/c7873b77b8149966e9171783e42cfde6971fbd41) by [@Icehunter](https://github.com/Icehunter))
- Update getDefaultJSExecutorFactory to load Hermes first and fallback to JSC ([70a757fc1e](https://github.com/facebook/react-native/commit/70a757fc1ede08fcb9d5014f3b05c94e5badaea7) by [@cortinico](https://github.com/cortinico))
- Update profiler button to use "Toggle" string. ([8bcaed90c1](https://github.com/facebook/react-native/commit/8bcaed90c11e292da199545f701fd44ecb07ec95) by [@szymonrybczak](https://github.com/szymonrybczak))
- Typos in `ReactCompoundViewGroup` comments ([385473522c](https://github.com/facebook/react-native/commit/385473522cbc525aad08500f5a752dea734c14c3) by [@kkafar](https://github.com/kkafar))
- Fix AndroidTextInputProps Detection of Padding ([4016bfbc37](https://github.com/facebook/react-native/commit/4016bfbc377215d2929de732f682bc9d1c823f39) by [@NickGerleman](https://github.com/NickGerleman))
- Fix type in BlobCollector.h/cpp ([c267a0679d](https://github.com/facebook/react-native/commit/c267a0679d21908e6e8026ca5ee542a9b571fb8b) by [@Sunbreak](https://github.com/Sunbreak))
- Fixed an issue where the status bar colors would not match when opening modals ([e8d622e9d1](https://github.com/facebook/react-native/commit/e8d622e9d118a7fcf71a14d665b2d2bf33dd0b1f))
- Bump Fresco to 3.1.3 ([dca81e6172](https://github.com/facebook/react-native/commit/dca81e6172aadd62a8cb7c2fdb9d08d853119215) by [@cortinico](https://github.com/cortinico))
- Fix crash with `java.lang.NoSuchMethodError` for Bridgeless ([b22f566104](https://github.com/facebook/react-native/commit/b22f566104d2d5d12867478a96ff5a0aa4911336) by [@cortinico](https://github.com/cortinico))
- B1fccb05ccb306005dc7616a4eaaa182b0b1deaf bumped fresco version to 3.1.0. ([fbc28fa73d](https://github.com/facebook/react-native/commit/fbc28fa73d075b49e263f1dd12f9a858bc8f97ef) by [@lafest](https://github.com/lafest))
- Ensure that `configureJavaToolChains` is only executed once during configuration ([c7d969f31b](https://github.com/facebook/react-native/commit/c7d969f31b1d584f593dfcbf119765b5efa4bc95) by [@UNIDY2002](https://github.com/UNIDY2002))
- Fix the crash in ReactViewGroup of https://github.com/facebook/react-native/issues/30785 ([b9418315e2](https://github.com/facebook/react-native/commit/b9418315e274f8693d1f7cd3f41529ba6c0436c9))
- Handle Crash for onRequestPermissionsResult ([925209932a](https://github.com/facebook/react-native/commit/925209932aa20f6c70e9642c5ab8dec8ac83a1cd) by [@chakrihacker](https://github.com/chakrihacker))
- Fix instacrash on bridgeless due to calling showMessage on null instance ([2f1ecea1cb](https://github.com/facebook/react-native/commit/2f1ecea1cb70edb878bb6c984da236aec49d0ba1) by [@cortinico](https://github.com/cortinico))
- Allow non-ascii header values on Android and add utf-8 filename fallback in FormData ([7c7e9e6571](https://github.com/facebook/react-native/commit/7c7e9e6571c1f702213e9ffbb40921cd5a1a786b) by [@robertying](https://github.com/robertying))
- Fix InteropUIBlockListener to support react-native-view-shot on Bridgeless ([24a3dade29](https://github.com/facebook/react-native/commit/24a3dade2993df8e4cc3ee7d5f8bea412f73c202) by [@cortinico](https://github.com/cortinico))
- Fix Android HorizontalScrollView fling when content length less than ScrollView length ([7d180d7127](https://github.com/facebook/react-native/commit/7d180d7127e30cfdf2213e088b79e11b55866816) by [@NickGerleman](https://github.com/NickGerleman))
- Fixed prefab header paths for `rrc_text` and `rrc_textinput` ([623bbe6bd6](https://github.com/facebook/react-native/commit/623bbe6bd628bd8b9305f6b7e4469fdd382fb700) by [@j-piasecki](https://github.com/j-piasecki))
- Fix build from source for hermes-engine
([a1171f79f8](https://github.com/facebook/react-native/commit/a1171f79f81cd924237570a456974b17c67c3ade) by [@cortinico](https://github.com/cortinico))
- Fix bridgeless configuration to include DebuggingOverlay in react packages ([ad9368068a](https://github.com/facebook/react-native/commit/ad9368068a447b7a135cb0cb6ded0dec27ceef5c) by [@hoxyq](https://github.com/hoxyq))
- React-Native-Restart in release ([b282e87729](https://github.com/facebook/react-native/commit/b282e877297854a5ac57c7c26b7e6635fa89d425) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode ([44e5bc9e2c](https://github.com/facebook/react-native/commit/44e5bc9e2c73235ba5d8bf0f5323181948e74197) by [@cortinico](https://github.com/cortinico))
- Re-enable listing Hermes debugger targets in chrome://inspect, broken in 0.74 RC ([4cfac8eea6](https://github.com/facebook/react-native/commit/4cfac8eea63129059559f0a65c038dfe95e12d7c) by [@motiz88](https://github.com/motiz88))
- Fix registration of ViewManagers in new renderer when not using lazyViewManagers. ([fb9872d4fe](https://github.com/facebook/react-native/commit/fb9872d4fe07ac7028ce536200632b3543d5e8a9) by [@javache](https://github.com/javache))
- NullPointerException is no longer ignored in MessageQueueThreadHandler ([5f45700bd0](https://github.com/facebook/react-native/commit/5f45700bd06fb253650c8653b511b084b99eeb7f) by [@javache](https://github.com/javache))
- Properly handle RR and CMD+M in Bridgeless Mode ([e9f66d9c0c](https://github.com/facebook/react-native/commit/e9f66d9c0c5308a75a3c7a0c34d748cdb2cd833f) by [@cortinico](https://github.com/cortinico))
- Bring back the UNSET constant to TextAttributeProps. ([9700540bec](https://github.com/facebook/react-native/commit/9700540bec67d221f72fd1d17e918538ffca7a8a) by [@dmytrorykun](https://github.com/dmytrorykun))
- Fix bridge mode by constructing ReactDelegate correctly ([a25004c86c](https://github.com/facebook/react-native/commit/a25004c86c9fe5b74a54ba913c2ce94f9b1b9b31) by [@cortinico](https://github.com/cortinico))
- Fixed possible deadlock in dispatchViewUpdates ([b2ca41eef5](https://github.com/facebook/react-native/commit/b2ca41eef59b17d212b35baa4a28c4b27a465b5c) by [@EvertEt](https://github.com/EvertEt))
#### iOS specific
- Resolving case sensitivity issue in header file import ([d655fee28b](https://github.com/facebook/react-native/commit/d655fee28be56ba42ae151daba4db84617683f27) by [@zhongwuzw](https://github.com/zhongwuzw))
- Pass the right flags to libraries ([5164e83c3b](https://github.com/facebook/react-native/commit/5164e83c3b24126c4cfcf916e88e737d26f8b76e) by [@cipolleschi](https://github.com/cipolleschi))
- Make sure that `addUIBlock` provides a Dictionary-look-alike object that returns the right views when queried. ([f61f87c5ef](https://github.com/facebook/react-native/commit/f61f87c5ef33cc8098f937aef4a9bd0634b16159) by [@cipolleschi](https://github.com/cipolleschi))
- Perf Monitor option not showing in Bridgeless ([209140046b](https://github.com/facebook/react-native/commit/209140046b451170315f9f30a19644a04ab80207) by [@okwasniewski](https://github.com/okwasniewski))
- Make sure to forward touches to the wrapped component in the InteropLayer. ([ab5e2e8099](https://github.com/facebook/react-native/commit/ab5e2e8099870a313ab2d24344f336604273f573) by [@cipolleschi](https://github.com/cipolleschi))
- Generate the RCTModulesConformingToProtocolsProvider only once in user space ([a3998f8d15](https://github.com/facebook/react-native/commit/a3998f8d15c6b0724039675ba4ead177ae9d7319) by [@cipolleschi](https://github.com/cipolleschi))
- Make sure that Modal is dismissed correctly in Paper ([4236538cbd](https://github.com/facebook/react-native/commit/4236538cbd36d5bc607b3108df45fc51fc8335db) by [@cipolleschi](https://github.com/cipolleschi))
- Fixed support for event name override in component specs. ([6974697b04](https://github.com/facebook/react-native/commit/6974697b049eff0038a17e3ebf962ec7451a5aa4) by [@dmytrorykun](https://github.com/dmytrorykun))
- Make [RCTBridge currentBridge] work in bridgeless mode ([f6f461593b](https://github.com/facebook/react-native/commit/f6f461593bf929aa5d3798fa277f8324ece36f0e) by [@cipolleschi](https://github.com/cipolleschi))
- Initialize the A11yManager in the main queue and when we need it. ([dc38988bcc](https://github.com/facebook/react-native/commit/dc38988bcc160e387fe1d821f80eb42de47d11c5) by [@cipolleschi](https://github.com/cipolleschi))
- Make font resolution work when using specific font name on the new architecture ([61774088d7](https://github.com/facebook/react-native/commit/61774088d79ac3ab730fa55d175d681b10ae50f3) by [@j-piasecki](https://github.com/j-piasecki))
- Disable the "Open Debugger" item from dev menu if packager is disconnected ([bc3fe0d76d](https://github.com/facebook/react-native/commit/bc3fe0d76d9ca7613115d5f10b85ba7608561c02) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- Don't add compiler conditionals when no platforms are specified ([1ce7bfd8c9](https://github.com/facebook/react-native/commit/1ce7bfd8c97998be678884986cf774178bef1185) by [@okwasniewski](https://github.com/okwasniewski))
- Fix TextInput vertical alignment issue when using lineHeight prop on iOS without changing Text baseline (Paper - old arch) ([349d5502d0](https://github.com/facebook/react-native/commit/349d5502d0f0a7e8f66bedb3b8416dca37a41b76) by [@fabOnReact](https://github.com/fabOnReact))
- Align the the bundleURL API from `RCTAppDelegate` to template's `AppDelegate` ([ebb55a780a](https://github.com/facebook/react-native/commit/ebb55a780a31ee985f48536b3eb7794cdff03304) by [@cipolleschi](https://github.com/cipolleschi))
- Bring back support for defining external libraries in react-native.config.js ([c6c23042a4](https://github.com/facebook/react-native/commit/c6c23042a4cdad0a44eb970dd40d9536e725767a) by [@dmytrorykun](https://github.com/dmytrorykun))
- Immediately set props of Components that goes through the interop layer ([68ae8cd5e9](https://github.com/facebook/react-native/commit/68ae8cd5e982db7778a8f9b3aa68494912d75d91) by [@cipolleschi](https://github.com/cipolleschi))
- [iOS] Fixes the root view's background color in bridgeless mode ([0bbc311c8a](https://github.com/facebook/react-native/commit/0bbc311c8ac45577c5ba5a58443380621e807faf) by [@zhongwuzw](https://github.com/zhongwuzw))
- Fix retrieving current appearance in multi-window apps ([d00d35e872](https://github.com/facebook/react-native/commit/d00d35e8723293b0c1e098fa2e02756884a0f7f9) by [@okwasniewski](https://github.com/okwasniewski))
- Refactored RCT_handleKeyCommand to avoid concurrency issues ([8d710bfaca](https://github.com/facebook/react-native/commit/8d710bfaca6b57291bf953bda848f3cf64ae2818) by [@cipolleschi](https://github.com/cipolleschi))
- Fixed potential threading issues accessing UIKit from background in RCTAlertManager ([8c4979e7a1](https://github.com/facebook/react-native/commit/8c4979e7a1ecb140b0b068d686b1ec6aab452121) by [@fkgozali](https://github.com/fkgozali))
- Fixed `DoubleConversion` build error from Swift integration ([631b6a12c5](https://github.com/facebook/react-native/commit/631b6a12c5968510b435080c87f06d03069615cb) by [@Kudo](https://github.com/Kudo))
- IOS Add React-debug to ReactCommon.podspec ([ea0e826c28](https://github.com/facebook/react-native/commit/ea0e826c2804f0c775030e76776fb3ac22978fda) by [@christophpurrer](https://github.com/christophpurrer))
- Remove an early return to suppress a deprecated API warning for `UIMenuController` ([6801fc3f9b](https://github.com/facebook/react-native/commit/6801fc3f9bf172f5ca929127576558be04e3f99c) by [@Saadnajmi](https://github.com/Saadnajmi))
- Bring the old RCT_NEW_ARCH_ENABLED semantic back for compatibility ([3690e4413b](https://github.com/facebook/react-native/commit/3690e4413be0459b2e5fc42ca266c1a03f3c04fa) by [@cipolleschi](https://github.com/cipolleschi))
- Fixed archiving for macos catalyst on react-native 0.73.1 in xcode ([aa2d613cfa](https://github.com/facebook/react-native/commit/aa2d613cfa760b4570ae659c5efa4620308807ce) by [@kesha-antonov](https://github.com/kesha-antonov))
- Fix RCTAppSetupPrepareApp.h import error from Objective-C *.m files ([de0c43ead4](https://github.com/facebook/react-native/commit/de0c43ead4d1503e708d2dafa3f5b7fc550fc01a) by [@Kudo](https://github.com/Kudo))
- Fixes `with-environment.sh` script for the case when Node can't be found prior to loading `.xcode.env` ([c684f9fc62](https://github.com/facebook/react-native/commit/c684f9fc62e865a5ecbd8ade0f5628f016eebcb2) by [@birdofpreyru](https://github.com/birdofpreyru))
- Further cleaned up RCT_USE_HERMES ([d50c9068a9](https://github.com/facebook/react-native/commit/d50c9068a927ec1fa0c574a4483dc7c03dca75f5) by [@fkgozali](https://github.com/fkgozali))
- Fix support for --sourcemap-output path containing spaces ([e25a9b4c5d](https://github.com/facebook/react-native/commit/e25a9b4c5d0e4c32dbc1eca071911e34faa177ce) by [@JorenVos](https://github.com/JorenVos))
- Move old props and prop diffing to the interop layer adapter ([3b80531f32](https://github.com/facebook/react-native/commit/3b80531f3247bee83a2e63a1ee31ca56ab15d024) by [@cipolleschi](https://github.com/cipolleschi))
- Optimise RCTKeyWindow() calls in RCTForceTouchAvailable method ([90fb73e83c](https://github.com/facebook/react-native/commit/90fb73e83caf087659b6b3173edd457b4f1d1987) by [@okwasniewski](https://github.com/okwasniewski))
- Fixed strict prototype warning when using the RCT_EXTERN_REMAP_MODULE macro. ([746ad378c7](https://github.com/facebook/react-native/commit/746ad378c7efe3ee2f4926ab30e5401407f8b3ba) by [@dehlen](https://github.com/dehlen))
- Add safe guard when receive network response data too long ([3c4517ffb6](https://github.com/facebook/react-native/commit/3c4517ffb63d6adfdac5f9f7d51d834a22ac2cd9) by [@zhongwuzw](https://github.com/zhongwuzw))
- The wrong height result of onContentSizeChange callback ([5217cc972a](https://github.com/facebook/react-native/commit/5217cc972ae8b95c12f99b93619bd4399382e7e6) by [@zyestin](https://github.com/zyestin))
- Fix cleanAssetCatalog error ([d5114a4b9f](https://github.com/facebook/react-native/commit/d5114a4b9f079bc0d643f3d6f303310bd78074eb) by [@janicduplessis](https://github.com/janicduplessis))
- Fixes ScrollView contentInsetAdjustmentBehavior assignment ([86df742e73](https://github.com/facebook/react-native/commit/86df742e73ecacbf29921ab6f74333c36a7dca26) by [@zhongwuzw](https://github.com/zhongwuzw))
- Network invalidate handlers to cleanup in turbo module mode ([44d6e4310c](https://github.com/facebook/react-native/commit/44d6e4310cc9ad0d711d05e8dd5ee5220738e5b5) by [@zhongwuzw](https://github.com/zhongwuzw))
- Move ActionSheet UI operation to main thread ([aa9e824a75](https://github.com/facebook/react-native/commit/aa9e824a756a86f61873c270b17603468a2166ec) by [@zhongwuzw](https://github.com/zhongwuzw))
- Move UIRequiredDeviceCapabilities for RNTester to arm64 ([c7bd397dac](https://github.com/facebook/react-native/commit/c7bd397dacc1a809572142bb7f80adf76d6002fe) by [@fkgozali](https://github.com/fkgozali))
- Remove duplicated category NSTextStorage+FontScaling ([6eef3661bf](https://github.com/facebook/react-native/commit/6eef3661bf22a2b0f9b4e293a501fb095004a7d2) by [@zhongwuzw](https://github.com/zhongwuzw))
- `setState` is not working for nested inline views in text ([9b33e752c7](https://github.com/facebook/react-native/commit/9b33e752c7c414c9c04b20888a2e1e9d9f8aa8a3) by [@ehsemloh](https://github.com/ehsemloh))
- Unbreak Cocoapods build ([05d92bf2a5](https://github.com/facebook/react-native/commit/05d92bf2a5ed54c3e7a52b78a3edd699471c710f) by [@hieu9102002](https://github.com/hieu9102002))
- `setState` is not working properly for text inline image ([36ef6460f0](https://github.com/facebook/react-native/commit/36ef6460f04db323d8bbfc8be5e5dc26691a35ae) by [@ehsemloh](https://github.com/ehsemloh))
- Fix running timers when the proximity sensor detects close ([79eac9666d](https://github.com/facebook/react-native/commit/79eac9666d9f0e3a3b076f64be0e6c45f035cb84) by [@saghul](https://github.com/saghul))
- Fixes Dev menu pop up multiple times when Tap command `D` continuously ([a257e9f5f0](https://github.com/facebook/react-native/commit/a257e9f5f0cb871ead636e4dee0ce1271bb90df8) by [@zhongwuzw](https://github.com/zhongwuzw))
- Fix module create dead-lock when start-up ([a4a8695cec](https://github.com/facebook/react-native/commit/a4a8695cec640e5cf12be36a0c871115fbce9c87) by [@zhongwuzw](https://github.com/zhongwuzw))
- Adjust RCTRedBox to work for iPad and support orientation changes ([e2eb26c951](https://github.com/facebook/react-native/commit/e2eb26c951c3d2a0a4721428d00ffc02b501ecfa) by [@okwasniewski](https://github.com/okwasniewski))
- Fix autoscrollToTopThreshold on iOS old arch ([9666814750](https://github.com/facebook/react-native/commit/9666814750198574170a26e21a47b028f8060ffe) by [@janicduplessis](https://github.com/janicduplessis))
- Fix iOS Paper Scroll Event RTL check ([c40fc313ca](https://github.com/facebook/react-native/commit/c40fc313ca9dd66f9949c44f494d50951d96fe9d) by [@NickGerleman](https://github.com/NickGerleman))
- View flips horizontally in paper arch on RTL ([1d74b38634](https://github.com/facebook/react-native/commit/1d74b38634a27bce65eb6ea11111dac6653bd905) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- Fixed narrowing conversion compilation error. ([ed9931f456](https://github.com/facebook/react-native/commit/ed9931f456ea9b7b006d2741223c882186afe368))
- Fix grammar in Xcode 15 helper method name ([fa87eaaebf](https://github.com/facebook/react-native/commit/fa87eaaebf4103d365adf44d1d14ed6117cb37cb) by [@mikehardy](https://github.com/mikehardy))
- Prevent unwanted border animation ([5fbdc994f9](https://github.com/facebook/react-native/commit/5fbdc994f945ee8d834632649e3b82451660e8fe) by [@sammy-SC](https://github.com/sammy-SC))
- Adding ccache_clang wrapper scripts to package.json for distribution ([1c8751a16a](https://github.com/facebook/react-native/commit/1c8751a16a4de82f71831de338a726de800a227b) by [@CatStudioApp](https://github.com/CatStudioApp))
- Decouple RCTBridge+Private from jsinspector-modern ([49bb2f37f1](https://github.com/facebook/react-native/commit/49bb2f37f1bb83d8b370fd09d528975084873b5f) by [@philIip](https://github.com/philIip))
- Properly warn about `createRootViewWithBridge` being deprecated ([a1197695fc](https://github.com/facebook/react-native/commit/a1197695fc7dd7750001dc60853fd19f162dc69e) by [@okwasniewski](https://github.com/okwasniewski))
- Codegen correctly handles react-native.config.js. ([f5d5d9d284](https://github.com/facebook/react-native/commit/f5d5d9d284fae2bce42c9202bbfcf948e6a9ed37) by [@dmytrorykun](https://github.com/dmytrorykun))
- Support .tsx, .ts, and .jsx in component stacks ([adaf5eba3e](https://github.com/facebook/react-native/commit/adaf5eba3e8381d0b499257ab04d30d6f3fb4c93) by [@rickhanlonii](https://github.com/rickhanlonii))
- RCTRedBox not appearing in Bridgeless when metro is not running ([4adef35e97](https://github.com/facebook/react-native/commit/4adef35e97f31db466e536aa21d5eeec6ee34fc6) by [@okwasniewski](https://github.com/okwasniewski))
- Make sure that the New Architecture listens to orientation change events. ([49b0d26d45](https://github.com/facebook/react-native/commit/49b0d26d45096227767bca90a528d5bb031d80e7) by [@cipolleschi](https://github.com/cipolleschi))
- Avoid to show Metro Loading banner twice. ([64ed8200f7](https://github.com/facebook/react-native/commit/64ed8200f739b0e8289ec7336557fa3d5d381b97) by [@cipolleschi](https://github.com/cipolleschi))
- Support launchOptions in bridgeless mode. ([cb2d93ea50](https://github.com/facebook/react-native/commit/cb2d93ea50e62024d5238cccfc7242f7fd75d3b2) by [@cipolleschi](https://github.com/cipolleschi))
- Let RCTHost be initialized with a function to provide the `bundleURL` so that it can connect to metro on Reload when the url changes.
([90296be1d4](https://github.com/facebook/react-native/commit/90296be1d4fab09a52e02dd09f34f819136d0a07) by [@cipolleschi](https://github.com/cipolleschi))
- Fix: build settings for custom build configuration ([bcac3c4d9c](https://github.com/facebook/react-native/commit/bcac3c4d9c2b7c712018c9686dfa620479674082) by [@jblarriviere](https://github.com/jblarriviere))
- Remove invalidate observer instead of re-adding observer in DeviceInfo module ([91279a822b](https://github.com/facebook/react-native/commit/91279a822be949051866a694148e509c1308035b) by [@zhongwuzw](https://github.com/zhongwuzw))
- Add missing fields to native errors in new arch ([98b1331609](https://github.com/facebook/react-native/commit/98b1331609142979ba13659c103d7c3fd31c8198) by [@vonovak](https://github.com/vonovak))
- [0.74] Fix archive for MacOS Catalyst ([0e5dc51bba](https://github.com/facebook/react-native/commit/0e5dc51bbac105fb225ecc7966c1cde954b90330) by [@cipolleschi](https://github.com/cipolleschi))
- Fix RNTester project and remove CCACHE from project when disabled ([2b18fdf806](https://github.com/facebook/react-native/commit/2b18fdf8063b423a0fb5762f2c6044244b4c35e6) by [@cipolleschi](https://github.com/cipolleschi))
- Make sure that the Open Debugger appears in bridgeless mode ([18916f391a](https://github.com/facebook/react-native/commit/18916f391a63f8eb454d007f97be4dcdd8ae5ef4) by [@cipolleschi](https://github.com/cipolleschi))
- Change bridgeless check in dev menu ([776f90024f](https://github.com/facebook/react-native/commit/776f90024f9879b804b9de781acef7ac24d2e4f0) by [@zhongwuzw](https://github.com/zhongwuzw))
### Security
#### iOS specific
- Bump activesupport to minimum 6.1.7.5 CVE-2023-38037. ([07a159f279](https://github.com/facebook/react-native/commit/07a159f279cdcbed29c9c437dec1c0b8ac2d852f) by [@lunaleaps](https://github.com/lunaleaps))
## v0.73.8
### Added
#### iOS specific
- Added privacy manifest to template ([520d120375](https://github.com/facebook/react-native/commit/520d120375c6b24bc161adea4f48d76537a34abc) by [@philIip](https://github.com/philIip)) (_fixed to include the file in the build_)
### Changed
- Update Hermes version ([1d0cbfd01b](https://github.com/facebook/react-native/commit/1d0cbfd01b1f47bcf5279d86a9ad9e0d28804346) by [@Titozzz](https://github.com/Titozzz))
### Fixed
#### iOS specific
- Add `HERMES_ENABLE_DEBUGGER=1` flag to React-RuntimeApple ([794aaa52d3](https://github.com/facebook/react-native/commit/794aaa52d39f2c419fcd49126c69dff3030e7bb9) by [@cipolleschi](https://github.com/cipolleschi))
- Fix Symbol not found: (_JSGlobalContextSetInspectable) ([224ac21568](https://github.com/facebook/react-native/commit/224ac21568278617c192bf00b6254d30c0957e11) by [@cipolleschi](https://github.com/cipolleschi))
- Add missing dependency to React-RuntimeHermes podspec ([fd48b94319](https://github.com/facebook/react-native/commit/fd48b9431954be8a79d5c094173f064944ba86e6) by [@cipolleschi](https://github.com/cipolleschi))
## v0.73.7
### Fixed
#### Android specific
- Fix possible deadlock in dispatchViewUpdates ([b741899f99](https://github.com/facebook/react-native/commit/b741899f9994d270803e38bd98ce81adc8ba93fc))
- Fix crash in getChildDrawingOrder ([342ce6115b](https://github.com/facebook/react-native/commit/342ce6115b744cd2fcfd80effb609b37dc9d5b37))
- Fix Android HorizontalScrollView fling when content length less than ScrollView length ([bd19d0ec6a](https://github.com/facebook/react-native/commit/bd19d0ec6af45b1327190cb3d2496a13f637fba4))
#### iOS specific
- fix: build settings for custom build configuration ([2bcf18812a](https://github.com/facebook/react-native/commit/2bcf18812a67627490d589290c2ee0054c28b0b2))
- Fix archiving for Mac Catalyst ([a8a2f1a578](https://github.com/facebook/react-native/commit/a8a2f1a578624333a113f285327987fb4f3b6c15) by [@cipolleschi](https://github.com/cipolleschi))
- add privacy manifest to pod install ([3ccbd9cd8c](https://github.com/facebook/react-native/commit/3ccbd9cd8c5fdcbbdb2e56cd447001ee89c109fa))
## v0.73.6
### Breaking
#### iOS specific
- Rename `BUILD_FROM_SOURCE` to `RCT_BUILD_HERMES_FROM_SOURCE` ([51b80477c7](https://github.com/facebook/react-native/commit/51b80477c7836058fb29ef92c1a1908e3c8dba58) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- Fix component stacks for tsx, ts, and jsx files ([28f604a97d](https://github.com/facebook/react-native/commit/28f604a97dc57afa631a24052ae6660c13c2c761) by [@lunaleaps](https://github.com/lunaleaps))
#### iOS specific
- Prevent unwanted border animation([d979491](https://github.com/facebook/react-native/commit/d9794916b0549330513fe530abf090fa48b8a776) by [@sammy-SC](https://github.com/sammy-SC))
- Fix flipper for Xcode 15.3 ([9d22a7fd0e](https://github.com/facebook/react-native/commit/9d22a7fd0e82d6c2660217c1fb3c004ab30d6844) by [@cipolleschi](https://github.com/cipolleschi))
## v0.73.5
### Security
- Update CLI to 12.3.6 ([ffcd8f5249](https://github.com/facebook/react-native/commit/ffcd8f524903d5d6e92e864472aaefd52dea77cf) by [@szymonrybczak](https://github.com/szymonrybczak))
### Changed
- Hermes bump ([3bdd54a51c](https://github.com/facebook/react-native/commit/3bdd54a51ceea30cbbd0d1c45e9c391a80371dd2) by [@lunaleaps](https://github.com/lunaleaps))
### Fixed
- Fix: fix codegen not finding all third-party libraries ([67e2bb455f](https://github.com/facebook/react-native/commit/67e2bb455fd39f00fbf2b4d4f2f019327929efa6) by [@tido64](https://github.com/tido64))
- Fix compiler flags passed to libraries ([929df582c8](https://github.com/facebook/react-native/commit/929df582c885ad60bd34e52ced481f8e9d5666d9) by [@cipolleschi](https://github.com/cipolleschi))
## v0.73.4
### Fixed
@@ -49,6 +713,89 @@
- Fix race condition between A11yManager and UIManager ([f39f34ed82](https://github.com/facebook/react-native/commit/f39f34ed82997d0595522a285c3cb8693594e718) by [@cipolleschi](https://github.com/cipolleschi))
- Fix symbol not found _jump_fcontext with use_frameworks ([a2771ce58a](https://github.com/facebook/react-native/commit/a2771ce58ac221d1ac0de265c1ce571212fbcf83) by [@cipolleschi](https://github.com/cipolleschi))
## v0.72.15
### Added
#### iOS specific
- Add privacy manifest aggregation. ([61f584c3af](https://github.com/facebook/react-native/commit/61f584c3afb79ba705be8b6372ff9b6c5599680e) by [@aleqsio](https://github.com/aleqsio))
### Fixed
#### iOS specific
- Privacy Manifest aggregation failing due to no `NSPrivacyAccessedAPITypes` key. ([fc4e099920](https://github.com/facebook/react-native/commit/fc4e0999206ec7c1f465bb2b1fea987e43485a82) by [@renchap](https://github.com/renchap))
## v0.72.14
### Added
#### iOS specific
- add privacy manifest to hello world template ([d357a61ead](https://github.com/facebook/react-native/commit/d357a61ead033f30221f82f16aed771649c6d981) by [@phillip](https://github.com/phillip))
### Changed
#### iOS specific
- Bumped hermes to remove Apple's RR API that were unused. Hermes does not requires a PrivacyManifest now ([ee14572](https://github.com/facebook/react-native/commit/ee14572e2438dabc1076c434fa99350ab2e1c4b9) by [@hurali97](https://github.com/hurali97))
### Fixed
#### iOS specific
- fix Symbol not found: (_JSGlobalContextSetInspectable) ([ae4c62a](https://github.com/facebook/react-native/commit/ae4c62a933f7ffcfe4be8a3499fb6e1cbe7f1c43) by [@cipolleschi](https://github.com/cipolleschi))
## v0.72.13
### Added
#### iOS specific
- Add privacy manifest to pod install ([d39712f54a](https://github.com/facebook/react-native/commit/d39712f54a95e6dcdf1d2f80d9581211ab03c157) by [@philIip](https://github.com/philIip))
### Fixed
#### Android specific
- Fixed possible deadlock in dispatchViewUpdates ([b2ca41eef5](https://github.com/facebook/react-native/commit/b2ca41eef59b17d212b35baa4a28c4b27a465b5c) by [@EvertEt](https://github.com/EvertEt))
## v0.72.12
### Changed
- Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE ([a215805eb7](https://github.com/facebook/react-native/commit/a215805eb73f687116af4aa74461ff4e17b05f42) by [@cipolleschi](https://github.com/cipolleschi))
#### iOS specific
- [0.72] Fix flipper for Xcode 15.3 ([a316e0154e](https://github.com/facebook/react-native/commit/a316e0154ee8d1dd809be47694abb62d245bff0b) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- Fix component stacks for tsx, ts, and jsx files ([dd311c9782](https://github.com/facebook/react-native/commit/dd311c9782c9f4d0f9d98423de2ae71227a24a7d) by [@rickhanlonii](https://github.com/rickhanlonii))
- Fix flags for new arch ([0724c2769a](https://github.com/facebook/react-native/commit/0724c2769a3dea8f7886c8c541ffb49ae5c045dc) by [@cipolleschi](https://github.com/cipolleschi))
## v0.72.11
### Changed
- Upgrade CLI to 11.4.1 ([c57a29a08c](https://github.com/facebook/react-native/commit/c57a29a08c086728ea3bbb6b077c92fae6792d11) by [@szymonrybczak](https://github.com/szymonrybczak))
- Update Metro to ^0.76.9, CLI to ^11.4.0 ([ddff36f770](https://github.com/facebook/react-native/commit/ddff36f7705f1b5b2e27bfb2ee62f6726dfdd7bd) by [@robhogan](https://github.com/robhogan))
#### iOS specific
- Improve Swift support for 3rd party libs ([6939021518](https://github.com/facebook/react-native/commit/693902151899c85ff00418d75df4377a1096efee) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- Fix overriding EXCLUDED_ARCHS when installing Hermes on RN v0.72 ([a4282a91c3](https://github.com/facebook/react-native/commit/a4282a91c32f947adfb4f210e296e8dfeefdae34) by [@ken0nek](https://github.com/ken0nek))
#### iOS specific
- Don't allow cocoapods 1.15. ([08fd9170fc](https://github.com/facebook/react-native/commit/08fd9170fcdc7042fdcfe5f54eec71ed245d9795) by [@blakef](https://github.com/blakef))
## v0.72.10
### Added
@@ -991,6 +1738,36 @@ This file contains all changelogs for latest releases, from 0.70.0 onward. Pleas
- Enable Address and Undefined Behavior Sanitizers on RNTester ([65e61f3c88](https://github.com/facebook/react-native/commit/65e61f3c88388d4a2ed88bcc9a2cb5ba63fd8afa) by [@Saadnajmi](https://github.com/Saadnajmi))
## v0.71.19
### Added
#### iOS Specific
- Add privacy manifest to pod install and hello world ([d669ff7df8](https://github.com/facebook/react-native/commit/d669ff7df8727decb18143065273077db93267b6) by [@philIip](https://github.com/philIip))
### Changed
#### iOS Specific
- Bumped hermes to remove Apple's RR API that were unused. Hermes does not requires a PrivacyManifest now. ([d8d096d995](https://github.com/facebook/react-native/commit/d8d096d995eacf63bc76b6a7f2ec4265c9fc1f37) by [@cipolleschi](https://github.com/cipolleschi))
## v0.71.18
### Fixed
- Fix component stacks for tsx, ts, and jsx files ([631c013126](https://github.com/facebook/react-native/commit/631c01312632c5483013afef171c8cd85cb007c8) by [@hurali97](https://github.com/hurali97))
#### iOS specific
- Fix flipper for Xcode 15.3 ([2944ca6554](https://github.com/facebook/react-native/commit/2944ca65544661ea22cdad5d6230cd9ea2ade5ca) by [@cipolleschi](https://github.com/cipolleschi))
## v0.71.17
### Security
- Update CLI to 10.2.7 ([28998075d9](https://github.com/facebook/react-native/commit/28998075d98754bc72a65887346f027a9657b6a3) by [@szymonrybczak](https://github.com/szymonrybczak))
## v0.71.16
### Changed
+3
View File
@@ -44,6 +44,9 @@ declare module 'chrome-launcher' {
declare class Launcher {
getChromePath(): string;
launch(options: Options): Promise<LaunchedChrome>;
Launcher: {
defaultFlags(): Array<string>,
};
}
declare module.exports: Launcher;
@@ -9,7 +9,7 @@
* @oncall react_native
*/
declare module '@rnx-kit/chromium-edge-launcher' {
declare module 'chromium-edge-launcher' {
import typeof fs from 'fs';
import typeof childProcess from 'child_process';
import type {ChildProcess} from 'child_process';
+999
View File
@@ -0,0 +1,999 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
* @oncall react_native
* @generated
*/
// Flowtype definitions for commander
// Generated by Flowgen from a Typescript Definition
// Flowgen v1.21.0
declare module 'commander' {
declare type LiteralUnion<LiteralType, BaseType: string | number> =
| LiteralType
| {...BaseType, ...{[key: empty]: empty, ...}};
declare export class CommanderError mixins Error {
code: string;
exitCode: number;
message: string;
nestedError?: string;
/**
* Constructs the CommanderError class
* @param exitCode - suggested exit code which could be used with process.exit
* @param code - an id string representing the error
* @param message - human-readable description of the error
* @constructor
*/
constructor(exitCode: number, code: string, message: string): this;
}
declare export class InvalidArgumentError mixins CommanderError {
/**
* Constructs the InvalidArgumentError class
* @param message - explanation of why argument is invalid
* @constructor
*/
constructor(message: string): this;
}
declare export {InvalidArgumentError as InvalidOptionArgumentError};
export interface ErrorOptions {
/**
* an id string representing the error
*/
code?: string;
/**
* suggested exit code which could be used with process.exit
*/
exitCode?: number;
}
declare export class Argument {
description: string;
required: boolean;
variadic: boolean;
defaultValue?: any;
defaultValueDescription?: string;
argChoices?: string[];
/**
* Initialize a new command argument with the given name and description.
* The default is that the argument is required, and you can explicitly
* indicate this with <> around the name. Put [] around the name for an optional argument.
*/
constructor(arg: string, description?: string): this;
/**
* Return argument name.
*/
name(): string;
/**
* Set the default value, and optionally supply the description to be displayed in the help.
*/
default(value: mixed, description?: string): this;
/**
* Set the custom handler for processing CLI command arguments into argument values.
*/
argParser<T>(fn: (value: string, previous: T) => T): this;
/**
* Only allow argument value to be one of choices.
*/
choices(values: $ReadOnlyArray<string>): this;
/**
* Make argument required.
*/
argRequired(): this;
/**
* Make argument optional.
*/
argOptional(): this;
}
declare export class Option {
flags: string;
description: string;
required: boolean;
optional: boolean;
variadic: boolean;
mandatory: boolean;
short?: string;
long?: string;
negate: boolean;
defaultValue?: any;
defaultValueDescription?: string;
presetArg?: mixed;
envVar?: string;
parseArg?: <T>(value: string, previous: T) => T;
hidden: boolean;
argChoices?: string[];
constructor(flags: string, description?: string): this;
/**
* Set the default value, and optionally supply the description to be displayed in the help.
*/
default(value: mixed, description?: string): this;
/**
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
* The custom processing (parseArg) is called.
* @example ```ts
* new Option('--color').default('GREYSCALE').preset('RGB');
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
* ```
*/
preset(arg: mixed): this;
/**
* Add option name(s) that conflict with this option.
* An error will be displayed if conflicting options are found during parsing.
* @example ```ts
* new Option('--rgb').conflicts('cmyk');
* new Option('--js').conflicts(['ts', 'jsx']);
* ```
*/
conflicts(names: string | string[]): this;
/**
* Specify implied option values for when this option is set and the implied options are not.
*
* The custom processing (parseArg) is not called on the implied values.
* @example program
* .addOption(new Option('--log', 'write logging information to file'))
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
*/
implies(optionValues: OptionValues): this;
/**
* Set environment variable to check for option value.
*
* An environment variables is only used if when processed the current option value is
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
*/
env(name: string): this;
/**
* Calculate the full description, including defaultValue etc.
*/
fullDescription(): string;
/**
* Set the custom handler for processing CLI option arguments into option values.
*/
argParser<T>(fn: (value: string, previous: T) => T): this;
/**
* Whether the option is mandatory and must have a value after parsing.
*/
makeOptionMandatory(mandatory?: boolean): this;
/**
* Hide option in help.
*/
hideHelp(hide?: boolean): this;
/**
* Only allow option value to be one of choices.
*/
choices(values: $ReadOnlyArray<string>): this;
/**
* Return option name.
*/
name(): string;
/**
* Return option name, in a camelcase format that can be used
* as a object attribute key.
*/
attributeName(): string;
/**
* Return whether a boolean option.
*
* Options are one of boolean, negated, required argument, or optional argument.
*/
isBoolean(): boolean;
}
declare export class Help {
/**
* output helpWidth, long lines are wrapped to fit
*/
helpWidth?: number;
sortSubcommands: boolean;
sortOptions: boolean;
showGlobalOptions: boolean;
constructor(): this;
/**
* Get the command term to show in the list of subcommands.
*/
subcommandTerm(cmd: Command): string;
/**
* Get the command summary to show in the list of subcommands.
*/
subcommandDescription(cmd: Command): string;
/**
* Get the option term to show in the list of options.
*/
optionTerm(option: Option): string;
/**
* Get the option description to show in the list of options.
*/
optionDescription(option: Option): string;
/**
* Get the argument term to show in the list of arguments.
*/
argumentTerm(argument: Argument): string;
/**
* Get the argument description to show in the list of arguments.
*/
argumentDescription(argument: Argument): string;
/**
* Get the command usage to be displayed at the top of the built-in help.
*/
commandUsage(cmd: Command): string;
/**
* Get the description for the command.
*/
commandDescription(cmd: Command): string;
/**
* Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
*/
visibleCommands(cmd: Command): Command[];
/**
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
*/
visibleOptions(cmd: Command): Option[];
/**
* Get an array of the visible global options. (Not including help.)
*/
visibleGlobalOptions(cmd: Command): Option[];
/**
* Get an array of the arguments which have descriptions.
*/
visibleArguments(cmd: Command): Argument[];
/**
* Get the longest command term length.
*/
longestSubcommandTermLength(cmd: Command, helper: Help): number;
/**
* Get the longest option term length.
*/
longestOptionTermLength(cmd: Command, helper: Help): number;
/**
* Get the longest global option term length.
*/
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
/**
* Get the longest argument term length.
*/
longestArgumentTermLength(cmd: Command, helper: Help): number;
/**
* Calculate the pad width from the maximum term length.
*/
padWidth(cmd: Command, helper: Help): number;
/**
* Wrap the given string to width characters per line, with lines after the first indented.
* Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
*/
wrap(
str: string,
width: number,
indent: number,
minColumnWidth?: number,
): string;
/**
* Generate the built-in help text.
*/
formatHelp(cmd: Command, helper: Help): string;
}
export type HelpConfiguration = $Rest<Help, {...}>;
export interface ParseOptions {
from: 'node' | 'electron' | 'user';
}
export interface HelpContext {
error: boolean;
}
export interface AddHelpTextContext {
error: boolean;
command: Command;
}
export interface OutputConfiguration {
writeOut?: (str: string) => void;
writeErr?: (str: string) => void;
getOutHelpWidth?: () => number;
getErrHelpWidth?: () => number;
outputError?: (str: string, write: (str: string) => void) => void;
}
export type AddHelpTextPosition =
| 'beforeAll'
| 'before'
| 'after'
| 'afterAll';
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
export type OptionValueSource = LiteralUnion<
'default' | 'config' | 'env' | 'cli' | 'implied',
string,
> | void;
export type OptionValues = {[key: string]: any, ...};
declare export class Command {
args: string[];
processedArgs: any[];
+commands: $ReadOnlyArray<Command>;
+options: $ReadOnlyArray<Option>;
+registeredArguments: $ReadOnlyArray<Argument>;
parent: Command | null;
constructor(name?: string): this;
/**
* Set the program version to `str`.
*
* This method auto-registers the "-V, --version" flag
* which will print the version number when passed.
*
* You can optionally supply the flags and description to override the defaults.
*/
version(str: string, flags?: string, description?: string): this;
/**
* Get the program version.
*/
version(): string | void;
/**
* Define a command, implemented using an action handler.
* @remarks The command description is supplied using `.description`, not as a parameter to `.command`.
* @example ```ts
* program
* .command('clone <source> [destination]')
* .description('clone a repository into a newly created directory')
* .action((source, destination) => {
* console.log('clone command called');
* });
* ```
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
* @param opts - configuration options
* @returns new command
*/
command(nameAndArgs: string, opts?: CommandOptions): Command;
/**
* Define a command, implemented in a separate executable file.
* @remarks The command description is supplied as the second parameter to `.command`.
* @example ```ts
* program
* .command('start <service>', 'start named service')
* .command('stop [service]', 'stop named service, or all if no name supplied');
* ```
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
* @param description - description of executable command
* @param opts - configuration options
* @returns `this` command for chaining
*/
command(
nameAndArgs: string,
description: string,
opts?: ExecutableCommandOptions,
): this;
/**
* Factory routine to create a new unattached command.
*
* See .command() for creating an attached subcommand, which uses this routine to
* create the command. You can override createCommand to customise subcommands.
*/
createCommand(name?: string): Command;
/**
* Add a prepared subcommand.
*
* See .command() for creating an attached subcommand which inherits settings from its parent.
* @returns `this` command for chaining
*/
addCommand(cmd: Command, opts?: CommandOptions): this;
/**
* Factory routine to create a new unattached argument.
*
* See .argument() for creating an attached argument, which uses this routine to
* create the argument. You can override createArgument to return a custom argument.
*/
createArgument(name: string, description?: string): Argument;
/**
* Define argument syntax for command.
*
* The default is that the argument is required, and you can explicitly
* indicate this with <> around the name. Put [] around the name for an optional argument.
* @example ```
* program.argument('<input-file>');
* program.argument('[output-file]');
* ```
* @returns `this` command for chaining
*/
argument<T>(
flags: string,
description: string,
fn: (value: string, previous: T) => T,
defaultValue?: T,
): this;
argument(name: string, description?: string, defaultValue?: mixed): this;
/**
* Define argument syntax for command, adding a prepared argument.
* @returns `this` command for chaining
*/
addArgument(arg: Argument): this;
/**
* Define argument syntax for command, adding multiple at once (without descriptions).
*
* See also .argument().
* @example ```
* program.arguments('<cmd> [env]');
* ```
* @returns `this` command for chaining
*/
arguments(names: string): this;
/**
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
* @example ```ts
* program.helpCommand('help [cmd]');
* program.helpCommand('help [cmd]', 'show help');
* program.helpCommand(false); // suppress default help command
* program.helpCommand(true); // add help command even if no subcommands
* ```
*/
helpCommand(nameAndArgs: string, description?: string): this;
helpCommand(enable: boolean): this;
/**
* Add prepared custom help command.
*/
addHelpCommand(cmd: Command): this;
/**
* @deprecated since v12, instead use helpCommand
*/
addHelpCommand(nameAndArgs: string, description?: string): this;
/**
* @deprecated since v12, instead use helpCommand
*/
addHelpCommand(enable?: boolean): this;
/**
* Add hook for life cycle event.
*/
hook(
event: HookEvent,
listener: (
thisCommand: Command,
actionCommand: Command,
) => void | Promise<void>,
): this;
/**
* Register callback to use as replacement for calling process.exit.
*/
exitOverride(callback?: (err: CommanderError) => empty | void): this;
/**
* Display error message and exit (or call exitOverride).
*/
error(message: string, errorOptions?: ErrorOptions): empty;
/**
* You can customise the help with a subclass of Help by overriding createHelp,
* or by overriding Help properties using configureHelp().
*/
createHelp(): Help;
/**
* You can customise the help by overriding Help properties using configureHelp(),
* or with a subclass of Help by overriding createHelp().
*/
configureHelp(configuration: HelpConfiguration): this;
/**
* Get configuration
*/
configureHelp(): HelpConfiguration;
/**
* The default output goes to stdout and stderr. You can customise this for special
* applications. You can also customise the display of errors by overriding outputError.
*
* The configuration properties are all functions:
* ```
* // functions to change where being written, stdout and stderr
* writeOut(str)
* writeErr(str)
* // matching functions to specify width for wrapping help
* getOutHelpWidth()
* getErrHelpWidth()
* // functions based on what is being written out
* outputError(str, write) // used for displaying errors, and not used for displaying help
* ```
*/
configureOutput(configuration: OutputConfiguration): this;
/**
* Get configuration
*/
configureOutput(): OutputConfiguration;
/**
* Copy settings that are useful to have in common across root command and subcommands.
*
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
*/
copyInheritedSettings(sourceCommand: Command): this;
/**
* Display the help or a custom message after an error occurs.
*/
showHelpAfterError(displayHelp?: boolean | string): this;
/**
* Display suggestion of similar commands for unknown commands, or options for unknown options.
*/
showSuggestionAfterError(displaySuggestion?: boolean): this;
/**
* Register callback `fn` for the command.
* @example ```
* program
* .command('serve')
* .description('start service')
* .action(function() {
* // do work here
* });
* ```
* @returns `this` command for chaining
*/
action(fn: (...args: any[]) => void | Promise<void>): this;
/**
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
*
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
*
* See the README for more details, and see also addOption() and requiredOption().
* @example ```js
* program
* .option('-p, --pepper', 'add pepper')
* .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
* ```
* @returns `this` command for chaining
*/
option(
flags: string,
description?: string,
defaultValue?: string | boolean | string[],
): this;
option<T>(
flags: string,
description: string,
parseArg: (value: string, previous: T) => T,
defaultValue?: T,
): this;
/**
* @deprecated since v7, instead use choices or a custom function
*/
option(
flags: string,
description: string,
regexp: RegExp,
defaultValue?: string | boolean | string[],
): this;
/**
* Define a required option, which must have a value after parsing. This usually means
* the option must be specified on the command line. (Otherwise the same as .option().)
*
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
*/
requiredOption(
flags: string,
description?: string,
defaultValue?: string | boolean | string[],
): this;
requiredOption<T>(
flags: string,
description: string,
parseArg: (value: string, previous: T) => T,
defaultValue?: T,
): this;
/**
* @deprecated since v7, instead use choices or a custom function
*/
requiredOption(
flags: string,
description: string,
regexp: RegExp,
defaultValue?: string | boolean | string[],
): this;
/**
* Factory routine to create a new unattached option.
*
* See .option() for creating an attached option, which uses this routine to
* create the option. You can override createOption to return a custom option.
*/
createOption(flags: string, description?: string): Option;
/**
* Add a prepared Option.
*
* See .option() and .requiredOption() for creating and attaching an option in a single call.
*/
addOption(option: Option): this;
/**
* Whether to store option values as properties on command object,
* or store separately (specify false). In both cases the option values can be accessed using .opts().
* @returns `this` command for chaining
*/
storeOptionsAsProperties<T: OptionValues>(): {...this, ...T};
storeOptionsAsProperties<T: OptionValues>(storeAsProperties: true): {
...this,
...T,
};
storeOptionsAsProperties(storeAsProperties?: boolean): this;
/**
* Retrieve option value.
*/
getOptionValue(key: string): any;
/**
* Store option value.
*/
setOptionValue(key: string, value: mixed): this;
/**
* Store option value and where the value came from.
*/
setOptionValueWithSource(
key: string,
value: mixed,
source: OptionValueSource,
): this;
/**
* Get source of option value.
*/
getOptionValueSource(key: string): OptionValueSource | void;
/**
* Get source of option value. See also .optsWithGlobals().
*/
getOptionValueSourceWithGlobals(key: string): OptionValueSource | void;
/**
* Alter parsing of short flags with optional values.
* @example ```
* // for `.option('-f,--flag [value]'):
* .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
* .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
* ```
* @returns `this` command for chaining
*/
combineFlagAndOptionalValue(combine?: boolean): this;
/**
* Allow unknown options on the command line.
* @returns `this` command for chaining
*/
allowUnknownOption(allowUnknown?: boolean): this;
/**
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
* @returns `this` command for chaining
*/
allowExcessArguments(allowExcess?: boolean): this;
/**
* Enable positional options. Positional means global options are specified before subcommands which lets
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
*
* The default behaviour is non-positional and global options may appear anywhere on the command line.
* @returns `this` command for chaining
*/
enablePositionalOptions(positional?: boolean): this;
/**
* Pass through options that come after command-arguments rather than treat them as command-options,
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
* positional options to have been enabled on the program (parent commands).
*
* The default behaviour is non-positional and options may appear before or after command-arguments.
* @returns `this` command for chaining
*/
passThroughOptions(passThrough?: boolean): this;
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* The default expectation is that the arguments are from node and have the application as argv[0]
* and the script being run in argv[1], with user parameters after that.
* @example ```
* program.parse(process.argv);
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
* ```
* @returns `this` command for chaining
*/
parse(argv?: $ReadOnlyArray<string>, options?: ParseOptions): this;
/**
* Parse `argv`, setting options and invoking commands when defined.
*
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
*
* The default expectation is that the arguments are from node and have the application as argv[0]
* and the script being run in argv[1], with user parameters after that.
* @example ```
* program.parseAsync(process.argv);
* program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
* program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
* ```
* @returns Promise
*/
parseAsync(
argv?: $ReadOnlyArray<string>,
options?: ParseOptions,
): Promise<this>;
/**
* Parse options from `argv` removing known options,
* and return argv split into operands and unknown arguments.
*
* argv => operands, unknown
* --known kkk op => [op], []
* op --known kkk => [op], []
* sub --unknown uuu op => [sub], [--unknown uuu op]
* sub -- --unknown uuu op => [sub --unknown uuu op], []
*/
parseOptions(argv: string[]): ParseOptionsResult;
/**
* Return an object containing local option values as key-value pairs
*/
opts<T: OptionValues>(): T;
/**
* Return an object containing merged local and global option values as key-value pairs.
*/
optsWithGlobals<T: OptionValues>(): T;
/**
* Set the description.
* @returns `this` command for chaining
*/
description(str: string): this;
/**
* @deprecated since v8, instead use .argument to add command argument with description
*/
description(
str: string,
argsDescription: {[key: string]: string, ...},
): this;
/**
* Get the description.
*/
description(): string;
/**
* Set the summary. Used when listed as subcommand of parent.
* @returns `this` command for chaining
*/
summary(str: string): this;
/**
* Get the summary.
*/
summary(): string;
/**
* Set an alias for the command.
*
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
* @returns `this` command for chaining
*/
alias(alias: string): this;
/**
* Get alias for the command.
*/
alias(): string;
/**
* Set aliases for the command.
*
* Only the first alias is shown in the auto-generated help.
* @returns `this` command for chaining
*/
aliases(aliases: $ReadOnlyArray<string>): this;
/**
* Get aliases for the command.
*/
aliases(): string[];
/**
* Set the command usage.
* @returns `this` command for chaining
*/
usage(str: string): this;
/**
* Get the command usage.
*/
usage(): string;
/**
* Set the name of the command.
* @returns `this` command for chaining
*/
name(str: string): this;
/**
* Get the name of the command.
*/
name(): string;
/**
* Set the name of the command from script filename, such as process.argv[1],
* or require.main.filename, or __filename.
*
* (Used internally and public although not documented in README.)
* @example ```ts
* program.nameFromFilename(require.main.filename);
* ```
* @returns `this` command for chaining
*/
nameFromFilename(filename: string): this;
/**
* Set the directory for searching for executable subcommands of this command.
* @example ```ts
* program.executableDir(__dirname);
* // or
* program.executableDir('subcommands');
* ```
* @returns `this` command for chaining
*/
executableDir(path: string): this;
/**
* Get the executable search directory.
*/
executableDir(): string | null;
/**
* Output help information for this command.
*
* Outputs built-in help, and custom text added using `.addHelpText()`.
*/
outputHelp(context?: HelpContext): void;
/**
* @deprecated since v7
*/
outputHelp(cb?: (str: string) => string): void;
/**
* Return command help documentation.
*/
helpInformation(context?: HelpContext): string;
/**
* You can pass in flags and a description to override the help
* flags and help description for your command. Pass in false
* to disable the built-in help option.
*/
helpOption(flags?: string | boolean, description?: string): this;
/**
* Supply your own option to use for the built-in help option.
* This is an alternative to using helpOption() to customise the flags and description etc.
*/
addHelpOption(option: Option): this;
/**
* Output help information and exit.
*
* Outputs built-in help, and custom text added using `.addHelpText()`.
*/
help(context?: HelpContext): empty;
/**
* @deprecated since v7
*/
help(cb?: (str: string) => string): empty;
/**
* Add additional text to be displayed with the built-in help.
*
* Position is 'before' or 'after' to affect just this command,
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
*/
addHelpText(position: AddHelpTextPosition, text: string): this;
addHelpText(
position: AddHelpTextPosition,
text: (context: AddHelpTextContext) => string,
): this;
/**
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
*/
on(event: string | Symbol, listener: (...args: any[]) => void): this;
}
export interface CommandOptions {
hidden?: boolean;
isDefault?: boolean;
/**
* @deprecated since v7, replaced by hidden
*/
noHelp?: boolean;
}
export type ExecutableCommandOptions = {
executableFile?: string,
...
} & CommandOptions;
export interface ParseOptionsResult {
operands: string[];
unknown: string[];
}
declare export function createCommand(name?: string): Command;
declare export function createOption(
flags: string,
description?: string,
): Option;
declare export function createArgument(
name: string,
description?: string,
): Argument;
declare export var program: Command;
}
+61
View File
@@ -0,0 +1,61 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow
* @format
*/
declare module 'listr2' {
declare export type TaskResult<
ContextT = {__proto__: null},
ReturnT = mixed,
> =
| ReturnT
| Promise<ReturnT>
| rxjs$Observable<ReturnT>
| stream$Readable
| Listr<ContextT>;
declare type TaskFn<ContextT, ReturnT> = (
ctx: ContextT,
task: TaskInstance,
) => TaskResult<ContextT, ReturnT>;
declare type SkipResultSync = boolean | string;
declare type SkipResult = SkipResultSync | Promise<SkipResultSync>;
declare type SkipFn<ContextT> = (ctx: ContextT) => SkipResult;
declare type CustomRenderer = {...}; // TODO
declare interface TaskInstance {
title: string;
output: string;
skip(reason?: string): void;
}
declare export type TaskSpec<
ContextT = {__proto__: null},
ReturnT = mixed,
> = {
title: string,
task: TaskFn<ContextT, ReturnT>,
skip?: SkipFn<ContextT>,
};
declare export type Options = {
concurrent?: boolean | number,
exitOnError?: boolean,
renderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
nonTTYRenderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
};
declare export class Listr<ContextT> {
constructor<ReturnT>(
tasks: Array<TaskSpec<ContextT, ReturnT>>,
options?: Options,
): void;
add<ReturnT>(task: TaskSpec<ContextT, ReturnT>): this;
add<ReturnT>(tasks: $ReadOnlyArray<TaskSpec<ContextT, ReturnT>>): this;
run(ctx?: ContextT): Promise<ContextT>;
}
}
+61
View File
@@ -0,0 +1,61 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow
* @format
*/
declare module 'listr' {
declare export type TaskResult<
ContextT = {__proto__: null},
ReturnT = mixed,
> =
| ReturnT
| Promise<ReturnT>
| rxjs$Observable<ReturnT>
| stream$Readable
| Listr<ContextT>;
declare type TaskFn<ContextT, ReturnT> = (
ctx: ContextT,
task: TaskInstance,
) => TaskResult<ContextT, ReturnT>;
declare type SkipResultSync = boolean | string;
declare type SkipResult = SkipResultSync | Promise<SkipResultSync>;
declare type SkipFn<ContextT> = (ctx: ContextT) => SkipResult;
declare type CustomRenderer = {...}; // TODO
declare interface TaskInstance {
title: string;
output: string;
skip(reason?: string): void;
}
declare export type TaskSpec<
ContextT = {__proto__: null},
ReturnT = mixed,
> = {
title: string,
task: TaskFn<ContextT, ReturnT>,
skip?: SkipFn<ContextT>,
};
declare export type Options = {
concurrent?: boolean | number,
exitOnError?: boolean,
renderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
nonTTYRenderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
};
declare export default class Listr<ContextT> {
constructor<ReturnT>(
tasks: Array<TaskSpec<ContextT, ReturnT>>,
options?: Options,
): void;
add<ReturnT>(task: TaskSpec<ContextT, ReturnT>): this;
add<ReturnT>(tasks: $ReadOnlyArray<TaskSpec<ContextT, ReturnT>>): this;
run(ctx?: ContextT): Promise<ContextT>;
}
}
+3364
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -136,7 +136,6 @@ declare interface $npm$shelljs$Result {
((rest: void) => $npm$shelljs$String);
}
// $FlowFixMe[unsupported-syntax]
declare module 'shelljs' {
declare export type ShellArray<T> = $npm$shelljs$Array<T>;
declare export type ShellAsync = $npm$shelljs$Async;
@@ -1,17 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// You can use this script to configure the gradleEnterprise{} block in your build.
// You need to rename this file to ./gradle/gradle-enterprise.gradle.kts in order for
// this to be processed.
extensions.getByName("gradleEnterprise").withGroovyBuilder {
setProperty("server", "https://your-gradle-enterprise-instance.example.com")
getProperty("buildScan").withGroovyBuilder {
"publishAlways"()
"tag"(if(System.getenv("CI") != null) "CI" else "Local")
}
}
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -1
View File
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
-7
View File
@@ -33,7 +33,6 @@ module.exports = {
'<rootDir>/packages/react-native/template',
'<rootDir>/packages/react-native/sdks',
'<rootDir>/packages/react-native/Libraries/Renderer',
'<rootDir>/packages/rn-tester/e2e',
'<rootDir>/packages/react-native-test-renderer/src',
],
transformIgnorePatterns: ['node_modules/(?!@react-native/)'],
@@ -41,12 +40,6 @@ module.exports = {
defaultPlatform: 'ios',
platforms: ['ios', 'android'],
},
moduleNameMapper: {
// This module is internal to Meta and used by their custom React renderer.
// In tests, we can just use a mock.
'^ReactNativeInternalFeatureFlags$':
'<rootDir>/packages/react-native/jest/ReactNativeInternalFeatureFlagsMock.js',
},
moduleFileExtensions: ['fb.js'].concat(defaults.moduleFileExtensions),
modulePathIgnorePatterns: ['scripts/.*/__fixtures__/'],
unmockedModulePathPatterns: [
+17 -26
View File
@@ -2,19 +2,11 @@
"name": "@react-native/monorepo",
"private": true,
"version": "1000.0.0",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": "github:facebook/react-native",
"types": "types",
"jest-junit": {
"outputDirectory": "reports/junit",
"outputName": "js-test-results.xml"
},
"scripts": {
"android": "cd packages/rn-tester && npm run android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
"build": "node ./scripts/build/build.js",
"bump-all-updated-packages": "node ./scripts/monorepo/bump-all-updated-packages",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"flow-check": "flow check",
@@ -46,9 +38,6 @@
"packages/*",
"tools/*"
],
"peerDependencies": {
"react": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/eslint-parser": "^7.20.0",
@@ -59,26 +48,26 @@
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.6.3",
"@pkgjs/parseargs": "^0.11.0",
"@react-native/metro-babel-transformer": "0.74.0",
"@react-native/metro-config": "0.74.0",
"@react-native/metro-babel-transformer": "0.75.0-main",
"@react-native/metro-config": "0.75.0-main",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.0.18",
"@typescript-eslint/parser": "^6.7.4",
"@types/react": "^18.2.6",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"async": "^3.2.2",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-syntax-hermes-parser": "0.22.0",
"babel-plugin-transform-define": "^2.1.2",
"babel-plugin-transform-flow-enums": "^0.0.2",
"babel-preset-fbjs": "^3.4.0",
"chalk": "^4.0.0",
"clang-format": "^1.8.0",
"connect": "^3.6.5",
"eslint": "^8.23.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-lint": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
@@ -87,11 +76,11 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.19.1",
"flow-bin": "^0.228.0",
"flow-api-translator": "0.22.0",
"flow-bin": "^0.238.0",
"glob": "^7.1.1",
"hermes-eslint": "0.19.1",
"hermes-transform": "0.19.1",
"hermes-eslint": "0.22.0",
"hermes-transform": "0.22.0",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
@@ -100,18 +89,20 @@
"metro-memory-fs": "^0.80.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.19.1",
"react": "18.2.0",
"react-test-renderer": "18.2.0",
"prettier-plugin-hermes-parser": "0.22.0",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.2"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
+2 -2
View File
@@ -1,11 +1,11 @@
{
"name": "@react-native/assets-registry",
"version": "0.74.0",
"version": "0.75.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native.git",
"url": "git+https://github.com/facebook/react-native.git",
"directory": "packages/assets"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/assets#readme",
+1
View File
@@ -29,6 +29,7 @@ const ANDROID_BASE_DENSITY = 160;
*/
function getAndroidAssetSuffix(scale: number): string {
if (scale.toString() in androidScaleSuffix) {
// $FlowFixMe[invalid-computed-prop]
return androidScaleSuffix[scale.toString()];
}
// NOTE: Android Gradle Plugin does not fully support the nnndpi format.
+3 -3
View File
@@ -1,11 +1,11 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.74.0",
"version": "0.75.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native.git",
"url": "git+https://github.com/facebook/react-native.git",
"directory": "packages/babel-plugin-codegen"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/babel-plugin-codegen#readme",
@@ -25,7 +25,7 @@
"index.js"
],
"dependencies": {
"@react-native/codegen": "0.74.0"
"@react-native/codegen": "0.75.0-main"
},
"devDependencies": {
"@babel/core": "^7.20.0"
-18
View File
@@ -69,24 +69,6 @@ npx react-native bundle --entry-file <path> [options]
| `--read-global-cache` | Attempt to fetch transformed JS code from the global cache, if configured. Defaults to `false`. |
| `--config <string>` | Path to the CLI configuration file. |
### `ram-bundle`
Build the [RAM bundle](https://reactnative.dev/docs/ram-bundles-inline-requires) for the provided JavaScript entry file.
#### Usage
```sh
npx react-native ram-bundle --entry-file <path> [options]
```
#### Options
Accepts all options supported by [`bundle`](#bundle) and the following:
| Option | Description |
| - | - |
| `--indexed-ram-bundle` | Force the "Indexed RAM" bundle file format, even when building for Android. |
## Contributing
Changes to this package can be made locally and tested against the `rn-tester` app, per the [Contributing guide](https://reactnative.dev/contributing/overview#contributing-code). During development, this package is automatically run from source with no build step.
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.74.0",
"version": "0.75.0-main",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -10,7 +10,7 @@
"bugs": "https://github.com/facebook/react-native/issues",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native.git",
"url": "git+https://github.com/facebook/react-native.git",
"directory": "packages/community-cli-plugin"
},
"license": "MIT",
@@ -22,10 +22,10 @@
"dist"
],
"dependencies": {
"@react-native-community/cli-server-api": "13.6.0",
"@react-native-community/cli-tools": "13.6.0",
"@react-native/dev-middleware": "0.74.0",
"@react-native/metro-babel-transformer": "0.74.0",
"@react-native-community/cli-server-api": "14.0.0-alpha.2",
"@react-native-community/cli-tools": "14.0.0-alpha.2",
"@react-native/dev-middleware": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.75.0-main",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "^0.80.3",
@@ -1,38 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {BundleCommandArgs} from '../bundle';
import type {Command, Config} from '@react-native-community/cli-types';
import bundleCommand from '../bundle';
import buildBundle from '../bundle/buildBundle';
import metroRamBundle from 'metro/src/shared/output/RamBundle';
const ramBundleCommand: Command = {
name: 'ram-bundle',
description:
'Build the RAM bundle for the provided JavaScript entry file. See https://reactnative.dev/docs/ram-bundles-inline-requires.',
func: (argv: Array<string>, config: Config, args: BundleCommandArgs) => {
return buildBundle(argv, config, args, metroRamBundle);
},
options: [
// $FlowFixMe[incompatible-type] options is nonnull
...bundleCommand.options,
{
name: '--indexed-ram-bundle',
description:
'Force the "Indexed RAM" bundle file format, even when building for android',
default: false,
},
],
};
export default ramBundleCommand;
@@ -38,7 +38,7 @@ export type StartCommandArgs = {
https?: boolean,
maxWorkers?: number,
key?: string,
platforms?: string[],
platforms: string[],
port?: number,
resetCache?: boolean,
sourceExts?: string[],
@@ -57,7 +57,7 @@ async function runServer(
const metroConfig = await loadMetroConfig(ctx, {
config: args.config,
maxWorkers: args.maxWorkers,
port: args.port ?? 8081,
port: args.port,
resetCache: args.resetCache,
watchFolders: args.watchFolders,
projectRoot: args.projectRoot,
@@ -10,7 +10,6 @@
*/
export {default as bundleCommand} from './commands/bundle';
export {default as ramBundleCommand} from './commands/ram-bundle';
export {default as startCommand} from './commands/start';
export {unstable_buildBundleWithConfig} from './commands/bundle/buildBundle';
+6
View File
@@ -0,0 +1,6 @@
{
"ignorePatterns": ["dist/**"],
"rules": {
"sort-keys": 2
}
}
+1
View File
@@ -0,0 +1 @@
dist/
+55
View File
@@ -0,0 +1,55 @@
# @react-native/core-cli-utils
![npm package](https://img.shields.io/npm/v/@react-native/core-cli-utils?color=brightgreen&label=npm%20package)
A collection of utilites to help Frameworks build their React Native CLI tooling. This is not intended to be used directly use users of React Native.
## Usage
```js
import { Command } from 'commander';
import cli from '@react-native/core-cli-utils';
import debug from 'debug';
const android = new Command('android');
const frameworkFindsAndroidSrcDir = "...";
const tasks = cli.clean.android(frameworkFindsAndroidSrcDir);
const log = debug('fancy-framework:android');
android
.command('clean')
.description(cli.clean.android)
.action(async () => {
const log = debug('fancy-framework:android:clean');
log(`🧹 let me clean your Android caches`);
// Add other caches your framework needs besides the normal React Native caches
// here.
for (const task of tasks) {
try {
log(`\t ${task.label}`);
// See: https://github.com/sindresorhus/execa#lines
const {stdout} = await task.action({ lines: true })
log(stdout.join('\n\tGradle: '));
} catch (e) {
log(`\t ⚠️ whoops: ${e.message}`);
}
}
});
```
And you'd be using it like this:
```bash
$ ./fancy-framework android clean
🧹 let me clean your Android caches
Gradle: // a bunch of gradle output
Gradle: ....
```
## Features
- `"@react-native/core-cli-utils/version.js"` contains the platform and tooling version requirements for react-native.
## Contributing
Changes to this package can be made locally and linked against your app. Please see the [Contributing guide](https://reactnative.dev/contributing/overview#contributing-code).
+31
View File
@@ -0,0 +1,31 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.75.0-main",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/react-native.git",
"directory": "packages/core-cli-utils"
},
"exports": {
".": "./src/index.js",
"./package.json": "./package.json",
"./version.js": "./src/public/version.js"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/core-cli-utils#readme",
"keywords": [
"cli-utils",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
},
"files": [
"src"
],
"dependencies": {},
"devDependencies": {}
}
+26
View File
@@ -0,0 +1,26 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
// @babel/register doesn't like export {foo} from './bar'; statements,
// so we have to jump through hoops here.
import {tasks as _android} from './private/android.js';
import {tasks as _app} from './private/app.js';
import {tasks as _apple} from './private/apple.js';
import {tasks as _clean} from './private/clean.js';
import * as _version from './public/version.js';
export const android = _android;
export const app = _app;
export const apple = _apple;
export const clean = _clean;
export const version = _version;
export type {Task} from './private/types';
+20
View File
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
/*::
export type * from './index.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../scripts/build/babel-register').registerForMonorepo();
}
module.exports = require('./index.flow');
@@ -0,0 +1,121 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Task} from './types';
import type {ExecaPromise} from 'execa';
import {isWindows, task} from './utils';
import execa from 'execa';
type AndroidBuildMode = 'Debug' | 'Release';
type Path = string;
type Args = $ReadOnlyArray<string>;
type Config = {
cwd: Path,
hermes?: boolean,
mode: AndroidBuildMode,
name: string,
newArchitecture?: boolean,
sdk?: Path,
};
function gradle(
taskName: string,
args: Args,
options: {cwd: string, env?: {[k: string]: string | void}},
): ExecaPromise {
const gradlew = isWindows ? 'gradlew.bat' : './gradlew';
return execa(gradlew, [taskName, ...args], {
cwd: options.cwd,
env: options.env,
});
}
function androidSdkPath(sdk?: string): string {
return sdk ?? process.env.ANDROID_HOME ?? process.env.ANDROID_SDK ?? '';
}
function boolToStr(value: boolean): string {
return value ? 'true' : 'false';
}
const FIRST = 1;
//
// Android Tasks
//
export const tasks = (
config: Config,
): ({
assemble: (...gradleArgs: Args) => {
run: Task<ExecaPromise>,
},
build: (...gradleArgs: Args) => {
run: Task<ExecaPromise>,
},
install: (...gradleArgs: Args) => {
run: Task<ExecaPromise>,
},
}) => ({
assemble: (...gradleArgs: Args) => ({
run: task(FIRST, 'Assemble Android App', () => {
const args = [];
if (config.hermes != null) {
args.push(`-PhermesEnabled=${boolToStr(config.hermes)}`);
}
if (config.newArchitecture != null) {
args.push(`-PnewArchEnabled=${boolToStr(config.newArchitecture)}`);
}
args.push(...gradleArgs);
return gradle(`${config.name}:assemble${config.mode}`, gradleArgs, {
cwd: config.cwd,
env: {ANDROID_HOME: androidSdkPath(config.sdk)},
});
}),
}),
build: (...gradleArgs: Args) => ({
run: task(FIRST, 'Assembles and tests Android App', () => {
const args = [];
if (config.hermes != null) {
args.push(`-PhermesEnabled=${boolToStr(config.hermes)}`);
}
if (config.newArchitecture != null) {
args.push(`-PnewArchEnabled=${boolToStr(config.newArchitecture)}`);
}
args.push(...gradleArgs);
return gradle(`${config.name}:bundle${config.mode}`, args, {
cwd: config.cwd,
env: {ANDROID_HOME: androidSdkPath(config.sdk)},
});
}),
}),
/**
* Useful extra gradle arguments:
*
* -PreactNativeDevServerPort=8081 sets the port for the installed app to point towards a Metro
* server on (for example) 8081.
*/
install: (...gradleArgs: Args) => ({
run: task(FIRST, 'Installs the assembled Android App', () =>
gradle(`${config.name}:install${config.mode}`, gradleArgs, {
cwd: config.cwd,
env: {ANDROID_HOME: androidSdkPath(config.sdk)},
}),
),
}),
// We are not supporting launching the app and setting up the tunnel for metro <-> app, this is
// a framework concern. For an example of how one could do this, please look at the community
// CLI's code:
// https://github.com/react-native-community/cli/blob/54d48a4e08a1aef334ae6168788e0157a666b4f5/packages/cli-platform-android/src/commands/runAndroid/index.ts#L272C1-L290C2
});
+250
View File
@@ -0,0 +1,250 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Task} from './types';
import type {ExecaPromise} from 'execa';
import {task} from './utils';
import debug from 'debug';
import execa from 'execa';
import fs from 'fs';
import path from 'path';
const log = debug('core-cli-utils');
type BundlerOptions = {
// Metro's config: https://metrobundler.dev/docs/configuration/
config?: string,
// Typically index.{ios,android}.js
entryFile: string,
+platform: 'ios' | 'android' | string,
dev: boolean,
// Metro built main bundle
outputJsBundle: string,
minify: boolean,
optimize: boolean,
// Generate a source map file
outputSourceMap: string,
// Where to pass the final bundle. Typically this is the App's resource
// folder, however this is app specific. React Native will need to know where
// this is to bootstrap your application. See:
// - Android: https://reactnative.dev/docs/integration-with-existing-apps?language=kotlin#creating-a-release-build-in-android-studio
// - iOS: https://reactnative.dev/docs/integration-with-existing-apps?language=swift#2-event-handler
outputBundle: string,
cwd: string,
jsvm: 'hermes' | 'jsc',
hermes?: HermesConfig,
...Bundler,
};
type HermesConfig = {
// Path where hermes is is installed
// iOS: Pods/hermes-engine
path: string,
// iOS: <hermes.path>/destroot/bin/hermesc
hermesc: string,
};
type BundlerWatch = {
+mode: 'watch',
callback?: (metro: ExecaPromise) => void,
};
type BundlerBuild = {
+mode: 'bundle',
};
type Bundler = BundlerWatch | BundlerBuild;
const FIRST = 1,
SECOND = 2,
THIRD = 3,
FOURTH = 4;
function getNodePackagePath(packageName: string): string {
// $FlowIgnore[prop-missing] type definition is incomplete
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
}
function metro(...args: $ReadOnlyArray<string>): ExecaPromise {
const metroPath = getNodePackagePath(path.join('metro', 'src', 'cli.js'));
log(`🚇 ${metroPath} ${args.join(' ')} `);
return execa('node', [metroPath, ...args]);
}
export const tasks = {
bundle: (
options: BundlerOptions,
...args: $ReadOnlyArray<string>
): Bundle => {
const steps: Bundle = {
/* eslint-disable sort-keys */
validate: task(FIRST, 'Check if Metro is available', () => {
try {
require('metro');
} catch {
throw new Error('Metro is not available');
}
}),
javascript: task(SECOND, 'Metro watching for changes', () =>
metro('serve', ...args),
),
};
return options.mode === 'bundle'
? Object.assign(steps, bundleApp(options, ...args))
: steps;
},
};
type Bundle = {
validate?: Task<void>,
javascript: Task<ExecaPromise>,
sourcemap?: Task<void>,
validateHermesc?: Task<ExecaPromise>,
convert?: Task<ExecaPromise>,
compose?: Task<ExecaPromise>,
};
const bundleApp = (
options: BundlerOptions,
...metroArgs: $ReadOnlyArray<string>
) => {
if (options.outputJsBundle === options.outputBundle) {
throw new Error('outputJsBundle and outputBundle cannot be the same.');
}
// When using Hermes, Metro should generate the JS bundle to an intermediate file
// to then be converted to bytecode in the outputBundle. Otherwise just write to
// the outputBundle directly.
let output =
options.jsvm === 'hermes' ? options.outputJsBundle : options.outputBundle;
// TODO: Fix this by not using Metro CLI, which appends a .js extension
if (output === options.outputJsBundle && !output.endsWith('.js')) {
log(
`Appending .js to outputBundle (because metro cli does it if it's missing): ${output}`,
);
output += '.js';
}
const isSourceMaps = options.outputSourceMap != null;
const bundle: Bundle = {
javascript: task(SECOND, 'Metro generating an .jsbundle', () => {
const args = [
'--platform',
options.platform,
'--dev',
options.dev ? 'true' : 'false',
'--reset-cache',
'--out',
output,
];
if (options.jsvm === 'hermes' && !options.dev) {
// Hermes doesn't require JS minification
args.push('--minify', 'false');
} else {
args.push('--minify', options.minify ? 'true' : 'false');
}
if (isSourceMaps) {
args.push('--source-map');
}
return metro('build', options.entryFile, ...args, ...metroArgs);
}),
};
if (options.jsvm === 'jsc') {
return bundle;
}
if (options.hermes?.path == null || options.hermes?.hermesc == null) {
throw new Error('If jsvm == "hermes", hermes config must be provided.');
}
const hermes: HermesConfig = options.hermes;
const isHermesInstalled: boolean = fs.existsSync(hermes.path);
if (!isHermesInstalled) {
throw new Error(
'Hermes Pod must be installed before bundling.\n' +
'Did you forget to bootstrap?',
);
}
const hermesc: string = path.join(hermes.path, hermes.hermesc);
/*
* Hermes only tasks:
*/
let composeSourceMaps;
if (isSourceMaps) {
bundle.sourcemap = task(
FIRST,
'Check if SourceMap script available',
() => {
composeSourceMaps = getNodePackagePath(
'react-native/scripts/compose-source-maps.js',
);
},
);
}
bundle.validateHermesc = task(FIRST, 'Check if Hermesc is available', () =>
execa(hermesc, ['--version']),
);
bundle.convert = task(
THIRD,
'Hermesc converting .jsbundle → bytecode',
() => {
const args = [
'-emit-binary',
'-max-diagnostic-width=80',
options.dev === true ? '-Og' : '-O',
];
if (isSourceMaps) {
args.push('-output-source-map');
}
args.push(`-out=${options.outputBundle}`, output);
return execa(hermesc, args, {cwd: options.cwd});
},
);
bundle.compose = task(FOURTH, 'Compose Hermes and Metro source maps', () => {
if (composeSourceMaps == null) {
throw new Error(
'Unable to find the compose-source-map.js script in react-native',
);
}
const metroSourceMap = output.replace(/(\.js)?$/, '.map');
const hermesSourceMap = options.outputBundle + '.map';
const compose = execa(
'node',
[
composeSourceMaps,
metroSourceMap,
hermesSourceMap,
`-o ${options.outputSourceMap}`,
],
{
cwd: options.cwd,
},
);
compose.finally(() => {
fs.rmSync(metroSourceMap, {force: true});
fs.rmSync(hermesSourceMap, {force: true});
});
return compose;
});
return bundle;
};
@@ -0,0 +1,196 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Task} from './types';
import type {ExecaPromise} from 'execa';
import {assertDependencies, isOnPath, task} from './utils';
import execa from 'execa';
import fs from 'fs';
import path from 'path';
type AppleBuildMode = 'Debug' | 'Release';
type AppleBuildOptions = {
isWorkspace: boolean,
name: string,
mode: AppleBuildMode,
scheme?: string,
destination: 'device' | 'simulator' | string,
...AppleOptions,
};
type AppleBootstrapOption = {
// Enabled by default
hermes: boolean,
newArchitecture: boolean,
frameworks?: 'static' | 'dynamic',
...AppleOptions,
};
type AppleInstallApp = {
// Install the app on a simulator or device, typically this is the description from
// `xcrun simctl list devices`
device: string,
appPath: string,
bundleId: string,
...AppleOptions,
};
type AppleOptions = {
// The directory where the Xcode project is located
cwd: string,
// The environment variables to pass to the build command
env?: {[key: string]: string | void, ...},
};
function checkPodfileInSyncWithManifest(
lockfilePath: string,
manifestLockfilePath: string,
) {
try {
const expected = fs.readFileSync(lockfilePath, 'utf8');
const found = fs.readFileSync(manifestLockfilePath, 'utf8');
if (expected !== found) {
throw new Error(
'Please run: yarn bootstrap ios, Podfile.lock and Pods/Manifest.lock are out of sync',
);
}
} catch (e) {
throw new Error('Please run: yarn run boostrap ios: ' + e.message);
}
}
const FIRST = 1,
SECOND = 2,
THIRD = 3;
/* eslint sort-keys: "off" */
export const tasks = {
// 1. Setup your environment for building the iOS apps
bootstrap: (
options: AppleBootstrapOption,
): {
validate: Task<void>,
installRubyGems: Task<ExecaPromise>,
installDependencies: Task<ExecaPromise>,
} => ({
validate: task(FIRST, 'Check Cocoapods and bundle are available', () => {
assertDependencies(
isOnPath('pod', 'CocoaPods'),
isOnPath('bundle', "Bundler to manage Ruby's gems"),
);
}),
installRubyGems: task(SECOND, 'Install Ruby Gems', () =>
execa('bundle', ['install'], {
cwd: options.cwd,
}),
),
installDependencies: task(THIRD, 'Install CocoaPods dependencies', () => {
const env = {
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
USE_FRAMEWORKS: options.frameworks,
USE_HERMES: options.hermes ? '1' : '0',
};
if (options.frameworks == null) {
delete env.USE_FRAMEWORKS;
}
return execa('bundle', ['exec', 'pod', 'install'], {
cwd: options.cwd,
env,
});
}),
}),
// 2. Build the iOS app using a setup environment
build: (
options: AppleBuildOptions,
...args: $ReadOnlyArray<string>
): {
validate: Task<void>,
hasPodsInstalled: Task<void>,
build: Task<ExecaPromise>,
} => ({
validate: task(
FIRST,
"Check you've run xcode-select --install for xcodebuild",
() => {
assertDependencies(isOnPath('xcodebuild', 'Xcode Commandline Tools'));
},
),
hasPodsInstalled: task(FIRST, 'Check Pods are installed', () => {
for (const file of ['Podfile.lock', 'Pods']) {
try {
fs.accessSync(
path.join(options.cwd, file),
/* eslint-disable-next-line no-bitwise */
fs.constants.F_OK | fs.constants.R_OK,
);
} catch (e) {
throw new Error('Please run: yarn run boostrap ios: ' + e.message);
}
}
checkPodfileInSyncWithManifest(
path.join(options.cwd, 'Podfile.lock'),
path.join(options.cwd, 'Pods/Manifest.lock'),
);
}),
build: task(SECOND, 'build an app artifact', () => {
const _args = [
options.isWorkspace ? '-workspace' : '-project',
options.name,
'-configuration',
options.mode,
];
if (options.scheme != null) {
_args.push('-scheme', options.scheme);
}
if (options.destination != null) {
// The user doesn't want a generic target, they know better.
switch (options.destination) {
case 'simulator':
_args.push('-sdk', 'iphonesimulator');
break;
case 'device':
default:
_args.push('-destination', options.destination);
break;
}
}
_args.push(...args);
return execa('xcodebuild', _args, {cwd: options.cwd, env: options.env});
}),
}),
// 3. Install the built app on a simulator or device
ios: {
install: (
options: AppleInstallApp,
): {validate: Task<void>, install: Task<ExecaPromise>} => ({
validate: task(
FIRST,
"Check you've run xcode-select --install for xcrun",
() => {
assertDependencies(
isOnPath('xcrun', 'An Xcode Commandline tool: xcrun'),
);
},
),
install: task(SECOND, 'Install the app on a simulator', () =>
execa('xcrun', ['simctl', 'install', options.device, options.appPath], {
cwd: options.cwd,
env: options.env,
}),
),
}),
},
};
@@ -0,0 +1,203 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Task} from './types';
import type {ExecaPromise, Options as ExecaOptions} from 'execa';
import {assertDependencies, isMacOS, isOnPath, isWindows, task} from './utils';
import execa from 'execa';
import {existsSync, readdirSync, rm} from 'fs';
import os from 'os';
import path from 'path';
const FIRST = 1,
SECOND = 2;
const rmrf = (pathname: string) => {
if (!existsSync(pathname)) {
return;
}
rm(pathname, {force: true, maxRetries: 3, recursive: true});
};
/**
* Removes the contents of a directory matching a given pattern, but keeps the directory.
* @private
*/
export function deleteDirectoryContents(
directory: string,
filePattern: RegExp,
): () => Promise<void> {
return async function deleteDirectoryContentsAction() {
const base = path.dirname(directory);
const files = readdirSync(base).filter((filename: string) =>
filePattern.test(filename),
);
for (const filename of files) {
rmrf(path.join(base, filename));
}
};
}
/**
* Removes a directory recursively.
* @private
*/
export function deleteDirectory(directory: string): () => Promise<void> {
return async function cleanDirectoryAction() {
rmrf(directory);
};
}
/**
* Deletes the contents of the tmp directory matching a given pattern.
* @private
*/
export function deleteTmpDirectoryContents(
filepattern: RegExp,
): () => Promise<void> {
return deleteDirectoryContents(os.tmpdir(), filepattern);
}
const platformGradlew = isWindows ? 'gradlew.bat' : 'gradlew';
type CocoaPodsClean = {
clean: Task<ExecaPromise>,
};
type AndroidClean = {
validate: Task<void>,
run: Task<ExecaPromise>,
};
type MetroClean = {
metro: Task<Promise<void>>,
haste: Task<Promise<void>>,
react_native: Task<Promise<void>>,
};
type NpmClean = {
node_modules: Task<Promise<void>>,
verify_cache: Task<ExecaPromise>,
};
type WatchmanClean = {
stop: Task<ExecaPromise>,
cache: Task<ExecaPromise>,
};
type YarnClean = {
clean: Task<ExecaPromise>,
};
type CleanTasks = {
android: (andoirdSrcDir: ?string, opts?: ExecaOptions) => AndroidClean,
cocoapods: CocoaPodsClean,
metro: () => MetroClean,
npm: (projectRootDir: string) => NpmClean,
watchman: (projectRootDir: string) => WatchmanClean,
yarn: (projectRootDir: string) => YarnClean,
cocoapods?: (projectRootDir: string) => CocoaPodsClean,
};
// The tasks that cleanup various build artefacts.
/* eslint sort-keys: "off" */
export const tasks: CleanTasks = {
/**
* Cleans up the Android Gradle cache
*/
android: (androidSrcDir: ?string, opts?: ExecaOptions) => ({
validate: task(FIRST, 'Check gradlew is available', () => {
assertDependencies(isOnPath(platformGradlew, 'Gradle wrapper'));
}),
run: task(SECOND, '🧹 Clean Gradle cache', () => {
const gradlew = path.join(androidSrcDir ?? 'android', platformGradlew);
const script = path.basename(gradlew);
const cwd = path.dirname(gradlew);
return execa(isWindows ? script : './' + script, ['clean'], {
cwd,
...opts,
});
}),
}),
/**
* Aggressively cleans up all Metro caches.
*/
metro: () => ({
metro: task(
FIRST,
'🧹 Clean Metro cache',
deleteTmpDirectoryContents(/^metro-.+/),
),
haste: task(
FIRST,
'🧹 Clean Haste cache',
deleteTmpDirectoryContents(/^haste-map-.+/),
),
react_native: task(
FIRST,
'🧹 Clean React Native cache',
deleteTmpDirectoryContents(/^react-.+/),
),
}),
/**
* Cleans up the `node_modules` folder and optionally garbage collects the npm cache.
*/
npm: (projectRootDir: string) => ({
node_modules: task(
FIRST,
'🧹 Clean node_modules',
deleteDirectory(path.join(projectRootDir, 'node_modules')),
),
verify_cache: task(SECOND, '🔬 Verify npm cache', (opts?: ExecaOptions) =>
execa('npm', ['cache', 'verify'], {cwd: projectRootDir, ...opts}),
),
}),
/**
* Stops Watchman and clears its cache
*/
watchman: (projectRootDir: string) => ({
stop: task(FIRST, '✋ Stop Watchman', (opts?: ExecaOptions) =>
execa(isWindows ? 'tskill' : 'killall', ['watchman'], {
cwd: projectRootDir,
...opts,
}),
),
cache: task(SECOND, '🧹 Delete Watchman cache', (opts?: ExecaOptions) =>
execa('watchman', ['watch-del-all'], {cwd: projectRootDir, ...opts}),
),
}),
/**
* Cleans up the Yarn cache
*/
yarn: (projectRootDir: string) => ({
clean: task(FIRST, '🧹 Clean Yarn cache', (opts?: ExecaOptions) =>
execa('yarn', ['cache', 'clean'], {cwd: projectRootDir, ...opts}),
),
}),
};
if (isMacOS) {
/**
* Cleans up the local and global CocoaPods cache
*/
tasks.cocoapods = (projectRootDir: string) => ({
// TODO: add project root
clean: task(FIRST, '🧹 Clean CocoaPods pod cache', (opts?: ExecaOptions) =>
execa('bundle', ['exec', 'pod', 'deintegrate'], {
cwd: projectRootDir,
...opts,
}),
),
});
}
@@ -4,13 +4,13 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
* @format
* @oncall react_native
*/
'use strict';
module.exports = {
showMessage(message: string, type: 'load' | 'refresh') {},
hide() {},
export type Task<R = mixed> = {
order: number,
label: string,
action: () => R,
};
@@ -0,0 +1,66 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Task} from './types';
import execa from 'execa';
import os from 'os';
export function task<R>(
order: number,
label: string,
action: Task<R>['action'],
): Task<R> {
return {
action,
label,
order,
};
}
export const isWindows = os.platform() === 'win32';
export const isMacOS = os.platform() === 'darwin';
export const toPascalCase = (label: string): string =>
label.length === 0 ? '' : label[0].toUpperCase() + label.slice(1);
type PathCheckResult = {
found: boolean,
dep: string,
description: string,
};
export function isOnPath(dep: string, description: string): PathCheckResult {
const cmd = isWindows ? ['where', [dep]] : ['command', ['-v', dep]];
try {
return {
dep,
description,
found: execa.sync(...cmd).exitCode === 0,
};
} catch {
return {
dep,
description,
found: false,
};
}
}
export function assertDependencies(
...deps: $ReadOnlyArray<ReturnType<typeof isOnPath>>
) {
for (const {found, dep, description} of deps) {
if (!found) {
throw new Error(`"${dep}" not found, ${description}`);
}
}
}
@@ -0,0 +1,53 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
// Usage:
//
// > const semver = require('semver');
// > semver.satisfies(process.env.ANDROID_SDK, android.ANDROID_SDK);
// true
//
// The version of @react-native/core-cli-utils matches a particular version
// of react-native. For example:
//
// > npm info @react-native/core-cli-util@latest --json | jq '.version'
// > "0.75.0"
//
// Means that:
// > require('@react-native/core-cli-utils/versions.js').apple.XCODE
// > ">= 12.x"
//
// For react-native@0.75.0 you have to have a version of XCode >= 12
export const android = {
ANDROID_NDK: '>= 23.x',
ANDROID_SDK: '>= 33.x',
};
export const apple = {
COCOAPODS: '>= 1.10.0',
XCODE: '>= 12.x',
};
export const common = {
BUN: '>= 1.0.0',
JAVA: '>= 17 <= 20',
NODE_JS: '>= 18',
NPM: '>= 4.x',
RUBY: '>= 2.6.10',
YARN: '>= 1.10.x',
};
export const all = {
...apple,
...android,
...common,
};
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
/*::
export type * from './version.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../../scripts/build/babel-register').registerForMonorepo();
}
module.exports = require('./version.flow');
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<fbad20dc7d32047d6d436b94ec8a15b4>>
Git revision: 12a45e0628384aa80075493354159ef5d91b2698
@generated SignedSource<<a5112919266a3a3f492b1f1336f63047>>
Git revision: f7e972ce2917749a125fc0871781d9307ca336e8
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
@@ -1,4 +1,4 @@
// Copyright 2023 The Chromium Authors. All rights reserved.
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const sheet = new CSSStyleSheet();
@@ -44,9 +44,11 @@ style.setProperty('--image-file-align-self-center', 'url(\"' + new URL(new URL('
style.setProperty('--image-file-align-self-end', 'url(\"' + new URL(new URL('align-self-end.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-align-self-start', 'url(\"' + new URL(new URL('align-self-start.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-align-self-stretch', 'url(\"' + new URL(new URL('align-self-stretch.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-back', 'url(\"' + new URL(new URL('arrow-back.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-down', 'url(\"' + new URL(new URL('arrow-down.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-drop-down-dark', 'url(\"' + new URL(new URL('arrow-drop-down-dark.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-drop-down-light', 'url(\"' + new URL(new URL('arrow-drop-down-light.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-forward', 'url(\"' + new URL(new URL('arrow-forward.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-up-down-circle', 'url(\"' + new URL(new URL('arrow-up-down-circle.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-up-down', 'url(\"' + new URL(new URL('arrow-up-down.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-arrow-up', 'url(\"' + new URL(new URL('arrow-up.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -99,6 +101,7 @@ style.setProperty('--image-file-dock-left', 'url(\"' + new URL(new URL('dock-lef
style.setProperty('--image-file-dock-right', 'url(\"' + new URL(new URL('dock-right.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dock-window', 'url(\"' + new URL(new URL('dock-window.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-document', 'url(\"' + new URL(new URL('document.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dog-paw', 'url(\"' + new URL(new URL('dog-paw.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dots-horizontal', 'url(\"' + new URL(new URL('dots-horizontal.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dots-vertical', 'url(\"' + new URL(new URL('dots-vertical.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-download', 'url(\"' + new URL(new URL('download.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -108,14 +111,21 @@ style.setProperty('--image-file-errorWave', 'url(\"' + new URL(new URL('errorWav
style.setProperty('--image-file-exclamation', 'url(\"' + new URL(new URL('exclamation.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-experiment-check', 'url(\"' + new URL(new URL('experiment-check.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-experiment', 'url(\"' + new URL(new URL('experiment.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-extension', 'url(\"' + new URL(new URL('extension.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-eye', 'url(\"' + new URL(new URL('eye.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-document', 'url(\"' + new URL(new URL('file-document.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-fetch-xhr', 'url(\"' + new URL(new URL('file-fetch-xhr.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-font', 'url(\"' + new URL(new URL('file-font.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-generic', 'url(\"' + new URL(new URL('file-generic.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-image', 'url(\"' + new URL(new URL('file-image.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-json', 'url(\"' + new URL(new URL('file-json.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-manifest', 'url(\"' + new URL(new URL('file-manifest.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-media', 'url(\"' + new URL(new URL('file-media.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-script', 'url(\"' + new URL(new URL('file-script.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-snippet', 'url(\"' + new URL(new URL('file-snippet.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-stylesheet', 'url(\"' + new URL(new URL('file-stylesheet.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-wasm', 'url(\"' + new URL(new URL('file-wasm.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-file-websocket', 'url(\"' + new URL(new URL('file-websocket.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-filter-clear', 'url(\"' + new URL(new URL('filter-clear.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-filter-filled', 'url(\"' + new URL(new URL('filter-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-filter', 'url(\"' + new URL(new URL('filter.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -131,6 +141,7 @@ style.setProperty('--image-file-frame', 'url(\"' + new URL(new URL('frame.svg',
style.setProperty('--image-file-gear-filled', 'url(\"' + new URL(new URL('gear-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-gear', 'url(\"' + new URL(new URL('gear.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-gears', 'url(\"' + new URL(new URL('gears.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-goto-filled', 'url(\"' + new URL(new URL('goto-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-heap-snapshot', 'url(\"' + new URL(new URL('heap-snapshot.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-heap-snapshots', 'url(\"' + new URL(new URL('heap-snapshots.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-help', 'url(\"' + new URL(new URL('help.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -155,19 +166,19 @@ style.setProperty('--image-file-justify-items-start', 'url(\"' + new URL(new URL
style.setProperty('--image-file-justify-items-stretch', 'url(\"' + new URL(new URL('justify-items-stretch.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-keyboard-pen', 'url(\"' + new URL(new URL('keyboard-pen.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-large-arrow-right-filled', 'url(\"' + new URL(new URL('large-arrow-right-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-largeIcons', 'url(\"' + new URL(new URL('largeIcons.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-layers-filled', 'url(\"' + new URL(new URL('layers-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-layers', 'url(\"' + new URL(new URL('layers.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-left-panel-close', 'url(\"' + new URL(new URL('left-panel-close.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-left-panel-open', 'url(\"' + new URL(new URL('left-panel-open.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-lightbulb-spark', 'url(\"' + new URL(new URL('lightbulb-spark.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-lighthouse_logo', 'url(\"' + new URL(new URL('lighthouse_logo.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-list', 'url(\"' + new URL(new URL('list.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-mediumIcons', 'url(\"' + new URL(new URL('mediumIcons.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-match-whole-word', 'url(\"' + new URL(new URL('match-whole-word.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-memory', 'url(\"' + new URL(new URL('memory.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-minus', 'url(\"' + new URL(new URL('minus.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-minus_icon', 'url(\"' + new URL(new URL('minus_icon.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-mop', 'url(\"' + new URL(new URL('mop.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-mouse', 'url(\"' + new URL(new URL('mouse.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-network-settings', 'url(\"' + new URL(new URL('network-settings.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-node_search_icon', 'url(\"' + new URL(new URL('node_search_icon.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-open-externally', 'url(\"' + new URL(new URL('open-externally.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-pause', 'url(\"' + new URL(new URL('pause.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-performance', 'url(\"' + new URL(new URL('performance.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -190,14 +201,17 @@ style.setProperty('--image-file-resume', 'url(\"' + new URL(new URL('resume.svg'
style.setProperty('--image-file-review', 'url(\"' + new URL(new URL('review.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-right-panel-close', 'url(\"' + new URL(new URL('right-panel-close.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-right-panel-open', 'url(\"' + new URL(new URL('right-panel-open.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-scissors', 'url(\"' + new URL(new URL('scissors.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-screen-rotation', 'url(\"' + new URL(new URL('screen-rotation.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-search', 'url(\"' + new URL(new URL('search.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-securityIcons', 'url(\"' + new URL(new URL('securityIcons.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-select-element', 'url(\"' + new URL(new URL('select-element.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-settings_14x14_icon', 'url(\"' + new URL(new URL('settings_14x14_icon.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-send', 'url(\"' + new URL(new URL('send.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-shadow', 'url(\"' + new URL(new URL('shadow.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-smallIcons', 'url(\"' + new URL(new URL('smallIcons.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-small-status-dot', 'url(\"' + new URL(new URL('small-status-dot.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-snippet', 'url(\"' + new URL(new URL('snippet.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-spark-info', 'url(\"' + new URL(new URL('spark-info.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-spark', 'url(\"' + new URL(new URL('spark.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-star', 'url(\"' + new URL(new URL('star.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-step-into', 'url(\"' + new URL(new URL('step-into.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-step-out', 'url(\"' + new URL(new URL('step-out.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -207,8 +221,11 @@ style.setProperty('--image-file-stop', 'url(\"' + new URL(new URL('stop.svg', im
style.setProperty('--image-file-symbol', 'url(\"' + new URL(new URL('symbol.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-sync', 'url(\"' + new URL(new URL('sync.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-table', 'url(\"' + new URL(new URL('table.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-thumb-down', 'url(\"' + new URL(new URL('thumb-down.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-thumb-up', 'url(\"' + new URL(new URL('thumb-up.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-top-panel-close', 'url(\"' + new URL(new URL('top-panel-close.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-top-panel-open', 'url(\"' + new URL(new URL('top-panel-open.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-touch-app', 'url(\"' + new URL(new URL('touch-app.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-triangle-bottom-right', 'url(\"' + new URL(new URL('triangle-bottom-right.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-triangle-down', 'url(\"' + new URL(new URL('triangle-down.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-triangle-left', 'url(\"' + new URL(new URL('triangle-left.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -217,8 +234,8 @@ style.setProperty('--image-file-triangle-up', 'url(\"' + new URL(new URL('triang
style.setProperty('--image-file-undo', 'url(\"' + new URL(new URL('undo.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-warning-filled', 'url(\"' + new URL(new URL('warning-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-warning', 'url(\"' + new URL(new URL('warning.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-warning_icon', 'url(\"' + new URL(new URL('warning_icon.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-watch', 'url(\"' + new URL(new URL('watch.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-width', 'url(\"' + new URL(new URL('width.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-zoom-in', 'url(\"' + new URL(new URL('zoom-in.svg', import.meta.url).href, import.meta.url).toString() + '\")');
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#000" d="m6.52 10.832 4.668 4.668L10 16.668 3.332 10 10 3.332 11.188 4.5 6.52 9.168h10.148v1.664Zm0 0"/></svg>

After

Width:  |  Height:  |  Size: 197 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#000" d="M13.48 10.832H3.332V9.168H13.48L8.812 4.5 10 3.332 16.668 10 10 16.668 8.812 15.5Zm0 0"/></svg>

After

Width:  |  Height:  |  Size: 191 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path d="M5.833 12.065c.422 0 .789-.05 1.1-.15.311-.1.667-.15 1.067-.15.4 0 .755.05 1.066.15.312.1.678.15 1.1.15a1.45 1.45 0 0 0 1.067-.433 1.45 1.45 0 0 0 .433-1.067c0-.388-.13-.73-.391-1.025a10.025 10.025 0 0 0-.842-.841 4.099 4.099 0 0 1-.558-.659 8.808 8.808 0 0 0-.542-.708 2.25 2.25 0 0 0-.592-.475A1.49 1.49 0 0 0 8 6.665a1.49 1.49 0 0 0-.742.192 2.25 2.25 0 0 0-.592.475c-.188.211-.369.444-.541.7a3.941 3.941 0 0 1-.559.667c-.3.266-.58.547-.841.841a1.498 1.498 0 0 0-.392 1.025c0 .423.145.778.433 1.067a1.45 1.45 0 0 0 1.067.433Zm-1.3-3.833c.333 0 .617-.117.85-.35.233-.233.35-.517.35-.85 0-.333-.117-.617-.35-.85a1.157 1.157 0 0 0-.85-.35c-.333 0-.617.117-.85.35-.233.233-.35.517-.35.85 0 .333.117.617.35.85.233.233.517.35.85.35Zm6.933 0c.334 0 .617-.117.85-.35.234-.233.35-.517.35-.85 0-.333-.116-.617-.35-.85a1.157 1.157 0 0 0-.85-.35c-.333 0-.616.117-.85.35-.233.233-.35.517-.35.85 0 .333.117.617.35.85.234.233.517.35.85.35ZM6.534 6.199c.333 0 .617-.117.85-.35.233-.234.35-.517.35-.85 0-.334-.117-.617-.35-.85a1.157 1.157 0 0 0-.85-.35c-.333 0-.617.116-.85.35-.233.233-.35.516-.35.85 0 .333.117.616.35.85.233.233.517.35.85.35Zm2.933 0c.334 0 .617-.117.85-.35.234-.234.35-.517.35-.85 0-.334-.116-.617-.35-.85a1.157 1.157 0 0 0-.85-.35c-.333 0-.616.116-.85.35-.233.233-.35.516-.35.85 0 .333.117.616.35.85.234.233.517.35.85.35ZM8 14.665a6.492 6.492 0 0 1-2.6-.525 6.732 6.732 0 0 1-2.117-1.425A6.733 6.733 0 0 1 1.858 10.6a6.492 6.492 0 0 1-.525-2.6c0-.923.175-1.79.525-2.6a6.732 6.732 0 0 1 1.425-2.117c.6-.6 1.306-1.075 2.117-1.425A6.492 6.492 0 0 1 8 1.332c.922 0 1.789.175 2.6.525.81.35 1.517.825 2.117 1.425.6.6 1.074 1.306 1.425 2.117.35.81.524 1.677.524 2.6 0 .922-.175 1.789-.524 2.6a6.733 6.733 0 0 1-1.425 2.116c-.6.6-1.306 1.075-2.117 1.425a6.492 6.492 0 0 1-2.6.525Z" fill="#474747"/></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.167 17.5c-.459 0-.851-.163-1.177-.49a1.605 1.605 0 0 1-.49-1.177v-3.166c.667 0 1.25-.212 1.75-.636.5-.423.75-.962.75-1.614 0-.653-.25-1.191-.75-1.615a2.624 2.624 0 0 0-1.75-.635V5c0-.458.163-.85.49-1.177.326-.326.718-.49 1.177-.49H7.5c0-.583.201-1.076.604-1.479a2.012 2.012 0 0 1 1.48-.604c.583 0 1.076.201 1.479.604.402.403.604.896.604 1.48H15c.458 0 .85.163 1.177.489.326.326.49.719.49 1.177v3.333c.583 0 1.076.202 1.479.604.403.403.604.896.604 1.48 0 .583-.201 1.076-.604 1.479a2.011 2.011 0 0 1-1.48.604v3.333c0 .459-.163.851-.489 1.177-.326.327-.719.49-1.177.49H4.167Zm0-1.667H15V5H4.167v1.833c.75.278 1.354.743 1.812 1.396.458.653.688 1.382.688 2.188 0 .791-.23 1.514-.688 2.166A3.888 3.888 0 0 1 4.167 14v1.833Z" fill="#041E49"/></svg>

After

Width:  |  Height:  |  Size: 829 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 17c-.412 0-.766-.147-1.06-.44A1.445 1.445 0 0 1 3 15.5v-11c0-.412.147-.766.44-1.06.294-.293.648-.44 1.06-.44H13l4 4v8.5c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44h-11Zm0-1.5h11V8H12V4.5H4.5v11Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 310 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 16v-1.5h1.75c.213 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534v-1.5c0-.57.191-1.059.573-1.469.382-.41.858-.65 1.427-.719V9.98a2.601 2.601 0 0 1-1.427-.77A2.043 2.043 0 0 1 14.5 7.75v-1.5a.726.726 0 0 0-.216-.534.726.726 0 0 0-.534-.216H12V4h1.75a2.17 2.17 0 0 1 1.594.656c.437.438.656.969.656 1.594v1.5c0 .213.072.39.216.534a.726.726 0 0 0 .534.216H18v3h-1.25a.726.726 0 0 0-.534.216.726.726 0 0 0-.216.534v1.5a2.17 2.17 0 0 1-.656 1.594A2.17 2.17 0 0 1 13.75 16H12Zm-5.75 0a2.17 2.17 0 0 1-1.594-.656A2.17 2.17 0 0 1 4 13.75v-1.5a.726.726 0 0 0-.216-.534.726.726 0 0 0-.534-.216H2v-3h1.25c.212 0 .39-.072.534-.216A.726.726 0 0 0 4 7.75v-1.5c0-.625.219-1.156.656-1.594A2.17 2.17 0 0 1 6.25 4H8v1.5H6.25a.726.726 0 0 0-.534.216.726.726 0 0 0-.216.534v1.5c0 .583-.191 1.08-.573 1.49-.382.41-.858.649-1.427.718v.087c.57.053 1.045.288 1.427.705.382.417.573.917.573 1.5v1.5c0 .213.072.39.216.534a.726.726 0 0 0 .534.216H8V16H6.25ZM9.193 10.35h1.952v1.587l-1.149 2.245h-1.26l.457-2.245V10.35Zm0-4.079h1.952v2.14H9.193V6.27Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.746 7.5c.21 0 .39-.071.535-.214a.714.714 0 0 0 .219-.532.736.736 0 0 0-.214-.535A.714.714 0 0 0 6.754 6a.736.736 0 0 0-.535.214.714.714 0 0 0-.219.532c0 .21.071.39.214.535.143.146.32.219.532.219Zm0 3.25c.21 0 .39-.072.535-.214a.714.714 0 0 0 .219-.532.736.736 0 0 0-.214-.535.714.714 0 0 0-.532-.219.736.736 0 0 0-.535.214.714.714 0 0 0-.219.532c0 .21.071.39.214.535.143.146.32.219.532.219Zm0 3.25c.21 0 .39-.072.535-.214a.714.714 0 0 0 .219-.532.736.736 0 0 0-.214-.535.714.714 0 0 0-.532-.219.736.736 0 0 0-.535.214.714.714 0 0 0-.219.532c0 .21.071.39.214.535.143.146.32.219.532.219ZM4.5 17c-.412 0-.766-.147-1.06-.44A1.445 1.445 0 0 1 3 15.5v-11c0-.412.147-.766.44-1.06.294-.293.648-.44 1.06-.44H13l4 4v8.5c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44h-11Zm0-1.5h11V8H12V4.5H4.5v11Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 898 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m8 13.5 5.5-3.5L8 6.5v7ZM4.5 17c-.417 0-.77-.146-1.062-.438A1.444 1.444 0 0 1 3 15.5v-11c0-.417.146-.77.438-1.062A1.444 1.444 0 0 1 4.5 3h11c.417 0 .77.146 1.062.438.292.291.438.645.438 1.062v11c0 .417-.146.77-.438 1.062A1.444 1.444 0 0 1 15.5 17h-11Zm0-1.5h11v-11h-11v11Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 377 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.163 4.5a3.5 3.5 0 0 1-6.326 0H4.5v11h11v-11h-2.337ZM12 3a2 2 0 1 1-4 0H4.5A1.5 1.5 0 0 0 3 4.5v11A1.5 1.5 0 0 0 4.5 17h11a1.5 1.5 0 0 0 1.5-1.5v-11A1.5 1.5 0 0 0 15.5 3H12Z" fill="#000"/><path d="M10 13.5V10H9v3h-.613v-2h-.782v2H7v-3H6v3.5c0 .142.048.26.144.356A.484.484 0 0 0 6.5 14h3c.142 0 .26-.048.356-.144A.484.484 0 0 0 10 13.5Z" fill="#000"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 13v1h-1v-3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75V14h-1v-1h-1Zm0-1v-1h1v1h-1Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 637 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m7 16-3-3 3-3 1.063 1.063-1.188 1.187H10v1.5H6.875l1.188 1.188L7 16Zm5.254-2.25a.736.736 0 0 1-.535-.214.714.714 0 0 1-.219-.532c0-.21.072-.39.214-.535a.714.714 0 0 1 .532-.219c.21 0 .39.072.535.214.146.143.219.32.219.532 0 .21-.072.39-.214.535a.714.714 0 0 1-.532.219Zm3 0a.736.736 0 0 1-.535-.214.714.714 0 0 1-.219-.532c0-.21.072-.39.214-.535a.714.714 0 0 1 .532-.219c.21 0 .39.072.535.214.146.143.219.32.219.532 0 .21-.072.39-.214.535a.714.714 0 0 1-.532.219ZM14 10l-1.063-1.063 1.188-1.187H11v-1.5h3.125l-1.188-1.188L14 4l3 3-3 3ZM5.754 7.75a.736.736 0 0 1-.535-.214A.714.714 0 0 1 5 7.004c0-.21.071-.39.214-.535a.714.714 0 0 1 .532-.219c.21 0 .39.071.535.214.146.143.219.32.219.532 0 .21-.071.39-.214.535a.714.714 0 0 1-.532.219Zm3 0a.736.736 0 0 1-.535-.214A.714.714 0 0 1 8 7.004c0-.21.071-.39.214-.535a.714.714 0 0 1 .532-.219c.21 0 .39.071.535.214.146.143.219.32.219.532 0 .21-.071.39-.214.535a.714.714 0 0 1-.532.219Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-2.8v-2.8H5.8V8.6H10V5.8l4.2 4.2-4.2 4.2Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 185 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 29 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><g clip-path="url(#a)"><path d="M12.334 6.684c0-.833-.295-1.545-.884-2.133a2.907 2.907 0 0 0-2.133-.884 2.92 2.92 0 0 0 2.133-.875 2.88 2.88 0 0 0 .884-2.125c0 .834.291 1.542.875 2.125a2.893 2.893 0 0 0 2.125.875 2.88 2.88 0 0 0-2.125.884 2.92 2.92 0 0 0-.875 2.133ZM2.928 11.991h4.804v1.2H2.928z" fill="#fff"/><path d="M9.352 7.34c0 1.39-.704 2.616-1.775 3.34h-4.5a4.025 4.025 0 1 1 6.275-3.338Z" stroke="#fff" stroke-width="1.2"/><path d="M4.126 13.906a1.2 1.2 0 0 0 2.4 0h-2.4Z" fill="#fff"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

After

Width:  |  Height:  |  Size: 658 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20" fill="none"><path d="M72-240v-192h72v120h672v-120h72v192H72Zm302.903-144v-31H372q-16 21-35.5 31t-46.237 10q-46.789 0-73.526-24.695Q190-423.389 190-466q0-41 30.5-66t80.5-25q21 0 42 4t32 10v-14q0-24-19-40t-48-16q-21 0-37.5 8.5T240-579l-41-32q17-25 46.5-38.5t64.84-13.5Q368-663 400-634.716q32 28.283 32 81.974V-384h-57.097ZM312-514q-29 0-46 13t-17 34q0 20 14.167 31.5Q277.333-424 300-424q32 0 53-21.706t21-52.576Q360-506 344.5-510t-32.5-4Zm192 130v-387h59v109.182L560-623h3q3-5 23.583-25t64.689-20Q714-668 749-623.5 784-579 784-522t-35.073 102q-35.072 45-97.53 45Q612-375 590.5-393T563-420h-3v36h-56Zm138-229q-38 0-60 28.159t-22 62.523Q560-487 582-458.5t60 28.5q38 0 60.5-28.5T725-522q0-35-22.5-63T642-613Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 812 B

Some files were not shown because too many files have changed in this diff Show More