Commit Graph
33095 Commits
Author SHA1 Message Date
Joe VilchesandBlake Friedman defc0c8c21 Fix animating background colors in View (#47101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47101

See https://github.com/facebook/react-native/issues/47011

borders do not have this problem because they call `removeAllAnimations` on the layer after changing it, which is what I am doing here

Changelog: [iOS] [fixed] - Fixed bug where background colors would sometimes animate when changing on Views

Reviewed By: cipolleschi

Differential Revision: D64493968

fbshipit-source-id: cf81549f21b124b67c6e7647c6ae827bfe80a9cf
2024-10-28 14:19:54 +00:00
Sunny LuoandBlake Friedman e56bd89eff Add jsBundleFile to DefaultReactNativeHost.kt (#47188)
Summary:
The JsBundleFilePath has been ignored when converting DefaultReactNativeHost to ReactHost

Changelog:
[Internal] [Changed] - Add jsBundleFile to DefaultReactNativeHost.kt

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

Reviewed By: javache

Differential Revision: D64914149

Pulled By: cortinico

fbshipit-source-id: d437ca81df5a170e0c5f01a22ccda83f43a09dd2
2024-10-28 14:19:49 +00:00
Riccardo CipolleschiandBlake Friedman 807500a63e Exclude generation of app-defined components from RCTThirdPartyFabricComponentsProvider (#47176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47176

While writing the guide for the New Architecture, we realized that we need to exclude the generation of the Cls function in the RCTThirdPartyFabricComponentsProvider for components defined in the app.

This is needed because a component that is defined in the app will have those function defined in the app project. However, the RCTThirdPartyFabricComponentsProvider is generated in Fabric, inside the Pods project.

The pod project needs to build in isolation from the app and cocoapods then link the app to the pods project. But the compilation of the pods project fails if one of the symbol needed by the pods lives in the app.

By disabling the generation of that function in th RCTThirdPartyFabricComponentsProvider, we can successfully build the app.

The downside is that the user needs to register the component manually, but this is not an issue because if they are writing a component in the app space, they have all the information tomanually register it in the AppDelegate

## Changelog
[iOS][Fixed] - Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app.

Reviewed By: cortinico, blakef

Differential Revision: D64739896

fbshipit-source-id: 0eca818ea0198532a611377d14a3ff4c95cb5fe3
2024-10-28 14:19:41 +00:00
Blake FriedmanandBlake Friedman bea4535246 Let .xcode.env.local NODE_BINARY handle path spaces
Summary:
For users who may have node installed in a path with a space, this requires escaping.  For example:

```
NODE_BINARY=/Users/blakef/Library/Application Support/fnm/node-versions/v20.12.0/installation/bin/node
```

Needs to be:

```
NODE_BINARY=/Users/blakef/Library/Application\ Support/fnm/node-versions/v20.12.0/installation/bin/node
```

# Changelog
[iOS][Fixed] Generated NODE_BINARY in .xcode.env.local now supports paths with a space

Reviewed By: cipolleschi

Differential Revision: D64080118

fbshipit-source-id: 1045473e4fd284fc570fa538984618630be1af6d
2024-10-28 14:19:34 +00:00
Blake Friedman 699a94d938 Update Podfile.lock
Changelog: [Internal]
2024-10-23 13:58:04 -07:00
React Native Bot 2e10ba945f Release 0.76.0
#publish-packages-to-npm&latest
v0.76.0
2024-10-23 16:09:59 +00:00
Riccardo CipolleschiandGitHub 007a8e12b8 [LOCAL] Fix template publishing (#47116) 2024-10-18 11:13:11 +01:00
Riccardo Cipolleschi 1be8c51173 [LOCAL] Bump Podfile.lock 2024-10-17 19:06:26 +01:00
React Native Bot 9f9e1a41ca Release 0.76.0-rc.6
#publish-packages-to-npm&next
v0.76.0-rc.6
2024-10-17 15:57:42 +00:00
Riccardo Cipolleschi c967deaa2d Revert "Fix Android AlertFragment Title Accessibility (#45395)"
This reverts commit 80a3ed7d0c.
2024-10-17 16:08:03 +01:00
Nicola CortiandGitHub 55671c00e5 [0.76] Undo breaking change on UIManager eventDispatcher accessor (#47090)
Summary:

Whe migrating this interface to Kotlin we've subtly introduced a breaking change which is causing a lot of breakages in the ecosystem.

This is forcing users to do:
```
// Before
reactContext.getNativeModule(UIManagerModule::class.java)!!.eventDispatcher
// After
reactContext.getNativeModule(UIManagerModule::class.java)!!.getEventDispatcher()
```

This reverts this breaking change.

Plus the method had a generic parameters which was completely unnecessary so I'm removing it.


Changelog:
[Android] [Fixed] - Undo breaking change on UIManager eventDispatcher accessor

Reviewed By: cipolleschi

Differential Revision: D64533594
2024-10-17 14:40:04 +01:00
Nicola CortiandRiccardo Cipolleschi ce1620616c Undo breaking change on ViewManagerDelegate.kt String params (#47086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47086

When we migrated `ViewManagerDelegate` to Kotlin, we convered his string params to be `String` (rather than `String?`).

Existing implementation of this interface in OSS written in Kotlin were using `String?` due to this interface being in Java (and not being Nullsafe annotated).
Therefore now changing this interface from `String?` to `String` is a breaking change for them.

Affected libraries are:
https://github.com/search?q=%22fun+receiveCommand%28%22+%22commandId%3A+String%3F%22+%22args%3A+ReadableArray%22+language%3Akotlin+-org%3Afacebook+-is%3Afork&type=code&p=4

This prevents the breaking change and should be included in 0.76.

Changelog:
[Android] [Fixed] - Undo breaking change on ViewManagerDelegate.kt String params

Reviewed By: cipolleschi

Differential Revision: D64532446

fbshipit-source-id: aac286554ad0e35f557160f900bcbad1acc5930d
2024-10-17 14:38:33 +01:00
Blake Friedman ab0d812cc6 Update Podfile.lock
Changelog: [Internal]
2024-10-15 23:49:56 +01:00
React Native Bot 5e2f3e018c Release 0.76.0-rc.5
#publish-packages-to-npm&next
v0.76.0-rc.5
2024-10-15 17:25:47 +00:00
Blake Friedman 45ae0b44d5 Replace sh scripts with tested JS scripts to release template (#46363)
Summary:
The previous scripts to trigger the react-native-communty/template
release workflow has not been working. This is a rewrite is js, along
with some testing to make this more robust.

I've have a PR to combine the publish and tag steps in the template publication: https://github.com/react-native-community/template/pull/65, this takes advantage of that change.

Changelog: [Internal]

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

Test Plan:
1. Unit tests
2. Once the infrastructure lands in the `react-native-community/template` workflow, we can trigger a dry run.

## TODO:
- ~~Still needs to be used in the GH release workflow.~~
- ~~Template release workflow needs to land the dry_run input change.~~

## Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D62296008

Pulled By: blakef

fbshipit-source-id: 217326c44b1d820e36a1d847cf9ad24d228087c1
2024-10-15 14:47:59 +01:00
Alex HuntandGitHub 02b879b1e2 [0.76] Fix server.end() usage following Metro bump (#47023) 2024-10-15 11:39:02 +01:00
Blake Friedman 788dd2e681 [LOCAL] Fix cherry-pick error
Looks like #46787 wasn't picked correctly.
2024-10-15 11:26:52 +01:00
Rob HoganandGitHub 3f8d1fa286 [0.76] Update Metro to "^0.81.0" (#47013) 2024-10-15 10:13:05 +01:00
Gabriel DonadelandBlake Friedman 066128321d Make PackagerConnectionSettings class open again (#47005)
Summary:
When migrating `PackagerConnectionSettings` from Java to Kotlin in https://github.com/facebook/react-native/pull/45800 the new class ended up being declared as final, causing a breaking change in 0.76.

We should add the `open` directive to `PackagerConnectionSettings.kt` to restore the old behavior. That would be crucial for the `expo-dev-client` package, given that Expo needs to be able to extend this class in order to overwrite the `debugServerHost` value.

## Changelog:

[ANDROID] [FIXED] - Make PackagerConnectionSettings class open again

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

Test Plan: Run RNTester on Android

Reviewed By: huntie

Differential Revision: D64323645

Pulled By: cortinico

fbshipit-source-id: 6870a3dee929ba664e4c402f321f84af7704f892
2024-10-15 10:11:48 +01:00
Nicola CortiandBlake Friedman 60a2706e97 Gradle to 8.10.2 (#46656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46656

This contains the fix for:
- https://github.com/gradle/gradle/issues/30472

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

Reviewed By: tdn120

Differential Revision: D63457979

fbshipit-source-id: 1439a9ce198c1df0dafa8f5088c079c3fb3d1543
2024-10-15 10:11:32 +01:00
Thibault MalbrancheandBlake Friedman d91a12bc8b fix: override podspecs dependencies c++ version (#46888)
Summary:
Some dependencies would override C++ version like [this](https://github.com/mrousavy/react-native-vision-camera/blob/83abb0832a22b6b080f8412ed17b0992532b0eb2/VisionCamera.podspec#L36).

We force it back to be the current version set by react-native so that we are sure projects are using the correct version

[IOS] [FIXED] - Enforce we use the correct C++ version for all, even if dependency tries to set it

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

Test Plan:
This can be test via
https://github.com/Titozzz/cpp17bug

Reviewed By: blakef

Differential Revision: D64042099

Pulled By: cipolleschi

fbshipit-source-id: c36dda0a718e52e19d53c3e9d895315141cb040c
2024-10-15 10:10:41 +01:00
Alan LeeandBlake Friedman 111d013c03 fix crash for Modal not attached to window manager (2) (#46764)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46764

This is a patched fix to earlier attempt (D63700769) and resolving crash due to`java.lang.IllegalArgumentException: View=DecorView@b9f88af[AdsManagerActivity] not attached to window manager`.
- removing ` !dialogWindow.isActive` check as it is always true resulting in always doing early return causing other bugs
- adding try/ catch instead so the code can still run but can catch the known exception without crashing

Changelog:
[Android][Fixed] - Fix crash for Modal not attached to window manager

Reviewed By: mdvacca

Differential Revision: D63712422

fbshipit-source-id: 85fb6df340eb1139f954c92b5f1daf0dc41671d2
2024-10-15 10:10:04 +01:00
Riccardo CipolleschiandBlake Friedman 7e14ec5177 Exclude dSYM from the archive (#46472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46472

Currently, we are building the Debug symbols (dSYM) for hermes dSYM but we are not shipping them with the xcframework.
This is correct, because Debug symbols can increase the size of Hermes thus enalrging the iOS IPA and increasing the download time when installing pods.

We distribute the dSYM separatedly, in case users needs to symbolicate Hermes stack traces.

However the path to the dSYM still appears in the Info.plist of the universal XCFramework and this can cause issues when submitting an app to apple.

This change should remove those lines from the universal framework.

It fixes https://github.com/facebook/react-native/issues/35863

[Internal] - Remove dSYM path from Info.plist

Reviewed By: cortinico

Differential Revision: D62603425

fbshipit-source-id: 038ec3d6b056a3d6f5585c8125d0430f56f11bb9
2024-10-15 10:08:57 +01:00
Blake Friedman 8d8b8c343e Update Podfile.lock
Changelog: [Internal]
2024-10-09 01:47:01 +01:00
React Native Bot 5106933c75 Release 0.76.0-rc.4
#publish-packages-to-npm&next
v0.76.0-rc.4
2024-10-08 22:20:58 +00:00
Blake Friedman 25a65cd2bd Revert [0.76] Fix errors with component stacks reported as warnings
- "Fix errors with component stacks reported as warnings (#46637)": 2da46a88ee
- "Refactor LogBox tests to spies (#46638)": 89263647aa
- "Add integration tests for console errors + ExceptionManager (#46636)": 094f036115
- "Re-enable integration tests (#46639)": bf40710f4f
2024-10-07 15:59:39 +01:00
Alex HuntandGitHub 7a601f428e [0.76] Update debugger-frontend from e8c7943...ce5d32a (#46790) 2024-10-07 15:42:18 +01:00
Alex HuntandGitHub 6047f9cc09 [0.76][Fix] Restore Metro log forwarding, change notice to signal future removal (#46815) 2024-10-07 15:41:56 +01:00
Nicola CortiandGitHub 531657b394 [0.76] Update ReactNativeFlipper deprecation to ERROR (#46840) 2024-10-07 15:41:32 +01:00
Rick HanlonandBlake Friedman 2da46a88ee Fix errors with component stacks reported as warnings (#46637)
Summary:
Ok so this is a doozy.

## Overview
There was a report that some console.error calls were being shown as warnings in LogBox but as console.error in the console. The only time we should downlevel an error to a warning is if the custom warning filter says so (which is used for some noisy legacy warning filter warnings internally).

However, in when I switched from using the `Warning: ` prefix, to using the presence of component stacks, I subtly missed the default warning filter case.

In the internal warning filter, the `monitorEvent` is always set to something other than `unknown` and if it's set to `warning_unhandled` then `suppressDialog_LEGACY` is always false.

However, the default values for the warning filter are that `monitorEvent = 'unknown'` and `suppressDialog_LEGACY = true`. In this case, we would downlevel the error to a warning.

## What's the fix?
Change the default settings for the warning filter.

## What's the root cause?

Bad configuration combinations in a fragile system that needs cleaned up, and really really bad testing practices with excessive mocking and snapshot testing (I can say that, I wrote the tests)

## How could it have been caught?
It was, but I turned off the integration tests while landing the component stack changes because of mismatches between flags internally and in OSS, and never turned them back on.

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

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

Reviewed By: huntie

Differential Revision: D63349613

Pulled By: rickhanlonii

fbshipit-source-id: 32e3fa4e2f2077114a6e9f4feac73673973ab50c
2024-10-07 15:35:28 +01:00
Rick HanlonandBlake Friedman 89263647aa Refactor LogBox tests to spies (#46638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46638

This is annoying, but in the next diff that fixes a bug I need to test using the default warning filter instead of a mock (really, all this mocking is terrible, idk why I did it this way).

Unfortunately, in Jest you can't just reset mocks from `jest.mock`, `restoreMocks` only resets spies and not mocks (wild right).

So in this diff I converted all the `jest.mock` calls to `jest.spyOn`. I also corrected some of the mocks that require `monitorEvent: 'warning',` like the warning filter sets.

I also added a test that works without the fix.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63349615

fbshipit-source-id: 4f2a5a8800c8fe1a10e3613d3c2d0ed02fca773e
2024-10-07 15:35:28 +01:00
Rick HanlonandBlake Friedman 094f036115 Add integration tests for console errors + ExceptionManager (#46636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46636

Adds more integration tests for LogBox (currently incorrect, but fixed in a later diff).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63349614

fbshipit-source-id: 8f5c6545b48a1ed18aea08d4ecbecd7a6b9fa05a
2024-10-07 15:35:28 +01:00
Rick HanlonandBlake Friedman bf40710f4f Re-enable integration tests (#46639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46639

These tests were skipped when we were switching to component stacks, which also hid a bug later in the stack. Re-enable them.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63349616

fbshipit-source-id: ccde7d5bb3fcd9a27adf4af2068a160f02f7432a
2024-10-07 15:35:27 +01:00
Cedric van PuttenandBlake Friedman 9ae812c72d fix(dev-middleware): respond with status code 200 when launching RNDT (#46814)
Summary:
This fixes an issue where `POST /open-debugger?appId&device&target` does not return a proper status code, meaning that the request will never be answered and clients might hang until the request timeout is hit.

## 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] - Respond with status code `200` when successfully launching RNDT

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

Test Plan:
- `curl -v -X POST "<deviceUrl>"`
- This should show a proper response for the request.

before | after
 --- | ---
![image](https://github.com/user-attachments/assets/5b820acd-1168-4642-90ec-f2eeec0afc16) | ![image](https://github.com/user-attachments/assets/82bb2a6c-3c7b-483f-a4a1-ad00e5ca0178)

Reviewed By: NickGerleman

Differential Revision: D63837025

Pulled By: huntie

fbshipit-source-id: ac72fc793e015f0eec498f4a35b4fb9e301c5b32
2024-10-07 15:19:52 +01:00
Alan HughesandBlake Friedman 904222e608 Allow taking control of bundle loading on new arch (#46731)
Summary:
On the old architecture you could take control of loading the bundle by implementing
```objc
- (void)loadSourceForBridge:(RCTBridge *)bridge
                 onProgress:(RCTSourceLoadProgressBlock)onProgress
                 onComplete:(RCTSourceLoadBlock)loadCallback;
```
in your `RCTBridgeDelegate`. This is not currently possible in the new architecture.

I've added this using a pretty much identical api by adding a function to both the `RCTInstanceDelegate` and `RCTHostDelegate` protocols. This will be called on the `RCTRootViewFactory`. I've added two properties to the `RCTRootViewFactoryConfiguration`, `loadSourceForHost` and `loadSourceWithProgressForHost`. If one is present, we call it, otherwise we fallback to the normal loading process

## Changelog:

[iOS] [Breaking] - Add ability to control bundle loading on the new architecture similar to `loadSourceForBridge`. Removed some properties from the `RCTRootViewFactory`.

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

Test Plan: Rn-tester works as normal and it is working for our use case in expo go.

Reviewed By: blakef

Differential Revision: D63755188

Pulled By: cipolleschi

fbshipit-source-id: f1f26b2775b9e547ce7a23028665797c19bfdd9b
2024-10-07 15:19:35 +01:00
Saad NajmiandBlake Friedman a536580e84 fix(iOS): Properly retain/release backgroundColor in RCTBorderDrawing (#46797)
Summary:
I discovered this while working on my shim of `UIGraphicsImageRenderer` for macOS (See https://github.com/microsoft/react-native-macos/pull/2209). A variable of type`CGColorRef` is not automatically retained and released when passed into a block. There was a case in `RCTBorderDrawing` where we were doing so. To fix this, we have two options:

1. Pass a `UIColor` instead (Requires a change to the signature of the function calling it)
2. Properly retain and release the variable.

The first option would technically be a breaking change (we would need to change the signature of `RCTGetBorderImage`, so I'm opting for option 2.

## Changelog:

[IOS] [FIXED] -  Properly retain/release backgroundColor in RCTBorderDrawing

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

Test Plan: CI should pass. Locally, borders still draw fine for me.

Reviewed By: joevilches

Differential Revision: D63827824

Pulled By: cipolleschi

fbshipit-source-id: 926601d062b90a7d741d7a1af3070cec4b8795ae
2024-10-07 15:19:09 +01:00
Saad NajmiandBlake Friedman 5e9804a398 Rename RCTUIGraphicsImageRenderer to RCTMakeUIGraphicsImageRenderer (#46772)
Summary:
Because `UIGraphicsImageRenderer` doesn't exist on macOS, I need to shim it for React Native macOS (See https://github.com/microsoft/react-native-macos/pull/2209). I planned to use the name `RCTUIGraphicsImageRenderer`. However.. it seems that is used by a static helper function in `RCTBorderDrawing.m`. So.. let's rename it? The function is just a helper method to make an instance of the class, so I think the name `RCTMakeUIGraphicsImageRenderer` is slightly more idiomatic anyway.

This method is not public, so it should not break the public API of React Native.

## Changelog:

[IOS] [CHANGED] - Rename `RCTUIGraphicsImageRenderer` to `RCTMakeUIGraphicsImageRenderer`

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

Test Plan: CI should pass

Reviewed By: joevilches

Differential Revision: D63765490

Pulled By: cipolleschi

fbshipit-source-id: de68dce0f92ec249ea8586dbf7b9ba34a8476074
2024-10-07 15:18:34 +01:00
shubhamguptadream11andBlake Friedman e14cdf6a5b fix(iOS): title and title color handling added for refresh control (#46655)
Summary:
Solve a part of this issue:  https://github.com/facebook/react-native/issues/46631

## 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] [CHANGED] - Passed correct title and titleColor prop to updateTitle function

**What's the Issue:**
When updating the PullToRefreshViewProps in a React Native iOS app, changes to the title and titleColor were not being reflected properly in the RefreshControl. This happened because the function responsible for updating the title (_updateTitle) was not always receiving the correct or updated values for title and titleColor.

**Updated `_updateTitle` function:**

The _updateTitle method was modified to accept both title and titleColor as parameters. This ensures that the latest values are always used when updating the refresh control's attributedTitle.
If the title is empty, the attributedTitle is cleared by setting it to nil. Otherwise, both the title and titleColor (if present) are applied correctly.

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

Test Plan:
**Without fix:**
https://github.com/user-attachments/assets/8a83c247-bf78-4080-bdc1-ac5a852481e8

**With Fix:**
https://github.com/user-attachments/assets/52e2495a-4419-41d1-b308-acb64600f9f7

Reviewed By: javache

Differential Revision: D63466516

Pulled By: cipolleschi

fbshipit-source-id: fef61a003b658b20a25b61b6d07ee9fe0750dae7
2024-10-07 15:18:34 +01:00
Riccardo CipolleschiandBlake Friedman 1c47b60585 Fix the generation of .xcode.env.local (#46661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46661

The previous approach was brittle and it was not working in all the scenarios.

This is the same approach used [by Expo](https://github.com/expo/expo/blob/12f24ea7fdbc8bab864d7852ae8e7275e44db4df/packages/expo-modules-autolinking/scripts/ios/xcode_env_generator.rb#L37C44-L37C75) (thanks guys! :D) and it looks like it is more stable.

This should definitely fix [#43285](https://github.com/facebook/react-native/issues/43285).

## Changelog
[Internal] - Fix the generation of .xcode.env.local

Reviewed By: cortinico

Differential Revision: D63460707

fbshipit-source-id: c6732adce3df5f8365b17ed9c500c38f773ecee5
2024-10-07 15:18:33 +01:00
zhongwuzwandBlake Friedman 756867933e Fabric: Fixes animations strict weak ordering sorted check failed (#46582)
Summary:
Fixes https://github.com/facebook/react-native/issues/46568 . cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fabric: Fixes animations strict weak ordering sorted check failed

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

Test Plan:
See issue in  https://github.com/facebook/react-native/issues/46568

## Repro steps
- Install Xcode 16.0
- navigate to react-native-github
- yarn install
- cd packages/rn-tester
- bundle install
- RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
open RNTesterPods.xcworkspace to open Xcode

{F1885373361}

Testing with Reproducer from OSS
|  Paper |  Fabric (With Fix) |
|--------|-----------------|
| {F1885395747} | {F1885395870} |

Android - LayoutAnimation (Looks like it has been broken and not working way before this changes.)
 https://pxl.cl/5DGVv

Reviewed By: cipolleschi

Differential Revision: D63399017

Pulled By: realsoelynn

fbshipit-source-id: aaf4ac2884ccca2da7e90a52a8ef10df6ae4fc8a
2024-10-07 15:18:33 +01:00
Tomasz ŻelawskiandBlake Friedman 273ad9c070 feat: Expose MetroConfig type directly from @react-native/metro-config (#46602)
Summary:
React Native [app template provided by the CLI](https://github.com/react-native-community/template) currently uses [`metro-config` directly for `MetroConfig` type](https://github.com/react-native-community/template/blob/main/template/metro.config.js#L7).
However, it doesn't have `metro-config` as neither a dependency or dev dependency, which can lead to version mismatches.

While this is obviously a mistake on the template repo side, `metro-config` versions aren't matched with `react-native` versions. Therefore, getting the correct version of `metro-config` from `react-native/metro-config` would require reflecting on `react-native/metro-config`'s package.json etc. which is far from ideal. In my opinion it's would be much better to expose `MetroConfig` type from `react-native/metro-config` directly.

Version mismatching can happen in a monorepo setup. Say we have the monorepo structure using Yarn Modern:

```tree
.
├── RN75-app (workspace)
├── RN76-app (workspace)
│   ├── metro.config.js
│   └── node_modules
│       └── react-native
│           └── metro-config (0.76)
│               └── node_modules
│                   └── metro-config (version for 0.76)
└── node_modules
    ├── react-native
    │   └── metro-config (0.75)
    └── metro-config (version for 0.75)
```

`react-native@0.75` gets hoisted to the monorepo root while `react-native@0.76` sits in an RN 0.76 app workspace.

Say we have the following `RN76-app/metro.config.js` contents:

```js
const {getDefaultConfig, mergeConfig} = require('react-native/metro-config');

/**
 * Metro configuration
 * https://reactnative.dev/docs/metro
 *
 * type {import('metro-config').MetroConfig}
 */
const config = {};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
```

In this case, `require('react-native/metro-config')` would resolve to `RN76-app/node_modules/react-native/node_modules/metro-config` since `react-native/metro-config` is a (dev) dependency of the App.

However `import('metro-config).MetroConfig` would resolve to `node_modules/metro-config` since it's not a direct dependency.

This is how we have a mismatch - imported functions come from different packages than imported type.

## Changelog:

[GENERAL] [ADDED] - Expose `MetroConfig` type directly from `react-native/metro-config`.

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

Test Plan:
`yarn build` to generate dist for `react-native/metro-config`, see it has the export of `MetroConfig`.

## Notes

If this PR gets approved, I'll submit relevant one to the CLI template.

Reviewed By: huntie

Differential Revision: D63258881

Pulled By: robhogan

fbshipit-source-id: e6f3c880eb4a0aa902c62932d58f243c38b07c2e
2024-10-07 15:18:33 +01:00
Blake Friedman 9628882922 Update Podfile.lock
Changelog: [Internal]
2024-10-01 13:29:05 +01:00
React Native Bot dbd9952e0a Release 0.76.0-rc.3
#publish-packages-to-npm&next
v0.76.0-rc.3
2024-10-01 10:20:51 +00:00
Blake Friedman 4e10c8b602 [LOCAL] Fix conflict on package.json 2024-09-30 15:06:40 +01:00
Nicola CortiandGitHub 52322fbd0e [0.76] Fix ReactFragment on New Architecture (#46675) 2024-09-30 14:44:22 +01:00
Alex HuntandGitHub 2f04dfe795 [0.76] Use Metro terminal reporter for dev-middleware logs (#46646) 2024-09-30 14:43:19 +01:00
5a0df6d0bf [0.76] Simplify key handling in start command (#46645)
Co-authored-by: Blake Friedman <blakef@meta.com>
2024-09-30 14:43:01 +01:00
Alex HuntandGitHub 6a24df7eaa [0.76] Add CLI selection of multiple debug targets (#46644) 2024-09-30 14:41:01 +01:00
Alex HuntandGitHub 2a344a9580 [0.76] Update Metro to 0.81.0-alpha.2 (#46643) 2024-09-30 14:40:42 +01:00
Alex HuntandBlake Friedman d56fb57502 Switch to hermes-parser in eslint-config
Summary:
Similar to D63541483, modernises our Flow syntax support for our published ESLint config to use `hermes-eslint` (`hermes-parser`).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63541856

fbshipit-source-id: 06cc5725faf5934fda07713ec1dac54ff9c32ddf
2024-09-30 14:36:59 +01:00