Commit Graph
31848 Commits
Author SHA1 Message Date
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