Commit Graph

38536 Commits

Author SHA1 Message Date
Samuel Susla 0fe234cb60 execute task directly instead of going through runEventLoopTick (#46540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46540

changelog: [internal]

avoid calling `runEventLoopTick` and execute task directly. runEventLoopTick is not designed to be called on re-entries.

Reviewed By: rubennorte

Differential Revision: D62871782

fbshipit-source-id: 259514d05eebed2e09d54233729994e56f2aa1a4
2024-09-18 18:02:06 -07:00
Joe Vilches 7e38cf32eb Fix crash that happens with shadow color with 0 alpha (#46551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46551

We crash if we pass a shadow color with 0 alpha due to some divide by 0 logic. This fixes that for inset and outset shadows and adds a test for that case.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62899047

fbshipit-source-id: 2aff1d016dd97bed024df1c3f89bcc62e49f0306
2024-09-18 16:44:45 -07:00
David Vacca 40638b8c26 Fix logging of internals of React Native renderer (#46562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46562

This diff if fixing the logging of internal statistics of React Native Android renderer

changelog: [internal] intenral

Reviewed By: javache

Differential Revision: D59985973

fbshipit-source-id: 5f5020a516d236ef41b0bff087b00e7d7c721bb8
2024-09-18 13:55:44 -07:00
Rubén Norte fea0aa7f83 Create feature flag to make estimation for remaining time in frame for view preallocation more precise (#46563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46563

Changelog: [internal]

Our current implementation of view preallocation on Android runs very early in the frame (during the `animation` stage, after `input` and before `traversal`). In that implementation, we check the remaining time in the frame and we allocate half of that time for view preallocation.

This logic can make us drop frames unnecessarily, if the work that we need to do after this allocated time is longer than we expect. Because we don't know how long the `traversal` stage will be, we don't account for that time at all (or, at best, we do only use half of the remaining time).

This creates a feature flag to move view preallocation outside of the choreographer, so we can compute the remaining time considering all the work we did in the frame, and not just the work we did in the input stage.

Reviewed By: javache

Differential Revision: D62962341

fbshipit-source-id: 69aaeecc8596906e61b47af9adad23c1075a091a
2024-09-18 13:25:49 -07:00
Pieter De Baets 7f55dc0f45 Remove unused UIManager lookup in NativeAnimatedNodesManager (#46565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46565

UIManager is initialized elsewhere in NativeAnimatedNodesManager so this is no longer required

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D62958646

fbshipit-source-id: af77ddbbc65124ed29d301340ad339d2a916f58c
2024-09-18 11:05:25 -07:00
Rubén Norte 68e55284c5 Ship correct fix for state updates after smooth scroll animation (#46564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46564

Changelog: [internal]

I incorrectly set up an experiment to fix reported scroll position during smooth scroll animations on Android in D59233069. It was incorrect because I fixed the issue in "control", and I re-enabled the bug in "test".

That means we actually shipped the fix the moment we set up the experiment.

We can just apply the fix ungated.

Reviewed By: Abbondanzo

Differential Revision: D62965254

fbshipit-source-id: edf855619ff9ede6fd406f7f19b3c504ce89f1d6
2024-09-18 10:09:11 -07:00
Thomas Nardone 74aaf7baa1 Nullsafe react/views/view (#46490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46490

Fix nulls to prepare this module for further Kotlin conversion

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D62641672

fbshipit-source-id: a426ae30bc0529cfd5057cae68f74f3a52cc514f
2024-09-18 09:47:13 -07:00
Rubén Norte a5dd56f7d0 Create flag to disable reentrancy in MountItemDispatcher (#46561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46561

Changelog: [internal]

We have some logic in `MountItemDispatcher.tryDispatchMountItems` to recursively call itself for as long as there are new items to mount in the general queue. This queue is copied and processed every time `tryDispatchMountItems` is called, but it's possible that during this time new mount operations are added (either from JS or from the mount operations themselves).

This logic can cause frame drops, as we could be finish processing the current frame without processing new mount items (we could do that in the next frame, and in many cases it's just pre-rendering work and state updates that the user can't perceive anyway).

This creates a feature flag to test disabling this behavior and only process whatever mount items are queued at the start of the frame.

Reviewed By: sammy-SC

Differential Revision: D62958009

fbshipit-source-id: ca038c827715411375410215deb5d5e374f5fdb4
2024-09-18 09:10:00 -07:00
Dawid 42bad68220 fix app crashing when reloads overlap (#46416)
Summary:
Regarding the [issue](https://github.com/facebook/react-native/issues/44755) where the app sometimes crashes due to race condition when two reloads overlap in unfortunate way. This PR fixes it in some way by introducing throttling on reload command. For now I set it to 700ms as I was still able to reproduce it on 500-550ms for provided repro in the issue. The problem may still happen for bigger apps where reload may take more time to finish.

## 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] - throttle reload command

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

Test Plan: I've tested on provided repro and a smaller app trying to brake it.

Reviewed By: huntie

Differential Revision: D62847076

Pulled By: cipolleschi

fbshipit-source-id: 6471f792d6b692e87e3e98a699443a88c6ef43cd
2024-09-18 07:32:59 -07:00
Riccardo Cipolleschi 7de3111f9b Add Maestro test for New Arch Example (#46541)
Summary:
This change adds automated tests for the New Architecture Examples page in RNTester.
It also updates the NativeComponentExample to make sure that iOS and Android behaves in the same way and in a reliable way.

## Changelog:
[Internal] - Adds

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

Test Plan:
* Android:

https://github.com/user-attachments/assets/65ead328-9c4f-4e0f-8b9b-992ffb584566

* iOS:

https://github.com/user-attachments/assets/412a4f68-c9c9-4ff2-a3e9-ae7194deef77

Reviewed By: cortinico

Differential Revision: D62879289

Pulled By: cipolleschi

fbshipit-source-id: 59e15f48f5995b18fd8b3ee24aca726b93e04d9f
2024-09-18 06:15:58 -07:00
Dmitry Rykun 4b035d820d Ship shouldSkipStateUpdatesForLoopingAnimations (#46556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46556

Changelog: [General][Breaking] - Native looping animation will not send React state update every time it finishes.

Facebook
The QE shows neutral results, and has been shipped https://www.internalfb.com/intern/qe2/rn_surface_loading_performance/skip_state_updates_for_looping_animations/wrapup/config

Reviewed By: javache

Differential Revision: D62877191

fbshipit-source-id: 5b04105b3a33535c0da3bc7835098a9c4571d482
2024-09-18 05:28:07 -07:00
Oskar Kwaśniewski 2f5adc3874 fix(iOS): subscribe to orientation changes only on iOS (#46531)
Summary:
This PR adds iOS ifdefs to `RCTUIManager` to subscribe to orientation changes on this platform.

The `UIDeviceOrientationDidChangeNotification` symbol is only available there.

## Changelog:

[IOS] [FIXED] - subscribe to orientation changes in RCTUIManager only on iOS

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

Test Plan: CI Green

Reviewed By: philIip

Differential Revision: D62864013

Pulled By: cipolleschi

fbshipit-source-id: 341df9ac765735273378d017b63fcb7a4d8e98e5
2024-09-18 03:28:26 -07:00
Riccardo Cipolleschi 6d61899fc5 Fix analyze_code to use the proper PR number (#46548)
Summary:
Analyze code was still using the CIRCLECI env variable to retrieve the PR number.
This change uses the github one and also removes a duplicated flow check

## Changelog:
[Internal] - Remove duplicated flow check and use gh PR number rather than CircleCI one

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

Test Plan: Tested locally and in CI

Reviewed By: NickGerleman

Differential Revision: D62883758

Pulled By: cipolleschi

fbshipit-source-id: 0c7e97ea9caf4465972424e0b69a899ecfd07095
2024-09-18 02:57:48 -07:00
Riccardo Cipolleschi 405d982854 Add patch script to enable E2E tests in CI (#46546)
Summary:
This chang introduces a patch file that can be applied to run the E2E tests in CI.

From the root folder `react-native`, a user can just run:

```sh
git apply packages/rn-tester/scripts/enable-e2e-tests.patch
```

And then add a commit to their PR to see whether the newly added E2E tests are actually running

## Changelog:
[Internal] - add patch to simplify running E2E tests in CI

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

Test Plan: Tested locally

Reviewed By: NickGerleman

Differential Revision: D62880559

Pulled By: cipolleschi

fbshipit-source-id: 19d639b2641aaa50e4f3e0753018d426d2da81c9
2024-09-18 02:18:26 -07:00
Benoit Girard a5dd1be889 Fix setImmediate/clearTimeout mismatch in NativeAnimatedHelper (#46525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46525

While debugging I noticed that my setTimout was being cleared by someone else. Upon further inspection I found NativeAnimatedHelper which was mismatching setImmediate timer handle with a clearTimeout. This isn't safe and needs to be fixed.

I used this to rename the timer to be more clear to reduce the changes of mismatches.

Changelog:
[General][Fixed] - Fix setImmediate/clearTimeout mismatch in NativeAnimatedHelper that could clear an unrelated setTimeout.

Reviewed By: javache, yungsters

Differential Revision: D62775703

fbshipit-source-id: c1669c60bd08f13a59dd6159be2f471a6c1beebd
2024-09-17 20:33:43 -07:00
Rodolfo Gomez Sirimarco bebd6531b5 Fix ActionSheetIOS crash attempt to insert nil object from objects (#46550)
Summary:
There is a crash on iOS when trying to show an action sheet, but `RCTPresentedViewController` returns null. The code attempts to print an error but fails when casting values.

The issue is that some values, like _title_ or _message_ could be `nil`, which causes a failure when casting them to use in `RCTLogError`.

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

## Stacktrace:

```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
  0   CoreFoundation                      0x00000001804ae0f8 __exceptionPreprocess + 172
  1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56
  2   CoreFoundation                      0x000000018051c84c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 660
  3   CoreFoundation                      0x00000001804ac9cc +[NSDictionary dictionaryWithObjects:forKeys:count:] + 48
  4   AwesomeProject.debug.dylib          0x0000000106ed9138 __61-[RCTActionSheetManager showActionSheetWithOptions:callback:]_block_invoke_4 + 340
  5   libdispatch.dylib                   0x0000000103f3bec4 _dispatch_call_block_and_release + 24
  6   libdispatch.dylib                   0x0000000103f3d73c _dispatch_client_callout + 16
  7   libdispatch.dylib                   0x0000000103f4d3f8 _dispatch_main_queue_drain + 1228
  8   libdispatch.dylib                   0x0000000103f4cf1c _dispatch_main_queue_callback_4CF + 40
  9   CoreFoundation                      0x000000018040e960 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
  10  CoreFoundation                      0x0000000180409078 __CFRunLoopRun + 1936
  11  CoreFoundation                      0x00000001804084d4 CFRunLoopRunSpecific + 572
  12  GraphicsServices                    0x000000018ef2aae4 GSEventRunModal + 160
  13  UIKitCore                           0x00000001853d0a28 -[UIApplication _run] + 868
  14  UIKitCore                           0x00000001853d46b0 UIApplicationMain + 124
  15  AwesomeProject.debug.dylib          0x0000000106d47bec __debug_main_executable_dylib_entry_point + 96
  16  dyld                                0x0000000102fbd544 start_sim + 20
  17  ???                                 0x00000001030620e0 0x0 + 4345700576
  18  ???                                 0x4e6d800000000000 0x0 + 5651313844908195840
```

## Changelog:

[IOS] [FIXED] - Fix ActionSheetIOS crash `attempt to insert nil object from objects`

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

Test Plan:
I created an example project.

Example: https://github.com/RodolfoGS/react-native-fix-ios-actionsheet

### How to reproduce using the example above:
1. `git clone git@github.com:RodolfoGS/react-native-fix-ios-actionsheet.git`
2. `cd react-native-fix-ios-actionsheet`
3. `npm install`
4. `npm run ios`
5. Tap on _Show Action Sheet_ button on the app
6. Notice the crash

### Steps to create the example from scratch and reproduce the crash:
1. `npx react-native-community/cli@latest init AwesomeProject`
2. `cd AwesomeProject`
3. Install `patch-package` and add this patch to simulate a situation where `RCTPresentedViewController` returns null (https://github.com/RodolfoGS/react-native-fix-ios-actionsheet/blob/main/patches/react-native%2B0.75.3.patch)
4. `npm run ios`
5. Tap on _Show Action Sheet_ button on the app
6. Notice the crash

Reviewed By: caodoan

Differential Revision: D62897554

Pulled By: philIip

fbshipit-source-id: fb978c4648a6c4e36c609783e59367a5997e42cb
2024-09-17 17:22:54 -07:00
Nishan 6866968a79 fix(android): linear gradient with platform color (#46290)
Summary:
Fix platform color on android with linear gradient.

## Changelog:

[ANDROID] [FIXED] - Linear gradient with platform colors

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

Pick one each for the category and type tags:

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

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

Test Plan: Added example and testcases

Reviewed By: mdvacca

Differential Revision: D62277253

Pulled By: NickGerleman

fbshipit-source-id: 376ee5ebde61f3cb1ed32e82f71ad5479ebc50a5
2024-09-17 17:21:57 -07:00
Alex Taylor (alta) 582c33b13e Deploy 0.246.0 to xplat + www (#46519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46519

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D62763246

fbshipit-source-id: db0296d9ec5c04374c9cacb947b4879671044264
2024-09-17 15:07:17 -07:00
javache (Meta Employee) bca232ad90 Fix misleading crash when view config is not found (#30970) (#46518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46518

## Summary

When a view config can not be found, it currently errors with
`TypeError: Cannot read property 'bubblingEventTypes' of null`. Instead
invariant at the correct location and prevent further processing of the
null viewConfig to improve the error logged.

## How did you test this change?

Build and run RN playground app referencing an invalid native view
through `requireNativeComponent`.

Changelog: [General][Fixed] Improved error message when no view config is found.

DiffTrain build for commit https://github.com/facebook/react/commit/26855e4680dedb21f2c73a069ed691822a242db1.

Test Plan: Sandcastle tests

Reviewed By: jackpope

Differential Revision: D62760863

Pulled By: javache

fbshipit-source-id: c71dacc48fe8795b28840cfb3f53c1f9fc664a16
2024-09-17 14:13:38 -07:00
Eli White 6666df9fb8 Add a union of all the types (#46528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46528

This is needed for a script that needs to switch over all possible type annotations in the codegen schema.

Reviewed By: GijsWeterings

Differential Revision: D62805189

fbshipit-source-id: 8fd113f4ad0b695b38e92b8d0fc45a991f597fb8
2024-09-17 13:20:04 -07:00
Samuel Susla 785123b9de fix isEventLoopScheduled_ getting stuck in true (#46538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46538

changelog: [internal]

When we run synchronous task, it was able to get into a state where RuntimeScheduler stopped executing tasks in the queue and it wouldn't get unstuck. This appeared as non-responsive app.

The problem was that `isEventLoopScheduled_` was not being restarted in case `syncTaskRequests_` was bigger than 0. There is a unit test covering this scenario.

Reviewed By: rubennorte

Differential Revision: D62756582

fbshipit-source-id: 878b8445baea05e8b9eddae05ca0d11d5e93acb6
2024-09-17 13:15:54 -07:00
Rexogamer de2f9c0f77 fix: clean up various ESLint issues (#46379)
Summary:
this PR fixes a few small ESLint issues that were showing up under PR diffs.

## Changelog:

[INTERNAL] [FIXED] - Fix various ESLint issues

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

Test Plan: ran JS tests + linter; all passing

Reviewed By: cipolleschi

Differential Revision: D62385788

Pulled By: NickGerleman

fbshipit-source-id: b33d7ade4696bbaed2ac1a3fc2e0b3dff9bb04b7
2024-09-17 13:07:20 -07:00
Alex Hunt 188f99b17a Clarify behaviour of noop init command in 0.76 (#46547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46547

While testing the 0.76 RCs, it was initially unclear to me that `npx react-native init` was both deprecated and **removed** (performs a noop). Update message for clarity.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D62881266

fbshipit-source-id: b9017e63360c7aee5483d437ce1510be9a14ef42
2024-09-17 10:40:35 -07:00
Yedidya Feldblum e9d48ae3c7 migrate from untagged array-range dynamic ctor (#46477)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46477

Reviewed By: NickGerleman

Differential Revision: D62582942

fbshipit-source-id: 24631924c4d2eb8001b7593594d0a3ed5d16e233
2024-09-17 10:19:12 -07:00
Alex Hunt 8972d0998f Add missing babel-jest dependency to react-native package (#46539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46539

Resubmission of D62583665, addressing internal CI errors from dep relocation.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D62867287

fbshipit-source-id: d28d35e2c0a82d7d2bfdaa26c4f9fe8c3a5ef41a
2024-09-17 09:42:36 -07:00
Rubén Norte 89f824b081 Pass default values for feature flags to overrides providers (#46533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46533

Changelog: [internal]

When defining overrides for feature flags, it's common to have this pattern:

```javascript
myFeatureFlag: () => someCondition ? value : defaultValueForFlag
```

But it's not always obvious how to get the default value defined in the feature flag system. This modifies the API so we receive the default value as a parameter to simplify the logic:

```javascript
myFeatureFlag: (defaultValueForFlag) => someCondition ? value : defaultValueForFlag
```

Reviewed By: mdvacca, rshest

Differential Revision: D62853299

fbshipit-source-id: 9421e31d00662e2a23f1e3fb43bdc9f5cf03fdf3
2024-09-17 09:16:41 -07:00
Rubén Norte 958d35ffd4 Make RN feature flags Flow strict (#46530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46530

Changelog: [internal]

There's nothing preventing these modules from being `flow strict` instead of `flow strict-local`, so we can just make the change.

Reviewed By: mdvacca

Differential Revision: D62763719

fbshipit-source-id: 1821ef9ad2e8dc67b754eccc77e35ef34400ca0a
2024-09-17 09:16:41 -07:00
MasGaNo 1e59f2e3f8 fix(ios): allow pods mixte type settings on post-install (#46536)
Summary:
Following the discussion on https://github.com/facebook/react-native/issues/46505, this PR aims to allow mixte type configuration (String and/or Array of String) during the post installation of pods.

## 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] - allow pods mixte type settings on post-install

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

Test Plan: `packages/react-native/scripts/cocoapods/__tests__/utils-test.rb` test suits was updated to support array and works as expected

Reviewed By: shwanton

Differential Revision: D62870582

Pulled By: cipolleschi

fbshipit-source-id: c0ace6d9d20e6609ceae5aafd236d97fc9e86ddf
2024-09-17 09:11:26 -07:00
anirudh.bharti 7cdb87eb19 chore: replace mkdirp with mkdir fs (#46388)
Summary:
This pull request replaces the use of mkdirp with Node.js's built-in fs.mkdirSync({ recursive: true }) function, which is available in Node.js version 10.12.0 and above. This change reduces the number of external dependencies and simplifies the codebase by using the native capabilities of Node.js.

The motivation behind this change is to remove the unnecessary mkdirp dependency, as Node.js natively supports recursive directory creation since version 10.12.0. This streamlines the code and reduces the reliance on external libraries.

## Changelog:

[INTERNAL] [REMOVED] - Replaced mkdirp with fs.mkdirSync({ recursive: true }) in build scripts and codegen. Requires Node.js 10.12.0 and above.

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

Test Plan: I ran the build and codegen scripts locally with Node.js version 10.12.0 and above after replacing mkdirp, ensuring the scripts work as expected. No issues were encountered, and all processes, including directory creation and file handling, function correctly.

Reviewed By: cortinico

Differential Revision: D62852488

Pulled By: huntie

fbshipit-source-id: 76f44102a80b499521c156308d276a17d279ce38
2024-09-17 07:03:44 -07:00
Oskar Kwaśniewski 3c17beafe3 fix(iOS): move boost compiler flags and folly dep name to centralized config (#46513)
Summary:
This PR does some further cleanup on the flags passed to cocoapods.

I've moved `boost_compiler_flags` and `folly_dep_name` to `helpers.rb` file.

## Changelog:

[INTERNAL] [FIXED] -  move boost compiler flags and folly dep name to centralized config

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D62846105

Pulled By: cipolleschi

fbshipit-source-id: dff07ddb49f1f4b559125f2ed8508b32f08d4975
2024-09-17 04:57:36 -07:00
Oskar Kwaśniewski e82743cf66 fix(internal): formatting of tsconfig.json (#46529)
Summary:
This PR is a small fix for the indentation of `tsconfig.json`

## Changelog:

[INTERNAL] [FIXED] -  fix for the indentation of `tsconfig.json`

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D62845892

Pulled By: cipolleschi

fbshipit-source-id: 52a0309027350cd9bba8c2c158887b23ea093876
2024-09-17 04:22:28 -07:00
legobt eacab6d420 chore(react-native): accept failing glog configure in setup script (#46358)
Summary:
Due to `set -e` shell option, missing `xcrun` may cause the setup script to fail on Linux.

Also makes the script continue even if the glog `./configure` call does not succeed.

### Related
- Follow-up to https://github.com/facebook/react-native/pull/44417

## Changelog:

- [Internal] [Fixed] - react-native: make missing xcrun not throw in `ios-configure-glog.sh`
- [Internal] [Fixed] - react-native: accept failing glog ./configure in `ios-configure-glog.sh`

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

Reviewed By: cortinico

Differential Revision: D62851737

Pulled By: cipolleschi

fbshipit-source-id: 3ed76a81b6f428a1697c364698a0dfdd3bbb74f2
2024-09-17 03:41:29 -07:00
Vin Xi cf42288181 fix(react-native-xcode): Add back BUNDLE_COMMAND (#46495)
Summary:
In this PR https://github.com/facebook/react-native/issues/45560  the BUNDLE_COMMAND initialization was removed while it is still being used. Without it, building from Xcode throws unknown options error for Physical iOS devices.

I have just brought back the initialization from the PR before that, so the bundle phase is successful.

## Changelog:
[IOS][Fixed] - Add back the BUNDLE_COMMAND

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

Test Plan: I have bundled release builds in Xcode. Everything seems to be fine.

Reviewed By: cortinico

Differential Revision: D62846877

Pulled By: cipolleschi

fbshipit-source-id: 3f07e8c0bc5acf98177582f1fee9a55ae77b31a1
2024-09-17 02:34:06 -07:00
Riccardo Cipolleschi 53980d918e Add changelog for 0.76.0-rc.1 (#46521)
Summary:
Add changelog for 0.76.0-rc.1

## Changelog:
[Internal] - add changelog

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D62765002

Pulled By: cipolleschi

fbshipit-source-id: 22e0b60c61276bae919445d811db8e26b2eeb877
2024-09-17 02:15:47 -07:00
Shawn Dempsey 9a6354fbbf Annotate DefaultTurboModuleManagerDelegate to avoid redex stripping dep in prod (#46527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46527

Changelog: [Internal]

**Context**
- `DefaultTurboModuleManagerDelegate.kt` was being stripped by redex since there was no direct dependency.
- This was causing a crash in prod builds
```
Trace: java.lang.RuntimeException: Unable to create application com.facebook.mobilehome.MobileHomeAppShell: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.defaults.DefaultTurboModuleManagerDelegate" on path: DexPathList
```

**Change**
- Annotate `DefaultTurboModuleManagerDelegate.kt` with `DoNotStripAny`
- Don't strip `DoNotStripAny` annotated classes

Reviewed By: mdvacca

Differential Revision: D62766339

fbshipit-source-id: 7d9bfa04e252c392b94f739443bacf34f593e481
2024-09-16 20:03:07 -07:00
Nick Gerleman 51673e41ae Breaking: Remove ReactViewBackgroundManager and ReactViewBackgroundDrawable (#46166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46166

## This Diff

This removes some of the legacy utilties used for background manipulation, no longer used anywhere (and very rarely used externally from some previous tests). These conflict with BackgroundStyleApplicator, which should be used instead.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog:
[Android][Breaking] - Remove ReactViewBackgroundManager and ReactViewBackgroundDrawable

Reviewed By: sammy-SC

Differential Revision: D61658084

fbshipit-source-id: 611f6d78fa4859574c063e9f0395c3dadc1588cc
2024-09-16 19:14:53 -07:00
Nick Gerleman 0fa7e01c5f Remove ReactScrollView Legacy Background Path (#46168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46168

## This Diff

This removes the legacy path from ReactScrollView and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D61658081

fbshipit-source-id: d6db43e25faf8e1ebd42d2816c7a915b3ed9404e
2024-09-16 19:14:53 -07:00
Nick Gerleman e58d300514 Remove ReactHorizontalScrollView Legacy Background Path (#46161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46161

## This Diff

This removes the legacy path from ReactHorizontalScrollView and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D61658082

fbshipit-source-id: 98cab5dfcad8beee6d131fcfe122313730a6f665
2024-09-16 19:14:53 -07:00
Nick Gerleman 426b3004ac Remove ReactEditText Legacy Background Path (#46162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46162

## This Diff

This removes the legacy path from ReactEditText and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61658080

fbshipit-source-id: 6ac7c5ed230e44fe307640a730e076b903e0674a
2024-09-16 19:14:53 -07:00
Nick Gerleman b4d28293a6 Remove ReactTextView Legacy Background Path (#46171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46171

## This Diff

This removes the legacy path from ReactTextView and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61658083

fbshipit-source-id: b753d4eb45091aa31ea870a684c35b71c1ee5036
2024-09-16 19:14:53 -07:00
Nick Gerleman 6291ff0281 Remove ReactViewGroup Legacy Background Path (#46159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46159

## This Diff

This removes the legacy path from ReactViewGroup and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D61657251

fbshipit-source-id: 6d00a1cac79450d306cf28446e6397d31ceffb19
2024-09-16 19:14:53 -07:00
Nick Gerleman 890970a61f Remove ReactImageView Legacy Background Path (#46167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46167

## This Diff

This removes the legacy path from ReactImageView and its view manager.

## This Stack

This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components.

There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61657253

fbshipit-source-id: 96cf1160e466de78c2f133f0e4fb2d9b2e7cf478
2024-09-16 19:14:53 -07:00
Eric Rozell a64183b0c6 Call __makeNative on children before __getNativeTag (#46524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46524

There's an interesting behavior in Animated where we effectively perform an O(N + M) traversal of the Animated graph, calling `__makeNative` on each "input", which in turn tends to call `__makeNative` on each "output" (so we revisit the current node M times when calling `__makeNative` on the M inputs). In practice, the behavior is still O(N), because M is small and finite (most Animated nodes have 1 or 2 inputs).

All that said, some platforms (e.g., react-native-windows) rely on this revisiting behavior, where on the first visit, we recurse the node to its inputs, and on the subsequent visit, we update the `_platformConfig` value without recursion (see https://github.com/facebook/react-native/pull/32736 for the original change adding platformConfig).

A recent change to AnimatedWithChildren (https://github.com/facebook/react-native/pull/46286) eagerly invokes `__getNativeTag` on AnimatedWithChildren in the initial recursion step, which forces materialization of the NativeAnimated node *before* it's `_platformConfig` is set.

There is certainly some refactoring that needs to be done to improve all this, but for now, this change reverts to delay the call to `__getNativeTag` until after at least one `__makeNative` occurs on an input.

## Changelog

[General][Fixed]: Order of operations related to platformConfig propagation in NativeAnimated

Reviewed By: yungsters

Differential Revision: D62768179

fbshipit-source-id: ca9d911503e0630bc3a1309b21f9686aa77ac8b9
2024-09-16 16:24:31 -07:00
Alan Lee 7aeff18970 rename overlayColor to backdropColor in Modal (#46523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46523

the name change [commit](https://github.com/facebook/react-native/pull/46322/commits/64ee5712f7aa9a3df84589146d00f81bac6d945c) was not properly imported from last diff for https://github.com/facebook/react-native/pull/46322/

redoing the name change: overlayColor -> backdropColor

Changelog:
[general][Fixed] - rename overlayColor prop in Modal to backdropColor

Reviewed By: christophpurrer

Differential Revision: D62760028

fbshipit-source-id: 92d6e8f002c92f4e13136542dce946434516988e
2024-09-16 16:11:55 -07:00
Vincenzo Vitale 40c875deca Support ARG_DISABLE_HOST_LIFECYCLE_EVENTS to conditionally set mDisableHostLifecycleEvents (#46509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46509

With ARG_DISABLE_HOST_LIFECYCLE_EVENTS it's possible to  conditionally set mDisableHostLifecycleEvents when the ReactFragment gets created.

## Changelog:

[Android][Fixed] ARG_DISABLE_HOST_LIFECYCLE_EVENTS in ReactFragment to allow unmounting a surface without destroying ReactHost.

Reviewed By: rozele

Differential Revision: D62714185

fbshipit-source-id: b6518ff67a9644421b8fe9c7cdc2aa6d62a23651
2024-09-16 12:18:26 -07:00
Oskar Kwaśniewski 40c5e6b64a fix: declare supportedInterfaceOrientations only on iOS (#46512)
Summary:
This PR adds an ifdef to declare `supportedInterfaceOrientations` only on iOS as this property does not affect other platforms causing a build issue.

## Changelog:

[IOS] [ADDED] - declare supportedInterfaceOrientations only on iOS

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D62754746

Pulled By: javache

fbshipit-source-id: e2ca5d96cba87e611c48a87f10bf7831e9051646
2024-09-16 12:10:23 -07:00
Rubén Norte e8dd036c8d Clean up "fixMissedFabricStateUpdatesOnAndroid" feature flag (#46508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46508

Changelog: [internal]

This cleans up the "fixMissedFabricStateUpdatesOnAndroid" feature flag and enables the fix permanently.

This fixes some state updates in the Fabric shadow tree being missed in some edge cases.

See https://github.com/facebook/react-native/pull/45236 for context.

Reviewed By: rshest

Differential Revision: D62743019

fbshipit-source-id: c24ab8a49a97ca26e60efa2fa4bc6a21ccac52d4
2024-09-16 12:07:35 -07:00
Rubén Norte 16337f1885 Remove redundant systrace block from ShadowTree (#46515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46515

Changelog: [internal]

This reduces the depth of the Systrace/Perfetto blocks by 1 removing this unnecessary nesting. If for some reason `ShadowTree::tryCommit` runs more than once, it will still show up.

Reviewed By: bgirard, sammy-SC

Differential Revision: D62499855

fbshipit-source-id: 48cce7532a308221c22d04de874870be509fe315
2024-09-16 11:25:07 -07:00
Rubén Norte f8a003b9b2 Rename DOMRectLike as DOMRectInit to align with spec (#46516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46516

Changelog: [internal]

Minor naming change

Reviewed By: NickGerleman

Differential Revision: D62755993

fbshipit-source-id: ad79002970500d31643fc555c9582e712d264175
2024-09-16 11:18:55 -07:00
Stephanie Nicholson 259f61ac6b Revert D62583665: Add missing babel-jest dependency to react-native package
Differential Revision:
D62583665

Original commit changeset: 8bbcc8736e27

Original Phabricator Diff: D62583665

fbshipit-source-id: e2d56d549fe6720000d81153215dfb2960be1d42
2024-09-16 10:21:29 -07:00