Commit Graph
29228 Commits
Author SHA1 Message Date
Tommy NguyenandAlex Hunt dcdea80d9e Fix build_codegen! not finding @react-native/codegen in pnpm setups (#41399)
Summary:
`build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead.

However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository.

## Changelog:

[GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups

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

Test Plan: We have a patched version of `react-native` working in a pnpm setup here: https://github.com/microsoft/rnx-kit/pull/2811

Reviewed By: dmytrorykun

Differential Revision: D51201643

Pulled By: cipolleschi

fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
2023-11-27 11:07:30 +00:00
Tommy NguyenandAlex Hunt c32064c510 Correctly declare runtime dependencies
In pnpm setups, codegen will fail during build because it cannot find
its dependencies. Some of the dependencies it relies on at runtime are
currently declared under `devDependencies`. This change moves them to
`dependencies`.
2023-11-27 11:07:08 +00:00
Alex Hunt e03137ecbd Bump package versions
#publish-packages-to-npm
2023-11-27 11:03:40 +00:00
Nicola CortiandAlex Hunt f3f75e86d8 Fix projects being broken on dependencies starting with a.. (#41621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41621

Currently, if you have a dependency that is alphabetically smaller than `app`, it's evaluation will happen before `app`.
This means that the namespace auto-discovery and the JVM toolchain configuration won't be working and the project will fail to buid.

This fixes it by introducing a root-project Gradle Plugin that takes care of enforcing the evaluation order on the `app` project.

Fixes #41620

Changelog:
[Android] [Fixed] - Fix projects being broken on dependencies starting with `a..`

Reviewed By: huntie

Differential Revision: D51547294

fbshipit-source-id: 65df7149548b7087dd8928e556fb803b3baf7b79
2023-11-27 10:44:10 +00:00
Riccardo CipolleschiandAlex Hunt 830c2e7c57 [RN][iOS] Fix React-ImageManager dependencies 2023-11-27 10:43:12 +00:00
Riccardo CipolleschiandAlex Hunt 9dfb0ffa1b Revert "RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag (#41573)"
This reverts commit 02a411e997.
2023-11-24 18:49:06 +00:00
Riccardo Cipolleschi 3bb7a70c0d [LOCAL] Update Podfile.lock 2023-11-24 17:52:41 +00:00
Nick GerlemanandAlex Hunt 154a81ad16 FP Tolerance in iOS Paper SafeAreaView debouncing (#41614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41614

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

SafeAreaView works by adding padding in order to shift content out of the safe area. This may change the layout dimensions of the SafeAreaView, in turn effecting its safe area insets.

This can cause layout results to change, which in turn changes the inset value. Because of this, there is a tolerance, where safe area inset changes do not trigger a new update.

Yoga is instructed to round layout dimensions to the closest physical pixel, so a very small difference in layout may result being off by about a pixel. Right now the tolerance is exactly one physical pixel, and if there is FP error here, we may not pass the test, and start oscillating with different layout values.

After changing affected ShadowNode order to always be root-first, the first call to set the frame of the `SafeAreaView` happens when a non-zero-sized RootView is present, which I think may lead to a safe area inset update communicated that wasn't before? Or other cosmic butterflies. Layout rounds to one physical pixel in difference, and our tolerance is `0.00001` dips off (not helped that 1/3 screen scale cannot be represented as decimal, even without FP error).

This adds a small tolerance beyond just the pixel boundary, matching the logic in Fabric, which seems to resolve the issue.

Changelog:
[iOS][Fixed] - FP Tolerance in iOS Paper SafeAreaView debouncing

Reviewed By: philIip

Differential Revision: D51539091

fbshipit-source-id: 88bddc38c7cd8d93feef5f12da64b124af22f46d
2023-11-24 17:12:48 +00:00
Alex HuntandAlex Hunt a66cda9284 Remove "Open Debugger" action under JSC (#41535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41535

## Context

**Remote JS Debugging removal**

In React Native 0.73, we have deprecated Remote JS Debugging (execution of JavaScript in a separate V8 process) and also removed the Dev Menu launcher (https://github.com/facebook/react-native/pull/36754).

## This diff

Follows D46187942 — this option wasn't correctly removed for Android when running JSC. This is now consistent with iOS.

Changelog:
[Android][Changed] "Open Debugger" is no longer available for remote JS debugging from the Dev Menu (non-Hermes). Please use `NativeDevSettings.setIsDebuggingRemotely()`.

Reviewed By: blakef

Differential Revision: D50555095

fbshipit-source-id: 1aeb48ab1390dc12ce300d6f321c30de5343cf0a
2023-11-21 12:00:08 +00:00
Christoph PurrerandAlex Hunt 02a411e997 RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag (#41573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41573

Changelog: [iOS][Fixed] RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag

On iOS we check for ENV flags if Hermes should be used:
- https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React-Core.podspec#L24
- https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React/React-RCTFabric.podspec#L90

and add necessary C++ packages based on that flag.

In code we do check for those imports
https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h#L16-L27

and decided if we should use Hermes or not.

However the .mm check is faulty and does not check for the `RCT_USE_HERMES` flag set in code.

Reviewed By: fkgozali

Differential Revision: D51483740

fbshipit-source-id: 428c27aae80fe6f9799cf6ae21a5d3801fe6ca11
2023-11-21 11:59:23 +00:00
szymonrybczakandAlex Hunt 3da0959291 Update CLI to v12.1.1 2023-11-21 11:15:35 +00:00
Distiller 4cd4b398dd [0.73.0-rc.5] Bump version numbers v0.73.0-rc.5 2023-11-20 18:10:13 +00:00
Thibault Malbranche 2896a57353 bumped packages versions
#publish-packages-to-npm
2023-11-20 17:24:36 +01:00
Luna Wei 5a3bcea25d Update podfile.lock 2023-11-16 23:48:02 -08:00
Luna Wei 3efabb6fa5 bumped packages versions
#publish-packages-to-npm
2023-11-16 23:15:30 -08:00
Luna Wei 690b317106 Update Hermes tag to hermes-2023-11-17-RNv0.73.0-21043a3fc062be445e56a2c10ecd8be028dd9cc5 2023-11-16 23:13:11 -08:00
Jesse Watts-RussellandLuna Wei 3f907b10d4 Android Events - setting default to true to use C++ event pipeline (#41036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41036

Changelog:
[Added] - Shipping the new event dispatching pipeline that immediately moves events over to the C++ queue. This should unblock useDeferredValue + useTransition interruptibility on Android.

Reviewed By: javache

Differential Revision: D50365981

fbshipit-source-id: ecf60e5bc29fb4568463568a6ede4330e0294fd3
2023-11-16 22:46:22 -08:00
David VaccaandLuna Wei 40fe1cbd8c Remove support for Android API < 23 in ReactEditText (#39671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39671

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactEditText

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactEditText

Reviewed By: NickGerleman

Differential Revision: D48545507

fbshipit-source-id: 98be52ba36248962864e99e80ff648bbb351ff61
2023-11-16 22:45:26 -08:00
Dmitry RykunandLuna Wei b23d71ca46 Do not include two copies of JSI when using hermes-engine (#41499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41499

After D48152876 we consume JSI from `ReactCommon/jsi`, and ignore JSI that is distributed with `hermes-engine`.
This diff removes `include/jsi` from `source_files` of `hermes-engine` so we don't get two sets of JSI headers - one from `ReactCommon`, and the other one from `hermes-engine`.
This diff also fixes accidental breakage of ODR violation. We will no longer compile JSI into `react-native` when linking against `hermes-engine`, which already has JSI in it.
Changelog: [iOS][Fixed] - Exclude JSI headers when using hermes-engine prebuilt.

Reviewed By: cipolleschi

Differential Revision: D51347562

fbshipit-source-id: 6e4b9940c43d74d227a05999926b8752d7685670
2023-11-16 22:40:48 -08:00
Gabriel DonadelandLuna Wei edb4746085 Expose unstable_InspectorProxy and unstable_Device from dev-middleware (#41370)
Summary:
Recently, both `metro-inspector-proxy`(https://github.com/facebook/react-native/pull/39045) and `react-native-community/cli-plugin-metro`(https://github.com/facebook/react-native/pull/38795) were moved to this repo and in the process of moving these packages, the `exports` field inside package.json was added, only exporting the `index.js` file.

The problem is that Expo CLI (and possibly other community packages) rely on functions and classes that are not exported in the `index.js` file, e.g. Importing the InspectorProxy class from `react-native/dev-middleware/dist/inspector-proxy/InspectorProxy`. Normally this wouldn't be a problem and we would just import from `dist/` but due to the `exports` field, attempting to import from any other file not specified on this field will result in a `ERR_PACKAGE_PATH_NOT_EXPORTED` error.

As a short-term fix, we should create `unstable_`-prefixed exports of individual features Expo currently depends on.

## Changelog:

[INTERNAL] [CHANGED] - Expose unstable_InspectorProxy and unstable_Device from `react-native/dev-middleware`

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

Test Plan: N / A

Reviewed By: robhogan

Differential Revision: D51163134

Pulled By: blakef

fbshipit-source-id: e67adaedc4fc64131e4c9dd8383c9877b8202283
2023-11-16 22:38:45 -08:00
Kacper KafaraandLuna Wei 735781cc9f Purge children from view registry when UIManager is invalidated (#38617)
Summary:
Talking about Paper & iOS here.

In standard RN applications when a native component is removed permanently from view hierarchy [it is invalidated (if it implements `RCTInvalidating`)](https://github.com/facebook/react-native/blob/e64756ae5bb5c0607a4d97a134620fafcb132b3b/packages/react-native/React/Modules/RCTUIManager.m#L483-L495). Components that implement `RCTInvalidating` such as [`RNSScreenView`](https://github.com/software-mansion/react-native-screens/blob/9fb3bd00850bcdf29b46daa57e56eabda3ae30ea/ios/RNSScreen.mm#L35) of [`react-native-screens`](https://github.com/software-mansion/react-native-screens) library rely on `RCTInvalidating#invalidate` method being called in adequate moment to release retained resources (in my case the `RNSScreenView` holds a strong reference to it's view controller preventing it from being garbage collected).

However in case of brownfield applications (React Native is used only for a particular view & loaded on demand, see: https://github.com/software-mansion/react-native-screens/issues/1754 for discussion & app example) when view controller holding `RCTRootView` is dismissed and whole `React Native` managed view / controller tree gets deallocated, `RCTInvalidating#invalidate` method is not called on the dismissed components, thus in my particular use case, leading to memory leak.

Right now I've added call to `RCTUIManager#_purgeChildren:fromRegistry:` (which internally invalidates all components which implement `RCTInvalidating`) in `RCTUIManager#invalidate`.

## 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] - Purge children from view registry on `RCTUIManager` invalidation.

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

Test Plan:
You can run the [demo](https://github.com/mkondakov/RNSScreensMemoryLeak) provided in the [issue](https://github.com/software-mansion/react-native-screens/issues/1754).

Following screenshots show that memory leak in brownfield application is resolved.

Without the change (`invalidate` method is not being called on native components)

![image](https://github.com/facebook/react-native/assets/50801299/dac331c2-1e7c-4e66-a8c1-b88f7a007d9b)

With the change:

![image](https://github.com/facebook/react-native/assets/50801299/7a8afbe9-446c-47a2-a972-d7589b921677)

Reviewed By: NickGerleman

Differential Revision: D49952215

Pulled By: javache

fbshipit-source-id: 6336b86774615acc40279c97e6ae0bb777bda8ad
2023-11-16 22:37:37 -08:00
Riccardo CipolleschiandGitHub 5d33f03b28 [RN][iOS] Improve Podspec dependencies and prepare support for multiple Apple platforms (#41380)
resolved: https://github.com/facebook/react-native/pull/41353
resolved: https://github.com/facebook/react-native/pull/41354
resolved: https://github.com/facebook/react-native/pull/41355
resolved: https://github.com/facebook/react-native/pull/41356
resolved: https://github.com/facebook/react-native/pull/41357
resolved: https://github.com/facebook/react-native/pull/41358
resolved: https://github.com/facebook/react-native/pull/41359
2023-11-16 22:35:27 -08:00
Riccardo Cipolleschi 77123b8d23 [LOCAL] Update Podfile.lock 2023-11-08 12:06:40 +00:00
Distiller 7ba400c35e [0.73.0-rc.4] Bump version numbers v0.73.0-rc.4 2023-11-06 22:35:02 +00:00
Luna Wei 7366fc64d8 bumped packages versions
#publish-packages-to-npm
2023-11-06 14:21:06 -08:00
Luna Wei 40c149b0c4 Update missing rnc/cli related packages to 12.0.0 and update lockfile 2023-11-03 10:38:27 -07:00
Riccardo CipolleschiandGitHub 641a11fe21 [RN][CI]Update node installation on debian (0.73) (#41275) 2023-11-03 09:32:40 -07:00
Gabriel DonadelandLuna Wei 84144272ba Fix ios pod post_install logic for detecting if fabric is enabled (#41284)
Summary:
There is a problem in the way that we check if Fabric is enabled inside `react_native_post_install`.

https://github.com/facebook/react-native/blob/899e7cdb55197fc17a96a93af4f8bcc7519553c2/packages/react-native/scripts/react_native_pods.rb#L239

We're determining if fabric is enabled by checking if the `React-Fabric pod `is present, but since we always call `setup_fabric!(:react_native_path => prefix)`  (https://github.com/facebook/react-native/pull/39057) inside `use_react_native` the `React-Fabric` pod is always present causing the `-DRN_FABRIC_ENABLED` flag to always be added to `project.pbxproj` even if the new arch is disabled.

[IOS] [FIXED] - Fix ios pod post_install logic for detecting if fabric is enabled

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

Test Plan: Run `use_react_native!(fabric => false)` should not add the `-DRN_FABRIC_ENABLED` flag to `project.pbxproj`

Reviewed By: fkgozali

Differential Revision: D50896487

Pulled By: cipolleschi

fbshipit-source-id: 78154407ce52b09fd3a317b7dc64bd4bba56363e
2023-11-02 15:32:13 -07:00
Luna Wei 9b97cd95cf Update podfile.lock and yarn.lock 2023-11-02 15:28:41 -07:00
Riccardo CipolleschiandLuna Wei cddd0e17d1 Make the interop-layer work with components with custom name (#41207)
Summary:
This should fix
https://github.com/facebook/react-native/issues/37905#issuecomment-1774851214

When working on react-native-fast-image, we realized that the interop layer does not work for components where the exported name is different from the iOS class.

To fix this, we can use the Bridge to retrieve the actual view manager, given the component name.

This solution should be much more robust than making assumptions on the ViewManager name, given the ComponentName.

On top of that, we realized tha the interop layer was not calling `didSetProps` after setting the props, so we are invoking that.

bypass-github-export-checks

[iOS][Fixed] - Add support for Components with custom names in the interop layer.

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

Test Plan: Tested locally on an app created in 0.72 and 0.73 in Bridge and Bridgeless mode.

Reviewed By: cortinico

Differential Revision: D50698172

Pulled By: cipolleschi

fbshipit-source-id: 49aee905418515b0204febbbe6a67c0114f37029
2023-11-02 14:55:24 -07:00
Luna Wei 126db5eb65 Bump CLI to 12.0.0 2023-11-02 14:46:36 -07:00
Rob HoganandLuna Wei 31ce64073f Bump dependency on deprecated-react-native-prop-types (#40869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40869

Bumps DRNPT to v5 - the significant change is that this one depends on `react-native/normalize-color: ^0.73.0`, instead of `*`, so is protected from future breaking changes to that package.

NOTE: We can't safely include `react-native/normalize-color: ^0.74.0` in the dependency range of DRNPT because `0.74.0` isn't a semver-compliant release (0.74 isn't cut yet), so this will pull 0.73.2 from NPM, which is fine.  We may need to publish DRNPT@6 if 0.74 final turns out to contain breaking changes (eg, a Node 20 bump).

Changelog:
[General][Fixed] Update `deprecated-react-native-prop-types` to remove fragile transitive `*` dependencies.

Reviewed By: huntie

Differential Revision: D50228564

fbshipit-source-id: 01aafafad40d9a93d00de2b5f45d2796620b9b5d
2023-11-02 12:01:08 -07:00
Gabriel Donadel Dall'AgnolandLuna Wei 7aa46a169e Fix createAnimatedStyle when providing undefined transform style (#41176)
Summary:
https://github.com/facebook/react-native/pull/35198 introduced a regression where if an `{transform: undefined}` style is provided to an Animated View a `Cannot read property 'map' of undefined` type error is thrown

<img src="https://github.com/facebook/react-native/assets/11707729/bb87781e-1ba7-40ec-879d-a57cef3e10d9" height="200" />

## Changelog:

[GENERAL] [FIXED] - Fix `createAnimatedStyle` when providing an undefined transform style

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

Test Plan:
<details>
  <summary>Render an `Animated.View` passing `style={{transform: undefined}}`</summary>

E.g.

```
const UndefinedTransform = () => {
  return (
    <View>
      <Animated.View style={{transform: undefined}} />
    </View>
  );
};
```
</details>

### RNTester
1. Open the RNTester app and navigate to the Animated page
2. Navigate to the Transform Styles page
3. App should not throw any errors

<table>
    <tr><th>Before</th><th>After</th></tr>
    <tr>
        <td><video src="https://github.com/facebook/react-native/assets/11707729/92ba9c3b-60b0-4805-8080-0e7fb7c00345"/></td>
        <td><video src="https://github.com/facebook/react-native/assets/11707729/80e2bba8-6ff6-4cf5-bcb8-26de0b869036"/></td>
    </tr>
</table>

Reviewed By: fabriziocucci

Differential Revision: D50638415

Pulled By: javache

fbshipit-source-id: 0ee949f019a77b8bef557888694e0e8404810105
2023-11-02 11:59:41 -07:00
Nick GerlemanandLuna Wei 29f8f1e196 Bail on hiPri render on missing layout data before checking priority (#41270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41270

`scheduleCellsToRenderUpdate()` is called in response to new measurements, or component changes. It has logic to decide whether to immediately calculate new state, or to defer it until a later batched period.

It will not immediately update state if we don't yet have measurements for cells, but this condition is after another which calculates priority, relying on these measurements. These are garbage if we don't yet have measurements, and trigger an invariant violation in horizontal RTL.

This switches around the conditions, to avoid offset resolution if we don't yet have valid measurements.

I suspect some "hiPri" renders where cells shift are bugged right now when we update state in response to content size change, before we have new corresponding cell layouts.

Changelog:
[General][Fixed] - Bail on hiPri render on missing layout data before checking priority

Reviewed By: yungsters

Differential Revision: D50791506

fbshipit-source-id: 8dbffc37edd2a42f7842c0090d344dcd6f3e3c6d
2023-11-02 11:58:46 -07:00
tarunrajputandLuna Wei 832b423a65 fix: textTransform not working in new arch (#41223)
Summary:
Fixes: https://github.com/facebook/react-native/issues/39524

## 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
-->
[ANDROID] [FIXED] - Fix textTransform not working in new architecture

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

Test Plan:
**Before:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/d44e6030-0a49-42c9-be44-cf7541583af0">

**After:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/fb717cec-72d3-41d7-8c48-4ec9a9ecb16b">

Reviewed By: javache

Differential Revision: D50773216

Pulled By: NickGerleman

fbshipit-source-id: 769bf67f2661ff4ff7b88121493bdd27564458d3
2023-11-02 11:57:57 -07:00
David VaccaandLuna Wei f4cf8abc09 Back out "Add support for legacy UIManager in UIManagerHelper"
Summary:
Original commit changeset: 93eba1eb3106

Original Phabricator Diff: D50694805

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D50853438

fbshipit-source-id: 687cb100dfea28f3ea63812e1dd5b21e4c8ceb0e
2023-11-02 11:55:00 -07:00
Nicola CortiandGitHub c8ad23ae1a [0.73] Collection of Android picks for RC4 (#41221)
Co-authored-by: Lulu Wu <luluwu@meta.com>
Co-authored-by: Gabriel Donadel <donadeldev@gmail.com>
fix `java.lang.NoSuchMethodError` for Bridgeless (#41081)
resolved: https://github.com/facebook/react-native/pull/41081
resolved: https://github.com/facebook/react-native/pull/40999
resolved: https://github.com/facebook/react-native/pull/41165
Fix RNTester not showing Redbox when Metro is not connected (#41191)
resolved: https://github.com/facebook/react-native/pull/41191
resolved: https://github.com/facebook/react-native/pull/41190
resolved: https://github.com/facebook/react-native/pull/41085
resolved: https://github.com/facebook/react-native/pull/41206
2023-11-02 09:23:15 -07:00
Riccardo CipolleschiandGitHub 2664b8b117 cipolleschi/fix test script (#41267) 2023-11-02 09:22:38 -07:00
Rob HoganandRob Hogan aed4aed9d5 Update Metro to ^0.80.0, don't pin to exact version
cherry-pick 7853b06929
2023-10-31 11:12:31 +00:00
Riccardo Cipolleschi abfdf2c7fe [LOCAL] Update Podfile.lock 2023-10-24 15:16:06 +01:00
Riccardo Cipolleschi 4ddf7cb025 [LOCAL] Run prettier 2023-10-24 15:14:33 +01:00
Riccardo Cipolleschi f068f4a903 [LOCAL] Fix e2e script for 0.73 2023-10-24 14:50:22 +01:00
Moti ZilbermanandAlex Hunt d64c72f629 Remove deprecated jsinspector files (#41159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41159

Changelog: [Internal]

Cleanup from D48966244. The deprecated `jsinspector` files are no longer used by any code in either fbsource or `react-native`.

Reviewed By: hoxyq

Differential Revision: D50530796

fbshipit-source-id: b539b097cb6caf6c50a482fa93bf5d7886e76e52
2023-10-23 16:32:31 +01:00
Distiller 6d41c72a90 [0.73.0-rc.3] Bump version numbers v0.73.0-rc.3 2023-10-23 14:23:48 +00:00
Riccardo CipolleschiandAlex Hunt 764ae1a03a Make the Fabric Interop layer work in Bridgeless (#40732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40732

This change allows the Fabric Interop Layer to work in bridgeless mode.

Given that the legacy components requires a Bridge to send events and use commands, this change simulates a bridge when it doesn't exists (i.e.: we are in bridgeless mode).

In order to make it work, we had to simulate a few elements from the Bridge and the UIManager.

## Changelog:
[iOS][Fixed] - Make the Fabric interop layer works in bridgeless mode.

## Facebook:
As an alternative approach, we could have created a `protocol RCTBridging`, have the `RCTBridge` conform to that protocol, and create a new type for it.
Practically this would have been much more cumbersome:
1. The [RCTBridge](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridge.h?lines=87-238) interface is quite big. All the props and method should be part of the protocol.
2. Extensions declared on RCTBridge would not have worked. For example, [`RCTBridge (RCTUIManager)`](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Modules/RCTUIManager.h?lines=170-174).
3. It would require a major overhaul of the APIs, returning `id<RCTBridging>` in place of **every** function that takes/return an instance of `RCTBridge *`.

Clearly, not a feasible way to go.

Reviewed By: RSNara

Differential Revision: D50079929

fbshipit-source-id: 77d4370e9043c8e06b676bff3987511c042b0f9c
2023-10-23 09:55:17 +01:00
Riccardo CipolleschiandAlex Hunt cb658983c4 Fix Glog for earlier versions of Xcode (#41058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41058

Glog has a piece of code which looks like this:
```
namespace google {

// They need the definitions of integer types.
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
```

This fragment is:
- Always valid when the pod does not define a module
- Valid for Xcode >= 14.3, when the pod do define a module
- Invalid for Xcode < 14.3, when the pod do define a module

Modules are required to support Swift, so, in the long run, we want to have `DEFINES_MODULE` set to `YES` for `Glog`.

This is a temporary workaround to keep supporting older versions of Xcode while Apple keeps allowing to use Xcode 14.1 to submit apps to the store.
Historically, Apple pushes the minimum version of Xcode every April, so we expect to be able to remove this workaround in April 2024.

## Changelog:
[Internal] - Make Glog work with older versions of Xcode

Reviewed By: cortinico

Differential Revision: D50410487

fbshipit-source-id: 96145cdf9ba1bc75622403d3c06454d6d4bfd967
2023-10-23 09:55:08 +01:00
Riccardo CipolleschiandAlex Hunt 50a8bd8146 Make hermes build fetching more flavour resilient (#41055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41055

This should fix the issue highlighted in [this comment](https://github.com/reactwg/react-native-releases/discussions/64#discussioncomment-7271155).
Basically, before the fix, we were not supporting flavours correctly, as we assumed that only Debug and Release were available.

With this change, we infer whether we have to fetch Hermes for Debug or Release based on the actual flags that are passed. In this way, the users can customize their app's flavors more freely.

## Changelog:
[Internal] - Support multiple flavors when downloading Hermes

Reviewed By: huntie

Differential Revision: D50408381

fbshipit-source-id: 6990218b286b4dd823323bc63de90279efc9e74e
2023-10-23 09:54:41 +01:00
Alex Hunt a98a781988 Bump package versions
#publish-packages-to-npm
2023-10-19 15:41:54 +01:00
Nicola CortiandAlex Hunt d6b73c6726 Make IntArray events work on Bridgeless for RN-Tester (#41047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41047

Array events are currently broken in the sample for RN Tester. This is because the event name is not registered correctly.

I'm updating the event registration to be correct.

Changelog:
[Internal] [Changed] - Make IntArray events work on Bridgeless for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D50266485

fbshipit-source-id: 13bbce91a41281383d4857048e573b6d9cc5387b
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt d1e2137425 Make events work for Fabric Interop on Bridgeless (#40941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40941

Events are currently not working for Fabric Interop on Bridgeless. That's because the `BridgelessReactContext` is not checking for interop modules on `getJsModule` calls, so the `InteropEventEmitter` is never returned.

This extends `BridgelessReactContext` so that  `InteropEventEmitter` is returned if the Interop Layer is turned on.

Changelog:
[Internal] [Changed] - Make events work for Fabric Interop on Bridgeless

Reviewed By: cipolleschi

Differential Revision: D50266484

fbshipit-source-id: 0188d71bdc7acc8c188d886d45f0258914ad7af7
2023-10-19 14:29:31 +01:00