Compare commits

..
Author SHA1 Message Date
Nicola Corti a429f4169c Fix tests - take 4 2024-11-05 14:15:39 +00:00
Nicola Corti 05f073d346 Fix tests - take 3 2024-11-05 14:11:50 +00:00
Nicola Corti a0ca57538f Fix tests - take 2 2024-11-05 13:49:14 +00:00
Nicola Corti 292f3a4cab Fix jest tests 2024-11-05 11:49:39 +00:00
Riccardo Cipolleschi 68231cb949 [LOCAL] Revert React 19 to React 18.3.1 2024-11-05 11:49:39 +00:00
Nicola Corti 1f62529dc4 Properly handle paths with spaces in autolinking (#47388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47388

Fixes https://github.com/facebook/react-native/issues/47364
Fixes https://github.com/facebook/react-native/issues/47377
Fixes https://github.com/facebook/react-native/issues/37124

We're having problems is a path contains a space ' ' because when autolinking,
the `add_subdirectory()` function of CMake consider the path with space as 2 parameters.

This fixes it by properly quoting the path.

Changelog:
[Android] [Fixed] - Properly handle paths with spaces in autolinking

Reviewed By: cipolleschi

Differential Revision: D65434413

fbshipit-source-id: b9147482f98f7e222405cc8d9e6f3c17a5f4ed02
2024-11-05 03:32:16 -08:00
Nicola Corti 3956955eaa Use absolute path when compiling appmodules.so sources (#47379)
Summary:
Fixes https://github.com/facebook/react-native/issues/47352

This fixes a bug when the user is providing its own CMakeLists.txt file say because they want to compile more C++ code than we actually provide.

Previously the `*.cpp` will evalute file in the current directory, meaning that the app's default `OnLoad.cpp` file would be ignored.

## Changelog:

[ANDROID] [FIXED] - Use absolute path when compiling appmodules.so sources

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

Test Plan:
Tested against the reproducer provided in:
- Use absolute path when compiling appmodules.so sources

Reviewed By: cipolleschi

Differential Revision: D65428676

Pulled By: cortinico

fbshipit-source-id: 7f3e4d470da0fffc5191c1a2c7e8fec517fee496
2024-11-05 03:27:59 -08:00
Nicola Corti 83d38501b8 setup-gradle v4 + Remove unnecessary Gradle Wrapper Validation (#47389)
Summary:
As per: https://github.com/gradle/actions#the-wrapper-validation-action

> Starting with v4 the setup-gradle action will [perform wrapper validation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation) on each execution. If you are using setup-gradle in your workflows, it is unlikely that you will need to use the wrapper-validation action.

I'm moving to setup-gradle v4 and remove this unnecessary extra action.

## Changelog:

[INTERNAL] - setup-gradle v4 + Remove unnecessary Gradle Wrapper Validation

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D65435069

Pulled By: cortinico

fbshipit-source-id: c28b4d520e91fea9c59a341fb94598db5fc69900
2024-11-05 03:19:06 -08:00
Riccardo Cipolleschi d7d5535fe1 Suppres CC_MD5 warning (#47378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47378

The RCTMD5Hash in RCTUtils is using CC_MD5 function which is deprecated. unfortunately we can't really change it or we will break many apps that use it in the AsyncStorage.

Those app wlll have to do a migration to use a different function. Meanwhile we are suppressing the warning

## Changelog
[Internal] - Suppress CC_MD5 warning

Reviewed By: cortinico

Differential Revision: D65424309

fbshipit-source-id: e0258ae68482f6c4a3a865bb52920f87bc5ada21
2024-11-05 02:48:49 -08:00
Ramanpreet Nara 0e7ba9094e Make redboxes resilient to react native preloading (#47391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47391

React Native can preload before the activity is available.

Preloading will execute the js bundle. If the js bundle throws an error, it'll try to render a redbox.

If the activity isn't available, and hasn't been set on the react instance yet, the redbox will just render nothing.

## Changes
In this diff, just re-try displaying the redbox after the application sets the activity on the react instance (i.e: calls onHostResume(activity)).

Changelog: [Android][Breaking] - Rename DevSupportManagerBase.getCurrentContext() -> getCurrentReactContext()

Reviewed By: mdvacca

Differential Revision: D65352596

fbshipit-source-id: 7750f6ca493fc50405119958e0f2908fc24f1cb4
2024-11-04 18:46:35 -08:00
Ramanpreet Nara 5a6a42c7d0 DevSupportManagerBase: Rename getCurrentContext() -> getCurrentReactContext() (#47390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47390

getCurrentContext() is very ambiguous.

Changelog: [Android][Breaking] - Make DevSupportManagerBase.getCurrentReactContext() public

Reviewed By: mdvacca

Differential Revision: D65433217

fbshipit-source-id: a739d206de8085fc5b47b2a31c7e94fe6e71852f
2024-11-04 18:46:35 -08:00
David Vacca fe656be26e Reduce visibility of ReactUnimplementedViewManager to internal (#47396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47396

Migrate ReactUnimplementedViewManager to internal visibility

verified and there are usages on OSS

changelog: [Android][Breaking] Reduce visibility of ReactUnimplementedViewManager to internal

Reviewed By: cortinico

Differential Revision: D65444514

fbshipit-source-id: 11ff2acc96098bc4e53be7ef3059e4a5c112c43e
2024-11-04 17:46:14 -08:00
Joe Vilches c9a96715ef Update public API for intrinsic sizing setters (#46939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46939

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

tsia! opted for one function for each keyword just like auto. This is kinda annoying and not the most sustainable, so maybe it makes more sense to make a new enum here and just add one function

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64002837

fbshipit-source-id: f15fae9fc0103175e1d85850fc9aa68579989fd3
2024-11-04 16:02:37 -08:00
Joe Vilches 027b8032c2 Modify private apis to set, store, and get intrinsic sizing keywords (#46938)
Summary:
X-link: https://github.com/facebook/yoga/pull/1721

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

The private internals of how we store styles needed to change a bit to support 3 new keyword values. Right now the only other keyword that can be stored is `auto`. As a result there isn't much fancy logic to support storing this and its just stored as a specific type inside of `StyleValueHandle`. There are only 3 bits for types (8 values), so it is not sustainable to just stuff every keyword in there. So the change writes the keyword as a value with a new `keyword` `Type`.

I chose not to put `auto` in there even though it is a keyword since it is a hot path, I did not want to regress perf when I did not need to.

I also make a new `StyleSizeValue` class to store size values - so values for `width`, `height`, etc. This way these new keywords are kept specific to sizes and we will not be able to create, for example, a margin: `max-content`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63927512

fbshipit-source-id: 7285469d37ac4b05226183b56275c77f0c06996c
2024-11-04 16:02:37 -08:00
Eli White 35f0e1cca2 Fix CodegenSchema Enum type to not export array (#47324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47324

I need to reference this type somewhere else, but not an array of the type.

Generally we prefer that all exported types are the object itself, and it used as a member type of arrays when used.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D65259014

fbshipit-source-id: 35fb5fe03a44bed61ad87337d0fc5c198744c0e9
2024-11-04 12:58:49 -08:00
Eli White dd472101b7 Add NumberLiteralTypeAnnotation support (#47323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47323

This change adds support for number literals as a type.

The codegen already has parsing support for these types
```
  +passNumber: (arg: number) => void;
  +passString: (arg: string) => void;
  +passStringLiteral: (arg: 'A String Literal') => void;
```

This change now also supports
```
  +passNumberLiteral: (arg: 4) => void;
```

On the native side this is treated the same as `number`. It could be strengthened in the future.

This is a pre-requisite for number literal unions and enums.

Changelog: [Added] Codegen: Added support for Number literals in native module specs

Reviewed By: makovkastar

Differential Revision: D65249334

fbshipit-source-id: 98b051d2a6bd1ad5cc6473ac88acfcbe82bd5c7d
2024-11-04 12:58:49 -08:00
Nicola Corti 623d481991 Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal
Summary:
Those 2 classes are not supposed to be exposed externally, so I'm making them internal.
The were never part of the public API so I'm not marking this commit as [BREAKING]

Changelog:
[Android] [Changed] - Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal

Reviewed By: fabriziocucci

Differential Revision: D65420257

fbshipit-source-id: b870274e84d9c3202b9f21360c29eeb995a8d52b
2024-11-04 12:20:50 -08:00
Nicola Corti cba1d4bae7 Stable API - Make InteropModuleRegistry internal (#47374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47374

I've converted this class to Kotlin + made it `internal` as it should not be exposed publicly.
This class is part of the iterop layer for the New Architecture.
Marked as breaking but I expect no meaningful breakages here.

Changelog:
[Android] [Breaking] - Stable API - Make InteropModuleRegistry internal

Reviewed By: javache

Differential Revision: D65421965

fbshipit-source-id: 207be5379ebe3a31530cfea75b4623787f5ae7cf
2024-11-04 11:01:46 -08:00
zhongwuzw 44f2a08371 Add png extension only if file exist when load local image (#46971)
Summary:
FIxes https://github.com/facebook/react-native/issues/46870.

To avoid many breaking changes, I modified the logic to add the PNG extension only if the file exists.

## Changelog:

[IOS] [FIXED] - Add png extension only if file exist when load local image

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46870 .

Reviewed By: blakef

Differential Revision: D65276409

Pulled By: cipolleschi

fbshipit-source-id: 9e03a36b229f7c336632b5b76a92d9f749c59835
2024-11-04 10:26:55 -08:00
Nicola Corti d7550293a2 Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal (#47373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47373

Users should not depend on `ReactDevToolsSettingsManagerModule` directly hence I'm making it internal.
I expect to breakages in OSS as there no usages at all:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.reactdevtoolssettings.ReactDevToolsSettingsManagerModule
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.devtoolsruntimesettings.ReactDevToolsRuntimeSettingsModule

Changelog:
[Android] [Breaking] - Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal

Reviewed By: javache

Differential Revision: D65421030

fbshipit-source-id: e9d701af6cde25133f7b3ff9b07b678a7710852c
2024-11-04 10:26:47 -08:00
oddlyspaced cc1d2853fb feat(Android): add support for invert colors check on android accessibility (#47341)
Summary:
This PR provides a fix for the long existing issue of missing check for invert color in accessibility options on Android.
Reference Issue : https://github.com/facebook/react-native/issues/30870

## Changelog:
- Added native module code to check for invert color settings value
- Updated js module to return a proper promise instead of default false for isInvertColorsEnabled()

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Missing isInvertColorsEnabled implementation for Android

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

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

Test Plan: Tested on OnePlus 12 with Android 14 and Pixel 6 with Android 15. The try catch exists because in some cases if the switch hasn't been toggled before the android system raises the missing settings exception.

Reviewed By: cortinico, fabriziocucci

Differential Revision: D65419632

Pulled By: javache

fbshipit-source-id: ddb103445a9d0f318e52ba9d23750140ce5a7ed0
2024-11-04 10:06:10 -08:00
Mateo Guzmán dc9db01665 feat(image): [android] adding only-if-cached cache control option (#47348)
Summary:
Following up from https://github.com/facebook/react-native/issues/47182, as basic caching control is already in place in Android, it can be extended to include the `only-if-cached` option.

We check whether the image is in the cache. If it is, we proceed to load it. Otherwise, we do nothing.

## Changelog:

[ANDROID] [ADDED] - Image `only-if-cached` cache control option

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

Test Plan:
In the `rn-tester`, I added a third example for Android where the third image will never be loaded as the cache policy is set to `only-if-cached` and the image has not been loaded before.

<details>
<summary>Video demonstrating how the `only-if-cached` options behaves</summary>

https://github.com/user-attachments/assets/45669e81-5414-4103-8931-138bffa81447

</details>

<details>
<summary>Error from image not found in cache example</summary>

<img width="807" alt="image" src="https://github.com/user-attachments/assets/6b79d811-1809-437c-b2fe-c86d3da7c58d">

</details>

Reviewed By: rshest

Differential Revision: D65384639

Pulled By: Abbondanzo

fbshipit-source-id: f4a72694f45eb3d7097c350f4a4008a0abf0a1ab
2024-11-04 08:37:59 -08:00
Samuel Susla 91df5a4a0f surface setup issues in EventBeat and Scheduler (#47355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47355

changelog: [internal]

Reviewed By: rshest

Differential Revision: D65333695

fbshipit-source-id: 854dbc3ae52db0093961cbeb81f1f96934eca40d
2024-11-04 08:15:12 -08:00
Parsa Nasirimehr 4da586ead9 chore(Android): Migrate DebugOverlayTag and ReactDebugOverlayTag to Kotlin (#47362)
Summary:
I believe these two were the last items under `com.facebook.debug` that were still Java.

I thought about making DebugOverlayTag a Data class, but i will leave it up to the reviewer to decide if it would be needed or not.

## Changelog:

[INTERNAL] [FIXED] - Migrate DebugOverlayTag and ReactDebugOverlayTag to Kotlin

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

Test Plan:
`./gradlew test`:
<img width="1265" alt="Screenshot 2024-11-02 at 18 45 45" src="https://github.com/user-attachments/assets/405e77bc-1287-4329-b230-9f46eadb3580">

Reviewed By: javache

Differential Revision: D65417984

Pulled By: cortinico

fbshipit-source-id: e39224e40bde281498fdbed1609a03b264967396
2024-11-04 06:57:47 -08:00
Marc Rousavy de3c1ee097 feat: Trigger Java GC on reload (#43813)
Summary:
While we (Margelo) were developing a new C++ 3D library for react-native, we noticed that Java often keeps a lot of dead instances in memory, making it hard to debug memory allocations (or actually _de_-allocations), especially since we use `jsi::HostObject` and `jni::HybridClass` in conjunction. Having two garbage-collected languages retain an object is a bit tricky, and making sure that we aren't doing anything wrong with our allocations and references was not easy - but manually calling `System.gc()` on app reloads helped us see that much better.

Before this, we needed to wait multiple minutes until some Java objects are actually freed from the GC. Our use-case was a `facebook::jni::HybridClass`, which was held strong in a `facebook::jsi::HostObject` (so again, two GC'd languages).

There _should_ be no change in behaviour with this PR, just two things to note:

1. Memory might be free'd more eagerly in full reloads (dev builds) - makes sense for library developers, especially when working with C++ modules.
2. `System.gc()` only _suggests_ garbage collection, it does not _force_ it. But when it runs, it might impact performance, although we haven't noticed any impact of that at all. The garbage collector runs anyways - better during a reload than later when exceuting the app normally.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [ADDED] - Trigger Java GC on app reload

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

Test Plan:
Open an app, create a Java module that holds a few objects, add `finalize()` methods to those objects and log their deletion.

Reload the app to see the logs, compare before vs after.

Reviewed By: rshest

Differential Revision: D65418163

Pulled By: javache

fbshipit-source-id: 7597548790577dfc542b57f59578ae48df543b14
2024-11-04 06:53:07 -08:00
Nicola Corti e1a1cead43 AGP to 8.7.2 (#47369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47369

This just bumps the AGP patch version to the latest stable.

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

Reviewed By: tdn120

Differential Revision: D65336357

fbshipit-source-id: 9a7464304ba29f6b752f41b252bde9cb0eca0e9a
2024-11-04 05:57:22 -08:00
Peter Abbondanzo 7211119d23 Add cache control check to multisource (#47357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47357

`MultiSourceHelper` should not yield an `ImageSource` that has its cache control policy set to `RELOAD`. This change skips such sources when computing the bestCached item (but not best item)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D65337414

fbshipit-source-id: bdd0d55f4a65128b141a1c7a132dba085232fa11
2024-11-01 15:26:58 -07:00
Chi Tsai 6ab7b70241 Add utf16 method to JSI (#47356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47356

Add utf16 method to JSI. This change will add the default implementation
for all VMs by calling UTF8 and manually convert it to UTF16. A later
change will be added for Hermes to use internal VM information to get
the UTF16 string.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D64918244

fbshipit-source-id: 6fc0c44fc397c2f8bb40a4262596b178ee4f1f29
2024-11-01 13:52:46 -07:00
zhongwuzw af384a914a FIxes CornerRadiiAreEqualAndSymmetrical error when check topLeftHorizontal == topLeftVertical (#47338)
Summary:
FIxes CornerRadiiAreEqualAndSymmetrical error when check topLeftHorizontal == topLeftVertical cc. jorge-cab

## Changelog:

[IOS] [FIXED] - FIxes CornerRadiiAreEqualAndSymmetrical error when check topLeftHorizontal == topLeftVertical

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

Test Plan: N/A

Reviewed By: jorge-cab

Differential Revision: D65281958

Pulled By: cipolleschi

fbshipit-source-id: f79fced7282bf75201d9dc99c82eeaddade0d314
2024-11-01 08:12:29 -07:00
Mateo Guzmán 566d30f88a fix(rn-tester): playground description not visible in dark mode (#47346)
Summary:
The informational description in the `RNTesterPlayground` is not visible in dark mode. To address this, the `RNTesterText`, which takes into account the theme, is used.

## Changelog:

[INTERNAL] [FIXED] -  `RNTesterPlayground` description not visible in dark mode

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

Test Plan:
| Before  | After |
  | ---------- | ---------- |
  | ![Screenshot_1730414376](https://github.com/user-attachments/assets/a42e1a99-de61-41b5-b677-ea3e2b4956fc) | ![Screenshot_1730414393](https://github.com/user-attachments/assets/885ed334-8277-4ba8-a033-477b9afef7b6) |

Reviewed By: cortinico

Differential Revision: D65319138

Pulled By: Abbondanzo

fbshipit-source-id: ff541be9705fb799cc4aa3624a9e2966a76a0f8d
2024-11-01 07:36:05 -07:00
Alex Hunt 4afc47a588 Revert to @babel/eslint-parser in eslint-config (#47333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47333

Motivated by https://github.com/facebook/hermes/issues/1549. This was originally changed in https://github.com/facebook/react-native/pull/46696, as our internal Flow support had diverged from `babel/eslint-parser` (https://github.com/facebook/react-native/issues/46601).

We effectively have three flavours of JavaScript in support:
- Flow@latest for the `react-native` package, shipped as source — uses `hermes-parser`.
- TypeScript for product code (community template, Expo) — uses `babel/plugin-syntax-typescript`.
- Plain JavaScript or Flow in product code, *which may be extended with additional user Babel plugins and needs lenient parsing* — uses `babel/plugin-syntax-flow` via `babel/eslint-parser` (**this change**).

I'd love to simplify this 😅.

Switching to `hermes-eslint` for the RN monorepo codebase (D63541483) is unchanged.

Changelog: [Internal]

Reviewed By: robhogan, cipolleschi

Differential Revision: D65272156

fbshipit-source-id: 3a2bbe3fcf8ed6057f6d994a0be4985e6bf46fa9
2024-11-01 05:31:37 -07:00
Alan Lee 2cd48ef351 fix Modal content being cut off when Android Activity is edge-to-edge (#47339)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47339

Fixing issue raised in https://github.com/facebook/react-native/issues/47307

This is a follow up from D62286026.
It appears there was a line that went missing while trying to refactor the code.

`fitsSystemWindows = true` is needeod for < API 30 to avoid content rendering under the system bars when Modal is shown with Activity that is edge-to-edge.

Changelog:
[Android][Fixed] Fix Regression - Modal content rendering below system bar on < API 30 when activity is edge-to-edge

Reviewed By: cortinico

Differential Revision: D65280014

fbshipit-source-id: 616ff739be55635f1295ef3bf8b997a27ef769ae
2024-11-01 01:27:40 -07:00
Alan Lee 65cdd5b82c Enable 16KB page size binaries for RN libraries + hermes (#47042)
Summary:
X-link: https://github.com/facebook/hermes/pull/1557

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

Add native build flags to support 16KB page size

- https://developer.android.com/guide/practices/page-sizes#compile-r27-higher

Changelog:
[Android][Added] add cmake arguments to support 16KB page size for native libraries

Reviewed By: cortinico

Differential Revision: D64446876

fbshipit-source-id: 5c6b7874a8837c7ebc9b3e9267ce11fb152bf535
2024-10-31 18:45:31 -07:00
Samuel Susla 66a2f1d312 Back out "delete redundant EventEmitter::dispatchEvent overload" (#47347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47347

changelog: [internal]

Original commit changeset: cffdc3ef0424

Original Phabricator Diff: D65040505

Reviewed By: lunaleaps

Differential Revision: D65305763

fbshipit-source-id: 4c9e4b4acd9c5f9530af428402b106272a4e0054
2024-10-31 18:42:07 -07:00
Nolan O'Brien 79d55542aa Move FBHashKit to LayerZero/METAHash (#47343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47343

Moving `FBHashKit` to *LayerZero* as `METAHash`

## Changelog

[Internal][Change] Move `FBXXHashUtils`

Reviewed By: adamjernst

Differential Revision: D65256846

fbshipit-source-id: 6e24a78925367e83e94e7c67a235cda924edd28e
2024-10-31 18:01:57 -07:00
Nolan O'Brien f8fc90e754 Modernize in preparation for move to Layer Zero (#47342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47342

There are things we can do to modernize `FBHashKit` to make it ready for prime time, aka Layer Zero.

  * Consolidate down to a singular `meta_hash(...)` generic macro (supports all primitives for hashing)
  * Eliminate the unnecessary C++
  * Deprecate legacy FB APIs
  * Make logic (and interfaces) explicit for 32 vs 64 bit inputs and 32 vs 64 bit outputs
  * Introduce robust unit tests
  * Have unit tests actually testable for 32-bit hashes

## Changelog

[Internal][Change] Prep to move `FBXXHashUtils`

Reviewed By: cipolleschi

Differential Revision: D65245787

fbshipit-source-id: 311404068fd9df2a77d1ae4850b8a785466e73f0
2024-10-31 18:01:57 -07:00
Parsa Nasirimehr ec4ead59e1 fix(iOS): small test fix for RCTViewTests (#47314)
Summary:
Depracated usage of scrollInsets + an unused param.

## Changelog:

[INTERNAL] [FIXED] - Switch to verticalScrollIndicatorInsets and mark unused value as __unused in test file

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

Test Plan:
Running the specific test itself, it passes:
<img width="1092" alt="Screenshot 2024-10-30 at 18 02 08" src="https://github.com/user-attachments/assets/e3ed27c6-9f00-4777-a72c-92f0da93a79f">

Reviewed By: NickGerleman

Differential Revision: D65231365

Pulled By: philIip

fbshipit-source-id: eed795ad65bd837fb9f38175081d961245ff3932
2024-10-31 16:24:41 -07:00
Jakub Piasecki fd273f83e0 Add RNTester examples for display: contents (#47201)
Summary:
Adds a page dedicated to `display: contents` to RNTester APIs section. Those can be used to verify that it's working correctly visually.

Needs https://github.com/facebook/react-native/pull/47194

## Changelog:

[INTERNAL] [ADDED] - Added `display: contents` examples to RNTester

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

Test Plan:
Row styles are ignored in new arch and TextInputs as leaf are hidden

https://www.internalfb.com/compare-screenshots-from-diff/D65248256

Reviewed By: javache

Differential Revision: D65248256

Pulled By: NickGerleman

fbshipit-source-id: 90410e1380e4cdb22cb4cac5c8c21e08a088ce69
2024-10-31 16:12:46 -07:00
Nicola Corti ecd138e267 Enable warningAsErrors for hermes-engine (#47320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47320

I've solved all the warnings on ReactAndroid/hermes-engine.
This enables warningsAsErrors for that part of the codebase so we can make sure
no further warnings get introduced.

Changelog:
[Internal] [Changed] - Enable warningAsErrors for hermes-engine

Reviewed By: NickGerleman

Differential Revision: D65243753

fbshipit-source-id: 17c22d1a7a32d2c684d7f236f7554f6e26469e99
2024-10-31 15:05:12 -07:00
Sam Zhou b91a449e7f Cleanup problematic React.ElementRef (#47340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47340

This diff cleans up some problematic `React.ElementRef<T>` when T is generic type.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D65280467

fbshipit-source-id: 71172b16320a10cbc7a8b46dae5d3dd0eb00ba0c
2024-10-31 13:30:17 -07:00
Pieter De Baets 6ba7cb3102 Fix potential race in FabricMountingManager (#47337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47337

We call `onSurfaceStart` after calling `surfaceHandler.start()`. In theory it's possible for the React surface to start generating commits before we've informed the mounting manager of the surface having started, which could cause us to not accurately track views allocated for that surface so far.

Changelog: [Android][Fixed] Addressed race condition in surface start.

Reviewed By: rshest

Differential Revision: D65269674

fbshipit-source-id: 2927220bc17e61125dabcdd75f5325a0ca77e60b
2024-10-31 12:33:13 -07:00
Mateo Guzmán e5dd7d68bf feat(image): enabling basic cache control for android (#47182)
Summary:
Fixes https://github.com/facebook/react-native/issues/12606

Previously, `Image` cache control options were not functional on Android, even though they were being passed to the native component via the `source` prop. This PR addresses that by implementing logic to manage cache behaviour on Android.

When the `reload` option is explicitly set, the image is now evicted from both memory and disk caches before a new request is made. This ensures the image is always fetched from the source, aligning the caching behaviour between Android and iOS for the `default` and `reload` options.

## Changelog:

[ANDROID][ADDED] - Enabling basic `Image` cache control for Android

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

Test Plan:
Added a new example to the `rn-tester`, where we can notice that the image on the right is reloaded if rendered or re-rendered as the cache policy is set to `reload`. The image on the left has the cache policy set to `default` and won't be re-rendered as the image is already in the cache.  See the video below:

https://github.com/user-attachments/assets/88bc1d2d-0239-4deb-bcde-fe0ce521ff4d

Also tested on both old and new architecture.

Reviewed By: NickGerleman

Differential Revision: D64915440

Pulled By: Abbondanzo

fbshipit-source-id: 32e1c55dd20bf96ab0f69ef900d821c3c2552ef7
2024-10-31 09:07:40 -07:00
Samuel Susla a12036f7be delete redundant EventEmitter::dispatchEvent overload (#47231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47231

changelog: [internal]

`EventEmitter::dispatchEvent` and `EventEmitter::dispatchUniqueEvent` that were accepting shared_ptr are not needed. Their functionality is covered by other methods. Let's get rid of them to keep the API of EventEmitter slim.

Reviewed By: rubennorte

Differential Revision: D65040505

fbshipit-source-id: cffdc3ef042418178c5e2e5714779dfd0b61455e
2024-10-31 08:15:21 -07:00
Pieter De Baets 3e46cb384c Downgrade fatal error in FabricMountingManager (#47329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47329

Downgrading from fatal (introduced in D63148523). It's not yet clear why this is firing, and may point at deeper underlying issues, as the re-ordering we do in `disableMountItemReorderingAndroid` only occurs at a later point in `FabricMountingManager`.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D65267936

fbshipit-source-id: cb32b149a77c9e5a3ac6350baaeae9c7215df01b
2024-10-31 06:47:13 -07:00
HyunWoo Lee 667ba76aef Click basic button & scroll down until item 600 is visible (#46804)
Summary:
This pr is part of issue https://github.com/facebook/react-native/issues/46757 solving a task - [ME2E0008] [ME2E0009]

- Set up a test
  - Starts the app
  - Scrolls until flatlist is visilbe and clicks on flatlist
  - Click basic button
  - Scroll down until item 600 is visible

## Changelog:

[Internal] [Added] - Add e2e-test logic that click button & scroll down until specific item is visible

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

Test Plan:
### Test Locally

- iOS

```bash
yarn install
cd packages/rn-tester
yarn e2e-build-ios
```

- Android

```bash
yarn install
cd packages/rn-tester
yarn e2e-build-android
```

### Start Maestro

- iOS

```bash
 cd packages/rn-tester
 yarn e2e-test-ios
```

- Android

```
cd packages/rn-tester
yarn e2e-test-android
```

### Test in CI

To test in CI, just add a comment on your PR with the text:

```
/test-e2e
```

Reviewed By: cortinico

Differential Revision: D63829274

Pulled By: cipolleschi

fbshipit-source-id: f7b4342ed353a48123f87dcfd8d503009f65637c
2024-10-31 04:33:13 -07:00
hexboy 9a3958a619 fix(Android, iOS): Fix AnsiHighlight Style in RTL Layout (#47230)
Summary:
This pull request fixes a style bug in the AnsiHighlight component when the application is in Right-To-Left (RTL) mode. The adjustments ensure that text highlighting is visually consistent and functions properly across all layout modes.

### Before
| Android RTL | iOS RTL | Android LTR | iOS LTR |
|----------|----------|----------|----------|
|  ![Before-RTL-Android](https://github.com/user-attachments/assets/059e30e7-f6da-4a07-9c91-08d952c6a4b6) | ![Before-RTL-iOS](https://github.com/user-attachments/assets/a325c838-1510-4415-bd1f-c419ce75e7e2) | ![Before-LTR-Android](https://github.com/user-attachments/assets/26494fb1-71dd-4fae-a75c-381eead211de)  | ![Before-LTR-iOS](https://github.com/user-attachments/assets/72bba2d8-f70f-4e16-b771-4af995370d26) |

### After
| Android RTL | iOS RTL | Android LTR | iOS LTR |
|----------|----------|----------|----------|
| ![After-RTL-Android](https://github.com/user-attachments/assets/d2f674c2-7aec-454f-903a-33fcd3e93240) | ![After-RTL-iOS](https://github.com/user-attachments/assets/e3735e79-7323-48e8-8213-f0871bec0ca5) | ![After-LTR-Android](https://github.com/user-attachments/assets/18c80754-8743-4282-8f95-1e9772d51a36) | ![After-LTR-iOS](https://github.com/user-attachments/assets/068f4bd8-df4e-420b-8949-c20dff9c2bc8) |

## Changelog:
[GENERAL] [Fixed] - AnsiHighlight style in RTL layout

<!-- 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/47230

Test Plan:
To test the changes, open LogBox while the app is in RTL mode. The modifications ensure that any error messages display correctly. I have verified that the changes function properly in both LTR and RTL modes, and all existing functionality remains unaffected.

This is an example component to throw an error to show LogBox.

```tsx
import React from 'react';
import {Alert, Button, I18nManager, StyleSheet, Text, View} from 'react-native';

function SampleError() {
  return (
    <View>
      <Button
        title="Change to RTL"
        onPress={() => {
          I18nManager.allowRTL(true);
          I18nManager.forceRTL(true);
          Alert.alert('Restart app to apply changes');
        }}
      />
      <Button
        title="Change to LTR"
        onPress={() => {
          I18nManager.allowRTL(false);
          I18nManager.forceRTL(false);
          Alert.alert('Restart app to apply changes');
        }}
      />

      <Text style={styles.text}>
        isRTL: {I18nManager.isRTL ? 'true' : 'false'}
      </Text>

      <Button
        title="Show Error"
        onPress={() => {
          console.error('sample خطا');
        }}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  text: {
    fontSize: 24,
    textAlign: 'center',
    paddingVertical: 20,
  },
});

export default SampleError;
```

Reviewed By: sammy-SC

Differential Revision: D65145991

Pulled By: NickGerleman

fbshipit-source-id: cbca106813e587ed223be48b75ee5279072c2da0
2024-10-31 01:32:39 -07:00
Phillip Pan 4d90f84869 clean up unused callsites to contextContainer->at (#47322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47322

Changelog: [Internal]

these callsites were causing crashes in new bridgeless integrations, it appears they are not used, so cleaning up. after this, we can remove all callsites that insert ReactNativeConfig to the contextContainer.

Reviewed By: javache

Differential Revision: D65191733

fbshipit-source-id: 94e694ef27249773c2a39bd77f316f8f5cc2b1fb
2024-10-31 00:56:21 -07:00
Phillip Pan 3a68f14ac2 cleanup enabled_automatic_interop_android (#47321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47321

Changelog: [Internal]

this seems to be the last callsite where we read the ReactNativeConfig from the contextContainer. i don't think this killswitch should block cleanup of the ReactNativeConfig, so maybe we can just remove this?

Reviewed By: cortinico

Differential Revision: D65192744

fbshipit-source-id: d8b595edb6fecce05e67abc257d98805daa16a9a
2024-10-31 00:56:21 -07:00
Nolan O'Brien b98846c2e3 Fix up designated initializers 8/x (#47316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47316

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

In preparation of enabling `-Wobjc-designated-initializers` error

## Changelog:

[iOS][Fixed] - Fix numerous class interfaces having incorrect designated initializer patterns

Reviewed By: caodoan

Differential Revision: D65180118

fbshipit-source-id: 6f977816ede0397225ec681a5357241c28e83f6c
2024-10-30 21:08:32 -07:00
Nolan O'Brien 13b93cfdda Remove implicit "start", then clean up callsites (#47313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47313

We're going to fix up a bunch of designated initializers.  `RCTSurfaceHostingProxyRootView` is particularly problematic because different initializers will do different things even though reading the code it looks like they should be equivalent.  Remove the encapsulated "start" to the provided "surface", and require it to be explicit at the callsite.

## Changelog:

[iOS][Changed] - `RCTSurfaceHostingProxyRootView` no longer has different behavior (whether it calls `start` on the provided *surface*) depending on which initializer is used.  Call `start` yourself on the *surface* instead.

Reviewed By: cipolleschi

Differential Revision: D65214656

fbshipit-source-id: 179d5220d4f866b4452561e1bb6e2051020c8a11
2024-10-30 21:08:32 -07:00
Sam Zhou 3a01a0c9c5 Fix signature of VirtualizedSectionList (#47318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47318

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D65239931

fbshipit-source-id: c09eaad8d63f6c415e5d07a4d00dd0acc636c6b9
2024-10-30 18:15:03 -07:00
Panos Vekris e3f8c63698 Deploy 0.251.1 to xplat (#47317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47317

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D65233278

fbshipit-source-id: 35057c00f9377b6492f43bb03e5f92572799a50a
2024-10-30 14:37:10 -07:00
David Vacca d79dc48abd Delete RCTConstants.RCTGetMemoryPressureUnloadLevel (#47297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47297

In this diff I'm proposing to remove configuration for RCTConstants.RCTGetMemoryPressureUnloadLevel API in iOS

changelog: [iOS][Breaking] Delete experimental API RCTConstants.RCTGetMemoryPressureUnloadLevel

Reviewed By: rubennorte, philIip

Differential Revision: D65181556

fbshipit-source-id: c435bec6ed03562b53f1924add7b69ab517b190b
2024-10-30 13:32:04 -07:00
Samuel Susla 8bd1f3fbfa Back out "surface setup issues in EventBeat and Scheduler" (#47312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47312

changelog: [internal]

Original commit changeset: 5e044e1e6b02

Original Phabricator Diff: D65001802

Reviewed By: rshest

Differential Revision: D65210838

fbshipit-source-id: 90d9db256374f32d2efc366fe120bf677639e67e
2024-10-30 12:06:27 -07:00
zhongwuzw 2d9933e616 automaticallyAdjustKeyboardInsets not shifting scrollview content (#46732)
Summary:
Fixes https://github.com/facebook/react-native/issues/46595 . It seems https://github.com/facebook/react-native/issues/37766 broke the `automaticallyAdjustKeyboardInsets` when input accessory view become first responder.

## Changelog:

[IOS] [FIXED] - automaticallyAdjustKeyboardInsets not shifting scrollview content

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

Test Plan: Repro please see in #https://github.com/facebook/react-native/issues/46595 .

Reviewed By: cipolleschi

Differential Revision: D65072478

Pulled By: javache

fbshipit-source-id: 7d5d7566438d4bb0e1d50074a953b18866e324d3
2024-10-30 12:01:10 -07:00
Oskar Kwaśniewski ec0dbb729d feat: introduce RCTArchConfiguratorProtocol (#47306)
Summary:
This PR introduces `RCTArchConfiguratorProtocol` for better separation of concerns inside of RCTAppDelegate.

It's also a prerequisite for https://github.com/facebook/react-native/issues/46298

Discussed with cipolleschi

## Changelog:

[IOS] [ADDED] - introduce RCTArchConfiguratorProtocol

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

Test Plan:
- CI Green
- Test if methods can be overriden

Reviewed By: realsoelynn

Differential Revision: D65212703

Pulled By: cipolleschi

fbshipit-source-id: 9850fec31c421f0c6230e7e23d7a208d823d828f
2024-10-30 11:24:19 -07:00
Nicola Corti 50e38cc9f1 Bump serve-static to 1.16.2 to fix CVE-2024-43800 (#47289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47289

Bump serve-static to 1.16.2 to fix CVE-2024-43800

Changelog:
[General] [Changed] - Bump serve-static to 1.16.2 to fix CVE-2024-43800

Reviewed By: cipolleschi

Differential Revision: D65146027

fbshipit-source-id: 2876a78f195230cc4cdaa14b0076ecbecc1ee6e4
2024-10-30 09:08:55 -07:00
Samuel Susla a85955a446 resume image download if previously cancelled (#47302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47302

changelog: [internal]

The original cancellation logic cancelled image request when RCTImageComponentView was recycled but the image request was never resumed.

So in case the request was cancelled and later the same shadow node representing the image view was showed, the image request was never fulfilled and it stayed blank. It entered invalid state from where it would never recover. The image would go from state: Loading -> Cancelled and Cancelled is terminal state.

This diff adds a "resume" mechanism. If image goes from Loading -> Cancelled and something subscribes to the image state, the image request will be started again.
So we can go from Loading -> Cancelled -> Loading -> Completed.
This diff also moves the resume/cancel mechanism to ImageResponseObserverCoordinator. Where we can observe if anything is observing result of the image response.

Even though this case was highly unlikely, with <Activity /> component in React Native, it may occur.

Reviewed By: lyahdav

Differential Revision: D65149804

fbshipit-source-id: d59c1793785a367bb92602f6438666fa53db4ceb
2024-10-30 06:01:03 -07:00
qy 758892a7d8 bugfix(image): add ts definition of resizeMethod attribute. (#47227)
Summary:
in the `image component`, add the ts definition with the `resizeMethod` attribute value as `none`.

## Changelog:

[Android][Fixed] - the definition of ts of resizeMethod attribute is none.

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

Test Plan: <img width="579" alt="image" src="https://github.com/user-attachments/assets/e91dc47a-22c4-4d47-a4c2-6497d47cb842">

Reviewed By: javache

Differential Revision: D65058737

Pulled By: Abbondanzo

fbshipit-source-id: a077e4e4786a72ebffaf0698217809b1e7fde226
2024-10-30 05:06:18 -07:00
Rubén Norte 1108b4d97b Clean up API of PerformanceMark and PerformanceMeasure (#47241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47241

Changelog: [internal]

The options for the internal constructor of `PerformanceMeasure` shouldn't be optional. This just cleans that up.

Reviewed By: rshest

Differential Revision: D64480048

fbshipit-source-id: d0275276b11bd329aa2e4667646c67608d562299
2024-10-30 04:58:04 -07:00
Pieter De Baets 0dcbebd285 Fix lint failure in Github CI (#47301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47301

Lint wasn't reported on diff / seems like our internal linter config is not aligned.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65201683

fbshipit-source-id: 879e87aafff849f9247cf1d807da092fa17d0337
2024-10-30 04:57:24 -07:00
Oskar Kwaśniewski 8850736188 feat(iOS): introduce RCTUIConfiguratorProtocol (#47139)
Summary:
This PR introduces `RCTUIConfiguratorProtocol` for better separation of concerns inside of RCTAppDelegate.

It's also a prerequisite for https://github.com/facebook/react-native/issues/46298

Discussed with cipolleschi

## Changelog:

[IOS] [ADDED] - introduce RCTUIConfiguratorProtocol

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

Test Plan:
- CI Green
- Test if methods can be overriden

Reviewed By: blakef

Differential Revision: D65063839

Pulled By: cipolleschi

fbshipit-source-id: b63766e245d57f369ab94bd8047d5de9a3447b3e
2024-10-30 04:32:17 -07:00
Alex Taylor (alta) e797135247 Deploy 0.251.0 to www + fbsource (#47295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47295

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D65176860

fbshipit-source-id: 2254fdac49a664f3a92ae0834c76d721132fddc4
2024-10-29 19:31:15 -07:00
Nick Gerleman 41265bac6b Reimplement Android lineHeight positioning/determination (#47271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47271

Let's keep the recent goals of centering (instead of arbitrary prioritizing ascent), ala spec, and make some changes to allow overlapping interior line-boxes, and make the implementation a lot simpler, instead of the cruft it has been accumulating.

The new simple versions is implemented as the only `CustomLineHeightSpan`. This replaces the code used when `enableAndroidLineHeightCentering` is enabled (which is now the default).

Legacy path is renamed to `LegacyLineHeightSpan`, slated to be deleted if rollout goes well.

We cannot yet cause text to overflow the bounds of the underlying TextView until potentially large later work related to ReactTextView reimplementation.

There's a somewhat arbitrary choice here, when rounding, to whether we ceil ascent vs descent when pixels don't evenly split. This does result in a visual difference, and for sake of avoiding breakage of screenshots, I left the same choice as before.

Changelog:
[Android][Fixed] - Reimplement Android lineHeight positioning/determination

Reviewed By: javache

Differential Revision: D64716557

fbshipit-source-id: 5a947377df7cfee9dff4484c840939f527caf94b
2024-10-29 17:53:16 -07:00
Nick Gerleman 7cb9fa9737 Add lineHeight screenshot tests (#47270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47270

Lets add some screenshot tests, along with one more example, and fixing some silly typos in test IDs.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65094482

fbshipit-source-id: a5f3e06c4737158bf6419364d05668c3feb1bd5e
2024-10-29 17:53:16 -07:00
Joe Vilches 9f73edee2d Fix issue where text would truncate sometimes (#47294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47294

TextView will set `setUseLineSpacingFromFallbacks` to `true` for their `StaticLayout`s while we ignore it in this case (`false` default). The docs even recommend setting it to `true`: https://developer.android.com/reference/android/text/StaticLayout.Builder#setUseLineSpacingFromFallbacks(boolean)

We set this in the `StaticLayout` builder below, but not up here so lets do that.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D65171352

fbshipit-source-id: aa7fd116898c6af9378d71c5c570c790e6ab415f
2024-10-29 17:49:41 -07:00
Nick Gerleman bfca7cfe7a Fix legacy arch RTL horizontal ScrollView regression (#47282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47282

D63318754 fixed a class of issues with RTL horizontal scrollviews by moving logic from native Android view layer to Fabric ShadowNode layer.

I realized quite a bit later this is problematic for legacy arch, since it now never runs RTL translation code, and all our RTL screenshot tests are against new arch.

It's tricky to port Fabric ShadowNode related code to Paper since its shadownodes are more coupled to Yoga nodes, and the existing solution for contextual layout direction didn't quite work, so I went with the original logic we had for this, where we use global layout direction to determine whether to offset, and disable removeClippedSubviews, and this is applied via onLayout. This is wrong in several ways, but not a regression compared to previous legacy arch behavior. The fully correct behavior will require new arch.

Changelog:
[Android][Fixed] - Fix legacy arch RTL horizontal ScrollView regression

Reviewed By: rshest

Differential Revision: D65139747

fbshipit-source-id: 5662c0744c3c402efe583e602b2272662b4d5476
2024-10-29 16:29:36 -07:00
Nick Gerleman 0df59d4f03 Fix RTL ScrollView position when content smaller than container (#47280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47280

Noticed in the screenshots of https://github.com/facebook/react-native/pull/47230 that Android's logic of setting scroll content origin to zero, then right aligning scroll offset, won't correctly handle case where content is smaller than scrolling container. We can fix that by only resetting the origin when content overflows container, since we otherwise are not scrollable, and scroll adjustment will not translate.

Changelog:
[Android][Fixed] - Fix RTL ScrollView position when content smaller than container

Reviewed By: rshest

Differential Revision: D65136654

fbshipit-source-id: 2818ff6360cbfac64d7e57bdcbbe8c0a9b4bbb97
2024-10-29 16:29:36 -07:00
Eric Rozell 0d664100bb Avoid null reference exception when fetching ReactRootView in bridgeless (#47284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47284

If the surface hasn't been set up yet, attempting to fetch the ReactRootView will throw a null reference exception. Since the result is already nullable, it's perhaps better to just return null when the surface has not yet been initialized.

## Changelog

[Android][Fixed] Avoid null reference exception in bridgeless ReactDelegate

Reviewed By: javache

Differential Revision: D65141137

fbshipit-source-id: 9b002b0520a7eeea61767cb8934e9bb8d049fc6a
2024-10-29 15:55:56 -07:00
Eric Rozell e3f03269c5 Minor typo in ReactHostImpl comment (#47290)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47290

Fixes a comment typo.

## Changelog

[General][Fixed] Fixes typo in ReactHostImpl

Reviewed By: cortinico

Differential Revision: D65149529

fbshipit-source-id: b419241f861ab28b2c4a512b27f33b94e7929b81
2024-10-29 15:18:09 -07:00
Ramanpreet Nara cc6f75bb75 earlyjs: Integrate c++ pipeline with console.error
Summary:
## Changes
If the c++ pipeline is active:

If someone calls console.error:
- The c++ pipeline will report it as a soft error

If someone reports an error:
- The c++ pipeline will log it via console.error

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64506069

fbshipit-source-id: 293cd1774f19ee03d7eb61572b7b1f03a47a4756
2024-10-29 14:24:27 -07:00
Ramanpreet Nara 5b53c07329 earlyjs: Integrate c++ pipeline with all ios apps
Summary:
Now, all ios apps will just be integrated with the c++ error reporting pipeline, with zero configuration.

Changelog: [Internal]

Reviewed By: javache, philIip

Differential Revision: D64615457

fbshipit-source-id: db9d98115238d9a42563e39a4780234a9bc3c034
2024-10-29 14:24:27 -07:00
Ramanpreet Nara eb3977eccf earlyjs: Introduce flag for always available js error handling
Summary:
This diff introduces ReactNativeFeatureFlags.useAlwaysAvailableJSErrorHandling.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64791786

fbshipit-source-id: 81cf3ed1fc7057638d7d817f1fea5fc371b53646
2024-10-29 14:24:27 -07:00
Dawid 08e8f6adfd fix(Android) drawing additional empty line when 'textAlign' is set to 'justify' (#47122)
Summary:
Fixes https://github.com/facebook/react-native/issues/46908

The `justificationMode` is not set for multiline text without unicode characters with known width on both architectures. This caused the issue of drawing additional empty line at the end of `TextView` because Yoga thought that text takes 5 lines and falsely calculated it's height.

Currently, on the old architecture, the `justificationMode` is set only on text that is not boring (contains unicode characters) with unknown width. I am not sure why is that, so I am opening this as a draft for now as I am still checking if it doesn't break anything.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [FIXED] - fix generating empty line at the end of multiline text view when `textAlign` is set to `justify`

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

Test Plan: I've tested on both architectures on repro provided in the issue.

Reviewed By: javache

Differential Revision: D65002386

Pulled By: NickGerleman

fbshipit-source-id: 0187956c88e6eb1e637c24e82b3052cc82581a64
2024-10-29 14:22:59 -07:00
Samuel Susla dacada7750 use move semantics in TouchEventEmitter (#47232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47232

changelog: [internal]

TouchEventEmitter APIs take ownership of TouchEvent and PointerEvent, the use of const & qualifiers is misleading and may lead it unnecessary copy.

Reviewed By: rubennorte

Differential Revision: D65040506

fbshipit-source-id: 941e2eab6a057e31066751e26387604858f03e51
2024-10-29 13:18:50 -07:00
Phillip Pan 6fc500ee99 hook up useNativeViewConfigsInBridgelessMode feature flag (#47265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47265

Changelog: [iOS][Breaking]

This was originally landed before as part of the effort to coalesce configurations with the feature flag infra, but got reverted due to a build issue. I'm pretty sure it was just because the legacy configuration methods were not cleaned up from the header (RCTConstants.h). I fixed that here.

Reviewed By: javache

Differential Revision: D65092536

fbshipit-source-id: 5012ba54b0314c487f2ef488c2eb30a3c4133cb5
2024-10-29 12:42:26 -07:00
Hanno J. Gödecke 0fc2e954be add example for dynamic sized text input (#46976)
Summary:
This PR adds an example showcasing a TextInput whose width gets resized dynamically based on the text content width.
This example was added for this PR, which tries to address a flickering bug with dynamic sized TextInputs:

- https://github.com/facebook/react-native/pull/46973

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [ADDED] Added dynamic content width TextInput example

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

Test Plan:
Test in RNTester app:

https://github.com/user-attachments/assets/7571b80b-7035-47df-b840-4218ab0802b5

Reviewed By: NickGerleman

Differential Revision: D64271454

Pulled By: arushikesarwani94

fbshipit-source-id: 28fe7bd93891ffe5284340d73e9ee947654f1788
2024-10-29 12:40:09 -07:00
Abdelhafidh Belalia e8f8ee3c0f Resume frame callback on host resume (#47264)
Summary:
When the app goes into background the frame callback is ignored by setting the `mShouldStop` flag to `true` https://github.com/facebook/react-native/blob/3111473d571a8315d11753f8c6acddd2ba301f8f/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java#L174
However this flag is never reset even after the app is back on foreground. This made the `AndroidEventBeat` not ticking in as much as expected causing events not being dispatched in time. In our case the `onLayout` was not being dispatched unless we tap on screen invoking a manual tick.

## Changelog:

[ANDROID] [FIXED] - Fix Frame Callback not being called after Host Resume

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

Test Plan:
1. Add log line `__android_log_print(ANDROID_LOG_DEBUG, "s77rt", "AndroidEventBeat::tick");` in `packages/react-native/ReactAndroid/src/main/jni/react/fabric/AndroidEventBeat.cpp` (tick method)
2. Open RN-Tester
3. Verify `AndroidEventBeat::tick` is logged for every frame
4. Put app into background
5. Verify no `AndroidEventBeat::tick` is logged
6. Open app again
7. Verify `AndroidEventBeat::tick` is logged for every frame

| Before | After |
|:------:|:-----:|
|     <video src="https://github.com/user-attachments/assets/9667ed49-3a56-4c30-992f-9e6426f5d08e" />   |     <video src="https://github.com/user-attachments/assets/548ae199-d9a2-497c-bba7-b89c4d684836" />  |
|     <video src="https://github.com/user-attachments/assets/e14851aa-0609-4b36-bf1e-dfd5d2ee8512" />   |     <video src="https://github.com/user-attachments/assets/db5a9fe6-dfc1-4b3c-92b0-359b4b68ac5c" />  |

Reviewed By: NickGerleman

Differential Revision: D65136338

Pulled By: javache

fbshipit-source-id: 0a101be2a7588cbbb5a55ee4d420082f85566c1b
2024-10-29 11:53:02 -07:00
Rubén Norte e51c32d7cf Improve intersection observer errors when trying to observe nullish targets (#47291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47291

Changelog: [internal]

Small devx improvement to distinguish problems caused by calling `IntersectionObserver.observe` with null or undefined, vs. other values not supported by the API (like legacy refs).

Differential Revision: D65150750

fbshipit-source-id: b9452ff19d35ccd0dc2d47ee2d5a0e933e0ae180
2024-10-29 11:31:30 -07:00
Alan Lee 97622a5caa RedBoxDialogSurfaceDelegate crash fix (#47249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47249

- It is likely that Dialog is being dismissed from an invalid state causing an exception
- apply similar changes from D63712422 which is to add try/catch around and ignore the exception as we are dismissing the dialog anyway

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65066186

fbshipit-source-id: 03ebbc3fec3adf6100e36ea38b43f410d98a5297
2024-10-29 11:19:02 -07:00
Mateo Guzmán c19fd11ccf fix(examples): fixing XMLHttpRequest file download example (#47152)
Summary:
The `XMLHttpRequest` example with a single file download doesn't seem to be working anymore. The test case is quite old so it seems like something changed in between with the example URLs.

- Changing the URL for the example. Using another file from `filesamples.com` as it's already being used in the chunk file download example as well.
- Adding an `onerror` callback as it was loading infinitely when something went wrong.

## Changelog:

[INTERNAL] [FIXED] - fixing `XMLHttpRequest` file download example

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

Test Plan:
Using the `rn-tester`, see the before and after for comparison

<details>
<summary>Before and after videos</summary>

**Before**:

https://github.com/user-attachments/assets/01f89cd9-0f5e-4ddb-9ff2-c3e053be5413

**After**:

https://github.com/user-attachments/assets/59ef161c-d5ba-43e3-827e-e250cc663276

</details>

Reviewed By: cipolleschi

Differential Revision: D65126952

Pulled By: NickGerleman

fbshipit-source-id: 7a4b2187570fd85d4444bfe63ae7bc77b09af261
2024-10-29 11:18:34 -07:00
Blake Friedman 7090b790c6 Changelog for 0.76.1 (#47288)
Summary:
Changelog: [Internal]

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

Reviewed By: cipolleschi

Differential Revision: D65146569

Pulled By: blakef

fbshipit-source-id: bdc25e4bf6b1b2f7fa7723171431aea3bb490622
2024-10-29 10:44:28 -07:00
Pieter De Baets 7a265d2406 Remove unused __inspectorLog (#47276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47276

This dates back all the way to D4021502 and is unused by any of our modern debugger tools.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D65134285

fbshipit-source-id: 44d8bf2553b28558755e9a603b8ddc8f7dd79b20
2024-10-29 10:34:00 -07:00
Nicola Corti 19813642f1 Move com/facebook/react/devsupport/AndroidManifest to Internal (#47279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47279

This file is used by BUCK only and should have not been exposed in the first place.
Fixes https://github.com/facebook/react-native/issues/47223

Changelog:
[Internal] [Changed] - Move `com/facebook/react/devsupport/AndroidManifest` to Internal

Reviewed By: NickGerleman

Differential Revision: D65136247

fbshipit-source-id: 01f1e3aed55e932e842132312166b786fd39e7ce
2024-10-29 10:25:46 -07:00
Blake Friedman f5595c716b test-e2e-local support useLastSuccessfulPipeline (#47248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47248

This argument wasn't implemented; this change implements it.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D65066030

fbshipit-source-id: 999fb2fa89cc71f9a568843d4cf92a500ff1b4f8
2024-10-29 10:08:07 -07:00
Blake Friedman 4c0cd72208 Fix typo in template action watcher script (#47286)
Summary:
Trivial typo - static analysis would have been a good thing.

Changelog: [Internal]

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

Test Plan: eyes

Reviewed By: NickGerleman

Differential Revision: D65145600

Pulled By: blakef

fbshipit-source-id: 567ef3637441aa84651dce03f45b80068c5f4290
2024-10-29 10:06:17 -07:00
Rubén Norte 9792d5e2d1 Quick print of feature flags definitions (#47240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47240

Changelog: [internal]

Adding a new option for the feature flags script to print the current definitions of feature flags.

```
yarn featureflags --print
```

```
┌────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────┬──────────────┐
│ (index)                                                    │ Description                                                                                               │ Purpose │ Date added   │
├────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────┼──────────────┤
│ commonTestFlag                                             │ 'Common flag for testing. Do NOT modify.'                                                                 │ '🔨'    │ undefined    │
│ commonTestFlagWithoutNativeImplementation                  │ 'Common flag for testing (without native implementation). Do NOT modify.'                                 │ '🔨'    │ undefined    │
│ enableFabricLogs                                           │ 'This feature flag enables logs for Fabric.'                                                              │ '🔨'    │ undefined    │
│ jsOnlyTestFlag                                             │ 'JS-only flag for testing. Do NOT modify.'                                                                │ '🔨'    │ undefined    │
│ traceTurboModulePromiseRejectionsOnAndroid                 │ 'Enables storing js caller stack when creating promise in native module. This is useful in case of Pr...' │ '🔨'    │ undefined    │
│ batchRenderingUpdatesInEventLoop                           │ 'When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and di...' │ '🚀'    │ undefined    │
│ disableEventLoopOnBridgeless                               │ 'The bridgeless architecture enables the event loop by default. This feature flag allows us to force ...' │ '🚀'    │ undefined    │
│ enableAccessToHostTreeInFabric                             │ 'Enables access to the host tree in Fabric using DOM-compatible APIs.'                                    │ '🚀'    │ undefined    │
│ enableBridgelessArchitecture                               │ 'Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the fo...' │ '🚀'    │ undefined    │
│ enableFabricRenderer                                       │ 'Enables the use of the Fabric renderer in the whole app.'                                                │ '🚀'    │ undefined    │
│ enableFabricRendererExclusively                            │ 'When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infra...' │ '🚀'    │ undefined    │
│ enableLayoutAnimationsOnAndroid                            │ 'When enabled, LayoutAnimations API will animate state changes on Android.'                               │ '🚀'    │ undefined    │
│ enableLayoutAnimationsOnIOS                                │ 'When enabled, LayoutAnimations API will animate state changes on iOS.'                                   │ '🚀'    │ undefined    │
│ enableLongTaskAPI                                          │ 'Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is e...' │ '🚀'    │ undefined    │
│ enableMicrotasks                                           │ 'Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).'                  │ '🚀'    │ undefined    │
│ enableReportEventPaintTime                                 │ 'Report paint time inside the Event Timing API implementation (PerformanceObserver).'                     │ '🚀'    │ undefined    │
│ fuseboxEnabledDebug                                        │ 'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug build...' │ '🚀'    │ undefined    │
│ fuseboxEnabledRelease                                      │ 'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release bui...' │ '🚀'    │ undefined    │
│ isLayoutAnimationEnabled                                   │ 'Function used to enable / disabled Layout Animations in React Native.'                                   │ '🚀'    │ undefined    │
│ useFabricInterop                                           │ 'Should this application enable the Fabric Interop Layer for Android? If yes, the application will be...' │ '🚀'    │ undefined    │
│ useModernRuntimeScheduler                                  │ 'When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with prioriti...' │ '🚀'    │ undefined    │
│ useTurboModules                                            │ 'When enabled, NativeModules will be executed by using the TurboModule system'                            │ '🚀'    │ undefined    │
│ allowRecursiveCommitsWithSynchronousMountOnAndroid         │ 'Adds support for recursively processing commits that mount synchronously (Android only).'                │ '🧪'    │ '2024-05-30' │
│ animatedShouldDebounceQueueFlush                           │ 'Enables an experimental flush-queue debouncing in Animated.js.'                                          │ '🧪'    │ '2024-02-05' │
│ animatedShouldUseSingleOp                                  │ 'Enables an experimental mega-operation for Animated.js that replaces many calls to native with a sin...' │ '🧪'    │ '2024-02-05' │
│ completeReactInstanceCreationOnBgThreadOnAndroid           │ 'Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on ...' │ '🧪'    │ '2024-07-22' │
│ enableAlignItemsBaselineOnFabricIOS                        │ 'Kill-switch to turn off support for aling-items:baseline on Fabric iOS.'                                 │ '🧪'    │ '2024-07-10' │
│ enableAndroidLineHeightCentering                           │ 'When enabled, custom line height calculation will be centered from top to bottom.'                       │ '🧪'    │ '2024-09-11' │
│ enableAnimatedAllowlist                                    │ 'Enables Animated to skip non-allowlisted props and styles.'                                              │ '🧪'    │ '2024-09-10' │
│ enableAnimatedClearImmediateFix                            │ 'Enables an experimental to use the proper clearIntermediate instead of calling the wrong clearTimeou...' │ '🧪'    │ '2024-09-17' │
│ enableAnimatedPropsMemo                                    │ 'Enables Animated to analyze props to minimize invalidating `AnimatedProps`.'                             │ '🧪'    │ '2024-09-11' │
│ enableCleanTextInputYogaNode                               │ 'Clean yoga node when <TextInput /> does not change.'                                                     │ '🧪'    │ '2024-04-06' │
│ enableCppPropsIteratorSetter                               │ 'Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).'         │ '🧪'    │ '2024-09-13' │
│ enableDeletionOfUnmountedViews                             │ 'Deletes views that were pre-allocated but never mounted on the screen.'                                  │ '🧪'    │ '2024-09-13' │
│ enableEagerRootViewAttachment                              │ 'Feature flag to configure eager attachment of the root view/initialisation of the JS code.'              │ '🧪'    │ '2024-07-28' │
│ enableEventEmitterRetentionDuringGesturesOnAndroid         │ 'Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug ...' │ '🧪'    │ '2024-08-08' │
│ enableGranularShadowTreeStateReconciliation                │ 'When enabled, the renderer would only fail commits when they propagate state and the last commit tha...' │ '🧪'    │ '2024-05-01' │
│ enableIOSViewClipToPaddingBox                              │ 'iOS Views will clip to their padding box vs border box'                                                  │ '🧪'    │ '2024-08-30' │
│ enableNewBackgroundAndBorderDrawables                      │ 'Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable'                              │ '🧪'    │ '2024-09-24' │
│ enableOptimisedVirtualizedCells                            │ 'Removing unnecessary rerenders Virtualized cells after any rerenders of Virualized list. Works with ...' │ '🧪'    │ '2024-08-21' │
│ enablePreciseSchedulingForPremountItemsOnAndroid           │ 'Moves execution of pre-mount items to outside the choregrapher in the main thread, so we can estimat...' │ '🧪'    │ '2024-09-19' │
│ enablePropsUpdateReconciliationAndroid                     │ 'When enabled, Android will receive prop updates based on the differences between the last rendered s...' │ '🧪'    │ '2024-07-12' │
│ enableSynchronousStateUpdates                              │ 'Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tr...' │ '🧪'    │ '2024-04-25' │
│ enableTextPreallocationOptimisation                        │ 'Text preallocation optimisation where unnecessary work is removed.'                                      │ '🧪'    │ '2024-09-12' │
│ enableUIConsistency                                        │ 'Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in o...' │ '🧪'    │ '2024-04-25' │
│ enableViewRecycling                                        │ 'Enables View Recycling. When enabled, individual ViewManagers must still opt-in.'                        │ '🧪'    │ '2024-07-31' │
│ excludeYogaFromRawProps                                    │ 'When enabled, rawProps in Props will not include Yoga specific props.'                                   │ '🧪'    │ '2024-07-22' │
│ fixMappingOfEventPrioritiesBetweenFabricAndReact           │ 'Uses the default event priority instead of the discreet event priority by default when dispatching e...' │ '🧪'    │ '2024-06-18' │
│ fixMountingCoordinatorReportedPendingTransactionsOnAndroid │ 'Fixes a limitation on Android where the mounting coordinator would report there are no pending trans...' │ '🧪'    │ '2024-08-27' │
│ forceBatchingMountItemsOnAndroid                           │ 'Forces the mounting layer on Android to always batch mount items instead of dispatching them immedia...' │ '🧪'    │ '2024-04-10' │
│ initEagerTurboModulesOnNativeModulesQueueAndroid           │ 'Construct modules that requires eager init on the dedicate native modules thread'                        │ '🧪'    │ '2024-07-11' │
│ lazyAnimationCallbacks                                     │ 'Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame...' │ '🧪'    │ '2024-05-01' │
│ loadVectorDrawablesOnImages                                │ 'Adds support for loading vector drawable assets in the Image component (only on Android)'                │ '🧪'    │ '2024-07-12' │
│ scheduleAnimatedEndCallbackInMicrotask                     │ 'Changes the completion callback supplied via `Animation#start` to be scheduled in a microtask instea...' │ '🧪'    │ '2024-09-27' │
│ setAndroidLayoutDirection                                  │ 'Propagate layout direction to Android views.'                                                            │ '🧪'    │ '2024-05-17' │
│ shouldSkipStateUpdatesForLoopingAnimations                 │ 'If the animation is within Animated.loop, we do not send state updates to React.'                        │ '🧪'    │ '2024-07-25' │
│ shouldUseAnimatedObjectForTransform                        │ 'Enables use of AnimatedObject for animating transform values.'                                           │ '🧪'    │ '2024-02-05' │
│ shouldUseRemoveClippedSubviewsAsDefaultOnIOS               │ 'removeClippedSubviews prop will be used as the default in FlatList on iOS to match Android'              │ '🧪'    │ '2024-02-05' │
│ shouldUseSetNativePropsInFabric                            │ 'Enables use of setNativeProps in JS driven animations.'                                                  │ '🧪'    │ '2024-03-05' │
│ shouldUseSetNativePropsInNativeAnimationsInFabric          │ 'Enables use of setNativeProps in Native driven animations in Fabric.'                                    │ '🧪'    │ '2024-03-05' │
│ useImmediateExecutorInAndroidBridgeless                    │ 'Invoke callbacks immediately on the ReactInstance rather than going through a background thread for ...' │ '🧪'    │ '2024-06-06' │
│ useInsertionEffectsForAnimations                           │ 'Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`.'       │ '🧪'    │ '2024-09-12' │
│ useNativeViewConfigsInBridgelessMode                       │ 'When enabled, the native view configs are used in bridgeless mode.'                                      │ '🧪'    │ '2024-04-03' │
│ useOptimisedViewPreallocationOnAndroid                     │ 'Moves more of the work in view preallocation to the main thread to free up JS thread.'                   │ '🧪'    │ '2024-07-23' │
│ useOptimizedEventBatchingOnAndroid                         │ 'Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreogra...' │ '🧪'    │ '2024-08-29' │
│ useRefsForTextInputState                                   │ 'Enable a variant of TextInput that moves some state to refs to avoid unnecessary re-renders'             │ '🧪'    │ '2024-07-08' │
│ useRuntimeShadowNodeReferenceUpdate                        │ 'When enabled, cloning shadow nodes within react native will update the reference held by the current...' │ '🧪'    │ '2024-06-03' │
│ useTurboModuleInterop                                      │ 'In Bridgeless mode, should legacy NativeModules use the TurboModule system?'                             │ '🧪'    │ '2024-07-28' │
└────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────┴──────────────┘
Summary
┌─────────────────┬────────┐
│ (index)         │ Values │
├─────────────────┼────────┤
│ Total           │ 68     │
│ Common          │ 51     │
│ JS Only         │ 17     │
│ Operational     │ 5      │
│ Release         │ 17     │
│ Experimentation │ 46     │
└─────────────────┴────────┘
Done in 1.62s.
```

```
yarn featureflags --print --json
```

```
{"common":{"commonTestFlag":{"defaultValue":false,"metadata":{"description":"Common flag for testing. Do NOT modify.","purpose":"operational"}},"commonTestFlagWithoutNativeImplementation":{"defaultValue":false,"metadata":{"description":"Common flag for testing (without native implementation). Do NOT modify.","purpose":"operational"},"skipNativeAPI":true},"allowRecursiveCommitsWithSynchronousMountOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-05-30","description":"Adds support for recursively processing commits that mount synchronously (Android only).","purpose":"experimentation"}},"batchRenderingUpdatesInEventLoop":{"defaultValue":false,"metadata":{"description":"When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.","purpose":"release"},"skipNativeAPI":true},"completeReactInstanceCreationOnBgThreadOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-22","description":"Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android","purpose":"experimentation"}},"disableEventLoopOnBridgeless":{"defaultValue":false,"metadata":{"description":"The bridgeless architecture enables the event loop by default. This feature flag allows us to force disabling it in specific instances.","purpose":"release"}},"enableAlignItemsBaselineOnFabricIOS":{"defaultValue":true,"metadata":{"dateAdded":"2024-07-10","description":"Kill-switch to turn off support for aling-items:baseline on Fabric iOS.","purpose":"experimentation"}},"enableAndroidLineHeightCentering":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-11","description":"When enabled, custom line height calculation will be centered from top to bottom.","purpose":"experimentation"}},"enableBridgelessArchitecture":{"defaultValue":false,"metadata":{"description":"Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer.","purpose":"release"}},"enableCleanTextInputYogaNode":{"defaultValue":false,"metadata":{"dateAdded":"2024-04-06","description":"Clean yoga node when <TextInput /> does not change.","purpose":"experimentation"}},"enableCppPropsIteratorSetter":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-13","description":"Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).","purpose":"experimentation"}},"enableDeletionOfUnmountedViews":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-13","description":"Deletes views that were pre-allocated but never mounted on the screen.","purpose":"experimentation"}},"enableEagerRootViewAttachment":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-28","description":"Feature flag to configure eager attachment of the root view/initialisation of the JS code.","purpose":"experimentation"}},"enableEventEmitterRetentionDuringGesturesOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-08-08","description":"Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)","purpose":"experimentation"}},"enableFabricLogs":{"defaultValue":false,"metadata":{"description":"This feature flag enables logs for Fabric.","purpose":"operational"}},"enableFabricRenderer":{"defaultValue":false,"metadata":{"description":"Enables the use of the Fabric renderer in the whole app.","purpose":"release"}},"enableFabricRendererExclusively":{"defaultValue":false,"metadata":{"description":"When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.","purpose":"release"}},"enableGranularShadowTreeStateReconciliation":{"defaultValue":false,"metadata":{"dateAdded":"2024-05-01","description":"When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.","purpose":"experimentation"}},"enableIOSViewClipToPaddingBox":{"defaultValue":false,"metadata":{"dateAdded":"2024-08-30","description":"iOS Views will clip to their padding box vs border box","purpose":"experimentation"}},"enableLayoutAnimationsOnAndroid":{"defaultValue":false,"metadata":{"description":"When enabled, LayoutAnimations API will animate state changes on Android.","purpose":"release"}},"enableLayoutAnimationsOnIOS":{"defaultValue":true,"metadata":{"description":"When enabled, LayoutAnimations API will animate state changes on iOS.","purpose":"release"}},"enableLongTaskAPI":{"defaultValue":false,"metadata":{"description":"Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.","purpose":"release"}},"enableMicrotasks":{"defaultValue":false,"metadata":{"description":"Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).","purpose":"release"},"skipNativeAPI":true},"enableNewBackgroundAndBorderDrawables":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-24","description":"Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable","purpose":"experimentation"}},"enablePreciseSchedulingForPremountItemsOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-19","description":"Moves execution of pre-mount items to outside the choregrapher in the main thread, so we can estimate idle time more precisely (Android only).","purpose":"experimentation"}},"enablePropsUpdateReconciliationAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-12","description":"When enabled, Android will receive prop updates based on the differences between the last rendered shadow node and the last committed shadow node.","purpose":"experimentation"}},"enableReportEventPaintTime":{"defaultValue":false,"metadata":{"description":"Report paint time inside the Event Timing API implementation (PerformanceObserver).","purpose":"release"}},"enableSynchronousStateUpdates":{"defaultValue":false,"metadata":{"dateAdded":"2024-04-25","description":"Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).","purpose":"experimentation"}},"enableTextPreallocationOptimisation":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-12","description":"Text preallocation optimisation where unnecessary work is removed.","purpose":"experimentation"}},"enableUIConsistency":{"defaultValue":false,"metadata":{"dateAdded":"2024-04-25","description":"Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).","purpose":"experimentation"}},"enableViewRecycling":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-31","description":"Enables View Recycling. When enabled, individual ViewManagers must still opt-in.","purpose":"experimentation"}},"excludeYogaFromRawProps":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-22","description":"When enabled, rawProps in Props will not include Yoga specific props.","purpose":"experimentation"}},"fixMappingOfEventPrioritiesBetweenFabricAndReact":{"defaultValue":false,"metadata":{"dateAdded":"2024-06-18","description":"Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.","purpose":"experimentation"}},"fixMountingCoordinatorReportedPendingTransactionsOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-08-27","description":"Fixes a limitation on Android where the mounting coordinator would report there are no pending transactions but some of them were actually not processed due to the use of the push model.","purpose":"experimentation"}},"forceBatchingMountItemsOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-04-10","description":"Forces the mounting layer on Android to always batch mount items instead of dispatching them immediately. This might fix some crashes related to synchronous state updates, where some views dispatch state updates during mount.","purpose":"experimentation"}},"fuseboxEnabledDebug":{"defaultValue":true,"metadata":{"description":"Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.","purpose":"release"}},"fuseboxEnabledRelease":{"defaultValue":false,"metadata":{"description":"Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.","purpose":"release"}},"initEagerTurboModulesOnNativeModulesQueueAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-11","description":"Construct modules that requires eager init on the dedicate native modules thread","purpose":"experimentation"}},"lazyAnimationCallbacks":{"defaultValue":false,"metadata":{"dateAdded":"2024-05-01","description":"Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.","purpose":"experimentation"}},"loadVectorDrawablesOnImages":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-12","description":"Adds support for loading vector drawable assets in the Image component (only on Android)","purpose":"experimentation"}},"setAndroidLayoutDirection":{"defaultValue":true,"metadata":{"dateAdded":"2024-05-17","description":"Propagate layout direction to Android views.","purpose":"experimentation"}},"traceTurboModulePromiseRejectionsOnAndroid":{"defaultValue":false,"metadata":{"description":"Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.","purpose":"operational"}},"useFabricInterop":{"defaultValue":false,"metadata":{"description":"Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.","purpose":"release"}},"useImmediateExecutorInAndroidBridgeless":{"defaultValue":false,"metadata":{"dateAdded":"2024-06-06","description":"Invoke callbacks immediately on the ReactInstance rather than going through a background thread for synchronization","purpose":"experimentation"}},"useModernRuntimeScheduler":{"defaultValue":false,"metadata":{"description":"When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.","purpose":"release"},"skipNativeAPI":true},"useNativeViewConfigsInBridgelessMode":{"defaultValue":false,"metadata":{"dateAdded":"2024-04-03","description":"When enabled, the native view configs are used in bridgeless mode.","purpose":"experimentation"}},"useOptimisedViewPreallocationOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-23","description":"Moves more of the work in view preallocation to the main thread to free up JS thread.","purpose":"experimentation"}},"useOptimizedEventBatchingOnAndroid":{"defaultValue":false,"metadata":{"dateAdded":"2024-08-29","description":"Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback.","purpose":"experimentation"}},"useRuntimeShadowNodeReferenceUpdate":{"defaultValue":false,"metadata":{"dateAdded":"2024-06-03","description":"When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.","purpose":"experimentation"}},"useTurboModuleInterop":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-28","description":"In Bridgeless mode, should legacy NativeModules use the TurboModule system?","purpose":"experimentation"}},"useTurboModules":{"defaultValue":false,"metadata":{"description":"When enabled, NativeModules will be executed by using the TurboModule system","purpose":"release"}}},"jsOnly":{"jsOnlyTestFlag":{"defaultValue":false,"metadata":{"description":"JS-only flag for testing. Do NOT modify.","purpose":"operational"}},"animatedShouldDebounceQueueFlush":{"defaultValue":false,"metadata":{"dateAdded":"2024-02-05","description":"Enables an experimental flush-queue debouncing in Animated.js.","purpose":"experimentation"}},"animatedShouldUseSingleOp":{"defaultValue":false,"metadata":{"dateAdded":"2024-02-05","description":"Enables an experimental mega-operation for Animated.js that replaces many calls to native with a single call into native, to reduce JSI/JNI traffic.","purpose":"experimentation"}},"enableAccessToHostTreeInFabric":{"defaultValue":false,"metadata":{"description":"Enables access to the host tree in Fabric using DOM-compatible APIs.","purpose":"release"}},"enableAnimatedAllowlist":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-10","description":"Enables Animated to skip non-allowlisted props and styles.","purpose":"experimentation"}},"enableAnimatedClearImmediateFix":{"defaultValue":true,"metadata":{"dateAdded":"2024-09-17","description":"Enables an experimental to use the proper clearIntermediate instead of calling the wrong clearTimeout and canceling another timer.","purpose":"experimentation"}},"enableAnimatedPropsMemo":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-11","description":"Enables Animated to analyze props to minimize invalidating `AnimatedProps`.","purpose":"experimentation"}},"enableOptimisedVirtualizedCells":{"defaultValue":false,"metadata":{"dateAdded":"2024-08-21","description":"Removing unnecessary rerenders Virtualized cells after any rerenders of Virualized list. Works with strict=true option","purpose":"experimentation"}},"isLayoutAnimationEnabled":{"defaultValue":true,"metadata":{"description":"Function used to enable / disabled Layout Animations in React Native.","purpose":"release"}},"scheduleAnimatedEndCallbackInMicrotask":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-27","description":"Changes the completion callback supplied via `Animation#start` to be scheduled in a microtask instead of synchronously executed.","purpose":"experimentation"}},"shouldSkipStateUpdatesForLoopingAnimations":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-25","description":"If the animation is within Animated.loop, we do not send state updates to React.","purpose":"experimentation"}},"shouldUseAnimatedObjectForTransform":{"defaultValue":false,"metadata":{"dateAdded":"2024-02-05","description":"Enables use of AnimatedObject for animating transform values.","purpose":"experimentation"}},"shouldUseRemoveClippedSubviewsAsDefaultOnIOS":{"defaultValue":false,"metadata":{"dateAdded":"2024-02-05","description":"removeClippedSubviews prop will be used as the default in FlatList on iOS to match Android","purpose":"experimentation"}},"shouldUseSetNativePropsInFabric":{"defaultValue":true,"metadata":{"dateAdded":"2024-03-05","description":"Enables use of setNativeProps in JS driven animations.","purpose":"experimentation"}},"shouldUseSetNativePropsInNativeAnimationsInFabric":{"defaultValue":false,"metadata":{"dateAdded":"2024-03-05","description":"Enables use of setNativeProps in Native driven animations in Fabric.","purpose":"experimentation"}},"useInsertionEffectsForAnimations":{"defaultValue":false,"metadata":{"dateAdded":"2024-09-12","description":"Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`.","purpose":"experimentation"}},"useRefsForTextInputState":{"defaultValue":false,"metadata":{"dateAdded":"2024-07-08","description":"Enable a variant of TextInput that moves some state to refs to avoid unnecessary re-renders","purpose":"experimentation"}}}}
```

Reviewed By: mdvacca

Differential Revision: D64406244

fbshipit-source-id: 6f82da64d1212faf6d5a82862a71fbc1d168134b
2024-10-29 08:02:54 -07:00
Rubén Norte 66ffa5ee4d Small improvement in types for feature flags definitions in JS (#47239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47239

Changelog: [internal]

Small refactor of the types for feature flags in JS to make objects read-only.

Reviewed By: mdvacca

Differential Revision: D65058612

fbshipit-source-id: 0d72df2f4afebf0426b9ac76a8f8b195c74fea52
2024-10-29 08:02:54 -07:00
Rubén Norte 66df63d3b5 Generalize feature flags script (#47208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47208

Changelog: [internal]

Small change to unify the yarn commands for feature flags into a single `featureflags` command with options.

Reviewed By: NickGerleman, mdvacca

Differential Revision: D64982509

fbshipit-source-id: 3f9d7ac35f61950bd03fef243e1a95625144a0cd
2024-10-29 08:02:54 -07:00
Samuel Susla 63f8c3dcd6 batch sync events based on event beats second try (#47255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47255

changelog: [internal]

Batching sync events into a single JavaScript task. The batching mechanism uses EventBeat's induce method.

Reviewed By: javache

Differential Revision: D64930580

fbshipit-source-id: dd68444ae5679155bb360353eec9e38dceb604ce
2024-10-29 07:50:29 -07:00
Samuel Susla 741ae296d9 ship optimisation enableTextPreallocationOptimisation (#47257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47257

changelog: [internal]

Reviewed By: NickGerleman, rshest

Differential Revision: D65068406

fbshipit-source-id: 2e54e0e42e9d30f14c139ac039378d3cb4897067
2024-10-29 07:20:16 -07:00
Samuel Susla 21b99d9981 delete stale flag enableCleanTextInputYogaNode (#47256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47256

changelog: [internal]

no plans to ship this. Let's delete the feature flag for now.

Reviewed By: rshest

Differential Revision: D65068295

fbshipit-source-id: 0b68e331c54c4989e6227d3e40a3bade30aa49d1
2024-10-29 07:20:16 -07:00
Rubén Norte 5f45f8a71c Remove unused flags for Hermes VM (#47244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47244

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D65062303

fbshipit-source-id: 7372536643636b8a1923d9e1194ebca45f856e57
2024-10-29 06:20:13 -07:00
Pieter De Baets f503fe3f10 Reduce public API for DevToolsReactPerfLogger (#47275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47275

Changelog: [Android][Removed] DevToolsReactPerfLogger stats gathering now uses an internal API

Reviewed By: cortinico, fabriziocucci

Differential Revision: D65133420

fbshipit-source-id: 360e86b69b1e4ba757090ae3fb87fc82d49163e7
2024-10-29 05:19:02 -07:00
Parsa Nasirimehr c1e964aa1f fix(iOS): migrate from RCTSharedApplication() for RCTDeviceInfo's RCTIsIPhoneNotched method (#47220)
Summary:
Far as i can see it, this is the last direct reference to how we used to get windows before the introduction of scenes. Everything now uses the new Scenes system (potentially we could start adding a `RCTSceneDelegate` if we ever want to move in that direction)

I also threw in a nullability check. Theoretically, that shouldn't happen, but honestly, who knows what platform will come in the future, better safe than sorry. Let me know if you think i should remove it

## Changelog:

[INTERNAL] [FIXED] - Potentially Migrate the last `KeyWindow` usage to `RCTKeyWindow` instead of tapping to the `UIWindow` directly via RCTSharedApplication

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

Test Plan:
yarn test:
<img width="1784" alt="Screenshot 2024-10-26 at 23 48 22" src="https://github.com/user-attachments/assets/3c0c6b2b-6aa1-4e7a-b663-327a363e4de6">
iOS test: Sadly it seems like it is still broken on Xcode 16 on my machine. Will leave it up to the CI to test it. I can see that there are more that are potentially broken. Might try to take a look and see if i can fix it in another PR.
<img width="1840" alt="Screenshot 2024-10-26 at 23 53 47" src="https://github.com/user-attachments/assets/2e302aee-bc57-41fe-baf3-0292dc65485e">

Reviewed By: philIip

Differential Revision: D65057289

Pulled By: cipolleschi

fbshipit-source-id: a5b2e875e681120a54e57ede90d67e66e9376a56
2024-10-29 04:37:24 -07:00
Nick Gerleman 52cdedb40e Fix missing emitter attributes on iOS TextInput when controlled component value specified using value instead of children (#47269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47269

There were [reports](https://github.com/reactwg/react-native-releases/issues/595) that patching in the fixes for iOS controlled input did not work as expected.

I think tracked this down to a difference in how I tested, where the controlled component I used passed value as a child of the `TextInput`, instead of via `value`. Passing via `value` triggers a secondary bug, where we don't correctly pass a reference to correct ShadowView when creating attributedstring, specifically in the iOS TextInputShadowNode impl.

We previously passed nothing for the ShadowView (only the first two struct fields). This was exposed in D52589303 which enabled `-Wextra`, but there, I went with same behavior of passing empty ShadowView, instead of the correct behavior (like Android impl) of passing a ShadowView of the current ShadowNode.

After fixing this, we now correctly create event emitters in the passed attributedstring, which matches expectations for pargraph-level eventemitter now in typing attributes. We don't seem actually use this on iOS for TextInput right now (just Text), but this is likely the right foundation for events regardless.

Changelog:
[iOS][Fixed] - Fix missing emitter attributes on iOS TextInput when controlled component value specified using `value` instead of `children`

Reviewed By: cipolleschi

Differential Revision: D65108163

fbshipit-source-id: 499fe28439fabd2579eca6ded7fd13fd8ea2e43e
2024-10-29 03:43:10 -07:00
David Vacca 4076dbfc86 Convert ReactFeatureFlags to Kotlin (#47260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47260

Convert ReactFeatureFlags to Kotlin

changeLog: [Android][Changed] Migrate ReactFeatureFlags to Kotlin

Reviewed By: shwanton, javache

Differential Revision: D65070217

fbshipit-source-id: 8939326c1e1e7cd634347a58123ad8c0795c309e
2024-10-28 18:49:19 -07:00
David Vacca 03797dda03 Convert LongStreamingStats to Kotlin (#47261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47261

Convert LongStreamingStats to Kotlin

changeLog: [internal] internal

Reviewed By: javache

Differential Revision: D65070215

fbshipit-source-id: b4e3ca9152ea382e516d1b598401df6bf38135eb
2024-10-28 18:49:19 -07:00
David Vacca b5696e6172 Migrate PreAllocateViewMountItem to Kotlin (#47258)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47258

Migrate PreAllocateViewMountItem to Kotlin

changeLog: [internal] internal

Reviewed By: shwanton

Differential Revision: D65070220

fbshipit-source-id: 3785f36747ea54304e45234daf377d20381f3c6c
2024-10-28 18:49:19 -07:00
David Vacca 0705eb8b91 Assert FeatureFlags in Bridgeless initialization only on Debug mode (#47263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47263

Assert FeatureFlags in Bridgeless initialization only on Debug mode

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D65078365

fbshipit-source-id: 79a40ba84e140b9784660ac9d1c14fd0f7426653
2024-10-28 14:23:51 -07:00
Samuel Susla 92d743a9ab surface setup issues in EventBeat and Scheduler (#47253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47253

changelog: [internal]

Add assert statements to make sure EventBeat and Scheduler classes are correctly setup.

Scheduler must receive RuntimeScheduler through ContextContainer.
Callers of EventBeat must set beatCallback before calling request.

Reviewed By: javache

Differential Revision: D65001802

fbshipit-source-id: 5e044e1e6b0249bc89c11cccd51801add2e85b88
2024-10-28 13:17:43 -07:00
Eli White 3111473d57 Add test for native module returning enum (#47229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47229

Adding a test case for an enum value in a fromNative position

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D65038107

fbshipit-source-id: ed323d9a8b226be3ff571c86fda617cabc17cdb9
2024-10-28 12:03:33 -07:00
Zeya Peng b5b65275c6 move multiline and submitBehavior down to BaseTextInputProps (#47205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47205

move `multiline` and `submitBehavior` from ios and android respectively to BaseTextInputProps

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D64494449

fbshipit-source-id: ac737af27ba21ee886c92667f6c51945738bfc02
2024-10-28 10:17:02 -07:00
Zeya Peng db835e28d8 Make textInputProps.submitBehavior on android an enum type (#47206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47206

Share definition of `SubmitBehavior` enum on ios, and use it on android

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64718150

fbshipit-source-id: a078c9be44c625cc5e9001e4ae25d32eaaf5d8e4
2024-10-28 10:17:02 -07:00
Samuel Susla 8b9535f101 add missing breaks in PointerEvent (#47233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47233

changelog: [internal]

This looks like a missing break statement when it was refactored in https://github.com/facebook/react-native/pull/41519

Reviewed By: rubennorte

Differential Revision: D65040504

fbshipit-source-id: c4d52792099a5764d00c16708e400fa8a0046c93
2024-10-28 10:14:34 -07:00
Riccardo Cipolleschi e4e68db2bc Backport to main fixes in publishing the template (#47250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47250

This commit backports to main [#47116](https://github.com/facebook/react-native/pull/47116)

## Changelog
[Internal] - Backport fix to publishTemplate from 0.76 to main

Reviewed By: blakef

Differential Revision: D65066047

fbshipit-source-id: 2c8fcca8ea7b75495aa5ad1bd4e3f53379cb3246
2024-10-28 09:58:38 -07:00
Samuel Susla 9a5d3efb12 remove EventEmitter::toggleEventTargetOwnership_ (#47224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47224

changelog: [internal]

not used, let's remove it.

Reviewed By: rshest

Differential Revision: D65004362

fbshipit-source-id: 7cedf18bf1d685510da3512cf40628897b357bcf
2024-10-28 09:20:04 -07:00
Blake Friedman cf8250a79f verify template is published method (#47243)
Summary:
This step called an old reference, this function identifier was updated.

Changelog: [Internal]

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

Reviewed By: cipolleschi

Differential Revision: D65063054

Pulled By: blakef

fbshipit-source-id: 640a4c501818c9b83cebb27c89ba6efd82800be8
2024-10-28 08:15:35 -07:00
Pieter De Baets bd133b5dd5 Add featureflag to not re-order mount items in FabricMountingManager (#46702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46702

In https://github.com/facebook/react-native/pull/44188, we've started combining multiple transactions in a single transaction, to meet React's atomicity requirements, while also dealing with the constraints of Android's Fabric implementation.

This revealed a bug where in some scenarios (especially when using transitions), a node may be deleted and created during the same transaction. The current implementation of FabricMountingManager assumes it can safely reorder some operations, which it does to optimize the size of IntBufferBatch mount items. This is however incorrect and unsafe when multiple transactions are merged.

**Example:**

Differentiator output:

```
# Transaction 1
Remove #100 from #11
Delete #100

# Transaction 2
Create #100
Insert #100 into #11
```
FabricMountingManager output
```
Remove #100 from #11
Insert #100 into #11
Delete #100
```

Note that the create action is also skipped, because we only update `allocatedViewTags` after processing all mutations, leading FabricMountingManager to assume creation is not required.

This leads to an invalid state in SurfaceMountingManager, which will be surfaced as a crash in `getViewState` on the next mutation that interacts with these views.

Changelog: [Android][Fixed] Fix crash in getViewState when using suspense fallbacks.

Reviewed By: sammy-SC

Differential Revision: D63148523

fbshipit-source-id: 07ae26b2f7b7eba1b9784041dd3059b0956c035e
2024-10-28 06:18:43 -07:00
Samuel Susla dd432790b8 Use RuntimeScheduler in EventBeat 2nd try (#47196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47196

changelog: [internal]

EventBeat can use RuntimeScheduler directly, no need to go through RuntimeExecutor.

Reviewed By: christophpurrer

Differential Revision: D64927936

fbshipit-source-id: 9fb317d7c98da588d3438424ab9923dc0c0259c1
2024-10-28 05:50:15 -07:00
zhongwuzw e271b23fad Fixes regression of RCTWindowFrameDidChangeNotification not fired (#47236)
Summary:
Fixes https://github.com/facebook/react-native/issues/47234. regression from https://github.com/facebook/react-native/commit/391680fe844aad887e497912378c699aed13464b#diff-b7fda5d350ac535115fa683faa7317b43aa11f3448f95266ef9ff051c3753a6fL63

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixes regression of RCTWindowFrameDidChangeNotification not fired

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/47234.

Reviewed By: blakef

Differential Revision: D65058105

Pulled By: cipolleschi

fbshipit-source-id: 0e286182ed93f289cb853710e2e00801ef2d4f73
2024-10-28 05:23:52 -07:00
Riccardo Cipolleschi 4192678bd7 Pin Xcodeproj to < 1.26.0 (#47237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47237

The Xcodeproj gem has been released yesterday to version 1.26.0 and it broke the CI pipeline of react native.

This should fix the issue

## Changelog
[Internal] - Pin Xcodeproj gem to 1.26.0

Reviewed By: blakef

Differential Revision: D65057797

fbshipit-source-id: f4035a1d3c75dd4140eb1646ab2aa0ccb08fb16b
2024-10-28 04:20:31 -07:00
Pieter De Baets dc2000c875 Improve correctness of textTransform: capitalize (#47219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47219

We received reports that textTransform does not correctly match the web behaviour for capitalize, eg. capitalized characters should not be lowercased when using `capitalize`.

Example input: 'hello WORLD', should become 'Hello WORLD'.

Changelog: [General][Fixed] TextTransform: capitalize better reflects the web behaviour

Reviewed By: NickGerleman

Differential Revision: D65023821

fbshipit-source-id: 8ba5fdbd7afb1460193bf82a2f4021c3aff2110a
2024-10-26 17:57:26 -07:00
Jakub Piasecki 33e1ae13f8 Add tests for LayoutableChildren iterator
Summary:
Adds unit tests that directly cover the order in which `LayoutableChildren` iterator goes over the descendant nodes. The covered cases are as follows (nodes with `display: contents` are marked green):

### Single `display: contents` node

```mermaid
flowchart TD
R((R)) --> A((A))
R --> B((B))
R --> C((C))

B --> D((D))
B --> E((E))

style B fill:https://github.com/facebook/yoga/issues/090
```

Correct order: `A, D, E, C`

### Multiple `display: contents` nodes

```mermaid
flowchart TD
R((R)) --> A((A))
R --> B((B))
R --> C((C))

A --> D((D))
A --> E((E))

B --> F((F))
B --> G((G))

C --> H((H))
C --> I((I))

style A fill:https://github.com/facebook/yoga/issues/090
style B fill:https://github.com/facebook/yoga/issues/090
style C fill:https://github.com/facebook/yoga/issues/090
```

Correct order: `D, E, F, G, H, I`

### Nested `display: contents` nodes

```mermaid
flowchart TD
R((R)) --> A((A))
R --> B((B))
R --> C((C))

B --> D((D))
B --> E((E))

E --> F((F))
E --> G((G))

style B fill:https://github.com/facebook/yoga/issues/090
style E fill:https://github.com/facebook/yoga/issues/090
```

Correct order: `A, D, F, G, C`

### Leaf `display: contents` node

```mermaid
flowchart TD
R((R)) --> A((A))
R --> B((B))
R --> C((C))

style B fill:https://github.com/facebook/yoga/issues/090
```

Correct order: `A, C`

### Root `display: contents` node

```mermaid
flowchart TD
R((R)) --> A((A))
R --> B((B))
R --> C((C))

style R fill:https://github.com/facebook/yoga/issues/090
```

Correct order: `A, B, C` - `LayoutableChildren` goes over the children with `display: contents` property, setting it on the root node should have no effect.

Changelog: [Internal]

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

Reviewed By: joevilches

Differential Revision: D64981779

Pulled By: NickGerleman

fbshipit-source-id: ee39759c663a40f96ad313f1b775d53ab68fb442
2024-10-25 18:01:20 -07:00
Samuel Susla db09e7c2e5 delete shouldYield from commit options (#47191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47191

changelog: [internal]

not used, let's delete it.

Reviewed By: javache, rubennorte

Differential Revision: D64916432

fbshipit-source-id: 182848c85ca58d4e8fae3c6ab67c781807803dff
2024-10-25 17:41:06 -07:00
Jakub Piasecki a88ddcecc9 Fix for nodes with display: contents not being cleaned in some cases (#47194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47194

Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called.

The problem here wasn't mutating before cloning, but leaving a node marked as dirty after the layout has finished.

The exact case in which I found this was a node with a single `display: contents` child which needs to be a leaf. Then in the parent node [this](https://github.com/facebook/yoga/blob/b0b842d5e75d041e3af7e0ac55abfb8929fbbf21/yoga/algorithm/CalculateLayout.cpp#L1339) condition is true, so `cleanupContentsNodesRecursively` doesn't get called and the child node is never visited and cleaned. I assume the same will happen in the other paths with an early return here.

Changelog:
[General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases

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

Reviewed By: rozele

Differential Revision: D64910099

Pulled By: NickGerleman

fbshipit-source-id: 6d56f8fbf687b7ee5af889c0b868406213c9cee8
2024-10-25 17:34:36 -07:00
Ramanpreet Nara 4f47439a02 cleanup: ExceptionsManager: Delete updateExceptionMessage (#47167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47167

I couldn't find any usages of this method in javascript.

Removing, so that the native code is easier to read.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64606928

fbshipit-source-id: 1d52d58437370ae3d99e9c44500080687f137191
2024-10-25 15:12:40 -07:00
Ramanpreet Nara f8788963b9 cleanup: ExceptionsManager: Delete reportUnhandledException (#47166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47166

This method wasn't used from javascript.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64607415

fbshipit-source-id: 2fb7eeee9479de85284d05629ed8e1bfb9fa5917
2024-10-25 15:12:40 -07:00
Ramanpreet Nara 0941b51e9d earlyjs: Make ExceptionsManager the js interface for c++ pipeline (#47165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47165

The c++ pipeline needs a javascript interface.

We could just re-use exceptions manager (for now).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64779068

fbshipit-source-id: 4e300668a01fa22e194ea9f149ef1d936d5e0834
2024-10-25 15:12:40 -07:00
Ramanpreet Nara 2247e0b983 earlyjs: Make JsErrorHandler work for all js throwables
Summary:
Now, handleError can be called with a JSError that wraps a non-error object!

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64706198

fbshipit-source-id: 562ed7d4e2a13eaef48acfdf3499296462e54166
2024-10-25 15:12:40 -07:00
Samuel Susla 3fff4cf966 delete MountingCoordinator::Shared typealias (#47207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47207

changelog: [internal]

delete typealias `MountingCoordinator::Shared` and use `std::shared_ptr<const MountingCoordinator>` directly.

Reviewed By: christophpurrer

Differential Revision: D64917023

fbshipit-source-id: 586ffcd5d22ea48b22d8a6cf86aa5fdf87fdefd0
2024-10-25 12:51:57 -07:00
David Vacca eddc0a1d49 Delete CoreFeatures class (#45626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45626

I'm deleting CoreFeatures class and all its imports because it was fully replaced by ReactNativeFeatureFlags

Changelog: [Internal][Removed] Delete CoreFeatures class in favor of ReactNativeFeatureFlags

Reviewed By: rubennorte

Differential Revision: D60137380

fbshipit-source-id: 8bf918cdd1ce66e315aa95e1c5a28879445ff9f9
2024-10-25 08:32:20 -07:00
David Vacca a01e2e4165 Delete CoreFeatures::excludeYogaFromRawProps (#45627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45627

I'm deleting CoreFeatures::excludeYogaFromRawProps in favor of ReactNativeFeatureFlags::excludeYogaFromRawProps();

changelog: [internal] internal

Reviewed By: rubennorte

Differential Revision: D60124448

fbshipit-source-id: 1dfec40d638c4051ebfebe712abe0bee6764e584
2024-10-25 08:32:20 -07:00
David Vacca 26278b10b1 Migrate enableCppPropsIteratorSetter to ReactNativeFeatureFlags (#45602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45602

Migrate enableCppPropsIteratorSetter to ReactNativeFeatureFlags

Changelog: [Internal] internal

Reviewed By: rubennorte

Differential Revision: D60022936

fbshipit-source-id: 88fe6f41af3dea0ac5de4a097901a7e8df39efb2
2024-10-25 08:32:20 -07:00
David Vacca 143b9d172c Expose JSBundleLoader as parameter of DefaultReactHost (#47179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47179

In this diff I'm exposing the new parameter (JSBundleLoader) as parameter of DefaultReactHost.

changelog: [Android][Breaking] Added JSBundleLoader as parameter of DefaultReactHost

Reviewed By: cortinico

Differential Revision: D64381501

fbshipit-source-id: dd0d56441802f7db53c67c659bbcae63c4b1b613
2024-10-25 02:08:32 -07:00
David Vacca 80f846948a Remove unused dependencies from facebook/react/interfaces (#47115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47115

Remove unused dependencies from facebook/react/interfaces

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D64585748

fbshipit-source-id: fd42b63dd25cb4b6d4d7bb4f05912cff3f167db8
2024-10-25 02:08:32 -07:00
David Vacca 2cb5198f1b Delete CompositeReactPackage from RN (#47128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47128

Delete CompositeReactPackage from RN, these classes were deprecated for a long time and they can be deleted now, there are no internal usages

changelog: [Android][Breaking] Deleting deprecated CompositeReactPackage

Reviewed By: cortinico

Differential Revision: D64382211

fbshipit-source-id: d4fdfd51177612a64dde918cd68d6e852ef1b0e2
2024-10-25 02:08:32 -07:00
Parsa Nasirimehr 795a21a471 fix(iOS): migrate from depracated websocket method in RCTCxxInspectorWebSocketAdapter (#47197)
Summary:
Saw this while going through the remaining warnings of the project. I double checked, and i can't find any other usages left behind, so this is probably the last one

## Changelog:

[INTERNAL] [FIXED] - Switch to using the new sendString method for Websocket

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

Test Plan:
yarn test:
<img width="933" alt="Screenshot 2024-10-25 at 00 55 58" src="https://github.com/user-attachments/assets/dbfebb90-4957-4fc9-8a90-153c03055ac9">
Running the tests in Xcode with `CMD+U` or the objc-test: I could not get it to pass in either the old code or the modified code. I know the test documentation said it needs a WebSocket, but it was a bit too vague , and even turning metro on did not help, so i have no idea how to test it. If anyone can guide me on that one, please let me know

Reviewed By: blakef

Differential Revision: D64934981

Pulled By: cipolleschi

fbshipit-source-id: c6f13d3da5aafe3eed8b99b98f04904fcdcc4115
2024-10-24 23:49:13 -07:00
Blake Friedman 94fdc38822 fix: mitigate DangerJS transpilation bug (#47192)
Summary:
Danger seems to have a bug where it's not transpiling the import of
rnx-kit/rn-changelog-generator. This mitigates the issue to get our
project back on track.

This can be replicated locally by:

```bash
DEBUG="*" DANGER_GITHUB_API_TOKEN=$GITHUB_TOKEN yarn danger pr https://github.com/facebook/react-native/pull/47182
```
You can see it running correctly here when switching to the branch with the fix.  **I'm a little concerned that this is still failing on the PR**.  Thoughts?

 {F1946190275}

Changelog: [internal]

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

Reviewed By: cortinico

Differential Revision: D64924466

Pulled By: blakef

fbshipit-source-id: 68df0521620809effe3a78ce842e043382ad64a6
2024-10-24 20:07:20 -07:00
Riccardo Cipolleschi e851e73c18 Add yoga to app search paths (#47195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47195

When a user wants to create a Fabric Component i their app (not in a separate library) the app fails to build because:
- The custom component has to inherit from `RCTViewComponentView`
- `RCTViewComponentView` imports `ViewProps.h`
- `ViewProps.h` imports `HostPlatformViewProps.h`
- `HostPlatformViewProps.h` imports `BaseViewProps.h`
- `BaseViewProps.h` imports `YogaStylableProps.h`

which is a Yoga private header and the App has not visibility over it.

It is also not possible to fix this issue with forward declaring the `YogaStylableProps`, because `BaseViewProps` inherit from the yoga's props, so the compiler needs the full declaration of `YogaStylableProps` to work

This needs to be picked in 0.76

## Changelog
[iOS][Fixed] - Give apps access to Yoga headers

Reviewed By: blakef

Differential Revision: D64925222

fbshipit-source-id: e724076bbfb0a678948340dfab2ce609e6509533
2024-10-24 17:16:50 -07:00
Sunny Luo d293fdd27a 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-24 14:59:21 -07:00
David Vacca 70c7616535 Make ReactHost.createSurface() method non nullable (#47189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47189

ReactHost.createSurface() should not return a nullable surface, I'm changing that here.

changelog: [Android][Breaking] Make ReactHost.createSurface() method non nullable

Reviewed By: tdn120

Differential Revision: D64910107

fbshipit-source-id: ce8c5efd2c1e36eba0a85ae89cd1cd2a6305e885
2024-10-24 13:04:23 -07:00
Thomas Nardone d825a4d712 Add OnLayoutChange API for scroll views (#47177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47177

Changelog: [Android][Added] Add OnLayoutChange API for scroll views

Reviewed By: lyahdav, mdvacca

Differential Revision: D64843826

fbshipit-source-id: 3161730ccd0b3816d1704d07a02714a2ff04ae3a
2024-10-24 11:05:38 -07:00
Alan Lee ba061a5d18 Bump NDK to 27.1 (#46357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46357

Bumping NDK to 27.1.12297006 as we need it to build native libraries with 16KB page size support.

See:
- Changelog r27: https://github.com/android/ndk/wiki/Changelog-r27
- 16KB page sizes: https://developer.android.com/guide/practices/page-sizes

Changelog:
[Android] [Changed] - Android NDK to 27.1

Reviewed By: cortinico

Differential Revision: D62278654

fbshipit-source-id: 9968a45d9f41031571dfa1bb1671d6ad71d0644d
2024-10-24 10:58:09 -07:00
Alan Lee 37375d8aba bump Folly to 2024.10.14.00 (#47033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47033

Lastest Folly has updates to fix build errors with LLVM 19 which is also llikely needed for NDK 27

- https://github.com/facebook/folly/commit/bf46c8a21ffa288d756cea2ad455b5f012c3231f

- also add folly's new dependency fast_float
- update fmt version

Changelog:
[General][Changed] - Bump Folly to 2024.10.14.00

Reviewed By: NickGerleman

Differential Revision: D64372125

fbshipit-source-id: 1a88f1bc2af7bedce96437f2dba5b6e0fe9ea772
2024-10-24 10:10:19 -07:00
Riccardo Cipolleschi dc7e9e2d83 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-24 09:36:07 -07:00
Sam Zhou ad341e3969 Add as const cast and make types readonly to prepare for natural inference (#47184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47184

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64859497

fbshipit-source-id: 2cff5e2671e210a4e8cefb5a2d8c0fb56d5a0d1b
2024-10-23 23:32:37 -07:00
David Vacca 5e21232717 Assert enableBridgelessArchitecture is true when starting Bridgeless (#47145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47145

Staring Bridgeless without previously setting ReactNativeFeatureFlags.enableBridgelessArchitecture() is UB, we should assert enableBridgelessArchitecture is true when starting Bridgeless

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D64641081

fbshipit-source-id: d7964f8a9d5a2e6dad9d44b8fd5cd5a52d1b2cf4
2024-10-23 22:53:44 -07:00
Cody Pizzaia 2d97a6ccb0 Revert D64631346: Use RuntimeScheduler in EventBeat
Differential Revision:
D64631346

Original commit changeset: b82dca150c13

Original Phabricator Diff: D64631346

fbshipit-source-id: 89ef52e5891d9fef33494fbfcc4252cade4aa803
2024-10-23 19:50:46 -07:00
Cody Pizzaia 020e1b6e86 Revert D64287526: batch sync events based on event beats
Differential Revision:
D64287526

Original commit changeset: a5dc3b643ef1

Original Phabricator Diff: D64287526

fbshipit-source-id: 9c967bd2573dc69bfbde69a7a79046e9d58fcb21
2024-10-23 19:44:14 -07:00
Phillip Pan 538bff710f clean up RCTTurboModuleInteropForAllTurboModulesEnabled (#47148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47148

Changelog: [iOS][Breaking]

This param was used to validate that the TurboModule interop layer could handle scale. Let's clean it up.

the only callsites are in forks: https://github.com/search?q=RCTEnableTurboModuleInteropForAllTurboModules&type=code&p=3, so this should be safe to delete.

Reviewed By: realsoelynn

Differential Revision: D64718453

fbshipit-source-id: 8bc6c1943a231389c74fd0114dfb7c54dd6c8614
2024-10-23 13:33:47 -07:00
Liron Yahdav 15eadbee14 batch sync events based on event beats (#47147)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47147

By batching sync events if multiple events are dispatched during sync rendering this will reduce the number of re-renders.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D64287526

fbshipit-source-id: a5dc3b643ef1853bef9e38ce8c2f5db75e02214b
2024-10-23 13:15:45 -07:00
Liron Yahdav 22b60c576b Use RuntimeScheduler in EventBeat (#47146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47146

This will allows us to batch sync events which leads to better performance.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D64631346

fbshipit-source-id: b82dca150c13bdb7acae6bedb392a93993273988
2024-10-23 13:15:45 -07:00
Ruslan Lesiutin 6098f24dfc Update debugger-frontend from 117c96a...ff343d8 (#47178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47178

Changelog: [Internal] - Update `react-native/debugger-frontend` from 117c96a...ff343d8

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

Reviewed By: huntie

Differential Revision: D64840904

fbshipit-source-id: 00e6e92e24eee545139845a4a9e4847d0185aab6
2024-10-23 11:31:12 -07:00
Riccardo Cipolleschi 2861ad0c72 Changelog for 0.76.0 (#47118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47118

This change refactors the changelog for version 0.76.0

## Changelog
[Internal] - changelog for 0.76 stable

Reviewed By: cortinico

Differential Revision: D64596098

fbshipit-source-id: a4b3c2dc1438607d10781245a3bd53483f01a9f6
2024-10-23 10:37:58 -07:00
Sam Zhou aadb1d9eb1 Eliminate final few React$AbstractComponent (#47163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47163

In order to adopt react 19's ref-as-prop model, we need to eliminate all the places where they are treated differently. `React.AbstractComponent` is the worst example of this, and we need to eliminate it.

This diff replaces final few in libdefs.

Changelog: [internal]

Reviewed By: alexmckenley

Differential Revision: D64776942

fbshipit-source-id: 5e96c6d4fecb1b6cf539a00aecb10b9b35fc140b
2024-10-22 16:10:54 -07:00
Nick Gerleman 7715a95895 Add more lineHeight examples (#47162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47162

Add some more interesting cases in prepration for screenshot testing

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64775710

fbshipit-source-id: 70b390ad944841044e0d5004bddd1a8d3cfc6cbf
2024-10-22 15:49:49 -07:00
Ruslan Lesiutin 3dfe22bd27 fix[Runtime.evaluate]: registered RuntimeExecutor should go through RuntimeScheduler (#47119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47119

# Changelog:
[General] [Fixed] - Microtasks are now correctly executed after the code evaluation in Console panel of DevTools.

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

`runtimeExecutor` which is propagated here, is actually being used by Hermes:
https://www.internalfb.com/code/fbsource/[cba75f2b515a]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp?lines=112-113

The issue was that any expression that should be evaluated as part of `Runtime.evaluate` was not going through `RuntimeScheduler`, because specified `runtimeExecutor` was not going through it as well, and it was defined prior to `RuntimeScheduler`. Because of this, `RuntimeScheduler` was not draining out the microtasks queue and basically any scheduled Microtasks were not executed, see T200616136.

With this fix, we create an executor that goes through `RuntimeScheduler`, which is using another executor that makes sure that all scheduled callbacks are only executed after `Inspector` was setup.

It is extremely messy and in the future we should untangle these circular dependencies and try to simplify the approach.

Reviewed By: rubennorte

Differential Revision: D64552372

fbshipit-source-id: 467d37c71a2eb7c940297ce90ca8d68268b1ff33
2024-10-21 22:10:28 -07:00
Jorge Cabiedes Acosta cc23aea2fc Enable new **Border** and **Background** drawables on BackgroundStyleApplicator (#47124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47124

With this we start the experiment to analyze the effect of the new `BackgroundDrawable.kt` and `BorderDrawable.kt` classes. This is also essentially a kotlinification of `CSSBackgroundDrawable`

We also start using CompositeBackgroundDrawable as the source of truth for **borderRadius** and **borderInsets**

We are hoping to get neutral results and a general win for code readability.

In general when the FeatureFlag passes we should not generate a CSSBackgroundDrawable at all and just use BackgroundDrawable and BorderDrawable

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63287222

fbshipit-source-id: 7ca98290c2e152b22d09b838e5f0e1cac97b1268
2024-10-21 21:24:19 -07:00
Jorge Cabiedes Acosta b3d5b793a4 Add BorderDrawable to replace border logic on CSSBackgroundDrawable (#46745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46745

**Note:** This diff still does nothing yet, it will be enabled on a diff further up the stack. This split is just to simplify reviewing

`CSSBackgroundDrawable` holds the drawing logic for both **Borders** and **Background**. This is not ideal since it results in a huge file which does 2 things.

We now have `CompositeBackgroundDrawable` which allows us to set a different drawable per "layer" on our view.

By splitting up **Border** and **Background** logic we get better modularity and it'll make it easier to implement more `backgroundImage` features without further bloating the `CSSBackgroundDrawable` file

Also, this helps with the kotlinification efforts

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62898246

fbshipit-source-id: 15d1a4ef61f0c757e648c002fc7ef26626d8e3f6
2024-10-21 21:24:19 -07:00
Jorge Cabiedes Acosta f41c59da96 Add BackgroundDrawable to replace background logic on CSSBackgroundDrawable (#46709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46709

**Note:** This diff still does nothing yet, it will be enabled on a diff further up the stack. This split is just to simplify reviewing

`CSSBackgroundDrawable` holds the drawing logic for both **Borders** and **Background**. This is not ideal since it results in a huge file which does 2 things.

We now have `CompositeBackgroundDrawable` which allows us to set a different drawable per "layer" on our view.

By splitting up **Border** and **Background** logic we get better modularity and it'll make it easier to implement more `backgroundImage` features without further bloating the `CSSBackgroundDrawable` file

Also, this helps  with the kotlinification efforts

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63137921

fbshipit-source-id: fc459beadfda1832e146e36d74c3d424a28ca905
2024-10-21 21:24:19 -07:00
SamChou19815 (Meta Employee) 6205aad81e Eliminate usage of more than 1-arg React.AbstractComponent in React codebase (#31314)
Summary:
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

In order to adopt react 19's ref-as-prop model, Flow needs to eliminate
all the places where they are treated differently.
`React.AbstractComponent` is the worst example of this, and we need to
eliminate it.

This PR eliminates them from the react repo, and only keeps the one that
has 1 argument of props.

## How did you test this change?

yarn flow

DiffTrain build for [45804af18d589fd2c181f3b020f07661c46b73ea](https://github.com/facebook/react/commit/45804af18d589fd2c181f3b020f07661c46b73ea)

Reviewed By: jbrown215

Differential Revision: D64725736

Pulled By: SamChou19815

fbshipit-source-id: c9f6f316c95d12a9ae98926faba111395b550ccf
2024-10-21 19:52:01 -07:00
Panos Vekris 363818ea20 pre-suppress errors before enabling experimental.object_freeze_fix (#47141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47141

D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6). This diff suppresses Flow errors that appear when this fix is enabled (`experimental.object_freeze_fix` flag is set).

For most of these cases the result of `Object.freeze()` is assigned to some variable typed as a mutable type. The variable is then passed to a context where its fields can be written to. Thus changing the annotation type to a readonly version would only cause more errors downstream. So, instead, these assignments are suppressed so that the choice of using Object.freeze can be revisited.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D64699992

fbshipit-source-id: 48e4376d4ed3dbda21d32cabe512e6457384994f
2024-10-21 19:26:02 -07:00
Panos Vekris d25f0c5edd prepare for fix in Object.freeze typing [2/n] (#47131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47131

D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6)

This diff prevents Flow errors from appearing when `experimental.object_freeze_fix` flag is set.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D64641920

fbshipit-source-id: b6de954d3474f5c4c2e2a58f69cf8cff61be53e5
2024-10-21 19:26:02 -07:00
Sam Zhou 036e4f64c4 Eliminate 2 more remaining React.AbstractComponent<...> in react native
Summary:
In order to adopt react 19's ref-as-prop model, we need to eliminate all the places where they are treated differently. `React.AbstractComponent` is the worst example of this, and we need to eliminate it.

This diff replaces 2 more remaining ones in react-native. Now the only remaining one is the one synced from react repo.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D64722899

fbshipit-source-id: 2b2484c385fc5d6c173253f9bee66dfc736368a5
2024-10-21 19:10:42 -07:00
Sam Zhou 71e9039e9f Prepare typing changes for HostComponent (#47150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47150

In https://github.com/facebook/react/pull/31314, I will change the host component type that will be synced to react-native. Notably, it will expose the issue where all the `HostComponent<mixed>` types are wrong, since it doesn't make sense to write `React.AbstractComponent<mixed>`. This diff fixes the existing usages first in prep for that typing change.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D64722939

fbshipit-source-id: 14e1477090128205d8be8fc7b135a8478f94b790
2024-10-21 18:15:34 -07:00
Eli White 4c37431c7f Support new codegen schema for native modules (#47114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47114

Export the EventEmitter annotation from the codegen

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D63995813

fbshipit-source-id: 0211c21d7813da03bf8b6680095e016a621c188b
2024-10-21 16:43:49 -07:00
David Vacca e10c07d5ae Rollout enableDeletionOfUnmountedViews in OSS and NewArchitecture apps (#47144)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47144

I'm fully rolling out enableDeletionOfUnmountedViews in OSS

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D64613764

fbshipit-source-id: 6dfecb9fe143ec59ddb71b614f12563a564578fc
2024-10-21 16:39:40 -07:00
Sam Zhou 723a37cb26 Replace most of the remaining React.AbstractComponent in react-native (#47143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47143

In order to adopt react 19's ref-as-prop model, we need to eliminate all the places where they are treated differently. `React.AbstractComponent` is the worst example of this, and we need to eliminate it.

This diff replaces most of the remaining `React.AbstractComponent` in react-native.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D64701145

fbshipit-source-id: c765674fdf59812895c4fae43df97cf8b9d24f05
2024-10-21 15:48:25 -07:00
Nicola Corti dbf09fbe58 Stable API - Make AppStateModule internal (#47121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47121

This class should be internal. I've verified this API is not used in OSS so this is technically breaking but not really affecting anyone in OSS.

Changelog:
[Android] [Breaking] - Stable API - Make AppStateModule internal

Reviewed By: Abbondanzo

Differential Revision: D64598660

fbshipit-source-id: aebc385c741e2e1f352d473db2be87d918f0ef65
2024-10-21 15:34:50 -07:00
David Vacca 1aaedc7fca Turnon enableEventEmitterRetentionDuringGesturesOnAndroid for all apps depending on ReactNativeNewArchitectureFeatureFlagsDefaults (#47142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47142

I'm turning on enableEventEmitterRetentionDuringGesturesOnAndroid for all apps depending on ReactNativeNewArchitectureFeatureFlagsDefaults

Reviewed By: cortinico

Differential Revision: D64610897

fbshipit-source-id: c301f616918484ed41790247d1e0cd7284602b09
2024-10-21 13:57:09 -07:00
Mateo Guzmán d784d95568 docs(rn-tester): adding extra instructions to disable fabric (#47127)
Summary:
While working on https://github.com/facebook/react-native/pull/47110, I wanted to disable fabric in the `rn-tester` to test some things in Paper. I followed all the steps but ended up deleting the whole repository locally, cloning it again and explicitly installing the pods `fabric_enabled` in all steps and it didn't work. I ended up disabling the new architecture by passing `RCT_NEW_ARCH_ENABLED=0` and then it worked immediately.

Wanted to add this extra hint as it might help other contributors.

## Changelog:

[INTERNAL] [ADDED] - extra instructions to disable fabric in the `rn-tester` package

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

Test Plan: Follow the instructions to disable fabric, try passing `RCT_NEW_ARCH_ENABLED=0` if `fabric_enabled = false` is not enough.

Reviewed By: cortinico

Differential Revision: D64652149

Pulled By: rshest

fbshipit-source-id: 0fc4149832a7973c57161b4fff5815414f304a3c
2024-10-21 09:18:25 -07:00
Parsa Nasirimehr 5697d923a0 fix(Android) - remove some unused imports in canvas utils (#47132)
Summary:
Was working on something, saw that CanvasUtils has some unused imports. Figured i'd send a PR to clean up.

## Changelog:

[INTERNAL] [FIXED] - Cleanup CanvasUtils imports

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

Test Plan:
Ran yarn test:

<img width="513" alt="Screenshot 2024-10-19 at 22 54 13" src="https://github.com/user-attachments/assets/6ca86852-cab5-425a-b71c-785c7d1ea95e">

Also tried running ./gradlew test, but it appears it is not having fun with my Node version (18.20.3), so `createBundleHermesReleaseJsAndAssets` randomly fails, to be investigated why:

<img width="1515" alt="Screenshot 2024-10-19 at 22 56 02" src="https://github.com/user-attachments/assets/f860cdc5-4f42-4d54-9497-7eaa028b6bc6">

Reviewed By: NickGerleman

Differential Revision: D64663918

Pulled By: cortinico

fbshipit-source-id: a681d6ee76dfcbc56889e76da6cf8ea11907bdf2
2024-10-20 18:28:11 -07:00
Jakub Piasecki e7a3f479fe Add support for display: contents (#46584)
Summary:
This PR adds support for `display: contents` style by effectively skipping nodes with `display: contents` set during layout.

This required changes in the logic related to children traversal - before this PR a node would be always laid out in the context of its direct parent. After this PR that assumption is no longer true - `display: contents` allows nodes to be skipped, i.e.:

```html
<div id="node1">
  <div id="node2" style="display: contents;">
    <div id="node3" />
  </div>
</div>
```

`node3` will be laid out as if it were a child of `node1`.

Because of this, iterating over direct children of a node is no longer correct to achieve the correct layout. This PR introduces `LayoutableChildren::Iterator` which can traverse the subtree of a given node in a way that nodes with `display: contents` are replaced with their concrete children.

A tree like this:
```mermaid
flowchart TD
    A((A))
    B((B))
    C((C))
    D((D))
    E((E))
    F((F))
    G((G))
    H((H))
    I((I))
    J((J))

    A --> B
    A --> C
    B --> D
    B --> E
    C --> F
    D --> G
    F --> H
    G --> I
    H --> J

    style B fill:https://github.com/facebook/react-native/issues/050
    style C fill:https://github.com/facebook/react-native/issues/050
    style D fill:https://github.com/facebook/react-native/issues/050
    style H fill:https://github.com/facebook/react-native/issues/050
    style I fill:https://github.com/facebook/react-native/issues/050
```

would be laid out as if the green nodes (ones with `display: contents`) did not exist. It also changes the logic where children were accessed by index to use the iterator instead as random access would be non-trivial to implement and it's not really necessary - the iteration was always sequential and indices were only used as boundaries.

There's one place where knowledge of layoutable children is required to calculate the gap. An optimization for this is for a node to keep a counter of how many `display: contents` nodes are its children. If there are none, a short path of just returning the size of the children vector can be taken, otherwise it needs to iterate over layoutable children and count them, since the structure may be complex.

One more major change this PR introduces is `cleanupContentsNodesRecursively`. Since nodes with `display: contents` would be entirely skipped during the layout pass, they would keep previous metrics, would be kept as dirty, and, in the case of nested `contents` nodes, would not be cloned, breaking `doesOwn` relation. All of this is handled in the new method which clones `contents` nodes recursively, sets empty layout, and marks them as clean and having a new layout so that it can be used on the React Native side.

Relies on https://github.com/facebook/yoga/pull/1725

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

This PR adds a few things over the corresponding one in Yoga:
- new value in the `DisplayType` enum - `Contents`
- new `ShadowNodeTrait` - `ForceFlattenView`, that forces the node not to form a host view
- updates TS types to include `display: contents`
- aliases `display: contents` to `display: none` on the old architecture

## Changelog:

[GENERAL] [ADDED] - Added support for `display: contents`

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

Test Plan:
<details>
<summary>So far I've been testing on relatively simple snippets like this one and on entirety of RNTester by inserting views with `display: contents` in random places and seeing if anything breaks.</summary>

```jsx
import React from 'react';
import { Button, Pressable, SafeAreaView, ScrollView, TextInput, View, Text } from 'react-native';

export default function App() {
  const [toggle, setToggle] = React.useState(false);
  return (
    <View style={{flex: 1, paddingTop: 100}}>
      <SafeAreaView style={{width: '100%', height: 200}}>
        <Pressable style={{width: 100, height: 100, backgroundColor: 'black'}} onPress={() => setToggle(!toggle)}>
          <ScrollView />
        </Pressable>
        <View style={{display: 'flex', flexDirection: 'row', flex: 1, backgroundColor: 'magenta'}}>
          <SafeAreaView style={{
            // display: 'contents',
            flex: 1,
            }}>
            <View style={{
              display: 'contents',
              width: '100%',
              height: 200,
              }}>
              <View style={{
                  display: 'contents',
                  flex: 1,
                }}>
                { toggle && <View style={{flex: 1, backgroundColor: 'yellow'}} /> }
                <View style={{flex: 1, backgroundColor: 'blue'}} />
                <View style={{flex: 1, backgroundColor: 'cyan'}} />
              </View>
            </View>
          </SafeAreaView>
        </View>
        {/* <View style={{width: 100, height: 100, backgroundColor: 'magenta', display: 'flex'}} /> */}
        <TextInput style={{width: 200, height: 100, backgroundColor: 'red', display: 'flex'}}>
          <Text style={{color: 'white'}}>Hello</Text>
          <Text style={{color: 'green'}}>World</Text>
        </TextInput>
      </SafeAreaView>
    </View>
  );
}
```

</details>

Reviewed By: joevilches

Differential Revision: D64584476

Pulled By: NickGerleman

fbshipit-source-id: bec77b5087ff95f0980cf02274fbb2c8581eb3c0
2024-10-18 22:05:41 -07:00
Jakub Piasecki e5296cfc81 Add support for display: contents style (#47035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47035

This PR adds support for `display: contents` style by effectively skipping nodes with `display: contents` set during layout.

This required changes in the logic related to children traversal - before this PR a node would be always laid out in the context of its direct parent. After this PR that assumption is no longer true - `display: contents` allows nodes to be skipped, i.e.:

```html
<div id="node1">
  <div id="node2" style="display: contents;">
    <div id="node3" />
  </div>
</div>
```

`node3` will be laid out as if it were a child of `node1`.

Because of this, iterating over direct children of a node is no longer correct to achieve the correct layout. This PR introduces `LayoutableChildren::Iterator` which can traverse the subtree of a given node in a way that nodes with `display: contents` are replaced with their concrete children.

A tree like this:
```mermaid
flowchart TD
    A((A))
    B((B))
    C((C))
    D((D))
    E((E))
    F((F))
    G((G))
    H((H))
    I((I))
    J((J))

    A --> B
    A --> C
    B --> D
    B --> E
    C --> F
    D --> G
    F --> H
    G --> I
    H --> J

    style B fill:https://github.com/facebook/yoga/issues/050
    style C fill:https://github.com/facebook/yoga/issues/050
    style D fill:https://github.com/facebook/yoga/issues/050
    style H fill:https://github.com/facebook/yoga/issues/050
    style I fill:https://github.com/facebook/yoga/issues/050
```

would be laid out as if the green nodes (ones with `display: contents`) did not exist. It also changes the logic where children were accessed by index to use the iterator instead as random access would be non-trivial to implement and it's not really necessary - the iteration was always sequential and indices were only used as boundaries.

There's one place where knowledge of layoutable children is required to calculate the gap. An optimization for this is for a node to keep a counter of how many `display: contents` nodes are its children. If there are none, a short path of just returning the size of the children vector can be taken, otherwise it needs to iterate over layoutable children and count them, since the structure may be complex.

One more major change this PR introduces is `cleanupContentsNodesRecursively`. Since nodes with `display: contents` would be entirely skipped during the layout pass, they would keep previous metrics, would be kept as dirty, and, in the case of nested `contents` nodes, would not be cloned, breaking `doesOwn` relation. All of this is handled in the new method which clones `contents` nodes recursively, sets empty layout, and marks them as clean and having a new layout so that it can be used on the React Native side.

Relies on https://github.com/facebook/yoga/pull/1725

Changelog: [Internal]

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

Test Plan: Added tests for `display: contents` based on existing tests for `display: none` and ensured that all the tests were passing.

Reviewed By: joevilches

Differential Revision: D64404340

Pulled By: NickGerleman

fbshipit-source-id: f6f6e9a6fad82873f18c8a0ead58aad897df5d09
2024-10-18 22:05:41 -07:00
Fabrizio Cucci f3e37e29e2 Back out "Account for diffrent frame size when using maintainVisibleContentPosition in virtualized lists" (#47125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47125

Original commit changeset: 9f05a461d178

Original Phabricator Diff: D64238887

Changelog: [Internal]

NOTE: while this seems to work on IGVR it breaks on the two use cases highlighted in D64339251, backing out the diff while trying to find out a solution that works on all cases!

Reviewed By: Abbondanzo

Differential Revision: D64611594

fbshipit-source-id: b43353b17448c181a76b2af09968cf0e4934c53c
2024-10-18 13:49:46 -07:00
Fabrizio Cucci 16ceb6f74c Add maintainVisibleContentPosition example in rn-tester (#47126)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47126

This will be used to validate the fix to `maintainVisibleContentPosition` for the two major use cases when the FlatList resizes:
* when the items have fixed size
* when the items scale with the size of the list

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D64339251

fbshipit-source-id: d0ee8d73cd9e6527a7ce0950e8f3941337b70474
2024-10-18 13:48:52 -07:00
David Vacca 1cc648feca Interrupt thread before throwing in BridgelessDevSupportManager (#47100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47100

We should interrupt thread before throwing

changelog: [internal] internal

Reviewed By: bvanderhoof, arushikesarwani94

Differential Revision: D64545258

fbshipit-source-id: dec90ca2e75b8f3bceb258edbb525372065962ee
2024-10-18 11:13:40 -07:00
Alex Hunt 6f421230c1 Drop appId from /open-debugger calls, disable matching for modern targets (#47120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47120

Fixes no-op behaviour of the "Open DevTools" Dev Menu item (bug on `main` introduced with D63329456).

This was caused by a change to the `description` field contents in our CDP `/json/list` response, when under Fusebox. In the `/open-debugger` call from the Dev Menu, we were still using the older `appId` param.

This did not affect `j` to debug, which uses the `target` param.

{F1937186832}

Changes:

In short: Matching against the `description` string is now fully eliminated for modern debugger targets.

- Update native Dev Menu implementation to omit `appId` parameter (`device` param alone is sufficient and fully precise on these platforms).
- Update `/open-debugger` implementation to ignore the `appId` parameter for modern targets, and document this in the `dev-middleware` README.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D64597581

fbshipit-source-id: 46f536e7d0a4ececab0d52f4c0704e8698466cd0
2024-10-18 11:02:51 -07:00
Nicola Corti dc1a498d39 Undo breaking change on UIManager eventDispatcher accessor (#47088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47088

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

fbshipit-source-id: c4f9a36993a22839fae90fb239f883305422ecec
2024-10-18 08:33:25 -07:00
Samuel Susla 5c6edc6861 add comment to EventBeat clarifying its use (#47065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47065

changelog: [internal]

Just a comment explaining intended use.

Reviewed By: tdn120

Differential Revision: D64469189

fbshipit-source-id: 65cb0c5ea4669f748abe1e78fd25816e895c3f58
2024-10-18 05:47:47 -07:00
shubhamguptadream11 45b177f50d fix: height and width added back in props (#47044)
Summary:
Fixes this: https://github.com/facebook/react-native/issues/41151

## Changelog:

[GENERAL] [FIXED] - Passed height and width as native props to support cases where source is an array.

**Issue**: Unable to use height and width as props in Image components when passing source as an array.

This functionality worked before this [commit](https://github.com/facebook/react-native/pull/34481). In Image.android.js and Image.ios.js, height and width props are extracted before passing them to the native side. This extraction makes these props ineffective when passed directly. Although setting height and width in style is a workaround, these props should still be respected since they exist for this purpose.

The issue occurs only when the source prop is an array. When source is an object, width and height are manually passed to the style object, so the issue doesn't arise.

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

Test Plan: Tested this on `rn-tester` app

Reviewed By: necolas, javache

Differential Revision: D64458292

Pulled By: cipolleschi

fbshipit-source-id: 5cacad79b8d4468a4a1fd0977221e42ce4b2e5d1
2024-10-18 05:04:11 -07:00
Samuel Susla b0f0f0631c delete typealias RunLoopObserver::Unique (#47117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47117

changelog: [internal]

use unique_ptr directly instead of typealias obscuring the type.

Reviewed By: christophpurrer

Differential Revision: D64302758

fbshipit-source-id: 5a7ee2408a04de6cf1e60036463227cd2b455fcf
2024-10-18 04:52:45 -07:00
Tim Yung c9ea05552f RN: Fix lint/sort-imports Errors (#47109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47109

Fixes the `lint/sort-imports` errors that are now surfaced after fixing the lint configuration.

For a couple files, I added lint suppressions instead because the unsorted import ordering is important due to interleaved calls with side effects.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D64569485

fbshipit-source-id: 26415d792e2b9efe08c05d1436f723faae549882
2024-10-18 04:07:02 -07:00
Frank Calise e14a2f3862 test(rn-tester): skip loading indicators when list is empty (#47094)
Summary:
During testing for 0.76-RC6, I came across the following behavior in RNTester.

Components > FlatList > Basic > Toggle `Empty` switch

You'll notice there are activity indicators in the header/footer (see video) for some time and things appear to be somewhat janky. I think the expectations would be to see only the `ListEmptyComponent` that is defined for this to look more correct. This will help not give any false indication that something has gone wrong with the latest picks when testing newer versions.

## Changelog:

[INTERNAL] [FIXED] - Fixed FlatList Empty behavior in RNTester

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

Test Plan: https://github.com/user-attachments/assets/6e116641-5b24-473c-a654-7d32a081b83f

Reviewed By: yungsters

Differential Revision: D64541905

Pulled By: cipolleschi

fbshipit-source-id: 0447d99588d85f9e1a46c6da169a0838e94994bc
2024-10-18 03:33:22 -07:00
Pieter De Baets 95a5d1c628 Explicity reset typeface in updateTextPaint (#47097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47097

Calling Paint.reset() doesn't reset the active type face (https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/hwui/PaintImpl.cpp;l=86), which causes measurements bugs for Text which don't specify a font to be incorrect.

Changelog: [Android][Fixed] Text without explicit font styles was potentially cut-off.

Reviewed By: NickGerleman

Differential Revision: D64535719

fbshipit-source-id: d300c26bf828a0e2e4b170254f9be5f409aff2dc
2024-10-18 03:29:34 -07:00
Nick Gerleman 0a2dec175e Remove legacy absolute positioning path (#46984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46984

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

The legacy (wrong) absolute positioning path positions in two places, including work that is definitely always overwritten in the new absolute layout path.

This came up before for position: static, but we didn't clean this up at the time. This code is also now leading display: contents impl being more annoying.

This diff tries to converge to the more spec correct implementation of positioning here, that also only happens in one place.

Previous path would potentially also incorrectly justify when `justify-content` was non-default, but not handled in the previous few cases? We don't have access to the flexLine at this point later, and apart from the existing tests now passing I reused the new correct logic for justification (spec says we should position child as if its the only child in the container https://www.w3.org/TR/css-flexbox-1/#abspos-items).

I added a new, more scoped errata `AbsolutePositionWithoutInsetsExcludesPadding` to preserve some of the legacy behavior that showed as very breaking.

I also did not try removing `AbsolutePercentAgainstInnerSize` which I suspect would be more breaking than this change.

Changelog:
[General][Breaking] - More spec compliant absolute positioning

Reviewed By: joevilches

Differential Revision: D64244949

fbshipit-source-id: ca97570e0de82e8f0424a0912adfd0b05254559e
2024-10-17 22:40:16 -07:00
Phillip Pan 2ffd31bbd7 set modal rendered state to false on unmount (#47078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47078

Changelog: [Internal]

in fabric, we've found a scenario where this modal state update is required to cleanup all artifacts from the modal presentation views. it is safe to add this back, as it was originally removed for a scenario that no longer exists.

Reviewed By: shwanton

Differential Revision: D64388550

fbshipit-source-id: f13571260379554b0126c379ace9f9e1b81866be
2024-10-17 22:09:43 -07:00
Nick Gerleman 0ba00fc998 Merge Android ViewNativeComponent ViewConfig into BaseViewConfig (#47105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47105

`codegenNativeComponent` expects we declare props as extending `ViewProps`, but the generated ViewConfig extends from BaseViewConfig.

This doesn't matter on iOS, where ViewProps are implemented more uniformly across components, but on Android, means we miss about 40 view props, since `ReactViewManager` backing `<View>` supports quite a bit more than `BaseViewManager`. This means that any components which extend `ReactViewManager` have some ViewProps omitted.

In this diff, I went with the solution of moving the props specific to View's ViewConfig to BaseViewConfig. This means the SVC may treat more props as valid than the underlying native component, but this should be safe compared to undercounting, and this will make future moves from ReactViewManager to BaseViewManager safer.

BaseViewConfig was already exposing props not supported by BaseViewManager, like those related to border widths (which effect LayoutShadowNode, but cannot be drawn out of the box?), so this shouldn't be too out there.

The alternative to this was to publicly expose the View ViewConfig and extend from that in codegen instead, but this seemed more complicated without much benefit.

Changelog:
[Android][Fixed] - Merge Android ViewNativeComponent ViewConfig into BaseViewConfig

Reviewed By: elicwhite

Differential Revision: D64570806

fbshipit-source-id: de5c590e935c879e33d59c36ddce1f2481023c19
2024-10-17 20:51:11 -07:00
Sam Zhou 797d013308 Deploy 0.250.0 to xplat (#47108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47108

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64577261

fbshipit-source-id: 265e1f6755fde3836bb7aa15116e2bb380cee091
2024-10-17 19:54:04 -07:00
Shawn Dempsey d78cb78b15 React Activity exposes ReactHost (#46980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46980

Changelog: [Android][Added]  React Activity exposes ReactHost

**Context:**

*These changes will not impact `DefaultReactHost` which is the way most OSS apps interface with `ReactHost`*

* We are simplifying `ReactHost` and `ReactHostDelegate` for Brownfield uses.
* We fetch the `ReactHost` to create the `ReactDelegate`
https://www.internalfb.com/code/fbsource/[00ee07afc695]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java?lines=110-112

* With Bridgeless, you must use or extend `ReactHostDelegate` to get the `ReactHost` since we don't expose a getter on `ReactActivity`.
* If there is a custom Application, then getting the `ReactHost` will need a custom implementation.
* For the base case, we shouldn't need to subclass the delegate.

**Change:**

* Expose `ReactHost` on `ReactActivity` for Bridgeless access.
* Expose `ReactActivity` on `ReactActivityDelegate`. This will help us avoid keeping a reference to Activity in each subclass.
* Update the RN Android API's

Reviewed By: arushikesarwani94

Differential Revision: D64150994

fbshipit-source-id: a9d790a4b4ce4eca29dee4bdc8d9fc56cf742f1f
2024-10-17 19:33:40 -07:00
Jorge Cabiedes Acosta 398512a4ed Fix getOpacity() for drawables (#47103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47103

`getOpacity()` is supposed to return a PixelFormat enum instead of a value between 0..255.
https://developer.android.com/reference/android/graphics/drawable/Drawable#getOpacity()

Also, I'm taking the value from the paint instead of the color's alpha since the paint might've been modified by setAlpha by this point and otherwise the paint will hold the alpha set by the color anyway since setAlpha() on Paints is just a helper for setColor() (https://developer.android.com/reference/android/graphics/Paint#setAlpha(int))

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64273014

fbshipit-source-id: e2c524f1d816ee3705c5118232be759898e666ea
2024-10-17 17:37:25 -07:00
Jorge Cabiedes Acosta 02e4f3e16a Nullable borderRadius optimization on shadows and outline (#46819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46819

Just some preparation to implement the new `BackgroundDrawable` and `BorderDrawable`.

This makes shadows and outline rely on `CompositeBackgroundDrawable` to set the state of `BorderRadiusStyle` and also makes them have a nullable borderRadius variable and initialize it only if we have it set saving a bit of overhead and performance

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63798853

fbshipit-source-id: 994327415ba160cf8e5ccb3135c4917809499f81
2024-10-17 17:37:25 -07:00
Tim Yung 892ce1b980 RN: Fix sort-imports Lint Configuration (#47104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47104

In https://github.com/facebook/react-native/pull/46082, the lint configuration for `lint/sort-imports` was accidentally removed.

This has happened on more than one occasion in the past. In order to prevent this from happening again in the future, I'm also adding a Jest integration test to verify that this lint rule is enabled in the `eslintrc.js` configuration.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D64547410

fbshipit-source-id: ec4f14aff140691b644189dfa3116a3d39285f80
2024-10-17 17:06:20 -07:00
Rubén Norte 14bbb87516 Fix incorrect type being passed to NativePerformance.mark (#47102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47102

Changelog: [internal]

In D64466057 / https://github.com/facebook/react-native/commit/32f7b3b4e0b8be1d1138f43c46b3c86d9a64c29a we accidentally modified the API of `NativePerformance.mark` (which we wanted to preserve and move the changes to `NativePerformance.markWithResult` after some iteration) to make `startTime` optional, which isn't compatible with the previous native API.

This fixes the issue by reverting the type back to being required and always passing it from the JS API.

Differential Revision: D64557467

fbshipit-source-id: 3ade4271622ac6213fd4c2d4948c7d40e4abe715
2024-10-17 13:05:01 -07:00
Edmond Chui d11954e800 add appId to Telemetry (#47099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47099

Changelog: [Internal]

As discussed in D64547367, recent changes caused `description` to stop reporting `appId`.

This impacted Telemetry's "top apps" dashboards.
{F1936011487}

Reviewed By: hoxyq

Differential Revision: D64548348

fbshipit-source-id: 46af650a89e2bef7be000482e7b774f56f84cac3
2024-10-17 12:47:05 -07:00
Edmond Chui 0d591d9dc3 add appId as a standalone field (#47098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47098

Changelog: [Internal]

D63329456 updated the `description` field to be human-readable.
Unfortunately, InspectorProxy relies on this field to compare the incoming `/open-debugger` calls.

hoxyq discovered the symptom of Fusebox failing to launch with `No compatible apps connected. React Native DevTools can only be used with the Hermes engine.` in Metro

Reviewed By: hoxyq

Differential Revision: D64547367

fbshipit-source-id: deed6851f3ede2c74be2b492def1eba6e58c43e6
2024-10-17 12:47:05 -07:00
Joe Vilches 1d6ac09530 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-17 11:58:12 -07:00
Samuel Susla d3fa580508 unify overlapping logic among platform specific EventBeats (#47085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47085

changelog: [internal]

Move induce method from  AppleEventBeat and AndroidEventBeat to its subclass EventBeat.

# Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64302639

fbshipit-source-id: cdea5ee64dc25633ae59fdce5b1ce6aff8a97d68
2024-10-17 11:51:22 -07:00
Samuel Susla 9fe253d677 delete AsynchronousEventBeat in favour of platform specific EventBeats (#47058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47058

changelog: [internal]

# Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64291889

fbshipit-source-id: fa46e2c5246e1a9a1b5f3bd02e5c0efa562188e9
2024-10-17 11:51:22 -07:00
Nicola Corti 7168a9d1a2 Stable API - Make AccessibilityInfoModule internal (#47092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47092

This class should not be public. I'm updating the BUCK rule to make it `internal` and remove it from the public API surface.

Technically breaking however I haven't found meaningful usages of this API in OSS so this should be safe to ship.

Changelog:
[Android] [Breaking] - Make `AccessibilityInfoModule` internal

Reviewed By: mdvacca

Differential Revision: D64539866

fbshipit-source-id: 21c9965dc95b697bef93bbad23872921a73566aa
2024-10-17 11:46:41 -07:00
Peter Abbondanzo c54b23ff9e Ensure alert dialog title wraps to two lines, uses default style (#47095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47095

The [internal `DialogTitle` implementation from Android](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/com/android/internal/widget/DialogTitle.java;l=63?q=DialogTitle) makes additional checks to see if the title should wrap to two lines before applying ellipsis, so this change recreates those same checks. This change also removes the text appearance and size changes made to the layout.

Reverts some of the changes made to https://github.com/facebook/react-native/pull/45395.

**Changelog:**
[Android][Fixed] - Fixed styling on alert dialog titles to wrap two lines and retain bold appearance

Reviewed By: cortinico

Differential Revision: D64543105

fbshipit-source-id: 30d1f9091aa7216eb5d00e4f8f14cbc719c803ea
2024-10-17 11:34:00 -07:00
yungsters (Meta Employee) dc737a7356 Delete __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED from React Native Renderer (#31276)
Summary:
## Summary

The React Native Renderer exports a
`__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED` property with a
single method that has no remaining call sites:
`computeComponentStackForErrorReporting`

This PR cleans up this unused export.

## How did you test this change?

```
$ yarn
$ yarn flow fabric
$ yarn test
```

DiffTrain build for [a3d9ea05bf01f3c3d7aedc2d938c581ad11fd14a](https://github.com/facebook/react/commit/a3d9ea05bf01f3c3d7aedc2d938c581ad11fd14a)

Reviewed By: rickhanlonii, kassens

Differential Revision: D64484457

Pulled By: yungsters

fbshipit-source-id: 9a7629210739d23175480191d30fc02ba3ee2fee
2024-10-17 10:56:28 -07:00
Riccardo Cipolleschi 8e80257f23 Add Changelog for 0.76.0-rc.6 (#47096)
Summary:
See changelog

## Changelog:
[Internal] - Add changelog for 0.76.0-rc.6

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

Test Plan: N/A

Reviewed By: blakef

Differential Revision: D64545320

Pulled By: cipolleschi

fbshipit-source-id: ebfe57f5009f9b1906856cc90a19dd858e7e6583
2024-10-17 10:39:08 -07:00
Cristian Matteu 4ae999b90b Add announceForAccessibilityWithOptions method mock. (#47063)
Summary:
Currently, tests on components that use the `AccessibilityInfo.announceForAccessibilityWithOptions` method fail because a mock for this method is not present in the `jest` setup file. This PR adds the mock for the before mentioned method in the appropriate `setup.js` file
## Changelog:
[General][Added] - Added the missing `announceForAccessibilityWithOptions` function mock in the `packages/react-native/jest/setup.js` file.

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

Test Plan:
Here are the commands I executed after making the modification:
- `yarn prettier`
- `yarn lint`
- `yarn test`
### Test output
![rn-tests-output](https://github.com/user-attachments/assets/81e9772e-37ce-43ad-9869-5f7f64c292f0)

Reviewed By: tdn120

Differential Revision: D64495941

Pulled By: lunaleaps

fbshipit-source-id: 6ab835e2934b87ec3ac64cf0aebd8dcb58cd0da1
2024-10-17 09:20:32 -07:00
Alex Hunt 52ea8b07e2 Specify package manager version for project (#47091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47091

Prompted by https://github.com/facebook/react-native/pull/47083, this change adds a `"packageManager"` field to the root `package.json` specifying `yarn@1.22.22`. This will configure a compatible, predictable version of Yarn for users using [Corepack](https://nodejs.org/api/corepack.html) via the Yarn Modern install process.

See https://yarnpkg.com/getting-started/install and https://nodejs.org/api/corepack.html.

Tested on a fresh system (GitHub Codespaces).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D64536673

fbshipit-source-id: 535c0ca725172e4a06de04b19c6cd2d31788f5a4
2024-10-17 07:55:07 -07:00
Riccardo Cipolleschi f1d2331dfb We use the right filename as hash in CI cache key (#47087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47087

In the repo, we don't have a `build-apple-framewroks.sh` file, but we do have a `build-apple-framewrok.sh` file, with no ending `s`

## Changelog:
[Internal] - Fix CI cache key

Reviewed By: cortinico

Differential Revision: D64531456

fbshipit-source-id: 05c104390b875eeef2cf15f8a30c8672cfc9b61d
2024-10-17 07:47:51 -07:00
Robert Pasiński 32f7b3b4e0 fix: performance.measure with mark names (#46786)
Summary:
This PR improves PerformanceObserver Native Public API and fixes issue with `performance.measure` not working with mark names.

## Changelog:

 - Made `PerformanceEntryReporter::report[Mark|Measure]` return the created entry with computed data.
 - Updated JS-Native interface to return computed data from Native side to JS.
 - Updated JS tests

[GENERAL] [FIXED] - Fixed `performance.measure` with mark names
[GENERAL] [INTERNAL] - `PerformanceEntryReporter::reportMark` and `PerformanceEntryReporter::reportMeasaure` now return created performance entries.

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

Test Plan:
- [ ] Update JS tests
 - [ ] Update Native tests

Reviewed By: rshest

Differential Revision: D64466057

Pulled By: rubennorte

fbshipit-source-id: d280d66c268a9830fbc9e6f3304e108ecf870a59
2024-10-17 07:25:50 -07:00
Edmond Chui ff113545cf Update debugger-frontend from a897db8...117c96a (#47072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47072

Changelog: [Internal] - Update `react-native/debugger-frontend` from a897db8...117c96a

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

Reviewed By: hoxyq

Differential Revision: D64487276

fbshipit-source-id: ae7efce5dadf72f62c824d0acbc6aa6d44149905
2024-10-17 07:25:20 -07:00
Nicola Corti 7bbac8ee27 Migrate MainReactPackage to Kotlin (#47070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47070

For the sake of Stable API, I'd like to get this class converted to Kotlin

The class is becoming `final` so could be breaking for some users if they subclass `MainReactPackage` which I believe this should not be a valid usage of this API.

Changelog:
[Android] [Changed] - Migrate MainReactPackage to Kotlin (and make it final)

Reviewed By: tdn120

Differential Revision: D64479418

fbshipit-source-id: 24a07de4e5796a7b82ba34c9b36511b8fc526f1a
2024-10-17 05:29:04 -07:00
Nicola Corti 2d2bb9c588 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 04:45:05 -07:00
Samuel Susla c90ab6e878 use unique_ptr instead of shared_ptr in RCTScheduler (#47055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47055

changelog: [internal]

no need to use shared_ptr here.

Reviewed By: christophpurrer

Differential Revision: D64464645

fbshipit-source-id: 8947ac8d13322ace3204697047a7582940f98687
2024-10-17 04:42:46 -07:00
Rubén Norte 2d9fe11578 Unify feature flags for event loop (2nd attempt) (#47084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47084

Changelog: [internal]

This unifies all the feature flags that control the new event loop on RN. Before, we'd have granular flags for different aspects of it. With this diff, we enable the event loop by default with bridgeless, and we introduce a new flag to explicitly disable it in that case if necessary.

When we're ready to clean up this opt-out, we just need to remove the `&& !ReactNativeFeatureFlags::disableEventLoopOnBridgeless()` conditions.

Reviewed By: fkgozali

Differential Revision: D64464902

fbshipit-source-id: d1a0ba38dd4c189c2da905b49de23a821223ac3a
2024-10-17 04:42:37 -07:00
Rubén Norte f92863e815 Add support for feature flags without native implementation (#47059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47059

Changelog: [internal]

This adds a new configuration for feature flags to preserve their definition only in JavaScript and skip their native API and implementations. This is useful to preserve the API in JavaScript when JavaScript changes progress faster than native changes.

Reviewed By: sammy-SC

Differential Revision: D64464779

fbshipit-source-id: 0af9624daad7bd655172905f8f616d53655cb407
2024-10-17 04:42:37 -07:00
Samuel Susla a72510d586 delete EventBeat's copy ctor and remove default implementation for induce (#47057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47057

changelog: [internal]

EventBeat should never be copied. Make that explicit.
EventBeat::induce must never be empty, remove the default implementation.

# Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64291845

fbshipit-source-id: 9265491c33b23d6ec2ccad4e2ea55e2b11211e6a
2024-10-17 04:36:28 -07:00
Samuel Susla e6ba1db5e9 rename AsyncEventBeat to AndroidEventBeat (#47053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47053

changelog: [internal]

AsyncEventBeat is Android specific, let's rename it to reflect that.

Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64301829

fbshipit-source-id: cc550ce3836764519c2f4ef849d699ed66226359
2024-10-17 04:36:28 -07:00
Samuel Susla c36806f9e8 pass eventBeat directly into EventDispatcher (#47052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47052

changelog: [internal]

EventBeat can be constructed in Scheduler and passed to EventDispatcher. This is cleaner than passing down all dependencies and constructing it in place.

# Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64291401

fbshipit-source-id: ef6d2bdb630767de1dab6052d9d9226c9e1a5f3c
2024-10-17 04:36:28 -07:00
Samuel Susla b1ec76e2ad copy by value in RunLoopObserver ctor (#47051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47051

changelog: [internal]

copy weak owner instead of using const&. const& is wrong here and hides important information because weak owner is always copied into ivat.

Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override EventBeat::request and EventBeat::induce.

Reviewed By: christophpurrer

Differential Revision: D64291515

fbshipit-source-id: 3e74270f03fac121e9f45b0a8ad287ccdb0a059a
2024-10-17 04:36:28 -07:00
Samuel Susla e00002131c refactor EventBeat owner (#47050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47050

changelog: [internal]

- Rename SchedulerToolbox::asynchronousEventBeatFactory to SchedulerToolbox::eventBeatFactory. There is only one eventBeat, no need to distinguish between sync and async.
- Remove typealias EventBeat::SharedOwnerBox and pass by value instead of const&.

# Goal of this stack:
Centralise event beat logic into EventBeat class inside react-native-github. Subclasses should only override `EventBeat::request` and `EventBeat::induce`.

Reviewed By: christophpurrer

Differential Revision: D64291288

fbshipit-source-id: 96afc56a51677ed9e61b2a662bb968678fa770f7
2024-10-17 04:36:28 -07:00
Nicola Corti 125d01286f Add -Xshare:off for Unit tests (#47066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47066

This suppresses the warning:
```
Sharing is only supported for boot loader classes because bootstrap classpath has been appended
```

which is not relevant for us.

Changelog:
[Internal] [Changed] - Add -Xshare:off for Unit tests

Reviewed By: cipolleschi

Differential Revision: D64474372

fbshipit-source-id: 67d0a2da47ecd1d4ab906b03515b9a59f2e4f245
2024-10-17 04:33:01 -07:00
Blake Friedman 19971092b6 Add changelog for 0.76.0-rc.5 (#47037)
Summary:
Changelog:
[Internal] - add changelog

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

Reviewed By: NickGerleman

Differential Revision: D64433991

Pulled By: blakef

fbshipit-source-id: 74c219553a40ff79554ec6a313e23eb82a5534ac
2024-10-17 02:31:08 -07:00
Douglas Lowder bb8992c760 fix: Add missing tvOS steps to build-hermes-macos GH action (#47073)
Summary:
After examining Hermes artifacts built after merging of https://github.com/facebook/react-native/issues/46865 , it was apparent that tvOS frameworks were missing from the Hermes universal framework generated by CI.

I went back and discovered additional steps that need to be added to the `build-hermes-macos` action to make CI work correctly.

## Changelog:

[Internal][Fixed] add required steps to build tvOS in build-hermes-macos action

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

Test Plan: After merging, Hermes artifacts generated by CI should contain the missing tvOS bits.

Reviewed By: rshest

Differential Revision: D64528911

Pulled By: cipolleschi

fbshipit-source-id: 61db3e154767830a4726d7ceeec229a4af30d247
2024-10-17 02:22:02 -07:00
Tim Yung 01e210fd28 RN: Support Ref Cleanup in useMergeRefs (#47040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47040

Updates `useMergeRefs` to support cleanup functions.

Changelog:
[General][Changed] - `useMergeRefs` and components using it (e.g. `Pressable`) now support ref cleanup functions.

Reviewed By: lunaleaps

Differential Revision: D64437947

fbshipit-source-id: b715abfa5b4236c1a7685ac023ff1d0384b6a3a4
2024-10-17 01:28:07 -07:00
Alan Lee 1c002c7b4e bump fbjni to 0.7.0 (#47031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47031

fbjni 0.7.0 has updates to support 16KB page size

- https://github.com/facebookincubator/fbjni/releases/tag/v0.7.0

Changelog:
[Android][Changed] - Bump fbjni to 0.7.0

Reviewed By: cortinico

Differential Revision: D64372127

fbshipit-source-id: eb2be6aec30ea5051d55d38554c0a912ff579109
2024-10-17 00:43:21 -07:00
Sam Zhou 10d8c0df29 Deploy 0.249.0 to xplat (#47077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47077

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D64512638

fbshipit-source-id: 6c61e13ef0b02f755a150a4d31312375ca487076
2024-10-17 00:09:24 -07:00
Nick Gerleman 6dc64d44f8 Add some unit tests for RCTIsAttributedStringEffectivelySame (#47038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47038

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64433780

fbshipit-source-id: d29f23c3d01cbb6157ba33c682cb1d9e20f12a7a
2024-10-16 23:34:08 -07:00
Tim Yung fa0358a058 RN: Fix useMergeRefs-test.js (#47076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47076

The Jest unit tests for `useMergeRefs` were incorrectly implemented, leading to missing expected values. The root cause is that the test helpers were rendering to new roots instead of reusing the same root.

This refactors the test helpers to be simpler and easier to debug, and then fixes the bug described above.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D64498741

fbshipit-source-id: f0dd65f89e0c13721e83a8e38a699bc688812a0e
2024-10-16 16:01:10 -07:00
Thomas Nardone 9406a09f87 Add PixelUtil extensions for Int, Long (#46992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46992

Changelog: [Android][Added] Added PixelUtil extensions for Int and Long

Reviewed By: Abbondanzo

Differential Revision: D64262473

fbshipit-source-id: 49a666662ca260b878bdfa9a81a79dd6a381c879
2024-10-16 13:55:01 -07:00
Edmond Chui c35035ed3c Update debugger-frontend from 0ecc39f...a897db8 (#47067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47067

Changelog: [Internal] - Update `react-native/debugger-frontend` from 0ecc39f...a897db8

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

Reviewed By: hoxyq

Differential Revision: D64475173

fbshipit-source-id: 216c88e13c292c4f857e03e135d761e7042a14c0
2024-10-16 12:21:31 -07:00
Sam Zhou 75dc0f7c73 Eliminate last React$AbstractComponent in react-native (#47069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47069

Use of this internal type will trigger a `internal-type` error in the next version of Flow. This diff eliminates the last use in react native.

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64479166

fbshipit-source-id: d440a2fbfe88223462ce61252082a2e7381fb4c9
2024-10-16 11:55:49 -07:00
Nicola Corti c867aba2f3 Move BridgelessDevSupportManager to .devsupport package (#46914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46914

The `BridgelessDevSupportManager` should have lived inside the `.devsupport` package alongside all the other
devsupport related tooling.

It was instead created inside `.runtime` causing a tight coupling with `ReactHostImpl`.
This made it impossible for Frameworks to customize it (i.e. in Expo GO) also because there was a circular
dependency between ReactHostImpl and BridgelessDevSupportManager

In this diff I'm:
1. Breaking the circular dependency by using `ReactHostDevHelper`
2. Updating all the parameters to reference `ReactHost` rather than `ReactHostImpl`
3. Moving BridgelessDevSupportManager to the `.devsupport` package.

This is breaking for users that are manually composing a `BridgelessDevSupportManager` or
that are extending the `ReactInstanceDevHelper`.

- `ReactInstanceDevHelper` has 3 new method which will have to be implemented.
- `BridgelessDevSupportManager` is now living in a different package.

Changelog:
[Android] [Breaking] - Add 3 methods to ReactInstanceDevHelper

Reviewed By: rshest

Differential Revision: D64105790

fbshipit-source-id: 13478fe1a035adb5b0dc83ebb1daad6cfb243881
2024-10-16 11:25:26 -07:00
Edmond Chui ad6a2fa612 Fusebox reload-to-profile refactor (#47060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47060

Changelog: [internal]

Follow up on feedback from D64077813

 oliver_clean

Reviewed By: hoxyq

Differential Revision: D64469842

fbshipit-source-id: e4639defb01683090823eb6774b0c65e9157ef27
2024-10-16 10:31:15 -07:00
Ruslan Lesiutin f53cd7238c Encapsulate TracingAgent (#46986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46986

# Changelog: [Internal]

Encapsulate integration with `FuseboxTracer.cpp` into `TracingAgent.cpp`, which will be responsible for handling `Tracing` domain CDP events.

Closer to the top of the stack, more changes will be added to it.

Reviewed By: huntie

Differential Revision: D64249695

fbshipit-source-id: 4adf5973299275e210e7cdf9c816efab881c9daf
2024-10-16 10:14:52 -07:00
Samuel Susla 4e12b86bfc delete fetchImagesInViewPreallocation feature flag (#47056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47056

changelog: [internal]

Reviewed By: Abbondanzo

Differential Revision: D64464758

fbshipit-source-id: 88b8deacac273b693c4bcdd195cbf46441330b0b
2024-10-16 09:08:28 -07:00
poonamjain96 848471b69f Add test case for set opacity in new arch examples (#47043)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:
- ME2E0004

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ Internal ] [ Added ] - Add setOpacity test in new-arch-example

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64457441

Pulled By: cipolleschi

fbshipit-source-id: 310270293f5c7ec8a94c0d38fdd0897e4591ec14
2024-10-16 08:33:37 -07:00
Riccardo Cipolleschi 17455e1004 Sort the changelog properly
Summary:
While working on the changelog, I realized that version 0.75.4 ended up in between RCs of 0.76

To avoid to lose the changelog of 0.75.4 once we release 0.76, I moved it to the right place, above 0.75.3's changelog
bypass-github-export-checks
## Changelog:
[Internal] - Sort Changelog properly

Reviewed By: cortinico

Differential Revision: D64470420

fbshipit-source-id: 0602b6cf4d7b9d9b3befb2535de6079d28545a15
2024-10-16 08:18:59 -07:00
antFrancon 6aeca53b3e fix(android): Prevent ArrayIndexOutOfBoundsException in permission check (#47047)
Summary:
This PR addresses a potential `ArrayIndexOutOfBoundsException` in the Android module's permission checking logic.

```diff
- results.length > 0 && results[j] == PackageManager.PERMISSION_GRANTED
+ results.length > j && results[j] == PackageManager.PERMISSION_GRANTED
```

It ensures that we only access the results array when the index `j` is within bounds, preventing crashes due to invalid array access that have been occurring in the production environment.

Here is the Crashlytics dashboard concerning this type of crash on my app last week (react-native 0.75.4 - old arch):
![image](https://github.com/user-attachments/assets/0b7c1a10-39f6-4a17-9eee-4b17986f5b85)

## Changelog:

[ANDROID] [FIXED] - Prevent ArrayIndexOutOfBoundsException in permission check

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

Test Plan:
1. Verify normal permission request scenarios still work on Android:
   - Request a permission (e.g., camera, location)
   - Grant the permission
   - Verify the app functions correctly with the granted permission

2. Monitor production crash reports:
   - Deploy the fix to production
   - Observe a decrease in ArrayIndexOutOfBoundsException occurrences in the permission check logic

Note: As this crash was only observed in production, we'll rely on production monitoring to verify the fix's effectiveness over time.

Reviewed By: rshest

Differential Revision: D64464171

Pulled By: cortinico

fbshipit-source-id: 87beacf7ee749a51665577d05a56cc8d6889d70f
2024-10-16 07:30:30 -07:00
David Vacca 6b67772204 Enable 'useFabricInterop' by default in new architecture (#47017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47017

Enable 'useFabricInterop' by default in RNOSS

changelog: [Android][Changed] Enable fabric interop by default in new architecture for Android

Reviewed By: cortinico, rshest

Differential Revision: D64340659

fbshipit-source-id: b94421aaf482675dbe8838a97d9968494e4fa75f
2024-10-16 04:37:14 -07:00
Douglas Lowder f673759c83 feat: Add tvOS support to Hermes artifacts (#46865)
Summary:
Adds tvOS to the list of Apple platforms supported by the Hermes artifacts. After this, the React Native TV builds will be able to use the same Hermes artifacts as those used by RN core.

~Added some code in `hermes-utils.rb` so that the Hermes podspec can use a local Maven repo (`/tmp/maven-local`).~

> *Note:* ~This PR should not be merged until the corresponding Hermes PR https://github.com/facebook/hermes/pull/1529 is merged.~ (https://github.com/facebook/hermes/pull/1529 has been merged)

## Changelog:

[iOS][Added] tvOS support for Hermes artifacts

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

Test Plan: - tvOS is also added to the build and test GitHub workflows.

Reviewed By: rshest

Differential Revision: D64461324

Pulled By: cipolleschi

fbshipit-source-id: d63889c60c72519818e7076cd0ab5851791715a1
2024-10-16 03:39:58 -07:00
Edmond Chui 4df224ca6d Fusebox reload-to-profile (Part 2 of 2: JS) (#46905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46905

Changelog: [General][Added] - Add support for reload-to-profile in Fusebox (Part 2 of 2: JS)

Reviewed By: hoxyq

Differential Revision: D64077813

fbshipit-source-id: a6d3326d8514f49e47074d21d37e00044ad62fd8
2024-10-16 01:27:28 -07:00
Shawn Dempsey 85f1d9a518 Back out "Unify feature flags for event loop" (#47041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47041

Original commit changeset: b879447def8a

Original Phabricator Diff: D64175216

Reviewed By: fkgozali

Differential Revision: D64439014

fbshipit-source-id: efc1bb7baa547d270322aabf6c5a4f50ace23e1b
2024-10-15 21:53:42 -07:00
Nick Gerleman 557e3447f5 Include existing attributes in newly typed text (#47018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47018

This change makes it so that newly typed text in a TextInput will include the existing attributes present based on cursor position. E.g. if you type after an inner fragment with blue text, the next character will be blue (or, an event emitter specific to an inner fragment will also be expanded). This is a behavior change for the (admittedly rare) case of uncontrolled TextInput with initially present children AttributedText, but more often effect controlled components, before state update (we are after, less likely to need to reset AttributedString because of mismatch).

Originally included this in D64121570, but it's not needed to fix the common case since we include paragraph-level event emitter as part of default attributes, and has some of its own risk, so I decided it is better separate.

Changelog:
[iOS][Changed] - Include existing attributes in newly typed text

Reviewed By: cipolleschi

Differential Revision: D64352310

fbshipit-source-id: 90ef8c49f50186eadf777e81cf6af57e1aada207
2024-10-15 16:24:53 -07:00
Nick Gerleman 36fd5533f6 Fix cursor moving while typing quickly and autocorrection triggered in controlled single line TextInput on iOS (New Arch) (#46970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46970

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

This one is a bit of a doozy...

During auto-correct in UITextField (used for single line TextInput) iOS will mutate the buffer in two parts, non-atomically. After the first part, after iOS triggers `textFieldDidChange`, selection is in the wrong position. If we set full new AttributedText at this point, we propagate the incorrect cursor position, and it is never restored.

In the common case, where we are not mutating text in the controlled component, we shouldn't need to be setting AttributedString in the first place, and we do have an equality comparison there currently. But it is defeated because attributes are not identical. There are a few sources of that:
1. NSParagraphStyle is present in backing input, but not the AttributedString we are setting.
2. Backing text has an NSShadow with no color (does not render) not in the AttributedText
3. Event emitter attributes change on each update, and new text does not inherit the attributes.

The first two are part of the backing input `typingAttributes`, even if we set a dictionary without them. To solve for them, we make attribute comparison insensitive to the attribute values in a default initialized control. There is code around here fully falling back to attribute insensitive comparison, which we would ideally fix to instead role into this "effective" attribute comparison.

The event emitter attributes being misaligned is a real problem. We fix in a couple ways.
1. We treat the attribute values as equal if the backing event emitter is the same
2. We set paragraph level event emitter as a default attribute so the first typed character receives it

After these fixes, scenario in https://github.com/facebook/react-native-website/pull/4247 no longer repros in new arch. Typing in debug build also subjectively seems faster? (we are not doing second invalidation of the control on every keypress).

Changes which do mutate content may be susceptible to the same style of issue, though on web/`react-dom` in Chrome, this seems to not try to preserve selection at all if the selection is uncontrolled, so this seems like less of an issue.

I haven't yet looked at old arch, but my guess is we have similar issues there, and could be fixed in similar ways (though, we've been trying to avoid changing it as much as possible, and 0.76+ has new arch as default, so not sure if worth fixing in old impl as well if this is very long running issue).

Changelog:
[iOS][Fixed] - Fix cursor moving in iOS controlled single line TextInput on Autocorrection (New Arch)

Reviewed By: javache, philIip

Differential Revision: D64121570

fbshipit-source-id: 2b3bd8a3002c33b68af60ffabeffe01e25c7ccfe
2024-10-15 16:24:53 -07:00
Ruslan Lesiutin d287c72804 Update debugger-frontend from 6f29504...0ecc39f (#47036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47036

Changelog: [Internal] - Update `react-native/debugger-frontend` from 6f29504...0ecc39f

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/6f29504d63ea3de4b07545fdfa59b978e30b05a9...0ecc39f68a7dbfb76ae5801b24f0e8ad610ba785).

Reviewed By: EdmondChuiHW

Differential Revision: D64405153

fbshipit-source-id: 1fe491aa878d203bee207f5c4163aac98f4524c2
2024-10-15 13:15:07 -07:00
Ruslan Lesiutin c1a7b4a8e9 upgrade[react-devtools-*]: ^6.0.1 (#47034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47034

allow-large-files

# Changelog: [Internal]

Upgrades React DevTools npm packages to 6.0.1 for whole xplat.

Reviewed By: EdmondChuiHW

Differential Revision: D64403912

fbshipit-source-id: 39310fcb300a2a2e48d38faacef97ef65c49bbe8
2024-10-15 13:15:07 -07:00
Joe Vilches dd1aea5ccf fix(iOS): Replace uses of CGColorRef with UIColor to avoid manual memory management v2 (#47019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47019

NOTE: This code is largely the same as https://github.com/facebook/react-native/pull/46847, I am merely fixing some internal issues

The original diff (D63989547) was backed out because it was causing some crashes related to some internal code that had to be changed. That code did not necessarily need to be changed - we could have just left the `RCTCreateCGColorRefFromSharedColor` function and not touched the internal code - which is what I am going to do here

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64201626

fbshipit-source-id: a8ead7a542514aee0749973e284cb7727d393c03
2024-10-15 12:59:58 -07:00
evanbacon 043e2fe14a prevent fatal crashes when launching App Clips (#47000)
Summary:
App Clips are full of bugs. One such bug is how launching an App Clip from Test Flight (and perhaps other systems) will cause the user activity to be of type `NSUserActivityTypeBrowsingWeb` but with a nullish `userActivity.webpageURL` (even though it's typed as never being nullish in this mode).

## Changelog:

[IOS] [FIXED] - Fix launching App Clips with nullish URLs.

<!-- 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/47000

Test Plan:
The following was failing cryptically and required extensive debugging to get launching.

https://github.com/user-attachments/assets/ffd26297-b20b-45a2-97cc-35a48b740cb2

Reviewed By: cipolleschi

Differential Revision: D64372170

Pulled By: lunaleaps

fbshipit-source-id: 388f05530f3bccdd9b446382931f127421bc8a27
2024-10-15 11:50:12 -07:00
Rubén Norte f9460deda7 Clean up feature flag removeNestedCallsToDispatchMountItemsOnAndroid (#47026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47026

Changelog: [internal]

Clean up feature flag after we tested it's safe.

Reviewed By: javache

Differential Revision: D64332654

fbshipit-source-id: 33e92abb24c9350628a814ecab195f995316d2bc
2024-10-15 10:59:03 -07:00
tarunrajput 3f633473c3 Add maestro e2e test for Legacy Style Event (#46784)
Summary:
part of https://github.com/facebook/react-native/issues/46757
closes ME2E0006, ME2E0007

## Changelog:

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

Pick one each for the category and type tags:

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

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

[Internal] - add e2e test for Legacy Style Event

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64172277

Pulled By: cipolleschi

fbshipit-source-id: adf3a55b354f1a293c4620dc617a6a08e3aebd2b
2024-10-15 10:57:32 -07:00
Riccardo Cipolleschi 118c1f7035 Add support for new iOS text content type cellular EID and cellular IMEI (#46507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46507

Support for new iOS text content type to autofill cellular EID or cellular IMEI:
- https://developer.apple.com/documentation/uikit/uitextcontenttypecellulareid?language=objc
- https://developer.apple.com/documentation/uikit/uitextcontenttypecellularimei?language=objc

## Changelog:

[General][Added] - Add JS layer for new text content type cellular EID and cellular IMEI

Reviewed By: cortinico

Differential Revision: D62737200

fbshipit-source-id: 4db9c29079e63107deeb00a3a1558aa151d80fc1
2024-10-15 10:55:03 -07:00
Rubén Norte 9e5b6e88c5 Unify feature flags for event loop (#46953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46953

Changelog: [internal]

This unifies all the feature flags that control the new event loop on RN. Before, we'd have granular flags for different aspects of it. With this diff, we enable the event loop by default with bridgeless, and we introduce a new flag to explicitly disable it in that case if necessary.

When we're ready to clean up this opt-out, we just need to remove the `&& !ReactNativeFeatureFlags::disableEventLoopOnBridgeless()` conditions.

Reviewed By: javache

Differential Revision: D64175216

fbshipit-source-id: b879447def8ab47c6ab772812ff1031177494069
2024-10-15 09:44:01 -07:00
Rubén Norte 3ebf4f3b0e Force bridgeless feature flags in RCTAppDelegate when bridgeless is enabled (#46972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46972

Changelog: [internal]

I'm unifying the feature flags for the new event loop (so it's enabled by default when bridgeless is enabled, unless a feature flag is explicitly set), and I realized that the feature flags for Bridgeless, Fabric and Turbo Modules aren't being set in iOS, causing my changes to be incorrect (as we're using bridgeless but the bridgeless flag is off).

This forces the right flags when using bridgeless so the configuration is consistent.

Reviewed By: rshest, cipolleschi

Differential Revision: D64234056

fbshipit-source-id: bfdbe6742ee84c23d6d2c0c56e6ca8fce1788b26
2024-10-15 09:44:01 -07:00
Riccardo Cipolleschi 7b6e8e7765 Codegen fails with Local Module (#47027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47027

While I was writing the documentation for extracting a module in a library, I realized that Codegen ignored the local node modules.

The reason is that `require.resolve` fails to resolve a local path.

bypass-github-export-checks

## Changelog
[General][Fixed] - Make Codegen work with local modules

Reviewed By: cortinico

Differential Revision: D64242713

fbshipit-source-id: cc5167665a49df1d09eb66a0dc9d76466f087a25
2024-10-15 09:30:50 -07:00
Riccardo Cipolleschi 40bcf0edba Do not kill emulators when testing (#47030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47030

Looking at the videos from the E2E tests, it seems that the tests are pretty reliable aside from the first one that often fail. And it looks like it is failing not because the test is wrong, but because maestro hits some sort of timeout and kills the test sooner.

With these changes we are:
- giving more time to maestro to run
- not killing the emulator anymore

Killing and restarting the simulator was making this problem workse, because a newly started simulator required more time to boots and to work properly

## Changelog:
[Internal] - stop killing simulators and increase timeouts

Reviewed By: cortinico

Differential Revision: D64398111

fbshipit-source-id: 17b107fee24d0fbd4897212c1907be3761e337ab
2024-10-15 08:32:37 -07:00
poonamjain96 8cf27e8b6f Add test for Console.log measure in new-arch-examples (#47020)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:
- ME2E0005

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ Internal ] [ Added ] - Add console.log measure test in new-arch-example

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64397112

Pulled By: cipolleschi

fbshipit-source-id: c9192d66065038528751e2e366f58158b06eb864
2024-10-15 08:29:47 -07:00
zhongwuzw c1178ac208 Fixes scrollIndicatorInsets not work in old arch (#46944)
Summary:
Fixes https://github.com/facebook/react-native/issues/46918 . break change comes from https://github.com/facebook/react-native/pull/44820 and https://github.com/facebook/react-native/pull/44789 .

## Changelog:

[IOS] [FIXED] - Fixes scrollIndicatorInsets not work in old arch

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

Test Plan: scrollIndicatorInsets should work in old arch.

Reviewed By: philIip

Differential Revision: D64173490

Pulled By: cipolleschi

fbshipit-source-id: f7186439146d1b811c02e584fd1d94fcbb5d88a2
2024-10-15 08:11:59 -07:00
Qichen Zhu 08bd8ac47d Fix KeyboardAvoidingView not aware of the keyboard closing after it is unmounted (#46952)
Summary:
In the new architecture, if you open the soft keyboard, unmount `KeyboardAvoidingView`, close the keyboard, and then remount `KeyboardAvoidingView`, it still assumes the keyboard is open and displays the keyboard avoiding area.

We need to check if the keyboard is still open after remounting.

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

## Changelog:

[GENERAL] [FIXED] - Fix KeyboardAvoidingView not aware of the keyboard closing it is unmounted

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

Test Plan:
Code to reproduce in RNTester:

```JSX
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import {Button, KeyboardAvoidingView, Text, TextInput, View} from 'react-native';
import {Fragment, Suspense, useState} from "react";

const infiniteThenable = { then() {} };

function Suspender({ freeze, children }) {
  if (freeze) {
    throw infiniteThenable;
  }
  return <Fragment>{children}</Fragment>;
}

function Freeze({ freeze, children }) {
  return (
    <Suspense>
      <Suspender freeze={freeze}>{children}</Suspender>
    </Suspense>
  );
}

function Playground() {
  const [isFrozen, setIsFrozen] = useState(false);

  return (
    <>
      <TextInput style={{ height: 100 }} />
      <Button title="Freeze" onPress={() => setIsFrozen(true)} />
      <Button title="Unfreeze" onPress={() => setIsFrozen(false)} />

      <Freeze freeze={isFrozen}>
        <KeyboardAvoidingView behavior="padding" style={{ flex: 1 }}>
          <View style={{ backgroundColor: '#909090', flex: 1, alignItems: 'center', justifyContent: 'flex-end' }}>
            <Text>Test</Text>
            <Text></Text>
          </View>
        </KeyboardAvoidingView>
      </Freeze>
    </>
  );
}

export default ({
  title: 'Playground',
  name: 'playground',
  render: (): React.Node => <Playground />,
}: RNTesterModuleExample);
```

### Steps

1. Tap the text input to show the soft keyboard.
2. Tap Freeze.
3. Tap the Enter or Done button on the soft keyboard to hide it.
4. Tap Unfreeze.
5. Verify that there is no blank area at the bottom of the screen.

### Videos

#### iOS

Before | After
-- | --
<video src="https://github.com/user-attachments/assets/0c8d840e-14a6-47ad-a163-d34ac9cfbf40" /> | <video src="https://github.com/user-attachments/assets/1d88a70c-e029-433d-920d-da7582edb3f2" />

#### Android

Before | After
-- | --
<video src="https://github.com/user-attachments/assets/f29f6526-c5a4-4b6a-b3aa-7c4c7ff3ed30" /> | <video src="https://github.com/user-attachments/assets/c4e92356-694b-4fca-8897-7dfca8495db0" />

Reviewed By: andrewdacenko

Differential Revision: D64178982

Pulled By: cipolleschi

fbshipit-source-id: 8d71654aac599cec4e1928b14d87cff34f28174a
2024-10-15 08:03:13 -07:00
Edmond Chui 2c9176ac0f Update debugger-frontend from 87b2feb...6f29504 (#47029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47029

Changelog: [Internal] - Update `react-native/debugger-frontend` from 87b2feb...6f29504

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/87b2feb14627b3e8713bc2637992b9a8c76bbe61...6f29504d63ea3de4b07545fdfa59b978e30b05a9).

Reviewed By: vzaidman

Differential Revision: D64393541

fbshipit-source-id: 4c87b37a192efa68a579b94bb4219099d4400714
2024-10-15 07:24:41 -07:00
Nicola Corti 11392c74d7 AGP to 8.7.1 (#47022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47022

That's just a patch bump for AGP from 8.7.0 to 8.7.1

Changelog:
[Internal] [Changed] - AGP to 8.7.1

Reviewed By: cipolleschi

Differential Revision: D64390797

fbshipit-source-id: b48218b5737b8e7379ab4f13dfa57a97c3e30cbd
2024-10-15 06:08:09 -07:00
Nicola Corti 091025e18b Fresco to 3.4.0 (#47024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47024

This bumps Fresco from 3.3.0 to 3.4.0
Most notable change is NDK 27 support + 16K Page support.

Changelog:
[Android] [Changed] - Fresco to 3.4.0

Reviewed By: cipolleschi

Differential Revision: D64391402

fbshipit-source-id: 4dc9b2a045d0901bd6ee41cdbd4f1db2e22eb576
2024-10-15 06:01:27 -07:00
Nicola Corti 44c5cc36ad Silence CMake warning caused by PROJECT_ROOT_DIR (#47015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47015

CMake is complaining that this variable is set outside the build but not used.
I'm using it inside our top level .cmake file to silence this warning.
We need this variable as user projects might use it.

Changelog:
[Internal] [Changed] - Silence CMake warning caused by `PROJECT_ROOT_DIR`

Reviewed By: javache

Differential Revision: D64334462

fbshipit-source-id: 558bfc9f647e62890e3cc25628b5544880c47e4b
2024-10-15 04:27:04 -07:00
YunPeng Chong 3485e9ed87 Fix onEndReached not being called when getItemLayout is present and we scroll past render window (#46990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46990

This is a reattempt land D63643856 to fix the scroll onendreached event not firing.

Changelog:
[General][Fixed] - Fix onEndReached not being called when getItemLayout is present and we scroll past render window

Reviewed By: NickGerleman

Differential Revision: D64222424

fbshipit-source-id: 7e22f377d2f754beb39fff2b5c097cea350daa7e
2024-10-14 15:09:25 -07:00
Rob Hogan 0902b0af75 Update Metro to 0.81.0 (#47012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47012

Update Metro from `0.81.0-alpha.2` to `0.81.0`.

This is also intended to be the final, stable release for RN 0.76.

Changelog:
[General][Changed]: Update Metro to 0.81.0

Reviewed By: blakef

Differential Revision: D64329574

fbshipit-source-id: e12bed356b46e4ed68c75b397b7f9e2228c377be
2024-10-14 10:08:36 -07:00
Peter Abbondanzo 6e120b3b46 Add e2e test for Image resize method (#46982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46982

E2E test setup for each of the `resizeMethod` methods for Image on Android

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64136839

fbshipit-source-id: 876939a50243836030401c6456410f119abe01b5
2024-10-14 08:54:28 -07:00
Vitali Zaidman e08c7eb22a fix how @babel/register is used and update it (#46987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46987

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

Update `babel/register` to latest version, fixing the bug that were preventing us from updating it previously.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D64245277

fbshipit-source-id: f3d07b06a11fbe3a0ed28e22f5b687541782dda9
2024-10-14 06:30:59 -07:00
Gabriel Donadel 4dd47eeb9e 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-14 04:43:52 -07:00
Fabrizio Cucci 6c19996e10 Account for diffrent frame size when using maintainVisibleContentPosition in virtualized lists (#46979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46979

It seems that, when the items in a virtualized list don't have a fixed size (i.e. they dynamically scale with the size of the container), we need to also take into account their size when updating the scroll position as a consequense of setting `maintainVisibleContentPosition`.

Changelog:
[Android][Fixed] - Account for items dynamically scaling with the container when using `maintainVisibleContentPosition` in virtualized lists

Reviewed By: javache, NickGerleman

Differential Revision: D64238887

fbshipit-source-id: 9f05a461d178bc191137b1a350072337ba62e224
2024-10-14 04:28:31 -07:00
Rubén Norte b5271779ec Fix race condition when reporting mounting transactions for deallocated surfaces (#47008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47008

Changelog: [internal]

This code is gated anyway so there's no harm in production.

Reviewed By: javache

Differential Revision: D64322331

fbshipit-source-id: 005eb385f7e5ccd3d33e2d8c28e45b84f1537d68
2024-10-14 04:16:04 -07:00
Sam Zhou 60bc3c5aed Deploy 0.248.1 to xplat (#47004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47004

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64280903

fbshipit-source-id: f3f7a7bfdab30574fa911ba940032255932cd508
2024-10-13 12:58:21 -07:00
Samuel Susla b7fec235de small refactor of EventBeat (#47001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47001

changelog: [internal]

EventBeat::beat is only used on Windows, let's move it there.

EventBeat::induce is only called by subclasses, doesn't need to be public.

Reviewed By: christophpurrer

Differential Revision: D64287646

fbshipit-source-id: 48edceddd273b45e8a4e63f4c1d5fda6c5adf425
2024-10-13 03:27:40 -07:00
Jeff Bahr 9ba6237bff Update google-java-format to 1.23.0 (#46860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46860

Pulling library into our repository

Result of:
  arc artificer download com.google.googlejavaformat:google-java-format:1.23.0 --interactive

Deps
```
➜  arc artificer rquery dependencies --cross-reference com.google.googlejavaformat:google-java-format:1.23.0
com.google.googlejavaformat:google-java-format:1.23.0 
└╼ com.google.guava:guava:32.1.3-jre:compile 

```

Formatted with

```
tools/arcanist/lint/codemods/googlejavaformat_fbsource
```

Reviewed By: hick209

Differential Revision: D60787993

fbshipit-source-id: dbadc5184c0a7cccd967173e21602657013ddac7
2024-10-12 08:51:46 -07:00
Samuel Susla 3130f0d646 add timestamp to onScroll on iOS (#46978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46978

changelog: [internal]

Add timestamp to onScroll event on Android.

Reviewed By: fabriziocucci

Differential Revision: D64068207

fbshipit-source-id: 3d4c31bbf43ef5f06af4933867380d3ef297b550
2024-10-12 04:55:12 -07:00
Samuel Susla f4855d7d37 add timestamp to onScroll on Android (#46977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46977

changelog: [internal]

Add timestamp to onScroll event on Android.

Reviewed By: fabriziocucci

Differential Revision: D64235402

fbshipit-source-id: 606446f2a711dcb4edd94a2a54ec50c54f622904
2024-10-12 04:55:12 -07:00
David Vacca 34431272c3 Move execution of ReactNativeFeatureFlags::enableDeletionOfUnmountedViews() out of destructor (#46993)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46993

Calling ReactNativeFeatureFlags::enableDeletionOfUnmountedViews() from the destructor increases the chance of accessing ReactNativeFeatureFlags during the tear down of React Native.

We are moving this call into the contructor of the object which always happen on the js thread

changelog: [internal] internal

Reviewed By: rubennorte

Differential Revision: D64190029

fbshipit-source-id: 377b85e8ff0704db0f6603662f595b75a6705693
2024-10-12 00:39:21 -07:00
David Vacca 621622a5b1 Refactor Systrace.traceSection() to unblock CI (#46994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46994

This diff makes a small refactor on Systrace.traceSection() to unblock CI, which was broken by D64141515

changelog: [internal] internal

Reviewed By: Abbondanzo

Differential Revision: D64276651

fbshipit-source-id: e35950f88cde3d547992bb700208a4d4d309710f
2024-10-12 00:39:21 -07:00
Benoit Girard 401991c3f0 Better instrument the startup timeline.
Summary:
Using a new JVM profiler (D64128815) to find blind spot in the early startup init markers and adding them.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D64141515

fbshipit-source-id: d2968ed5dafdd891b8cc5a6115479c0678bfdc80
2024-10-11 12:50:28 -07:00
Blake Friedman 54c29a7acf Add changelog for 0.76.0-rc.4 (#46907)
Summary:
Changelog:
[Internal] - add changelog

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

Reviewed By: rshest

Differential Revision: D64081074

Pulled By: blakef

fbshipit-source-id: 8da22806036632cd266dcc83d023235231cce20b
2024-10-11 11:32:07 -07:00
Blake Friedman a7023414fd add yargs#usage typing (#46983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46983

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

Add support for `.usage` overload: https://github.com/yargs/yargs/blob/main/docs/api.md#usagemessagecommand-desc-builder-handler

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D64241927

fbshipit-source-id: 9928f08bad16a5e1a6bcfa7c2cf2bfa73668ff57
2024-10-11 11:27:09 -07:00
Rubén Norte c86b5c1232 Add new dangerouslyForceOverride method to feature flags (#46963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46963

Changelog: [internal]

This introduces a new method in `ReactNativeFeatureFlags` to force setting overrides without triggering any errors (they're returned a string instead to be handled in userland). This is partially equivalent to calling `dangerouslyReset` and `override` but completely avoids the hard crashes that could be caused by race conditions.

Reviewed By: javache, rshest

Differential Revision: D64186262

fbshipit-source-id: 854caa03810ec78217999292a4335dad373b7fcb
2024-10-11 10:05:25 -07:00
Sam Zhou 105aa129d8 Deploy 0.248.0 to fbsource
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D64225120

fbshipit-source-id: ce00574ea5d367737191ac430017332799906ebe
2024-10-11 09:59:44 -07:00
Thomas Nardone fc199bb5f3 Convert ReactViewManager to Kotlin (#46965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46965

Converting this class as close to 1:1 as possible.

Changelog: [Internal]

Reviewed By: NickGerleman, rshest

Differential Revision: D64124890

fbshipit-source-id: 2034ed8ecb877bb267a953b183b77daaf883a80a
2024-10-11 09:14:55 -07:00
Peter Abbondanzo 483b928224 Swallow exceptions on draw, forward to onError (#46964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46964

Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing.

Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco.

## Changelog

[Android][Fixed] - Apps will no longer fatally crash when trying to draw large images

Reviewed By: tdn120

Differential Revision: D64144596

fbshipit-source-id: 32b69ad4ecef0564c2cad7a287a31b56688f38b8
2024-10-11 09:10:30 -07:00
Blake Friedman 44fe0643ff Add changelog for 0.76.0-rc.3 (#46752)
Summary:
Add changelog for 0.76.0-rc.3

Changelog:
[Internal] - add changelog

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D63693195

Pulled By: blakef

fbshipit-source-id: a1a0ef6b24c3caab11527f8c89ce9d642be125a8
2024-10-11 08:56:45 -07:00
Samuel Susla ca6dc67570 fix stale contentSize in ScrollView (#46981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46981

changelog: [internal]

stateUpdate with closure syntax has to be used in order to not override contentSize stored inside of C++ state.

Reviewed By: jessebwr

Differential Revision: D64242221

fbshipit-source-id: 32d55ccc03e32922f2746293ccb6c0941ca67d92
2024-10-11 08:44:29 -07:00
Nick Lefever aacd4bba29 Disable shadow node reference updates by default (#46961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46961

Changelog: [Internal]
Runtime Shadow Node Reference Syncing causes asserts when updating the shadow tree without passing through the JS-thread. This diff disables the feature by default to avoid the asserts encountered on RN Windows.

Reviewed By: sammy-SC

Differential Revision: D64188839

fbshipit-source-id: eb65206662d842f8150f1771c86dc8d190cbc3aa
2024-10-11 08:35:34 -07:00
Fabrizio Cucci c09f824962 Replace React.AbstractComponent with component type in ActivityIndicator (#46951)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46951

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D64175898

fbshipit-source-id: 4db76dda0c4ac604c38dc3acf5bc39448cad006e
2024-10-11 06:53:43 -07:00
Fabrizio Cucci bcb6dafedc Replace React.AbstractComponent with component type in Pressable (#46950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46950

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D64175859

fbshipit-source-id: 56c3fe658a372b5148952850166781b733bbb37a
2024-10-11 06:53:43 -07:00
Riccardo Cipolleschi ce5358866f Disable e2e on PR (#46974)
Summary:
Commit https://github.com/facebook/react-native/commit/d4edbcffbf9e797d33bf06a8873c73874ec51bdc mistakingly enable iOS e2e on PRs
This change disable them again

## Changelog:
[Internal] - disable e2e in PRs

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D64239005

Pulled By: cipolleschi

fbshipit-source-id: 5b3655d1f8ebb07fd552f656fee0e8e3f255301a
2024-10-11 06:40:40 -07:00
Nicola Corti 972c2c864c Bump Kotlin 1.9.x to 2.0.x (#46955)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46955

This is a major bump of Kotlin. It comes with no breaking changes for the Kotlin API, but there are several new warnigns that I had to fix.
Most importantly several `override` methods that are overriding Deprecated API, also need to be deprecated as well in Kotlin.

Changelog:
[Android] [Changed] - Bump Kotlin 1.9.x to 2.0.x

Reviewed By: tdn120

Differential Revision: D64179842

fbshipit-source-id: 295ab2636ce9f9bb04e9d8c7ed27d9f8a1a64338
2024-10-11 05:34:02 -07:00
Riccardo Cipolleschi d4edbcffbf Move E2E tests to larger machines to see if flakyness decreases (#46960)
Summary:
This change move E2E tests to larger mac machines to see if we can reduce the flakyness.
Most of the time the flakyness is due to slowness in connecting to the simulator or slowness in Metro to provide the bundle to RNTester when we run the tests in Debug.
More power should speed-up those processes.

E2E tests took < 30 min in this diff
on Main, they took > 120 min

## Changelog:
[Internal] - Move the E2E tests to bigger machines

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

Test Plan: GHA

Reviewed By: blakef

Differential Revision: D64237659

Pulled By: cipolleschi

fbshipit-source-id: c2458413c8de70c07fae8f2b5f202371c6293815
2024-10-11 05:10:10 -07:00
Nicola Corti 2c4567562c RNGP - Pass PROJECT_ROOT_DIR to CMake (#46958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46958

This will make it easier to link against custom C++ TM which will most likely live inside ./shared or
some other paths outside of ./android.

CMake will have access to `PROJECT_ROOT_DIR` which points to ./android (the folder where the settings.gradle file exists).

Changelog:
[Internal] [Changed] - RNGP - Pass PROJECT_ROOT_DIR to CMake

Reviewed By: cipolleschi

Differential Revision: D64183641

fbshipit-source-id: 347256c04f10e92cf5a13e9c70db16aa29bcb741
2024-10-11 03:34:54 -07:00
Nick Gerleman b69a92e2c9 Add boxShadow support to BaseViewManager (#46936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46936

Let's enable box-shadow everywhere! This should be safe, now that we assume any background mutating methods in BaseViewManager go through BackgroundStyleApplicator. `boxShadow` is also already in `BaseViewConfig` instead of configs for each native component (bc we were already planning to make this change).

Changelog:
[Android][Added] - Add boxShadow support to BaseViewManager

Reviewed By: mdvacca

Differential Revision: D64140841

fbshipit-source-id: e937a4bcaa4506fd25d0916633313083c7e49333
2024-10-10 18:02:50 -07:00
Nick Gerleman 6741fd94ad Add missing BaseViewManager props to BaseViewManagerDelegate (#46934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46934

BaseViewManagerDelegate is a handcrafted second source of truth, used specifically for codegen.

The organization here has some problems, but this diff adds the props currently missing from it, so that these work correctly in generated view managers.

Changelog:
[Android][Fixed] - Add missing BaseViewManager props to BaseViewManagerDelegate

Reviewed By: mdvacca

Differential Revision: D64137615

fbshipit-source-id: 4ff85f2524e5472f3b768e212fd5f2d4d9a36e17
2024-10-10 18:02:50 -07:00
Ramanpreet Nara 9119c32785 earlyjs: Implement decoratedExtraDataKey (#46932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46932

In the old error handling pipeline, when the app [assigns an object to error[ExceptionsManager.decoratedExtraDataKey]](https://fburl.com/code/9t9u8rgv)

```
        const error = new Error('Some error happened');
        // Annotates the error with some custom extra data.
        error[ExceptionsManager.decoratedExtraDataKey] = {foo: 'bar'};
        ExceptionsManager.handleException(error, true);
```

That object [gets forwarded as extraData](https://fburl.com/code/gy7v173u) to ExceptionsManager.

This diff implements that functionality within the c++ earlyjs pipeline.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63927091

fbshipit-source-id: ac88bf3e545714aa42531e8e1365e2eba32a7c2b
2024-10-10 16:03:02 -07:00
Ramanpreet Nara 9619ba5ce6 Integrate logbox into earlyjs c++ pipeline (#46935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46935

Now, whenever the earlyjs c++ pipeline handles an error, it'll invoke callbacks registered via javascript.

## The API

```
if (global.RN$registerExceptionListener != null) {
  global.RN$registerExceptionListener(
    (error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
      error.preventDefault();

      // show logbox
    },
  );
}
```

## The Future API
We want something more aligned with the HTML spec:

```
addEventListener('error', (event) => {
   event.preventDefault();
   // show logbox
});
```

## Fatals vs soft errors
The earlyjs pipeline covers just main bundle execution for now.

So, it displays logbox only if there was a soft error. If there was a fatal error, it'll just continue to display redbox as usual.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63769385

fbshipit-source-id: 9c01e1cfe0ec80842af2e5bcfbf0adfb040dbcf3
2024-10-10 16:03:02 -07:00
Ramanpreet Nara 509abff063 Extend earlyjs c++ pipeline for soft errors (#46893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46893

Before, the c++ pipeline only supported fatal errors.

Now, it supports soft errors!

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63927090

fbshipit-source-id: ddaad0ea9b4aa1f889b24ca388cd6b9b1c83adba
2024-10-10 16:03:02 -07:00
Ramanpreet Nara 934af0c59e Align earlyjs c++ stack trace parsing with js (#46894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46894

This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++.

Details:
- I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7)
- I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82)

I also migrated all their tests to c++:
- [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5)
- [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16)

Changelog: [Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D63659013

fbshipit-source-id: 146acc9db7d4e8907b9fa1d42e4979133ef020f6
2024-10-10 16:03:02 -07:00
Ramanpreet Nara e4645d033a easy: Align earlyjs c++ native data structures with js (#46895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46895

For the js error handling pipeline, the javascript data structure looks like [this](https://www.internalfb.com/code/fbsource/[6181b57f4ba3619f58056bcec65382650d6ff59a]/xplat/js/react-native-github/packages/react-native/src/private/specs/modules/NativeExceptionsManager.js?lines=17-35):

```
export type StackFrame = {|
  column: ?number,
  file: ?string,
  lineNumber: ?number,
  methodName: string,
  collapse?: boolean,
|};
export type ExceptionData = {
  message: string,
  originalMessage: ?string,
  name: ?string,
  componentStack: ?string,
  stack: Array<StackFrame>,
  id: number,
  isFatal: boolean,
  // flowlint-next-line unclear-type:off
  extraData?: Object,
  ...
};
```

So, I made the c++ data structure look similar
```
  struct ParsedError {
    struct StackFrame {
      std::optional<std::string> file;
      std::string methodName;
      std::optional<int> lineNumber;
      std::optional<int> column;
    };

    std::string message;
    std::optional<std::string> originalMessage;
    std::optional<std::string> name;
    std::optional<std::string> componentStack;
    std::vector<StackFrame> stack;
    int id;
    bool isFatal;
    jsi::Object extraData;
  };
```

Notes:
* [parseErrorStack](https://fburl.com/code/e27q9gkc) doesn't actually generate a collapse property on the error object. So, I omitted it from the c++.
* ExceptionsManager [always provides an extraData field](https://fburl.com/code/2bvcsxac). So, I made it required.
* In C++, I just stored extraData as a jsi::Object. I wanted the freedom to store arbitrary key/value pairs. But, I also didn't want to use folly::dynamic.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D63929580

fbshipit-source-id: 51d8fcc79c9383789d456cfe4527cdd3f579395f
2024-10-10 16:03:02 -07:00
Eli White ff698f542e Make RN ColorScheme a Union (#46872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46872

This can now be flow typed as a union because the codegen supports it.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D63681874

fbshipit-source-id: 97783df5ae71292dd10602dee0bea39743e62234
2024-10-10 14:20:49 -07:00
Joe Vilches b0e2cb3371 Back out "fix(iOS): Replace uses of CGColorRef with UIColor to avoid manual memory management" (#46967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46967

Original commit changeset: 5e85e17567e3

Original Phabricator Diff: D63989547

This is causing some crashes internally

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D64194385

fbshipit-source-id: 835469e09971ae39d2db6e82f6c05970b1e6238c
2024-10-10 13:41:13 -07:00
Nicola Corti f25abe51ce Remove Deprecated DefaultDevSupportManagerFactory.create() (#46959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46959

This method was deprecated in: b8893c7003
since React Native 0.72.

I verified that no-one is using it in OSS so I'm removing it.

This is necessary as I'll need to refactor the BridgelessDevSupportManager a bit.

Changelog:
[Android] [Breaking] - Remove Deprecated DefaultDevSupportManagerFactory.create()

Reviewed By: javache

Differential Revision: D64184635

fbshipit-source-id: a4081b2189d2e22cd9b2067f982a6ffd4f8b054e
2024-10-10 11:32:37 -07:00
Pieter De Baets e4bdde6562 Remove default false/null props from Text (#46956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46956

isHighlighted/isPressable/selection color are the same as the native default, there's no need to send these in our props payload needlessly.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64179256

fbshipit-source-id: 22e62c8d440d3bd219a79f445e49739c24fa5d52
2024-10-10 11:30:11 -07:00
Peter Abbondanzo 09682b5109 Fix dark mode text (#46898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46898

Replaces *many* `Text` component usages with `RNTesterText`: a thin wrapper around `Text` that applies color based on the color scheme chosen by the user. It makes text legible for dark mode across 41 different example files. This changes intentionally do not touch a few larger component sites that expand beyond RNTester, like `Animated` and `NewAppScreen`

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64053464

fbshipit-source-id: 9516fef2afe1b364eb38e85e3a2dbb5c434e44db
2024-10-10 11:02:18 -07:00
Nikita Lutsenko f7b28e86aa rn/objc | Suppress warnings about set but unused variables. (#46945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46945

Fixing a warning, so we can enable it globally.

Changelog:
[iOS][Fixed] - Silenced 'set but unused variable' warning.

Reviewed By: cipolleschi

Differential Revision: D64161528

fbshipit-source-id: 39f80d46a04422dd167334a4492fd2119503ca23
2024-10-10 11:00:34 -07:00
Fabrizio Cucci f98006830c Replace React.AbstractComponent with component type in ProgressBarAndroid.android.js (#46928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46928

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64113211

fbshipit-source-id: f850739f9116cf0cc8705e541a97333aa04c3a44
2024-10-10 10:59:58 -07:00
Fabrizio Cucci c00f0d36b1 Replace React.AbstractComponent with component type in ScrollView (#46927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46927

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64112934

fbshipit-source-id: d869ccd814cd3bbda2a548c7c2d405f651605716
2024-10-10 10:59:58 -07:00
Fabrizio Cucci c8fd793cff Replace React.AbstractComponent with component type in ScrollViewStickyHeader (#46926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46926

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64111478

fbshipit-source-id: 674316b9545dd12420e50f77cff6ac1c94783d4e
2024-10-10 10:59:58 -07:00
Fabrizio Cucci 5d07c7232c Replace React.AbstractComponent with component type in TextInput (#46925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46925

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64109824

fbshipit-source-id: 9823a459c9bd4f3eed4d3c560f0bdaf4be16d410
2024-10-10 10:59:58 -07:00
Ruslan Shestopalyuk e39c91703d Add an event start timestamp field into RawEvent (#46949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46949

# Changelog:

[Internal] -

This adds an (optional) event start time field into RawEvent, so that it can be threaded by the platform-specific code to tell where is the earliest point of the event start (depending on the platform).

For example, on Android platform it can be the point of time when the original MotionEvent was received.

Reviewed By: rubennorte

Differential Revision: D64175467

fbshipit-source-id: 535c95c695713dbbed74c554bceb70fa5e511d6a
2024-10-10 09:12:15 -07:00
David Rickard 26d8d490e4 Fix null ref on iOS 18 (#46929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46929

Got this error on Marketplace Home when I tried on the iOS 18 simulator:

```
Cannot read property 'stack' of null

if (rejection.stack && ...
```

This indicated `rejection` was null.

Fixed by adding an extra null check there.

Changelog:
[iOS][Fixed] Fixed crash on promise rejection handler in iOS 18.

Differential Revision: D64116020

fbshipit-source-id: 4198748b47d27c6def9957ff475ee780962d3baa
2024-10-10 09:11:53 -07:00
sarthak-d11 af4907025e fix: change opacity logic from random to decrement by -0.20 (#46830)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

ME2E0003

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ Internal ] [ Changed ] - The opacity logic is changed from random to decrement the opacity by -0.2
For more details, see:

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

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D64173519

Pulled By: cipolleschi

fbshipit-source-id: 69a09b64e7e4f098d3bfd72529401dadb49b93d7
2024-10-10 08:59:25 -07:00
Fabrizio Cucci 1e8bee94cb Replace React.AbstractComponent with component type in TouchableBounce (#46924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46924

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64108765

fbshipit-source-id: bc10f958948c24b16964e63790a9cb40bce095e9
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 90523b62a5 Replace React.AbstractComponent with component type in TouchableHighlight (#46923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46923

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107889

fbshipit-source-id: 824e318da8e833f82d2bd869a8c6485ec9dd541e
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 8d230fa78a Replace React.AbstractComponent with component type in TouchableOpacity (#46922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46922

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107774

fbshipit-source-id: f7b9afa8b0a08cedc07c055054bd2cda9a2b5b84
2024-10-10 08:36:53 -07:00
Fabrizio Cucci 15f5ba4f9e Replace React.AbstractComponent with component type in DebuggingOverlay (#46921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46921

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107726

fbshipit-source-id: abd75fbb79db0b8f75b55c7c57e8b021b800256f
2024-10-10 08:36:53 -07:00
Thomas Nardone 6c35ff92dc View clipping tweaks (#46933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46933

Some small tweaks to either resolve or better log clipping-related crashes in ReactViewGroup
Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63914809

fbshipit-source-id: cf8bfd260c6affb85b8e1ac13447ae9f01d19135
2024-10-10 08:32:15 -07:00
Qichen Zhu ca0abd1b9e Set TextInput selection correctly when attached to window in Android (#46948)
Summary:
On Android, when `ReactEditText` is attached to window, `setTextIsSelectable` moves the caret to the beginning, so we need to restore the selection.

This is similar to what we did in https://github.com/facebook/react-native/pull/17851.

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

## Changelog:

[ANDROID] [FIXED] - Fix TextInput caret moving to the beginning when attached to window

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

Test Plan:
Code to reproduce in RNTester:

```TSX
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import {TextInput} from 'react-native';
import {useEffect, useRef} from 'react';

function Playground() {
  const input = useRef(null);
  useEffect(() => { setTimeout(() => input.current?.focus(), 1000); }, []);
  return <TextInput ref={input} value='1.00' selection={{start: 4, end: 4}} />;
}

export default ({
  title: 'Playground',
  name: 'playground',
  render: (): React.Node => <Playground />,
}: RNTesterModuleExample);
```

Before | After
-- | --
![Screenshot_1728553990](https://github.com/user-attachments/assets/382cf3ec-7437-4b0d-8c15-c8923d677afd) | ![Screenshot_1728553884](https://github.com/user-attachments/assets/9883e966-e9b8-4f8a-bedb-6ee43880d482)

Reviewed By: cortinico

Differential Revision: D64175774

Pulled By: rshest

fbshipit-source-id: ef9fdbecca582c8075bcdfd2d9b810b04d87e3d9
2024-10-10 08:29:56 -07:00
Sam Zhou 2bc25be88c Replace last React.Ref type usage in react-native (#46931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46931

Prepare for deletion of this deprecated type that contain support for string ref in the next flow release.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64127228

fbshipit-source-id: 9d3a1c0e6303efb35a540349fdc8e42b7b70be8b
2024-10-10 08:19:34 -07:00
Ruslan Lesiutin 4eceb7e568 Implement Runtime.releaseObject and releaseObjectGroup (#46032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46032

Changelog: [Internal]

Implements the [`Runtime.releaseObject`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObject) and [`Runtime.releaseObjectGroup`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObjectGroup) CDP methods. These are used by CDT in a few places to release inspected objects (e.g. as part of the [popover](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/7b143e5d05a102c8c9cc7e282bab7b0751f75d61/front_end/panels/sources/DebuggerPlugin.ts#L766) feature), which is important to prevent memory leaks in long-running Fusebox sessions.

Reviewed By: dannysu, robhogan

Differential Revision: D61280394

fbshipit-source-id: 82181c6d0d6e52cf606ef2f48d389631e44b295e
2024-10-10 07:49:46 -07:00
Oskar Kwaśniewski 7e1674fc59 feat: deprecate passing separate new arch flags to RCTRootViewFactory (#46652)
Summary:
This PR follows up with the deprecation introduced here: https://github.com/facebook/react-native/pull/46228

The idea is to have new architecture depend on one flag, namely `newArchEnabled`. It exposes additional initializers for RCTRootViewFactory.

## Changelog:

[IOS] [CHANGED] - Use `newArchEnabled` flag in RCTAppDelegate and RCTRootViewFactory

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

Test Plan: CI Green

Reviewed By: javache

Differential Revision: D64173015

Pulled By: cipolleschi

fbshipit-source-id: 49474baf5415a2527e481a5d68ec94ae874185e6
2024-10-10 07:39:16 -07:00
Fabrizio Cucci 865f302e0c Replace React.AbstractComponent with component type in ImageTypes (#46920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46920

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64107532

fbshipit-source-id: 9fb09e0b5735f9f7b91b46867e35043fe9d679f0
2024-10-10 07:01:29 -07:00
Fabrizio Cucci 5f058018dc Replace React.AbstractComponent with component type in various examples (#46919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46919

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64105531

fbshipit-source-id: 5729862a95f544a3c1e1a88484d145ba92e192a6
2024-10-10 07:01:29 -07:00
Fabrizio Cucci 6e2b9daf7d Replace React.AbstractComponent with component type in VScrollViewNativeComponent (#46917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46917

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64108764

fbshipit-source-id: 44cf9316a03bb18b658aeb45b7d951ad346ae3f0
2024-10-10 07:01:29 -07:00
Fabrizio Cucci f86a14e4ad Replace React.AbstractComponent with component type in View (#46916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46916

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64104990

fbshipit-source-id: c747f4e89b5631a6c1543aca86cbea4db4987f5a
2024-10-10 07:01:29 -07:00
Dawid ab8f3ff3e9 fix: vertical scroll views are detected as horizontals (#46836)
Summary:
There is a numerical issue that causes vertical scroll view to be considered as the horizontal one and leads to problems described [here](https://github.com/facebook/react-native/issues/46592). The problem is no longer visible after checking if the scroll view is horizontal with float equality.

~~I am not sure if it also happens on Android, so I am leaving it as a draft for now.~~

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

## Changelog:

[IOS] [FIXED] - check if scroll view is horizontal with float equality.

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

Pick one each for the category and type tags:

[IOS] [FIXED] - fixed scroll view

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

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

Test Plan: Tested on the repro provided in the above issue.

Reviewed By: rshest

Differential Revision: D64114476

Pulled By: cortinico

fbshipit-source-id: a5048e1403c4bb675d32928937d6411cfb12fd51
2024-10-10 06:37:28 -07:00
Fabrizio Cucci 46a9711454 Replace React.AbstractComponent with component type in SafeAreaView (#46913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46913

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64104922

fbshipit-source-id: 3210b6b7368872f13f9006bb1b19de9f92aa4bc8
2024-10-10 05:21:53 -07:00
Edmond Chui 91a40a28de Fusebox reload-to-profile (Part 1 of 2: native) (#46856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46856

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/117
React: https://github.com/facebook/react/pull/31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256

fbshipit-source-id: f2f2814491e785b03af143cc26639ef178881fff
2024-10-10 05:20:18 -07:00
zhongwuzw 77889afa1c Fixes missing char mode of linebreakmode (#46941)
Summary:
cipolleschi , Fixes missing char mode of linebreakmode.

## Changelog:

[IOS] [FIXED] - Fixes missing char mode of linebreakmode

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

Test Plan: char mode works.

Reviewed By: cipolleschi

Differential Revision: D64166107

Pulled By: javache

fbshipit-source-id: 1b1a5c603652e1d3bc9f7a32039fab4de7f59627
2024-10-10 04:24:49 -07:00
Joe Vilches 0d6908f4ed Sunset the value namespace (#46930)
Summary:
X-link: https://github.com/facebook/yoga/pull/1720

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

This is not really needed anymore, we can just use `StyleLength` statics instead

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63922280

fbshipit-source-id: cd953bae8e9f68574463eafc49c33c2e85ac1856
2024-10-09 19:20:15 -07:00
Saad Najmi b70709dbc2 fix(iOS): Replace uses of CGColorRef with UIColor to avoid manual memory management (#46847)
Summary:
Update React Native on iOS to do less manual memory management, by replacing uses of `CGColorRef` with `UIColor`, and only calling `UIColor.CGColor` when needed. This results in much less manual memory management, which is probably a good thing in 2024 :D. The downside is there is a breaking change: the signature of a method in `RCTBorderDrawing` changes.

This is a followup to https://github.com/facebook/react-native/issues/46797 . After that PR merged and I tested merging React Native macOS to the `0.76-stable` branch cut commit again, I saw even more places I needed to manually call `CGColorRetain` / `CGColorRelease`. The reason is due to React Native macOS specifics (explained below) and I could update React Native macOS to not need these changes, but I thought I would at least throw up a PR to propose the changes, as it may be good to move away from using Core Graphics' C base API as much as possible.

## Longer Explanation

With https://github.com/microsoft/react-native-macos/pull/2209 , I wrote a shim of [UIGraphicsImageRenderer](https://developer.apple.com/documentation/uikit/uigraphicsimagerenderer) for macOS. The main difference is my shim calls the NSImage API [imageWithSize:flipped:drawingHandler:](https://developer.apple.com/documentation/appkit/nsimage/1519860-imagewithsize?language=objc) to shim the UIGraphicsImageRenderer API [imageWithData:](https://developer.apple.com/documentation/uikit/uiimage/1624137-imagewithdata). The difference between the two is that the macOS API copies the block, and executes it when Appkit is about to draw the image, while the iOS API executes the block right away. Because of this, I think I am hitting way more places where `CGColorRef` variables needed to be retained / released. Additionally, I hit more of them when I merge to the 0.76 branch cut commit (this is why I didn't catch it with https://github.com/facebook/react-native/issues/46797).

Given this constraint, I have a couple of options:
1. Refactor my macOS shim to use the deprecated API [[NSImage lockFocus]](https://developer.apple.com/documentation/appkit/nsimage/1519891-lockfocus)
    - I am not a fan of this because `lockFocus` was deprecated for `imageWithSize:flipped:drawingHandler:`
2. Refactor my macOS shim to do what we used to do: Create a CGContext manually and write it to an image
    - This is probably OK. Relies on less Appkit specifics, and potentially gives more control to RN on the rendering layer, which I recall lenaic told me is better for Fabric)
3. Refactor React Native to avoid CGColorRef altogether, and use `UIColor` (which ARC will memory manage for us) as much as possible.
    - This is the approach of this PR and my preferred approach. The downside is this changes the signature of some of the methods in `RCTBorderDrawing` which is a breaking change. I've seen other PRs do this, so maybe its OK?

## Changelog:

[IOS] [BREAKING] -  Replace uses of `CGColorRef` with UIColor to avoid manual memory management

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

Test Plan: Launching RNTester's View example (which tests a lot of the border / outline / shadow rendering) does not crash for me on both iOS and macOS.

Reviewed By: NickGerleman

Differential Revision: D63989547

Pulled By: joevilches

fbshipit-source-id: 5e85e17567e3dd8b4b0388452398954ad2e02464
2024-10-09 16:42:17 -07:00
Tatiana Kapos 0794fa909b fix(Windows): Fix cast and control paths errors on windows (#46899)
Summary:
Windows has a stricter set of rules for C++ files where we treat warning as error, the following files have fixes to correctly cast numbers and fix control path errors.

Control Path Error on React-Native-Windows repo:
```
1>react-native-windows\node_modules\react-native\ReactCommon\react\performance\timeline\PerformanceEntryReporter.h(138,1): warning C4715: 'facebook::react::PerformanceEntryReporter::getBufferRef': not all control paths return a value
1>react-native-windows\node_modules\react-native\ReactCommon\react\performance\timeline\PerformanceEntryReporter.h(154,1): warning C4715: 'facebook::react::PerformanceEntryReporter::getBuffer': not all control paths return a value
```

Apply these fixes will allow us to unfork these files in our repo :)

## Changelog:

[GENERAL] [FIXED] - Fix cast and control paths errors on windows

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

Test Plan: Tested on the RNW repo, these files are already forked with the respective fix

Reviewed By: cipolleschi

Differential Revision: D64086963

Pulled By: arushikesarwani94

fbshipit-source-id: fdad72dafa1a01c426536fc1b007dd4a83588d93
2024-10-09 16:12:16 -07:00
Nick Gerleman 7fb3d830be Breaking: Remove BaseViewManagerInterface (#46809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46809

BaseViewManagerInterface isn't adding much value right now. It was added in D16984121 to allow codegen generated ViewManager delegates to apply to view managers which derive from ViewMangager instead of BaseViewManager (if they did some cleverness, to make VM delegate apply to a no-op class, still implementing all of BaseViewManager's methods).

All of the cases where that was used have since been moved to `SimpleViewManager`, and `BaseViewManagerAdapter` (needed to wire this together) doesn't exist anymore, so it's not possible to take any advantage of this interface existing. We should remove it, since its existence  is a source of error (e.g. it was missing setters for `accessibilityValue` or those related to pointer events), and is more generally confusing for anyone adding to `BaseViewManager` in the future.

This is a breaking change, because there are some libraries which vendor a copy of generated ViewManagerDelegate when building against legacy arch to be able to share code normally generated at build time. That means these will need to be updated to maintain compatibility with RN versions of 0.77+ with new arch disabled. This will not effect compatibility of these libraries against the default new arch, and the updated delegate is still compatible with older RN version.

```
    sourceSets.main {
        java {
            if (!isNewArchitectureEnabled()) {
                srcDirs += [
                    "src/paper/java",
                ]
            }
        }
    }
```

1. `react-native-picker/picker`
2. `rnmapbox/maps`
3. `react-native-gesture-handler`
4. `react-native-screens`
5. `react-native-svg`
6. `react-native-safe-area-context`
7. `react-native-pdf`

Changelog:
[Android][Breaking] - Remove BaseViewManagerInterface

Reviewed By: cortinico

Differential Revision: D63819044

fbshipit-source-id: 7e4935c8e43706b168f0f599a6676e8abfa66937
2024-10-09 14:49:01 -07:00
Fabrizio Cucci c5a12df6f7 Replace React.AbstractComponent with component type in Text (#46912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46912

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64103863

fbshipit-source-id: 8a443d02b2ab8836056fa8756180d7e6942f531e
2024-10-09 12:55:12 -07:00
Fabrizio Cucci 37e0973bb3 Replace React.AbstractComponent with component type in Switch (#46911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46911

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64103195

fbshipit-source-id: e0ff745c70df910dcb84ed3a824d67883bbfc44d
2024-10-09 12:55:12 -07:00
Deepanshu.shukla 3102a58df3 test: pressable test cases (#46861)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757

Solves:
ME2E0015
ME2E0016

## Changelog:

[ Internal ] [ Added ] - Add e2e test for pressable

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: arushikesarwani94

Differential Revision: D63986636

Pulled By: cipolleschi

fbshipit-source-id: 4b58da97be3c7a14584f0343b6449b407c9517d2
2024-10-09 07:39:02 -07:00
sarthak-d11 d0e5053528 chore: test case added for Image (#46831)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

ME2E0019
## Changelog:
[ Internal ] [ Added ] - Added a test case for Image
<!-- 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/46831

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: cortinico

Differential Revision: D63889719

Pulled By: cipolleschi

fbshipit-source-id: 674879066ec159f11894f24935fe39a86ea1ea63
2024-10-09 07:17:24 -07:00
Eric Rozell 0449630612 Resolve Paper leak on Android (#46896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46896

On Android Paper UIManager, when calling `ReactRootView.unmountReactApplication`, the ReactRootView tag is unset [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java#L926), before the round trip unmount operation to JS makes it's way back to a `dropView` call on `NativeViewHierarchyManager`.

In practice, this means that legacy architecture apps that unmount surfaces via `ReactRootView.unmountReactApplication` leak references to Views, and the "finalization" step (`onDropViewInstance`) is not universally called.

This is an attempt to fix the issue by skipping the `clearReactRoot` step on Paper, instead waiting for the round trip `UIManager.removeRootView` call.

## Changelog

[Android][Fixed] Fix issue where `onDropViewInstance` cleanup was not being handled after `ReactRootView.unmountReactApplication`

Reviewed By: javache

Differential Revision: D64054042

fbshipit-source-id: b8b8c237796674ca23a332e57a1bf2e07ab5af13
2024-10-09 05:25:10 -07:00
Marc Rousavy 87bae7f734 feat: Add CallInvoker to installJSIBindings(..)/BindingsInstaller (#46851)
Summary:
While the new `installJSIBindings(..)`/`BindingsInstaller` functionality allows you to synchronously set up stuff in the JS runtime before JS runs, there is no access to the JS CallInvoker, meaning you cannot really set up anything that uses callbacks or asynchronous code.

[Nitro](https://github.com/mrousavy/nitro) needs this.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[IOS] [ADDED] - Add `CallInvoker` to `installJSIBindings(..)`
[ANDROID] [ADDED] - Add `CallInvoker` to `BindingsInstaller`

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

Test Plan: In `SampleTurboModuleJSIBindings`, we can now use the `CallInvoker`.

Reviewed By: rshest

Differential Revision: D63975546

Pulled By: javache

fbshipit-source-id: 43cd469de2c35581f5362d2500fc27e41d6eab72
2024-10-09 04:36:04 -07:00
Blake Friedman eeaa3ff458 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-09 04:14:31 -07:00
Rubén Norte 5f00db970f Use CommonJS in feature flags definitions to simplify loading from Node.js (#46887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46887

Changelog: [internal]

This is a small change to use CommonJS in `ReactNativeFeatureFlags.config.js` so the file can be easily imported from Node.js.

Reviewed By: jorge-cab

Differential Revision: D64039860

fbshipit-source-id: c84ddbdbfe942224e213d12b9496c41b73dd5731
2024-10-09 03:40:20 -07:00
Nicola Corti a268b2bf53 Enable warningAsErrors for RN-Tester (#46817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46817

As I've cleaned up all the RN Tester warnings, I'm enable warningAsErrors for RNTester to make
sure we keep up with our warning count.

Changelog:
[Internal] [Changed] - Enable warningAsErrors for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D63837633

fbshipit-source-id: f83273dadc7aa10ce7ae52ae790279819fb88345
2024-10-09 03:12:27 -07:00
Blake Friedman e4814b0d6d Add description to CLI arguments (#46890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46890

Add details as this is discussed in the Turbo Native Modules documentation going out in 0.76:

```
Usage: combine-js-to-schema-cli.js <outfile> <file1> [<file2> ...]

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
  -p, --platform  Platforms to generate schema for, this works on filenames:
                  <filename>[.<platform>].(js|tsx?)              [default: null]
  -e, --exclude   Regular expression to exclude files from schema generation
                                                                 [default: null]
```

## Changelog:
[General][Added] Add cli --help details to combine-js-toschema-cli.js

Reviewed By: dmytrorykun

Differential Revision: D64045337

fbshipit-source-id: a4b977da2cbb0198a5d43f17ca3466ebde21e9a9
2024-10-08 19:22:29 -07:00
Panos Vekris 380175865b remove '$TEMPORARY$array' (#46897)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46897

Reviewed By: SamChou19815

Differential Revision: D64051902

fbshipit-source-id: 0cbcbb81f86f1383c7237b306cdbc839938c17b7
2024-10-08 16:33:45 -07:00
Peter Abbondanzo 768a1d8664 Add example of different resize methods (#46873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46873

## Summary

Adds a small showcase for the different `resizeMethod` options and how downsampling is applied

## Changelog

[Android][Added] - Added showcase for Android `resizeMethod` options when applied to a large image

Reviewed By: rshest

Differential Revision: D62393212

fbshipit-source-id: 46e7ff6310617acb9eb288e3831c0b5e6b1751c8
2024-10-08 16:18:27 -07:00
Arushi Kesarwani 52f8c57ac6 RN][Android] Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android (#46904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46904

Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android, default false

Changelog: [internal] internal

Reviewed By: fryfrog

Differential Revision: D64073913

fbshipit-source-id: 0d92fd47c4905e74d734113e921511120037bd8d
2024-10-08 16:11:12 -07:00
Arushi Kesarwani 05cc40952c Revert D64062268: Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android
Differential Revision:
D64062268

Original commit changeset: 474e191e6a67

Original Phabricator Diff: D64062268

fbshipit-source-id: 9003d52d60b98999a478d2bf797e2ad58c82054d
2024-10-08 15:14:27 -07:00
David Vacca 4763ef3121 Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android (#46903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46903

Add a ReactNativeFeatureFlag to enable/disable LayoutAnimations in Android, default false

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D64062268

fbshipit-source-id: 474e191e6a677065681b512a93af74908e8250f5
2024-10-08 15:03:11 -07:00
Peter Abbondanzo 6202319ed5 Add resizeMethod type 'none' to disable downsampling on Android (#46866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46866

## Summary
Adds a new `resizeMethod` called `none`. It disables downsampling on the image request and disregards the global image pipeline default. This has been a pain point raised when rendering large images on Android in issues like [this one](https://github.com/facebook/react-native/issues/21301) and [this one](https://github.com/facebook/fresco/issues/2397).

## Changelog
[Android][Added] - Adds a new `resizeMethod`, `none`, which disables downsampling for an image

Reviewed By: yungsters

Differential Revision: D62393211

fbshipit-source-id: d85e3ed098ad502c8edbdfa817c841271ee9e914
2024-10-08 13:29:15 -07:00
Nikita Lutsenko d386dfc804 rn | Remove set but unused variable. (#46891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46891

This was set but never directly used - fix it.
Changelog:
[iOS][Fixed] Removed usage of set but unused variable.

Reviewed By: mg-here

Differential Revision: D64029449

fbshipit-source-id: 0d60428317de95aa235f249c512fa968aa04f879
2024-10-08 12:48:45 -07:00
generatedunixname89002005232357 6b2bbcf632 Revert D63643856
Summary:
This diff reverts D63643856

`_highestMeasuredFrameIndex` is not properly invalidated causing issues with previous logic when data size shrinks.

bypass-github-export-checks

Changelog:
[General][Changed] - Revert "Fix onEndReached not being called when getItemLayout is present and we scroll past render window"

Reviewed By: NickGerleman

Differential Revision: D64009287

fbshipit-source-id: 8a21b57f5247fc743e65f9a730ff33a9a89d2bc1
2024-10-08 12:13:10 -07:00
Nicola Corti cbc0978bb6 Bump AGP to 8.7.0 (#46886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46886

This brings AGP to the latest stable version.

Changelog:
[Android] [Changed] - Bump Android Gradle Plugin (AGP) to 8.7.0

Reviewed By: tdn120

Differential Revision: D64038466

fbshipit-source-id: d7ba1c8e5840f6c8658f037fc5846fb640ab3922
2024-10-08 10:59:40 -07:00
Anatoliy Magda d54c25fdae Improve FpsDebugFrameCallback.getTotalTimeMS accuracy (#46869)
Summary:
`FpsDebugFrameCallback.getTotalTimeMS()` implementation loses accuracy due to incorrect order of type casting to int

## Changelog:

[ANDROID] [CHANGED] - Improve FpsDebugFrameCallback.getTotalTimeMS() accuracy

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

Test Plan:
- Launch some test app
- Open up the [Dev Menu](https://reactnative.dev/docs/debugging#accessing-the-dev-menu) in your app and toggle Show Perf Monitor
- Compare results of current & improved implementations

Reviewed By: rshest

Differential Revision: D64024054

Pulled By: arushikesarwani94

fbshipit-source-id: 438792bace0e3443d151cf13364f6e94b66dfb5e
2024-10-08 10:49:10 -07:00
Panos Vekris 19fc1c75d4 replace '$TEMPORARY$object' with '$ReadOnly' [1/n] (#46879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46879

* `js1 flow-runner codemod flow/replaceTempObjWithReadOnly`
* Suppress errors

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D64019269

fbshipit-source-id: 811deeff3be2f9ebed750719da67a4e87a074a67
2024-10-08 10:28:56 -07:00
Panos Vekris 9038a78948 replace '$TEMPORARY$string<str>' with 'str' (#46877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46877

* Used codemods of [this commit](https://www.internalfb.com/intern/commit/cloud/FBS/3a8982d63197fff7bac8b6d448545ec9660f331e)
* `flow-runner codemod flow/replaceTempStringWithStringLiteral`
* `~/fbsource/xplat/js/scripts/flow/tool add-comments .`

Reviewed By: SamChou19815

Differential Revision: D63991777

fbshipit-source-id: 0b2314c4e88c43c0ca1f92f34516f2408a30624b
2024-10-08 10:28:56 -07:00
Sam Zhou 9b5fef32f1 Update some React.AbstractComponent type to use component type (#46855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46855

Prepare for the ref-as-prop typing change in flow.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D63947642

fbshipit-source-id: bec8a2498961b5bc602d86ecb2b5a4b5c4785e09
2024-10-08 09:20:42 -07:00
Thibault Malbranche d7a8aae9ac 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

## Changelog:

[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-08 08:09:25 -07:00
Riccardo Cipolleschi 7c0258ab2c Add changelog for 0.73.10 (#46889)
Summary:
Add changelog for 0.73.10

## Changelog:
[Internal] - Add changelog for 0.73.10

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

Test Plan: N/A

Reviewed By: blakef

Differential Revision: D64042711

Pulled By: cipolleschi

fbshipit-source-id: b98d2793672ab031c88e96fe6047b1bb1ec486f6
2024-10-08 07:59:51 -07:00
Peter Abbondanzo ff1c3824d2 Remove unused vector drawable code path (#46878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46878

Removes an unused code path from `ResourceDrawableIdHelper`. Vector drawables are now loaded via Fresco decoder so we don't need to offer this utility anymore. While part of the public API, it only made it into 0.76.0 RCs and should have really been marked internal.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64021956

fbshipit-source-id: 6e8073e0f7f079d023fa1e45a5a43f8652ca2826
2024-10-08 07:24:28 -07:00
Alonso Paulino aaf7a6a3ab Back out "cache JNI calls to FabricUIManager::getColor" (#46871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46871

changelog: [internal]

Original commit changeset: 748efce7f0b8

Original Phabricator Diff: D59859754

This is temporarily until we find an actual solution that can both cache the colors and also react to theme changes updating the colors value properly.

Reviewed By: javache

Differential Revision: D64002346

fbshipit-source-id: 9ba3bd0d653b9a0d8617f45d42c0c3d966fba01f
2024-10-08 04:39:27 -07:00
Panos Vekris 40a4feb681 replace '$TEMPORARY$string<>' with 'string' (#46876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46876

* Used codemods of [this commit](https://www.internalfb.com/intern/commit/cloud/FBS/3a8982d63197fff7bac8b6d448545ec9660f331e)
* `js1 flow-runner codemod flow/replaceTempStringWithString`
* `js1 flow-runner codemod flow/simplifyUnionsOfString`

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D63991775

fbshipit-source-id: 5b9d1fdf045405230ca2b0969357ae92479692b5
2024-10-07 19:18:14 -07:00
Panos Vekris bed5323374 manually remove instances of '$TEMPORARY$string<>' (#46874)
Summary:
Remove instances of an unsound flow type

Changelog: [internal]

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

Reviewed By: SamChou19815

Differential Revision: D63991776

fbshipit-source-id: 1817b1287803d22195bf521e07b3027b86562f47
2024-10-07 19:18:14 -07:00
Arushi Kesarwani 7b877a4bed Adding support for custom C++ TM wrapper to CxxReactPackage (#46822)
Summary:
Modifying the CxxReactPackage by changing the annotation from UnstableReactNativeAPI to FrameworkAPI so as to now support custom C++ TM wrapper

Changelog:
[Android][Changed] - Modify CxxReactPackage to support custom C++ TM wrapper

Reviewed By: shwanton, christophpurrer

Differential Revision: D63740964

fbshipit-source-id: 175b1104dcd11674413199b30415516d4d324a97
2024-10-07 17:28:00 -07:00
Eli White a669de1dd2 Parse string unions as StringLiteralUnionTypeAnnotation (#46845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46845

Previously, the parser was throwing away the values of a string union when storing it in the schema. It would only store the union as

```
{
  type: 'UnionTypeAnnotation',
  memberType: 'StringTypeAnnotation'
}
```

We now track the string literals through the parser and store them in the schema:

```
{
  type: 'StringLiteralUnionTypeAnnotation',
  types: [
    {
      type: 'StringLiteralTypeAnnotation'
      value: 'light'
    },
    {
      type: 'StringLiteralTypeAnnotation'
      value: 'dark'
    },
  ],
}
```

We aren't changing the generators, those still just output "string". They could eventually be made smarter.

The value of this is that the compat checker can now error when the union changes.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D63917685

fbshipit-source-id: 34a10e1f1910d2935837a3659f66049fd4473134
2024-10-07 16:56:04 -07:00
Eric Rozell 1ffef5669c Fix for multi-root apps with Modal (#46867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46867

In multi-root Android React Native apps (e.g., multiple ReactFragments), if the following sequence occurs:
1. a Modal is displayed via the secondary root
2. the secondary root is destroyed
3. the app is backgrounded
4. the app is foregrounded

The LifecycleEventListener on the ReactModalHostView will fire, causing the Modal to be rehydrated in the onHostResume callback.

Removing the lifecycle event listener when the modal is detached from the window resolves the issue.

## Changelog

[Android][Fixed] Fix issues with Modals and lifecycle events in multi-surface apps

Reviewed By: alanleedev

Differential Revision: D64001103

fbshipit-source-id: 10f8304cd9cca0d5c90e39f5e361290f4fc35283
2024-10-07 16:09:53 -07:00
Peter Abbondanzo 86d92e41d2 Bump Fresco version to 3.3.0 (#46864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46864

## Summary
Fresco v3.3.0 contains necessary adjustments to allow downsample overrides per image request (see https://github.com/facebook/fresco/pull/2787), as well as numerous other bug fixes and adjustments across both Drawee and Vito images.

## Changelog
[Android][Changed] - Update Fresco from 3.2.0 to 3.3.0

Reviewed By: oprisnik

Differential Revision: D63983051

fbshipit-source-id: 9ad0c40dfc864d24ffa39ca9e2bc0ddf8210f4f7
2024-10-07 13:44:44 -07:00
Eli White d2f3f06826 Add support for StringLiteralTypeAnnotation (#46827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46827

You can now define a native module that takes an argument that is a specific string literal:

Like this:
```
export interface Spec extends TurboModule {
  +passString: (arg: string) => void;
  +passStringLiteral: (arg: 'A String Literal') => void;
}
```

On the native side, this will still generate `string`, but the schema will now store the string literal, and it will be allowed in JS. This should allow more strict flow / typescript types for modules.

This will also allow the compatibility check to fail if the literal changes.

This is a step towards accepting a union of string literals.

Changelog: [General][Added] Codegen for Native Modules now supports string literals

Reviewed By: GijsWeterings

Differential Revision: D63872440

fbshipit-source-id: e54b97d34af4a3d1af51727db0777f26fb7b778c
2024-10-07 12:35:19 -07:00
Alan Lee 73ce1984e8 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-07 12:31:20 -07:00
Thomas Nardone eb04be8ec0 Add ReactViewGroupTest (#46843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46843

Add some simple tests for ReactViewGroup clipping logic

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63903975

fbshipit-source-id: 8ce683a4aeba2f3916a26d7b4e93b4a30227c6d5
2024-10-07 10:37:44 -07:00
Nick Gerleman 276e3a7df7 Fix mising ANTI_ALIAS_FLAG when resetting Text Paint (#46848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46848

D63303172 introduced a bug showing truncation on versions of Android <= 28. I tracked this down to `ANTI_ALIAS_FLAG` getting cleared when we reset the paint. This applies it again after resetting, for consistency with previous behavior, and TextView.

This bug doesn't effect newer versions of Android, since API 29+ applies this flag by default. https://github.com/aosp-mirror/platform_frameworks_base/commit/47c51fe80e3dd9d6b518c11c2e1714c271835af5#diff-57b6a0bc3755a19d1faf73c130b0e56e8e13930148c5434666c5a186aeb01c78R256

Changelog:
[Android][Fixed] - Fix mising `ANTI_ALIAS_FLAG` when resetting Text Paint

Reviewed By: javache

Differential Revision: D63930051

fbshipit-source-id: bb4c98834954637b0a8f0dba8502188626a68b54
2024-10-07 10:34:32 -07:00
Vitali Zaidman 8bbd3a8fb4 do not require @fb-tools/babel-register in open source (#46863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46863

open source should not require `fb-tools/babel-register`

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D63976514

fbshipit-source-id: 83302adfc8059d294ca568f9edf1aa24d0244933
2024-10-07 09:36:47 -07:00
Tomasz Żelawski cc6d1eb844 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 06:35:01 -07:00
Nick Lefever 7510ba3c2a Clean up layout-only shadow node reference update feature flag (#46825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46825

Changelog: [Internal]

Removing the `useRuntimeShadowNodeReferenceUpdateOnLayout` feature flag after releasing `useRuntimeShadowReferenceUpdate`.

Reviewed By: shwanton

Differential Revision: D63831444

fbshipit-source-id: 61fd800f5c9f933ce5c18d066a6b5984daed2647
2024-10-07 06:11:36 -07:00
Nick Lefever 7316e3233d Remove layout-only shadow node reference updates (#46824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46824

Changelog: [Internal]

Removing the implementation of layout-only shadow node reference updates, since the full version of shadow node reference updates are being released.

Reviewed By: shwanton

Differential Revision: D63831453

fbshipit-source-id: 84cb231be6c16bdc4a4b12a559c41b5a77064813
2024-10-07 06:11:36 -07:00
Nick Lefever de56fb6309 Enable shadow node reference updates by default (#46823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46823

Changelog: [Internal]

Releasing runtime shadow node reference updates, enabling it by default.

Reviewed By: shwanton, rubennorte

Differential Revision: D63829891

fbshipit-source-id: 9292df3f8c7c8986d8e06d3c526ad1e6e8773916
2024-10-07 06:11:36 -07:00
Alex Hunt 2f07130bb3 Align logIfUpdateAvailable to use resolved RN version from CLI (#46777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46777

Simplifies this internal logic plus ensures there is one source of truth for `reactNativeVersion` in our CLI plugin. Also, renames the `ctx` variable to `cliConfig`, to more clearly signal that this is an integration point with the Community CLI.

Completes this wave of `community-cli-plugin` simplifications.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D63534247

fbshipit-source-id: bf5779fcf971dee1e0caf58b071df360636c53e9
2024-10-07 05:53:37 -07:00
Nicola Corti d1a256f51a Remove ReactNativeFlipper object (#46839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46839

The `ReactNativeFlipper` object is not referenced in the template since 0.75. We can safely remove it as users should not reference it anymore.

Changelog:
[Android] [Breaking] - Remove ReactNativeFlipper object, deprecated in 0.75

Reviewed By: huntie

Differential Revision: D63897187

fbshipit-source-id: a7d73a98550518e46f8dbc0c9b859e0afb16e8a9
2024-10-07 04:51:45 -07:00
Ramanpreet Nara d0912ed067 Fix global.__fetchSegment's error case (#46854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46854

When segment fetch fails, it seems incorrect to call the callback twice: once with error, and once with null.

This seems like a bug.

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D63959015

fbshipit-source-id: f3ebb0f4732d99d91b5717a5bf193f44d957bde4
2024-10-06 15:13:40 -07:00
Nicola Corti 352c063589 Removed unused mJSEngineResolutionAlgorithm from ReactHostImpl (#46842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46842

This filed is unused, let's just remove it.

Changelog:
[Internal] [Changed] - Removed unused `mJSEngineResolutionAlgorithm` from ReactHostImpl

Reviewed By: NickGerleman

Differential Revision: D63899705

fbshipit-source-id: 09fbd57333b32071540bf4c0aab9200a83a76010
2024-10-04 20:59:22 -07:00
Nick Gerleman 0b0ac81fbe Fix some cases where we override setBackgroundColor on View-level instead of VM level (#46846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46846

As of D61658739, BaseViewManager setting color now goes through BackgroundStyleApplicator, which gives a default implementation of setting a background color, while storing information in a way where we can impement things like border radii and shadows on background for out of the box views.

I knew this could lead to breaks where we previously overrode view-level `setBackgroundColor` to do something custom, but didn't override on VM level, but didn't see any external usages so I assumed it should be relatively safe. Turns out we have some internal usages which run into this pattern (D63913128 already fixed one), including a usage in RN itself! Let's override the view managers in these to delegate to the view's custom drawing.

Changelog:
[Android][Fixed] - Fix some cases where we override setBackgroundColor on View-level instead of VM level

Reviewed By: Abbondanzo

Differential Revision: D63922722

fbshipit-source-id: af988d1436c790be97b2be1325541aa418bf43a3
2024-10-04 18:43:49 -07:00
Joe Vilches 3f1e381ded Add RNTester box sizing example and e2e test round 2
Summary:
Add the tests back!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63844898

fbshipit-source-id: 6c08557e54be01a1dc156cf72f187a5bb6c5d791
2024-10-04 17:07:05 -07:00
Joe Vilches 3ca796edc3 Plumbing to get boxSizing prop to Yoga round 2 (#46820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46820

Relanding this as we had to unship due to some issues, which are fixed in the previous diff

Reviewed By: NickGerleman

Differential Revision: D63844167

fbshipit-source-id: b3e62004fe87ff732aac1c1622ac35d581b4980f
2024-10-04 17:07:05 -07:00
Joe Vilches f3d51ef519 Fix issue where padding for box sizing is resolved against wrong reference length (#46799)
Summary:
X-link: https://github.com/facebook/yoga/pull/1715

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

Content box impl had a bug where we resolved padding % against the same reference length as the dimensions. Padding should always be against containing block's width. This is also true for width, but not for height, which should be against containing block's height.

This just pipes the width into our box sizing functions.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63787577

fbshipit-source-id: e512338770f25b66506cabab5a7cde8f04397ea0
2024-10-04 17:07:05 -07:00
Benoit Girard f0527d8662 Instrument XMLHttpRequest (#46844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46844

Currently we can't see when a network query is made. It makes it hard to debug performance in apps like Store because it's unclear which queries are preloaded, which are fetched as early as they can and which ones are fetched late.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D63858486

fbshipit-source-id: 29d74a68f96a7d4c7b212453d7c0ceba525f3e39
2024-10-04 14:27:25 -07:00
Riccardo Cipolleschi ab2c47be28 Fix deadlock when a new surface is getting started while another is stopped (#46841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46841

Some apps are crashing because surfaces are started and stopped concurrently and this can create a deadlock.

This is an attempt to disentangle the deadlock by not moving synchronously to the main queue when starting a surface

## Changelog
[iOS][Changed] - Do not move to the main queue synchronously when starting a new surface

Reviewed By: fkgozali

Differential Revision: D63899469

fbshipit-source-id: 98cb313ebd610c65f6b06a683912856a00102e44
2024-10-04 13:23:20 -07:00
Eli White 3af126b562 Add support for basic unions for native modules (#46747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46747

You can now use unions in native modules.

Support for this pretty much existed, but one callsite was throwing for non-cpp modules which meant nobody could use this.

Previously, StructCollector would throw that this was not supported because it couldn't generate it for objc. Instead of generating something smart in the native code for each option, it just tells native to treat them like the base type (number, string, object).

Changelog: [General][Added] Codegen now supports Union Types in NativeModules

Reviewed By: GijsWeterings

Differential Revision: D63664505

fbshipit-source-id: 73278ed9cd64452173c5170aba44ced71181510f
2024-10-04 12:08:51 -07:00
Ariel Lin af3bee6511 add support for iOS "Darker System Colors" (Increase Contrast) setting into AccessibilityInfo (#46826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46826

This change adds `isDarkerSystemColorsEnabled()` to `AccessibilityInfo` to enable access to iOS's "Increase Contrast" setting option. It also adds a new event, `darkerSystemColorsChanged`, to enable listeners to subscribe to changes on this setting.

## Changelog

[iOS][Added] - Added `isDarkerSystemColorsEnabled()` to `AccessibilityInfo` to read "Increase Contrast" setting value

Reviewed By: cipolleschi

Differential Revision: D63880393

fbshipit-source-id: a476f8fc4d7354826bc344876b359eb1a3485f0d
2024-10-04 11:46:10 -07:00
Nicola Corti 7bb12ebbea Convert react/nativemodule/samples/ to Kotlin (#46816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46816

This converts the same native module from Java to Kotlin.
I've converted the whole module as it was quite simple + I've fixed some of the warnings.

Changelog:
[Internal] [Changed] - Convert react/nativemodule/samples/ to Kotlin

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D63837631

fbshipit-source-id: bb126d7649a6e8a36510bf2b252ecdfae91fe09f
2024-10-04 07:57:46 -07:00
muskan27797 fa62b7e1ed Add test for background color and border width in text.yml (#46829)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

- ME2E0017
- ME2E0018

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ Internal ] [ Added ] - Add e2e test for button

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

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D63889079

Pulled By: cipolleschi

fbshipit-source-id: ca2ede3142d77170fcb4121b025eab56818ffb07
2024-10-04 07:05:40 -07:00
Ahmed Bilal 1a2532b1fc Add Modal Testing to modal.yml (#46796)
Summary:
This pr is part of issue https://github.com/facebook/react-native/issues/46757 solving tasks [ME2E0001] and [ME2E0002].
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ Internal ] [ Added ] - Add e2e test for modal

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

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: cortinico

Differential Revision: D63829299

Pulled By: cipolleschi

fbshipit-source-id: ff64d0babde8aea6e2586c2f69056a10533750f9
2024-10-04 06:02:13 -07:00
Riccardo Cipolleschi fdee0ebbcb Avoid calling keyWindow on any UIScene (#46832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46832

After bumping to minIOSVersion 15.1, we refactored the code to remove some check.
In the refactoring, we changed how the `keyWindow` is returned and now we are unsafely casting `UIScene` to `UIWindowScene`.

We have some internal apps that use `UIScene` that are not `UIWindowScene` and the change is causing them to crash.

This change fixes the crash by checking whether the selector is available in the UIScene and casting it only in that case.
Otherwise we return `nil`, the same behavior we used to have before the refactor.

## Changelog
[iOS][Fixed] - Cast the UIScene to UIWindowScene only if the scene respond to the selector

Reviewed By: javache

Differential Revision: D63890980

fbshipit-source-id: 3230e0075f06ed3f3d759b48f9c7bd13d8787b44
2024-10-04 05:53:39 -07:00
Yasir 1c923ad8ab Add Pressable testing case in pressable.yml (#46808)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

- ME2E0013
- ME2E0014

## Changelog:

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

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [ADDED] - Added E2E for Pressable

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

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D63838828

Pulled By: cipolleschi

fbshipit-source-id: a28f654a14fbf7f9b79dedf04f402593042fb4a3
2024-10-04 05:53:07 -07:00
shubhamguptadream11 699f73a6b0 Added Submit Application test to button.yml (#46805)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:
- ME2E0011
- ME2E0012

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ Internal ] [ Added ] - Add e2e test for button

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D63829243

Pulled By: cipolleschi

fbshipit-source-id: 87d8e62650c66fb07e116877a212eff79f10eaf2
2024-10-04 04:53:26 -07:00
Oskar Kwaśniewski a1ec345e2a refactor(iOS): move RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED to const (#46833)
Summary:
This PR moves `RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED` as it was used as string in the codebase and in OSS libraries.

## Changelog:

[IOS] [FIXED] - move RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED to const

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

Test Plan: CI Green

Reviewed By: cipolleschi

Differential Revision: D63891220

Pulled By: javache

fbshipit-source-id: d4fa1f751b4b0cb131ab6c6d4dd0a345762d7c71
2024-10-04 04:26:29 -07:00
Saad Najmi 47748c7935 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-04 03:56:30 -07:00
Cedric van Putten eeb6122f39 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-04 02:45:59 -07:00
Riccardo Cipolleschi bd50c4a460 Make sure that all the pods in a project use the same C++ version (#46787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46787

This issue was raised by a some partner that were integrating with libraries that were setting the wrong C++ version.

With this change, RN takes ownership of the version of C++ that must be supported.

## Changelog
[iOS][Breaking] - Cocoapods decide the C++ version for iOS pods

Reviewed By: blakef

Differential Revision: D63760271

fbshipit-source-id: 5e629c61accd97fb10a199430d31e8b4c73d482b
2024-10-04 02:17:15 -07:00
Nick Gerleman 309cdea337 Use BackgroundStyleApplicator when setting background color in BaseViewManager (#46160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46160

We use this for all built-in components now, and rely on going through `BackgroundStyleApplicator` to be able to set additional background effects like borders, rounded corners, box shadow, outlines.

Let's use this in `BaseViewManager`, to allow exposing those other effects to all views, letting RN manage the background drawable for views using `BaseViewManager` and exposing the props for the managed styles.

This is technically breaking, in the case where a custom component could previously inherit directly from `BaseViewManager`/`ReactViewGroupManager`, (vs `SimpleViewManager`/`ReactViewManager`), then override `setBackgroundColor` on the Android View, instead of the view manager, but this effected zero of the [276 top libraries](https://github.com/elicwhite/react-native-libraries), so I don't think it would be common to hit.

Changelog:
[Android][Breaking]  - Use BackgroundStyleApplicator when setting background color in BaseViewManager

Reviewed By: tdn120

Differential Revision: D61658739

fbshipit-source-id: 15af649328ea18fda3cd68e56d481ed1c0fd43c4
2024-10-03 14:55:15 -07:00
Joe Vilches 211534b481 Add default test for box sizing (#46800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46800

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

Had a mini heart attack thinking I set the default to content box. Wrote this to double check and it passed. Might as well check it in

Technically the default to BoxSizing.h is ContentBox, but in the style we override that. Regardless I switched that around so border box was the default.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63802722

fbshipit-source-id: 49ed29657c964bc12a2bf70988061ab4599267ec
2024-10-03 12:21:16 -07:00
Peter Abbondanzo 420229d669 Disable loading XML on main thread (#46712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46712

## Summary

Now that XML resources are loaded via Fresco decoder, this change removes the custom branch that attempts to load drawables on the main thread. Loading (i.e. binary XML decompression) is performed on a background decoder thread from Fresco the same as every other image type.

## Changelog
[Android][Fixed] - Avoid blocking the main thread when decompressing drawable resources

Reviewed By: javache

Differential Revision: D63476282

fbshipit-source-id: a8510d140f85a55b90bf4aab6fd4cf5e46dfc7fd
2024-10-03 11:41:25 -07:00
Thomas Nardone 0aef7b64dc Convert ReactClippingViewManager (#46812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46812

Convert to Kotlin as close a 1:1 as possible.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D63773448

fbshipit-source-id: 72d67ec5993ffb225b016937e6a33fc8d4a8af16
2024-10-03 11:40:41 -07:00
Cao Doan 079c0b2c87 Deprecate UIApplication.windows access (#46763)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46763

Changelog: [Internal]
[iOS][DeprecatedAPI] - Deprecate UIApplication.windows access for iOS versions higher than 13.0

> 'windows' is deprecated: first deprecated in iOS 15.0 - Use UIWindowScene.windows on a relevant window scene instead [-Werror,-Wdeprecated-declarations]

Reviewed By: cipolleschi

Differential Revision: D63708635

fbshipit-source-id: 18cfeda89def996319a46573abeb88d4672f6c0d
2024-10-03 10:44:25 -07:00
Nick Gerleman 6cf0cfb5a4 Reenable setAndroidLayoutDirection by default (#46811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46811

I turned this off a few weeks after we turned off in FB app in (D60273063), after discovering it defeated a check used to disable `removeClippedSubviews` in RTL (reintroducing its bugged behavior).

D63318754 fixed that bug, so this is turning back on by default. This is also needed to fix border rendering direction bug introduced in BackgroundStyleApplicator in views where the contextual layout direction is different from the root Android layout direction (either because of `direction`, or `I18nManager` forceRTL). This fixes some existing RNTester RTL screenshot test failures which are hooked via forceRTL.

This also fixes rendering of some native components like `Switch` which would previously not respect contextual direction.

Changelog:
[Android][Fixed] - Reenable `setAndroidLayoutDirection` by default

Reviewed By: javache

Differential Revision: D63815077

fbshipit-source-id: fea64191d83d366c6bfc7b8c58b215773c8e8efe
2024-10-03 10:41:59 -07:00
Nick Gerleman 060c594457 Properly fix measurement of trailing newlines (#46613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46613

https://github.com/facebook/react-native/commit/bd323929dc5be5666ee36043babec7d981a095dc added a workaround to a bug where Android new arch would return incorrect measurements when the last character in dynamically sized TextInput is a newline. This workaround works by adding a placeholder character after any trailing newlines.

Apart from a minor oversight in the impl (unnecessary `toString()` copying text on every layout), approach of mutating Spannable will create problems for `PrecomputedText`, where we want to avoid mutating Spannable after set in more common cases for normal text (though mutation must happen for a few other cases, like adjustment, or EditText).

The real root cause of the issue is that StaticLayout tries to derive the size of text for area outside of what is covered by the Spannable (whose last char is the newline, considered on the previous to last line). This causes it to use text size, family, etc from `TextPaint`, which does not have this information set in new arch (the font size (but oddly nothing else) is set in Paper).

This updates TextLayoutManager to set this information on TextPaint before creating a layout. Because TextPaint is now mutable, and TextLayoutManager can be called by multiple threads, I made the variable thread local to avoid concurrent mutation. We also have the cached Spannable scenario where we have already lost the AttributedString, but in this case, we can reuse the underlying EditText paint, which I associate with the underlying cached Spannable.

I also marked a few more methods in TextLayoutManager private which nothing else is calling, to be able to better reason.

A followup, is that `ReactTextInputManager` sets all of these extra fields on the `EditText` paint (so those will be consistent), but `ReactTextAnchorViewManager` does not set all of these, so its underlying TextView would normally show newlines with an inconsistent size compared to the attributes present (though I don't think it much matters if we add the right amount of extra space to the actual layout).

Changelog:
[Android][Fixed] - Properly fix measurement of trailing newlines

Reviewed By: cortinico, mdvacca, mellyeliu

Differential Revision: D63303172

fbshipit-source-id: 63e5e24bce7fe8866524171d9acfc8f13e1efffc
2024-10-03 10:35:10 -07:00
Nick Gerleman a11a7c3c32 Keep base TextAttributes as part of AttributedString (#46612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46612

This information is lost by the time the AttributedString makes its way to be measured.

Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63303709

fbshipit-source-id: 644a97c80a9280e643514786ea6cf32faa4f1cf8
2024-10-03 10:35:10 -07:00
Peter Abbondanzo 118b7c18a6 Add custom Fresco decoder for binary XML (#46711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46711

## Summary
Vector drawable decompression is a blocking operation and can sometimes take upwards of 20-30ms per image, especially if that vector drawable uses complex colors. Less complex vector drawables still take several milliseconds to decompress and are served from a cache on later load attempts.

Here's a list of all the load times of vector drawable images in FBVR:
 {F1891592104}

This diff aims to shift decompression to one of Fresco's decode threads, off the main thread, so we don't block while waiting for decompression operations to complete. This relies on adding a new custom decoder that reads the header of XML binary and converts encoded image requests to drawable objects that are yielded from the new `XmlDrawableFactory`.

It's important to note that this change does not stop `ReactImageView` from loading XML-based drawables on the main thread, it merely offers a new mechanism for loading them.

## Changelog
[Android][Added] - Add a new Fresco decoder for XML resource types

Reviewed By: mdvacca

Differential Revision: D63476283

fbshipit-source-id: b0f9b5af42254bcf038a9eb088e7d72dd39cdb51
2024-10-03 09:33:48 -07:00
JDMathew b0ac99b477 use unknown in Flatlist setNativeProps type for typescript >= 3.0 (#46773)
Summary:
While digging through the types I came accross this TODO. Now that react-native uses version 5 of TS this can be updated

## Changelog:

[General] [Added] - Updated FlatList setNativeProps type

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

Reviewed By: NickGerleman

Differential Revision: D63765333

Pulled By: cipolleschi

fbshipit-source-id: ad612205d168cd90f270da72092f8ce67f5038c4
2024-10-03 09:25:38 -07:00
Nicola Corti d3c7469d8c Remove several unused imports in Flow code (#46789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46789

GitHub is reporting those warnings on each pull request. This clears them up as they're effectively unused.

Changelog:
[Internal] [Changed] - Remove several unused imports in Flow code

Reviewed By: cipolleschi

Differential Revision: D63757201

fbshipit-source-id: 21189136a03de8899adcbf18c8f0e29844ade340
2024-10-03 09:21:54 -07:00
Sam Zhou 94009f30e0 Update hermes-parser and related packages in fbsource to 0.24.0 (#46802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46802

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

Changelog: [internal]

Reviewed By: javache

Differential Revision: D63797332

fbshipit-source-id: 98179d3cd777ff6824dfd10ceb7236a02dc6c9d6
2024-10-03 08:20:16 -07:00
Alan Hughes 7487a2c277 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-03 07:12:43 -07:00
Saad Najmi 6a09fc09af 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-03 05:46:01 -07:00
Gabriel Donadel b7bcdcd8ee chore: Add changelog for 0.75.4 (#46792)
Summary:
Adds changelog for the 0.75.4 patch.

## Changelog:

[Internal] [Changed] - Add 0.75.4 changelog

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

Reviewed By: blakef

Differential Revision: D63766181

Pulled By: cipolleschi

fbshipit-source-id: f1b4e9e0676bc7dd32fe9d86386552f273fdcc75
2024-10-03 04:10:05 -07:00
Nicola Corti df396d5361 Unbreak build_android (#46806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46806

This fixes the CI which is currently red due to wrong C++ imports.

Changelog:
[Internal] [Changed] - Unbreak build_android

Reviewed By: javache, cipolleschi

Differential Revision: D63826953

fbshipit-source-id: 4d9e407331af666a420cf56178420df40e598ef4
2024-10-03 03:40:53 -07:00
Alex Hunt 19b971ff94 Remove run on iOS/Android key handlers (#46781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46781

Implements https://github.com/react-native-community/discussions-and-proposals/discussions/821.

Changelog:
[General][Removed] - Remove "run on iOS" and "run on Android" from the dev server key commands

Reviewed By: cortinico

Differential Revision: D63534248

fbshipit-source-id: 003d4c639bbf9128f921936508a62de2caadac5e
2024-10-03 03:39:04 -07:00
Joe Vilches 5e47ef991e Back out "Plumbing to get boxSizing prop to Yoga" (#46794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46794

Original commit changeset: f57e9a51236c

Original Phabricator Diff: D63430964

Seeing some issues with this so gonna turn it off for the meantime.

Changelog: [Internal]

Differential Revision: D63777437

fbshipit-source-id: fe8abd0110b2cf7296911c5b1e95ada40d30994c
2024-10-02 15:56:38 -07:00
Joe Vilches 32dd52e027 Back out "Add RNTester box sizing example and e2e test" (#46795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46795

Original commit changeset: d7bb6f115bca

Original Phabricator Diff: D63471840

See previous diff, there were some problems

Changelog: [Internal]

Differential Revision: D63777438

fbshipit-source-id: ea9f370eade10282fcee84d07d709b549dde1b6d
2024-10-02 15:56:38 -07:00
Nick Gerleman 62b7396bf4 Fix onEndReached not being called when getItemLayout is present and we scroll past render window (#46736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46736

Copying the comment in code:

> We only call `onEndReached` after we render the last cell, but when getItemLayout is present, we can scroll past the last rendered cell, and never trigger a new layout or bounds change, so we need to check again after rendering more cells.

Changelog:
[General][Fixed] - Fix onEndReached not being called when getItemLayout is present and we scroll past render window

Reviewed By: yungsters

Differential Revision: D63643856

fbshipit-source-id: 9c53789cb15b225ceac353c37cbb67f7beeaf4fb
2024-10-02 15:53:55 -07:00
Benoit Girard b3bc6ea69c Create ReactPerfLogger to log to Perfetto and Fusebox (#46793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46793

Currently performance logging has several problems:
- We have widly different APIs. It's hard to know which to use for what.
- Most of these APIs don't allow retroactive timestamp which is important for hero logging and react flame graphs
- These APIs aren't accessible from JS/C++/Java/Koltin (this part will be fixed in another diff)
- Logging doesn't go to the right place. It either only goes to Systrace, or Perfetto but with broken async timeline etc...

This diff start addressing the problem by refactoring. Currently performance.measure/performance.mark are the best APIs. Let's start with refactoring them so that we can call them directly without the otherwise PerformanceEntry side effects.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D63560473

fbshipit-source-id: 86755b3e8491a7cf6919173a07ba9421cd30e663
2024-10-02 12:35:05 -07:00
Rubén Norte 4b82922ac5 Fix reported properties for native modules (#46788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46788

Changelog: [internal]

This fixes the reported keys for C++ TurboModules:
```
import MyNativeCppModule from 'MyNativeCppModule';

Object.keys(MyNativeCppModule); // [] - expected
Object.keys(Object.getPrototypeOf(MyNativeCppModule)); // [] - NOT expected
```

Before, we were trying to read the properties from the method map in the public `TurboModule`, but in this implementation all the logic is actually in its delegate (also a `TurboModule` instance, yeah, confusing).

This fixes the issue by forwarding the call to the delegate that has the right information.

Reviewed By: javache

Differential Revision: D63761381

fbshipit-source-id: 90bd216efa0f60352c5ca341d210d83239c80dba
2024-10-02 12:25:06 -07:00
Samuel Susla 7b577065a6 make sure logs reflect new class name (#46785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46785

changelog: [internal]

Make sure logs match the class name

Reviewed By: rubennorte

Differential Revision: D63757693

fbshipit-source-id: 815e70e8ae38d99b1908d3aa2a9cfffdd9dc9851
2024-10-02 12:00:07 -07:00
Alex Hunt c430083fa0 Update modern inspector targets to directly send CDP title and description (#46780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46780

This is primarily a debugger server change to better-align the `title` and `description` fields (visible in via the CDP `/json/list` endpoint), reporting them directly from the device.

For React Native users, the net effect of this change is to improve/align the display name for each debugger target in the CLI multi-select menu (`j` to debug). This change may also be useful for discovery in non-Fusebox frontends such as VS Code (`vscode-expo` extension).

Changes:
- Rename `title` prop on `InspectorPageDescription`/`IInspector::addPage` to `description` (no call site changes).
- Add `deviceName` param to `InspectorPackagerConnection`.
- Move the page `description` to the `description` JSON field.
- Update `InspectorPackagerConnection::Impl::pages()` to return new `title` and `description` fields.
- Align `OpenDebuggerKeyboardHandler` to display `title` field.
- Deprecate the nonstandard `deviceName` field.

**Before**

```
[
    {
        "id": "3c9f24bedab0e73fca6a1b295030e7af9346a8c0-1",
        "title": "React Native Bridgeless [C++ connection]",
        "description": "com.facebook.RNTester",
         ...
    }
```

The `description` field was previously the closest thing we had to a target identifier. Today, this is not needed, since we have the stable `reactNative.logicalDeviceId` field.

**After**

```
[
    {
        "id": "3c9f24bedab0e73fca6a1b295030e7af9346a8c0-1",
        "title": "com.facebook.RNTester (iPhone 16 Pro)",
        "description": "React Native Bridgeless [C++ connection]",
         ...
    }
```

The `title` field is now more human readable and aligned with what we render in the window title of React Native DevTools. The `description` field describes the type of debugger target (the specific React Native implementation).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D63329456

fbshipit-source-id: cfe98f77e31c729431005925cfc66e2780ef8c72
2024-10-02 07:30:31 -07:00
Samuel Susla 07c02d4427 prevent C++ state update in RCTScrollViewComponentView if value is the same (#46782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46782

changelog: [internal]

Avoid setting C++ state for the same contentOffset. This is redundant work and can be safely avoided.

Reviewed By: NickGerleman

Differential Revision: D63700308

fbshipit-source-id: d6ea8cf6a1da47a13787b49abd66a87e3da57d34
2024-10-02 07:28:32 -07:00
Riccardo Cipolleschi 519e07ae62 Add changelog for 0.74.6 (#46783)
Summary:
Add changelog for 0.74.6

## Changelog:
[Internal] - Add changelog for 0.74.6

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D63756879

Pulled By: cipolleschi

fbshipit-source-id: c36fae089c58fad49f45fa3b3380c38490d67293
2024-10-02 07:16:21 -07:00
Pieter De Baets c06b1e9a0b Rollout destroyFabricSurfacesInReactInstanceManager (#46778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46778

This has been rolled out internally already and is a good cleanup for OSS too. We no longer use this config externally (BRIDGE+FABRIC) so this shouldn't actually affect the new arch rollout.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D63752084

fbshipit-source-id: da3025f7b072dc7b82f8de22ff247b3979ae64d0
2024-10-02 05:10:49 -07:00
Pieter De Baets 17f4c45eed Add missing lock in ReactInstanceManager#attachRootView (#46776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46776

All other paths that touch `mAttachedReactRoots` uses this lock. We expect this to address a crash we're seeing in production where `startSurface` is invoked multiple times.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D63752083

fbshipit-source-id: f06d07aa70719945f6956fbf6e0cde3e9c8e8ed0
2024-10-02 05:10:49 -07:00
Pieter De Baets 5b5e150eaf Fix Cxx TurboModule methods not being cached (#46751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46751

rubennorte noticed that some turbo module methods were not getting cached on the jsRepresentation as expected. This is caused by the react-native-codegen wrappers we generate overriding the `get` method and bypassing this caching layer. Instead they should be overriding `create` to lazily allocate new properties. To prevent this from re-occuring, I've made `get` final so no other overrides can happen.

## Changelog:

[General][Fixed] Properties for C++ TurboModules using codegen were not correctly cached
[General][Breaking] TurboModule::get is now a final method, override `create` to customize property lookup

Reviewed By: rubennorte

Differential Revision: D63665966

fbshipit-source-id: c614901c2f0d698147ec9ba36a4b592ed3d37652
2024-10-02 05:10:33 -07:00
Rubén Norte 44f431b471 Make detail readonly in PerformanceMark (#46697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46697

Changelog: [internal]

This is already the case in `PerformanceMeasure` but for some reason we didn't apply it here as well.

Reviewed By: rshest

Differential Revision: D63541134

fbshipit-source-id: 262d504ed153e07e89492945f761887729bad9e0
2024-10-02 03:13:24 -07:00
Rubén Norte 434decb409 Optimize locks in PerformanceEntryReporter (#46698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46698

Changelog: [internal]

Small optimization to use readers/writers for locking in `PerformanceEntryReporter`.

Reviewed By: rshest

Differential Revision: D63540236

fbshipit-source-id: 80b3fd313453ad8da4f0af2deaab61a86064b4b7
2024-10-02 03:13:24 -07:00
Rubén Norte 559c6029fd Refactor Performance and PerformanceObserver internals (#46693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46693

Changelog: [internal]

This unifies the native modules for `Performance` and `PerformanceObserver` in the same module. Keeping them separate is artificial and introduces unnecessary duplication. These APIs are very closely related so it makes sense to unify

Reviewed By: javache

Differential Revision: D63471855

fbshipit-source-id: fa8c5dc7b7c68954fc11867f68909d2c6c2ee85c
2024-10-02 03:13:24 -07:00
Rubén Norte b62ae0d02b Remove dependency to PerformanceEntryReporter singleton from RuntimeSchedulerTest (#46760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46760

Changelog: [internal]

Relying on the singleton was causing issues in iOS tests for RuntimeScheduler. This fixes those issues.

Reviewed By: rshest

Differential Revision: D63702251

fbshipit-source-id: 42b98e673ffba6f45b52510cdb3eea410e55b894
2024-10-02 03:13:24 -07:00
Rubén Norte 0fb3c24a82 Small renames in PerformanceEntryReporter (#46688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46688

Changelog: [internal]

Just aligns on `report*` as the public API in `PerformanceEntryReporter` (e.g.: `measure` -> `reportMeasure`, `logEventEntry` -> `reportEvent`, etc.).

Reviewed By: rshest

Differential Revision: D63471856

fbshipit-source-id: 59617160c238aaefaefe8b6fc27de4481ef32ada
2024-10-02 03:13:24 -07:00
Tim Yung de927e6138 Animated: Enqueue Completion Callbacks in Microtask (#46714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46714

Sets up a feature flag to experiment with scheduling `Animation` completion callbacks in a microtask instead of executing them synchronously. (The completion callback is the callback passed into `animation.start(<callback>)`).

There are currently 4 potential scheduling behaviors of the animation completion callback:

- Synchronously when `start()` is invoked, for spring and timing animations that immediately complete (e.g. no delays and not native driver).
- Synchronously when `stop()` is invoked, if the animation has not yet completed.
- Synchronously during the layout effect phase, or commit phase (if the `useInsertionEffectsForAnimations` feature flag is enabled), if the animation has not yet completed.
- Asynchronously when the animation completes (e.g. non-zero delay or when the native driver is employed).

The wide number of variables and the timing-dependent nature of these variables means that the behavior of the completion callback is very non-deterministic.

Imperically, we have also found that most codebases using `useNativeDriver` mostly have completion callbacks executed asynchronously. However, this leads to surprising problems where the callback causes unpredictable behavior when it is called synchronously (e.g. when the animating component is unmounted *during* the animation).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63573322

fbshipit-source-id: 16c48be78c9ac65a64021249fad10f7265737c44
2024-10-02 02:07:00 -07:00
Tim Yung 11bf3a32e1 Animated: Rename __debouncedOnEnd to __notifyAnimationEnd (#46718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46718

Simple rename of a protected method that should not be called by anyone outside of the `Animation` class and its subclasses, just to make it more intuitive.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572363

fbshipit-source-id: cf68f63a9b361767b9dbfcd73124bcdae7a1806e
2024-10-02 02:07:00 -07:00
Tim Yung b519d49106 Animated: Hoist Common Logic to Parent Class (#46717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46717

Reduces redundancy and cleans up the layers of abstraction between the `Animation` class and its subclasses, by hoisting common and duplicated logic into the parent class.

I also cleaned up the Flow types in these files while I was at it.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572064

fbshipit-source-id: ab6bf7265b67ab38cc5a9d5c94f8cd1456c93f23
2024-10-02 02:07:00 -07:00
Tim Yung fd8cf19625 Animated: Fail Fast on Native Driver Incompatibility (#46720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46720

Refactors the `Animation` subclasses (from Animated) such that using `useNativeDriver` with a non-native `AnimatedValue` will consistently fail when calling `start()`.

The current behavior is inconsistent because if a timing or spring animation has a non-zero delay, the error will be thrown in asynchronously in a timeout.

Changelog:
[General][Changed] - Animations started with incompatible `useNativeDriver` and `AnimatedValue` configurations will now synchronously fail. Previously, spring and timing animations with non-zero delays would throw the error asynchronously.

Reviewed By: javache

Differential Revision: D63572062

fbshipit-source-id: 2619e2867fe7754695e3347c838ad6fe136a6614
2024-10-02 02:07:00 -07:00
Tim Yung 63100a9639 Animated: Simplify TimingAnimation#start Logic (#46719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46719

Implements a minor refactor of `TimingAnimation#start` so that we standardize how the `_useNativeDriver` case is handled.

There is no behavior change from this besides more consistently assigning to `this._startTime`. (Previously, we would not set it if the duration were 0 and `!useNativeDriver`.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572066

fbshipit-source-id: 9cbd05c5ca5e00227be69441b9d7d8a502690246
2024-10-02 02:07:00 -07:00
Tim Yung 85aa9278f9 Animated: Change nativeID to Private Property (#46716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46716

Changes `_nativeId` to be a private property in the `Animation` class (from Animated).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572065

fbshipit-source-id: 24facca0ccb1256f602ec4406bf8c0b22c4bbf96
2024-10-02 02:07:00 -07:00
Tim Yung b3fe06b268 Animated: Change onEnd to Private Property (#46721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46721

Currently, the `Animation` class (from Animated) defines an unofficially protected `__onEnd` property that subclasses are expected to populate. However, subclasses are expected to *not* invoke `__onEnd`, but instead call `__debouncedOnEnd`.

In order to make this code less fragile, this commit refactors the `Animation` class and its subclasses so that `onEnd` is stored in a private property and initialized by the `start` method in the `Animation` parent class. Now, the only way to invoke the `onEnd` callback is by calling `__debouncedOnEnd`.

The subclasses have been adjusted to call the `start` superclass method to initialize this.

Changelog:
[General][Changed] - The `Animation` superclass no longer exposes `__onEnd` as a property. Subclasses must instead invoke `super.start(…)` in their `start()` implementation.

Reviewed By: javache

Differential Revision: D63572063

fbshipit-source-id: 221153ca890c67c59713d607032536f57d7a5b0a
2024-10-02 02:07:00 -07:00
Tim Yung fd355308fa Animated: Fix NativeAnimatedModule Mock for Jest (#46715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46715

Properly mocks `NativeAnimatedModule` in Jest so that we can cleanup the `process.env.NODE_ENV` checks in Animated.

Changelog:
[General][Added] - Added Jest mocks for `NativeAnimatedModule`

Reviewed By: javache

Differential Revision: D63572067

fbshipit-source-id: a4fcedeebbaaa47a34bb356305652a3ed6358855
2024-10-02 02:07:00 -07:00
Tim Yung 177697f539 RN: Migrate to HostInstance Type (#46742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46742

Migrates type definitions in React Native to use the newly created `HostInstance` type instead of `NativeMethods` and `React.ElementRef<HostComponent<T>>`.

Changelog:
[General][Changed] - Simplified Flow types to use `HostInstance` (which changing nominal types).

Reviewed By: NickGerleman

Differential Revision: D63646763

fbshipit-source-id: 904894dc40da4d2e70bcb6df47018fc6248ea972
2024-10-01 22:51:48 -07:00
yungsters (Meta Employee) e24f9917c2 Define HostInstance type for React Native (#46743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46743

Creates a new `HostInstance` type for React Native, to more accurately capture the intent most developers have when using the `NativeMethods` type or `React.ElementRef<HostComponent<T>>`.

Since `React.ElementRef<HostComponent<T>>` is typed as `React.AbstractComponent<T, NativeMethods>`, that means `React.ElementRef<HostComponent<T>>` is equivalent to `NativeMethods` which is equivalent to `HostInstance`.

Changelog:
[General][Added] - Added `HostInstance` type to represent the instance of a `HostComponent<T>`.

Test Plan:
Ran the following successfully:

```
$ cd ~/fbsource
$ js1 flow
```

Reviewed By: NickGerleman

Differential Revision: D63646555

Pulled By: yungsters

fbshipit-source-id: 075859e6b0217521ba9ab2b92843ae7e47db5be0
2024-10-01 22:51:48 -07:00
Ariel Lin d4ea147b41 add support for Android's "High Text Contrast" setting into AccessibilityInfo (#46746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46746

This change adds `isHighTextContrastEnabled()` to `AccessibilityInfo` to enable access to Android OS's "High contrast text" setting option. It also adds a new event, `highContrastTextChanged`, to enable listeners to subscribe to changes on this setting.

## Changelog

[Android][Added] - Added `isHighTextContrastEnabled()` to `AccessibilityInfo` to read `ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED` setting value

Reviewed By: NickGerleman

Differential Revision: D63155444

fbshipit-source-id: 9829b40e6c183f6beba732190dc318894e9d9a3f
2024-10-01 19:57:46 -07:00
Samuel Susla d19a2178b6 remove use of type alias from Differentiator (#46762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46762

changelog: [internal]

Typealias NonOwningList obscures the underlaying type and provides limited benefit. Using std::vector<ShadowViewNodePair*> is more readable.

Reviewed By: NickGerleman

Differential Revision: D63396285

fbshipit-source-id: 70cda3f33a7649cabbf5888fbefe0610d2c002b3
2024-10-01 17:31:46 -07:00
Alex Hunt ebc699ce7f Tweak start command output (#46770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46770

Small updates to the `react-native start` command CLI output:

- Change "Welcome..." text to blue.
- Display server base URL instead of port only.
- Embolden key command letters.
- "Ctrl+C to exit" prompt.
- Extra newlines for balance.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D63328267

fbshipit-source-id: 119ddb2ba68c99df532840285c3c1f922e727e8b
2024-10-01 17:14:43 -07:00
Alex Hunt df8f4d6b5d Replace and remove optional dep on cli-tools logger (#46769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46769

(Further refactors to logging after D63255296.)

Fully decouples `community-cli-plugin` from the unlisted optional dependency on `react-native-community/cli-tools'`. This is motivated by changes in https://github.com/facebook/react-native/pull/46627 which switch to using Metro's `TerminalReporter` API for emitting logs safely.

- Swaps out logs in the dev server for the `unstable_server_log` Metro reporter event.
- Swaps out `logger.debug()` calls for the `debug` package, currently used by Metro and `dev-middleware`.
- Swaps out other logs in the `bundle` command for `console`.
- (Also specify missing `semver` dep.)

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63328268

fbshipit-source-id: f552748ecc3456bd5fb8870c3a51d744a6bf3e70
2024-10-01 17:14:43 -07:00
Alex Hunt b52bbb4d21 Simplify key handling in start command (#46768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46768

Remove the `KeyPressHandler` util in favour of using the `process.stdin` APIs inline.

This reduces complexity (where we were effectively not using the conditional interception this previously implemented — see also https://github.com/facebook/react-native/pull/46416), and more closely mirrors our internal dev server setup.

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

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63255321

fbshipit-source-id: 5cdf7a480053a2215fa50f544733f443bab07ef2
2024-10-01 17:14:43 -07:00
Alex Hunt 7186fdeb1c Replace execa with child_process (#46767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46767

Swaps out `execa` dependency for Node's built in `child_process`.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D63255320

fbshipit-source-id: ce7ef5e2ea78aa96c61815ff8c1e054a8f04e8b0
2024-10-01 17:14:43 -07:00
Joe Vilches e1246f04d1 Add RNTester box sizing example and e2e test (#46765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46765

Tests are good!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63471840

fbshipit-source-id: d7bb6f115bcae502e9f8b5ce2a12df8e850d5c26
2024-10-01 15:19:22 -07:00
Joe Vilches 39b9cf2412 Plumbing to get boxSizing prop to Yoga (#46766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46766

tsia!

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D63430964

fbshipit-source-id: f57e9a51236cb4c7d4c284af6987f88f9c7597da
2024-10-01 15:19:22 -07:00
Joe Vilches 11ef671063 Camel case *AxisownerSize (#46744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46744

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

This was annoying me :)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63424778

fbshipit-source-id: 8f9df4e92bde251214f4c1d61ff8282d56f87816
2024-10-01 15:19:22 -07:00
Joe Vilches d06a9b356b Let flex basis support content box (#46740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46740

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

The flex basis length applies to the value of `box-sizing` per the spec: https://drafts.csswg.org/css-flexbox-1/#flex-basis-property

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63424590

fbshipit-source-id: f73bffd30cc7b673453a55089ecc880819d3d788
2024-10-01 15:19:22 -07:00
Joe Vilches 353529867f Impl of content box (#46741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46741

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

box sizing is really just a reinterpretation of what length properties (like `width`, `height`, `max-width`, etc) mean. So to implement this I just add the border and padding if we are in content box when we ask for any of these properties. All the math that gets done by the algorithm is still in border box land, and the layout we return is to be interpreted as the border box (this is actually the expected behavior per https://drafts.csswg.org/css-sizing/#box-sizing). This makes this implementation pretty simple actually.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63416833

fbshipit-source-id: fd76132cf51e8a5092129802c3a12ab24023018b
2024-10-01 15:19:22 -07:00
Joe Vilches 999a66b2a3 Clean up calls to dimension() with a hardcoded FlexDirection (#46739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46739

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

This is a bit more clear, imo

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63408245

fbshipit-source-id: cea9723914f69d2697e18c8bfe2b55c830af2b6a
2024-10-01 15:19:22 -07:00
Joe Vilches e704f3ba9b Rename Node.h's getResolvedDimension to getProcessedDimension (#46649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46649

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

To get the height and width we call a function currently named `getResolvedDimension`. This returns a `Style::Length`, which in most cases we "resolve" immediately by calling `resolve`. This is a bit confusing that you need to `resolve` something that is already `resolved`.

I plan on adding a new function soon for `contentBox` which would resolve the length for you, so I think this should be renamed.

Also deleted unused `getResolvedDimensions`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63407730

fbshipit-source-id: e855c17d9c99817be308b7263fcb5d43559ede14
2024-10-01 15:19:22 -07:00
Nick Gerleman 267b250690 Cleanup background drawing feature flags (#46761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46761

The legacy paths for this is all gone and non functional. We can clean thes up fully now.

Changelog: [Internal]

Reviewed By: rshest, Abbondanzo

Differential Revision: D63652264

fbshipit-source-id: cabc1af0098553c64f834e6bc30000ef7a942a4c
2024-10-01 12:46:29 -07:00
Christoph Purrer 1118cc6327 Share TextInputEventEmitter between C++ platforms (#46198)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46198

Extending on https://github.com/facebook/react-native/pull/43431 this change allows to share the TextInputEventEmitter with our C++ based platforms such as RN Windows > https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h

## Changelog:
[Internal] - Share TextInputEventEmitter between C++ platforms

Reviewed By: NickGerleman

Differential Revision: D61749959

fbshipit-source-id: 2526bf29200cd6a3dc6d5eaef5edbaf4b1df5751
2024-10-01 12:35:16 -07:00
Alex Hunt aa55d765e5 Add CLI selection of multiple debug targets (#46627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46627

IMPORTANT: Requires a Metro bump, CI will fail until updated.

Introduces a target selection API for launching React Native DevTools when more than one device is connected.

Credit to robhogan for the initial internal implementation of `OpenDebuggerKeyboardHandler`!

(This leverages recent additions to Metro's reporter API — which we should follow up on to use for the rest of `community-cli-plugin`. Notably, using `TerminalReporter` ensures server output won't conflict with Metro's own event and progress logs.)

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63255295

fbshipit-source-id: da93500358791eabe4cab433cad31b82d518fb5f
2024-10-01 11:27:41 -07:00
Alex Hunt 7c2a7de162 Bump Metro to 0.81.0-alpha.2 (#46703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46703

Updates us in line with the release branch and unblocks https://github.com/facebook/react-native/pull/46627.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63544047

fbshipit-source-id: 4c093e6c2fc389888f12063df013db7023761859
2024-10-01 11:27:41 -07:00
Blake Friedman ffb10b5b4c 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-01 11:03:36 -07:00
Rubén Norte a5e430579e Improve RNTester example for performance.mark/measure (#46759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46759

Changelog: [internal]

This improves the example in RNTester for `performance.mark` and `performance.measure` by only listing the marks/measures explicitly emitted from the example. This removes noise if other parts of the app are logging marks/measures as well.

Reviewed By: rshest

Differential Revision: D63695731

fbshipit-source-id: f65cf59363da0e6c9e0b3ffadf05abd2eb5a214c
2024-10-01 11:03:31 -07:00
Riccardo Cipolleschi eaa780de1c Fix crash for Modal not attached to window manager (#46758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46758

There are some occurrencies where the Modal results not attached to the Window, perhaps when the app is backgrounded.

This trigger an exception `java.lang.IllegalArgumentException: View=DecorView@b9f88af[AdsManagerActivity] not attached to window manager`.\

This was fixed already but the conversion from Java to Kotlin missed a condition in the `||` clause. We are adding it back.

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

## Facebook
The original fix is in this diff  D22264672 by mdvacca
Also see this post: https://fb.workplace.com/groups/rn.support/permalink/27047414764880449/

Reviewed By: cortinico

Differential Revision: D63700769

fbshipit-source-id: bc8a44868d5cacb8822e1646c2b7643682f45e1b
2024-10-01 10:59:40 -07:00
Riccardo Cipolleschi 6d6dd99ec9 Throw JS exception when calling a method if bufferedRuntimeExecutor is not initialized (#46735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46735

We had some crash on Android where we call [`callFunctionOnModule`](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L258) when the `bufferedRuntimeExecutor_` might not be initialized. This can happen when navigating away from RN surface and quickly navigate to another one or across refreshes.

There could be a scheduled JS function from the previous surface/instance that might try to call a native module while the new instance is being created.

This change prevent the crash and replace it with a soft crash, that should show a RedBox on the screen.

## Changelog
[Internal] - Throw JS exception when calling a method if buffereRuntimeExecutor is not initialized

## Facebook
Have a look at T201983945 that generated the crash report

Reviewed By: cortinico

Differential Revision: D63638633

fbshipit-source-id: ba331f5173963265232d0810c2d12895cea3d528
2024-10-01 10:15:50 -07:00
Nicola Corti c441de5a47 Fix build warning for prepareGlog (#46756)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46756

prepareGlog was firing a warning due to a duplicate config.h file. Here I'm setting so that the file is always overridden (which is the desired behavior) to suppress this warning.

Changelog:
[Internal] [Changed] - Fix build warning for prepareGlog

Reviewed By: cipolleschi

Differential Revision: D63696664

fbshipit-source-id: 83b78afea09c4a5d39f341dd5b604cec466470ae
2024-10-01 10:04:57 -07:00
Nicola Corti 3cd46b9534 Do not reference setTranslucentBackgroundDrawable (#46754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46754

This method has been deprecated since 0.76, but we're still using it inside our codebase.
I'm cleaning up the only usage of it replacing it with the implementation.

Changelog:
[Internal] [Changed] - Do not reference `setTranslucentBackgroundDrawable`

Reviewed By: cipolleschi

Differential Revision: D63695933

fbshipit-source-id: d39b13b584d3ac1406c61c3bf86b86b05dc984d9
2024-10-01 10:04:57 -07:00
Nicola Corti eb3d352761 RNGP - Do not apply java-gradle-plugin on root build (#46755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46755

There is no need to apply `java-gradle-plugin` to the root build of RNGP as that does not contain any Gradle Plugins (they're in subfolders).

This is actually causing the build to be a bit slower as extra tasks for compilation/bundling will be created which are definitely not needed.

Changelog:
[Internal] [Changed] - RNGP - Do not apply `java-gradle-plugin` on root build

Reviewed By: cipolleschi

Differential Revision: D63695934

fbshipit-source-id: 84268105c73b49afdcd94610fcb7006ef53306a4
2024-10-01 10:04:57 -07:00
Nicola Corti 41c6ad5597 Fix NPE on ReactTextInputManager.setTextDecorationLine (#46750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46750

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

Fix is pretty straightforward, parameter is annotated as Nullable, but is accessed with a `.split` call.
This causes a crash when the `textDecorationLine` property is removed (i.e. is null).

Changelog:
[Android] [Fixed] - Fix NPE on ReactTextInputManager.setTextDecorationLine

Reviewed By: cipolleschi

Differential Revision: D63689492

fbshipit-source-id: 3424897cc40beaeb579e3affd0a87656ff43afee
2024-10-01 09:20:53 -07:00
Pieter De Baets 4ede9205a0 Fix BoxShadow support for platform colors (#46753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46753

Colors can be more than just ints, so we need to use `ColorPropConverter` to convert it correctly. For ViewManagers, this happens automatically through the ReactProp annotation, but since this is a nested field, we need to manually apply it.

Changelog: [Android][Fixed] BoxShadow now supports platformColor.

Reviewed By: fabriziocucci

Differential Revision: D63693048

fbshipit-source-id: 26b1da24db1b6f319af8cef6f62e4739c3f65ee3
2024-10-01 08:30:25 -07:00
Oskar Kwaśniewski d24507611d feat(iOS): expose RCT_NEW_ARCH_ENABLED to Swift (#46749)
Summary:
This PR exposes `RCT_NEW_ARCH_ENABLED` flag to Swift.

It allows you to use conditional compilation:

```swift
#if RCT_NEW_ARCH_ENABLED
func test() {
	print("I'm running on new arch!)
}
#else
func test() {
	print("I'm running on old arch!)
}
#endif
```

## Changelog:

[IOS] [ADDED] - expose RCT_NEW_ARCH_ENABLED to Swift

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D63689711

Pulled By: cipolleschi

fbshipit-source-id: 706013019571f597d1966ffcf13bd47ba7f29a2d
2024-10-01 07:59:25 -07:00
Alex Hunt 80122678e0 Simplify FuseboxReactDevToolsDispatcher diagram and document inline (#46737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46737

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63637626

fbshipit-source-id: 314ec6dc6eff8d458beba84e49d5aaca3d192087
2024-10-01 06:50:49 -07:00
Alex Hunt 82f4e1714d Reorganise debugger modules in src/private/ (#46738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46738

Combines modules previously under `fusebox` and `reactdevtools` directories into a single `src/private/debugging/` directory.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D63637625

fbshipit-source-id: 58add7fa3b6553c33d59e785563b24d57b7db547
2024-10-01 06:50:49 -07:00
Pieter De Baets 390925ea39 Add StrictAnimatedProps to fix missing Animated types (#46659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46659

The current `AnimatedProps` maps all types to `any` which prevents us from catching many types of issues. Introduce an alternative variant which we can adopt incrementally which enforces the underlying types.

Changelog: [General][Fixed] Improved types for AnimatedProps

Reviewed By: SamChou19815

Differential Revision: D63315760

fbshipit-source-id: 718fc2754cc99891e490a48d7792f626205c37e4
2024-10-01 06:29:51 -07:00
Cedric van Putten 39c98fb8f8 fix(react-native-codegen): upgrade jscodeshift@17.0.0 to resolve outdated dependencies (#46724)
Summary:
This upgrades `jscodeshift` from `0.14.0` to `17.0.0`, to resolve unsupported babel dependencies when installing React Native. See https://github.com/expo/expo/issues/31613

## Changelog:

[GENERAL] [FIXED] - Upgrade Codegen dependency `jscodeshift@17.0.0` to resolve outdated dependencies

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

Test Plan:
To test it out yourself:

- `npx create-expo@latest ./test-codegen`
- `cd ./test-codegen`
- `npm why babel/plugin-proposal-nullish-coalescing-operator@7.18.6 | grep codegen` - [npm deprecation](https://www.npmjs.com/package/babel/plugin-proposal-nullish-coalescing-operator/v/7.18.6)
- `npm why babel/plugin-proposal-class-properties@7.18.6 | grep codegen` - [npm deprecation](https://www.npmjs.com/package/babel/plugin-proposal-class-properties/v/7.18.6)
- `npm why rimraf@2.6.3 | grep codegen` - [npm deprecation](https://www.npmjs.com/package/rimraf/v/2.6.3)
- `npm why babel/plugin-proposal-optional-chaining@7.21.0 | grep codegen` - [npm deprecation](https://www.npmjs.com/package/babel/plugin-proposal-optional-chaining/v/7.21.0)

> [!IMPORTANT]
> There are other dependencies that require an update, unfortunately there are no flow typings available (yet).
> - `npm why glob@7.2.3 | grep codegen` - [npm deprecation](https://www.npmjs.com/package/glob/v/7.2.3)

Reviewed By: cortinico

Differential Revision: D63629133

Pulled By: huntie

fbshipit-source-id: 3799e49677b8e5fd64841e6c7f855bde10e15072
2024-10-01 05:14:16 -07:00
Nicola Corti 290258f00f Further Reduce Build Warnings (#46733)
Summary:
This further reduces the build warning coming from the Hermes build, which we can't do much about as we don't own that code.

## Changelog:

[Internal] [Changed] - Further Reduce Build Warnings

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D63644753

Pulled By: cortinico

fbshipit-source-id: d0e65559715ac1fa2b920f4c3d3cf63b6171765d
2024-10-01 02:47:59 -07:00
Tim Yung 223e98cc4b RN: Remove String Refs from NativeMethods (TS) (#46734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46734

The TypeScript definition for `NativeMethods` defined a `refs` property for referencing component instances by string refs.

String refs are deprecated and support is being formally dropped in React 19.

This removes the obsolete type definition.

Changelog:
[General][Removed] - Removed `refs` property from `NativeMethods` TypeScript definition.

Reviewed By: NickGerleman

Differential Revision: D63640881

fbshipit-source-id: 82148ac91bd44d63da9a41b1d1dcebb7ca32a5bd
2024-09-30 14:54:51 -07:00
Eli White 86cac68365 Promise annotations must specify their elementType (#46727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46727

It makes scripts operating on the schema complicated when the elementType might be there or might not. Let's make it required, but VoidTypeAnnotation if it's unknown.

Arguably we shouldn't allow it to be unknown at all, but that's out of scope here.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D63616703

fbshipit-source-id: 290586384b911928e55344aa522bd296f23a074c
2024-09-30 11:19:44 -07:00
Eli White ad380c011f Add test for Object with indexers (#46726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46726

An object isn't allowed to have both an indexer and regular properties. Previously, the schema just wouldn't include the properties and would only include the indexer. Instead of failing silently and not generating the expected code, let's explicitly error out.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D63615090

fbshipit-source-id: a4c881b7a809f0b467509f7f7e2131be59ee274e
2024-09-30 11:19:44 -07:00
Eli White c658e87518 Add a test for an Alias to an Alias (#46725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46725

This covers types that deeply alias.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D62926913

fbshipit-source-id: 2fea1900f1be2893230a949db6778c76afae0423
2024-09-30 11:19:44 -07:00
Pieter De Baets 544c4ff75b Use HybridClassBase for frequently constructed objects (#46706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46706

Simplifies object construction and collection, and avoids additional JNI roundtrips to set HybridData.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D63537781

fbshipit-source-id: 55df2785840ec8fcd5a7a08d2c7dd73c5b5fca82
2024-09-30 09:59:52 -07:00
Frank Calise e12c0d9551 fix(dev-menu): export for react-native package (#46723)
Summary:
In an effort to achieve a similar API in the new architecture, I was trying to replace the following code from the old architecture:
```
import { NativeModules } from 'react-native'
// ...
NaiveModules.DevMenu.show()
```

After https://github.com/facebook/react-native/issues/46694 landed, you can achieve this with the following import in the new architecture:
```
// ts-ignore
import DevMenu from "react-native/Libraries/NativeModules/specs/NativeDevMenu"

// and then use it
DevMenu.show()
```

However, this change provides the interface for `DevMenu` from the `react-native` package, similar to the API for `DevSettings`, making it easier to use via the public API and better type support.

```
import { DevMenu } from 'react-native'
DevMenu.show()
```

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Export `DevMenu` from `react-native`

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

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

Test Plan:
<img width="750" alt="image" src="https://github.com/user-attachments/assets/dc5a9876-4364-473e-9fd8-c49484d6de01">

### Before
`any` type on `show` from the private import
<img width="226" alt="image" src="https://github.com/user-attachments/assets/45a085d2-9794-482d-b5ec-3b882aadb56b">

### After
typed show method from the new import
<img width="399" alt="image" src="https://github.com/user-attachments/assets/7c7587b3-499b-40f0-8262-126e4ec17dc6">

Reviewed By: cortinico

Differential Revision: D63631196

Pulled By: huntie

fbshipit-source-id: a00efa85c8ca1aa127c9ae0a059978ba5eadb376
2024-09-30 09:22:52 -07:00
Rick Hanlon cbb313253f 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-09-30 09:15:04 -07:00
Oskar Kwaśniewski fbda60e657 feat(iOS): refactor RCTDevLoadingView to use constraints (#46621)
Summary:
This PR refactors the RCTDevLoadingView to use constraints instead of explicitly defining frames.

Now the code looks like this:

```
#if TARGET_OS_MACCATALYST
      self->_window.frame = CGRectMake(0, window.safeAreaInsets.top, windowWidth, 20);
      self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, windowWidth, 20)];
#else
      self->_window.frame = CGRectMake(0, 0, windowWidth, window.safeAreaInsets.top + 10);
      self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top - 10, windowWidth, 20)];
#endif
```

When working with visionOS I quickly found my self in the need of adding additional else there...

This PR uses constraints to layout the views correctly for every device.

| Device         | Screenshot |
| -------------- | ---------- |
| iOS | <img src="https://github.com/user-attachments/assets/decc146e-41a2-4ce8-bafd-77c77a39398b" width="200"/> |
| macOS Catalyst | <img src="https://github.com/user-attachments/assets/78ef4946-a6dc-49a2-864e-a483577798f1" width="200"/> |
| iPadOS | <img src="https://github.com/user-attachments/assets/a15bd1a8-84ae-47d0-becb-e14c3a9352d4" width="200"/>  |
| visionOS | <img src="https://github.com/user-attachments/assets/d74f0607-837e-4f7b-b924-fc6fce80d763" width="200"/>  |

## Changelog:

[IOS] [CHANGED] - refactor RCTDevLoadingView to use constraints

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

Test Plan: Test if DevLoading view is properly showing up

Reviewed By: blakef

Differential Revision: D63383002

Pulled By: cipolleschi

fbshipit-source-id: b17499e12d4a882facce4c45b1cc22eb43ea3bb1
2024-09-30 08:26:45 -07:00
evanbacon 4caf548a9f add missing iOS platform colors (#46730)
Summary:
- add missing platform colors on iOS https://developer.apple.com/documentation/uikit/uicolor/standard_colors

## Changelog:

[IOS] [ADDED] - Add `systemCyan` and `systemMint` colors on iOS

<!-- 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/46730

Test Plan:
- Ran it in an iOS app (text is no longer black)

![Simulator Screenshot - iPhone 15 Pro - 2024-09-30 at 15 31 30](https://github.com/user-attachments/assets/2f1d337c-d5f3-40d6-8e58-fdccb94603fd)

Reviewed By: cortinico

Differential Revision: D63635182

Pulled By: cipolleschi

fbshipit-source-id: b6fa3ff0e38630d820aacedbf88dfe9bd13c0644
2024-09-30 08:12:41 -07:00
shubhamguptadream11 5c7a166dca 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-09-30 08:04:36 -07:00
Pieter De Baets 18faf68b48 Rename Binding to FabricUIManagerBinding (#46705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46705

We have multiple classes in React Native Android acting as a binding layer (between C++ and Java, between C++ and JS). Make it more obvious this Binding is for (Android) FabricUIManager and flatten the (now) unused Binding interface.

Changelog: [Android][Removed] BindingImpl is no longer part of the public interface

Reviewed By: cortinico

Differential Revision: D63536329

fbshipit-source-id: 329d184c1889fbe804995211cdd339b50a7c9234
2024-09-30 07:31:56 -07:00
Pieter De Baets 8dd616410d Make more SurfaceHandler configuration go through UIManager Binding (#46701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46701

Reduce the interface we expose in SurfaceHandler(Binding), and concentrate the logic in the FabricUIManager Binding.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D63536328

fbshipit-source-id: 5882bdd24fd3ca8f3d36210dca80587fee091dcf
2024-09-30 07:31:56 -07:00
Riccardo Cipolleschi aa35a21714 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-09-30 06:03:22 -07:00
Samuel Susla 4e38493d71 delete state alignment mechanism (#46658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46658

changelog: [internal]

We are shipping a better solution: Runtime Shadow Node Reference Syncing which is being rolled out.

Reviewed By: lenaic, rubennorte

Differential Revision: D63456344

fbshipit-source-id: e70b7dd4be7bf0670366e5200a910195b929a14d
2024-09-30 04:59:49 -07:00
Nicola Corti d1f47f7ad5 Silence unnecessary Gradle outputs - Part 1 (#46704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46704

Our build log for Gradle is extremely noisy due to Hermes.
Here I'm suppressing all the build output from Hermes as we can't really do much from that side of the build.

This should make it easier for folks on GitHub Actions to immediately spot where are failures.

Changelog:
[Internal] [Changed] - Silence unnecessary Gradle outputs

Reviewed By: GijsWeterings

Differential Revision: D63541175

fbshipit-source-id: d1a60098c317ff9e8c9575b5b8b2aab639f28f2f
2024-09-30 03:55:54 -07:00
Jorge Cabiedes Acosta fae572d815 Fix mixBlendMode not updating on Image state updates (#46680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46680

Since the parent of a view with mixBlendMode prop set is the one responsible for setting the compositing of the child, when updating mixBlendMode on a child we need to also invalidate the parent.

Changelog: [Android] [Fixed] - mixBlendMode now properly does state updates

Reviewed By: joevilches

Differential Revision: D63424394

fbshipit-source-id: 0eb15520f1087e25683853632943e64a66344481
2024-09-29 22:59:28 -07:00
Jorge Cabiedes Acosta d2c48f3b1a Remove experimental_ and cleanup mixBlendMode experiment (#46650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46650

tsia

Changelog: [General] [Added] - Removed `experimental` prefix and fully released `mixBlendMode` prop

Reviewed By: joevilches

Differential Revision: D63407473

fbshipit-source-id: 892ababcfe19b82d3f4c73d3cbc13fb46b7425b6
2024-09-29 22:59:28 -07:00
Nick Gerleman 513e9669e7 Fix interactions between removeClippedSubviews and RTL by applying HorizontalScrollContentView translation during layout metric assignment (#46685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46685

This attempts a similar fix to D59566611, but keeps the removedClippedSubviews logic as is, instead moving the current translation done in ReactHorizontalScrollContainerView onLayout to ShadowNode layout metric assignment (so the world is consistent from very early on, and `removeClippedSubviews` never sees coordinates before translation),

I suspect doing this at the ShadowNode layer might also result in some fixes to DevTools in RTL.

This should let us roll out setAndroidLayoutDirection again.

Changelog:
[Android][Fixed] - Fix interactions between removeClippedSubviews and RTL

Reviewed By: mdvacca

Differential Revision: D63318754

fbshipit-source-id: 828e103e2ad21c7e886e39c163474b10ebd5099e
2024-09-27 19:19:53 -07:00
Nick Gerleman a396f6c49b Back out "Do not hold raw RuntimeScheduler pointer in BufferedRuntimeExecutor"
Summary:
A crash we are getting in the wild suggests that destruction on weak ref count going away may be delaying RuntimeExecutor task destruction to a point where jsi::Function is invalid. Let's try backing D62748768 out and seeing if the crash goes away.

Changelog:
[General][Fixed] - Attempt to fix crash from delayed RuntimeExecutor task destruction

#bypass-github-export-checks

Reviewed By: mdvacca

Differential Revision: D63568504

fbshipit-source-id: 6152e7293902d0eb67a14c5840bea56561c35b08
2024-09-27 18:19:45 -07:00
Panos Vekris d75e917753 Deploy 0.247.1 to xplat (#46710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46710

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D63560047

fbshipit-source-id: a43ac647fee12115c794aa8002bd340a4c4bcf16
2024-09-27 15:27:53 -07:00
zhongwuzw 7c60a65ace 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-09-27 13:11:45 -07:00
Alex Hunt d17373c4ef Require Flow types in all react-native source files (#45786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45786

Following D60377082, `packages/react-native/Libraries/` is now 100% parsable by `flow-api-translator` and covered by `flow-api-test`. This diff increases test strictness to preserve this state going forward.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60377123

fbshipit-source-id: 8c48bdd73d9d0d97a114d553eb70cc01faf18e89
2024-09-27 12:02:37 -07:00
Alex Hunt 776e822db5 Add minimal Flow types to remaining files under Libraries/ (#45785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45785

Adds `flow` annotation, and/or adds minimal Flow types to remaining files under `packages/react-native/Libraries/`. As of this diff, 100% of this directory is now parsable by `flow-api-translator` and covered by `public-api-test`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60377082

fbshipit-source-id: 67e8acafc3fdd8f107f1d8d53c69ee6c27d3ed0a
2024-09-27 12:02:37 -07:00
Alex Hunt 33b78ee080 Substitute babel-preset-fbjs for metro-transform-plugins (#46689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46689

Resubmission of D61014834 / https://github.com/facebook/react-native/pull/45959 (previously reverted).

> Addresses TODO comment. I noticed this lone reference to babel-preset-fbjs (last published 3y ago) while attempting to upgrade our Babel Flow syntax plugin.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63532211

fbshipit-source-id: e94b55b7b61194b50131b36a2fe817e149152953
2024-09-27 10:36:42 -07:00
Alex Hunt 64381d3569 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-27 10:20:19 -07:00
Alex Hunt 1387f521fd Switch Babel parsing from legacy Flow plugin to hermes-parser (#46696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46696

Following D62161923, we began to lose sync with modern Flow syntax when Metro's `transformer.hermesParser` option is disabled. This config option loads Babel for transformation (instead of `hermes-parser`), which requires a Babel plugin to parse (not strip) Flow syntax.

This diff migrates us away from `babel/plugin-syntax-flow` (see also https://github.com/babel/babel/issues/16264) and uses the modern [`babel-plugin-syntax-hermes-parser`](https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser) instead (a component of the modern Hermes Parser stack).

Following this change, new projects that unset `transformer.hermesParser` will compile.

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

Changelog:
[General][Fixed] - Fix parsing of modern Flow syntax when `transformer.hermesParser = false` is configured in Metro config

Reviewed By: cipolleschi

Differential Revision: D63535216

fbshipit-source-id: d2c6ddec030d89e2698e03b76194cf3568d04e6b
2024-09-27 10:20:19 -07:00
Alex Hunt dc8bc45cfa Switch to hermes-parser in eslint-* package tests (#46699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46699

Switch from legacy Babel Flow parser integrations to the Meta-maintained `hermes-eslint` and `babel-plugin-syntax-hermes-parser` packages (both part of the `hermes-parser` codebase).

Required to unblock D63535216.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63541483

fbshipit-source-id: 04ccfa04c9a2b8c0a87ef1a5c38e952971838b77
2024-09-27 10:20:19 -07:00
Nicola Corti 6eb21ca1fb RNGP: Read enableWarningsAsErrors property correctly (#46657)
Summary:
I've noticed that some users are reporting build failures due to warnings inside RNGP.
We do have `allWarningsAsErrors` set to true for everyone (also for users).
That's too aggressive, and can cause build failures which are not necessary. Let's keep it enabled only on our CI (when the `enableWarningsAsErrors` property is set).

## Changelog:

[INTERNAL] - RNGP: Read `enableWarningsAsErrors` property correctly

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D63459601

Pulled By: cortinico

fbshipit-source-id: 0307e8d6771518038a5abe27ca5a993cb0a9f8c0
2024-09-27 08:40:14 -07:00
Pieter De Baets 43af902693 Unbreak Android LayoutAnimation by making all surfaces go through Binding (#46691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46691

In Bridgeless, ReactSurface would only call `registerSurface` when it started, which did not match the behaviour seen in startSurface(WithConstraints). Instead, make all calls to start the surface go through the FabricUIManager Binding so we can correctly configure `setMountingOverrideDelegate` which is required for layout animations.

Changelog: [Android][FIxed] LayoutAnimations work on full new architecture

Reviewed By: cortinico

Differential Revision: D63533635

fbshipit-source-id: f6d3db020bb2d7245f7b14f2407271d76837d40c
2024-09-27 08:32:31 -07:00
Ruslan Lesiutin 459fadce77 Use native module to persist RDT settings (#46663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46663

# Changelog: [Internal]

Now we can use the native module for persisting settings in React DevTools. Basically, this diff adds read / write implementations.

Reviewed By: huntie

Differential Revision: D62967060

fbshipit-source-id: c14ef056c8d7e30a23d2b84d1ad4fc0ad8eaaf34
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin d336a7c9c6 fix: pass closest public instance to React DevTools (#46664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46664

# Changelog: [Internal]

Please see https://github.com/facebook/react/pull/31068.

Synced changes for React Native - D63453667.

Reviewed By: huntie

Differential Revision: D63421463

fbshipit-source-id: e455711206598a06f7cdce4150e79c3548843b99
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin 37756d7de5 fix: ReactDevToolsSettingsManagerModule in ReactModuleList for android (#46665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46665

# Changelog: [Internal]

Looks like this module was missing on android for a while.

Reviewed By: huntie

Differential Revision: D63460309

fbshipit-source-id: 7146e7f2104f868d0f2b7271bd2c452608611ea3
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin cf491d769f Libraries/DevToolsSettings -> private/reactdevtools/ReactDevToolsSettings (#46662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46662

# Changelog: [Internal]

This should not have been a public API in the first place.

1. Moving this to `src/private`.
2. Removed some unused APIs, such as profiling settings.

Reviewed By: huntie

Differential Revision: D62965492

fbshipit-source-id: fb97eccaf647ce418f500b02d153263aa8632eee
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin 53b7f0e764 upgrade React Native on a new RDT backend (#46669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46669

# Changelog: [Internal]

In React DevTools 6.0.0, settings manager is [no longer used](https://github.com/facebook/react/pull/30986), because the host of the Backend is responsible for settings persistance.

Also, `installHook()` call was removed from the top level of the JavaScript module and now we need to call `initialize()` explicitly.

The logic for persisting settings will be added in one of the next diffs at the top.

Reviewed By: huntie

Differential Revision: D62967059

fbshipit-source-id: 5022546aab02540f38c8d2e2f2e7dfeb82863f3f
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin 6173d6ca42 Update debugger-frontend from e8c7943...87b2feb (#46673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46673

Changelog: [Internal] - Update `react-native/debugger-frontend` from e8c7943...87b2feb

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

Reviewed By: huntie

Differential Revision: D63455520

fbshipit-source-id: 07776c17f368e895a2d526cbb9abb8e1104bb29c
2024-09-27 08:12:45 -07:00
Ruslan Lesiutin ed4f6d6891 upgrade[react-devtools-core]: 6.0.0 (#46670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46670

# Changelog:
[General] [Changed] - upgrade React DevTools to 6.0.0.

allow-large-files

Reviewed By: huntie

Differential Revision: D63460308

fbshipit-source-id: 159b0a0a074aae52c3710730a4fc2cbccb04970d
2024-09-27 08:12:45 -07:00
Nicola Corti 1bdae07d89 Add Android implementation for DevMenu Module (#46694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46694

The DevMenu module was never implemented on Android. This adds its implementation by mirroring the iOS implementation.

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

Changelog:
[Android] [Fixed] - Add missing Android implementation for DevMenu Module

Reviewed By: cipolleschi

Differential Revision: D63535172

fbshipit-source-id: 791e72b46b7d3264b98e85a73f2d9025dc3a2c7d
2024-09-27 07:49:52 -07:00
zhongwuzw 8bfd7e1039 Fixes Appearance getColorScheme sync method UI thread issue (#46344)
Summary:
If the module sets the method queue to the main queue, we should call it on the main queue if it contains some UI operations, otherwise it may lead to some undefined behavior.

## Changelog:

[IOS] [FIXED] - Fixes the exported synchronous method not being called on the method queue when it's the main queue

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

Test Plan: The sync method should be called on the main queue if the module's method queue is main queue.

Reviewed By: cipolleschi

Differential Revision: D63532525

Pulled By: javache

fbshipit-source-id: 55baaa60af96bb1355d3641174f23bccd8eb9344
2024-09-27 06:47:53 -07:00
Blake Friedman 8237e237ce cli: fix init when called as npx react-native init (#46677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46677

Since removing `react-native-community/cli` as a dependency in 0.76 the `npx react-native init` command isn't working.  This is the deprecated way to run this command, but users should still expect it to work for now.

This now forks this kind of request to `npx react-native-community/cli init <args>` as described in the warning logs to the user.

Changelog: [Internal]

Issue: reactwg/react-native-releases#508

Reviewed By: cortinico

Differential Revision: D63467046

fbshipit-source-id: 84560bdae8d6f62629dee61da3cbbf544b9a83b2
2024-09-27 03:38:19 -07:00
Nicola Corti 12dda31bc1 fix: ReactDelegate crashing New Architecture apps by invoking setContentView (#46671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46671

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

Currently `ReactFragment` and `ReactDelegate` don't work in OSS + New Architecture because we call `Activity.setContentView`
on the host activity.

That result on us replacing the whole activity layout, even when the user wants to use a Fragment.
As we do have `ReactActivityDelegate` that already does this:
https://github.com/facebook/react-native/blob/94b77938435693792e57c96d76691d58d7361530/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java#L138

So this call is unncessary.

I've also updated the relative documentation here:
https://github.com/facebook/react-native-website/pull/4232

Changelog:
[Android] [Fixed] - fix: ReactDelegate/ReactFragment crashing on New Architecture apps

Reviewed By: rozele

Differential Revision: D63464367

fbshipit-source-id: acbfbf7d68eb79657b811a5a9a0d3f72660ec94a
2024-09-27 01:49:38 -07:00
Nicola Corti 7176d11ce4 ReactFragment should properly instantiate ReactDelegate on Bridgeless (#46623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46623

I've just noticed that ReactFragment is not properly instantiating the `ReactDelegate` with a ReactHost
when on Bridgeless. This causes Fragments to crash when the app is on bridgeless mode.

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

Changelog:
[Android] [Fixed] - ReactFragment should properly instantiate ReactDelegate on Bridgeless

Reviewed By: mdvacca

Differential Revision: D63319977

fbshipit-source-id: 08256e35b2769e18df2d24f870ec5d98e5574f85
2024-09-27 01:49:38 -07:00
Nicola Corti ecd660984c 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-09-27 00:43:25 -07:00
Sam Zhou efe51044b8 Deploy 0.247.0 to fbsource
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D63506281

fbshipit-source-id: a992a1786a570f5d9562fbec71e0d2628c139bf3
2024-09-27 00:23:22 -07:00
Sam Zhou c2c9b78e49 Pre-suppress errors ahead of v0.247 release
Summary:
drop-conflicts

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D63506234

fbshipit-source-id: 186d60e42a8a2a3604058692ed844ba764d6ad3f
2024-09-26 22:25:21 -07:00
David Vacca d93e67d02c Enable Microtasks, ModernRuntimeScheduler and NativeViewConfigsInBridgelessMode by default only for New Architecture (#46683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46683

Enabling these Microtask, ModernRuntimeScheduler and NativeViewConfigsInBridgelessMode in BridgeMode is risky and leads to bugs.  In this diff I'm ensuring we only enable these flags when newArchitecture is enabled

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D63503519

fbshipit-source-id: 4ef757834b8f7fba595b3394735f4b91335d7c98
2024-09-26 22:02:42 -07:00
Nick Gerleman 3f880991aa Back out "Redo "[RN][Android] Convert ReactViewManager, ReactClippingViewManager to Kotlin""
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.

Reviewed By: Abbondanzo

Differential Revision: D63493332

fbshipit-source-id: 4423bf41c793e00a0aa22d12a77bca69d3b1ae77
2024-09-26 15:50:26 -07:00
Nick Gerleman 8d22e3b249 Back out "Redo "[RN][Android] Convert ReactViewGroup to Kotlin""
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.

Reviewed By: Abbondanzo

Differential Revision: D63493331

fbshipit-source-id: 44658ffc99eb4ebc947f95bb6e6bde105ac88c93
2024-09-26 15:50:26 -07:00
Nick Gerleman a886a2fa05 Back out "ReactViewGroup post-conversion cleanup"
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.

Reviewed By: Abbondanzo

Differential Revision: D63493334

fbshipit-source-id: 175fc7b5b69aa2874c867e460ab102bb077a7cd8
2024-09-26 15:50:26 -07:00
Eric Rozell 1dcaf823f5 Fix conflicting assertions for click events (#46633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46633

There is an assertion in the "basic click test" that [checks](https://github.com/facebook/react-native/blob/d6e0bc7/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouch.js#L36-L40) that `isPrimary` is set to false. The same assertion suite also does a mouse event [validation](https://github.com/facebook/react-native/blob/d6e0bc7/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js#L201-L204) that `isPrimary` is set to true.

This fixes the conflicting assertions, favoring the behavior observed on Firefox, which appears to be more closely aligned with the W3C spec.

## Changelog

[General][Fixed] Fixed issues with W3C PointerEvents testsx

Reviewed By: vincentriemer

Differential Revision: D63336622

fbshipit-source-id: adbfe5e1bc2a5fd7db18ae067f39e719c19c8cda
2024-09-26 14:45:44 -07:00
David Vacca fc9fcb5976 Fix initialization of FeatureFlags in DefaultNewArchitectureEntryPoint (#46681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46681

Fix initialization of FeatureFlags in DefaultNewArchitectureEntryPoint

D60364016 introduced a bug, disabling Fabric and TurboModules when DefaultNewArchitectureEntryPoint is initialized with bridgless disabled

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D63474698

fbshipit-source-id: 8b5aaeeda564d3463d13448b0adc7e964015000e
2024-09-26 14:23:04 -07:00
Thomas Nardone 9cd83fa9ab ReactViewGroup post-conversion cleanup (#46668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46668

Small tweaks post-Kotlin-conversion:
- Make `overflow` a var
- Replace `+ -` with `-`
- Clean up properties and move up init block
- Iterate over entire allChildren array to clean up listeners

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D63343964

fbshipit-source-id: 2e9022e2d7e54ac338d1003419d8959771f7f270
2024-09-26 13:11:07 -07:00
Thomas Nardone be5e2b5827 Redo "[RN][Android] Convert ReactViewGroup to Kotlin" (#46672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46672

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63129923

fbshipit-source-id: 0734f564b38e3adba704edffe45511e671ae74ac
2024-09-26 13:11:07 -07:00
Thomas Nardone f775f6919f Redo "[RN][Android] Convert ReactViewManager, ReactClippingViewManager to Kotlin" (#46667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46667

Pre-req for converting ReactViewGroup without affecting API visibility.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63129925

fbshipit-source-id: 3b31df7b5450adcc961bb677114fb94d944f1ce4
2024-09-26 13:11:07 -07:00
Pieter De Baets 3fbf5c72f3 Fix ReactSurfaceView-backed roots not reporting the end of pending transactions correctly (#46676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46676

Changelog: [internal]

## Context

We recently "fixed" a problem in `MountingCoordinator` on Android where it would report that it doesn't have any pending transactions when, in fact, it does. The fix introduces a new method in that class to delay marking transactions as done until a mount hook is invoked for that surface.

That fixed the issue... by always reporting that there were pending transactions accidentally.

The reason for this bug is that the mount hook doesn't have access to the mounting coordinator of the surface if the surface is registered through some of the methods in `Binding.cpp` that don't add the surface to a registry. In that case, we can never mark the transactions as done and the mounting coordinator for those surfaces always report pending transactions incorrectly.

NOTE: this bug only affects apps that have the `fixMountingCoordinatorReportedPendingTransactionsOnAndroid` feature flag enabled.

## Changes

This fixes the issue by making sure that surfaces are always registered in the registry and that we can access their mounting coordinators in the mount hook to report the transactions as done.

Reviewed By: rubennorte

Differential Revision: D63466672

fbshipit-source-id: a621a12cda89a3ab7331d3c6a16c6cdfa9341821
2024-09-26 11:32:00 -07:00
Pieter De Baets 04da3d784b Error in reportMount when surface is not found (#46678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46678

I'm investigating some issues with surface management and noticed `surfaceHandlerRegistry_` is not updated in the bridgeless path when using ReactSurfaceView.

Adding a warning to help us validate this is resolved when we do eventually fix it.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D63463521

fbshipit-source-id: 38995924588f1d71b9fc517c76a6e0c572fd0699
2024-09-26 11:32:00 -07:00
hoxyq (Meta Employee) 633ad4933e fix: use public instance in Fiber renderer and expose it from getInspectorDataForViewAtPoint (#31068) (#46674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46674

bypass-github-export-checks

React DevTools no longer operates with just Fibers, it now builds its
own Shadow Tree, which represents the tree on the Host (Fabric on
Native, DOM on Web).

We have to keep track of public instances for a select-to-inspect
feature. We've recently changed this logic in
https://github.com/facebook/react/pull/30831, and looks like we've been
incorrectly getting a public instance for Fabric case.

Not only this, turns out that all `getInspectorData...` APIs are
returning Fibers, and not public instances. I have to expose it, so that
React DevTools can correctly identify the element, which was selected.

Changes for React Native are in
[D63421463](https://www.internalfb.com/diff/D63421463)

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

Test Plan: Sandcastle tests

Reviewed By: poteto

Differential Revision: D63453667

Pulled By: hoxyq

fbshipit-source-id: 21b1d5d4cd68b42748d4a785e0f28eaf5db57f21
2024-09-26 09:58:18 -07:00
Robert Pasiński 38b3b2195c New implementation of PerformanceObserver and related APIs (fixes #45122) (#45206)
Summary:
Changelog: [internal]

(this functionality hasn't been enabled in OSS yet, so no changelog necessary).

Fix https://github.com/facebook/react-native/issues/45122.

performance.mark is currently O(1) but performance.clearMark is O(n) (being n the number of entries in the buffer), which makes this operation very slow.

### Changes overview

 - Created new `PerformanceEntryBuffer` abstraction with the following subtypes, that differ on how entries are stored:
   - `PerformanceEntryCircularBuffer` - stores them in a ring buffer that was already implemented, removed key lookup cache (`BoundedConsumableBuffer`)
   - `PerformanceEntryKeyedBuffer` - stores them in a `unordered_map`, allowing for faster retrieval by type
   - `PerformanceEntryLinearBuffer` - a simple infinite buffer based on `std::vector`, currently used in a `PerformanceObserver`
 - Created `PerformanceObserver` abstraction on native side.
 - Created `PerformanceObserverRegistry` that collects active observers and forwards entries to observers that should retrieve them
 - Moved some method implementations to `.cpp` files to reduce potential compilation time slowdown. As the `PerformanceEntryReporter` can be included from anywhere in the code, it will be beneficial to make header files as light as possible.
 - Add comments to methods that note which standard is the method from/for.
 - Added some `[[nodiscard]]` attributes
 - Since the logic of routing entries to observers is moved to native side, JS side of the code got much simplified
 - If ever needed, `PerformanceObserver` can be created from native-side

Standards covered:

 - https://www.w3.org/TR/performance-timeline
 - https://www.w3.org/TR/event-timing/
 - https://w3c.github.io/timing-entrytypes-registry
 - https://w3c.github.io/user-timing/

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

Test Plan:
I've tested this e2e on IGVR and in the RNTester playground for the performance APIs. Everything works as expected.
There are also new unit tests for this.

C++ test results: https://www.internalfb.com/intern/testinfra/testconsole/testrun/8725724513169247/

Reviewed By: rshest

Differential Revision: D63101520

Pulled By: rubennorte

fbshipit-source-id: 5970b5c14692ff33ffda44a9f09067f6a758bdbe
2024-09-26 09:16:03 -07:00
Riccardo Cipolleschi 94b7793843 Run Maestro tests also in debug mode (#46573)
Summary:
This change runs Maestro tests also in Debug mode, by starting Metro in background.

## Changelog:
[Internal] - Add E2E tests in Debug mode too

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

Test Plan:
GHA must be green.
Successful run: https://github.com/facebook/react-native/actions/runs/11033322135?pr=46573

Reviewed By: cortinico

Differential Revision: D63452169

Pulled By: cipolleschi

fbshipit-source-id: e04b87f6a3e7aca8519dc2cb37c982dff3c20100
2024-09-26 06:01:28 -07:00
tutejsy 19d468fed9 Fix applying of tintColor and progressViewOffset props for RefreshControl component (#46628)
Summary:
While developing my project with New Architecture enabled I've found out that properties `tintColor` and `progressViewOffset` of component `RefreshControl` don't apply on iOS.  This happens due to the lack of handling of these properties in the `RCTPullToRefreshViewComponentView.mm` class.

The bug can be easily reproduced in RNTester app on RefreshControlExample.js screen, since it has property `tintColor="#ff0000"` (Red color), but RefreshControl renders with gray color:

<img width="300" alt="RefreshControlExample.js" src="https://github.com/user-attachments/assets/10931204-dbe8-4cbd-9adc-d0f38319febd">

<img width="300" alt="gray Refresh Control" src="https://github.com/user-attachments/assets/e5d088e8-b3f5-46b8-9284-9b452232ad10">

<br />
<br />

This PR is opened to fix that by applying `tintColor` and `progressViewOffset` props to `_refreshControl` in `RCTPullToRefreshViewComponentView.mm` class.

Fixes https://github.com/facebook/react-native/pull/46628

## Changelog:

[IOS][FIXED] - Fix applying of tintColor and progressViewOffset props for RefreshControl component with New Architecture enabled

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

Test Plan:
1. Run rn-tester app with New Architecture enabled on iOS
2. Open screen of RefreshControl component:

<img width="300" alt="Снимок экрана 2024-09-24 в 19 48 49" src="https://github.com/user-attachments/assets/94a2d02d-f3e3-4e18-a345-87c22d4a2620">

3. Open `/packages/rn-tester/js/examples/RefreshControl/RefreshControlExample.js` file and change properties `tintColor` and `progressViewOffset` of  RefreshControl components on the line 85:

<img width="300" alt="Снимок экрана 2024-09-24 в 22 01 19" src="https://github.com/user-attachments/assets/425826a6-d34c-4316-8484-e65f125a8b28">

4. check that your changes applied:

<img width="300" alt="Снимок экрана 2024-09-24 в 19 54 46" src="https://github.com/user-attachments/assets/b97621f1-b553-48c9-bc81-e04a99a7e099">

Reviewed By: cortinico

Differential Revision: D63381050

Pulled By: cipolleschi

fbshipit-source-id: 4f3aed8bd7a1e42ce2a75aa19740fd8be1623c86
2024-09-26 05:58:54 -07:00
Oskar Kwaśniewski 391680fe84 feat: improve RCTAppDelegate usage for brownfield (#46625)
Summary:
This PR improves the usage of `RCTAppDelegate` for brownfield scenarios.

Currently, when we want to integrate React Native with a brownfield app users might not want to initialize React Native in the main window. They may want to create it later.

Example usage:

```swift
class AppDelegate: RCTAppDelegate {
   override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
      // Disable automatically creating react native window
      self.automaticallyLoadReactNativeWindow = false

      return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
```

```swift
import Foundation
import React
import React_RCTAppDelegate

class SettingsViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    self.view = (RCTSharedApplication()?.delegate as? RCTAppDelegate)?.rootViewFactory .view(withModuleName: "Settings", initialProperties: [:])
  }
}
```

## Changelog:

[IOS] [ADDED] - improve RCTAppDelegate usage for brownfield, add `automaticallyLoadReactNativeWindow` flag

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D63325397

Pulled By: cipolleschi

fbshipit-source-id: 1361bda5fcd91f4933219871c64a84a83c281c34
2024-09-26 05:39:01 -07:00
David Vacca 10a33e0479 Migrate ReactFeatureFlags.enableFabricRenderer -> ReactNativeFeatureFlags (#46493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46493

Migrate:
- ReactFeatureFlags.enableFabricRenderer -> ReactNativeFeatureFlags.enableFabricRenderer()
- ReactFeatureFlags.useTurboModules -> ReactNativeFeatureFlags.useTurboModules()
- Rename ReactFeatureFlags.enableBridgelessArchitecture -> ReactNativeFeatureFlags.enableBridgelessArchitecture()

changelog: [Android][Breaking] Delete useTurboModules, enableFabricRenderer and enableBridgelessArchitecture fields from ReactFeatureFlags class

Reviewed By: rubennorte

Differential Revision: D60364016

fbshipit-source-id: e10a44fc08deb8969104b5cb0bd426dfb0a45d30
2024-09-26 04:29:27 -07:00
Riccardo Cipolleschi 038e6eda6d Fix the trigger e2e on comment workflow (#46653)
Summary:
This change fixes the workflow by using the right URL. I also added some logging for debugging.

## Changelog:
[Internal] - Fix Trigger E2E tests workflow

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

Test Plan: Tested the script locally and verified that it triggers the workflow.

Reviewed By: cortinico

Differential Revision: D63452098

Pulled By: cipolleschi

fbshipit-source-id: f44956071edb68046ed1cb74e286e8edbe0eb23a
2024-09-26 03:49:09 -07:00
Vitali Zaidman 23e738fb6d allow waiting for metro to be torn down (#46620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46620

The following error was thrown when the test `packages/metro/src/integration_tests/__tests__/server-test.js` was running on Metro:
{F1816961963}

It led me to investigate why don't we wait for Metro to be torn down.

Currently we close metro by closing the http server that it launches.
```
const httpServer = await Metro.runServer(/* ... */);
httpServer.close(callback);
```
While we can listen to the callback fired when the server is closed, it only covers one of the systems running internally in metro. The systems that are not covered are:
* File watchers
* File map workers
* Dependency graph
* Bundler

And many systems that were themselves listening to the above like "eslint file map" or the "dependency analysis".

**These systems are closed by us _after_ the server is closed.** This means that a listener to `server.on('close'` would only get the indication where these systems has started to close rather than actually got closed.
https://www.internalfb.com/code/fbsource/[17e03bc6bd86]/xplat/js/tools/metro/packages/metro/src/index.flow.js?lines=359-361

This diff introduces a way to wait for all of metro to be closed.

In this diff I use that new way of listening to Metro closure to get rid of the jest test warning mentioned above in `packages/metro/src/integration_tests/__tests__/server-test.js`:
```
  let serverClosedPromise;

  beforeEach(async () => {
    config = await Metro.loadConfig({
      config: require.resolve('../metro.config.js'),
    });

    let onCloseResolve;
    serverClosedPromise = new Promise(resolve => (onCloseResolve = resolve));
    httpServer = await Metro.runServer(config, {
      reporter: {update() {}},
      onClose: () => {
        onCloseResolve();
      },
    });
  });

  afterEach(async () => {
    httpServer.close();
    await serverClosedPromise;
  });
```

Changelog: [Feature] add `onClose` to `Metro.runServer` configuration allowing to wait for metro and all associated processes to be closed.

Reviewed By: huntie

Differential Revision: D61594124

fbshipit-source-id: e3c50ef986077503bce0caa42a9f9430efc65272
2024-09-26 03:42:49 -07:00
Michael Troger 7dcb10b6e7 Fix YogaConfig getting garbage collected #1678 (#46651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46651

Fixes [https://github.com/facebook/yoga/issues/1678](https://github.com/facebook/yoga/issues/1678)

As described in the linked Issue, the problem is that the `YogaConfig` can get garbage collected by the JVM, while a `YogaNode` is still referring to it. This at some point leads to unexpected behaviour (0 values for `layoutWidth`/`layoutHeight`). The change coming with this PR makes sure the `YogaConfig` can not get garbage collected while it's used by a `YogaNode`.

Demo project to confirm the fix https://github.com/michaeltroger/yogabug

Kudos to rtPag, who helped identifying the issue.

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

Reviewed By: mdvacca

Differential Revision: D63416127

Pulled By: NickGerleman

fbshipit-source-id: efd87dac897e44d3664c228c40cda90f1e11c4f6
2024-09-25 23:53:17 -07:00
Shawn Dempsey 256adcab7b Add a new playground component to rntester (#46632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46632

Changelog: [General][Added] Add Playground to RNTester for testing out features & submitting reproducers.

**Context**

- Adding the Playground from Catalyst to RNTester
- This should help folks test React Native features for a particular version

**Change**

- Add a new playground component to RNTester
- Add a new reducer action for opening an example from navbar press
- Fixed typing issues
- Add icon from this fb asset pack: https://www.internalfb.com/assets/set/facebook_icons/nucleus-beaker/variant_outline-size_24?q=beaker
- Matched background color using this imagemagick script

**dark**
```
convert input.png -fill 'rgb(178,180,186)' -colorize 100% output.png
```
**light**
```
convert input.png -fill 'rgb(81,82,84)' -colorize 100% output.png
```

Reviewed By: NickGerleman

Differential Revision: D61972594

fbshipit-source-id: 4a5523a84a6ef09d3266d5f56825907bd3fbe4b5
2024-09-25 23:29:11 -07:00
Rick Hanlon e9ec9fbde4 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-09-25 19:28:05 -07:00
Rick Hanlon 2f85e28cde 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-09-25 19:28:05 -07:00
Rick Hanlon 1787726bf9 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-09-25 19:28:05 -07:00
Joe Vilches 8eadb84d32 Expose box sizing getters and setters in Yoga (#46630)
Summary:
X-link: https://github.com/facebook/yoga/pull/1701

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

I would like to write some tests for box sizing that will drive a lot of my development as I implement content box. To do that, I need this publicly exposed. Obviously not that ideal since this currently does not do anything. Maybe we can name the value in such a way that its clear it is in development?

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63135970

fbshipit-source-id: 7520823bf925364eae45341531e012e80ec92284
2024-09-25 15:46:55 -07:00
Joe Vilches 9ee5fffae0 Small perf fix for new iOS view clipping (#46629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46629

If we clipped and had no border or corner radius we would end up hitting this path every time. We can optimize this a bit to avoid that.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63299597

fbshipit-source-id: 90031f964b7669049a4a2efe00a553c888d28cd7
2024-09-25 13:35:56 -07:00
Blake Friedman eb7c43965e Add changelog for 0.76.0-rc.2 (#46619)
Summary:
Add changelog for 0.76.0-rc.2

Changelog:
[Internal] - add changelog

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

Reviewed By: cipolleschi

Differential Revision: D63387314

Pulled By: blakef

fbshipit-source-id: c80449ff2043c26a126ec91db39f81093ac2d57f
2024-09-25 06:57:00 -07:00
Oskar Kwaśniewski 5bd751bd91 fix: running local tests (#46615)
Summary:
This PR fixes running local tests.

### Before

Tests from Pods/ are executed (including Hermes tests)

![CleanShot 2024-09-24 at 10 09 04@2x](https://github.com/user-attachments/assets/5d766321-1099-4970-bc4d-cf20ec1f5d89)

### After

![CleanShot 2024-09-24 at 10 10 24@2x](https://github.com/user-attachments/assets/356b0db3-9278-4cb3-a216-2ca78b623950)

## Changelog:

[INTERNAL] [FIXED] - Make tests run locally

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

Test Plan: 1. Run yarn run test (with and without the change). Make sure you have installed pods.

Reviewed By: huntie

Differential Revision: D63383063

Pulled By: cipolleschi

fbshipit-source-id: d7352f80c0fe4efdbb169e1adc4d5f60179f78e8
2024-09-25 05:51:49 -07:00
Hailey 99ab845a5c convert NSNull to nil before checking type in readAsDataURL (#46635)
Summary:
This issue original arose out of https://github.com/bluesky-social/social-app/issues/5100. Copying the description (with my general understanding of the problem) from the patch PR to here as well.

There's a crash that comes up in the following, pretty specific scenario:

- Have a response that has an empty body
- Do not include a `content-type` header in the response
- Set the `x-content-type-options` header to `nosniff`

RN handles the response for a request in this block of code: https://github.com/facebook/react-native/blob/303e0ed7641409acf2d852c077f6be426afd7a0c/packages/react-native/Libraries/Blob/RCTBlobManager.mm#L314-L326

Here, we see that values of `nil` - which `[response MIMEType]` will return when no `content-type` is provided in the response and the actual type cannot be determined (https://developer.apple.com/documentation/foundation/nsurlresponse/1411613-mimetype) - gets converted to `NSNull` by `RCTNullIfNil`.

When we get back over to `readAsDataURL`, we see that we grab the type from the dictionary and check if its `nil` before calling `length` on the string. https://github.com/facebook/react-native/blob/303e0ed7641409acf2d852c077f6be426afd7a0c/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm#L74-L77

However, this check is dubious, because the value will never actually be `nil`. It will always either be `NSString` or `NSNull` because of the `RCTNullIfNil` call made above and `[RCTConvert NSString]` seems to just return the input if it is `NSNull`.

## Changelog:

[IOS] [FIXED] - Convert `NSNull` to `nil` before checking `type` in `readAsDataURL`

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

Test Plan:
This is a little awkward to test, but essentially this comes up in the following scenario that is described (and "tested" as being fixed by tweaking) in https://github.com/bluesky-social/social-app/issues/5100. I have personally tested by using Cloudflare rules to add/remove that particular header from an empty body response. You could also test this with a little local web server if you want.

### Before

https://github.com/user-attachments/assets/deb86c68-2251-4fef-9705-a1c93584e83e

### After

https://github.com/user-attachments/assets/9ffab11b-b2c8-4a83-afd6-0a55fed3ae9b

Reviewed By: dmytrorykun

Differential Revision: D63381947

Pulled By: cipolleschi

fbshipit-source-id: b2b4944d998133611592eed8d112faa6195587bd
2024-09-25 04:47:54 -07:00
Oskar Kwaśniewski 65575e8399 feat: get react-native package name from package.json in codegen script (#46604)
Summary:
This PR fixes the retrieval of react native package name to retrieve it from package.json.

This fixes the annoying message in codegen that poped up when installing pods:

```
[Codegen] Found react-native-macos
[Codegen] CodegenConfig Deprecated Setup for react-native-macos.
    The configuration file still contains the codegen in the libraries array.
    If possible, replace it with a single object.

BEFORE:
    {
      // ...
      "codegenConfig": {
        "libraries": [
          {
            "name": "libName1",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName1/js"
          },
          {
            "name": "libName2",
            "type": "all|components|modules",
            "jsSrcsRoot": "libName2/src"
          }
        ]
      }
    }

    AFTER:
    {
      "codegenConfig": {
        "name": "libraries",
        "type": "all",
        "jsSrcsRoot": "."
      }
    }
```

## Changelog:

[GENERAL] [CHANGED] - get react-native package name from package.json in codegen script

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

Test Plan: Install pods

Reviewed By: cortinico

Differential Revision: D63335543

Pulled By: arushikesarwani94

fbshipit-source-id: 0470e54f0fc7aa962918c889855c52648d11e32d
2024-09-25 01:28:23 -07:00
Eric Rozell 68a6b69b27 Fix PointerOverOut test (#46634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46634

The PointerEventPointerOverOut.js test case is broken due to a changed assumption about the name of the native tag property (`_nativeTag` vs. `__nativeTag`). This fixes the broken assumption.

## Changelog

[General][Fixed] Fixed issue with W3C PointerEvents tests

Reviewed By: NickGerleman

Differential Revision: D63336621

fbshipit-source-id: b54270f1c1232de6845ef73cac52f06b9a85539c
2024-09-24 19:49:34 -07:00
Pieter De Baets 0cb32d5ac9 Cleanup Fresco SystraceRequestRequestListener (#46626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46626

Remove `!!` by reusing lookup result.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D63316175

fbshipit-source-id: 1abfb20490831f26819aef4393c9629253d33ec6
2024-09-24 13:40:47 -07:00
Riccardo Cipolleschi 303e0ed764 Fix Increment and Decrement accessibility actions (#46617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46617

This changes fixes the Increment/Decrement accessibility actions on iOS with the New Architecture.

## Changelog
[iOS][Fixed] - Make sure that the Increment and Decrement accessibility actions works on iOS

Reviewed By: javache

Differential Revision: D63263830

fbshipit-source-id: 99dca14a002e098db2d3b0e268af32cdab6ce786
2024-09-24 09:24:24 -07:00
Pieter De Baets a9551641b4 Cleanup Modal test code (#46603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46603

Was debugging this test for the mounting instruction changes, and found some opportunities to clean this up.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D63258342

fbshipit-source-id: f7e6be58474f112993232ce5859ccb160f050ae8
2024-09-24 05:34:01 -07:00
Nicola Corti c005609b01 Properly set REACTNATIVE_MERGED_SO for autolinked libraries. (#46606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46606

This fixes this issue reported here:
https://github.com/react-native-community/discussions-and-proposals/discussions/816#discussioncomment-10673136

reported by both SWM and Expo.

The problem is that `REACTNATIVE_MERGED_SO` is not properly set for autolinked libraries so they can't access it
to understand if the version of ReactNative has merged so libraries or not.
This fixes it, I've tested against
https://github.com/tomekzaw/repro-reactnative-merged-so
reproducer provided by tomekzaw

Changelog:
[Android] [Fixed] - Properly set `REACTNATIVE_MERGED_SO` for autolinked libraries

Reviewed By: rubennorte

Differential Revision: D63262687

fbshipit-source-id: c505dce9036bb4cd0366b7ab99412368963273af
2024-09-24 03:35:15 -07:00
Nick Gerleman fc8224036b Fix measuring text with incorrect hyphenationFrequency
Summary:
A typo means TextLayoutManager will incorrectly measure text as if `LineBreaker.HYPHENATION_FREQUENCY_NORMAL` is set, instead of the correct default of `LineBreaker.HYPHENATION_FREQUENCY_NONE` which we use to display the `TextView`. This causes truncation if hyphenation would have caused text to be shorter than if not hyphenated. Fix the typo.

Changelog: [Android][Fixed] - Fix measuring text with incorrect hyphenationFrequency

Reviewed By: mellyeliu

Differential Revision: D63293027

fbshipit-source-id: baaf2ae2676548cf0815ae96e324af273be6f99e
2024-09-23 17:52:30 -07:00
Jorge Cabiedes Acosta 7ab0002799 Disable outline props on old architecture (#46608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46608

tsia

Changelog: [Android][Changed] - Disabling `outline` props on Android to stay consistent with iOS

Reviewed By: NickGerleman

Differential Revision: D63143626

fbshipit-source-id: 3eafe5beeb54b1619d94fe3d886ab19d445a0b09
2024-09-23 13:46:32 -07:00
Jorge Cabiedes Acosta 8ad4b7d0cf Fix outline drawing 1px width when outlineWidth = 0 (#46586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46586

When Paint.strokeWidth is set to 0 its not actually 0 but "hairline mode" so  the fix is just to make outline not draw at all when outlineWidth = 0 {F1879399325}

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D63136220

fbshipit-source-id: 81ef7ce0b72158c6b7c332191d332008c5a919b4
2024-09-23 11:57:39 -07:00
Dmitry Rykun 6e0e712c2a Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag (#46598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46598

Changelog: [General][Changed] - Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag

Facebook
Also bring back `skip_state_updates_for_looping_animations` MC. This will allow the experiment to participate in a holdout properly.

Reviewed By: GijsWeterings

Differential Revision: D63252185

fbshipit-source-id: 89bc9321b12f07bd9b3b52c4fc1021d34594ebc0
2024-09-23 10:56:06 -07:00
Pieter De Baets b846f94b1c Refactor FabricMountingManager to enable reuse of IntBuffer methods (#46600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46600

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D63150556

fbshipit-source-id: 039a88d6444df53767be52b9e70c20ef2ffd99be
2024-09-23 09:08:00 -07:00
Renaud Chaput 3c54e1ee45 Fix <KeyboardAvoidingView> with floating keyboard on iPad (#44859)
Summary:
On iPadOS, users can change the kind of keyboard displayed onscreen, going from normal keyboard, to split keyboard (one half on the left of the screen, one half on the right), or a floating keyboard that you can move around the screen.

When a non-normal kind of keyboard is used, `<KeyboardAvoidingView>` calculations are all wrong and, depending on the `behavior` prop, can make your screen completely hidden.

This PR attempts to detect that the keyboard is not the "normal displayed-at-bottom-of-screen" keyboard, and forces `enable={false}` if this happens.

The approach of comparing the keyboard width with the window width comes from this comment: https://github.com/facebook/react-native/issues/29473#issuecomment-696658937

A better fix might be to detect the kind of keyboard used, but this involves native code changes and I do not know iOS enough to do that. In addition, I have not found an easy way to do it using iOS APIs after a quick search.

I also chose to cache the window width as a class attribute. Maybe this is not needed as `Dimensions.get('window').width` is very fast and can be called on every keyboard event?

This fixes https://github.com/facebook/react-native/issues/44068 and https://github.com/facebook/react-native/issues/29473

## Changelog:

[IOS] [FIXED] - Fix `<KeyboardAvoidingView>` with floating keyboard on iPadOS

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

Test Plan:
Tested using RNTester and the "Keyboard Avoiding View with different behaviors" example.

Before:

https://github.com/facebook/react-native/assets/42070/111598a3-286c-464d-8db8-73afb35cd7f9

After:

https://github.com/facebook/react-native/assets/42070/0b3bc94f-8b67-4f42-8a83-e11555080268

Reviewed By: cortinico

Differential Revision: D62844854

Pulled By: cipolleschi

fbshipit-source-id: 577444be50019572955a013969d78178914b5b8d
2024-09-23 07:59:33 -07:00
Pieter De Baets a6fcad7e27 Move ShadowNodePair to Differentiator (#46590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46590

This API should not be part of the ShadowView header, since the class is only used by Differentiator. The ShadowView header should contain public API's that the mounting layer can consume.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63148522

fbshipit-source-id: 0545777fd311424ccd2d66de8b47b5591e8175f7
2024-09-23 07:12:09 -07:00
Pieter De Baets 300db67b27 Remove unused FabricComponents mapping (#46591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46591

This is a duplicate of FabricNameComponentMapping, which is not exposed. Checking GitHub codesearch, this API is not referenced elsewhere.

This component should be cleaned, with the mappings moved to a generic translation layer (eg in [ViewManagerRegistry](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java#L55)) or by fixing the JS callers.

Changelog: [Android][Removed] FabricComponents is removed from public API

Reviewed By: fabriziocucci

Differential Revision: D63099721

fbshipit-source-id: 7018deadc919e21cdf3482ae454baca72937611f
2024-09-23 07:12:09 -07:00
Pieter De Baets 9eafec48f3 Unbreak RN_SHADOW_TREE_INTROSPECTION flag (#46589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46589

This is a useful too for debugging ShadowTree mutations, but was broken due to some recent build changes.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63099720

fbshipit-source-id: 9ae5ee062ef9a6a99b2517e4eedd286cd6259fbe
2024-09-23 04:57:17 -07:00
Rubén Norte 9235be3776 Add metadata to feature flag definitions (#46597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46597

Changelog: [internal]

Adding explicit metadata to feature flags so they're easier to manage:
* Purpose: to indicate why the feature flags are added.
    * Release: gating features we don't want to expose in certain environments yet (e.g.: Fabric).
    * Experimentation: changes that we want to test before enabling them broadly. Should generally be short lived.
    * Operational: flags that enable certain behaviors in certain environments (e.g.: debugging logs).
* Date added: only for experimental flags, so we know how long we've been waiting to fully roll out the change (without having to go through the repository history, which could've been changed due to refactors).

Reviewed By: javache

Differential Revision: D62972237

fbshipit-source-id: ab51e989a2cddb8dc52197238b638609d30002f0
2024-09-23 04:40:37 -07:00
Pieter De Baets be7b78ec9d Use CopyOnWriteArrayList for ReactHostImpl lifecycle listeners (#46567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46567

Switch to a simpler data structure which avoids locking and doesn't require copies when iterating. This is more consistent with other listener arrays in React Native.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62872893

fbshipit-source-id: b0ce6a904d25057f0217f7de7ec2928c8b2d1f34
2024-09-23 04:32:13 -07:00
Pieter De Baets e27259b3db Do not hold raw RuntimeScheduler pointer in BufferedRuntimeExecutor (#46542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46542

If `bufferedRuntimeExecutor_` is referenced beyond the lifetime of the ReactInstance, it may point to invalid memory. RuntimeScheduler already holds weak references to the actual runtime, so it's safe to retain that instead.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D62748768

fbshipit-source-id: 1cd8fcb050dd561e7d54a11d91c89eda3a5ddaaa
2024-09-23 04:32:13 -07:00
Jakub Piasecki bd323929dc Add a workaround for text being measured incorrectly when ending with an empty line (#42331)
Summary:
It looks like `StaticLayout` used for measuring multiline text on the new architecture returns wrong metrics for the last line if it's empty, however, if it contains anything, then the returned values are correct.

Similar approach with measuring `I` was already used in `ReactEditText`: https://github.com/facebook/react-native/blob/258d8e51b451b221e557dad4647cbd210fe37392/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java#L1203-L1213

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [FIXED] - Fixed text being measured incorrectly when ending with an empty line on the new architecture

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

Test Plan:
<details>
<summary>I tested the change on this simple code on React Native 0.73.2 (with the new arch enabled)</summary>

```jsx
import React from 'react';
import {useState} from 'react';
import {SafeAreaView, TextInput} from 'react-native';

export default function App() {
  const [text, setText] = useState('ABC\nDEF\nGHI\n');

  return (
    <SafeAreaView style={{flex: 1}}>
      <TextInput
        value={text}
        onChangeText={setText}
        style={{borderWidth: 1, margin: 20, padding: 30}}
        multiline
      />
    </SafeAreaView>
  );
}
```

</details>

Before:

https://github.com/facebook/react-native/assets/21055725/0787cc86-70c6-4238-b93a-87984e527a83

After:

https://github.com/facebook/react-native/assets/21055725/2acf619f-5cb4-4869-9576-cb8cc081c15b

Reviewed By: cipolleschi

Differential Revision: D62873674

Pulled By: cortinico

fbshipit-source-id: cc2481b1924a13af7326cfc16c59b9390f0d06d8
2024-09-21 06:34:21 -07:00
Oskar Kwaśniewski 1747f57c67 feat(iOS): add colors to codegen output (#46557)
Summary:
This PR is a quality-of-life improvement, adds colors to codegen output:

![CleanShot 2024-09-18 at 12 18 00@2x](https://github.com/user-attachments/assets/13290a1c-8411-40e4-8abe-8fce4b88b6e7)

Makes it a lot easier to grasp what's going on in the actions taken by codegen.

## Changelog:

[GENERAL] [ADDED] - Add color formatting to codegen output

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

Test Plan:
1. Run codegen
2. Expect colored output

Reviewed By: christophpurrer

Differential Revision: D63031248

Pulled By: cipolleschi

fbshipit-source-id: e86bc72f16582562dc9f1e3b55dc69af4c7838f5
2024-09-20 03:33:31 -07:00
Riccardo Cipolleschi 9e2e8c1a27 Prepare scripts to simplify E2E testing (#46545)
Summary:
Add tests to simplify running Maestro e2e tests locally.
Thanks to these scripts, users can just, from the root folder:

```sh
yarn install
cd packages/rn-tester

# build android for testing
yarn e2e-build- android

# run tests on android
yarn e2e-test-android

# build iOS for testing
yarn e2e-build-ios

# run tests on iOS
yarn e2e-test-ios
```

This is a preliminary step for a future umbrella issue. We can also use these command in CI to simplify the scripts.

## Changelog:
[Internal] - add script to simplify e2e testing

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

Test Plan: Tested the command locally

Reviewed By: cortinico

Differential Revision: D62879105

Pulled By: cipolleschi

fbshipit-source-id: 6f68aebb3f8112302a458ca9e118180d3dbaf180
2024-09-20 03:29:43 -07:00
David Vacca 151008f8c2 Back out "Convert ReactViewManager, ReactClippingViewManager to Kotlin" (#46581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46581

Original commit changeset: 09a81c91a1c9

Original Phabricator Diff: D62776270

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D63076764

fbshipit-source-id: 9cbd8ab86be356a7c35e44c86a95b80342c3da76
2024-09-19 22:56:17 -07:00
David Vacca d721d83149 Back out "Convert ReactViewGroup to Kotlin" (#46580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46580

Original commit changeset: 780350e7e449

Original Phabricator Diff: D62642663

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D63076763

fbshipit-source-id: 01d3949c13129b71d5c96f19682bb24c51ff2552
2024-09-19 22:56:17 -07:00
Jorge Cabiedes Acosta 1288e38423 Implement outline properties on iOS (#46444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46444

This diff adds:

`outline-width`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width
`outline-color`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color
`outline-style`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style
`outline-offset`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset

Using `BackgroundStyleApplicator`

Changelog: [iOS] [Added] - Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset`

Reviewed By: joevilches

Differential Revision: D62273339

fbshipit-source-id: 0ed775218e7d1dfb13bbf1760bc6ec331a388b64
2024-09-19 16:41:46 -07:00
Thomas Nardone 66c3074c65 Convert ReactViewGroup to Kotlin (#46577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46577

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D62642663

fbshipit-source-id: 780350e7e449ffd2d6378cbed6f4381e34636a24
2024-09-19 13:20:15 -07:00
Thomas Nardone d80e1e9be3 Convert ReactViewManager, ReactClippingViewManager to Kotlin (#46578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46578

Pre-req for converting ReactViewGroup without affecting API visibility.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D62776270

fbshipit-source-id: 09a81c91a1c95685b36f4417cb1b1a2852dd7194
2024-09-19 13:20:15 -07:00
Pieter De Baets 5f49e279f0 Fix AnimatedEvent leaking topScrollEnded handler (#46576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46576

We automatically add this handler in `addAnimatedEventToView` but we do not remove it in `removeAnimatedEventFromView`, which causes us to leak it. This is especially bad as we attach and detach the event handler multiple times while rendering.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D63029768

fbshipit-source-id: 9ef2bc6887fecb7ab448af4dee94463f8be27768
2024-09-19 11:56:28 -07:00
zhongwuzw 052def0da0 Fabric: Add missing source properties of Image (#46460)
Summary:
Fabric: Add missing source properties of Image

## Changelog:

[IOS] [FIXED] - Fabric: Add missing source properties of Image

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

Test Plan: Missing props should worked.

Reviewed By: javache

Differential Revision: D62847594

Pulled By: cipolleschi

fbshipit-source-id: 83d7c836a2e96c9053aa94e0e9b8e706103d026f
2024-09-19 11:00:25 -07:00
Alex Hunt a026d6d250 Update relocated JS logs message (#46558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46558

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D62937482

fbshipit-source-id: 323d4220443e2660ff2f0cb8c019477ee245a07d
2024-09-19 10:15:05 -07:00
Pieter De Baets d8aa664adf Clear out CreateReactInstanceTaskRef early when destroying (#46544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46544

Experiments with `completeReactInstanceCreationOnBgThreadOnAndroid` have shown a native crash in this code path, but it also existed previously.

I believe this is due to the ordering of ReactInstance teardown: we first destroy the ReactInstance, and only then destroy the reference to it in mCreateReactInstanceTaskRef. When using the immediate executor and completeReactInstanceCreationOnBgThreadOnAndroid, we read the react instance from the task, which may no longer be valid at this point. Resetting the task at the earliest point should mitigate the issue.

Changelog: [Internal]

Reviewed By: markv

Differential Revision: D62872625

fbshipit-source-id: 5aaccd53433ca806d2b93f7e3dd2bcf9bf8c09a8
2024-09-19 07:52:59 -07:00
Riccardo Cipolleschi 6d51c5cd8e Setup homebrew in ubuntu machine (#46575)
Summary:
This change setups homebrew on Ubuntu. Due to https://github.com/actions/runner-images/issues/6283, brew is not in the PATH anymore.

## Changelog:
[Internal] - Setup homebrew in ubuntu machine

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

Test Plan: Can't test before it lands. :(

Reviewed By: cortinico

Differential Revision: D63027253

Pulled By: cipolleschi

fbshipit-source-id: e0b3a3c1a2a7b0659f0c1f57c45d8d42a74734a1
2024-09-19 07:19:00 -07:00
Riccardo Cipolleschi 0d2248557b Configure E2E test to run on comments (#46572)
Summary:
This change configure the Test All job to enable the E2E tests with an input parameter.
Then it adds another workflow that is triggered on PRs when someone posts the "/test-e2e" comment.

## Changelog:
[Internal] - Let users run E2E tests on a specific PR comment

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

Test Plan: This kind of things can only be tested once the PR lands, as workflows that are triggered by comments runs only from the main branch.

Reviewed By: cortinico

Differential Revision: D63021786

Pulled By: cipolleschi

fbshipit-source-id: 95b271f6de658ca208c773429fedef2a36417752
2024-09-19 05:34:53 -07:00
Riccardo Cipolleschi c6f32828b9 Fix crash when navigating away from screens (#46559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46559

There is an edge case when we navigate away from a screen that contains a scroll view where one of the UISCrollViewDelegates does not implement the scrollViewDidEndDecelerating method.

This happens because the Macro used assumes that the event that we are forwarding is the actual method from where the macro is called. Which is not true when it comes to `didMoveToWindow`.

This change fixes that by explicitly expanding the macro in this scenario and passing the right selector.

## Changelog:
[iOS][Fixed] - Fixed a crash when navigating away from a screen that contains a scrollView

## Facebook
This should fix T201780472

Reviewed By: philIip

Differential Revision: D62935876

fbshipit-source-id: e29aadf201c8066b5d3b7b0ada21fa8d763e9af0
2024-09-19 03:24:41 -07:00
Nicola Corti 2524c8eb72 Fix init behavior for 0.76 (#46560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46560

The `init` command should still keep on working till 2024-12-31

This handles this scenario as currently `npx react-native@next init` is broken.

Changelog:
[Internal] [Changed] - Clarify init behavior for 0.76

Reviewed By: huntie, cipolleschi

Differential Revision: D62958747

fbshipit-source-id: ce3d974df55162720d59a7ece7fcb816e257185d
2024-09-19 03:08:10 -07:00
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
Oskar Kwaśniewski e98c221e5e fix: remove @available for RCTKeyWindow check (#46510)
Summary:
This PR removes `available` for `RCTKeyWindow` after minimum version bump to iOS 15 this check is not needed anymore.

## Changelog:

[IOS] [REMOVED] - remove available for RCTKeyWindow check

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

Test Plan: CI Green

Reviewed By: rshest

Differential Revision: D62752434

Pulled By: javache

fbshipit-source-id: 7b7745d4f27128cdb66053f7fa1cc234435eac31
2024-09-16 09:38:30 -07:00
shubhamguptadream11 4e1d7015c1 feat: add overlayColor prop to modal component for customisable background overlay (#46322)
Summary:
Solves these issues:
- https://github.com/facebook/react-native/issues/18398
- https://github.com/facebook/react-native/issues/12478

Solves this proposal: https://github.com/react-native-community/discussions-and-proposals/discussions/774

## Changelog:

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

Pick one each for the category and type tags:

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

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

[GENERAL] [ADDED] - added overlayColor prop to modal component for customisable background overlay

**Motivation:**
Currently, the React Native Modal component only allows the background to be set to either `transparent` or `white`. This limits the ability to dim the background or apply custom colors, which is essential for creating a more polished and user-friendly interface.

**Change Log:**

Modal Component Enhancements:

- Introduced a new optional prop `overlayColor` to the Modal component.
- Updated the background color logic to prioritize `overlayColor` when transparent is `false`.
- Ensured backward compatibility by defaulting to `white` when `overlayColor` is not provided.

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

Test Plan:
- Test the changes on both iOS and Android devices/emulators to ensure consistent behavior.
- Added example in **rn-tester** app

**Sample screenshot with custom overlayColor passed as 'red'.**

![simulator_screenshot_4F112217-7AD5-4030-8A18-6260AD32988A](https://github.com/user-attachments/assets/52f16ef2-874b-487c-908b-1aa2a1b8fafb)

Reviewed By: cipolleschi

Differential Revision: D62201559

Pulled By: alanleedev

fbshipit-source-id: e990d7f18f5edf61f0107026ea899c5f22d47bfd
2024-09-16 09:29:00 -07:00
Rubén Norte b4c41ec768 Clean up "fixIncorrectScrollViewStateUpdateOnAndroid" feature flag (#46506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46506

Changelog: [Android][Fixed] Fixed incorrect scroll event/position for scroll views when doing a smooth scroll animation.

We tested this in production and the fix is safe to land.

Reviewed By: rshest

Differential Revision: D62738925

fbshipit-source-id: e1198dac76cf850dfa76a5cee1ef205d5b367d19
2024-09-16 09:22:41 -07:00
Samuel Susla 8da5924b57 add std::move when adding task to taskQueue (#46511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46511

changelog: [internal]

task is not used after this line of code. Let's avoid copy shared_ptr's copy constructor.

Reviewed By: rubennorte

Differential Revision: D62751612

fbshipit-source-id: 92b0da44972b200870ef66f3a8482fbde55052ac
2024-09-16 09:16:56 -07:00
Saad Najmi 8ac80e39ea Revert "feat: build codegen on postinstall (#46227)" (#46420)
Summary:
This reverts commit 0cb97f0261.

Revert this commit that adds a `post install` script for a couple of reasons:

1. (EDIT: This turns out to be unrelated) The `postinstall` script causes `yarn install` to fail on React Native macOS, where we use Yarn 4. I'm not entirely sure why, but I probably won't debug it for the rest of the reasons.
2. `postinstall` scripts (at least inside Microsoft) are viewed as a security risk. Any package in your dependency tree can get compromised, add the phase, and run arbitrary code. This has happened in the past with React Native past if I recall correctly. As such, we disable `postinstall` scripts in many of our repos (including `rnx-kit` and `react-native-test-app`).
3. The issue this is trying to solve is to help newcomers avoid a stale cache when they switch branches in the React Native monorepo and only run `yarn install`. I think it would be sufficient to add some documentation somewhere that it is expected one runs `yarn && yarn build` to use this repo locally? That's a fairly common practice in monorepos, at least ones inside Microsoft.

## Changelog:

[INTERNAL] [SECURITY] - Remove post install script phase in the React Native monorepo

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

Test Plan: CI should pass

Reviewed By: christophpurrer, robhogan, cortinico, rshest

Differential Revision: D62755022

Pulled By: huntie

fbshipit-source-id: bf94ed33e3e451ea337ef7a6984f7ba964d0b212
2024-09-16 09:14:54 -07:00
Alex Hunt 8f1c227721 Add missing babel-jest dependency to react-native package (#46462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46462

While adding D62583337, I noticed that `react-native` doesn't specify `babel-jest` as a dependency, despite referencing it in the included `jest-preset.js` — instead this would need to be installed by the template/project.

If we want to change this in future, we should consider a separate `react-native/jest-preset` package. However, I strongly believe this is the right location for this dependency: installing `react-native` = all parts of it work.

(Note that in the React Native monorepo, we are using `dependencies` for both dev and runtime deps in packages.)

Changelog: [Internal]

allow-executable-binary

## allow-executable-binary: Bypassed as this is a managed JavaScript dependency that is pre-existing in other parts of the codebase

Reviewed By: robhogan

Differential Revision: D62583665

fbshipit-source-id: 8bbcc8736e2740e45793d7b7e225ccfd1ca7f898
2024-09-16 08:25:12 -07:00
Alex Hunt 38a490574c Switch to Hermes parser in Jest preset (#46465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46465

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

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: robhogan

Differential Revision: D62583337

fbshipit-source-id: 64813d84c2a6395be8ef4f138398834ddae6e54b
2024-09-16 08:25:12 -07:00
Riccardo Cipolleschi 74d9a4c38c Add changelog for 0.76.0-rc.0 (#46419)
Summary:
This PR adds the Changelg for 0.76.0-rc.0

## Changelog:
[Internal] - Add changelog for 0.76.0-rc.0

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D62443133

Pulled By: cipolleschi

fbshipit-source-id: 814d1de8b90de819c60e3962430132544539bdd7
2024-09-16 07:58:00 -07:00
Pascoal Júnior 14e0d0dffb Add support for new iOS text content type cellular EID and cellular IMEI (#46378)
Summary:
Support for new iOS text content type to autofill cellular EID or cellular IMEI:
- https://developer.apple.com/documentation/uikit/uitextcontenttypecellulareid?language=objc
- https://developer.apple.com/documentation/uikit/uitextcontenttypecellularimei?language=objc

## Changelog:

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

Pick one each for the category and type tags:

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

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [ADDED] - new text content type cellular EID and cellular IMEI

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

Test Plan:
JavaScript Tests - yarn test [PASSED]
- No errors related with the changes

Flow - yarn flow && yarn lint [PASSED]
- No errors related with the changes

iOS Tests - ./scripts/objc-test.sh test [PASSED]
- No errors related with the changes

Build RNTester [PASSED]
- No errors related with the changes
- Proof:
<img width="838" alt="Screenshot 2024-09-07 at 12 06 48" src="https://github.com/user-attachments/assets/836a71f2-8adb-428f-b98d-8b84f71e93d6">
<img width="806" alt="Screenshot 2024-09-07 at 12 07 29" src="https://github.com/user-attachments/assets/7b33b919-3b29-4846-b6a2-3427dbbc2869">
<img width="1221" alt="Screenshot 2024-09-07 at 12 13 02" src="https://github.com/user-attachments/assets/58b369e9-5281-4a6b-9663-1cbd77439510">

![Simulator Screenshot - iPhone 15 Pro - 2024-09-07 at 12 06 36](https://github.com/user-attachments/assets/9411c9d9-0b93-4f47-b21c-cbd95810f4c7)
Note: Since the test was done using an iOS simulator the autofill suggestion won't appear for the cellularEID or cellularIMEI

Reviewed By: cortinico

Differential Revision: D62386126

Pulled By: cipolleschi

fbshipit-source-id: 50da572650b796d0426a15f0c06fd0c52a8247f5
2024-09-16 07:27:01 -07:00
Samuel Susla 1ac3b890d8 add support for multiple calls to Linking.getInitialURL (#46502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46502

changelog: [internal]

At the moment, Linking module has undocumented restriction that if you call it twice when Android Activity is not available, it will return with an error.

This is unnecessary and can be handled more sensibly.

Reviewed By: javache, yungsters

Differential Revision: D62708123

fbshipit-source-id: 79a6beb70e834e631f7bedaf6a64076b050a7daa
2024-09-16 06:45:53 -07:00
Samuel Susla b63ec30614 fix race condition in IntentModule.mInitialURLListener (#46499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46499

changelog: [internal]

IntentModule.mInitialURLListener is accessed and mutated on three different threads and is missing synchronisation.

1. In [waitForActivityAndGetInitialURL](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L83) it is accessed and mutated from thread mqt_v_native.
2.  In [LifecycleEventListener](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L97) it is mutated from the main thread.

3. In [invalidate](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java#L44) it is read and mutated on a another thread.

Reviewed By: javache

Differential Revision: D62698183

fbshipit-source-id: b437928c4d5d9b9d20bcad601805b2f7f402b33c
2024-09-16 06:45:53 -07:00
Riccardo Cipolleschi 20b141508b Add TS types for Codegen (#46484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46484

We recently realized that we don't have TS types for Codegen.
These are needed to let our users use these types when writing Specs in TS

## Changelog
[General][Added] - Add CodegenTypes for TS

Reviewed By: christophpurrer

Differential Revision: D62644516

fbshipit-source-id: 92bb7e8998d31806f6eb63319fb6d406fcd65ad8
2024-09-16 06:28:33 -07:00
Oskar Kwaśniewski 52718b530e feat: stub RCTStatusBarManager for non iOS Apple platforms (#45896)
Summary:
Following one of my previous PRs: https://github.com/facebook/react-native/pull/45176 I'm adding same conditionals to another module.

StatusBar API is supported on this platforms:

| Platform  | Support |
| ------------- | ------------- |
| macOS |    |
| tvOS |    |
| visionOS |    |
| iOS/iPadOS |    |

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [ADDED] - Conditionals for iOS only code in RCTStatusBarManager.mm

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

Test Plan: CI Green / Make sure everything works as before

Reviewed By: cortinico

Differential Revision: D62579943

Pulled By: cipolleschi

fbshipit-source-id: 0c198c7732d253993638d825ca83be076bb09b90
2024-09-16 05:56:40 -07:00
Vitali Zaidman 8fba154b66 Fix source mapping for codegenNativeCommands (#46452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46452

`babel-plugin-codegen` transforms `codegenNativeComponent`s by expending it with a whole set of many commands (~40 lines) that don't have a good equivalent on the source file.

Currently these lines are pointing to random parts of the due to a bug that causes the source maps to be incorrect and confusing.

Instead, I point all these generated lines of code to the default export as the only line that can represent them.

This way, if an error is thrown from that generated code it would point to that export.

If the users are confused by how it works, there's a comment in the function that is used in the default export in these that explains it:
```
// If this function runs then that means the view configs were not
// generated at build time using `GenerateViewConfigJs.js`. Thus
// we need to `requireNativeComponent` to get the view configs from view managers.
// `requireNativeComponent` is not available in Bridgeless mode.
// e.g. This function runs at runtime if `codegenNativeComponent` was not called
// from a file suffixed with NativeComponent.js.
function codegenNativeComponent<Props>(
  componentName: string,
  options?: Options,
): NativeComponentType<Props> {
```

The transformation is from all the types and exports after the imports:
[`MyNativeViewNativeComponent` for example](https://github.com/facebook/react-native/blob/773a02ad5d3cc38e0f5837b42ba9a5e05a206bf9/packages/rn-tester/NativeComponentExample/js/MyNativeViewNativeComponent.js#L4)
Which is roughly (ignoring all typing):
```
// types and exports
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
  supportedCommands: [
    'callNativeMethodToChangeBackgroundColor',
    'callNativeMethodToAddOverlays',
    'callNativeMethodToRemoveOverlays',
    'fireLagacyStyleEvent',
  ],
});

export default (codegenNativeComponent<NativeProps>(
  'RNTMyNativeView',
): MyNativeViewType);

```
to roughly:
```
  var React = require('react');
  var nativeComponentName = 'RNTMyNativeView';
  var __INTERNAL_VIEW_CONFIG = {
    uiViewClassName: 'RNTMyNativeView',
    bubblingEventTypes: {
      topIntArrayChanged: { /* */ },
      topAlternativeLegacyName: { /* */ },
    },
    validAttributes: {
      opacity: true,
      values: true,
      ...require('ViewConfigIgnore').ConditionallyIgnoredEventHandlers({
        onIntArrayChanged: true,
        onLegacyStyleEvent: true
      })
    }
  };
  var _default = require('NativeComponentRegistry').get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
  var Commands = {
    callNativeMethodToChangeBackgroundColor(ref, color) {
      require('RendererProxy').dispatchCommand(ref, "callNativeMethodToChangeBackgroundColor", [color]);
    },
    callNativeMethodToAddOverlays(ref, overlayColors) {
     require('RendererProxy').dispatchCommand(ref, "callNativeMethodToAddOverlays", [overlayColors]);
    },
    callNativeMethodToRemoveOverlays(ref) {
      require('RendererProxy').dispatchCommand(ref, "callNativeMethodToRemoveOverlays", []);
    },
    fireLagacyStyleEvent(ref) {
     require('RendererProxy').dispatchCommand(ref, "fireLagacyStyleEvent", []);
    }
  };
  exports.default = _default;
  exports.__INTERNAL_VIEW_CONFIG = __INTERNAL_VIEW_CONFIG;
  exports.Commands = Commands;
```

Changelog: [Fix] Fixed source maps in Native Components JS files that use codegenNativeComponent

Reviewed By: robhogan, huntie

Differential Revision: D62443699

fbshipit-source-id: 522b4382736a8fed93a1bc687a78d6885fe7c9d5
2024-09-16 05:22:38 -07:00
Rodolfo Gomez Sirimarco b4532adad4 Fix Headless Crash Tried to finish non-existent task with id (#46497)
Summary:
Sometimes a headless task tries to finish, but it doesn’t exist, which causes an exception.
No one knows how to reliably reproduce it, as it could be a race condition. However, if you attempt to remove a task that has already been removed, it shouldn’t cause an issue since you're trying to remove something that’s already gone (which is exactly what you want).

Fixes:
 - https://github.com/facebook/react-native/issues/46496
 - https://github.com/facebook/react-native/issues/33883
 - https://github.com/facebook/react-native/issues/27597
 - https://github.com/transistorsoft/react-native-background-fetch/issues/202
 - https://github.com/transistorsoft/react-native-background-fetch/issues/369
 - https://github.com/transistorsoft/react-native-background-geolocation/issues/2096
 - https://github.com/jpush/jpush-react-native/issues/78

## Stacktrace:
```
Fatal Exception: java.lang.AssertionError: Tried to finish non-existent task with id 28.
  at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:88)
  at com.facebook.react.jstasks.HeadlessJsTaskContext.finishTask(HeadlessJsTaskContext.java:179)
  at com.facebook.react.jstasks.HeadlessJsTaskContext$3.run(HeadlessJsTaskContext.java:217)
  at android.os.Handler.handleCallback(Handler.java:958)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loopOnce(Looper.java:257)
  at android.os.Looper.loop(Looper.java:368)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:233)
  at java.lang.Thread.run(Thread.java:1012)
```

## Screenshot

https://github.com/user-attachments/assets/101f0f53-95c9-40ec-a59d-22d6d474b457

## Changelog:

[ANDROID] [FIXED] - Fix Headless Crash `Tried to finish non-existent task with id`

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

Test Plan:
I created an example where I attempt to remove a task that doesn’t exist.

Example: https://github.com/RodolfoGS/react-native-fix-non-existent-task

### How to reproduce using the example above:
1. `git clone git@github.com:RodolfoGS/react-native-fix-non-existent-task.git`
2. `cd react-native-fix-non-existent-task`
3. `npm install`
4. `npm run android`
5. 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. Add call to finishTask to reproduce the crash (https://github.com/RodolfoGS/react-native-fix-non-existent-task/commit/6fe3c1388a58b9ffdcca5f9c6f00a4f2fea725ea)
4. `npm run android`
5. Notice the crash

Reviewed By: javache

Differential Revision: D62738059

Pulled By: rshest

fbshipit-source-id: 3232dc76ba8a069279c2b741d62372537a3f9140
2024-09-16 04:29:47 -07:00
David Vacca 6dbbbe33fd Delete pre-allocated views that were never mounted on the screen (#46473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46473

This diff extends the renderer of react native to ensure that pre-allocated views that were never mounted on the screen are deleted as soon as the shadow node is deleted from JS

This feature is controlled by the ReactNativeFeatureFlag: enableDeletionOfUnmountedViews

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D62559190

fbshipit-source-id: 1af6785fc57256d12750db64489c9ecc6cf98c9d
2024-09-16 04:16:36 -07:00
Sam Zhou 68a92aa312 Replace React.Ref with React.RefSetter in react-native (#46488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46488

React.Ref includes string | number to support legacy string ref, which will be killed in React 19. Therefore, the type is deprecated in Flow. This diff changes the type to use React.RefSetter instead.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62649800

fbshipit-source-id: 81bcfbb052e2039b23829dac8de242bfb0fdca3a
2024-09-15 20:22:44 -07:00
Tim Yung 7bd4a54968 Animated: Restore AnimatedNode.prototype.toJSON (#46498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46498

Looks like this is still necessary because we still run into this error when using the Components tab when using React DevTools:

> TypeError: cyclical structure in JSON object

This effectively reverts https://github.com/facebook/react-native/pull/46382.

Changelog:
[General][Changed] - AnimatedNode (and its subclasses) once again implement `toJSON()`.

Reviewed By: javache

Differential Revision: D62690380

fbshipit-source-id: d5b7c1d156b49838abefe48a7d7b61471cc3488a
2024-09-14 22:21:27 -07:00
Kevin Gozali 7d621f5eb7 Android: check SafeAreaView component existence before exporting (#46500)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46500

We're in the process of adding the required native component to all apps we maintain.
Until that is fully completed, fall back to using View if the native component
doesn't exist.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D62701331

fbshipit-source-id: d26c946af3a68231d0714e89d5e41be311399036
2024-09-14 20:20:34 -07:00
Tim Yung afb40e9f2a Animated: Alias onUpdateRef Type Argument (#46469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46469

This causes VS Code to syntax highlight incorrectly, so let's use a type alias to workaround that limitation.

Changelog:
[Internal]

Reviewed By: tyao1

Differential Revision: D62595120

fbshipit-source-id: 97fc3caded51190a7840de91025eeb71c6290be8
2024-09-13 20:10:18 -07:00
Melissa Liu 6bcaa09749 evenly distribute adjustment between top and bottom
Summary:
Before we were dividing proportionally and were noticing some truncation at the bottom. It seems that the truncation was disproportionately because of the way the metrics are calculated. Through guess and check, dividing equally between top and bottom seems to yield better results... 🤡

Changelog: [internal]

Reviewed By: NickGerleman, xunrongl

Differential Revision: D62665295

fbshipit-source-id: b1589c75251d68eaf75e32598ee84fbac457ae4a
2024-09-13 17:50:10 -07:00
Jorge Cabiedes Acosta 17faac4170 Implement outline properties on Android (#46284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46284

This diff adds:

`outline-width`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width
`outline-color`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color
`outline-style`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style
`outline-offset`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset

Using `BackgroundStyleApplicator`

Changelog: [Android] [Added] - Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset`

Reviewed By: NickGerleman

Differential Revision: D61293868

fbshipit-source-id: d8787bbf1560cf46b92ad039afde9c1e7ab669da
2024-09-13 17:26:37 -07:00
Rubén Norte 40aaeb7181 Improve FlatList estimates for items not yet laid out (#46487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46487

Changelog: [General][Fixed] Fixed accuracy of FlatList estimations to determine what elements are visible in the rendering window.

This fixes a bug in FlatList where it thinks that some elements are visible in the rendering window, when they're not. Specifically, if a cell hasn't been laid out yet, it ignores all the information it already has on the ones that had, and estimates its position and offset based on the estimated size of the cells. In this case, if the first element has a larger offset because the list has a header, that offset is ignored in this case.

One observed result of this is that in a list where there's a header and a single cell that occupy the whole rendering window, FlatList thinks it needs to pre-render an additional element because the header is ignored.

Reviewed By: NickGerleman

Differential Revision: D62649060

fbshipit-source-id: 437bae79916707ca1d08784190508a9f7e36688e
2024-09-13 16:18:33 -07:00
David Vacca 70188fe222 Introduce ReactNativeFeatureFlag enableDeletionOfUnmountedViews (#46467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46467

This diff introduces a new feature flag called ReactNativeFeatureFlag.enableDeletionOfUnmountedViews, which will ensure that pre-allocated views that were never mounted on the screen are deleted as soon as the shadow node is deleted from JS

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D62559188

fbshipit-source-id: 61f19a6dd38536de9f70fecc2937793681036f68
2024-09-13 13:46:12 -07:00
Jorge Cabiedes Acosta 6f84b63d64 Rename DropShadowPrimitive to DropShadowValue (#46476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46476

Keep the type naming consistent with examples like `DimensionValue`, `ColorValue`, etc.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62614579

fbshipit-source-id: 824ea9af17487a4459e8f39d9374e2e00452db43
2024-09-13 12:35:57 -07:00
Jorge Cabiedes Acosta eaff327e0d Rename BoxShadowPrimitive to BoxShadowValue (#46485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46485

Keep the type naming consistent with examples like `DimensionValue`, `ColorValue`, etc.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62614444

fbshipit-source-id: 3ff66d3f52623b6fb7bd8d31d2910aa255ae8a31
2024-09-13 12:35:57 -07:00
Nick Gerleman 2d6c59e1d4 Unhide new arch layout props (#46478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46478

These are all supported in the new arch (default as of 0.76), across all platforms. but were previously hidden from types, and undocumented.

I will make a pick request for this change, and we should then add these to documentation.

Changelog:
[General][Added] - Unhide new arch layout props

Reviewed By: cortinico

Differential Revision: D62616897

fbshipit-source-id: f6c2e71785284e667824a76918ccf2724adc4e98
2024-09-13 12:04:52 -07:00
Nicola Corti f3a969f38d Do not print Bridgeless Mode is enabled on console anymore. (#46486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46486

We probably don't need this extra log anymore as this information is already avaialbe from the start application log.

Changelog:
[General] [Changed] - Do not print Bridgeless Mode is enabled on console anymore

Reviewed By: fkgozali

Differential Revision: D62639866

fbshipit-source-id: 720bb1446a1e1be71bf27830fe4156ae64a1586f
2024-09-13 11:50:32 -07:00
Nicola Corti 4d814f20af Back out "Remove some Tasks overhead" (#46483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46483

Original commit changeset: 631d741bd2ec

This is breaking the RedBox on React Native 0.76 on Android when not connected to Metro.

Original Phabricator Diff: D62213722

Changelog:
[Internal] [Changed] - Back out "[react-native] Remove some Tasks overhead"

Reviewed By: cipolleschi

Differential Revision: D62644614

fbshipit-source-id: a092614da78bef65546c2539a3ebc9bff5e807b2
2024-09-13 11:35:24 -07:00
Nicola Corti d7884a6bb8 RNGP - Sanitize the output of the config command (#46482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46482

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

I'm sanitizing the output of the `config` command + I've added some more logging in case of failure.

Changelog:
[Android] [Fixed] - RNGP - Sanitize the output of the config command

Reviewed By: cipolleschi

Differential Revision: D62641979

fbshipit-source-id: c13d27a42beeb7a973c1802e7204631d49d3d09b
2024-09-13 10:42:20 -07:00
Oskar Kwaśniewski 3cbaddbc16 fix(iOS): fallback to old path when dynamic resolve fails (#46432)
Summary:
This PR is a follow-up after https://github.com/facebook/react-native/issues/46181 this change makes sure that if the `require.resolve` fails we still fall back to the old behavior.

The `require.resolve` was failing for local builds of OOT platforms (because in OOT platforms mono repo `react-native` is renamed to `react-native-platform-name`)

## Changelog:

[IOS] [FIXED] - Fallback to old resolve mechanism when node require fails to resolve react native path

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D62577183

Pulled By: cipolleschi

fbshipit-source-id: d62d9c2a5eee3546a81d2aad52b7f73763315b18
2024-09-13 09:44:19 -07:00
Riccardo Cipolleschi 11a2ab1cc5 Fix some basic warning while building (#46463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46463

We had some basic warnings emitted by React Native components due to unused parameters or missing documentations.

This change fixes some of those

## Changelog:
[Internal] - Fix some build warnings

Reviewed By: NickGerleman

Differential Revision: D62583790

fbshipit-source-id: 329acc67ce64c00757a8568460ee68b85a62b6e9
2024-09-13 08:19:55 -07:00
Riccardo Cipolleschi 62d4768984 Inhibit warning in 3p libraries (#46464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46464

React Native uses some 3P libraries that are emitting some warnings for which we can't do anything about.

This change suppress those warnings.

## Changelog:
[Internal] - Suppress 3p warnings

Reviewed By: cortinico

Differential Revision: D62582960

fbshipit-source-id: 79e8c28725177f5f47359da86f865e770dcf7c7b
2024-09-13 08:19:55 -07:00
Riccardo Cipolleschi f529fe4876 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

## Changelog
[Internal] - Remove dSYM path from Info.plist

Reviewed By: cortinico

Differential Revision: D62603425

fbshipit-source-id: 038ec3d6b056a3d6f5585c8125d0430f56f11bb9
2024-09-13 08:16:19 -07:00
Riccardo Cipolleschi de39a204c3 Fix SVC Validator for Box Shadow and filter (#46454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46454

The SVC Validator have no idea on how to process a simple NSArray *.

With this change, we are creating two named types for the NSArray:
* BoxShadowArray
* FilterArray
To create unique types that we can reference in JS.

We are then enhancing the `getProcessor` function to return the proper processor when those types are found in the NativeViewConfig

## Changelog:
[iOS][Fixed] - Fixed warnings when validating SVC

## Facebook:
This change is OTA safe: even when we ship the JS before the native code, the new cases in the switch will be never hit, similarly to the situation we have right now.

As soon as the native code is shipped, the new cases will start get hit and the wrning will disappear

Reviewed By: NickGerleman

Differential Revision: D62574612

fbshipit-source-id: d173bf5534ee5e436f23a4bc6e2fb25e72a4b06d
2024-09-13 08:10:10 -07:00
Riccardo Cipolleschi fad4a0783b Fix Basic SVC for RNTester iOS (#46439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46439

The SVC for some components on iOS got out of sync.
This was creating warnings in the React Native DevTools and it was affecting the release of 0.76.

With this change, I updated the manually written SVC so that we don't have warnings anymore.

We still have to fix the `boxShadow` and `filter`. This will happen in a later change.

## Changelog
[iOS][Fixed] - Solved SVC warnings for RNTester

Reviewed By: NickGerleman

Differential Revision: D62501704

fbshipit-source-id: 3c02f7615c3511a97eba73a2ddaa713d2e4e30f0
2024-09-13 08:10:10 -07:00
Robert Pasiński f3fee67c54 fix: AppRegistry not callable from Native in bridgeless (#46480)
Summary:
AppRegistry was not treated as a Callable Module in bridgeless mode. This is breaking headless tasks on Android.

Fixes:

 - https://github.com/facebook/react-native/issues/46050

## Changelog:

[ANDROID] [FIXED] - Made AppRegistry callable from Native code in Bridgeless (fixes headless tasks)

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

Test Plan: Used repro from linked issue

Reviewed By: javache

Differential Revision: D62637486

Pulled By: cortinico

fbshipit-source-id: 756527003ac6d712e76c02c188e280d15c010068
2024-09-13 07:58:19 -07:00
shubhamguptadream11 b98b9f1fa7 fix(iOS): fire onMomentumScrollEnd when UIScrollView is removed from window (#46277)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/46276

## 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] [ADDED] - fire onMomentumScrollEnd when UIScrollView is removed from window

**Why the issue is happening?**
The `onMomentumScrollEnd` event is typically triggered by the `UIScrollView` delegate methods `scrollViewDidEndDecelerating` and `scrollViewDidEndScrollingAnimation`. However, if the scroll view is removed from the window while navigating away, these delegate methods are not called, resulting in the event not being dispatched.

This behaviour was particularly problematic in scenarios where a scroll view is in motion, and the user navigates away from the screen before the scrolling completes. In such cases, the `onMomentumScrollEnd` event would never fire, which further make scroll area un touchable or un responsive.

**What we changed?**
In the didMoveToWindow method, we added logic to handle the scenario where the UIScrollView is being removed from the window (i.e., when the component is unmounted or the user navigates away). Here’s a breakdown of the changes:

- **Added a Check for Scroll State:** We check if the UIScrollView was decelerating or had stopped tracking (_scrollView.isDecelerating || _scrollView.isTracking == NO).

- **Manually Triggered onMomentumScrollEnd:** If the scroll view was in motion and is being removed from the window, we manually trigger the `onMomentumScrollEnd` event to ensure that the final scroll state is captured.

**_I had fixed this issue on both Old and New arch._**

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

Test Plan:
Attaching a video with working solution:

https://github.com/user-attachments/assets/1a1f3765-3f11-46c3-af18-330c88478db8

Reviewed By: andrewdacenko

Differential Revision: D62374798

Pulled By: cipolleschi

fbshipit-source-id: 014be8d313bab0257459dc4e53f5b0386a39d5e0
2024-09-13 06:33:30 -07:00
Philip Su f8287e25e1 feat(scripts): Support multiple bundles in react-native-xcode.sh (#46339)
Summary:
This enables projects to have multiple bundles built during the Xcode bundling phase (e.g. for projects where you might have a PhoneScene and a CarPlayScene each with their own RootView and bundle, if you're using [react-native-carplay](https://github.com/birkir/react-native-carplay)).

## Changelog:
[IOS] [ADDED] - User-configurable BUNDLE_NAME when building bundles

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

Test Plan:
Built my project with the following Xcode "Bundle React Native code" build step:
```sh
set -e

export SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map";
SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map"

WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"

/bin/sh -c "BUNDLE_NAME=main $WITH_ENVIRONMENT $REACT_NATIVE_XCODE"
/bin/sh -c "BUNDLE_NAME=carplay $WITH_ENVIRONMENT $REACT_NATIVE_XCODE"
```

Then launched the app with a modified `AppDelegate.swift` which loaded main.jsbundle into one RootView and carplay.bundle into another RootView.

Reviewed By: cortinico

Differential Revision: D62577314

Pulled By: cipolleschi

fbshipit-source-id: 22312ca144146da6c71a8533a1883e720aff1e85
2024-09-13 05:09:51 -07:00
Nicola Corti 2136c19944 Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata. (#46461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46461

This bumps SoLoader to 0.12.1 inside React Native and cleans up the extra
`com.facebook.soloader.enabled` metadata which are not necessary anymore.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata

Reviewed By: cipolleschi

Differential Revision: D62581188

fbshipit-source-id: ff990c0af1f0f51070037fcb4c7c13fbe6bae234
2024-09-13 03:51:58 -07:00
Phillip Pan a777a8937e delete partialBatchDidFlush (#46471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46471

Changelog: [iOS][Breaking] Delete partialBatchDidFlush

this is an extremely old method on RCTBridgeModule similar to batchDidComplete that was special cased for UIManager. however, UIManager ended up deleting its implementation of partialBatchDidFlush. we had this janky logic that would iterate through all of the modules to call this partialBatchDidFlush when we really just wanted to do this for the UIManager. this logic is risky because the _moduleDataByID array is not thread safe.

i feel we can skip the deprecation cycle for this method, because i searched through GH and i did not find any callsites of this: https://github.com/search?q=partialBatchDidFlush&type=code&p=1.

Reviewed By: realsoelynn

Differential Revision: D62600722

fbshipit-source-id: d889bad54170a267e938b588e2fd6f558583a904
2024-09-12 22:57:11 -07:00
Phillip Pan 731bd95c43 do not iterate through moduleData array to handle UIManager batch completion (#46470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46470

Changelog: [iOS][Deprecated] - Deprecating RCTBridgeModule batchDidComplete and adding configuration to disable it

batchDidComplete is used for the UIManager to initiate a layout and mount after a callback has been initiated by the bridge. however, we iterate through the whole module array in order to get this single UIManager, which is unnecessary. this also increases risk of a crash because the module array is shared between threads.

Reviewed By: realsoelynn

Differential Revision: D62600034

fbshipit-source-id: 6c98df7d5ab282015181fb07764121693bcc141e
2024-09-12 22:57:11 -07:00
Tim Yung 1c7fd8baa8 Animated: Switch to useInsertionEffect (#46474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46474

Changes `useAnimatedPropsLifecycle_passiveEffects` (the experimental lifecycle management in `useAnimatedProps`) to `useInsertionEffect` instead of `useEffect`. This has a few benefits:

1. Prevents any Activity detach and attach events from triggering Animated lifecycle work (which adds to effect mounting and unmounting time).
2. Fixes batching of native Animated operations across components. (Since we flush the operation queue in a passive effect, enqueueing operations in a passive effect causes weird interleaving of enqueuing and flushing.)
3. Enables animations to be started in layout effects.

Changelog:
[Internal]

Reviewed By: bvanderhoof

Differential Revision: D62602336

fbshipit-source-id: 3f6412387d87d4ea4135a29893135b4a64638809
2024-09-12 22:05:02 -07:00
Melissa Liu 5e288d0cd4 fix for bottom adjustment (#46475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46475

fm.top is negative, so we want to add in order to decrease the absolute value, but fm.bottom is positive, so we need to subtract instead here

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D62612192

fbshipit-source-id: fc942abcb5a1ddedd6547aca66a188736e4ec029
2024-09-12 19:17:23 -07:00
Eric Rozell bb3ec4d6c3 Add protected constructor to decouple ReactFragment lifecycle events from ReactHost (#46425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46425

It's entirely plausible that one would want to run a ReactFragment that does not tear down the ReactHost when it is destroyed. This adds a protected constructor that can be used to disable host lifecycle events in a ReactFragment. When disabled, the `onDestroy` method of the ReactFragment simply stops the surface attached to it using `ReactDelegate.unloadApp`.

## Changelog

[Android][Added] Flag in ReactFragment to allow unmounting a surface without destroying ReactHost.

Reviewed By: philIip

Differential Revision: D62449779

fbshipit-source-id: a443ed004ced45e0adc95bd43b36d1b80f9f392f
2024-09-12 18:13:51 -07:00
Phillip Pan cf8d09b279 remove RCTRuntimeExecutor (#46466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46466

We should use [BindingsInstaller](https://github.com/facebook/react-native/pull/44486?fbclid=IwZXh0bgNhZW0CMTEAAR0noV5FT4pi2z0saQhFy4q2bVLiu0bLUn0Aq0QPAWnycksVBuizmUYXdnc_aem_bS3_Q_CgUIljILgDtrHUhA) and [RCTCallInvoker](https://github.com/facebook/react-native/pull/44378?fbclid=IwZXh0bgNhZW0CMTEAAR3rjd8_Ak2CsQfs3k4o6k0F9uivwx-22llwl6TiCFl5c0FmcoW8PKaxNgs_aem_R3cJp9eKQsMte_03lfuBdQ) instead.

## Changelog:
[iOS][Breaking] - We deprecated RCTRuntimeExecutor in 0.76, so let's get rid of the code now.

Reviewed By: cipolleschi

Differential Revision: D62469005

fbshipit-source-id: 3ed033b08f52823bd42f8a57d5d6ab40e35d30f1
2024-09-12 14:57:58 -07:00
Eric Rozell 38593c440e Add unloadApp method to ReactDelegate (#46424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46424

It's not isomorphic for `ReactDelegate` to have a `loadApp` method to initialize a surface, but only allow unloading of a surface by calling `onHostDestroy`, which also destroys the ReactHost. This change adds an `unloadApp` method to `ReactDelegate` so it can be used in, e.g., `ReactFragment` to stop a surface without tearing down the host.

## Changelog

[Android][Added] ReactDelegate `unloadApp` methods for unmounting surfaces without destroying ReactHost

Reviewed By: mdvacca

Differential Revision: D62448543

fbshipit-source-id: e99b880f48e857935ee856c37b881bcc8bd22ad0
2024-09-12 14:34:46 -07:00
Eric Rozell cbddcfc691 ReactRootView is Nullable in ReactDelegate (#46440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46440

ReactDelegate does not properly annotate the ReactRootView field as Nullable. This fixes that.

## Changelog

[Android][Fixed] Use appropriate Nullable attribute for ReactRootView field in ReactDelegate

Reviewed By: philIip

Differential Revision: D62514424

fbshipit-source-id: e9f10899007dfe794aa081717f5a5aa7d0038181
2024-09-12 14:34:46 -07:00
Joe Vilches 93b608d130 Make it so that aspect ratio behaves like auto if it is 0 or inf (#46428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46428

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

We do not validate the aspect ratio to ensure it is non zero and non inf in a lot of places. Per the spec, these values should act like auto. There is no auto keyword, but it is the default so I just set the style to a default FloatOptional in this case

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62473161

fbshipit-source-id: 6857de819538a7a87ce0a652e99f5a49992921ae
2024-09-12 14:28:33 -07:00
Nicola Corti d7c1e5b989 Unblock RNTester instacrashing due to SoLoader not being enabled (#46459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46459

After the SoLoader 0.12.0 bump I've noticed RNTester is instacrashing due to us not having enabled it
explicitely in the Manifest:

Changelog:
[Internal] [Changed] - Unblock RNTester instacrashing due to SoLoader not being enabled

Reviewed By: cipolleschi

Differential Revision: D62580751

fbshipit-source-id: 3b291e7f82daf1a6bd61bc9588c2d49a389801ef
2024-09-12 14:16:33 -07:00
Vladimir Makaev 3949d9b5ba Update ktfmt component on FBS:master
Reviewed By: zertosh

Differential Revision: D62584126

fbshipit-source-id: 46170730dd7cabfa5e366a3139a9119c319592cc
2024-09-12 14:06:06 -07:00
Tim Yung d0121a6c2d Revert D62398039: Speed up animation on back button press + animated reattach on tab switch
Differential Revision:
D62398039

Original commit changeset: af286e428188

Original Phabricator Diff: D62398039

fbshipit-source-id: 9a69733d5a00c9081471096cca298579af468352
2024-09-12 13:34:32 -07:00
Jorge Cabiedes Acosta 6b369a40d9 Remove experimental_ prefix from filter (#46406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46406

As title

Second attempt at landing the new name. There were 2 issues previously which led us to revert.

1. **Error on workrooms tests.** This ended up not being caused by us but rather by D61896776. After renaming the error changed which might've caused the renaming to be blamed for the issue. It has since been resolved

2. **FB crash** FB was crashing when using drop-shadow after renaming. For some reason after renaming `filter` an invalid stylex property was making FB crash. We don't know why renaming uncovered the issue but the the code was using unsupported features on RN (`calc` & `stylex`) which then led to passing a raw unsupported value for `filter` and crashing on the `processFilter` function.

FB was fixed here D62407454 to prevent crashing after landing this diff

Changelog: [General] [Changed] - Add official `filter` CSSProperty.

Reviewed By: NickGerleman

Differential Revision: D62401985

fbshipit-source-id: 14422603c40b7ddf8300029165a85655354075c3
2024-09-12 11:46:43 -07:00
Shawn Dempsey ec39b8ba96 ReactNativeNewArchitectureFeatureFlagsDefaults defaults to newArch (#46448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46448

Changelog: [Internal]

**Context**

- D61621224 changed `ReactNativeNewArchitectureFeatureFlagsDefaults` to default `newArchitectureEnabled=true`

https://www.internalfb.com/code/fbsource/[dc23ff7ddd18]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt?lines=16-18

**Change**
- We no longer need to explicitly set `newArchitectureEnabled=true`

Reviewed By: cortinico

Differential Revision: D62537633

fbshipit-source-id: 64df997fe85e49d731a914bd5ca749085749a0ac
2024-09-12 10:08:54 -07:00
Oskar Kwaśniewski cadd41b1a2 fix(iOS): don't reference PrivacyInfo.xcprivacy twice for new projects (#46457)
Summary:
This PR fixes an issue with PrivacyInfo files.

When generating a new project for using the latest RC 0.76.0.rc0 I got two privacy manifests references in Xcode.

This is because `PrivacyManifestUtils` look for build phase reference:

```ruby
reference_exists = target.resources_build_phase.files_references.any? { |file_ref| file_ref&.path&.end_with? "xcprivacy" }
```

Which doesn't exist for the generated template.

Here is how Xcode file tree looks like after installing pods:

![CleanShot 2024-09-12 at 13 23 21@2x](https://github.com/user-attachments/assets/44e5bb55-a1ab-4b4b-bfe4-e4a6808afd15)

## Changelog:

[IOS] [FIXED] - don't reference PrivacyInfo.xcprivacy twice for new projects

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

Test Plan:
1. Generate a new project
2. Execute pod install
3. Check if only one PrivacyInfo file exists

Reviewed By: cortinico

Differential Revision: D62580116

Pulled By: cipolleschi

fbshipit-source-id: 1224a41307ae6c9b862832f145baf0edc92476d6
2024-09-12 09:31:25 -07:00
Riccardo Cipolleschi 120558c0cd Bump main to 0.77
Summary:
This change bumps the React Native version in main to 0.77

bypass-github-export-checks

## Changelog:
[General][Changed] - Bump main to 0.77-main

## Facebook:
generated by running `js1 publish react-native 0.77.0-main`

Reviewed By: cortinico

Differential Revision: D62575939

fbshipit-source-id: 6d239fca2eed6cfe51f8c37f78d8dc8730c18b8c
2024-09-12 09:23:23 -07:00
Samuel Susla 6243a33978 do not pass state wrapper for text during view preallocation (#46418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46418

changelog: [internal]

introduce a small performance optimisation on Android.

When Paragraph is preallocated, it does not have valid C++ state. But we still send it to Android layer because it is part of a more generic pipeline. This has a cost because Android will end up using the state to update internal state on ReactTextView. To avoid this, simply add a special case to view preallocation and prevent it from sending C++ state.

Reviewed By: javache

Differential Revision: D62435529

fbshipit-source-id: 36b5b00a7a390432721d28d53ff8d4af76169e08
2024-09-12 08:01:28 -07:00
Marlene Cota 13db1cb88b Fix double to float type conversion error (#46447)
Summary:
![image](https://github.com/user-attachments/assets/3808e1ec-7b56-4cc6-85fb-a48beceba519)

## Changelog:
[GENERAL] [FIXED] - Fix type conversion error in react native windows build.

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

Test Plan: RNW CI builds.

Reviewed By: cipolleschi

Differential Revision: D62570270

Pulled By: cortinico

fbshipit-source-id: da3da297ba10cdd41f49e754ce52053055d61644
2024-09-12 07:27:52 -07:00
Nicola Corti 81e8c39f0a Do not stub SoLoader and use version 0.12.0 (#46422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46422

Stubbing SoLoader comes with a couple of breaking changes (e.g. users in OSS are using `com.facebook.common.logging.FLog` which is exposed by Fresco).

In order to reduce those breaking changes, here I'm moving React Native to use SoLoader 0.12.0.
This new version comes with a constructor that accepts a MergedSoMapping implementation which we provide only for OSS apps.

Please note that the CI on this Diff will be red till SoLoader 0.12.0 releases.

Changelog:
[Internal] [Changed] - Do not stub SoLoader and use version 0.12.0

Reviewed By: cipolleschi

Differential Revision: D62447566

fbshipit-source-id: 6ff38799ed0c9f40cf3ab84be8a05979def63dc2
2024-09-12 07:17:22 -07:00
Tommy Nguyen aec6666bfa Re-add RCTHermesInstance constructor for compatibility (#46453)
Summary:
https://github.com/facebook/react-native/pull/46314 introduced a breaking change, making it hard to maintain backwards compatibility elsewhere. This change re-introduces the constructor that takes two arguments.

## Changelog:

[IOS] [FIXED] - Unbreak `RCTHermesInstance` constructor breaking change

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

Test Plan: n/a

Reviewed By: javache

Differential Revision: D62574496

Pulled By: cortinico

fbshipit-source-id: dcd15bf9694f4b14e37d61d7209193b3e448cd6b
2024-09-12 07:05:39 -07:00
Pieter De Baets 533ef2ca37 Mark HoverEvents as handled when pointer event dispatching is enabled (#46445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46445

Similarly to onTouchEvent, we should return true from onHoverEvent to signal to Android that the hover event is "handled" (because we've dispatched the event to JS). This is important to be able to distinguish multiple stacked React roots on top of each other.

Changelog: [Android][Fixed] Hover events were dispatched incorrectly when multiple ReactRoots were layered.

Reviewed By: mdvacca

Differential Revision: D62529586

fbshipit-source-id: d007c44b8ef56989888eb9a993e1428bd0b72a7b
2024-09-12 03:30:52 -07:00
Thomas Nardone c942469700 Re-enable ktfmt on RN (#46441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46441

Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D62518893

fbshipit-source-id: ca2ff83018716a4dc1e2dcfb8596138d088ce9f4
2024-09-11 19:06:25 -07:00
Jorge Cabiedes Acosta 2241c3146f Remove experimental_ prefix from boxShadow (#46404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46404

As title

Second attempt to rename the prop. BoxShadow caused no issues after renaming but it was batched with `filter` which we reverted.

Changelog: [General] [Changed] - Add official `boxShadow` CSSProperty.

Reviewed By: NickGerleman, cyan33

Differential Revision: D62400814

fbshipit-source-id: ad721f6d11d614e987048e55556b05ff74a4747d
2024-09-11 16:01:06 -07:00
Tim Yung dc84d00db6 Animated: Minimize AnimatedProps Invalidation (#46386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46386

Currently, `useAnimatedProps` attempts (and fails) to memoize the `AnimatedProps` instance by using `props` in the dependency array:

https://www.internalfb.com/code/fbsource/[de6bf108ae11fad0e8516617cde6f0cf3152d129]/xplat/js/react-native-github/packages/react-native/Libraries/Animated/useAnimatedProps.js?lines=56-59

However, `props` is very easily invalidated whenever the component is updated by its parent. The only time when it will not be invalidated is if the component that directly uses this hook — `createAnimatedComponent`'s return value — updates state… which never happens.

This changes `useAnimatedProps` so that we memoize `AnimatedProps` using only the nested property values that actually require a new `AnimatedProps` object to be created, which are `AnimatedNode` subclasses.

A minor detail is that in order for `AnimatedProps.prototype.__getValue` to continue working, we must supply `props` when we're actualizing the `AnimatedNode` instances into real values. This is accomplished by introducing a new method to select `AnimatedNode` subclasses: `__getValueFromStatic{Props,Object,Style,Transforms}`

Changelog:
[General][Added] - Created an experimental optimization to improve memoization within `Animated` to improve product performance

Reviewed By: javache

Differential Revision: D61997128

fbshipit-source-id: 2ca3cfb1038ba9a0abd82904acbc5cb4eb41a45d
2024-09-11 15:34:22 -07:00
Riccardo Cipolleschi 401f735e35 Add changelog for 0.75.3 (#46442)
Summary:
Add changelog for version 0.75.3

## Changelog:
[Internal] - Add Changelog for 0.75.3

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

Test Plan: N/A

Reviewed By: kassens

Differential Revision: D62526856

Pulled By: cipolleschi

fbshipit-source-id: 50045ec5fbbbf282bcec3dd59787f860e5510846
2024-09-11 15:21:55 -07:00
Royi Hagigi 46abda55b9 Speed up animation on back button press + animated reattach on tab switch (#46438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46438

When hiding a view with React.Activity, React will "detach" all the views in teh subtree (call all their effect cleanups) and then upon showing it again will attach them (call all their effects again).

This was previously causing problems with useAnimatedProps and https://github.com/facebook/react-native/pull/46205 was intended to fix it (cc javache), but it's still a perf drain to have to detach all of this and then re-attach it upon show. Worse, it makes it so that we can't actually do any animations upon re-showing a view until all the passive effects have run to re-attach the views to the animations.

So instead, what this diff does is lean on the fact that useInsertionEffect *does not* clean up and rerun when Activity goes from hidden to visible and vice versa. Thus, we can rely on it to only detach the animated node when we're *actually* unmounting - rather than when we're simply hiding/showing.

Changelog:
[General][Changed] - Improved the performance of unmounting (and updating, when an enclosing Activity becomes hidden) Animated components

Reviewed By: yungsters, sammy-SC

Differential Revision: D62398039

fbshipit-source-id: af286e428188b5104f6cfd3fd4d8c9f791dedb8d
2024-09-11 15:00:01 -07:00
Melissa Liu 65d8f66b50 improve text line height calculation (#46362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46362

Changelog:
[Android] [Fixed] - improve text line height calculation

## Context
There is a recurring issue in React Native where text containing accented characters, non-latin scripts, and special glyphs experiences truncation when line height is set too small, even when the line height equals or exceeds the font size. This problem has a significant impact, particularly when rendering complex text in multiple languages or special character sets.

See: https://docs.google.com/document/d/1W-A80gKAyhVbz_WKktSwwJP5qm6h6ZBjFNcsVbknXhI/edit?usp=sharing for more context

## Investigation
Previously, when font metrics (ascent, descent, top, bottom) exceeded the line height, the logic arbitrarily prioritized descent over ascent and bottom top. This led to vertical misalignment and text clipping at the top of the text.

## Proposed Implementation:

1. Descent Exceeds Line Height:
Descent is capped to fit within the line height, setting ascent and top to 0, similar to the current behavior.
2. Shrink ascent and descent equally:
When the combined ascent and descent exceed the line height, the vertical deficit is split proportionally between them, ensuring even distribution of the space.
3. Proportionally shrink top and bottom:
If the top and bottom together exceed the line height, reductions are now applied proportionally based on the delta between top and ascent and bottom and descent.

Reviewed By: NickGerleman

Differential Revision: D62295350

fbshipit-source-id: 81381e8ea18ba9059488468295778c21781e4e7a
2024-09-11 14:53:09 -07:00
Melissa Liu f338e7c0a1 add feature flag for line height gating (#46408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46408

## Changelog:

[Android] [Added] - new feature flag for line height calculation

## Context
Adding feature flag for line height calculation centering.

There is a recurring issue in React Native where text containing accented characters, non-latin scripts, and special glyphs experiences truncation when line height is set too small, even when the line height equals or exceeds the font size. This causes issues in rendering complex text in multiple languages or special character sets.

See: https://docs.google.com/document/d/1W-A80gKAyhVbz_WKktSwwJP5qm6h6ZBjFNcsVbknXhI/edit?usp=sharing for more context

## Investigation
Previously, when font metrics (ascent, descent, top, bottom) exceeded the line height, the logic arbitrarily prioritized descent over ascent and bottom top. This led to vertical misalignment and text clipping at the top of the text.

## Implementation:

1. Descent Exceeds Line Height:
Descent is capped to fit within the line height, setting ascent and top to 0, similar to the current behavior.
2. Shrink ascent and descent equally:
When the combined ascent and descent exceed the line height, the vertical deficit is split proportionally between them, ensuring even distribution of the space.
3. Proportionally shrink top and bottom:
If the top and bottom together exceed the line height, reductions are now applied proportionally based on the delta between top and ascent and bottom and descent.

Reviewed By: NickGerleman

Differential Revision: D62421775

fbshipit-source-id: 6b0542426d7ee575f4986e60ddf92247542b65cb
2024-09-11 14:53:09 -07:00
Zeya Peng 4014aa4528 correctly pass down isLooping in parallel animation (#46429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46429

Right now if I create a `Animated.loop(Animated.parallel(...))`, `config.__isLooping` for nested animations are not `true`. The reason is Animated.parallel doesn't pass down `isLooping`. This change is fixing that.

Changelog: [General][Fixed] - correctly pass down isLooping in parallel animation

Reviewed By: cipolleschi

Differential Revision: D62473189

fbshipit-source-id: 405dd36aa008cc965599ff82333b5552df1eb41f
2024-09-11 09:58:04 -07:00
Pieter De Baets 94489d563d Add trace markers for onScrollChanged / updateClippingRect (#46412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46412

These are quite useful when investigating scroll performance.

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D62213724

fbshipit-source-id: 3293aaf82584eae8508c748638c47c8b010db58f
2024-09-11 08:22:08 -07:00
Riccardo Cipolleschi 274f5bfe6c Disable concurrency on main (#46435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46435

On main, we want to run CI as fast as possible to catch failures as soon as possible.
Currently, if two commits arrives on main (say commit A and commi B) CI will run on commit B only when it is finished on commit A.
Instead, we would like for CI to run in parallel.

## Changelog
[Internal] - Run CI in parallel on main

Reviewed By: cortinico

Differential Revision: D62496842

fbshipit-source-id: 03dc910deab42af98d92ea8e8e5b90049940dba1
2024-09-11 07:08:40 -07:00
Mohamed Alsadek b3f4d54786 Back out "Enable Multiple Sheet Presentation in React Native" (#46433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46433

Original commit changeset: 53667cf1a75e

Original Phabricator Diff: D62143463

Changelog: [Internal]  revert previous modal presentation improvement

Reviewed By: sammy-SC

Differential Revision: D62474039

fbshipit-source-id: b510c0460c06ab9d595d414d4ea32acd224871bc
2024-09-11 04:20:50 -07:00
Mohamed Alsadek 080c82e70f Back out "Enable Multiple Sheet Presentation in React Native" (#46434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46434

Original commit changeset: daa0cf95edb2

Original Phabricator Diff: D62202475

Changelog: [Internal]  revert previous modal presentation improvement

Reviewed By: sammy-SC

Differential Revision: D62474041

fbshipit-source-id: a4af6b5361dcc482e9bb3c2f45d614f9494f022e
2024-09-11 04:20:50 -07:00
Nicola Corti 1e07ac1d32 Add an issue template for React Native DevTools bug reports
Summary:
This introduces a new issue template for Debugger related issues.

bypass-github-export-checks

Changelog:
[Internal] [Changed] - Add an issue template for React Native DevTools bug reports

Reviewed By: cipolleschi, hoxyq

Differential Revision: D62440315

fbshipit-source-id: c7437d9787a910a2886df50171c86c9ed2412dd6
2024-09-11 04:14:56 -07:00
Tomek Zawadzki e91690d929 Expose jsctooling via prefab (#46430)
Summary:
This PR exposes `jsctooling` prefab that contains `facebook::jsc::makeJSCRuntime` used by Reanimated and other third-party libraries previously accessed via `libjscexecutor.so`.

Based on https://github.com/facebook/react-native/pull/46423.

## Changelog:

[Android] [Changed] - Expose jsctooling via prefab

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

Test Plan: Tested on Reanimated paper-example app built from source on RN 0.76.0-rc.0 with JSC enabled

Reviewed By: cipolleschi

Differential Revision: D62492763

Pulled By: cortinico

fbshipit-source-id: 53b6c0d9bb88559c40b5b8796bf6a1513bd388d9
2024-09-11 03:52:55 -07:00
Tomek Zawadzki b1d42c8ef2 Expose react_timing headers in reactnative prefab (#46427)
Summary:
This PR fixes the following error when building third-party libraries that `#include <react/fabric/Binding.h>` which includes `react/timing/primitives.h` which is not included in `reactnative` prefab.

```
FAILED: CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o
/Users/tomekzaw/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/Users/tomekzaw/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DFOLLY_NO_CONFIG=1 -Drnscreens_EXPORTS -I/Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/../cpp -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/jsi/include -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include -isystem /Users/tomekzaw/.gradle/caches/8.10.1/transforms/b0878eb14f826ac5f04db98523604de2/transformed/fbjni-0.6.0/prefab/modules/fbjni/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -std=c++20 -MD -MT CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o -MF CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o.d -o CMakeFiles/rnscreens.dir/src/main/cpp/NativeProxy.cpp.o -c /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:17:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/jni/JRuntimeScheduler.h:11:
In file included from /Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/runtimescheduler/RuntimeScheduler.h:11:
/Users/tomekzaw/.gradle/caches/8.10.1/transforms/eb5443cef7868b6c3cc54bbf3f161a63/transformed/react-android-0.76.0-rc.0-debug/prefab/modules/reactnative/include/react/performance/timeline/PerformanceEntryReporter.h:10:10: fatal error: 'react/timing/primitives.h' file not found
#include <react/timing/primitives.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

## Changelog:

[ANDROID] [FIXED] - Expose `react_timing` headers in `reactnative` prefab

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

Test Plan: Tested on Reanimated fabric-example app with react-native-screens installed built from source on top of RN 0.76.0-rc.0 with new arch enabled

Reviewed By: cipolleschi

Differential Revision: D62492707

Pulled By: cortinico

fbshipit-source-id: 94ed7044457bea53660a6ca6d5342cf8ea20a8b4
2024-09-11 03:47:56 -07:00
Ruslan Lesiutin 69325c11f2 Update debugger-frontend from 50a4d4f...e8c7943 (#46414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46414

Changelog: [Internal] - Update `react-native/debugger-frontend` from 50a4d4f...e8c7943

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

Reviewed By: robhogan

Differential Revision: D62436953

fbshipit-source-id: 7a877142c5713c78cb6f1a3d839c4e90f93fa0c6
2024-09-11 03:42:57 -07:00
Douglas Cheong a05f9c6771 Mark params as unused (#46426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46426

## Changelog:
[Internal] -
Comment out unused params

Reviewed By: rshest

Differential Revision: D62448755

fbshipit-source-id: da647197994b982f924b2c1330a2b529e48d7ad8
2024-09-10 14:33:17 -07:00
Benoit Girard ef0ea4d834 Add FuseboxPerfettoDataSource to emit Fusebox traces using Perfetto (#46376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46376

Ideally we would use Fusebox directly but it's not supported in release build. This is a clever work around that:
1) Allows us to use Perfetto to start/stop a trace, otherwise we'd need to build another way to do that which would be either hacky and/or complex.
2) Implements tacking Hermes JS samples and putting them inside of Fusebox traces.
3) Manually taking the trace and opening them in an instance of devtools.

Reviewed By: rubennorte

Differential Revision: D62263012

fbshipit-source-id: 49468914d2b7e5da4761329b176f140b917a404d
2024-09-10 12:54:02 -07:00
Nick Lefever 199d194c46 Use asset name as key for vector image check caching (#46421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46421

Changelog: [Internal]

Avoid using the Context as a cache key, using only the asset name.

Reviewed By: Abbondanzo

Differential Revision: D62445718

fbshipit-source-id: 4161e6ef1bbc396c8ab815cdc0362159411f6a68
2024-09-10 12:44:22 -07:00
Nicola Corti f41af55958 Expose hermestooling via prefab (#46423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46423

This is used by Reanimated as they were previously accessing `libhermes_executor.so`

Changelog:
[Android] [Changed] - Expose hermestooling via prefab

Reviewed By: cipolleschi

Differential Revision: D62447875

fbshipit-source-id: e863c56bc5a801ee7de8a4e5d45f95481d3497f8
2024-09-10 11:46:40 -07:00
Nick Lefever 65beadb00a Cache vector image detection for assets (#46415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46415

Changelog: [Internal]

Cache the results checking for vector content. This check is decompressing the asset content and parsing XML to check for vector graphics. Caching the result per context/asset name removes the need to parse the content on each image assignment.

Reviewed By: Abbondanzo

Differential Revision: D62436412

fbshipit-source-id: 9e1fe9f0747c9a30ac0d89124b6909d4260a2a2f
2024-09-10 09:20:08 -07:00
Yunlong Wu 4a22f2c816 Add TextInput.editable and BaseTextInputProps (#46356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46356

# Changelog:
[Internal]-
Currently TextInput does not expose `editable` and `readOnly` (only `editable` is exposed as Android-specific prop).
This change is to add them to BaseTextInputProps so they can be supported cross-platform.

Reviewed By: rshest

Differential Revision: D62180722

fbshipit-source-id: 6cb82589f1d36b61167761f5a2e70e8d4b31b01b
2024-09-10 09:08:23 -07:00
Tim Yung 5b5a8397aa Animated: Create enableAnimatedAllowlist Feature Flag (#46405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46405

Creates a feature flag for enabling the `Animated` code paths utilizing the new allowlist features. This enables us to validate the impact on product performance and developer experience before fully rolling it out.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62405286

fbshipit-source-id: be4a4786d4d2f44504f7788e473c12ed432ef1cd
2024-09-10 08:33:54 -07:00
Nicola Corti 773a02ad5d Fix wrong command for publishing of external-artifacts (#46417)
Summary:
This is a pick on main of a fix necessary to release 0.76.x

## Changelog:

[INTERNAL] - Fix wrong command for publishing of external-artifacts

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D62440193

Pulled By: cortinico

fbshipit-source-id: 57ea0736c1b6e3e60b048a46770356901de74024
2024-09-10 07:11:42 -07:00
Riccardo Cipolleschi d3d48cb357 feat(JS): Expose text content types to JS (#46170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46170

This PR expose to JS a few missing text content types on iOS (available from iOS 15)

- dateTime
- flightNumber
- shipmentTrackingNumber

## Changelog
[General][Added] - Expose missing text content type to JS

Reviewed By: blakef

Differential Revision: D61657788

fbshipit-source-id: 1a0ea0e76efaf715d88bcbf249f7cb20b5f3607b
2024-09-10 05:00:00 -07:00
shubhamguptadream11 ce2d34f194 feat(iOS): line break mode implement JS APIs for the new mode (#46128)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/44107

## Changelog:

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

Pick one each for the category and type tags:

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

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

[IOS] [ADDED] - Line break mode for TextInput components. **This includes JS APIs for the new mode.**

This PR is a breakdown of [this](https://github.com/facebook/react-native/pull/45968) PR.

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

Test Plan:
- Added unit tests to cover the new JS APIs.
- Verified that the new mode functions as expected through manual testing.

Reviewed By: andrewdacenko

Differential Revision: D61657004

Pulled By: cipolleschi

fbshipit-source-id: 9fc5c40fc077bee8e1abc51b6eae2e0f0fcd9b8f
2024-09-10 04:52:22 -07:00
Riccardo Cipolleschi 27bd6c9227 Use Debug APK for release testing (#46413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46413

When testing RNTester for Android during a release, we downloads the APKs from CI to save time.

Sadly, we were downloading the Release APKs instead of the Debug ones, so we could not test te integration with Metro.

This change fixes the testing scripts to download the debug APK

## Changelog
[Internal] - Download the debug APK instead of the Release one

Reviewed By: cortinico

Differential Revision: D62436023

fbshipit-source-id: 08a568caf3e5c85b9da933bc01623587bd36affe
2024-09-10 04:41:07 -07:00
Tim Yung 8dabed60f4 Animated: Create Default NativeAnimatedAllowlist (#46385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46385

Changes `NativeAnimatedAllowlist` to export a "default allowlist" for use with "native animated components" (i.e. components that are only used with `Animated` values with `useNativeDriver`).

This required some minor internal implementation changes in order to make the allowlist conform to `{[string]: true}`, so I also added some unit tests to ensure the functionality remains the same.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62351434

fbshipit-source-id: e92b7245c0d61da87a0d149ffeb967f1ebb888a2
2024-09-09 20:34:57 -07:00
Tim Yung f3f652daab Animated: Create Experimental Props Allowlist (#46374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46374

Creates an experimental `allowlist` parameter that can be supplied to a new `unstable_createAnimatedComponentWithAllowlist` method for use in new experiments to evaluate the impact on product performance and developer experience.

When it is provided, only the props and styles in `allowlist` will be inspected for `AnimatedNode` values. The hypothesis for this change is that restricting the search space for `AnimatedProps` to an allowlist will significantly reduce the runtime overhead of using `Animated` components.

Changelog:
[General][Added] - Created an experimental (unstable) method for allowlisting props when using `Animated`

Reviewed By: javache

Differential Revision: D62117424

fbshipit-source-id: bdd656be1fdc7454360035627644606cb00d33c0
2024-09-09 20:34:57 -07:00
Tim Yung 5dbd9fc159 Animated: Reduce Duplication in Animated{Props,Style} (#46384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46384

Minor refactor to reduce duplicated logic when traversing props and styles in `AnimatedProps` and `AnimatedStyle`, respectively.

This refactor also makes a future optimization (in which we want to skip processing certain props) more straightforward to implement.

Changelog
[Internal]

Reviewed By: javache

Differential Revision: D62351078

fbshipit-source-id: 63c06462c99ef83f3b511456a3281b940b7a3ac0
2024-09-09 20:34:57 -07:00
Tim Yung 734c1505f4 Animated: Improve Types in Animated{Props,Style} (#46383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46383

Minor refactors to the internal types of `AnimatedProps` and `AnimatedStyle` to avoid using `Object` and `any`.

This also migrates private properties prefixed with `_` to instead use `#` (ECMAScript private properties). This has the desired benefit of minimizing thrash in the `public-api-test.js` snapshot, too.

There are no behavior changes associated with this commit.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62351005

fbshipit-source-id: bb69d4db50aef5e0b3193971dac581686e359a95
2024-09-09 20:34:57 -07:00
Tim Yung fe6228512e Animated: Delete AnimatedNode.prototype.toJSON (#46382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46382

Deletes the `AnimatedNode.prototype.toJSON` method.

It was originally introduced by [facebook/react-native#7442](https://github.com/facebook/react-native/pull/7442) as a means to resolve [facebook/react-native#7441](https://github.com/facebook/react-native/issues/7441), where an error occurs attempting to serialize `AnimatedNode` instances.

However, this is no longer needed for that purpose because our inspector implementation is now more resilient. (It correctly reports the current style value instead of the `AnimatedNode` instance.)

The impetus for this change is that this `toJSON` method prevents a future performance optimization for all `Animated` components.

Changelog:
[General][Changed] - AnimatedNode (and its subclasses) no longer implement `toJSON()`.

Reviewed By: javache

Differential Revision: D62350726

fbshipit-source-id: c68edc98878e58d48bc677c4f1299bb1bd15c9c4
2024-09-09 20:34:57 -07:00
Tim Yung ca234ba10e Animated: Lazily Allocate AnimatedNode Instances (#46317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46317

Changes `AnimatedProps` to avoid allocating `AnimatedStyle` (and `AnimatedTransform`, `AnimatedObject`) unless necessary.

This not only reduces memory and traversal overhead, but it enables us to implement allowlist strategies to prune unnecessary traversals.

Changelog:
[General][Changed] - Animated now omits `style` if the supplied value is null, undefined, or not an object. Previously, it would emit an empty `style` object.
[General][Changed] - Animated now resolves `style` to the original prop value if it contains no `AnimatedNode` instances. Previously, it would resolve to a flattened style object.

Reviewed By: javache

Differential Revision: D62117423

fbshipit-source-id: 34b0c9940be5b6f5d94467993a5344406cc56f93
2024-09-09 20:34:57 -07:00
Tim Yung 9e6c4fd342 Animated: Codify Update Subscription Invariants (#46373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46373

Currently, the logic for managing the native subscription in `AnimatedNode` is scattered and difficult to follow. This refactors the code to make the subscription's state easier to understand and harder to break in future refactors.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62268695

fbshipit-source-id: 098cc6413db2abffa80983116dd0a5f440ba6fce
2024-09-09 20:34:57 -07:00
Tim Yung 7377929e15 RN: Reintroduce forwardRef to ScrollView (#46400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46400

Since React 19 is not yet stable, we cannot publish a release of React Native depending on it, yet. As such, we have to revert our dependency on React 19 and bring back patterns such as `forwardRef`.

This is a spiritual revert of https://github.com/facebook/react-native/pull/45197.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D62384482

fbshipit-source-id: 880ad1166e0b449ad5be6f914907661adb5f458d
2024-09-09 20:32:19 -07:00
SamChou19815 (Meta Employee) 1f65bf9545 Upgrade Flow to 0.245.2 (#30919)
Summary:
## Summary

This PR bumps Flow all the way to the latest 0.245.2.

Most of the suppressions comes from Flow v0.239.0's change to include
undefined in the return of `Array.pop`.

I also enabled `react.custom_jsx_typing=true` and added custom jsx
typing to match the old behavior that `React.createElement` is
effectively any typed. This is necessary since various builtin
components like `React.Fragment` is actually symbol in the React repo
instead of `React.AbstractComponent<...>`. It can be made more accurate
by customizing the `React$CustomJSXFactory` type, but I will leave it to
the React team to decide.

## How did you test this change?

`yarn flow` for all the renderers

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

Reviewed By: yungsters

Differential Revision: D62384646

Pulled By: SamChou19815

fbshipit-source-id: 727794f2d4091f37d771854b8e8a52f070309213
2024-09-09 19:53:43 -07:00
Alan Lee af1b18e125 fix SafeAreaView mis-used import (#46402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46402

JS code for importing SafeAreaView is causing error in windows due to import being used.
Fix it by using conditional require instead

Changelog:
[Internal] -  Fixed mis-used import of core only SafeAreaView in JS

Reviewed By: fkgozali

Differential Revision: D62392588

fbshipit-source-id: 65c4728ff73b43cc54543ec2d141a88fce1275ca
2024-09-09 19:43:27 -07:00
Kacper Rozniata 84f2d25124 fix(iOS): fix animating Switch component value change (#46173)
Summary:
This PR fixes animating controlled `Switch` component when it's initial value is set to `false`

When initial value was set to `false`, `_isInitialValueSet` flag wasn't changed to `YES`, because `oldSwitchProps.value` &`newSwitchProps.value` were equal, which resulted in controlled `Switch` component being updated without animation on first value change

This PR fixes it by moving setting `_isInitialValueSet` flag to the end of `updateProps` method

## Changelog:

[IOS] [FIXED] - Fix animating Switch component value change in Fabric

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

Test Plan:
1. Open `Switch` example in `RNTester`
2. In `Change events can be detected` section press switch that is `off` by default
3. Switch under it should change with animation

Reviewed By: javache

Differential Revision: D62377771

Pulled By: cipolleschi

fbshipit-source-id: 0213287c935db79a199b086ebb36a6979df03913
2024-09-09 16:41:49 -07:00
Samuel Susla 95af340aac ship granular state updates on iOS (#46403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46403

changelog: [internal]

ship granular state updates on iOS.

Reviewed By: rubennorte

Differential Revision: D62374462

fbshipit-source-id: 7ed217011e1c65031d418f1807802c113628f542
2024-09-09 15:23:59 -07:00
Ruslan Lesiutin af8b232741 Update debugger-frontend from a556d26...50a4d4f (#46401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46401

Changelog: [Internal] - Update `react-native/debugger-frontend` from a556d26...50a4d4f

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

Reviewed By: huntie

Differential Revision: D62385355

fbshipit-source-id: 77056540c9d40cd7cfc8098332e86f9521633619
2024-09-09 10:31:31 -07:00
Peter Abbondanzo 2e80f5acf1 Load XML files on disk by default (#46371)
Summary:
X-link: https://github.com/facebook/metro/pull/1348

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

## Internal

Vector drawable image support was added in D59530172 but importing vector drawable asset types was not supported out of the box. It required custom source transformers like the one added in D60021474. This is because Android cannot load vector drawable XML over the network. Vector drawables are compiled by AAPT as part of the build process. Even though Metro can serve XML, it would never load.

## Summary

This adds some minor checks in the `AssetSourceResolver` to only attempt loading XML asset types from disk on the Android platform. XML assets like vector drawables are precompiled and cannot be served over the network by Metro.

## Changelog

[Android] [Added] - Adds support for importing XML assets as images

Reviewed By: javache

Differential Revision: D62302929

fbshipit-source-id: 01e49ac5b0429d291318984128dfca2dc058149d
2024-09-09 10:18:10 -07:00
Rob Hogan 40f98b5eee Bump Metro to 0.81.0-alpha.0 (#46398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46398

Bump Metro packages to the version stablising for RN 0.76

Changelog:
[General][Changed] - Bump Metro dependencies to 0.81.0-alpha.0

Reviewed By: cortinico

Differential Revision: D62377929

fbshipit-source-id: 0808b11ad534e6a649c28f32b19f95f691645be4
2024-09-09 08:20:52 -07:00
Nicola Corti 90f89a830a Gradle to 8.10.1 (#46399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46399

This is a patch release for Gradle. Let's include it inside main/0.76.

Changelog:
[Android] [Changed] - Gradle to 8.10.1

Reviewed By: tdn120

Differential Revision: D62377887

fbshipit-source-id: e8a5acaa48c15c9a12a09504c33c2a0d2834d92c
2024-09-09 07:26:53 -07:00
Hampus Sjöberg 833c3a2cf5 fix: RNGP autolink not properly filter out pure C++ TurboModules (#46381)
Summary:
Hey.

The react-native gradle plugin didn't properly filter out [Pure](https://github.com/react-native-community/cli/pull/2387) C++ TurboModules for autolinking, which caused build failures as a non-existing gradle dependency would be emitted.

This makes Pure C++ TurboModules work again for Android.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID][FIXED] Fix autolinking issues for Pure C++ TurboModules

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

Test Plan:
https://github.com/hsjoberg/rn75autolinkregression

Try running this repro project to observe the error:

```
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/coco/Projects/Blixt/rn75autolinkregression/example/android/app/build.gradle' line: 54

* What went wrong:
A problem occurred evaluating project ':app'.
> Project with path ':react-native-cxx-turbomodule' could not be found in project ':app'.
```

Simply add the 1-line code from this PR to make the build succeed.

Cheers.

Reviewed By: cipolleschi

Differential Revision: D62377757

Pulled By: cortinico

fbshipit-source-id: 9e3fa3777b4e6e4d3f2eb0f996ac0ac7676eedbe
2024-09-09 07:22:28 -07:00
Rob Hogan 143f1ad298 Enable RN DevTools Android OSS debug builds (#46395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46395

Enable React Native Devtools in Android OSS debug builds

Changelog:
[Android][Added] Enable React Native DevTools in OSS debug builds

Reviewed By: huntie

Differential Revision: D62376708

fbshipit-source-id: b5f98d003fee224930c0b8df1455be962e56d245
2024-09-09 05:45:13 -07:00
Alex Hunt d55efe8953 Fix HERMES_ENABLE_DEBUGGER define for jsinspector-modern under CocoaPods (#46393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46393

> [!Note]
> Replaces https://github.com/facebook/react-native/pull/46282.

We intended to enable Fusebox on `main` since https://github.com/facebook/react-native/pull/45469 — this worked when building under Buck, however was not working for builds under Xcode. This is because the `HERMES_ENABLE_DEBUGGER` preprocessor flag was missing for the `React-jsinspector` Podspec.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D62375148

fbshipit-source-id: 5d4d243d0a2cb7796fdf59d57086a0cb966639c7
2024-09-09 04:38:32 -07:00
Alex Hunt f220bde4d7 Remove Inspector Panel perf + network tabs under New Arch (#46307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46307

Changelog:
[General][Breaking] - Remove Inspector Panel perf + network tabs  under New Arch (see https://github.com/react-native-community/discussions-and-proposals/pull/777)

Reviewed By: christophpurrer

Differential Revision: D62123634

fbshipit-source-id: 44ecc476943ccb33f8de96dcefa3e233e954841a
2024-09-09 04:31:17 -07:00
Vojtech Novak 7041ed28f0 fix(android): ensure Appearance change listener does not skip events (#46017)
Summary:
I'm able to reproduce a case when Appearance module methods are called in the following order:

starting point: dark mode enabled
1. call `setColorScheme` light
2. call `getColorScheme`, which sets `colorScheme` to light [here](https://github.com/facebook/react-native/blob/7bb7a6037bd78bbfa6d9e8499973ea921e9c70e1/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt#L57)
3. [onConfigurationChanged](https://github.com/facebook/react-native/blob/7bb7a6037bd78bbfa6d9e8499973ea921e9c70e1/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt#L82) is called but `if (colorScheme != newColorScheme)` does not evaluate to true, so no event is dispatched to JS. That means JS is not in sync with the native state.

The issue was the `getColorScheme` had a side-effect of setting `colorScheme` private member (not sure what its use was). The fix remembers the last emitted color scheme value and emits event if new value is different.

## Changelog:

[ANDROID] [FIXED] - ensure Appearance change listener does not skip events

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

Test Plan: tested locally with RN tester

Reviewed By: NickGerleman

Differential Revision: D62016949

Pulled By: cipolleschi

fbshipit-source-id: b7b5755d38becda655cf376749d9a996daff7e07
2024-09-09 04:30:50 -07:00
Riccardo Cipolleschi 148066e8f9 Bump CLI to 15 (#46394)
Summary:
Bumps the CLI to the next version

## Changelog:
[General][Changed] - Bump cli dependencies to 15.0.0-alpha.2

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

Test Plan: CI

Reviewed By: huntie

Differential Revision: D62375405

Pulled By: cipolleschi

fbshipit-source-id: fec99216bc7ad6decfd83840091d807f603184da
2024-09-09 03:54:43 -07:00
Oskar Kwaśniewski 3621606c44 feat(iOS): expose newArchEnabled, deprecate separate methods (#46228)
Summary:
This PR exposes the `newArchEnabled` flag and deprecates all of the separate methods to enable new architecture.

As discussed with cipolleschi here: https://github.com/react-native-community/template/pull/45#discussion_r1732522705

## Changelog:

[IOS] [DEPRECATED] - Deprecate turboModuleEnabled, fabricEnabled, bridgelessEnabled
[IOS] [ADDED] - Add newArchEnabled method to RCTAppDelegate

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

Test Plan: Test if switching newArchEnabled flag from AppDelegate works.

Reviewed By: cortinico

Differential Revision: D61849385

Pulled By: cipolleschi

fbshipit-source-id: 8acf718386882679f00d2d5000b4432a523b34ac
2024-09-09 03:15:19 -07:00
Alan Lee 97b661c3f0 add inset based margins to RedBox (#46391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46391

**Issue:**
RedBox displays early error before JS Error handling is properly setup.
On Android 15, targetSdk 35 (forced edge-to-edge), dialog overlaps with system bars making it difficult to use.

**Solution**
Add inset based margins so content does not overlap with system bars.

Changelog:
[Android][Fixed] - RedBox content overlapping with system bars on Android 15 forced edge-to-edge

Reviewed By: fkgozali

Differential Revision: D62362105

fbshipit-source-id: 57f60222914d407ebdcfd0359dbdf3ac36bde8f5
2024-09-09 01:15:18 -07:00
Alan Lee 3244a5ee74 code cleanup for depreacted OS version (#46390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46390

As React Native's minSdkVersion is not 24, clean up version checks and code that is using deprecated version from OSS

Changelog:
[Internal] - code cleanup for minSdkVersion 24

Reviewed By: philIip

Differential Revision: D62362059

fbshipit-source-id: a851d0908d4175269524f41955acca5f2da69cad
2024-09-09 00:25:54 -07:00
Riccardo Cipolleschi d424c24432 Zip slices to preserve symlinks (#46387)
Summary:
When creating Hermes in CI, we build it for MacOS and Mac Catalyst as well.
The slices for these platforms requires symlinks to work properly.
The upload artifacts action on github, when applied to folders, follows the symlinks and copies the destination folder. The result is that Hermes for macOS and Catalyst does not work as expected.

This should fix https://github.com/facebook/react-native/issues/46213.

## Changelog:
[Internal] - Build Hermes in CI properly

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

Test Plan: Tested already in 0.75

Reviewed By: robhogan

Differential Revision: D62355050

Pulled By: cipolleschi

fbshipit-source-id: 7abb85c8a2a88f13e06a49c6cb0caccbdad4551a
2024-09-08 06:27:48 -07:00
dirkpostma d687d38987 Fix duplicate entries in HEADER_SEARCH_PATHS when running react_native_post_install script (#46262)
Summary:
In a react native project where USE_FRAMEWORKS is not nil, every time when running `pod install`, duplicate lines are added to `HEADER_SEARCH_PATHS` section of `project.pbxproj`:

```
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
```

Note: a popular library that needs `use_frameworks` is react-native-firebase.
See https://rnfirebase.io/#altering-cocoapods-to-use-frameworks

## Analyse

- `react_native_post_install` calls `ReactNativePodsUtils.update_search_paths(installer)`
- when `ENV['USE_FRAMEWORKS'] != nil` then `update_search_paths` calls `add_search_path_if_not_included`
- `add_search_path_if_not_included` checks if `"#{new_search_path}"` is already there
- if not found it adds `" #{new_search_path}"` _with an extra space_
- next time, it can't find `"#{new_search_path}"` because of the extra space, and adds `" #{new_search_path}"` again

## Changelog:

[IOS] [FIXED] - react_native_post_install script no longer adds duplicate entries to HEADER_SEARCH_PATHS

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

Test Plan:
- create a react native project
- add `use_frameworks! :linkage => :static` to `ios/Podfile` (just before `use_react_native`)
- run `pod install`
- assert no duplicate lines are added to HEADER_SEARCH_PATHS of file `project.pbxproj`

Reviewed By: cipolleschi

Differential Revision: D61982680

Pulled By: shwanton

fbshipit-source-id: 61b566893c551d0813edd6eec2f8352c041c748f
2024-09-07 06:27:23 -07:00
Oskar Kwaśniewski 9cc6f007ba chore(iOS): bump socket rocket to 0.7.1 (#46300)
Summary:
This PR bumps Socket Rocket to 0.7.1, this release brings some new improvements and visionOS support. I've also moved the version to a constant.

## Changelog:

[INTERNAL] [CHANGED] - Bump SocketRocket to 0.7.1

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

Test Plan: CI Green

Reviewed By: cortinico, cipolleschi

Differential Revision: D62294833

Pulled By: blakef

fbshipit-source-id: 0e45c7de041710fb1f500b0ac23898b68a8a8936
2024-09-07 02:56:51 -07:00
Alan Lee 77b3a8bdd6 Modal bugfix for statusBarTranslucent prop and Android 15 (#46359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46359

Remove unneeded code around size calculation and old arch support
- updateState was getting called unnecessarily in multiple places --> only call from onSizeChanged()
    - this is a reliable source for getting the content size area of the dialog used for Modal
     - remove code checking duplicated update
- Old architecture cleanup
    - Remove Java implementation of ShadowNode
      - we already have logic to set the node size via UIManagerModule::updateNodeSize(). This  code is now group together in updateState() for both new and old architecture

This fixes issues with resulting from wrong size calculation:
- having gaps at bottom when we set `statusBarTranslucent` to `true`
- Modal cut off at bottom on Android 15 (drawn under bottom nav bar)

Changelog:
[Android][Fixed] - Modal statusBarTranslucent bug, Modal at bottom being cut off in Android 15 (without forced edge-to-edge)
[Android][Deprecation] - Deprecating ModalHostShadowNode and ModalHostHelper classes

Reviewed By: mdvacca

Differential Revision: D62286026

fbshipit-source-id: 03b64a7783c12bebd1457c86a9a2657adc882c79
2024-09-07 00:59:47 -07:00
Alan Lee 79e4ed2b09 Refactor/ bugfix for ReactModalHostView (#46326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46326

- renaming variabled to make intent more clear
    - `dialog` -> `dialogWindow` to distinguish with `activity.window`
    - `hostView` -> `dialogRootViewGroup` as name was confusing.
        - `ReactModalHostView` creates and manages `DialogRootViewGroup` but it used as contentView for the Dialog.
- bug fixes

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D62177564

fbshipit-source-id: f81b167c1a234c02617ec2a3d63979628e01063b
2024-09-06 19:07:04 -07:00
Shawn Dempsey 17d0345fdf Migrate FlatList/SectionList E2E testss from Catalyst to RNTester (#46274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46274

changelog: [General][Add] - Add E2E test cases for Flat/SectionList to RNTester

Reviewed By: philIip

Differential Revision: D62002065

fbshipit-source-id: 038907cd7afd33505b7599e390cb9f366b7b32f6
2024-09-06 15:13:33 -07:00
Marc Rousavy e629a8552d fix: Bring back Cxx TurboModule autolinking via registerCxxModuleToGlobalModuleMap (#46360)
Summary:
Reverts the PR https://github.com/facebook/react-native/pull/45967 from philIip to bring back the `registerCxxModuleToGlobalModuleMap(..)` function, which I use in Nitro Modules and MMKV.

Ontop of that, this also removes the "experimental" `RCT_EXPORT_CXX_MODULE_EXPERIMENTAL` macro, which I think was the original intent of this PR as this macro is a bit unsafe.

I also added some small docs to `registerCxxModuleToGlobalModuleMap` while I'm at it.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [CHANGED] - Bring back CxxTurboModule autolinking function, but remove `RCT_EXPORT_CXX_MODULE_EXPERIMENTAL` macro

[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/46360

Test Plan: Build Nitro Modules. Worked for me! :)

Reviewed By: realsoelynn

Differential Revision: D62310637

Pulled By: philIip

fbshipit-source-id: 2caa2b8ea094dda5e13c81431a9a645cbcf8f807
2024-09-06 15:11:03 -07:00
Benoit Girard 1bd4a11736 Add Fusebox support for saving traces to disk (#46370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46370

Add a function to write the current trace contents to a file. To be used by the upcoming Perfetto data source while we wait for devtools to work in a profiling build.

Reviewed By: rubennorte

Differential Revision: D62262985

fbshipit-source-id: 04789f5312721434c773e51b3da333498bf0e786
2024-09-06 12:40:42 -07:00
Tim Yung 2f8676924d Animated: Store Listeners w/ Map
Summary:
Currently, `AnimatedNode.prototype.getListeners` creates an array with `Object.keys()` to determine the number of listeners.

This is a relatively hot code path for animation-intensive user interfaces. Although `Object.keys()` is fast, every unnecessary memory allocation is an unnecessary opportunity to create garbage that requires collection.

Using an object as a dictionary performs worst than using a `Map` anyway, so this switches `AnimatedNode` to use a `Map`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62267352

fbshipit-source-id: 8629861a64109a3a711c0f66a345029d0bfcd440
2024-09-06 12:15:21 -07:00
Tim Yung d1ebe02c19 Animated: Optimize Traversals in Nodes (#46286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46286

Optimizes the runtime performance of `Animated` by using memoization to avoid repetitive traversals of `props` (and `style`) values.

Changelog:
[General][Changed] - Improved runtime performance of `Animated`

Reviewed By: javache

Differential Revision: D62037506

fbshipit-source-id: b0202f02c87466e1cef61b841de7e861a0ecae4e
2024-09-06 12:15:21 -07:00
Tim Yung 9e35dffcf1 Animated: Refactor NativeAnimatedHelper (#46312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46312

Refactors `NativeAnimatedHelper` to make it easier to read, reduce runtime overhead, and no longer export `queueOperation` (which was not useable externally anyway).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62139993

fbshipit-source-id: ce75e530887da6290f26060ecfe36049cf81879a
2024-09-06 12:15:21 -07:00
Dmitry Rykun 1063de3c27 Instrumentation for SurfaceMountingManager (#46366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46366

This diff adds a Systrace section to the `SurfaceMountingManager::createViewUnsafe` method.
This will allow us to see more detail within the `MountItemDispatcher::mountViews preMountItems` that was previously almost blank.
Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D62247235

fbshipit-source-id: 3765c15e3e24e3231a30294938c725e82d100542
2024-09-06 11:05:15 -07:00
Pieter De Baets 0c90cfc7d4 Remove some Tasks overhead (#46348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46348

`continueWithTask` skips an extra invocation layer that `onSuccess` adds. Switch to Task<Void> as the task can already represent failure or success without needing a boolean.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D62213722

fbshipit-source-id: 631d741bd2ec4917eab69a20978ab2ace737c459
2024-09-06 10:32:47 -07:00
Alan Lee 3bd3d7687d handle InspectorPanel overlap with system bars (#46340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46340

**Issue:**
InspectorPanel is hidden behind 3 button nav bar on Android 15 forced edge-to-edge

**Solution:**
Apply SafeAreaView to avoid overlap with system bars
(CAUTION: SafeAreaView here is for internal RN Core usage only and should not be used elsewhere)

Changelog:
[Internal]

Reviewed By: cortinico, mdvacca

Differential Revision: D62225374

fbshipit-source-id: e762288386d4f1d210bd26b8f28e73c652c7ba4e
2024-09-06 09:39:01 -07:00
Alan Lee 206d0085f9 handle LogBox Notification overlap with nav bar (#46341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46341

Issue: LogBox Notification (or toast) is partly hidden behind 3 button nav bar on Android 15 targetSdk 35 build

Solution: surround with SafeAreaView to avoid overlap with system bars
(CAUTION: SafeAreaView here is for internal RN Core usage only and should not be used elsewhere)

Changelog:
[Internal]

Reviewed By: cortinico, mdvacca

Differential Revision: D62224584

fbshipit-source-id: 0662b1be9822bf51dadec2dd4879c915a47dfc65
2024-09-06 09:39:01 -07:00
Nicola Corti aca31eb610 Bump AGP to 8.6.0 (#46368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46368

This bumps AGP to the latest stable.
Release notes are here https://developer.android.com/build/releases/gradle-plugin

No relevant changes for React Native, other than the requirement on minimum Gradle version.

Changelog:
[Android] [Changed] - Bump AGP to 8.6.0

Reviewed By: tdn120

Differential Revision: D62296897

fbshipit-source-id: c34a18ab15dbacd6e5d69003b9e192d7f76d9f8f
2024-09-06 09:28:13 -07:00
Nicola Corti d0a5f8ff51 Gradle to 8.10 (#46369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46369

This bumps Gradle to the latest stable ahead of the 0.76 branch cut.

Changelog:
[Android] [Changed] - Gradle to 8.10

Reviewed By: tdn120, Abbondanzo

Differential Revision: D62296898

fbshipit-source-id: 59fc119dd6fad3b6b0ebbfcd8166da4cad9b8633
2024-09-06 09:28:13 -07:00
Pieter De Baets 31abc5d51b Simplify preMountItems frame time check (#46347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46347

Calculate a frame deadline, and compare the current time against that.

This will also allow us to make frame timing more dynamic in the future, based on the display's frame rate.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D62213710

fbshipit-source-id: 1c7fc4b67d08c1eda4f3b9612a4506b33c44f626
2024-09-06 09:19:01 -07:00
Richard Barnes 194b642633 Fix using namespace issues in xplat
Differential Revision: D62242159

fbshipit-source-id: b95e0ece2f55b3df3310ac84cde34d7f40b2706c
2024-09-06 09:06:49 -07:00
Dmitry Rykun 5e777848ed Cleanup the useDebouncedEffect experiment
Summary:
This diff cleans up the `use_debounced_effects_for_animated` experiment. It is not shipped because it breaks semantics of Animated.

It also removes the implementation of now unused `useDebouncedEffect` hook.

bypass-github-export-checks

Facebook
Details here https://fb.workplace.com/groups/3611662615830335/permalink/3666119690384627/

Changelog: [Internal]

Reviewed By: bvanderhoof

Differential Revision: D62188361

fbshipit-source-id: ce215cf7dd57e41e02c33760e91808d774bbd919
2024-09-06 05:27:01 -07:00
Samuel Susla 8ebddf3715 listen to onUserDrivenAnimationEnded in passive effects versions of useAnimatedPropsLifecycle (#46361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46361

changelog: [internal]

to support onScroll native animated event, subscribe to onUserDrivenAnimationEnded event in passive effects version of useAnimatedPropsLifecycle.

Reviewed By: javache

Differential Revision: D62236130

fbshipit-source-id: 850e6cb5544eb0377492fd030f735b159f24ab8d
2024-09-06 04:30:17 -07:00
Samuel Susla 4c55e94dc5 remove unnecessary useRef (#46351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46351

changelog: [internal]

useRef here is not needed, let's remove it.

Reviewed By: yungsters

Differential Revision: D62235850

fbshipit-source-id: 77d50152f5423e8806cc28c18bcaf4803076e813
2024-09-06 04:30:17 -07:00
Alan Lee 5fe7660439 Set inset based margins on LogBox (#46338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46338

**Issue:**
With forced edge-to-edge on Android 15, LogBox bottom tab bar is hidden behind 3 button nav bar and is unusable.

**Solution:**
LogBox is using Android Dialog so update it to set margins based on inset values. With this change we can get rid of android header logic from JS.

Changelog:
[Android][Changed] - Modify LogBox to be usable on Android 15

Reviewed By: mdvacca

Differential Revision: D62224124

fbshipit-source-id: 4721753bf340bd813bcd560052c52b63fa58ad4b
2024-09-05 17:23:14 -07:00
Alan Lee f7479e6a1c set inset based padding to RNTester (#46354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46354

**Issue:**
With forced edge-to-edge on Android 15, RNTester title at top overlaps with the status bar and bottom tab bar overlaps with bottom nav bar

**Solution:**
Add margins based on inset values to the ReactRootView which is the contentView for RNTesterActivity which acts as global padding within RNTester

Changelog:
[Android][Changed] - Adding padding for RNTester on Android 15 forced edge-to-edge

Reviewed By: mdvacca

Differential Revision: D62247910

fbshipit-source-id: 7b35d0c2016b6897b5de436a4245c9e910559541
2024-09-05 15:56:54 -07:00
Pieter De Baets 46fc9d9a2d Fix DispatchUIFrameCallback invoked multiple times per frame (#46346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46346

Noticed that we could sometimes have multiple instances of DispatchUIFrameCallback in a single frame, which would cause us to execute more view preallocations or other work scheduled by Fabric. Root cause for this is on the new architecture, onHostResume seems to be invoked multiple times.

Make this code more resilient by explicitly tracking the state of the frame callback and avoiding multiple subscriptions. Longer-term we should consider having ReactChoreographer support repeating FrameCallbacks, since most of them are.

Changelog: [Android][Fixed] Fixed multiple Fabric dispatch callbacks being executed in a single Android frame

Reviewed By: sammy-SC

Differential Revision: D62213721

fbshipit-source-id: ac6fa5483ea38d9a15824af233fd23f1f6f3c891
2024-09-05 10:28:09 -07:00
Vitali Zaidman b37101486b update babel and fix tests accordingly (#46295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46295

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

Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically):
### (D61336392) updated jest snapshot tests failing
### (D61336393) updated babel types and corrected typings accordingly
The latest babel 7 introduces the following features we need to adjust our types to:
* `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](https://github.com/babel/babel/pull/16421))
  * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense.
* Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](https://github.com/babel/babel/pull/15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings.
  * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later.

### Added a new metro ENV ignore
`BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK`
and then ignored in
`js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js`

Reviewed By: robhogan

Differential Revision: D61543660

fbshipit-source-id: abbcab72642cf6dc03eed5142eb78dbcc7f63a86
2024-09-05 07:11:17 -07:00
Pieter De Baets 3df0f3b9ff Skip transform invalidation if unchanged (#46345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46345

Deriving transforms can be expensive on Android. When using NativeAnimated with transforms, especially with an EventBasedDriver, we may update the transform every frame, even if it's unchanged. Ideally, we'd fix this in Animated, and diff the previous and next values, but this closes the gap somewhat in the short-term.

Both JavaOnlyArray and ReadableNativeArray implement equals, but will not compare equality correctly with each other. That's not an issue, as it just means we'll redo the transform once more than necessary.

Changelog: [Android][Fixed] Optimize BaseViewManager#setTransform to ignore duplicate values

Reviewed By: NickGerleman

Differential Revision: D62213726

fbshipit-source-id: 5df026030c66e31eb6a5fe6353de3706b5b7b799
2024-09-05 04:48:15 -07:00
Sam Zhou 2bdcbb1c6b Deploy 0.245.2 to xplat (#46343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46343

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D62226470

fbshipit-source-id: 58fb884fa9071cb3f6c5d4a046ce0a494297a495
2024-09-05 00:45:35 -07:00
Mohamed Alsadek f1031be3e2 Enable Multiple Sheet Presentation in React Native (#46333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46333

This pull request introduces enhancements to the view controller presentation logic in React Native, allowing for multiple sheets to be presented on top of each other. The current implementation restricts the presentation to a single view at a time, which limits the flexibility needed in complex applications.
The proposed changes modify the presentation behavior to always utilize the top-most view controller for presentations. This adjustment ensures that multiple sheets can be managed more effectively, without disrupting the existing application flow.
Key changes include:
Modification of the presentation logic to reference the top-most view controller.
Utilization of a recursive method to determine the top-most controller.
The changes have been thoroughly tested with both old and new interfaces and have shown to work seamlessly across different scenarios
Changelog: [Internal] Allow multiple sheets to be presented on top of each other

Reviewed By: jessebwr

Differential Revision: D62202475

fbshipit-source-id: daa0cf95edb23ea52a26441337f9a16f5475b211
2024-09-04 20:43:58 -07:00
Sam Zhou 62ee5c9b81 Replace final $ObjMap in react-native with mapped type (#46335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46335

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D62208265

fbshipit-source-id: f7c72f7239b49fbaee626c3572c116e26b698300
2024-09-04 18:33:20 -07:00
Sam Zhou 464a202ba6 Replace $ObjMap in EventEmitter with mapped type (#46332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46332

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D62199703

fbshipit-source-id: 24abf39b01d5ba8a90e03ce837a887d4b4f4ade8
2024-09-04 13:52:02 -07:00
Qi Zhao e8646630a4 fix broken test due to error message change (#46329)
Summary:
## Context
The error message in folly dynamic has been updated in D62136190. Updating related tests to reflect the change.

## Diff
Only test code is changed. No business logic change.

## Changelog:
[Internal] [Fixed] - Fix broken unit test due to folly error message change

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

```
Shows details about the selected run from the run history
Run result
java.lang.AssertionError: Test failure
Test Case RecoverableError
* Running RecoverableError.RunRethrowingAsRecoverableRecoverTest
* Running RecoverableError.RunRethrowingAsRecoverableFallthroughTest
2/2 tests passed.
Test Case JsArgumentHelpersTest
* Running JsArgumentHelpersTest.args
***** Failure in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact/tests/jsarg_helpers.cpp:108
Expected equality of these values:
  ex.what()
    Which is: "Error converting javascript arg 4 to C++: TypeError: expected dynamic type 'int/double/bool/string', but had type 'array'"
  std::string("Error converting javascript arg 4 to C++: " "TypeError: expected dynamic type `int/double/bool/string', but had type `array'")
    Which is: "Error converting javascript arg 4 to C++: TypeError: expected dynamic type `int/double/bool/string', but had type `array'"

0/1 tests passed.
Test Case JSBigFileString
```

Reviewed By: yfeldblum

Differential Revision: D62184078

fbshipit-source-id: 6ae0a33f58e0e10f14166084b80a997e59a008ec
2024-09-04 12:19:00 -07:00
Tim Yung 320963c7cb RN: Enable Hermes Parser in Default Metro Config (#46318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46318

Configures the Metro by default to use the Hermes parser so that React Native can fully leverage all modern Flow language syntax.

NOTE: This does not affect `*.ts` and `*.tsx` files which will continue to use Babel. Metro has logic to enforce this regardless of the transform options.

Changelog:
[General][Changed] - Changed Metro default config to use Hermes parser, enabling the use of advanced Flow syntax in React Native.

Reviewed By: robhogan

Differential Revision: D62161923

fbshipit-source-id: 0f4c069d429517be16abcc6a2187cd23c6bd52d4
2024-09-04 11:04:32 -07:00
Pieter De Baets b4b0c1d475 Avoid list allocation in scroll path (#46324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46324

For listener sets that change infrequently, `CopyOnWriteArrayList` is a better trade-off compared to copying the list to iterate on it, especially in perf-sensitive paths like scrolling. Using `WeakReference` is also significantly simpler than `Collections.newSetFromMap(WeakHashMap`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D62178024

fbshipit-source-id: bfc4f7389683b15be673dd7731094d52199d1c66
2024-09-04 10:51:48 -07:00
Sam Zhou eb02d5cb03 Deploy 0.245.1 to xplat (#46328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46328

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D62186461

fbshipit-source-id: 280794aac3b627af430fc132283b06d512c52f2d
2024-09-04 09:01:22 -07:00
Tim Yung dda3397545 Animated: Make NativeAnimatedHelper Private (#46311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46311

A straightforward move of `NativeAnimatedHelper` into the private directory, so that it does not impact our Public API.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62142349

fbshipit-source-id: c93979e26e290d13e2a19fbe40d8f460ebea15fd
2024-09-04 02:54:57 -07:00
Mohamed Alsadek dea5a6ca60 Enable Multiple Sheet Presentation in React Native (#46316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46316

This pull request introduces enhancements to the view controller presentation logic in React Native, allowing for multiple sheets to be presented on top of each other. The current implementation restricts the presentation to a single view at a time, which limits the flexibility needed in complex applications.

The proposed changes modify the presentation behavior to always utilize the top-most view controller for presentations. This adjustment ensures that multiple sheets can be managed more effectively, without disrupting the existing application flow.

Key changes include:
Modification of the presentation logic to reference the top-most view controller.
Utilization of a recursive method to determine the top-most controller.

The changes have been thoroughly tested with both old and new interfaces and have shown to work seamlessly across different scenarios

Changelog: [Internal] Allow multiple sheets to be presented on top of each other

Reviewed By: cipolleschi

Differential Revision: D62143463

fbshipit-source-id: 53667cf1a75e4514156780574bf604aee6b3fefc
2024-09-04 02:54:32 -07:00
Tim Yung 0a1ba02273 Animated: Remove Validation from Production Builds (#46287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46287

Changes `Animated` to avoid validating certain values in production builds to improve performance.

In order to maintain consistent behavior between development and production builds (so that we reduce the likelihood of bugs that only appear in one of the environments), this also changes the validation errors to use `console.error` instead of error throwing.

Changelog:
[General][Changed] - Changed `Animated` props validation to soft errors instead of thrown errors

Reviewed By: sammy-SC

Differential Revision: D62055674

fbshipit-source-id: 8e5732d00ab06e14ba8562f5190ce79ca240e374
2024-09-03 19:02:12 -07:00
Chiara Mooney c722ec7c37 Upstream Fixes from React Native Windows Platform (#46315)
Summary:
The following fixes were needed to restore a clean build of React Native Windows downstream.

- LayoutableShadowNode.cpp: Value must be cast to a float to avoid type conversion error.
- ValueUnit.h: Must add a default return statement. Switch statement alone produces compiler error that function may end with no return value.

## Changelog:

[GENERAL] [FIXED] - Upstream fixes for build errors in React Native Windows

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

Test Plan: React Native Windows CI runs clean.

Reviewed By: javache, alanleedev

Differential Revision: D62149228

Pulled By: realsoelynn

fbshipit-source-id: 0d85455a22fbc0066076a50adee6b2d4409cd628
2024-09-03 17:10:56 -07:00
Pieter De Baets db375ab449 Do not disable AllocInYoung for Hermes by default (#46314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46314

In Bridgeless's version of the Hermes JVM init path, we defaulted an internal GC option to allocate memory in Hermes' OldGen, and revert that behaviour once an internal API was called which marked the app as loaded.

This is an unsuitable default behaviour, since we can't rely on that internal API to be called on every launch. We're also moving to implicit performance instrumentation, which makes it harder to reliably call this API at the right time.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D61937427

fbshipit-source-id: 95e43fc093b56aee6362f43b6b0832d1f439fb3f
2024-09-03 16:01:30 -07:00
Pieter De Baets 83489de271 Fix perfetto integration iOS build (#46313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46313

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D61937428

fbshipit-source-id: cceaa7ffb2be3fbd80ce450f2e35ddbdddbd19cc
2024-09-03 16:01:30 -07:00
Tomasz Żelawski c16defaff2 fix(TypeScript): Allow readonly arrays in transform (#46310)
Summary:
Currently readonly arrays aren't allowed in components' style, but readonly objects are accepted. This becomes evident in such case:

```ts
import { View } from 'react-native';

interface AppProps {
  transform: readonly ({ translateX: number } | { translateY: number })[];
  shadowOffset: Readonly<{ width: number; height: number }>;
}

export default function App({ transform, shadowOffset }: AppProps) {
  return (
    <>
      {/* TypeScript error with transform */}
      <View style={{ transform }} />
      {/* No errors with shadowOffset */}
      <View style={{ shadowOffset }} />
    </>
  );
}
```

## Changelog:

[GENERAL] [FIXED] - Allow readonly array type for transform property

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

Test Plan:
`yarn test-typescript`

I added relevant tests cases.

Reviewed By: robhogan

Differential Revision: D62140462

Pulled By: NickGerleman

fbshipit-source-id: 87374b0901ebc40cab48d442b61fe7a65711bc89
2024-09-03 14:50:24 -07:00
Tim Yung 2b11131247 Animated: Cleanup Types in AnimatedTransform (#46285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46285

Cleans up the Flow types in `AnimatedTransform`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D62054390

fbshipit-source-id: de0f0b7b35f5b1e250ea72ec563b01cde1510a23
2024-09-03 11:53:39 -07:00
Samuel Susla b875b91b91 do not ignore events dispatched during view creation (#46308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46308

changelog: [internal]

If an event happens before view has event emitter, the event is stored in a [queue](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L1218) on [ViewState](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L1206). Once event emitter is assigned, the queue is drained.

However, if view dispatches event during view creation in preallocation, the event is dropped. This happens because when view is created, ViewState for the view is not created yet. The implementation of [createViewUnsafe](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L655) first creates a view (where view creation may trigger events) and only after it creates [ViewState and stores it inside of mTagToViewState](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L675-L680).

This diff fixes it by creating ViewState for a view before view creation.

Reviewed By: javache, rubennorte

Differential Revision: D62126909

fbshipit-source-id: bec53ea2f926a43a99dc005be257c5dc7985f373
2024-09-03 08:26:07 -07:00
Alex Hunt a1668e37e5 Remove experimental suffix from page titles (#46296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46296

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D62095278

fbshipit-source-id: 429236c1614d689f4d64a64f062393ad524484b1
2024-09-03 04:04:28 -07:00
Alan Lee 4ddb12c5e4 export SafeAreaView for limited RN core use (#46249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46249

Add internal only version of SafeAreaView.
This should be only used within RN Core or RNTester as there are a few places where this is needed and cannot have dependency on 3rd party

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D61896413

fbshipit-source-id: 03fc263a9341f9b93b696d88a77a6501cd490177
2024-09-02 17:20:33 -07:00
Alan Lee ade863a48c Add Android version of SafeAreaView (#46246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46246

Add Android implementation for 'SafeAreaView' (native implementation for [RCTSafeAreaViewNativeComponent](https://www.internalfb.com/code/fbsource/[cace8a68d2323612b199982f6784b32c9bd0ef21]/xplat/js/react-native-github/packages/react-native/src/private/specs/components/RCTSafeAreaViewNativeComponent.js)) which is intended to be used in RN core and RN Tester.

This is needed for forced edge-to-edge w/ targetSdk 35 in Android 15.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D61673059

fbshipit-source-id: ccc0866c30e1b6ef23756e2f2c216dfc6071a4c8
2024-09-02 15:44:55 -07:00
Edmond Chui 5bbf5a4878 default embedder script for open-source (#46302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46302

Changelog:
[General][Fixed] - Removed noisy ENOENT error message upon launching the debugger

As described in T200199544, Metro terminal in open-source would show an error message for the missing embedder script.

In this diff, we add a response of an empty file to open-source (no-op)

Reviewed By: hoxyq

Differential Revision: D62103015

fbshipit-source-id: 219bc398b7786527db00528cca175adc13a527a0
2024-09-02 10:33:57 -07:00
Alex Hunt 3350050edc Update debugger-frontend from d3a8d98...a556d26 (#46289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46289

Changelog: [Internal] - Update `react-native/debugger-frontend` from d3a8d98...a556d26

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

Reviewed By: EdmondChuiHW

Differential Revision: D62068339

fbshipit-source-id: 9e09c11df5d73be8e7e235f0556414e91f27a5e3
2024-09-02 02:53:53 -07:00
Nick Gerleman 305b4357eb Revert D61966685: Update InspectorFlags to use NDEBUG flag
Differential Revision:
D61966685

Original commit changeset: d30950172420

Original Phabricator Diff: D61966685

fbshipit-source-id: f6cd61d7260670e6438f78dfe6e1a32ef65fb0c1
2024-08-31 01:49:19 -07:00
Alex Hunt f00e8baff6 Update InspectorFlags to use NDEBUG flag (#46282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46282

We intended to enable Fusebox on `main` since https://github.com/facebook/react-native/pull/45469 — this worked when building under Buck, however was not working for builds under Xcode/Android Studio. This is because the `HERMES_ENABLE_DEBUGGER` preprocessor flag is not equivalently defined in these build configurations.

This diff genericises these checks to `!defined(NDEBUG)` (i.e. *any debug build*), meaning we are correctly able to evaluate the `ReactNativeFeatureFlags::fuseboxEnabledDebug()` setting.

Changelog: [Internal]

NOTE: `NDEBUG` should be the as-generic-as-possible choice to select a debug build in both OSS and fbsource. Having `HERMES_ENABLE_DEBUGGER` set remains significant (AFAIK) **within the Hermes codebase** (there are no other references in `jsinspector-modern`). Evaluation of whether the lack of this flag works in OSS continues in T200241280.

Reviewed By: hoxyq

Differential Revision: D61966685

fbshipit-source-id: d30950172420a0afd6c137dbf014794f3353bb7a
2024-08-30 15:50:07 -07:00
Tim Yung 4094ce0718 RN: Improve Error for Invalid processFilter Values (#46271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46271

Improves the error thrown when an invalid value is supplied to `processFilter`. Without this, the error thrown would look something like:

> TypeError: … is not iterable

Changelog:
[General][Changed] - Improved error message for invalid filter values

Reviewed By: jorge-cab

Differential Revision: D62011191

fbshipit-source-id: 5594eeaf2b9174af14cc9e4daa275ae72974e597
2024-08-30 15:50:00 -07:00
Jorge Cabiedes Acosta b25d6c8d1b Fix process functions not properly dealing with newlines (#46281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46281

In CSS newlines are considered equal to whitespaces which is why when receiving strings from RSD we could get \n characters which we were not handling

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D62034706

fbshipit-source-id: df2342b89156a131fecd0b0babeb478a6962b108
2024-08-30 15:12:46 -07:00
Jorge Cabiedes Acosta 6f88a608d2 Fix small border radius getting capped (#46251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46251

The diff D21124739 introduced this as a workaround for some faulty logic we used to have.

It seems like we no longer need it and it was actually causing issues with small border radii. Its barely noticeable but Outline looks weird in some cases if we leave it as is

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61938725

fbshipit-source-id: cf7ee7417e1085d01e2e307e780ff5d1db499e69
2024-08-30 13:15:35 -07:00
Tim Yung 56937d646c Animated: Generalize ReactElement Check in AnimatedObject (#46273)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46273

The implementation of `AnimatedObject` should recurse through its structure and consistently treat `ReactElement` objects as opaque.

It wasn't consistent. This makes it consistent.

Changelog:
[General][Fixed] - Fixed undefined behavior in certain scenarios when `ReactElement` objects are supplied to Animated components

Reviewed By: javache

Differential Revision: D62012006

fbshipit-source-id: e6c3ac472945af8070735f1df856ff88b30a5624
2024-08-30 11:17:04 -07:00
Sam Zhou 7d7f94cc98 Deploy 0.245.0 to xplat (#46272)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46272

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D62012136

fbshipit-source-id: ae94c6db62cdccec2ba3a175fb71464f16cbeb71
2024-08-30 09:14:54 -07:00
Vitali Zaidman 5cdfec9843 update metro version in react-native (#46264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46264

React-native was not in sync with metro changes that RN relies on

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61982240

fbshipit-source-id: 63b1f53174ab0ec663a537569a032c62c431eb83
2024-08-30 05:26:34 -07:00
Edmond Chui 2cfd082659 Update debugger-frontend from ae992da...d3a8d98 (#46265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46265

Changelog: [Internal] - Update `react-native/debugger-frontend` from ae992da...d3a8d98

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

Reviewed By: huntie

Differential Revision: D61976181

fbshipit-source-id: 2d9d723246c2c04eeb027ec44a48f9e6278d2fa5
2024-08-30 05:08:56 -07:00
Joe Vilches defb0bd137 Add more tests for border + child interaction (#46195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46195

go tests!

Testing
* Symmetrical, transparent border clips to padding box (wrong behavior atm)
* Asymmetrical, transparent border clips to padding box (wrong behavior atm)
* Children render over borders with no clipping (correct behavior atm)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61695025

fbshipit-source-id: 01eb69193df4f2d4c71dc7f9bf764a4554777c97
2024-08-30 02:00:19 -07:00
Joe Vilches 4f50aca247 Decouple clipping logic from border drawing (#46191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46191

Borders should not have to deal with clipping logic, that is fairly independent.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61418470

fbshipit-source-id: 762dbf30d50b5ce9b2b73720e58625447d8bf00e
2024-08-30 02:00:19 -07:00
Joe Vilches 7653f7600e Decouple background color from border drawing (#46190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46190

Right now the background color is tightly coupled with border drawing. For starters, I find this a bit confusing as one would not assume they are very closely related. But this also causes a bug around not being able to properly clip to the padding box, because if we did this we would clip the background color and transparent borders would look wrong.

This would also block a fix related to how borders display with clipped content that is coming in the later diffs. If we decide to use the border image, then we cannot properly display things like images since they would be on top of this image (otherwise background color shows through).

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61248625

fbshipit-source-id: ad398bbcfb69edc7d61362920773b51abea81d08
2024-08-30 02:00:19 -07:00
Joe Vilches 2176866eb5 Add children to separate _containerView, if needed (#46189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46189

A lot of the style decorators we have (filters, box shadows, borders, etc) use a separate sub-CALayer to accomplish what they want. This becomes an issue if we are clipping the content to the bounds and if these decorators extend beyond the bounds of the view as they are typically unaffected by this clipping. The main things here are `box-shadow` and `outline`. However, this implementation will let us fix some issues w.r.t content rendering under borders. See later diffs for that.

To fix this, if needed, we insert a `_containerView` to contain all of our subviews, and actually apply the clipping to. If this exists, our UIView will only have one subview, this one. But it may have multiple sublayers.

NOTE: This diff does not actually redirect the clipping. It just inserts the subview to test if this breaks anything in and of itself.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61414649

fbshipit-source-id: ddc2bfa47199909274c44da96a16e008290f9d2b
2024-08-30 02:00:19 -07:00
Rubén Norte d055efd4de Implement optimized event batching on Android (#46270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46270

Changelog: [internal]

When analyzing traces, I noticed that we were using the choreographer to batch events in the native layer on Android. This approach isn't very efficient for 2 reasons:
1. The choreographer runs in specific intervals and there could be some delay between receiving the events and dispatching them from the choreographer.
2. A slow mount operation in the choreographer after receiving the event would completely block the dispatch for the whole duration of the operation. This could take as long as 100s of ms, so it can be very significant.

This is especially relevant with layout events, which are dispatched using the same mechanism as input events. In this case, there are instances where we delay rendering in JS because we're doing an expensive mount in the UI thread.

It makes sense to batch events in native so we don't do unnecessary work in JS to process them, but there's a better mechanism to do this. Instead of posting a frame callback in the choreographer, we can batch events using a new task in an Android handler running on the UI thread. This would run immediately after the job where the events are dispatched, after all the events are dispatched.

This implements that mechanism behind a feature flag.

Reviewed By: sammy-SC

Differential Revision: D62004018

fbshipit-source-id: d8b78a75cf05d0d8c9dd867a82a776f8d293a683
2024-08-29 20:57:25 -07:00
Rubén Norte 0eec866059 Improve naming of methods in FabricEventDispatcher (#46269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46269

Changelog: [internal]

I'm planning some changes to this class and it was kinda hard for me to understand what some of these methods were meant to do. Doing a small refactor to rename them with more meaningful names.

Reviewed By: sammy-SC

Differential Revision: D62004020

fbshipit-source-id: 1e28e7e80f12a3a56ff16ace8794887b2f46495c
2024-08-29 20:57:25 -07:00
Rubén Norte dbe2b38172 Remove unnecessary null check from FabricEventDispatcher (#46268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46268

Changelog: [internal]

`mReactEventEmitter` is final and initialized with a non-null value in the constructor, so this check is redundant.

Reviewed By: sammy-SC

Differential Revision: D62004021

fbshipit-source-id: bb8719c286cd04005370f2cdef89928c0d01007a
2024-08-29 20:57:25 -07:00
Nick Gerleman a2d53d5ea0 Support simple opacity in nested text (#46267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46267

We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas.

This does not support propagating to views, and contrary to the iOS example added which originated with legacy arch, does not correctly support nesting opacity. This is a limitation of new arch more generally, where an AttributedString fragment only contains inner-most opacity.

Bg and foreground are drawn separately with alpha as well, instead of rendering overlapping content offscreen to properly apply it (this is an issue on RN Android more generally, and existing color alpha support, but is pretty noticeable here).

This impl targets new arch only.

Changelog:
[Android][Added] - Support simple opacity in nested text

Reviewed By: alanleedev

Differential Revision: D61999163

fbshipit-source-id: adb99834e94e00cb84a98d56f422c15b1bd849db
2024-08-29 20:43:30 -07:00
Jorge Cabiedes Acosta acbde249b7 Revert D61726506 (#46266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46266

This diff reverts D61726506
T200279372

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61986793

fbshipit-source-id: bbf462b79192b67801a6cf56727f8f43ade8fd56
2024-08-29 20:34:19 -07:00
Rubén Norte 4351247654 Lift Web Performance tracks in Perfetto to the top of the custom tracks list (#46263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46263

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D61980863

fbshipit-source-id: 400a615e32e056f40302ceb0d0d6423198bec52a
2024-08-29 16:16:03 -07:00
Blake Friedman 9f3fe8178f Add missing commander dependency (#46242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46242

This is transitively included, but should be explicitly included.

Changelog:
[Internal] commander is a dependency when bundling from Xcode

Reviewed By: cipolleschi

Differential Revision: D61916607

fbshipit-source-id: 1466d38d959970e5bd56576f8a7a22697d2eec4e
2024-08-29 16:09:33 -07:00
Rubén Norte 610212d6f4 Fix incorrect timing for events that do not update the UI (#46253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46253

Changelog: [internal]

This is still internal because this API hasn't been publicly released yet.

## Context

This fixes a problem in our implementation for Event Timing API with paint time reporting (currently gated behind `ReactNativeFeatureFlags::enableReportEventPaintTime`) where events that don't trigger UI changes would wait for the next (unrelated) UI change to finish the event timing information.

## Implementation

We had this issue because we were relying on mount hooks to finish pending events. The problem is that if the event itself didn't cause a commit, the mount hook will not execute immediately, and we'll wait for the mount notification of whatever is the next change (in an arbitrary point in time in the future).

The fix for this has several parts:
1. Modify `RuntimeScheduler` to start tracking which surface IDs are the rendering updates applying to. It makes sense to do this regardless because `RuntimeScheduler` implements the Event Loop, and the Event Loop is aware of "documents" on Web (and the equivalent are surfaces in RN).
2. Create a new hook in `RuntimeScheduler` to report events after the task has finished executing (which is already a step in the Event Loop on Web). This will pass the list of surface IDs with pending changes, so the listener can determine if the events should be finished already or they should wait for mount for those changes.
3. Integrate `EventPerformanceLogger` with `RuntimeScheduler` and add the proper logic to handle this.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939260

fbshipit-source-id: 505bd41db8d3f62e5065424e62f9ed540832eed9
2024-08-29 12:28:15 -07:00
Rubén Norte c6aa9f4feb Add surfaceId to EventTarget (#46254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46254

Changelog: [internal]

Right now it's very hard to access the surface ID from the target when dispatching events, and we need that to determine if the event we dispatched produced any updates its surface ID.

This adds surfaceId to EventTarget so we can access it without an unnecessary large amount of indirection in the current code.

This is a dependency for https://github.com/facebook/react-native/pull/46253 / D61939260, split to simplify reviewing.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939910

fbshipit-source-id: 6dd6bc55fc6d4aa6cf8a535080c14a7a5b573b71
2024-08-29 12:28:15 -07:00
Rubén Norte a0909efbec Move reporting of long tasks to before updating rendering (#46252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46252

Changelog: [internal]

The long task API should only account for work specifically done by the task. Updating the rendering shouldn't be considered for that, so this moves the determination of long tasks before doing that work.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939261

fbshipit-source-id: 6d2573d561d507dff60b9703e4cc90ce4d131960
2024-08-29 12:28:15 -07:00
Andrew Knapp 8501b6396b Fix GH-41226 by suppressing path adjustment when not actually drawing a border (#46239)
Summary:
When not drawing a border, the mGapBetweenPaths adjustment can create noticable pixelation when drawing curves through a low number of pixels.  This is noticable mostly on buttons and such on low-dpi devices.  This fix only applies the fix if clipping for the border radius is done.

When drawing small radius rounded backgrounds (e.g. to draw a circle or button) we see visible pixelation (see [GH-41226](https://github.com/facebook/react-native/issues/41226)) This is particularly noticable on low DPI devices.

## Changelog:

[ANDROID] [FIXED] - Don't use mGapBetweenPaths if not drawing a border

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

Test Plan:
Built an android app that directly uses CSSBackgroundDrawable to draw a background and verified repro of this issue.
![pre-fix](https://github.com/user-attachments/assets/e56a41b1-60f6-4953-9e91-b95a3380f2d7)
Then modified the code according to this PR and verified that anti-aliasing is appropriately applied
![fix](https://github.com/user-attachments/assets/b6b1aecf-a713-4e0a-9759-82c2dd862991)

Reviewed By: NickGerleman

Differential Revision: D61925281

Pulled By: jorge-cab

fbshipit-source-id: 93014629d031bd0d716cd3bb11e2c294dedad639
2024-08-29 11:21:21 -07:00
Thomas Nardone 48c4380a9b ReactImageView - fix double imageSource check (#46248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46248

Only null check and grab the url once.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D61934974

fbshipit-source-id: 2214a79b34ecc9182e88551a7b04b58d371e5e7d
2024-08-29 11:12:08 -07:00
Eli White 84ec424e8a Remove superflous {type:string} from CodegenSchema (#46237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46237

I can't find any uses of this, it's not referenced in any fixtures, and flow and typescript both pass without it.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61892355

fbshipit-source-id: 8ebb4da3e104109c740d90c2495dbcc89d3978e5
2024-08-29 10:51:31 -07:00
Eli White a5363113f1 Fix NativeModuleEnumMembers type (#46222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46222

This value was typed as always being a string, even though it  was containing both strings and numbers in the fixtures. This was because on this line https://fburl.com/code/9j7gh4av the input type is $FlowFixMe (from the source AST), which wasn't catching that it couldn't flow into just `string`.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61830075

fbshipit-source-id: 0d5a0239d7c0209049184ca858a7ceb1ada02f79
2024-08-29 10:51:31 -07:00
Eli White 0b56ccab2a Array's with unparsable element type's are explicitly Any vs missing (#46221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46221

Previously the schema special cased unparseable elementType with elementType just being undefined. This causes issues for logic that requires recursively matching types. Instead of being implicit, this makes them explicitly an AnyTypeAnnotation

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61825742

fbshipit-source-id: 47bf70d32d21647896d8f5319087378cc8ac8d4f
2024-08-29 10:51:31 -07:00
Blake Friedman 0f66a696b4 rebuild autolinking cache if empty or invalid (#46241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46241

Our test for rebuilding the `autolinking.json` file currently rebuilds everytime if the cached json file ISN'T empty.  This means users who have an empty entry get stuck there.

I've also added more validation that the contents of the cached config have at a minimum the `.project.android.packageName` entry in it, otherwise it rebuilds.

Changelog: [Internal]

Closes 46134

Reviewed By: cortinico

Differential Revision: D61911114

fbshipit-source-id: 188c7f975ce05802c8ea06eaa48345c2bc96f2b2
2024-08-29 10:11:09 -07:00
Alan Lee 1333e0ee6a update compileSdk to 35 (#46235)
Summary:
X-link: https://github.com/facebook/yoga/pull/1692

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

Update compileSdk to 35 before adding relating work for Android 15

Changelog:
[Android][Added] - Update compileSdk to 35

Reviewed By: cortinico

Differential Revision: D61874541

fbshipit-source-id: f7c92dc15aa68a53bcd626450c515d2f24e9e40f
2024-08-29 09:17:42 -07:00
Edmond Chui 8b2ccea243 Update debugger-frontend from 7f6cfe3...32358bd (#46256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46256

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7f6cfe3...32358bd

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/7f6cfe3c847411c3e4a730384d00536f049edc16...32358bd2899e7fdc86703d969fcba08fb6d04562).

Reviewed By: hoxyq

Differential Revision: D61955962

fbshipit-source-id: 4b5d9fb1034b69deeaf386e23a96890d0adea77a
2024-08-29 04:07:11 -07:00
Alan Lee 768415dd62 Refactoring: extract helper functions from StatusBarModule (#46224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46224

- Extract functions from StatusBarModule so they can be reused
- WindowUtil was created as a container for the extracted Window related helper functions

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D61834841

fbshipit-source-id: a40f6b95ab7569bbe7680b5ca314eb0844114d1d
2024-08-29 01:53:56 -07:00
Jorge Cabiedes Acosta 6fa54f9b5d Remove experimental_ prefix from boxShadow and filter (#46245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46245

As title

Changelog: [General] [Changed] - Add official `boxShadow` and `filter` CSS properties

Reviewed By: cipolleschi

Differential Revision: D61726506

fbshipit-source-id: 8ee7a95d95a66f1f890a5ebb6791da73219b2c52
2024-08-28 23:03:41 -07:00
Alan Lee 9cd6f3ea31 fix prettier error in CI (#46255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46255

Trying to fix lint error in GH likely happening after this [commit](https://github.com/facebook/react-native/commit/7bc9244d0cbebc310116b6b2a2baf0781073d0f5) (D60533197).

used ` yarn run format-check --write` to get changes need to fix the error when running prettier v29

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D61951889

fbshipit-source-id: 891b6b90e854504a35452e546c81bca644661dde
2024-08-28 19:35:46 -07:00
Nishan 20e3f4518f fix: Linear gradient border styles with BackgroundStyleApplicator (#46084)
Summary:
Fix linear gradient borders with BackgroundStyleApplicator.

### After fix
<img width="200" alt="Screenshot 2024-08-18 at 3 44 56 PM" src="https://github.com/user-attachments/assets/79ae7c9c-3b64-43e0-bbbe-ddc930c73648">

## Changelog:

[ANDROID] [FIXED] - Linear gradient border styles

<!-- 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/46084

Test Plan: Test border examples in LinearGradientExample.js

Reviewed By: rshest

Differential Revision: D61798132

Pulled By: NickGerleman

fbshipit-source-id: a8cf1d84166044e09fb573995cac3d3f31c2187b
2024-08-28 17:25:15 -07:00
David Prevost 7bc9244d0c Upgrade pretty-format to v29 (#45732)
Summary:
As described in [this issue](https://github.com/facebook/react-native/issues/45726), we had a problem where, at runtime, version v29 instead of v26 was used, so upgrading it is the fastest fix.

## Changelog:

[GENERAL] [CHANGED] - Upgrade pretty-format to 29.7.0

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

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

Test Plan:
I use console log in the RN tester app
![image](https://github.com/user-attachments/assets/3e3ab0d1-e32b-4b73-8f00-cbd8f040c5aa)

Reviewed By: blakef

Differential Revision: D60533197

Pulled By: tdn120

fbshipit-source-id: b83dbfe463971abbf00cfebdcc9e5dd6975de0d8
2024-08-28 13:12:43 -07:00
Jorge Cabiedes Acosta 8618eecde6 Make Filters implicitly set overflow hidden (#46145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46145

Filters clip children by default due to using `RenderEffect` we are keeping this behavior but we were clipping to the border box while Web clips to padding box.

To keep the clipping consistent we are enforcing `Overflow.HIDDEN` when a view contains a filter.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61630698

fbshipit-source-id: dcc3fd680546793096d8996f405724df0a834079
2024-08-28 11:58:42 -07:00
Alex Hunt 3077db32ef Update references to debugger frontend (#46232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46232

Follows D61711818.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61852414

fbshipit-source-id: a2d7f135a3ff03751c6d91978bebee007272f306
2024-08-28 03:20:17 -07:00
Alex Hunt c2d73269b3 Rename Dev Menu debugger item (#46182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46182

Renames the "Open Debugger" menu item as "Open DevTools".

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61711818

fbshipit-source-id: 3867582f889c1b8c4242af1b63168c76d58df589
2024-08-28 03:20:17 -07:00
Alex Hunt 94e7a87f23 Remove --experimental-debugger option (#46231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46231

Removes this option from `npx react-native start`. Flipper will no longer be the default launch flow in 0.76.

The debugger frontend variant remains controlled by `target.reactNative.capabilities?.prefersFuseboxFrontend`. This will always be Fusebox, since D60893243.

Changelog:
[General][Changed] Remove `--experimental-debugger` option from start command

Reviewed By: robhogan

Differential Revision: D61852415

fbshipit-source-id: 3351f0e12c24717916a70dd1ea28f8690bb5509f
2024-08-28 03:20:17 -07:00
Rubén Norte cf356bd19b Remove legacy integration of createPerformanceLogger with Systrace (#46236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46236

Changelog: [internal]

Reviewed By: bgirard

Differential Revision: D61885705

fbshipit-source-id: c84889d3b1a2c9544b393a2cbb04ee3b38522993
2024-08-27 19:15:38 -07:00
Rubén Norte 54ce662803 Create feature flag to fix incorrect "MountingCoordinator::hasPendingTransactions" on Android due to push model (#46223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46223

Changelog: [internal]

This introduces a new feature flag to fix some problems with `IntersectionObserver` on Android.

## Context

Our current implementation works as follows:
1. When observing a new target, we synchronously check if there are pending transactions in the mounting layer for that surface.
    a) If there are, then we don't dispatch an initial notification for the current state of that target and we wait for those transactions to the applied. When they are, mount hooks are executed and the notifications are dispatched.
    b) If there aren't, then we cannot rely on receiving a notification via mount hooks, so we dispatch the notification immediately.

This works well to ensure that when observing a target that was just mounted by React we'll receive a notification with the paint time for that target.

The problem we currently have on Android is that that platform uses a "push" model for the mounting layer, which means we consume transactions immediately after commit. Because of that, when we check whether there are pending transactions, the mounting layer would report "no" but the consumed transactions haven't actually been mounted. In that case, we dispatch the notification immediately.

The result of that behavior is that we don't wait for the transactions that will paint a new target and instead report its intersection immediately, providing incorrect data about when it was first mounted.

## Changes

The way the new feature flag fixes the problem is by adding a new parameter in `MountingCoordinator::pullTransaction` to tell the coordinator that it should continue reporting pending transactions if there were any when that was called. We also add a new method to clear pending transactions when we execute mount hooks for that surface.

Reviewed By: javache

Differential Revision: D61831209

fbshipit-source-id: ed6e5a3d27bd3e802c79a203e920d247b1715c61
2024-08-27 15:23:39 -07:00
Joe Vilches b01da5e53d Get filter/boxShadow to show up with CoreFeatures::enablePropIteratorSetter (#46234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46234

We were seeing some cases of these not working and that was because CoreFeatures::enablePropIteratorSetter was set to true and we need to add this line for it to parse with that

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61861547

fbshipit-source-id: 47356671dc61e99ffa3df9834eb5856f29b07c59
2024-08-27 12:56:13 -07:00
Nick Gerleman 03801f275e Move experimental_boxShadow and experimental_backgroundImage to BaseViewConfig
Summary:
RN Android has historically delegated any responsibilities for background and border rendering to individual view managers.

When we enforced that SVCs didn't allow more properties than native view configs, it meant that unlike for iOS, we needed to structure these SVCs to only apply to single view managers, to avoid warnings.

This creates issues for third-party view managers extending ReactViewGroupManager, which don't seem to get these attributes added to their SVCs under current setup. RNSVG also uses `codegenNativeComponent` on TS `ViewProps`, but for historically reasons around hiding props from the new arch, that does not include these props (and would not have a way to associate with the right process function if it did).

After we clean up an old experiment path (waiting a little bit longer for safety), BaseViewManager on Android will be able to influence rendering, and we can put these in BaseViewManager (see D61658737).

In the meantime, D60575253 allows us to make SVCs a superset of native view config, which means we can declare this for `BaseViewConfig`, before Java view managers catch up, without creating warnings.

Changelog:
[Android][Changed] - Move `experimental_boxShadow` and `experimental_backgroundImage` to BaseViewConfig

Reviewed By: RSNara

Differential Revision: D61744706

fbshipit-source-id: dcf3511ee6f826ef260f557703c182b361b7a2d7
2024-08-27 11:17:30 -07:00
Ruslan Lesiutin f80e6c12b0 Back out "Introduce NativeDebuggerSessionObserver module" (#46042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46042

# Changelog: [Internal]

Original commit changeset: dd095954529f

Original Phabricator Diff: D59975264

Reviewed By: robhogan

Differential Revision: D61325016

fbshipit-source-id: 99d98b95dd2133516cba4c8e13f2528bedc04a14
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin 6d524451a6 use DebuggerSessionObserver in LogBox (#46045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46045

# Changelog: [Internal]

Use newly added global instead of TurboModule

Reviewed By: robhogan

Differential Revision: D61301332

fbshipit-source-id: 4d7299aeb08dcafce2190c35adc56daaa8e29e0e
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin 2e545b10f5 DebuggerSessionObserver: JavaScript API (#46043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46043

# Changelog: [Internal]

Defined JavaScript interface, which can be used by other modules, such as LogBox, which will be migrated in the next diff

Reviewed By: robhogan

Differential Revision: D61301333

fbshipit-source-id: 63bb8581b893d0fdcb36e1fa16d243f1a5b08ac4
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin dd26c3c1d4 DebuggerSessionObserver: define global from C++ (#46044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46044

# Changelog: [Internal]

Migrating from using TurboModule in favour of scheduling JavaScript tasks and using jsi.

See [this doc](https://docs.google.com/document/d/1i8Jp8AGPrqAVqqSVVqHNb5GeM_NMcsbAzzdOfMX_KZY/edit?usp=sharing) and this post(https://fb.workplace.com/groups/615693552291894/permalink/1790063878188183/) for more context.

Reviewed By: robhogan

Differential Revision: D61301334

fbshipit-source-id: 3489026ce7e3d789c552a52be5c8fe3ec82d1438
2024-08-27 11:02:15 -07:00
shubhamguptadream11 6365df54db fix(android): resolve crash by handling colour resource IDs with "android" package name fallback (#46202)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/29763

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [ADDED] - Added a conditional check in the `resolveThemeAttribute` function to reattempt resource resolution with the "android" package name if the resource ID is 0.

**Reason why app is getting crashes?**

The crash was occurring due to an issue with resolving certain color attributes in the Android theme. Specifically, when attempting to resolve attributes like textColorPrimary, the getIdentifier method returned a resource ID of 0, indicating that the resource could not be found. This issue resulted in the resolveThemeAttribute function failing, as it attempted to resolve a non-existent resource ID, which led to a crash.

**Key Points:**

**Problem**: Resource ID returned as 0 for specific attributes like textColorPrimary.
**Cause**: The resource ID of 0 indicates that the attribute was not found in the app's resources.
**Impact**: The resolveThemeAttribute function attempted to resolve an invalid resource ID, leading to crash because of this line: https://github.com/facebook/react-native/blob/6cfe51ded006e55617a6f4f2587ca2026306c58d/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.java#L227

The introduced fix includes a fallback mechanism to attempt resolution with the "android" package name when the initial lookup returns 0. This helps in correctly resolving theme attributes that might be part of the Android system's default resources, thereby preventing the crash.

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

Test Plan: - Tested the app with above colors mentioned. Ensured that app is not getting crashed.

Reviewed By: cipolleschi

Differential Revision: D61847357

Pulled By: cortinico

fbshipit-source-id: 50895a8fd7956e001dbbad9a505ae65151209bd9
2024-08-27 09:35:27 -07:00
Szymon Rybczak 396bdd87d8 fix: ensure --build-output destination exists (#45182)
Summary:
Replicates https://github.com/react-native-community/cli/commit/48d4c29bba4e8b16cbc8307bd1b4c5349f3651d8, which landed inside `cli-plugin-metro` inside RNC CLI, but because of migration of code to `community-cli-plugin` it looks like apparently the fix wasn't replicated.

## Changelog:

[GENERAL] [FIXED] - Ensure `--build-output` destination exists

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

Test Plan:
Specify a new directory that doesn't exists inside `--build-output`:

`npx react-native bundle --build-output dist/new-dir/index.bundle`

and this command shouldn't fail.

Reviewed By: christophpurrer

Differential Revision: D61850942

Pulled By: huntie

fbshipit-source-id: 90e57f19c661ace8206162d6fa2e6a27acb31e20
2024-08-27 09:04:14 -07:00
Edmond Chui 3a77e6e275 Update debugger-frontend from c98a122...7f6cfe3 (#46233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46233

Changelog: [Internal] - Update `react-native/debugger-frontend` from c98a122...7f6cfe3

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

Reviewed By: huntie

Differential Revision: D61851264

fbshipit-source-id: bcb29b5e44e273862a318f281c1dfa05f86642a4
2024-08-27 08:29:36 -07:00
Oskar Kwaśniewski 0cb97f0261 feat: build codegen on postinstall (#46227)
Summary:
This PR solves a small issue I've encountered when working with the repo.

When changing branches we often run `yarn` to reinstall dependencies (let's say we change from 0.74-stable to main).

There are lots of changes between those two versions in the `react-native-codegen` package. This causes an issue when we install pods in `packages/rn-tester` the old version of codegen is used (the one cached from 0.74-stable) leading to a big error that's hard to solve at first.

This PR solves this by building codegen on `postinstall`. I've seen many newcomers blocked by this issue (and rerunning `yarn` is the natural thing to do in this situation)

## Changelog:

[INTERNAL] [ADDED] - Build codegen on postinstall when working with the monorepo

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

Test Plan: Run `yarn`

Reviewed By: cipolleschi

Differential Revision: D61849150

Pulled By: huntie

fbshipit-source-id: 24fc5cf9b6a2510298f7bcdce59043e5dcfbfdd4
2024-08-27 08:28:35 -07:00
Dmitry Rykun 46d17efa62 Start looking for codegen-enabled dependencies from the project root (#46229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46229

When running codegen from `pod install`, something affects `require.resolve`, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here https://github.com/facebook/react-native/issues/46196

This diff is supposed to fix this by adding the project root path to the `require.resolve` call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Reviewed By: cipolleschi

Differential Revision: D61850219

fbshipit-source-id: d60a0e72e9c60e862c0d64e227ea3652d1be5a90
2024-08-27 07:58:39 -07:00
Alex Hunt 773fc8d0f1 Remove useFuseboxInternalBranding experiment (#46230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46230

Follows https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/101.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D61850578

fbshipit-source-id: 9283e74dd5fddac001f9748115dc8e85b8d0d491
2024-08-27 07:10:02 -07:00
Dawid 3596019489 Fix handling 'auto' checks in absolute layout (#46216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46216

Regarding [issue](https://github.com/facebook/react-native/issues/45817) with incorrect layout when `left` is set to `auto`. This PR introduces handling `auto` whenever inline or flex position is checked to be defined and it fixes above issue.

Changelog:
[General][Fixed] - Fix handling 'auto' checks in absolute layout

## Tests:
 I have run the provided unit tests and everything passes.

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

Reviewed By: cipolleschi

Differential Revision: D61737876

Pulled By: NickGerleman

fbshipit-source-id: 531199a91c5e122b930b49725ea567cbb1d592ce
2024-08-27 06:00:34 -07:00
Nick Gerleman b96238db11 Remove FakeYogaNode and FakeYogaConfig (#46215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46215

These cause a build error in RN and need to be updated any time a thick Yoga API changes. This change replaces them with mocking the factories with Mockito instead.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61804855

fbshipit-source-id: 24fbf10a12102de2975ba3aee45efe7350e294ec
2024-08-27 06:00:34 -07:00
shubhamguptadream11 8c81ffa60a fix(android): make getUri and isResource available for override (#46152)
Summary:
Fixes following issues:
- https://github.com/facebook/react-native/issues/46150
- https://github.com/facebook/react-native/issues/46155

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [FIXED] - Make getUri and isResource open

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

Reviewed By: NickGerleman, rshest, blakef

Differential Revision: D61845164

Pulled By: cortinico

fbshipit-source-id: 88ccdad92423b5add9b2fad4c98f296b6cbfb27d
2024-08-27 05:00:36 -07:00
Oskar Kwaśniewski b10ed0e19d feat(iOS): dynamically resolve react native path in Hermes podspec (#46181)
Summary:
This PR modifies hermes-engine.podspec to resolve the path to `react-native` dynamically.

In OOT platforms case we often have slightly different versioning, let's say `react-native` is at 0.75.1 and `react-native-visionos` is at 0.75.2. This causes an issue while resolving the prebuilt version of Hermes. We should always get the Hermes tied to the `react-native` package version, not the OOT platform.

## Changelog:

[IOS] [FIXED] - Resolve Hermes prebuilt version based on react-native packge

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

Test Plan: Install pods

Reviewed By: blakef

Differential Revision: D61720652

Pulled By: cipolleschi

fbshipit-source-id: a99c3261ae8738979f30e831ac6cb494a5c06e31
2024-08-27 03:44:08 -07:00
Eli White 851037d144 Dedupe trivial types between modules and components (#46220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46220

We'll want to eventually combine the module and component capabilities more, but these are at least the trivially shared ones.

More work is required to merge the more complex object types.

This change also makes it more clear where capabilities are different between native modules and components

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61740140

fbshipit-source-id: 9e7bf740cf6cd2431be8cad822ec69903dbbc71f
2024-08-26 17:34:40 -07:00
Rubén Norte 74c9ef8fde Remove incorrect state update during unmount in Modal (#46218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46218

Changelog: [internal]

https://github.com/facebook/react-native/pull/42975  added some logic to fix modal on iOS for Paper but introduced a state update in `componentWillUnmount`. Doing this is incorrect and we've seen cases where it leads to forcing passive effects synchronously, which can affect performance.

This removes that unnecessary call to update the state, because the component will be unmounted anyway.

Reviewed By: bgirard

Differential Revision: D61813988

fbshipit-source-id: bb203578376d86a907544fa62a0d04e93ca132ef
2024-08-26 15:54:18 -07:00
Samuel Susla d0f48c87bc reduce noisy systrace sections (#46185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46185

changelog: [internal]

this is not needed anymore. let's remove it.

Reviewed By: dmytrorykun

Differential Revision: D61717151

fbshipit-source-id: 46f616e8170e653f0203c16ec76cfcfa948be153
2024-08-26 15:52:22 -07:00
meetdhanani17 2a230694c4 fix font weight not update for mutate state (#45932)
Summary:
flattenStyle may return an object which is already frozen (in development), so it is incorrect to further mutate this.
related to https://github.com/facebook/react-native/issues/45285

## Changelog:

[GENERAL] [FIXED] - fixed fontWeight number value error for text optimized

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

Reviewed By: NickGerleman

Differential Revision: D61773721

Pulled By: javache

fbshipit-source-id: c5e23becf3af0b4303dda7b9d48628b2bca3285a
2024-08-26 13:53:21 -07:00
Nick Gerleman 1ffe74a5dc Add trace markers to ReactTextView (#46214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46214

This tries to represent a few operations which have previously been observed to be costly in a sampling profiler (showing more granularity than the trace events):
1. TextView getting measurements via `onMeasure()` when updating layout metrics during mount, which may [trigger UI-thread text layout](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/widget/TextView.java;l=11217).

2. Text drawing, which may do layout as well

3. State updates, where we construct a new Spannable and set content to it

Changelog: [Internal]

Reviewed By: tdn120, mdvacca

Differential Revision: D61705770

fbshipit-source-id: 199a6c65c18296f2ff948642701a331ba656e9d9
2024-08-26 12:28:20 -07:00
Tim Yung b86e8ef95f Appearance: Lazily Initialize NativeAppearance (#46123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46123

Optimizes initialization performance by changing `Appearance` to lazily import `NativeAppearance` and setup its listeners.

Changelog:
[General][Changed] - Improve `Appearance` performance overhead by lazily initializing the NativeModule

Reviewed By: rickhanlonii

Differential Revision: D61578726

fbshipit-source-id: 13fe6de7b5c3b52b8f4c54dd567bbe146379cf0f
2024-08-26 11:16:54 -07:00
Pieter De Baets fdb77ae924 Reset animatedView when detaching AnimatedProps (#46205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46205

When React.Activity unmounts and remounts effects, we fail to re-attach the native view to the NativeAnimated nodes, which causes animations to stop working.

Changelog: [Internal]

Reviewed By: sammy-SC, bvanderhoof

Differential Revision: D61662164

fbshipit-source-id: 8e86502f7258beba02d5e60b31864974d7288af5
2024-08-26 09:38:00 -07:00
Ingrid Wang b6fc75a121 Remove check for deprecated isIgnoringInteractionEvents for hotkeys (#46178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46178

Changelog:

[iOS][Internal] Remove deprecated API isIgnoringInteractionEvents

Reviewed By: christophpurrer

Differential Revision: D61678577

fbshipit-source-id: fc57f108c7ea242da784f1ab0cd131fb84fc25d1
2024-08-26 09:04:35 -07:00
Shawn Dempsey 6cfe51ded0 Border Radius percentage should be disabled on Paper (#46179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46179

Changelog: [Internal]

**Context**

- When debugging E2E tests, we found RNTester Legacy Arch builds were rendering border radius w/ percentages in a strange way
- The issues was only noticeable on production e2e builds
- Support for percentage on borderRadius ViewStyle props was added in D56198302
- This should be fabric only, but the same props are parsed on Paper

**Change**

- Add Custom Conversion for BorderRadius on Paper
- Only Parse integer border radius values

Reviewed By: philIip

Differential Revision: D61686841

fbshipit-source-id: cc24d3dbdb82b1dcb90f18fc44d5d13d3e6465b4
2024-08-23 19:42:29 -07:00
Riley Berton 09e88448ce Fix undefined behavior in MethodInvoker (#46188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46188

UBSAN identified undefined behavior when argCount == 0 (defining a variable array of zero length).

Plus variable arrays in C++ are a clang extension.

[ChangeLog]: [General] [Fixed] - Undefined behavior fix in MethodInvoker

Reviewed By: nlutsenko

Differential Revision: D61725776

fbshipit-source-id: 3729080eae8e78b65a558305f68782ae99edbc0a
2024-08-23 15:34:16 -07:00
Jorge Cabiedes Acosta 8d3c4fb475 Fix border radius on Paper (#46187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46187

For some reason tests didn't catch border radius change breaking border radius on paper. This fixes the issue

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61724240

fbshipit-source-id: 9a44dd55d352f956cb6f8d233d1deef428099c57
2024-08-23 11:43:23 -07:00
Jorge Cabiedes Acosta baae360272 Fix dropShadow not creating stacking context (#46143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46143

Before `drop-shadow` was not creating a stacking context causing its children to get flattened and not receive the shadow effect.

This was due to incorrect parsing on C++. We didn't notice since we don't support `drop-shadow` on iOS and Android gets the parsed prop directly

Changelog: [Internal]

Reviewed By: NickGerleman, joevilches

Differential Revision: D61617699

fbshipit-source-id: a8bfbb0043fcd2b2867923eb937a6be8e9004f13
2024-08-23 11:43:21 -07:00
shubhamguptadream11 fe941a8f4c feat(iOS): line break mode prop iOS updates to consume new cpp functions (#46129)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/44107

## Changelog:

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

Pick one each for the category and type tags:

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

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

[IOS] [ADDED] - Line break mode for TextInput components. **This includes  iOS updates to consume new cpp functions.**

This PR is a breakdown of [this](https://github.com/facebook/react-native/pull/45968) PR.

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

Test Plan: - Tested builds in new and old architecture mode.

Reviewed By: andrewdacenko

Differential Revision: D61656969

Pulled By: cipolleschi

fbshipit-source-id: 4c6ed983ad15841ce52443bba13962d45c04e756
2024-08-23 11:13:33 -07:00
shubhamguptadream11 6cab6c2a13 feat(iOS): line break mode cpp changes and new functions (#46130)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/44107

## Changelog:

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

Pick one each for the category and type tags:

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

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [ADDED] - Line break mode for TextInput components. **This includes cpp changes and new functions.**

This PR is a breakdown of [this](https://github.com/facebook/react-native/pull/45968) PR.

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

Test Plan: - Tested builds in new and old architecture mode.

Reviewed By: andrewdacenko

Differential Revision: D61656894

Pulled By: cipolleschi

fbshipit-source-id: 9a25387cb27cded072e76575e6d2fca01963c621
2024-08-23 11:13:33 -07:00
Blake Friedman b22970e3cf autolinked package scripts use absolute path (#46186)
Summary:
A previous attempt at fixing this issue used a relative path (https://github.com/facebook/react-native/issues/45208), this doesn't work if the user runs bundle install outside of the `ios/`
folder, using the `--project-directory=ios` argument.

## Changelog:
[iOS][Fixed] support bundle install from outside the ios folder using --project-directory

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

Test Plan:
Ran the command in a project with `react-native-firebase/app` using the
`--project-directory`, confirmed that it's fixed when using the absolute
path.

closes: reactwg/react-native-releases#341

Reviewed By: cipolleschi

Differential Revision: D61719821

Pulled By: blakef

fbshipit-source-id: d83429dd29c9e8cc066ab9843ad95fdfc0af8dea
2024-08-23 09:56:09 -07:00
Kacper Rozniata d7a3e48032 feat(iOS): add support for missing text content types (#42788)
Summary:
This PR adds few missing text content types on iOS (available from iOS 15)

- dateTime
- flightNumber
- shipmentTrackingNumber

## Changelog:

[IOS] [ADDED] - Add support for missing text content types

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

Test Plan: Make sure that `RNTester` builds and runs successfully

Reviewed By: robhogan

Differential Revision: D61656748

Pulled By: cipolleschi

fbshipit-source-id: e960eded5f049d3c4bf76a5a4e3159b240546288
2024-08-23 09:19:41 -07:00
Jan Kassens 17613fcac3 remove unused method nativeFabricUIManager.cloneNode
Summary:
I couldn't find a reference nor a reason for this method. It's a bit hard to grep, so let me know if I missed something.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D61558809

fbshipit-source-id: d977440ff98b2a5bf115d19bfa4acbcf6d216b2a
2024-08-23 09:15:53 -07:00
zhongwuzw 6b104bbe01 Fixes race condition when setup image loader (#46153)
Summary:
Fixes https://github.com/facebook/react-native/issues/46115 .

## Changelog:

[IOS] [FIXED] - Fixes race condition when setup image loader

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

Test Plan: crash in https://github.com/facebook/react-native/issues/46115

Reviewed By: cipolleschi

Differential Revision: D61662905

Pulled By: andrewdacenko

fbshipit-source-id: 22bc45b473c7c8e1c811e41f5030220ca7988e1f
2024-08-23 08:08:58 -07:00
Deepanshu.shukla a8be335a37 fix (iOS): refresh control not behaving correctly if it is offscreen (#45996)
Summary:
FIXES https://github.com/facebook/react-native/issues/45858

When working with UIRefreshControl in a custom React Native component, we encountered a problem where the refresh control did not behave correctly if it was offscreen. Specifically, attempts to programmatically begin or end refreshing were ignored if the control was not visible. This typically manifested as the refresh control not updating its state properly when it was re-rendered or moved in the view hierarchy.
Happening only on old-arch.

**Problem Details**
**Offscreen Refresh Control Ignored:** The UIRefreshControl would ignore calls to beginRefreshing and endRefreshing if it was not currently visible on the screen.
**Inconsistent State:** The internal state _currentRefreshingState might not match the actual state of the UIRefreshControl, leading to unexpected behavior.

**Steps to Fix**
**Track Visibility with didMoveToWindow:**

Implement the didMoveToWindow method to track when the refresh control is added to or removed from the window.
Use a flag _hasMovedToWindow to keep track of this state.
And check this flag should be true whenever we start or end refreshing

## Changelog:

[IOS] [FIXED] - Fixed an issue where the refresh control would not behave correctly if it was offscreen.

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

Test Plan:
Issue Screen recording

https://github.com/user-attachments/assets/73b45c27-19c2-4eeb-991e-33b45f0a6d97

Fix Screen Recording :

https://github.com/user-attachments/assets/ffc6b6e6-fc68-498c-abdf-3144c31caa86

Reviewed By: realsoelynn

Differential Revision: D61657472

Pulled By: cipolleschi

fbshipit-source-id: 7a369f8e3ca902536a7608fbe1b89cec7734c418
2024-08-23 04:50:46 -07:00
Jorge Cabiedes Acosta 4075418c14 Add support for assymetrical border radii when using % (#46009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46009

as title

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61148739

fbshipit-source-id: 7cc37f98ab441df2e0df7cfa0415791cb642caaf
2024-08-22 21:03:28 -07:00
Samuel Susla 858ad5e9c9 move enableLayoutAnimationsOnIOS feature flag to common infra (#46174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46174

changelog: [internal]

LayoutAnimation on iOS should be shipped everywhere except FBiOS.

Reviewed By: javache

Differential Revision: D61656839

fbshipit-source-id: b3903491cbdea81dd4424a69e58976ab470b33e2
2024-08-22 17:57:10 -07:00
Pieter De Baets 75114e3672 Fix ModalHostView's inner view not having the correct reactTag (#46176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46176

Noticed that ModalHostView's event dispatching would sometimes fallback to RCTEventEmitter, which is not supported in the new architecture. Instead, we should propagate the reactTag to the inner content view so we can correctly associate the right UIManager and host component with events emitted.

Changelog: [Android][Fixed] PointerEvents from Modal would not be dispatched correctly in new architecture.

Reviewed By: bvanderhoof

Differential Revision: D61671005

fbshipit-source-id: 6aad1ff609da81cf5e8f71c4e91be30713494679
2024-08-22 15:16:24 -07:00
Tzvetan Mikov bb3c51dc84 RN: don't check for or add zero terminator to bundle (#45966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45966

JSI performs the check itself, no need to do it here. Plus, bytecode
bundles must not be zero terminated.

## Changelog:

[IOS] [FIXED] - Fixes NSDataBigString length calculation

Reviewed By: realsoelynn

Differential Revision: D61058869

fbshipit-source-id: 15b99ef13f9aebd11ff410d02c21db8e46cc6ac3
2024-08-22 12:49:50 -07:00
Rubén Norte 1f755defdc Improve handling of disconnected nodes in IntersectionObserver (#46156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46156

Changelog: [internal]

This improves the handling of disconnected nodes in `IntersectionObserver`. Specifically:
* When observing a node, if the node is disconnected (unmounted) this is just a no-op (without logging errors). We can't observe an unmounted node.
* When disconnecting the observer, if the observed nodes are disconnected, we get the target shadow node from an internal map, which we always have access to if we successfully started observing the node. If this logs an error now, it's something to look into but it won't generally log it if the target is just disconnected. That will work correctly.

Reviewed By: bvanderhoof

Differential Revision: D61656597

fbshipit-source-id: 6a39c878acc976ddc0789260106da104a3f2a57f
2024-08-22 12:23:37 -07:00
Rubén Norte 5fc2bd4f60 Improve handling of disconnected nodes in MutationObserver (#46157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46157

Changelog: [internal]

This improves the handling of disconnected nodes in `MutationObserver`. Specifically:
* When observing a node, if the node is disconnected (unmounted) this is just a no-op (without logging errors). We can't observe an unmounted node.
* When disconnecting the observer, if the observed nodes are disconnected, we get the target shadow node from an internal map, which we always have access to if we successfully started observing the node. If this logs an error now, it's something to look into but it won't generally log it if the target is just disconnected. That will work correctly.

Reviewed By: bvanderhoof

Differential Revision: D61655856

fbshipit-source-id: d18a885350ef000fc563c85f6775ba864d184ad1
2024-08-22 12:23:37 -07:00
Joe Vilches 5bb4ef5dec Fix issue where filter layer was not the same shape as the underlying layer (#46138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46138

jorge-cab noticed that filters on iOS do not fit the shape of the layer if we have rounded corners. Fix is pretty straight forward.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61612655

fbshipit-source-id: 91785ed10a039e031c5440bde131c1583ba3992a
2024-08-22 12:12:46 -07:00
Jakub Piasecki 9bfbf948df Add line offset for baseline alignment of text attachments (#46172)
Summary:
In https://github.com/facebook/react-native/pull/45102 I've implemented a baseline alignment function for the new architecture. I've noticed one thing I've missed previously - `locationForGlyphAtIndex` is [relative to the line fragment](https://developer.apple.com/documentation/appkit/nslayoutmanager/1403239-locationforglyphatindex), not the container. This means that the attachments would be put in the wrong place in multiline text.

This PR fixes that by adding the position of the entire line to the attachment position.

## Changelog:

[IOS] [FIXED] - Fixed baseline attachment position in multiline text

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

Test Plan:
Checked on relevant example of RNTester.

|Before|After|
|-|-|
|<img width="546" alt="Screenshot 2024-08-22 at 15 53 14" src="https://github.com/user-attachments/assets/c1861655-9253-44fd-9f2f-796aff83df1e">|<img width="546" alt="Screenshot 2024-08-22 at 15 52 37" src="https://github.com/user-attachments/assets/27f07bc7-a8f6-4696-a414-815e7ece642c">|

Reviewed By: andrewdacenko

Differential Revision: D61662006

Pulled By: cipolleschi

fbshipit-source-id: 5eafdae1800c06d9fc61bfac99584e6e25a05c24
2024-08-22 10:41:01 -07:00
Phillip Pan 42dcfdd2cd avoid default when switching on UnitType (#46146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46146

Changelog: [Internal]

`unit` is of type `UnitType`, so there's no reason to have a default case here.

i found this because my build failed when pulling in this dependency, there was a compiler flag that enforced that all cases must be enumerated. this seems like the right practice anyways.

Reviewed By: NickGerleman

Differential Revision: D61635463

fbshipit-source-id: b84b5518f2a17e792309f85ae91514a17abad295
2024-08-22 00:14:38 -07:00
Nick Gerleman 524a3f0476 Try fixing bundling outside the repo (#46148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46148

Try fixing the import path (not sure if access from external modules is allowed though).

Changelog: [Internal]

Reviewed By: realsoelynn

Differential Revision: D61643115

fbshipit-source-id: a840ee375430b0e20050a36b695a5a4c93c29258
2024-08-21 23:19:56 -07:00
Thomas Nardone 81a41ec976 Clean up ReactViewGroup child listeners (#46139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46139

Potential fix for IndexOutOfBounds crashes in clipping rect logic.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D61615009

fbshipit-source-id: 1208e11286ad2a84c22262462832a66396a1b35b
2024-08-21 15:43:34 -07:00
David Vacca 5f7538cfdd Add default value for newArchitectureEnabled param (#46140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46140

Add default value for newArchitectureEnabled param

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D61621224

fbshipit-source-id: 728c91f9ce10ad5872f86cd223ea30c8f9bde413
2024-08-21 15:38:23 -07:00
Andrei Marchenko 954e294183 perf(virtualized-lists) removing rerender cells for every change of Virtualized list (#46103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46103

Reducing the boundary of rerender of virtual lists. Previously with prop: "strictMode={true}" the VirtualizedList still re rendered each CellRenderer component. Because method getDerivedStateFromProps generated every time a new uniq state and the cells didn’t have a PureComponent. It helps to improve react performance for lists which have 5+ elements.

I reused recomended approach from react doc https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization

changelog: [internal]
Optimizing CellRenderer of VirtualizedList

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D61493434

fbshipit-source-id: 917a33e48bd2f18e8ac150e5701d2e7c45dbe879
2024-08-21 14:23:07 -07:00
zhongwuzw 9239ad1c6b Clean up RCTParagraphComponentView & RCTParagraphTextView (#46125)
Summary:
Clean up some dead code after some refactoring of RCTParagraphComponentView.  cc cipolleschi

## Changelog:

[IOS] [FIXED] - Clean up RCTParagraphComponentView & RCTParagraphTextView

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

Test Plan: CI green.

Reviewed By: christophpurrer

Differential Revision: D61603193

Pulled By: cipolleschi

fbshipit-source-id: a357e8c5355707b2296462de513010acda4ee6ea
2024-08-21 12:19:33 -07:00
Soe Lynn b93c2b2412 Bump React Native CI to min iOS 15.1 (#46135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46135

Changelog:
[iOS] - Bump iOS min version for CI

Reviewed By: cipolleschi

Differential Revision: D61604034

fbshipit-source-id: 5d2b0001b6437e62c64d821e36a4183096e8ef74
2024-08-21 12:11:58 -07:00
Soe Lynn d11c99922c Bump React Native OSS build infra to min iOS 15.1 (#46137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46137

Changelog:
[iOS] - Bump OSS Build infra to min iOS 15.1

Reference: https://github.com/react-native-community/discussions-and-proposals/discussions/812

Reviewed By: christophpurrer

Differential Revision: D61577939

fbshipit-source-id: 8f2929af266f61aedd55358b13d08544fd79e434
2024-08-21 12:11:58 -07:00
Soe Lynn e1a1cdacf2 Update RNTester and HelloWorld to min iOS 15.1 (#46136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46136

Changelog:
[iOS] - Update RNTester and HelloWorld template app to `min iOS 15.1`

Reviewed By: philIip, blakef

Differential Revision: D61604036

fbshipit-source-id: 9260b9b51a9c976792fd9d705b9b6a35a88a7f86
2024-08-21 12:11:58 -07:00
Krystof Woldrich 774fe0cf6f fix(react-native-xcode): Use CONFIG_CMD if set (#46112)
Summary:
In the recent 0.75 release I've noticed new `CONFIG_CMD` option in `react-native-xcode.sh`. But this option was not used. Insted when set `CONFIG_APP` was used.

This seems like a bug. As the usage before this PR would be as follow:

```bash
export CONFIG_CMD=true
export CONFIG_APP="/path/to/node /path/to/node_modules/react-native/cli.js config"
```

After this PR

```
export CONFIG_CMD="/path/to/node /path/to/node_modules/react-native/cli.js config"
```

This PR also removed unused explicite `--config-cmd "$CONFIG"` flag, as this is always overwriten by the code above, by default to `--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config`.

## 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] - Use CONFIG_CMD if set

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

Test Plan: I've set `CONFIG_CMD` and run Xcode Release build to check that the set command is executed.

Reviewed By: christophpurrer

Differential Revision: D61545010

Pulled By: blakef

fbshipit-source-id: ebbf8ebc08404bc6816277518a3b86c6f7e41e6e
2024-08-21 08:16:37 -07:00
Riccardo Cipolleschi 9c16fb3394 Fetch Github tags in the publish-release job (#46131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46131

React native 0.75.0, 0.75.1 and 0.75.2 has been published to NPM without the latest tag, despite the tag being on the commit.

When debugging why that's happened, I realized that we were not downloading the tags when checking out the repo.

This change fixes that.

{F1816667285}

## Changelog:
[Internal] - Publish React native as latest when the latest tag is specified on git

Reviewed By: cortinico

Differential Revision: D61593398

fbshipit-source-id: 96bf8346207f0bd0b01f60ee09879210d12d30af
2024-08-21 07:46:13 -07:00
Alex Hunt 516428771d Disable native source code fetching in jsinspector-modern targets (#46132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46132

Temporaily disable the `nativeSourceCodeFetching` capability — which reverts this to the legacy handling in the Inspector Proxy.

This is because we've noticed performance issues when loading large bundle source maps, particularly on Android, with a nontrivial path to optimising this ([raising the frontend `IO.read` size](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/97) further is leading to WebSocket disconnections on Android 😐).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61543480

fbshipit-source-id: ee66b4cebd40f8cc6466270c5875df744d2b588a
2024-08-21 07:02:42 -07:00
Samuel Susla a462dfd6ce delete change_order_of_mounting_instructions optimisation (#46113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46113

changelog: [internal]

This showed promised in local tracing but that failed to translate to real perf improvement. Unshipping.

Reviewed By: christophpurrer

Differential Revision: D61537744

fbshipit-source-id: 03a2a69a6fed32a6b493bc17372e3783b9db2d1e
2024-08-21 06:04:57 -07:00
Tim Yung 8f0f50f7a1 Appearance: Cache colorScheme in JavaScript (#46122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46122

Implements a JavaScript cache for `colorScheme` in the `Appearance` module, so that we avoid potentially expensive and unnecessary native property accesses.

Changelog:
[General][Changed] - Improved `Appearance.getColorScheme` performance

Reviewed By: rickhanlonii

Differential Revision: D61567880

fbshipit-source-id: ca316946d68114b05239daa17105c85e637efe07
2024-08-21 01:48:58 -07:00
Tim Yung ed3ca0730c Appearance: Dedupe colorScheme Validation Logic (#46120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46120

Currently, the implementation of `Appearance` duplicates the validation logic of string `colorScheme` values multiple times.

This leads to more complicated code and also unnecessary work in certain edge cases (e.g. when `NativeAppearance` is not registered).

This refactors `Appearance` to be simpler and to do less work. I've also configured `NativeAppearance.setColorScheme` to be non-nullable because it has existed since 2023.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567881

fbshipit-source-id: 61cb51709dc716ad97ae1397105414e74fe57a28
2024-08-21 01:48:58 -07:00
Tim Yung 693a575143 Appearance: Manage Native Listener Count (Android) (#46121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46121

Updates `Appearance` on Android to supply the native module to `NativeEventEmitter` so that the native listener count can be managed like it is on iOS.

This was previously required by macOS and iOS. Android and Windows also already implement:

```
interface NativeModule {
  addListener(eventType: string): void;
  removeListeners(count: number): void;
}
```

So we should start passing `NativeAppearance` into the `NativeEventEmitter` constructor across all platforms.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567883

fbshipit-source-id: 1b3b76de9be3f35cacba1acbc43f6dcc0b41fde5
2024-08-21 01:48:58 -07:00
Tim Yung a7fbe8117f Appearance: Migrate to ESM Named Exports (#46119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46119

Straightforward migration of the `Appearance` module to use ESM named exports.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567882

fbshipit-source-id: a4a5a9771de001bd41cb0e23ba066f150267a55d
2024-08-21 01:48:58 -07:00
Nick Gerleman 387560a9af Make StaticViewConfigValidator permissive of extra attributes on SVC compared to native viewconfig (#45859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45859

"Fabric without SVCs" configuration is nearly gone, and so it doesn't make sense to need to add no-op methods, on normally Paper only code, etc to satisfy native viewconfig. These particular warnings are then more often noise, than things we need to action on.

Checking for native code to be present can also break development where users are using distributed native app, slightly older than JS.

This keeps the warning, only if static viewconfigs are missing native view config attributes (i.e. new prop would only be exposed to Paper, instead of only exposed to Fabric)

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D60575253

fbshipit-source-id: 1c118274b92eb7922c0dd92df060b24e44fceb3d
2024-08-20 18:58:07 -07:00
Ramanpreet Nara a949e0d751 Report early js exceptions on the js thread (#46116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46116

If your app raises an early js exception, and you cold start it, often you'll see this error:

```
SurfaceRegistryBinding::startSurface failed. Global was not installed.
```

{F1807125099}

The reason why is because two different threads race to redbox:
* The nativemodule thread: the early js error (reported [here](https://fburl.com/code/vcrqzsdp))
* The javascript thread: the SurfaceRegistryBinding error (a subsequent native -> js call)

After this diff, the early js error will **not jump onto the nativemodule thread** to report this error.

This ensures that we "always" (to the best of my knowledge) see the early js error first.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D61339213

fbshipit-source-id: f1b9ab30150b87377817c2fd93ca349c406db48b
2024-08-20 17:50:55 -07:00
Nick Gerleman ee597bfe2b Breaking: Always use AttributedStringBox instead of AttributedString in TextLayoutManager (#46104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46104

We want to use `PrecomputedText` to store glyph-level measurements on underlying Android Spannable. This means we need to consistently reuse the same Spannable, instead of recreating them on measurement.

We have an opaque cache ID used by Android, for spannables originating from uncontrolled TextInput on UI-thread side. We also have `AttributedStringBox`, for a kind of similar purpose on iOS, which allows passing opaque pointer to the `TextLayoutManager`. This is only used for the `measure` function.

This change makes us consistently use `AttributedStringBox` at the TextLayoutManager boundary, to let us migrate calls across TextLayoutManager to all pass opaque handle to underlying Spannable we will store, instead of passing the AttributedString each time. For now, every place previously passing an AttributedString value still passes one.

There were also some egregious cases of accepting very large structures by value, causing unneeded copies. I changed the APIs to accept anything potentially larger than two pointers to pass by reference instead.

This change is technically breaking, to any 3p code calling into TextLayoutManager (IIRC live-markdown exposed prefabs for this, but should be able to adapt fairly easily).

Changelog:
[General][Breaking] - Always use AttributedStringBox instead of AttributedString in TextLayoutManager

Reviewed By: joevilches

Differential Revision: D61484999

fbshipit-source-id: 07c5600cd917f2dab3d24559a25f27e0872ebddc
2024-08-20 17:27:51 -07:00
Nick Gerleman 3cd6d18aa8 Increase Example List Density (#46080)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46080

1. Force the examples to be alphabetized, where the hand-maintained list has some examples that are not
2. Remove reundant/not useful UI

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61430910

fbshipit-source-id: 1f3e116fe81502faa7a72f2720912e26c9f04bb2
2024-08-20 16:48:38 -07:00
Nick Gerleman d713349b0c Replace "elevation" in RNTester rows with box-shadow (#46076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46076

This will add the shadows to iOS as well. let's see if anyone notices 🙂. I also removed dead styles, and removed some of the extra (excessive) padding specific to Android where the previous shadows would overlap.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D61421903

fbshipit-source-id: 887fa5aa96e3b0b4f81114ee814897c218db2b76
2024-08-20 16:48:38 -07:00
generatedunixname89002005232357 2bbe8f44c6 Revert D61298649 (#46118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46118

Changelog: [Internal]

Reviewed By: cyan33

Differential Revision: D61550740

fbshipit-source-id: 8c201b8f79416dec13ece9c671405af7b2de9c8c
2024-08-20 15:10:29 -07:00
Benoit Girard 5561457c98 Limit HermesPerfetto tracing to the top 25 and bottom 25 frames, allowing you to see both sides (#46117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46117

Currently in large cursive blocks like layout effect we can't tell what the slow leaf function is. With this fixed I'm able to root cause more complex issues in layout effects.

Reviewed By: NickGerleman

Differential Revision: D61486415

fbshipit-source-id: 5a4043b35eedcabcbea86953aac2173f66d7257b
2024-08-20 13:25:45 -07:00
Alan Lee 67b4a5a2d1 Introduce extension function for PixelUtil (#46072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46072

Introducing extension fuctions in PixelUtils to replace Java static methods so Kotlin code can be more readable.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61372704

fbshipit-source-id: 489a74d60cd1463f0b1fad6f7c33925cec4000d2
2024-08-20 12:18:38 -07:00
shubhamguptadream11 f6b6d001a0 fix(android): status bar black strip fixed (#46086)
Summary:
Fixes these issues:
- https://github.com/facebook/react-native/issues/46070
- https://github.com/facebook/react-native/issues/39362

## Changelog:

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

Pick one each for the category and type tags:

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

[ANDROID] [FIXED] - Fixed black strip coming when hiding status bar

`setHidden` function is responsible for hiding status bar

https://github.com/facebook/react-native/blob/25d6a152cc720e0d5f860dab228ac2e43321d9e4/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt#L122

**What real issue is?** **_For android devices with camera area on top a black strip is coming after hidding status bar._**

Previous Implementation:
```
  override fun setHidden(hidden: Boolean) {
    val activity = currentActivity
    if (activity == null) {
      Log.w(
          ReactConstants.TAG,
          "StatusBarModule: Ignored status bar change, current activity is null.")
      return
    }
    UiThreadUtil.runOnUiThread(
        Runnable {
          val window = activity.window ?: return@Runnable
          if (hidden) {
            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
          } else {
            window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
          }
        })
  }
```
It seems that FLAG_FULLSCREEN flag are not enough to draw content in camera area.

**Solution:**
In order to tackle this, android exposes 2 flags:
- [layoutInDisplayCutOutMode](https://developer.android.com/reference/android/view/WindowManager.LayoutParams#layoutInDisplayCutoutMode):  The window is always allowed to extend into the [DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout) areas on the short edges of the screen. [Android 9.0 and above]
- [setDecorFitsSystemWindows](https://developer.android.com/reference/android/view/Window#setDecorFitsSystemWindows(boolean)):  allows content to be able to extend into the cutout area. [Android 10.0 and above]

By adding this flag we are now able to hide status bar properly.
```
  override fun setHidden(hidden: Boolean) {
    val activity = currentActivity
    if (activity == null) {
      FLog.w(
          ReactConstants.TAG,
          "StatusBarModule: Ignored status bar change, current activity is null.")
      return
    }
    UiThreadUtil.runOnUiThread(
        Runnable {
          val window = activity.window ?: return@Runnable
          if (hidden) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
              // Ensure the content extends into the cutout area
              window.attributes.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
              window.setDecorFitsSystemWindows(false)
            }
            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
          } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
              window.attributes.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT
              window.setDecorFitsSystemWindows(true)
            }
            window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
          }
        })
  }
```

**_Note: This will work above Android 11 and above_**

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

Test Plan:
- Tested by author of this issue
- Sharing here the videos of before and after fix

Device Detail:
Oneplus9 5G OS 11
**Before fix:**
https://github.com/user-attachments/assets/589098ff-a3fa-4962-a15b-ceacbfd03d2d

**After fix:**
https://github.com/user-attachments/assets/a87dd8e4-3624-4e09-99da-a14f9e19fcc6

Reviewed By: cipolleschi

Differential Revision: D61509889

Pulled By: alanleedev

fbshipit-source-id: 733962a3bed2efba71588a4d2fdf7c9c386bc3b4
2024-08-20 11:38:23 -07:00
David Vacca ed1410136f Remove overriding thread priority for RN Main Thread (#46101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46101

Remove overriding thread priority for RN Main Thread as it is not possible to update main thread.

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D61448536

fbshipit-source-id: 44ec28a875e3208df042ac11bdd17a7287836ebb
2024-08-20 11:22:45 -07:00
David Vacca dee503812a Fix MessageQueueThreadImpl warnings (#46108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46108

Fix MessageQueueThreadImpl warnings

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60855886

fbshipit-source-id: d26a994ea7c4a100ba001862a4947417c1e0479d
2024-08-20 11:22:45 -07:00
zhongwuzw efa9711e35 Fixes Appearance user interface style when app run from background (#46021)
Summary:
Fixes https://github.com/facebook/react-native/issues/46015.

## Changelog:

[IOS] [FIXED] - Fixes Appearance user interface style when app run from background

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46015.

Reviewed By: christophpurrer

Differential Revision: D61536857

Pulled By: cipolleschi

fbshipit-source-id: ee06cb25b5fc4fa72d646efe212738e54b9ef858
2024-08-20 10:44:41 -07:00
Zhi Zhou 52888c0c1e fix: iOS crash occurring when navigating to a new app screen with a displaying modal (#45313)
Summary:
Our app is using the react-native v0.74.2 with the `react-navigation` lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with the `react-navigation`'s `reset` or `replace` method and meanwhile there's a react native modal displaying, then the iOS app always crashes.

I saw there is already a relevant [PR](https://github.com/facebook/react-native/pull/38491) and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native.

## Changelog:

[IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal

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

Test Plan: More issue details and the reproduction steps can be found in this [PR](https://github.com/facebook/react-native/pull/38491) :)

Reviewed By: christophpurrer

Differential Revision: D61537167

Pulled By: cipolleschi

fbshipit-source-id: 3c0474d794b4216ebc073dd6558d2b6ae27492d2
2024-08-20 10:04:47 -07:00
Ingrid Wang 4fb518bbe9 Migrate off of iOS 13 deprecated API statusBarFrame (#46105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46105

Changelog:

[iOS][Internal] Migrate from UIApplication.statusBarFrame to UIStatusBarManager.statusBarFrame

Reviewed By: cipolleschi

Differential Revision: D61499532

fbshipit-source-id: 1fe10600fcbaf54280b6d630cb92383b9cf091a3
2024-08-20 09:59:51 -07:00
Nicola Corti f4a979580d Set REACTNATIVE_MERGED_SO for React Native 0.76 (#46114)
Summary:
Setting a variable called `REACTNATIVE_MERGED_SO` so libraries/apps can selectively decide to depend on either libreactnative.so or link against a old prefab target (this is needed for React Native 0.76 on).

## Changelog:

[INTERNAL] - Set REACTNATIVE_MERGED_SO for React Native 0.76

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

Test Plan: CI

Reviewed By: hezi

Differential Revision: D61541372

Pulled By: cortinico

fbshipit-source-id: b16fa29ce6dd1670b452848e37cfcd7be15861e6
2024-08-20 08:49:54 -07:00
Blake Friedman 0bb085c7b6 Summary: Add changelog for 0.75.2 (#46111)
Summary:
## Summary:
Add changelog for 0.75.2

## Changelog:
[Internal] - Add changelog

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

Reviewed By: cipolleschi

Differential Revision: D61538106

Pulled By: blakef

fbshipit-source-id: 45c4ee97d294a11f04852936e44f25d05030182e
2024-08-20 06:51:37 -07:00
Riccardo Cipolleschi 31cbc77f52 Add internal end to end tests for text and background color with border width (#46068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46068

This change adds some internal E2E tests to verify that the text is rendered properly on top of a solid background color when borderWidth is set

## Changelog
[Internal] - Add E2E tests

Reviewed By: cortinico

Differential Revision: D61392253

fbshipit-source-id: 76e11821eba96ac75b055c5fe94365197c0f9be2
2024-08-20 04:38:45 -07:00
Riccardo Cipolleschi f4609dbb5f Move RCTParagraphTextView drawing to contentView (#46081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46081

This change fixes an issue that has been reported by OSS where a Text with both background color and borderWidth is not rendered properly.

The reason is that `RCTParagraphComponentView` uses the `drawRect` method which draws the text in the main view layer, while the parent `RCTViewComponentView` can apply an extraLayer on top of the base layer, drawing on top of the text.

This change moves the drawing of the text to an auxiliary view, `RCTParagraphTextView`, that is set as contentView of the `RCTParagraphView`. In this way, the text is drawn in a different view and can't be covered by the `_borderLayer`

## Changelog:
[Internal] - Introduce a RCTParagraphTextView to draw the text

Reviewed By: joevilches

Differential Revision: D61431369

fbshipit-source-id: 05467167186411fe42312f2ed956f5b5336de019
2024-08-20 04:38:45 -07:00
Riccardo Cipolleschi 0f4a405f28 Add Text example with BG and borderWidth
Summary:
This diff adds an example in RNTester to verify that we can draw text on top of a colored background and non uniform border radius.

As you can see from the test plan, the current code works well when:
* There is only the background color
* There is a background color and uniform cornerRadius
* There are non uniform border radius but the background is transparent.

The current code **does not** work when:
* there is a background and non-uniform border radius
* there is a background, uniform border radius and borderwidth

The reason why this happens is because:
* `RCTParagraphComponentView` draws the text in the View's main layer in the `drawRect` method
* `RCTViewComponentView` has a method `invalidateLayer` that, when there are non-uniform border radii o there is a borderWidth, it creates an extra `CALayer` with an image as content and that layer is put on top of the base layer, covering the text.

## Changelog
[Internal] - Add example to RNTester

Reviewed By: cortinico

Differential Revision: D61389317

fbshipit-source-id: 3e0a9e6c611190f90198a1b0b5855431b9f6ed12
2024-08-20 04:38:45 -07:00
Moti Zilberman 457f8f08fc Add test for resolving a breakpoint without a reload
Summary:
bypass-github-export-checks

Covers the case of an immediately-resolved breakpoint in `JsiIntegrationTest`, complementing the existing `ResolveBreakpointAfterReload` case.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61468055

fbshipit-source-id: 0f68656a2558166f1302163d14722c17c590044b
2024-08-20 02:04:28 -07:00
Raman Gupta 143437a837 Update React-RCTAppDelegate.podspec syntax error for USE_HERMES=1 (#46075)
Summary:
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix https://github.com/facebook/react-native/issues/38193.

See https://github.com/facebook/react-native/issues/38193#issuecomment-2072243996.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix imports from RCTAppSetupUtils when Hermes is active

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

Test Plan: I made the change in my local project and it fixed issues I was having with building my React Native project. See https://github.com/facebook/react-native/issues/38193#issuecomment-2072243996.

Reviewed By: cipolleschi

Differential Revision: D61422872

Pulled By: realsoelynn

fbshipit-source-id: ddaa88ab01bd1186b33d1d7c73d5865182271c81
2024-08-19 22:19:32 -07:00
Phillip Pan e8fd7a0f78 update comment to use BaseReactPackage instead of TurboReactPackage (#46102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46102

Changelog: [Internal]

TurboReactPackage is deprecated, use BaseReactPackage instead

Reviewed By: NickGerleman

Differential Revision: D61487902

fbshipit-source-id: a47436148b83b3dbdd985c8c480f78307e080a2c
2024-08-19 21:28:38 -07:00
Nishan 1a49892d57 fix: linear gradient color stop fix up spec (#45969)
Summary:
- Color stops needs to follow [fix up spec](https://drafts.csswg.org/css-images-4/#color-stop-fixup)
- Adds multiple stops syntax support. e.g. linear-gradient(red 30% 50%, green).
- Rename `position` to `positions` in object style API. Optional string array here makes more sense. We'll add number array support once `px` support is added. Will do it as a follow up to this PR.

TODOs: transition hint syntax support `linear-gradient(red, 50%, green)` (Done locally, dependent on this PR). `px` support.

## Changelog:
[GENERAL] [FIXED] - Linear gradient color stop spec.

<!-- 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/45969

Test Plan: - Added testcases in processBackgroundImage-test.js

Reviewed By: javache

Differential Revision: D61309203

Pulled By: NickGerleman

fbshipit-source-id: 884052c6841320048933361f38e6478ff4192736
2024-08-19 18:23:13 -07:00
Joe Vilches 7027eac09a Extra log for case where availableHeight is undefined and sizing mode != max content (#45965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45965

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

We are seeing some crashes that are hard to wrap our head around. Lets add more logs. I chose these values based on what could make the height/width undefined from looking at the code. We might need more but this should give us some more direction.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61054392

fbshipit-source-id: 654ff96f94aa89605a603e2e36335bb48b61f4a2
2024-08-19 16:13:44 -07:00
Jorge Cabiedes Acosta 0f3ed90455 Add mix-blend-mode examples to rn-tester (#46006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46006

Adding some extra examples for mix-blend-mode

And added E2E tests for each mix-blend-mode example

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60605636

fbshipit-source-id: 553f3a2c3b971c918530bdee5a73108c22bd936e
2024-08-19 11:07:46 -07:00
Nicola Corti 55d35411ae Finalize AssertJ migration (#46097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46097

I've noticed we still have some tests here and there that were not migrated to AssertJ. This finishes them all.

Changelog:
[Internal] [Changed] - Finalize AssertJ migration

Reviewed By: javache

Differential Revision: D61473682

fbshipit-source-id: 3d51bfeb0e5ba3fd8cd4f3667dc88de3d88a3dbc
2024-08-19 10:51:24 -07:00
Blake Friedman 2ac997abcc Remove references to old template (#46082)
Summary:
## Summary
There are old references to the react-native/template. This code has
moved to react-native-community/template.

Changelog: [Internal]

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

Test Plan:
CI

closes facebook/metro#1324

Reviewed By: cipolleschi

Differential Revision: D61472439

Pulled By: blakef

fbshipit-source-id: fc40145c03002a7c3117b72d07981a96aa3d8760
2024-08-19 09:19:35 -07:00
zhongwuzw 9cfd9dd1c7 Fixes Italic text not work (#46094)
Summary:
Fixes https://github.com/facebook/react-native/issues/46090. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes Italic text not work

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46090

Reviewed By: NickGerleman

Differential Revision: D61472362

Pulled By: cipolleschi

fbshipit-source-id: 8cee04c4a3bdc842a765d13e997af5063ea03a32
2024-08-19 08:38:59 -07:00
Riccardo Cipolleschi 7f3717eb78 Add changelog for 0.72.17 (#46100)
Summary:
Add changelogfor 0.72.17

## Changelog:
[Internal] - Add changelog for 0.72.17

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D61476630

Pulled By: cipolleschi

fbshipit-source-id: e6a5115a1dd5d6745d5234cbffebb0fc8294cf67
2024-08-19 08:29:10 -07:00
Christoph Purrer 6340662d4f Add C++ Turbo Module enum Event Emitter example (#46049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46049

## Changelog:

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

Reviewed By: kentwilliam

Differential Revision: D61336742

fbshipit-source-id: 81ac54020f4d88dc3c1235541d613a59235069a3
2024-08-19 08:26:20 -07:00
Nicola Corti 0e805a953d Make Imagesource open for inheritance (#46092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46092

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

Changelog:
[Android] [Fixed] - Make Imagesource `open` for inheritance

Reviewed By: rshest, cipolleschi

Differential Revision: D61469357

fbshipit-source-id: ee122b46346c47c7665c60ceb5ea7e91f12a965c
2024-08-19 04:34:22 -07:00
David Vacca d4d5ab0bba Fix lint warnings (#46083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46083

Fix lint warnings

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D61376258

fbshipit-source-id: e4e047e478a4e5a95d5e6b3dea426189f29bb641
2024-08-18 16:45:02 -07:00
Sam Zhou 25d6a152cc Deploy 0.244.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D61435279

fbshipit-source-id: 05212fe00d352c32d2be9d93ad0fcd6d414ef828
2024-08-17 17:51:37 -07:00
Nick Gerleman d9f684b1cf Revamp InsetBoxShadowDrawable (#46074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46074

This brings over the changes made to OutsetBoxShadowDrawable. Namely

1. Removing reliance on CSSBackgroundDrawable for drawing paths
2. Using BlurMaskFilter instead of RenderEffect
3. Removing RenderNode usage

This should make the implementation, more reliable less memory intensive for large boxes, and compatible down to Android API 29. I changed previous gating to allow outset shadows for 28+, and inset for 29+.

Changelog:
[Android][Changed] - Revamp InsetBoxShadowDrawable

Reviewed By: joevilches

Differential Revision: D61348615

fbshipit-source-id: 97b63b5dce65224ca54b76c5318c219973fc09fa
2024-08-17 09:21:06 -07:00
Nick Gerleman f905f90468 Support OutsetBoxShadowDrawable on Android 9+ (#46037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46037

We no longer need to use a RenderNode, since we aren't using a RenderEffect, and when I looked at our usage, and RenderNode internals, it is definitely adding more overhead instead of less.

This lets us simplify the code further, and to support down to Android API 28, allowing us to support 90% of Android devices out there, instead of 80%.

API 28 [switches to Skia](https://cs.android.com/android/_/android/platform/frameworks/base/+/04f1f011397e10ded08ac14b7e62c85e6a521f27:libs/hwui/Properties.cpp;dlc=ac1d112c4bef3fef85b4de3ce0d2bc2d3006f4b5) as the default rendering backend. We see many [related drawing APIs](https://developer.android.com/topic/performance/hardware-accel#drawing-support) show as first officially supported in hardware accelerated canvases in this version, including `setShadowLayer()`, which uses [`SKMaskFilter`](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/jni/Paint.cpp;l=1104;drc=7ad774120c090227ba12b9e9e8d724db01b854f4) internally.

We are still waiting on InsetBoxShadowDrawable to be changed though, before the prop setter stops gating to API 31+.

Changelog:
[Android][Changed] - Support OutsetBoxShadowDrawable on Android 9+

Reviewed By: joevilches

Differential Revision: D61331711

fbshipit-source-id: 170f6d4e5bfebbce5005445a3c32c4b17910eb05
2024-08-17 09:21:06 -07:00
Jorge Cabiedes Acosta 3e6b4fa230 Fix processFilter incorrectly splitting function args (#46073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46073

Before we had issues with drop-shadow definitions like `drop-shadow(10 10 10 rgba(255, 255, 255, 1))`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61413945

fbshipit-source-id: 478c437336d3e7d5066ed62f6aa5bec106b8b061
2024-08-16 17:55:30 -07:00
Phillip Pan e881a1184c convert TurboReactPackage to BaseReactPackage in oss (#46055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46055

Changelog: [Android][Breaking]

BaseReactPackage is a 1:1 replacement for the deprecated TurboReactPackage. TurboReactPackage has been deprecated since 0.74. let's move the codebase to the recommended standard.

Reviewed By: cortinico

Differential Revision: D61329022

fbshipit-source-id: cef69e37bb2be7f6dccbab70d0996c33a8abf091
2024-08-16 17:41:32 -07:00
SamChou19815 (Meta Employee) 39c338ff8d Eliminate a few React.Element type that will be synced to react-native (#30719)
Summary:
## Summary

Flow will eventually remove the specific `React.Element` type. For most
of the code, it can be replaced with `React.MixedElement` or
`React.Node`.

When specific react elements are required, it needs to be replaced with
either `React$Element` which will trigger a `internal-type` lint error
that can be disabled project-wide, or use
`ExactReactElement_DEPRECATED`.

Fortunately in this case, this one can be replaced with just
`React.MixedElement`.

## How did you test this change?

`flow`

DiffTrain build for commit https://github.com/facebook/react/commit/85fb95cdffdd95f2f908ee71974cae06b1c866e1.

bypass-github-export-checks

Reviewed By: poteto

Differential Revision: D61397212

Pulled By: SamChou19815

fbshipit-source-id: c0aa5a4ed3922f88b7e557738f76f872c02a9d07
2024-08-16 16:37:25 -07:00
Sam Zhou 77154c64f0 Eliminate exact React.Element types in react-native codebase
Summary: Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D61389820

fbshipit-source-id: 566a4904c570e24f5beb965734020f8b9c1ed819
2024-08-16 07:30:09 -07:00
Nicola Corti db80d78d7a Merge all the remaining .so libraries into libreactnative.so (#46059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46059

This merges all the remaining dynamic libraries into libreactnative.so.
Sadly I couldn't split this in smaller diffs as all the libraries are connected with each other.

I also had to introduce 2 other SOs: `libhermestooling.so` and `libjsctooling.so` which contains
all the necessary libs used when loading either JSC or Hermes. They need to be isolated
as RNGP will remove those libraries based on the library the user decides to pick.

Changelog:
[Android] [Breaking] - Merge all the remaining .so libraries into libreactnative.so

Reviewed By: hezi

Differential Revision: D61376496

fbshipit-source-id: ab9e725b7acbebdfd8fa3ff36ad34d080044bf0e
2024-08-16 05:42:46 -07:00
Nicola Corti 7916f7e120 Merge libuimanagerjni.so inside libreactnative.so (#46056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46056

This merges another library inside libreactnative.so

Changelog:
[Android] [Changed] - Merge libuimanagerjni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61376498

fbshipit-source-id: db646721a5a4b56f2cf098d5087a3e45d2076743
2024-08-16 05:42:46 -07:00
Nicola Corti 6e5227bd83 First round of prefab cleanup (#46057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46057

We have a bunch of prefab targets which are no longer necessary. I'm removing them all in this first round of cleanup

Changelog:
[Android] [Breaking] - Remove several unnecessary android prefab targets. Use ReactAndroid::reactnative instead

Reviewed By: cipolleschi

Differential Revision: D61376497

fbshipit-source-id: e2e3cb38b1db712890f8bd58abadbdcb5cfaeec7
2024-08-16 05:42:46 -07:00
Nicola Corti 80c3aea48d Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so (#46058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46058

This moves other 2 libraries inside libreactnative.so

Changelog:
[Android] [Changed] - Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61376499

fbshipit-source-id: 8780831491a5d57c4bb747fccf8a872ad30dc09e
2024-08-16 05:42:46 -07:00
Riccardo Cipolleschi e39aaf5da5 Make sure we can create a .xcode.env.local (#46060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46060

Closures in ruby don't need the `return` statement. They exit from the calling function!

## Changelog
[Internal] - fix .xcode.env.local.generation

Reviewed By: cortinico

Differential Revision: D61343918

fbshipit-source-id: 39073ead7ad596f48403a5c2d4c066d410355698
2024-08-16 02:20:18 -07:00
zhongwuzw 1d1646afd1 Fixes findNodeAtPoint when views were inverted (#45519)
Summary:
FIxes https://github.com/facebook/react-native/issues/45502 .  cc realsoelynn

## Changelog:

[GENERAL] [FIXED] - Fixes findNodeAtPoint when views were inverted

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/45502 .

Reviewed By: cipolleschi

Differential Revision: D59920660

Pulled By: realsoelynn

fbshipit-source-id: 9e1075406830aa3a3ec436d70d539ca0674f8d34
2024-08-16 01:00:07 -07:00
Nicola Corti e864910a4d Move more libraries to so-merging: rninstance, react_featureflagsjni, hermesinstancejni, fabricjni (#46036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46036

This is a round of merging of .so libraries inside libreactnative.so

Changelog:
[Android] [Changed] - Move more libraries to so-merging: rninstance, react_featureflagsjni, hermesinstancejni, fabricjni

Reviewed By: javache

Differential Revision: D61331552

fbshipit-source-id: ac93e844b304038eefd4679680180eb3be2d5e1d
2024-08-16 00:42:51 -07:00
Nicola Corti 7fa9bc85c4 Remove unnecessary circular dependency on bridgeless<->hermes (#46048)
Summary:
Remove unnecessary circular dependency on bridgeless<->hermes

## Changelog:

[INTERNAL] - Remove unnecessary circular dependency on bridgeless<->hermes

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

Test Plan: CI

Reviewed By: christophpurrer

Differential Revision: D61343505

Pulled By: cortinico

fbshipit-source-id: 5e182c724e80d419a5af1e0ea9dfb96595e4abe2
2024-08-16 00:36:59 -07:00
Joe Vilches d490354cd8 Add View box shadow e2e tests (#46054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46054

tsia, more test = good

Changelog: [Internal]

Reviewed By: necolas

Differential Revision: D60938608

fbshipit-source-id: abce5ab7d42a7f7f626f0edc852aa1374f8029f0
2024-08-15 20:59:11 -07:00
Joe Vilches de39ebb9f8 Make default shadow color black (#46053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46053

tsia, default should be black like android

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61370471

fbshipit-source-id: a69933049f9db30a17322bd53ef30035ae145a63
2024-08-15 20:59:11 -07:00
Edmond Chui cae9ae5b48 console preview for Error objects (#46010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46010

X-link: https://github.com/facebook/hermes/pull/1474

Changelog:
[General][Added]: support for rendering Error object previews in Chrome DevTools console

On web, an array of Error objects have previews. This diff brings the parity to RN DevTools

Reviewed By: huntie

Differential Revision: D61243518

fbshipit-source-id: d9c6af4b44cef44cb63c4462eee649a8e498a429
2024-08-15 19:42:52 -07:00
Edmond Chui 1740a56a46 Render Error objects in CDT (#45990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45990

X-link: https://github.com/facebook/hermes/pull/1471

Changelog:
[General][Added]: support for rendering Error objects in Chrome DevTools console

As discussed in [Linkifying and symbolicating JavaScript Error stacks in Fusebox](https://docs.google.com/document/d/1JI_PPzxFRwRNii6pcx-4Cb7g8UTrqnZHCxaoynntIrM/edit) by hoxyq, Error objects in CDT currently displays a big blob of string.

In this diff, we send the correct CDT params.

Reviewed By: hoxyq

Differential Revision: D60598446

fbshipit-source-id: 527c4e5858dfb879a32b40e5ad4df73a22e694e5
2024-08-15 19:42:52 -07:00
Jorge Cabiedes Acosta 17017d2b81 Add isolate property (#45883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45883

Isolate property lets us easily define when a <View> should set a stacking context.

This is particularly useful when used with `mix-blend-mode`

Changelog: [Internal]

Reviewed By: christophpurrer, NickGerleman

Differential Revision: D60604683

fbshipit-source-id: 449079abe45ae57e98315bdf27b54ec5cf9d6fdc
2024-08-15 16:55:26 -07:00
Jorge Cabiedes Acosta 0a698e5971 Make mix-blend-mode only blend with stacking context parent (#45867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45867

Before mix-blend-mode was blending with everything in the background, now we make it blend with just stacking context parent as spec by doing off-screen rendering.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60597403

fbshipit-source-id: 3af0c1266fde4ca32846785879d616316349369c
2024-08-15 16:55:26 -07:00
bacarybruno 6cc44d765a feat(accessibility): support large content viewer on iOS (#45903)
Summary:
Referring to the [iOS Large Content Viewer](https://developer.apple.com/videos/play/wwdc2019/261/):
iOS Tab Bars can't grow with dynamic text, but the Large Content Viewer helps them to be seen by people with low vision.

Currently on React Native we don't expose the properties that can help implementing iOS [UILargeContentViewerItem](https://developer.apple.com/documentation/uikit/uilargecontentvieweritem) protocol.
The goal of this PR is to expose the necessary props.

In this PR, I'm exposing 2 props:
- `accessibilityShowsLargeContentViewer`: to enable the large content viewer
- `accessibilityLargeContentTitle`: to define the large content viewer title

I plan to use this to open a PR on react-navigation so that bottom tabbars can implement largeContentViewer.
Should fix https://github.com/facebook/react-native/issues/30892

## Changelog:
[IOS] [ADDED] - Support LargeContentViewer on iOS for better accessibility

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

Test Plan: <img width="300" src="https://github.com/user-attachments/assets/d8f1dc46-66e7-4945-bc3b-f1d29044441b" />

Reviewed By: cipolleschi

Differential Revision: D61148361

Pulled By: joevilches

fbshipit-source-id: 86dd92f4f79534a58e6e015febdaf217ea291eb4
2024-08-15 13:38:15 -07:00
Jorge Cabiedes Acosta d69dbd6f15 Add support for assymetrical bonder radii when using % (#45985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45985

As title.

We can now create ellipses when using percentages. The algorithm for this is still flawed and to get it to be a 1:1 to web it will probably require a re-write of some of the logic but this should get us closer for now.

Some examples:

1. Border thinning on large single corner radii (100%)
 {F1798145800}
2. Thinning gets worse when having irregular border colors (100%)
 {F1798148002}

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61025927

fbshipit-source-id: 218d44af014bc8351c329ff1bca82658aebac38c
2024-08-15 12:35:15 -07:00
Vincent Riemer abc322c708 fix erroneous pointerenter events firing when pointer leaves app bounds (#46024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46024

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D61298649

fbshipit-source-id: 16ee8084fa31297ee12db26ee86254eed6da248f
2024-08-15 11:27:41 -07:00
Pieter De Baets f8aa7867f1 Fix type of callerContext (#46039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46039

Broke during Kotlin conversion I assume

Image onSubmit events were failing with

```
FdingControllerListener  E  InternalListener exception in onSubmit
                         E  java.lang.NullPointerException: Parameter specified as non-null is null: method com.facebook.react.views.image.ReactImageView$setShouldNotifyLoadEvents$1.onSubmit, parameter
                            callerContext
                         E      at com.facebook.react.views.image.ReactImageView$setShouldNotifyLoadEvents$1.onSubmit(Unknown Source:9)
                         E      at com.facebook.drawee.controller.ForwardingControllerListener.onSubmit(ForwardingControllerListener.java:75)
                         E      at com.facebook.drawee.controller.AbstractDraweeController.reportSubmit(AbstractDraweeController.java:832)
                         E      at com.facebook.drawee.controller.AbstractDraweeController.submitRequest(AbstractDraweeController.java:578)
                         E      at com.facebook.drawee.controller.AbstractDraweeController.onAttach(AbstractDraweeController.java:468)
                         E      at com.facebook.drawee.view.DraweeHolder.attachController(DraweeHolder.java:252)
                         E      at com.facebook.drawee.view.DraweeHolder.attachOrDetachController(DraweeHolder.java:269)
                         E      at com.facebook.drawee.view.DraweeHolder.onAttach(DraweeHolder.java:87)
                         E      at com.facebook.drawee.view.DraweeView.doAttach(DraweeView.java:208)
                         E      at com.facebook.drawee.view.DraweeView.onAttach(DraweeView.java:194)
                         E      at com.facebook.drawee.view.DraweeView.onAttachedToWindow(DraweeView.java:168)
                         E      at android.view.View.dispatchAttachedToWindow(View.java:20812)
                         E      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
                         E      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
                         E      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
                         E      at android.view.ViewGroup.addViewInner(ViewGroup.java:5290)
                         E      at android.view.ViewGroup.addView(ViewGroup.java:5076)
                         E      at com.facebook.react.views.view.ReactViewGroup.addView(ReactViewGroup.java:591)
                         E      at android.view.ViewGroup.addView(ViewGroup.java:5016)
                         E      at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:41)
                         E      at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.java:21)
                         E      at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SurfaceMountingManager.java:412)
                         E      at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(IntBufferBatchMountItem.java:119)
                         E      at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(MountItemDispatcher.java:387)
                         E      at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.java:294)
                         E      at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.java:127)
                         E      at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1362)
                         E      at com.facebook.react.fabric.GuardedFrameCallback.doFrame(GuardedFrameCallback.kt:22)
                         E      at com.facebook.react.modules.core.ReactChoreographer$frameCallback$1.doFrame(ReactChoreographer.kt:59)
                         E      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1035)
                         E      at android.view.Choreographer.doCallbacks(Choreographer.java:845)
                         E      at android.view.Choreographer.doFrame(Choreographer.java:775)
                         E      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
                         E      at android.os.Handler.handleCallback(Handler.java:938)
                         E      at android.os.Handler.dispatchMessage(Handler.java:99)
                         E      at android.os.Looper.loopOnce(Looper.java:214)
                         E      at android.os.Looper.loop(Looper.java:304)
                         E      at android.app.ActivityThread.main(ActivityThread.java:7918)
                         E      at java.lang.reflect.Method.invoke(Native Method)
                         E      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                         E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1010)
```

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D61332854

fbshipit-source-id: 48409e2b93abf15e846620580d1f0d07a2e75025
2024-08-15 08:59:18 -07:00
Alex Hunt 2469c67641 Disable connection read timeout for Network.loadNetworkResource (Android) (#46041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46041

We observed that large or remotely loaded source maps could time out. This change aligns `OkHttpClient` timeout values with `CxxInspectorPackagerConnection`.

https://github.com/facebook/react-native/blob/a77f26827fee0fc18a11faccd0b5e51d1b222735/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.java#L87-L91

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61333240

fbshipit-source-id: 605b1fbf1b050d8e80ed569b25cb5694e2d14ec7
2024-08-15 08:45:54 -07:00
Thomas Nardone 49fa92e016 ReactViewGroup - use safer removeViewInLayout (#45980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45980

Use a safe remove method that won't crash on IndexOutOfBounds.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D61132496

fbshipit-source-id: edd887611c47f236b495986fc29e2d0b9ce56b8e
2024-08-15 08:44:32 -07:00
Elene Botchoradze 26aff664c0 fix(ios): removed default value (#46020)
Summary:
Removed UIReturnKeyDefault as it caused bug when there wasn't any type.

## Changelog:

[IOS] [REMOVED]: UIReturnKeyDefault

<!-- 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/46020

Reviewed By: christophpurrer

Differential Revision: D61277058

Pulled By: cipolleschi

fbshipit-source-id: 18349c49b05d492a2c2ed5713af3ceb6d3728e70
2024-08-15 08:10:08 -07:00
Blake Friedman 15c9961c88 Fix publish template url for GHA action (#46040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46040

The URL to dispatch the workflow was not correct, see [0].

## Changelog: [Internal]

[0] https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

## Internal:

For S441191, see the job launched:
- https://github.com/react-native-community/template/actions/runs/10404141179/job/28811993693

 {F1806960111}

Reviewed By: cipolleschi

Differential Revision: D61333084

fbshipit-source-id: 62b20d792b9c667b3ee80d6d446423a6d24a67c2
2024-08-15 07:27:45 -07:00
Riccardo Cipolleschi 7d088f8020 Add changelog for 0.75.1 (#46038)
Summary:
Add changelog for 0.75.1

## Changelog:
[Internal] - Add changelog

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D61333096

Pulled By: cipolleschi

fbshipit-source-id: 19ba0bce60056be12d1b0427939c5896c22e215b
2024-08-15 06:41:10 -07:00
Riccardo Cipolleschi b4a2a4e756 Backport Fixes for Create Release Workflow (#46034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46034

The create release workflow was not working properly for 0.75:

* the latest tag was not pushed because we were using the wrong input
* the latest tag was not deleted because we were not fetching all the tags
* the create release job 'dry-run' defaults to false, which is a bit dangerous

This change is a backport from 0.75 to main of these changes.

## Changelog
[Internal] - Make sure that the Latest tag is properly pushed to github while releasing

Reviewed By: cortinico

Differential Revision: D61331247

fbshipit-source-id: 89bf0698c45ec6c766e25b11599dbe926d8a6297
2024-08-15 06:40:40 -07:00
zhongwuzw a77f26827f Add missing pod dependency of jserrorhandler (#46030)
Summary:
Fixes build error like https://github.com/facebook/react-native/actions/runs/10398775597/job/28797041872. cc RSNara

## Changelog:

[IOS] [FIXED] - Add missing pod dependency of jserrorhandler

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

Test Plan: CI green.

Reviewed By: cortinico

Differential Revision: D61329173

Pulled By: cipolleschi

fbshipit-source-id: c7dc6d7af3b57f748ae3464d9f4231ff4fb36e63
2024-08-15 03:22:28 -07:00
Ramanpreet Nara 8c26048df6 ReactInstance: Remove redundant try/catch in loadScript (#45617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45617

This isn't necessary.

RuntimeScheduler will catch and report via js error handler.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D60139055

fbshipit-source-id: 511f384ede71d88b81ef5c031fa67b1fb03f7631
2024-08-14 20:43:11 -07:00
Ramanpreet Nara 7fce71709e Route fatal js errors caught in js through JsErrorHandler
Summary:
If a fatal error is caught in js, and the js pipeline isn't ready, route it through the c++ pipeline.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D60138414

fbshipit-source-id: 333e38e2b904d6434a88469816e39bf1b9d0bc3f
2024-08-14 20:43:11 -07:00
Ramanpreet Nara dd7be8de05 Route all js errors caught in C++ through JsErrorHandler
Summary:
If any fatal js error is caught in c++, just route it through js error handler.

Then, make js error handler call into the right pipeline:
1. After the js pipeline is ready: Route the errors through the js pipeline
2. Otherwise: Route errors through the c++ pipeline.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D60138417

fbshipit-source-id: 24c466ffadbd14a9e9a5571548f3d34d2f406a8d
2024-08-14 20:43:11 -07:00
Ramanpreet Nara bc930441cf Refactor: RuntimeScheduler: Make error hander configurable
Summary:
## History
1. Originally landed in D60138415
2. Reverted in D60232011 (it broke ios oss builds)

## Motivation
In bridgeless, we want to configure the error handling of runtime scheduler. So that we can route those errors to the C++ error handling pipeline, when necessary.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D60477342

fbshipit-source-id: f14e20d7aff39e0fee42918567ccc6e685674134
2024-08-14 20:43:11 -07:00
Bowen Xie 68c0720e34 - Change RawPropsParser logs to WARNING (#46025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46025

Changelog:
[General][Fixed] - Change RawPropsParser logs from ERROR level to WARNING

Reviewed By: christophpurrer

Differential Revision: D61304854

fbshipit-source-id: bc16df4916a54cb7c1fa57f359eab3d9eed4e2f4
2024-08-14 19:27:20 -07:00
Devan Buggay 9bc32a0101 Fix minimize/restore crash (#46023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46023

Minimizing and restoring a Mac Catalyst app causes an `interfaceOrientationDidChange` which causes a downstream crash on `application.delegate.window`.

There doesn't seem to be a clean way to get if an app is fullscreen in Mac Catalyst, so just no-oping for now.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D61253706

fbshipit-source-id: 73d260366adcc74e88f43f256cc5aff8a6e3ef71
2024-08-14 15:22:58 -07:00
Dawid 94407f56d1 fix(iOS): displaying irregular borders on iOS Fabric (#45973)
Summary:
This PR solves [issue](https://github.com/facebook/react-native/issues/45958) with displaying irregular borders on Fabric. The same issue appears on the old architecture, but I am having a problems there, so I am pushing this fix for now.

The problem is solved by decoupling `backgroundColor` from `borderLayer` and setting `zPosition` on `borderLayer` to `1024.0f`, so that the border is always in front of the layer. The `zPosition` is compared within a layer, so it shouldn't impact outside components. I would love to hear your opinion if there is a case in which this could break.

## Changelog:

[IOS] [FIXED] - changed border display

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

Test Plan:
I've checked that on RNTester Images.

![border-issues-screen](https://github.com/user-attachments/assets/e12add82-8016-4c42-833d-f396307e9423)

Reviewed By: joevilches

Differential Revision: D61119409

Pulled By: cipolleschi

fbshipit-source-id: a88912061c7a8d72eec4f4092adb076dd6ae511e
2024-08-14 13:16:10 -07:00
Blake Friedman bd3a3e3de0 Remove @react-native-community/cli direct dependencies (#45927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45927

This was attempted earlier in the year, and was unsuccessful because HelloWorld had a hidden dependency on this.

Changelog: [General][Breaking] Projects that intend to use the community CLI will now have to declare that dependency instead of transitively having the react-native package handle this.

Reviewed By: GijsWeterings

Differential Revision: D60898346

fbshipit-source-id: 1d62615f718e06caf684f48ecfaf610bf1f51f8e
2024-08-14 12:55:50 -07:00
Pieter De Baets e39b916966 Revert D60143747: Fix debug logging of IntBufferBatchMountItem
Differential Revision:
D60143747

Original commit changeset: 6f1a9ea1cf95

Original Phabricator Diff: D60143747

fbshipit-source-id: c07088c4591ca344dbdc31c9f86b1a44a575c0ae
2024-08-14 08:26:45 -07:00
Riccardo Cipolleschi 9f77287a0c Update changelog for 0.75.0 (#45814)
Summary:
Changelog for 0.75.0

## Changelog:

[Internal] - Changelog for 0.75.0

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D60446949

Pulled By: cipolleschi

fbshipit-source-id: e26e3486e3c9d224678f3df913368fa280c2e431
2024-08-14 08:09:41 -07:00
Moti Zilberman 730885863d Collapse stack frames in new renderer error handling file (#45982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45982

Changelog: [Internal]

Recently `src/private/renderer/errorhandling/ErrorHandlers.js` started showing up in some error stack traces, making LogBox less readable. This diff ensures we collapse these extra stack frames by default (as well as hide them in Fusebox, etc).

Reviewed By: hoxyq

Differential Revision: D61128294

fbshipit-source-id: 2ebcb47265aaf3281b669ed022c29978167f3e81
2024-08-14 06:56:51 -07:00
Pieter De Baets 59c1adbfdb Rethrow original exception in DefaultReactHostDelegate (#46016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46016

Wrapping the JavaScriptException with a RuntimException means we lose JS specific metadata on the top-level exceptions, and can break categorization in crash-reporting tools.

We could also use the same logic as [DefaultJSExceptionHandler](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/DefaultJSExceptionHandler.java) but that doesn't seem to be required for Kotlin.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61261515

fbshipit-source-id: fa85c8818834905759cbc984ea3c45403eb87e8c
2024-08-14 05:33:41 -07:00
Nicola Corti 5b761ff15c Move libmapbufferjni.so inside libreactnative.so (#46003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46003

Another library going inside libreactnative.so

Changelog:
[Android] [Changed] - Move libmapbufferjni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61211105

fbshipit-source-id: 38fce9ff9025fc6d2cd9eff3ee57303babed8852
2024-08-14 05:07:56 -07:00
Nicola Corti 0caf3e824d Move libreact_newarchdefaults.so inside libreactnative.so (#46004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46004

This is the first library I'm moving over inside libreactnative.so

Changelog:
[Android] [Changed] - Move libreact_newarchdefaults.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61211104

fbshipit-source-id: 2526395a246df9ebf6387ca434e07b4ed4484f1e
2024-08-14 05:07:56 -07:00
Nicola Corti 6dc01dad09 Do not depend on OSS SoLoader anymore (#45873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45873

I'm removing the Gradle dependency on OSS SoLoader and stubbing it with our own implementation.
This will allow us to implement merging of further .so libraries and

As Fresco also depends on SoLoader, I had to stub the `NativeLoader` dependency as well.

Changelog:
[Android] [Breaking] - Do not depend on OSS SoLoader anymore and do not expose Fresco `api` dependency.

Reviewed By: mdvacca

Differential Revision: D60652007

fbshipit-source-id: 6e70a5c37ba9337fbe8772e192b886ba4693c7f1
2024-08-14 05:07:56 -07:00
Daniel Strebinger 53969cb8d0 Enable third-party podspec sources to be fetched from mirrored git repositories (#45566)
Summary:
At OEBB we currently facing an issue we're not able to use our mirrored git repositories for third-party podspecs. This is due to the fact podspecs contain hardcoded git repository urls. With this change we could specify urls to our mirrored git repositories.

## Changelog:

[IOS] [ADDED] Enable third-party podspec sources to be fetched from mirrored git repositories

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

Test Plan:
```bash
# Define env vars for git mirrors

export FMT_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export GLOG_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export FOLLY_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export DOUBLE_CONVERSION_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export BOOST_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"

# Pod install command run from ios app folder
pod install
```

Reviewed By: cortinico

Differential Revision: D61209204

Pulled By: cipolleschi

fbshipit-source-id: b19f7b8262c860b5c4d553732da50c9bd0373397
2024-08-14 04:42:58 -07:00
Soe Lynn 7bb7a6037b Back out "Fixes NSDataBigString length calculation" (#46011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46011

Backing out D58561775 in the meantime while we are trying to do proper fix in Hermes engine D61058869

Changelog: [Internal]
Temporarily revert this diff https://github.com/facebook/react-native/pull/44900 while we wait for https://github.com/facebook/react-native/pull/45966 to land

Reviewed By: makovkastar

Differential Revision: D61246120

fbshipit-source-id: 8c205efe9d29cd34f24676c4a48d55f0493d73ab
2024-08-13 20:12:48 -07:00
Devan Buggay f9abe96d19 Fix RCTDevLoadingView position (#46005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46005

The RCTDevLoadingView is clipped in Mac Catalyst, hiding half of it under the toolbar. This change maintains the behavior on iOS of extending past the dynamic island.

{F1803665273}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D61209780

fbshipit-source-id: 6c9c572a9e47a8caf191c40fb53c4a7d43b64281
2024-08-13 16:23:15 -07:00
Alex Hunt bd90a076f7 Update debugger-frontend from 7b143e5...c98a122 (#46000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46000

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7b143e5...c98a122

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

Reviewed By: robhogan

Differential Revision: D61208000

fbshipit-source-id: 8884d7946f4f62bbfe48e3fddc6c873f952d826c
2024-08-13 16:00:25 -07:00
Thomas Nardone 66ff4d3515 Fully synchronize NativeViewHierarchyManager (#45984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45984

A few methods were not synchronized, exposing members like `mTagsToViews` to potential out-of-sync access.
Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D61151447

fbshipit-source-id: 696dbec559968cdfc7c6d2e662f4c8f3471039e1
2024-08-13 13:16:41 -07:00
Sam Zhou a622a43764 Replace all exact React.Element type in react-native with ExactReactElement_DEPRECATED (#45998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45998

The exact `React.Element` type is deprecated and will be removed in a future version of Flow.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D61205640

fbshipit-source-id: a029a3a46c7d8d9f94b0b931b991b2ce461151b2
2024-08-13 09:08:44 -07:00
Pieter De Baets 5f88c659c8 Fix debug logging of IntBufferBatchMountItem (#45637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45637

This breaks when `setAndroidLayoutDirection` is enabled.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60143747

fbshipit-source-id: 6f1a9ea1cf95f9be0451460201e49b4ce80ce204
2024-08-13 08:35:38 -07:00
Tommy Nguyen 3e084bc159 fix(react-native-codegen): scripts require yargs (#45994)
Summary:
Android fails to build in a pnpm monorepo setup because `yargs` cannot be found:

```
% yarn android
info Installing the app...

> Configure project :app
WARNING: The option setting 'android.jetifier.ignorelist=hermes-android' is experimental.
Signing config for 'release' build type not found; reusing debug config

> Task :react-native-webapis_web-storage:generateCodegenSchemaFromJavaScript FAILED
28 actionable tasks: 6 executed, 22 up-to-date

node:internal/modules/cjs/loader:1148
  throw err;
  ^

Error: Cannot find module 'yargs'
Require stack:
- /~/node_modules/.store/react-native-codegen-virtual-39ff8dcc54/package/lib/cli/combine/combine-js-to-schema-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
```

## Changelog:

[GENERAL] [FIXED] - Fix codegen failing in a pnpm monorepo because of missing `yargs`

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

Test Plan: Tested in https://github.com/microsoft/rnx-kit/pull/3290

Reviewed By: dmytrorykun

Differential Revision: D61201420

Pulled By: cortinico

fbshipit-source-id: aac3704ae7f200db827b14c8362f83a5e66ad08e
2024-08-13 06:31:42 -07:00
Riccardo Cipolleschi eb2d9852c7 Fix E2E tests on Template (#45974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45974

This change fixes the E2E tests on the template on main.

There were two issues:
1. we were forcing the project on the 0.75 branch. We now use the current branch name
2. we were replacing all the versions for the dependencies that starts with `react-native` to the monorepo version. The problem is that also `react-native-community` packages starts with `react-native`. We now changes the versions if the dependency name starts with `react-native/`.

## Changelog:
[Internal] - Fix E2E tests on main

Reviewed By: cortinico

Differential Revision: D61122154

fbshipit-source-id: 07210fc9f63e99eac46894f13c7ca5359e186e6c
2024-08-13 05:05:56 -07:00
Devan Buggay 84fe531952 Fix RedBox crash
Summary:
`RCTSharedApplication().delegate.window.safeAreaInsets.bottom;` causes a crash in Mac Catalyst.

There is already precedent of a `#if TARGET_OS_MACCATALYST` in the same file. This just defaults it to 0 in that case, which looks fine.

## Changelog:

[iOS] [Fixed] - Mac Catalyst crash in RCTRedBox

Reviewed By: shwanton

Differential Revision: D61160503

fbshipit-source-id: 5771ebff88242d9dd4b892d8823e15d1f2307728
2024-08-12 22:36:22 -07:00
Nick Gerleman 6c0710620f Use BlurMaskFilter in outset shadows instead of Blur RenderEffect (#45986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45986

This uses SkBlurMaskFilter under the hood, to draw geometry of a solid color with alpha blur, without going the route of full image filter/rasterization. It was not supported under hardware accelerated canvases for a while, but seems to fully work as of API 29.

Requiring Android 10 instead of 12 makes box shadows a lot more palatable (80% support vs 50%), and we see drastically better performance in one case with many large shadows, where creating many large hardware layers previously drastically hurt framerates.

{F1801807696}

At this point, the RenderNode may be redundant, though I think it can technically save us some work on redraws still. It is kept around for now. I simplified some of the math around here as well.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61162637

fbshipit-source-id: 8f6ff486e655e64a0665c31391359c499c374c8f
2024-08-12 21:41:13 -07:00
Nick Gerleman 9e48976bc2 Do not implicitly convert parsed LengthPercentage to pixels (#45987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45987

This is a confusing public API, because styles layer deals with DIPs, conversion only happens when parsing dynamic, and `POINT` (the `LengthPercentageType`) also maps to DIPs instead of physical pixels.

This moves conversion to physical pixels to drawing layer, so everything above `BackgroundStyleApplicator` works with `style` types which are all in DIPs.

To preserve compatibility with existing APIs using raw radii, we keep it so that (most) views operate in pixel units, while view managers operate under DIPs.

Changelog: [Android][Breaking] Do not implicitly convert parsed LengthPercentage to pixels

Reviewed By: rshest

Differential Revision: D60507151

fbshipit-source-id: b90066af7b221304aded374627fc0e2165dfc08f
2024-08-12 21:41:13 -07:00
Nick Gerleman 3ee94174b4 Clip to radii bounds in OutsetBoxShadowDrawable (#45947)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45947

This adjusts logic to be similar to InsetBoxShadowDrawable to keep the full ink within RenderNode bounds. This avoids a tiny bit of overdraw, but also means we get correct rendering if RenderNode is promoted to a compositing layer.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60972085

fbshipit-source-id: 0916733c6abae37e30dd1f64a36c0e211e41917e
2024-08-12 21:41:13 -07:00
Nick Gerleman b4159576a2 Add Android RTL Coverage to ReactNativeCoreE2E tests (#45758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45758

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60345614

fbshipit-source-id: 17f638ef58c4f7a4ed807573b6f8a67bff9559e3
2024-08-12 18:50:09 -07:00
Danny Su 04932f2677 Add HeapSnapshotOptions for jsi::Instrumentation (#45963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45963

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-takeHeapSnapshot

As per `HeapProfiler.takeHeapSnapshot` documentation, there are a few
more configurable options to what is contained in the snapshot. Adding
a struct and the `captureNumericValue` bool to the interface since
that's what we need right now. In the future, there is the
`exposeInternals` parameters that's currently experimental for Chrome.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D60989352

fbshipit-source-id: fcd269f0db5b24983631206a1b738dea29566f0e
2024-08-12 18:44:10 -07:00
Phillip Pan 184646e491 remove cxx TM autolinking (#45967)
Summary:
Changelog: [iOS][Android][Breaking]

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

this was a meaningful exploration, but since we have support in TM for jsi runtime access and that's been widely advertised and accepted, let's get rid of this. it's a bit hacky and hard to use (shown by no one using it), so i want to stop any possibility of its usage.

if interested in accessing jsi::Runtime via a native module, please consider the following options:
- [Android] BindingsInstaller: https://github.com/facebook/react-native/pull/44526
- [iOS] RCTTurboModuleWithJSIBindings: https://github.com/facebook/react-native/pull/44486
- C++ TurboModules (no autolinking): https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules-xplat.md

Reviewed By: christophpurrer

Differential Revision: D61059182

fbshipit-source-id: da5d74e2b6161ea7e8dd5f664ae0eb927bb1e2c3
2024-08-12 15:29:39 -07:00
Nicola Corti d01f1b3214 Add support for handling com.facebook.react.bridge.Dynamic as parameter type in TurboModules (#45944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45944

This diff adds support having (Legacy) Native Modules with functions with parameters of type `Dynamic`.
This is currently blocking some libraries making it harder for them to migrate to New Architecture.

I've implemented it by adding a `DynamicNative` implementation of `Dynamic` which holds a reference of
the payload as a `folly::dynamic`.

Changelog:
[Android] [Added] - Add support for handling `com.facebook.react.bridge.Dynamic` as parameter type in TurboModules

Reviewed By: mdvacca, cipolleschi

Differential Revision: D60966684

fbshipit-source-id: 2e63bc53ede5277a9c12f1b19f05f6099f5f35f9
2024-08-12 12:56:38 -07:00
Thomas Nardone 471445eb17 Delete LongArray (#45736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45736

This was an internally used class that was made irrelevant by Kotlin conversion.  Appears to be unused in OSS, no breakages expected.

Changelog:
[Android][Breaking] - Deleted LongArray

Reviewed By: sammy-SC

Differential Revision: D60292651

fbshipit-source-id: cebb3d41113ad9f3247c3189889337d6e3e4ebab
2024-08-12 10:54:33 -07:00
Jakub Grzywacz 010e0010a3 Make setPointerEvents public on ReactViewGroup.java (#45975)
Summary:
I maintain the `react-native-svg` library, where our elements extend `ReactViewGroup`. Currently, `ReactViewGroup` only exposes the getter for `mPointerEvents` publicly, so we cannot set it. To properly handle `pointerEvents`, we would have to duplicate all methods related to `mPointerEvents`, which results in maintaining a separate state. This duplication can lead to desynchronization between the state in our class and the state in the superclass.

PR with a workaround that we can avoid with this change https://github.com/software-mansion/react-native-svg/pull/2395

## Changelog:

[ANDROID] [CHANGED] - make `setPointerEvents` public

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

Test Plan: This change was tested manually by making the field public, allowing dependent classes to override or reference it.

Reviewed By: cortinico

Differential Revision: D61124293

Pulled By: javache

fbshipit-source-id: 389d0a670375a8a68c975294f98c33c28ef41ffe
2024-08-12 10:36:57 -07:00
Jon Thysell c30e35fb44 Fix "C4715 not all control paths return a value" warning in MSVC (#45827)
Summary:
When integrating react-native into react-native-windows, we got the following build warning (which we treat as an error) when building ReactCommon: `C4715 not all control paths return a value`

This PR adds defaults to the switches to make sure every path returns a value.

See https://github.com/microsoft/react-native-windows/issues/13516

## Changelog:

[GENERAL] [FIXED] Fix "C4715 not all control paths return a value" warning in MSVC when building ReactCommon

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

Test Plan: The switches are checking enums this code should never be hit unless new enum values are added.

Reviewed By: robhogan

Differential Revision: D61103286

Pulled By: NickGerleman

fbshipit-source-id: 2028cb60e0b438b9ac17a828f5e1b690052a0bec
2024-08-12 10:00:24 -07:00
Pieter De Baets d9d638c06b Pass unflattened styles to reconciler (#45345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45345

When React diffs props, it can can short-circuit nested objects if their object identity hasn't changed. Whenever we use `flattenStyle` we prevent this optimization from taking place.

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D59518281

fbshipit-source-id: e88ca781ab4622b5342169f8f27b09f0515513b3
2024-08-12 08:13:17 -07:00
Håkon Knutzen 7e41ea4c9d Data race related to read/write on ReactMarker::logTaggedMarkerImpl (#45557)
Summary:
When using `TSan` while running the Unit tests of `RNTester`, there are a few data races picked up. One is described [here](https://github.com/facebook/react-native/issues/45280), while this PR deals with a race related to concurrent read/write of `ReactMarker::logTaggedMarkerImpl`. Here is the `TSan` output:

```
WARNING: ThreadSanitizer: data race (pid=5236)
  Read of size 8 at 0x00011a602690 by thread T34:
    #0 std::__1::__function::__value_func<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>::operator bool[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x18cd49c)
    https://github.com/facebook/react-native/issues/1 std::__1::function<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>::operator bool[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x18cd2bc)
    https://github.com/facebook/react-native/issues/2 facebook::react::JSIExecutor::initializeRuntime() <null> (RNTesterUnitTests:arm64+0x1c96818)
    https://github.com/facebook/react-native/issues/3 facebook::react::NativeToJsBridge::initializeRuntime()::$_0::operator()(facebook::react::JSExecutor*) <null> (RNTesterUnitTests:arm64+0x1a7a074)
    https://github.com/facebook/react-native/issues/4 decltype(std::declval<facebook::react::NativeToJsBridge::initializeRuntime()::$_0&>()(std::declval<facebook::react::JSExecutor*>())) std::__1::__invoke[abi:ue170006]<facebook::react::NativeToJsBridge::initializeRuntime()::$_0&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::initializeRuntime()::$_0&, facebook::react::JSExecutor*&&) <null> (RNTesterUnitTests:arm64+0x1a79fbc)
    https://github.com/facebook/react-native/issues/5 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<facebook::react::NativeToJsBridge::initializeRuntime()::$_0&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::initializeRuntime()::$_0&, facebook::react::JSExecutor*&&) <null> (RNTesterUnitTests:arm64+0x1a79e5c)
    https://github.com/facebook/react-native/issues/6 std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::initializeRuntime()::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::initializeRuntime()::$_0>, void (facebook::react::JSExecutor*)>::operator()[abi:ue170006](facebook::react::JSExecutor*&&) <null> (RNTesterUnitTests:arm64+0x1a79d84)
    https://github.com/facebook/react-native/issues/7 std::__1::__function::__func<facebook::react::NativeToJsBridge::initializeRuntime()::$_0, std::__1::allocator<facebook::react::NativeToJsBridge::initializeRuntime()::$_0>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) <null> (RNTesterUnitTests:arm64+0x1a75250)
    https://github.com/facebook/react-native/issues/8 std::__1::__function::__value_func<void (facebook::react::JSExecutor*)>::operator()[abi:ue170006](facebook::react::JSExecutor*&&) const <null> (RNTesterUnitTests:arm64+0x1abac9c)
    https://github.com/facebook/react-native/issues/9 std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const <null> (RNTesterUnitTests:arm64+0x1aba9d0)
    https://github.com/facebook/react-native/issues/10 facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8::operator()() const <null> (RNTesterUnitTests:arm64+0x1aba8d4)
    https://github.com/facebook/react-native/issues/11 decltype(std::declval<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8&>()()) std::__1::__invoke[abi:ue170006]<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8&) <null> (RNTesterUnitTests:arm64+0x1aba6d4)
    https://github.com/facebook/react-native/issues/12 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8&) <null> (RNTesterUnitTests:arm64+0x1aba4f8)
    https://github.com/facebook/react-native/issues/13 std::__1::__function::__alloc_func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8>, void ()>::operator()[abi:ue170006]() <null> (RNTesterUnitTests:arm64+0x1aba45c)
    https://github.com/facebook/react-native/issues/14 std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>&&)::$_8>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x1ab4918)
    https://github.com/facebook/react-native/issues/15 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x3ce2e4)
    https://github.com/facebook/react-native/issues/16 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x3cdfd0)
    https://github.com/facebook/react-native/issues/17 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x4af18c)
    https://github.com/facebook/react-native/issues/18 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x51595c)
    https://github.com/facebook/react-native/issues/19 facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1::operator()() const <null> (RNTesterUnitTests:arm64+0x529df0)
    https://github.com/facebook/react-native/issues/20 decltype(std::declval<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>()()) std::__1::__invoke[abi:ue170006]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) <null> (RNTesterUnitTests:arm64+0x529b54)
    https://github.com/facebook/react-native/issues/21 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) <null> (RNTesterUnitTests:arm64+0x529978)
    https://github.com/facebook/react-native/issues/22 std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()[abi:ue170006]() <null> (RNTesterUnitTests:arm64+0x5298dc)
    https://github.com/facebook/react-native/issues/23 std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x524518)
    https://github.com/facebook/react-native/issues/24 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x3ce2e4)
    https://github.com/facebook/react-native/issues/25 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x3cdfd0)
    https://github.com/facebook/react-native/issues/26 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) <null> (RNTesterUnitTests:arm64+0x515384)
    https://github.com/facebook/react-native/issues/27 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ <null> (CoreFoundation:arm64+0x8dc0c)
    https://github.com/facebook/react-native/issues/28 __NSThread__start__ <null> (Foundation:arm64+0x645c60)

  Previous write of size 8 at 0x00011a602690 by main thread:
    #0 std::__1::__function::__value_func<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>::swap[abi:ue170006](std::__1::__function::__value_func<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>&) <null> (RNTesterUnitTests:arm64+0x43b078)
    https://github.com/facebook/react-native/issues/1 std::__1::function<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>::swap(std::__1::function<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>&) <null> (RNTesterUnitTests:arm64+0x433100)
    https://github.com/facebook/react-native/issues/2 std::__1::function<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>& std::__1::function<void (facebook::react::ReactMarker::ReactMarkerId, char const*)>::operator=<registerPerformanceLoggerHooks(RCTPerformanceLogger*)::$_1, void>(registerPerformanceLoggerHooks(RCTPerformanceLogger*)::$_1&&) <null> (RNTesterUnitTests:arm64+0x432d50)
    https://github.com/facebook/react-native/issues/3 registerPerformanceLoggerHooks(RCTPerformanceLogger*) <null> (RNTesterUnitTests:arm64+0x4170fc)
    https://github.com/facebook/react-native/issues/4 -[RCTCxxBridge initWithParentBridge:] <null> (RNTesterUnitTests:arm64+0x416504)
    https://github.com/facebook/react-native/issues/5 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x3bf6f4)
    https://github.com/facebook/react-native/issues/6 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc540)
    https://github.com/facebook/react-native/issues/7 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc124)
    https://github.com/facebook/react-native/issues/8 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7de8)
    https://github.com/facebook/react-native/issues/9 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Location is global 'facebook::react::ReactMarker::logTaggedMarkerImpl' at 0x00011a602678 (RNTesterUnitTests+0x438a690)

  Thread T34 (tid=11229216, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x2bee4)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x6458f0)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x3bf748)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc540)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc124)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageLoaderUsesImageDecoderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0xbe8c)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x13371c)
```

The proposed solution is to wrap `logTaggedMarkerImpl` in a class that has a static getter and setter wherein a read/write lock is employed. It is my understanding that `logTaggedMarkerImpl` is read several times, but only assigned rarely, and thus it seems appropriate with a read/write lock. The getter and setter functions are also inlineable, such that one should not need to make an extra function call when obtaining the `logTaggedMarkerImpl` instance.

In order to reproduce my findings and verify fix:

* Clone this branch
* Run setup code as described in README
* Execute `git revert -n 65998835c2198b9d626160a6883744801fa056a9 83a2a3c9b4e5ea588a6cc3a9281ad385a388b84a`
* Enable TSan for both `RNTester` and its test scheme.
* Enable Runtime issue breakpoint for TSan
* Run unit tests
* Observe the `TSan` breakpoint is hit (possibly other places in the codebase as well) when accessing `logTaggedMarkerImpl`. Continue execution if other breakpoints are hit before this breakpoint.
* Execute `git revert --abort`
* Run the tests again and observe the `TSan` breakpoint does _not_ hit said code again.

## Changelog:

[iOS][Fixed] Data race related to read/write on `ReactMarker::logTaggedMarkerImpl`

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

Test Plan: I believe there are existing tests that will cover the proposed changes.

Reviewed By: cipolleschi

Differential Revision: D60525080

Pulled By: dmytrorykun

fbshipit-source-id: 78b0ce2a660af0e29909ff68c018698a9a1e29f8
2024-08-12 05:06:05 -07:00
Riccardo Cipolleschi 4faafb0aa4 Remove _shouldEmitEvent guardrails (#45837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45837

Some Internal tests in the old architecture were failing after landing [#45414](https://github.com/facebook/react-native/pull/45414) because the `RCTNativeAnimatedModule` in the old architecture was not declaring the event.

This change fixes it by declaring the event that is never fired in the Old Architecture as it is not needed.

## Changelog
[iOS][Added] - Declare the `onUserDrivenAnimationEnded` in the old Architecture

Reviewed By: sammy-SC

Differential Revision: D60499584

fbshipit-source-id: 581a30a88dbd6d8d67078a11699157c55ed19e58
2024-08-12 03:52:51 -07:00
Riccardo Cipolleschi a8786fc1df React to onUserDrivenAnimationEnded event in JS (#45839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45839

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

This change completes the fix for broken pressable when animations were applied to components with native driven animations.

When creating the AnimatedProps, if they are natively drive animation, we look for the AnimatedValue involved and we register a listener. This is needed to make sure that the NativeModule will send te updated value upon calling the `update` function.

Then, when observing the props lifecycle, it register a listener to the new `OnUserAnimationEnded` event, fired by the NativeAnimation module.

When the `OnUserAnimationEnded` event is fired, the AnimatedProps will update the props that depends on the user driven animation.

## Changelog
[General][Fixed] - reallign the shadow tree and the native tree when the user finishes interacting with the app.

Reviewed By: sammy-SC

Differential Revision: D60499583

fbshipit-source-id: 02d25e7ca31b91f4d6e4ec1654350e2d84117eda
2024-08-12 03:52:51 -07:00
David Vacca 175943f15b Fix Fabric logging when ReactNativeFeatureFlags.setAndroidLayoutDirection is enabled (#45953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45953

Fabric logging was broken when ReactNativeFeatureFlags.setAndroidLayoutDirection is enabled, I'm fixing it here

changelog: [internal] internal

Reviewed By: NickGerleman, bvanderhoof

Differential Revision: D61002408

fbshipit-source-id: bff76ce145d4619635a4b55a4750c3e51bb4d8d7
2024-08-10 00:01:24 -07:00
Nick Gerleman d3bd4254cf Fix OutsetBoxShadowDrawable offseting (#45954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45954

Fixes offset issue after CSSBackgroundDrawable decoupling.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61003916

fbshipit-source-id: e23faf7f9bae89f2f77a448ba3d99f29c89eb621
2024-08-09 19:05:16 -07:00
shubhamguptadream11 603eb94dd9 feat(android): height issue fixed with keyboard avoiding component in new architecture (#45928)
Summary:
Fixes this issue: https://github.com/facebook/react-native/issues/45880

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Message

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

[ANDROID] [CHANGED] - Replaced `mLastHeight` with `mVisibleViewArea.height()` since mLastHeight value is not getting updated. For `width` we are already using `mVisibleViewArea.width()`

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

Test Plan: - Tested the fix in new and old architecture both

Reviewed By: christophpurrer

Differential Revision: D61023998

Pulled By: cortinico

fbshipit-source-id: df67616330effb7b9e6724d94b3be92c0dbd6190
2024-08-09 12:23:09 -07:00
Gijs Weterings f2aa3fe0ec Revert D61014834: Substitute babel-preset-fbjs for metro-transform-plugins
Differential Revision:
D61014834

Original commit changeset: 26bd1cacf890

Original Phabricator Diff: D61014834

fbshipit-source-id: 6879dc6e1dae7fdb59cfc3bd63ac090cffca26b0
2024-08-09 09:39:26 -07:00
Alex Hunt 82795715ae Substitute babel-preset-fbjs for metro-transform-plugins (#45959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45959

Addresses TODO comment. I noticed this lone reference to `babel-preset-fbjs` (last published 3y ago) while attempting to upgrade our Babel Flow syntax plugin.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D61014834

fbshipit-source-id: 26bd1cacf8907550a5c318d4daf70359fb4f5700
2024-08-09 06:28:29 -07:00
Oskar Kwaśniewski 58a8fa69b4 ci: add xcbeautify for xcodebuild actions (#45957)
Summary:
This PR adds `xcbeautify` for xcodebuild actions.

Installing `xcodebuild` is not required as its included in every macos runner image: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#tools

## Changelog:

[INTERNAL] [ADDED] - add xcbeautify for xcodebuild actions

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D61012286

Pulled By: cipolleschi

fbshipit-source-id: d0ef3df18963c0ebfc1c856816a63b1cc0259ba5
2024-08-09 06:12:15 -07:00
Gabriel Donadel 5ced5f8363 Add shared-testutil folder to NPM files to be published (#45936)
Summary:
React-native 0.75 RC7 gradle sync is currently broken due to the fact that the `shared-testutil` folder is missing from the `react-native/gradle-plugin` npm package

## Changelog:

[INTERNAL] [ADDED] - Add shared-testutil folder to NPM files to be published

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D60969631

Pulled By: cortinico

fbshipit-source-id: 850edfe0cf6b0e8174a1df9ea962d207d2ce0112
2024-08-09 05:50:16 -07:00
Oskar Kwaśniewski e4e461c9cf feat: implement automicallyAdjustsKeyboardInsets for new architecture on iOS (#45939)
Summary:
This PR implements the missing `automicallyAdjustsKeyboardInsets` for new architecture. It's a fixed version of reverted: https://github.com/facebook/react-native/issues/45819

We now check if the view intersects with the keyboard's end frame and if it doesn't we just do nothing.

Here is the app running on new arch:

https://github.com/user-attachments/assets/673f0587-6a67-47e3-8050-d6ee33a45724

## Changelog:

[IOS] [FIXED] - implement automicallyAdjustsKeyboardInsets for new arch

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

Test Plan:
1. Test out ScrollViewKeyboardInsets example
2. See if it works the same with old and new arch

Reviewed By: cortinico

Differential Revision: D60958475

Pulled By: cipolleschi

fbshipit-source-id: 8650064af84bc79b6b89e07293640e5d010154c2
2024-08-09 05:22:23 -07:00
Nicola Corti ee25081d20 Fix typo in workflow name (#45956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45956

Fix typo in workflow name

Changelog:
[Internal] [Changed] - Fix typo in workflow name

Reviewed By: cipolleschi

Differential Revision: D61007940

fbshipit-source-id: 62f8e15503ed1d9668c097e8a4c2c552a6458a83
2024-08-09 04:21:20 -07:00
Joe Vilches 7b36c0204f Fix crash when you layout multiple absolute nodes in the same static subtree (#45952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45952

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

https://en.wikipedia.org/wiki/Short-circuit_evaluation 🫠

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60997231

fbshipit-source-id: 11d70086eecfb5481c578477f288138370016a83
2024-08-08 22:41:29 -07:00
Nick Gerleman 0273123dde Gate off % translate on Android Paper (#45946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45946

This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch.

This change disables support on Android Paper for consistency.

Changelog:
[Android][Removed] - Gate off % translate on Android Paper

Reviewed By: joevilches

Differential Revision: D60970266

fbshipit-source-id: 5df73b948464f5093941528b0af2e694827a9460
2024-08-08 19:44:49 -07:00
Nick Gerleman 620b1221fa Avoid Image ofscreen render (#45948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45948

This change effectively reverts D59489788 which fixed Image implementation of `hasOverlappingRendering()`. When this is true, Android will draw offscreen, then composite the rasterized layer with alpha in one pass, instead of drawing each element with alpha (which results in incorrect rendering).

The unforseen downside is that this prevents drawing overflow, which means images with non-full opacity break box shadows and outline in the future.

This deserves a fuller fix... but in the meantime, I discovered we disable offscreen alpha in many of the core components already, with `<View>` as a major example requiring explicit opt-in. This is... kinda terrible, since `opacity` rendering is pretty broken on RN Android, but the status quo lets us avoid a pretty bad boxShadow bug for now.

Changelog:
[Android][Changed] - Avoid image ofscreen render

Reviewed By: Abbondanzo

Differential Revision: D60972846

fbshipit-source-id: 403714d6bb0527a7426feba3dafee05b6aefbb7d
2024-08-08 17:21:21 -07:00
Ingrid Wang 8a390ba9b8 Mark setNetworkActivityIndicatorVisible as deprecated (#45950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45950

Changelog:

[iOS][Deprecated] Deprecated StatusBar.setNetworkActivityIndicatorVisible

The status bar network activity indicator is deprecated in iOS 13. Setting its visibility has no effect in iOS 13 and later. It will be completely removed in a future release.

Reviewed By: philIip

Differential Revision: D60977517

fbshipit-source-id: 31e79113fffd0201c4393b61236d3911e82b40d1
2024-08-08 16:27:49 -07:00
Alan Lee 270951a212 Update OSS to minSdk 24 (#45906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45906

- Updating RNTester and React Native to minSdk 24 targeting 0.76 release as [announced](https://github.com/react-native-community/discussions-and-proposals/discussions/802)

**Changelog:**
[Android][Breaking] - updating `minSdkVersion` to API 24 (Android 7)

Reviewed By: cortinico, mdvacca

Differential Revision: D60790790

fbshipit-source-id: 961141867e7238157e5e6e72ede0f73bd31901a2
2024-08-08 15:23:15 -07:00
Nick Gerleman d56d9d9618 Decouple CSSBackgroundDrawable from OutsetBoxShadowDrawable (#45805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45805

After recent changes where we dive into paths ourselves, we really don't have a good reason to use the heavy CSSBackgroundDrawable. Accept a box shadow style in place of a reference to the original drawable, and then draw using calculated round rect path instead of new whole Drawable. This lets us avoid a lot of conversions as well (with the last diff already removing some).

This should also resolve a crash we started seeing:

```
androidx.core.util.Preconditions.checkNotNull (Preconditions.java:136) [inlined]
- com.facebook.react.uimanager.drawable.CSSBackgroundDrawable.drawRoundedBackgroundWithBorders (CSSBackgroundDrawable.java:386)
 [inlined]
- com.facebook.react.uimanager.drawable.CSSBackgroundDrawable.draw (CSSBackgroundDrawable.java:142)
- com.facebook.react.uimanager.drawable.OutsetBoxShadowDrawable.draw (OutsetBoxShadowDrawable.kt:137)
- android.graphics.drawable.LayerDrawable.draw (LayerDrawable.java:1019)

```

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60401423

fbshipit-source-id: 693d9bf5e85956290db932cdb18f15ba26446894
2024-08-08 12:56:39 -07:00
Nick Gerleman bbd5b5e157 Gate off % border radii on Android Paper (#45945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45945

This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch.

This change disables support on Android Paper for consistency.

Changelog:
[Android][Removed] - Gate off % border radii on Android Paper

Reviewed By: cortinico

Differential Revision: D60967347

fbshipit-source-id: 1d26bc71aee677aa9a0dc9bb38f781a99c7762a8
2024-08-08 11:26:04 -07:00
Jorge Cabiedes Acosta 757cefb26e Fix box-shadow showing on top of subviews (#45935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45935

As title

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60925627

fbshipit-source-id: 3cc2703eb68201fd02063738f8896b87a938658c
2024-08-08 11:22:16 -07:00
Alex Hunt 51ffc5cc12 Break out URLSearchParams, require typedef for unparsable files (#45783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45783

Improves type strictness in the `react-native` package.

- Break out `URLSearchParams` from `URL.js` into its own module, to isolate a `$FlowFixMe[unsupported-syntax]` suppression within that definition.
- Update `public-api-test` to require an adjacent `<module>.js.flow` type definition file whenever a `$FlowFixMe[unsupported-syntax]`is present.
- Add `URLSearchParams.js.flow` with a Flow parser compatible typedef (`@iterator` instead of `[Symbol.iterator]`).

The result of these changes is to add missing typedef test coverage for `Libraries/Blob/URL.js` (see updated test snapshots).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D60376327

fbshipit-source-id: 93c0949289a4b53f621f563769ffb68d5dc38d91
2024-08-08 10:38:12 -07:00
Alex Hunt 0e9c9c7c6e Align paused overlay design on Android (#45942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45942

Design refinements to the paused debugger overlay on Android.

Changed:
- Visual treatment of the button (text, icon colour, spacing)
- The touch area of the button (whole unit becomes touchable to resume)
- Overlay opacity reduced
- Overlay animation removed

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D60962345

fbshipit-source-id: 3c1c480e5469e6f7700fe96305bb83c348329ea6
2024-08-08 10:35:29 -07:00
Oskar Kwaśniewski 02e896989a ci: run cache-repear only on main repo (#45943)
Summary:
This PR fixes Cache repear
## Changelog:

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

[INTERNAL] [FIXED] - Cache repear job

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

Test Plan: CI Green

Reviewed By: blakef

Differential Revision: D60962822

Pulled By: cortinico

fbshipit-source-id: 453153005bbc1b99dbe569eb6be77d17c8a176db
2024-08-08 09:40:06 -07:00
Sushant Sardeshpande beebf4a0a3 Fix for app restart on Android in case of remote debugging (#45775)
Summary:
Added a check in setRemoteJSDebugEnabled in DevSupportManagerBase.java to check for PREFS_REMOTE_JS_DEBUG_KEY to see if the value has changed.

Fix for https://github.com/facebook/react-native/issues/45399 - App restarting when `NativeDevSettings.setIsDebuggingRemotely` is used in a landing component. If this was invoked from a component load or action that would fire on app start, it was creating an infinite loop where the app would keep on restart before eventually leading to a crash.

## Changelog:
[ANDROID] [FIXED] - Fix issue with `NativeDevSettings.setIsDebuggingRemotely` where the app would keep on restarting if remote debugging was invoked from an action / component that was called on app start.

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

Test Plan:
Create a new project using RN CLI.
Set `newArchEnabled=false`.�
Install modules using `yarn install`.�
Build from source for Android by setting the following in `settings.gradle`-�
```
includeBuild('../node_modules/react-native') {
     dependencySubstitution {
         substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
         substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
         substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
         substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
     }
 }
```
Set the ANDROID_HOME and ANDROID_NDK_HOME environment variables required for react native.�Call `NativeDevSettings.setIsDebuggingRemotely` from App.tsx which is the landing component.�
Test with both `hermesEnabled=true` and `hermesEnabled=false` and ensure that app does not keep on restarting after fix.

Reviewed By: cipolleschi

Differential Revision: D60377406

Pulled By: huntie

fbshipit-source-id: c8faf184b50b67f50f8a4b6851df9d0ef3350949
2024-08-08 07:58:23 -07:00
Dmitry Rykun 5d70411b48 Use useDebouncedEffect for managing animated props lifecycle
Summary:
This diff sets up an experiment to use `useDebouncedEffect` for managing animated props lifecycle.

Changelog: [Internal]

bypass-github-export-checks

Facebook
This diff also defaults to `useDebouncedEffect` for managing animated props lifecycle in IGVR and FBVR.

Based on local tracing of FBVR, `useDebouncedEffect` results in **~19ms faster visual completion**.
Before we executed **54.2 ms** of passive effects vs **35.6 ms** after.

Reviewed By: josephsavona, rubennorte

Differential Revision: D60834116

fbshipit-source-id: 35d5eb4c4be18e716f96129911e66eaffe54bb17
2024-08-08 06:04:13 -07:00
Rob Hogan c8acbf55c5 Unbreak Swift build - guard C++ header in #ifdef __cplusplus (#45941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45941

Quick fix to avoid imports from Swift chaining to Objective-C++ headers. Will follow up with a redesign.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D60960077

fbshipit-source-id: 4ce9507900196d5298c7885a99a5e4d786f76982
2024-08-08 05:49:19 -07:00
Nicola Corti 92dff73ba2 Introduce the enableEventEmitterRetentionDuringGesturesOnAndroid to gate the Pressable fix (#45930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45930

This introduces the `enableEventEmitterRetentionDuringGesturesOnAndroid` that allows us to gate the
fix for bug #45126 and #44610.

Changelog:
[Internal] [Changed] - Introduce the enableEventEmitterRetentionDuringGesturesOnAndroid to gate the Pressable fix

Reviewed By: mdvacca

Differential Revision: D60908117

fbshipit-source-id: 885917832718d9b90d043b2d7e2cdb47e0f01ea7
2024-08-08 05:06:04 -07:00
Nicola Corti 6b7f68240e Do not destroy views when there is a touch going on for New Architecture (#45865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45865

This diff introduces the logic to defer the destruction of ViewState (and EventEmitter) for views that are currently touched on by the user. The idea is to let the UIManager know which view is currently active from the `JSTouchDispatcher` and eventually defer the view deletion till the view is not interacted anymore.

The JSTouchDispatcher already retains the information on which tag was the touch originally fired.
We'll pass over that information to the UIManager/SurfaceMountingManager so that it can be accounted for when the view has to be deleted.

This is causing a couple of bad bugs on Android:

Fixes https://github.com/facebook/react-native/issues/45126
Fixes https://github.com/facebook/react-native/issues/44610
Closes https://github.com/facebook/react-native/pull/45675

Changelog:
[Android] [Fixed] - Do not destroy views when there is a touch going on for New Architecture

Reviewed By: mdvacca

Differential Revision: D60594878

fbshipit-source-id: c3334d16cf305e0178f50772576050ebfbba85ec
2024-08-08 05:06:04 -07:00
Blake Friedman 03c0e5e2af ReactSwitch.java → Kotlin (#45931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45931

Migration to Kotlin.

Changelog: [Android][Changed] Migrated ReactSwitch to Kotlin

Reviewed By: cortinico

Differential Revision: D60898267

fbshipit-source-id: 530e240a071deb3eff3e463f04edc590de03c594
2024-08-08 03:17:26 -07:00
Oskar Kwaśniewski b7221238aa ci: run cache-repear only on main repo (#45940)
Summary:
This PR enables the `cache-repear.yml` only for the main repository. This is running constantly on forks creating lots of notifications and it's mostly needed only for the main repo.

![CleanShot 2024-08-08 at 10 06 38@2x](https://github.com/user-attachments/assets/51f7e208-05c9-4a02-982d-d746a717dc69)

## Changelog:

[INTERNAL] [CHANGED] - Run `cache-repear.yml` only on main repo

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

Test Plan: CI GREEN

Reviewed By: blakef

Differential Revision: D60957003

Pulled By: cortinico

fbshipit-source-id: 2f250d734688739a278095af8d860a54426604bf
2024-08-08 02:36:13 -07:00
zhongwuzw 089e8289ba Fixes FORCE_BUNDLING error when bundle js (#45871)
Summary:
After enable FORCE_BUNDLING to true, build error.  cc blakef
![image](https://github.com/user-attachments/assets/42f7fed7-efa1-4c23-b812-db49b64d3bff)

![image](https://github.com/user-attachments/assets/4ac40c43-b404-4f3a-8b7d-3c2749f587ed)

## Changelog:

[IOS] [FIXED] - Fixes FORCE_BUNDLING error when bundle js

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

Test Plan: enable FORCE_BUNDLING to true, build success.

Reviewed By: cipolleschi

Differential Revision: D60829522

Pulled By: blakef

fbshipit-source-id: cc8d3bf6a88a49010215acb958ad65e311f618b2
2024-08-08 02:20:33 -07:00
Sam Zhou ecc2910b26 Deploy 0.243.0 to xplat (#45937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45937

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D60935044

fbshipit-source-id: 898ccfa0fd9dbd0551bbc9afe46a7ac322191351
2024-08-07 18:28:27 -07:00
David Vacca 99a8cd0fd8 Refactor DefaultNewArchitectureEntryPoint to use ReactNativeNewArchitectureFeatureFlagsDefaults (#45919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45919

Refactor DefaultNewArchitectureEntryPoint to use ReactNativeNewArchitectureFeatureFlagsDefaults

changelog: [internal] internal

Reviewed By: shwanton, cortinico

Differential Revision: D60866416

fbshipit-source-id: 2ac92500ac0a30f5bf775ae870f557cd543980aa
2024-08-07 17:35:24 -07:00
David Vacca ff2a77a2e2 Introduce ReactNativeNewArchitectureFeatureFlagsDefaults (#45922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45922

Introduce the ReactNativeNewArchitectureFeatureFlagsDefaults class, which initializes default values for ReactNativeFeatureFlags when the New architecture is  enabled.
This class is meant to be overrode by ReactNativeNewArchitectureFeatureFlagsDefaults or others apps migrating to the new architecture.

changelog: [internal] internal

Reviewed By: philIip

Differential Revision: D60861873

fbshipit-source-id: b31ba947dae999fea8bb4effd63c56dc142a5c3d
2024-08-07 17:35:24 -07:00
Shawn Dempsey 6a1ecbb2bb ReactRootView.createRootView should be @nullable (#45924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45924

Changelog: [android][fixed] Anntate ReactRootView.createRootView with nullable

**Context**

- D54772205 changed `createRootView` to return `null`
- https://www.internalfb.com/diff/D60803470?dst_version_fbid=533309559035246&transaction_fbid=475433162004889

**Change**

- Annotate `createRootView` with `Nullable`

Reviewed By: mdvacca

Differential Revision: D60867547

fbshipit-source-id: 12c325cb9a2dd6db4b2388b2ad3c2af13065d371
2024-08-07 16:42:54 -07:00
Joe Vilches e5d8c60172 Fix broken shadows on iOS (#45934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45934

The OSS impl of gradient was wrong, and ends up skipping shadows if it is not defined. Fixed that.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D60917620

fbshipit-source-id: 3d4ea3e8084d33fa5d15fb82d45cfd063143087c
2024-08-07 14:01:44 -07:00
Alex Hunt 115918780d Update hermes-parser and related packages in fbsource to 0.23.1 (#45782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45782

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

React Native specific changes: This removes all remaining syntax parsing exclude cases from `public-api-test` 🎉

Changelog: [Internal]

Differential Revision: D60375696

fbshipit-source-id: 35dbb17fe1b2b9bce7c7772e5735773ac50504e8
2024-08-07 12:41:47 -07:00
Alex Hunt 7c49df9d08 Set nativeSourceCodeFetching capability in jsinspector-modern targets (#45850)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45850

Enables the `nativeSourceCodeFetching` capability flag for the modern debugger stack on both Android and iOS. This disables source code fetching hacks within the Inspector Proxy layer and instead enables the debugger server to handle all source code fetching directly on the device.

Changelog: [Internal]

Differential Revision: D60236216

fbshipit-source-id: 1239b4d7d2233852f007114721b202d90459fa06
2024-08-07 09:08:28 -07:00
Alex Hunt db3069b7ca Schedule IWebSocketDelegate event calls on inspector thread (#45849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45849

This fixes a bug where we were calling `delegate.didReceiveMessage` (and other handlers) from multiple threads on Android. In particular, with the addition of `Network.loadNetworkResource` in D54496969, we observed memory access issues in the implementation for `IO.read` in `NetworkIOAgent` after multiple successive requests are received.

This approach updates the Android-specific implementation of `IWebSocketDelegate` to schedule delegate handler and `close` calls on the inspector thread.

Changelog: [Internal]

Differential Revision: D60520747

fbshipit-source-id: 459b44b424157793faaf5967435e1303a0061292
2024-08-07 09:08:28 -07:00
Alex Hunt 7cd1787e02 Implement HostTargetDelegate.networkRequest (Android Bridgeless) (#45666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45666

Following https://github.com/facebook/react-native/pull/45664, implements the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for Android (Bridgeless).

Changelog: [Internal]

Differential Revision: D60232817

fbshipit-source-id: 109574392da21b2a698e061aa1847e17d17e662b
2024-08-07 09:08:28 -07:00
Alex Hunt 0c8ce2728e Implement HostTargetDelegate.networkRequest (Android Bridge) (#45664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45664

Implement the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for Android (Bridge). This diff introduces a common `InspectorNetworkHelper` class that will be shared for the Bridgeless implementation.

This change allows the modern debugger server to handle CDP `Network.loadNetworkResource` (etc) requests. Notably, resources in the Chrome DevTools Sources panel will now be loaded by the backend.

Changelog: [Internal]

Differential Revision: D60036502

fbshipit-source-id: 5fdca7f34634c7541395041025bef62ddfad9eab
2024-08-07 09:08:28 -07:00
Rob Hogan c720583f6c Implement HostTargetDelegate.networkRequest on iOS (#44846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44846

Implement the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for iOS (bridge and bridgeless) to satisfy CDP `Network.loadNetworkResource` (etc) requests.

Changelog:
[iOS][Added] Debugger: Implement CDP methods for loading network resources through the debug target.

Differential Revision: D54496969

fbshipit-source-id: fdaf445dda69b621617decdba49ba89c42043a92
2024-08-07 09:08:28 -07:00
Dmitry Rykun 62231ea883 Introduce useDebouncedEffect
Summary:
This diff introduces the `useDebouncedEffect` hook. It should be used for expensive effects that can be scheduled asynchronously, not blocking the rendering.

Changelog: [Internal]

bypass-github-export-checks

Facebook
This a copy of https://www.internalfb.com/code/fbsource/xplat/js/RKJSModules/public/xplat-react/shared/core/react_hooks/DebouncedEffectImplementation.js
I put it here temporarily to be able to run an experiment with `Animated`. We should come up with a better way to introduce this hook to OSS.
I'm bypassing GH export to not to draw extra attention to this.

Reviewed By: rubennorte

Differential Revision: D60762745

fbshipit-source-id: c13b20424360493a7fc94dc27264591a7253f77f
2024-08-07 08:41:06 -07:00
Oskar Kwaśniewski 05dec917f2 fix: Hermes build for visionOS simulator (Release) (#45911)
Summary:
Building for the visionOS simulator in the Release scheme requires an x86_64 slice to be included.

![CleanShot 2024-08-06 at 15 18 29@2x](https://github.com/user-attachments/assets/6fd962eb-ab71-4937-affe-964d8fa39f53)

## Changelog:

[IOS] [FIXED] - Include x86_64 slice when building for visionOS simulator

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

Test Plan: CI Green

Reviewed By: GijsWeterings

Differential Revision: D60828872

Pulled By: cipolleschi

fbshipit-source-id: 74444ac0b6661baf427837d242ba0ca295da0d16
2024-08-07 07:56:19 -07:00
Oskar Kwaśniewski c17da4e811 fix: minor fixes for hermes scripts (#45841)
Summary:
This PR fixes few issues with Hermes scripts:

- Set visionOS vendored frameworks
- Fail if env variables are not set

## Changelog:

[INTERNAL] [FIXED] - Hermes script should fail when no deployment target is set

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

Test Plan: Try to build Hermes

Reviewed By: blakef

Differential Revision: D60901886

Pulled By: cipolleschi

fbshipit-source-id: b9ff470ac6c07e1bd5abc7410ac0c366d66016c5
2024-08-07 06:53:37 -07:00
Alex Hunt e9e5fb0141 Remove unstable_fuseboxEnabled API (#45926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45926

Removes the temporary `unstable_fuseboxEnabled` API on both platforms. Fusebox is enabled by default on `main` since https://github.com/facebook/react-native/pull/45469.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60893243

fbshipit-source-id: 7ca4550eafb979730c0c5829df4c200f11e0df30
2024-08-07 06:40:13 -07:00
Nicola Corti 2ca01b4d04 Revert "Remove unnecessary git config --global --add safe.directory" (#45929)
Summary:
This reverts commit 9d9a8d2df6.

## Changelog:

[INTERNAL] - This reverts commit 9d9a8d2df6.

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60901502

Pulled By: cortinico

fbshipit-source-id: 2b7a7908a29f031c1f229907aa899a8a6960da4b
2024-08-07 06:39:31 -07:00
Andrew Datsenko baa366654e AssetSourceResolver: use resolver defined by PackagerAsset (#45897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45897

Changelog:
[General][Added] - Use PackagerAsset resolver instead of Platform.OS when its provided.

Reviewed By: christophpurrer

Differential Revision: D60670503

fbshipit-source-id: 9732b0ee3ec0cd1424bd83a4cc18924bcbd88db5
2024-08-07 05:40:05 -07:00
Andrew Datsenko 3f3a85b3c5 Add asset dest path resolver override (#45878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45878

Changelog:
[General][Added] - Add optional `PackagerAsset.resolver` prop so AssetSourceResolver can use it instead of `Platform.OS` to identify where asset is stored on device.

Reviewed By: rshest

Differential Revision: D60447815

fbshipit-source-id: 44fb8510746905ca0cd266144e213c40a3fa86a9
2024-08-07 05:40:05 -07:00
Sam Zhou 5b96e90f77 Replace React.Element<any> and unnecessarily specific React.Element with React.MixedElement (#45923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45923

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60872182

fbshipit-source-id: b81fb43968c52cbfdb4a9fa57f1175aabc2a3939
2024-08-06 21:33:08 -07:00
Nick Gerleman 82094dd9e3 Gracefully handle unexpected overlow values (#45917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45917

Did this the right way for BorderStyle, but not for Overflow.

Changelog:
[Android][Fixed] - Gracefully handle unexpected overlow values

Reviewed By: necolas

Differential Revision: D60853891

fbshipit-source-id: e641e62e9e301681a1be190d8158f793ec17c1f5
2024-08-06 20:45:25 -07:00
Nick Gerleman 8ed3838cbd Cleanup ReactNativeFeatureFlags.allowCollapsableChildren() (#45860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45860

This has been on by default for a long while.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D60579198

fbshipit-source-id: 4bd8a13dada8edf00489dc64b1ff4ff0364a8843
2024-08-06 20:17:27 -07:00
David Vacca 10c91e9a38 Deprecate ReactFeatureFlags.enableBridgelessArchitecture (#45918)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45918

In this diff we are deprecating ReactFeatureFlags.enableBridgelessArchitecture, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable TurboModules.

changelog: [Android][Deprecated] deprecate ReactFeatureFlags.enableBridgelessArchitecture

Reviewed By: philIip

Differential Revision: D60853317

fbshipit-source-id: 2476bb81887893cedc8d43b117c10cd9d96bdee3
2024-08-06 19:50:55 -07:00
David Vacca 0e91400857 Deprecate ReactFeatureFlags.useTurboModules (#45920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45920

In this diff we are deprecating ReactFeatureFlags.useTurboModules, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable TurboModules.

changelog: [Android][Deprecated] deprecate ReactFeatureFlags.useTurboModules

Reviewed By: philIip

Differential Revision: D60853315

fbshipit-source-id: 084ef8073daae16b288d82ececf770fd4b68e80c
2024-08-06 19:50:55 -07:00
David Vacca 3f35217856 Deprecate ReactFeatureFlags.enableFabricRenderer (#45921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45921

In this diff we are deprecating ReactFeatureFlags.enableFabricRenderer, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable fabric instead.

changelog: [Android][Deprecated] deprecate ReactFeatureFlags.enableFabricRenderer

Reviewed By: philIip

Differential Revision: D60853316

fbshipit-source-id: f9883a68771c8db8f24269630b0950e96741cf9d
2024-08-06 19:50:55 -07:00
Nick Gerleman 35d9a18b81 Fix "setTranslucentBackgroundDrawable()" deprecation version (#45856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45856

No time traveling allowed.

Changelog:
[Android][Fixed] - Fix "setTranslucentBackgroundDrawable()" deprecation version

Reviewed By: joevilches

Differential Revision: D60569284

fbshipit-source-id: 364b0cde6f5117523289a2720128f44fd0e9e7db
2024-08-06 19:07:17 -07:00
Alan Lee 60c38c37aa Update helloworld tempate to minSdk 24 (#45905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45905

- Updating minSdk to 24 before we do the update for the RN

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D60788291

fbshipit-source-id: d21d766159a04d79547e64fca802600279d08255
2024-08-06 17:13:48 -07:00
Omar Manjarrez Osornio fb67612e0b Revert D60453404: feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch
Differential Revision:
D60453404

Original commit changeset: bd7ce5bac8fa

Original Phabricator Diff: D60453404

fbshipit-source-id: cda549be11288fa6cda03a4e6798125bac3c95e2
2024-08-06 15:36:52 -07:00
Jorge Cabiedes Acosta c3e2390be2 Fix missing empty check on isOnlyColorMatrixFilters() (#45916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45916

When a Filter was removed by state update we missed this check which led to setting the layer type to HARDWARE incorrectly

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60840169

fbshipit-source-id: e375e7d25c85e9d031c1e1a0795c49687e0018e7
2024-08-06 15:07:39 -07:00
Nishan b99675d78a feat: linear gradient ios (#45434)
Summary:
- Adds `background` prop that supports CSS's linear gradient. Later this can be extended to support various other gradients and possibly CSS's background image (less motivation as better solutions exists for image)
- Uses `CAGradientlayer` to draw Linear Gradient layers. So it is GPU optimised under the hood.
- Style supports JS object to specify `LinearGradient`, so it can support Animated libraries.

## Changelog:
[IOS] [ADDED] - linear gradient

<!-- 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/45434

Test Plan:
- Check out `processBackground-test.js` for supported syntax testcases.
- Checkout example added in ViewExample.js

Although the PR is tested well but open to any changes/feedback on the approach taken.

Android PR - https://github.com/facebook/react-native/pull/45433. Separated the PRs to keep it easier to review. Both PRs can be reviewed individually.

Reviewed By: NickGerleman

Differential Revision: D60791581

Pulled By: joevilches

fbshipit-source-id: 051088fdf68d9fe20c0c306f1f1c591cbd77f3d5
2024-08-06 13:59:33 -07:00
Fred Liu 09fd7528b6 Revert D60648823: ship use of passive effects in Animated
Differential Revision:
D60648823

Original commit changeset: 8efa1dac2a42

Original Phabricator Diff: D60648823

fbshipit-source-id: 6deb00df29f8e2ba8cb58d252c40144d2bed229e
2024-08-06 13:48:30 -07:00
Nick Gerleman 05e8b1061a Recreate Shadow RenderNode Display List If Needed (#45915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45915

We avoid recomputing the RenderNode display list for shadow shape when the inputs have not changed, but Android may clear the display list itself, in which case we need to recreate it.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D60833553

fbshipit-source-id: fe1ea04b13f85dda6af2761693e7c664794235e1
2024-08-06 11:46:04 -07:00
Thomas Nardone d023e0aae5 Stop recycling before calling onViewStateDeleted v2 (#45913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45913

Changelog: [Internal] - Call ViewManagers' onSurfaceStopped() before onDropViewInstance()

This allows `ViewManager` to call `mRecyclableViews.remove(surfaceId)` before it wastes time on `prepareToRecycleView()` for views in a stopped surface.

Reviewed By: sammy-SC

Differential Revision: D60806242

fbshipit-source-id: d5eaaa5443fcb1d9390d8b84e0b5069618bb175e
2024-08-06 11:11:55 -07:00
Samuel Susla 8bf5a12ea2 fix crash in RefreshControl (#45914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45914

changelog: [internal]

Fix a crash when SwipeRefreshLayout uses a custom child.

According to the docs, [SwipeRefreshLayout must override canChildScrollUp](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#canChildScrollUp()) method if a custom view is used.

On Android, we do use a custom view: https://fburl.com/code/kfaj8q9z

Reviewed By: Abbondanzo

Differential Revision: D60829986

fbshipit-source-id: 09e6bc690bb66131d614b1eedfbede615f42d2e1
2024-08-06 10:42:07 -07:00
Nick Gerleman 9035008427 Add Screenshot Tests for Image border, background, shadows (#45885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45885

There are some gaps here right now, but Android API 31+ is looking good.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60731848

fbshipit-source-id: f515270a61a00c362b584f0d1549d14098c2e385
2024-08-06 09:25:34 -07:00
Blake Friedman 28597168aa Fix failing Publish @react-native-community/template step (#45910)
Summary:
In build_npm_package, the publishing of the bumped template is [failing](https://github.com/facebook/react-native/actions/runs/10148492447/job/28063424722)
because it's running in sh instead of bash, but using bash syntax.

## Changelog: [Internal]

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

Test Plan:
~~I'm unclear on how to test this, and the fix is very much speculative based on other having hit a similar issue.~~

I've had to stub some of the values that the action substitutes.

Reviewed By: cortinico

Differential Revision: D60828697

Pulled By: blakef

fbshipit-source-id: 0a8f909ae5219268f034e5ff0efb8acc94bdb7b1
2024-08-06 07:34:31 -07:00
Riccardo Cipolleschi 24e7f7d256 Try to restore caches for Hermes (#45908)
Summary:
We had CI on main failing consistently the past couple of days.
The problem is that the hermes pipeline is failing to create the iOS XCFramework with the error:
> unable to create a Mach-O from the binary at '/Users/runner/work/react-native/react-native/packages/react-native/sdks/hermes/destroot/Library/Frameworks/catalyst/hermes.framework/hermes'

The main cause is this upgrade of [upload-artifacts](https://github.com/actions/upload-artifact/issues/590) which breaks symlinks.

The solution is to bump the caches and downgrade the `upload-artifact` actions.
## Changelog:
[Internal] - Try to fix CI for Hermes

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

Test Plan: GHA must be green

Reviewed By: cortinico

Differential Revision: D60828616

Pulled By: cipolleschi

fbshipit-source-id: 6976b86dd67e2fd9d806ebaa62f47e39dc44b30d
2024-08-06 06:41:35 -07:00
Riccardo Cipolleschi c7d238da13 Do not cancel jobs on main when new commits are pushed
Summary:
Last month, during the migration to GHA, we decided to reimplement the same behavior we had in CCI: when a new commit comes in, we stop executing tests on the previous one.

This behavior is great to save money, but on main it has the side effect that it makes it hard to detect when the ci was broken.

\With this change, we want to disable this behvior on main while keeping it in PRs.

After this change, when a new commit arrives on main, the previous jobs will not be interrupted

## Changelog
[Internal] - Do not cancel jobs on main when new commits are pushed.

Reviewed By: cortinico, blakef

Differential Revision: D60822657

fbshipit-source-id: 38561438f2e2850a94220d732cd73a09d04e8b81
2024-08-06 06:37:58 -07:00
Oskar Kwaśniewski 21bdce7286 feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch (#45819)
Summary:
This PR implements the missing `automicallyAdjustsKeyboardInsets` for new architecture.

After fixing this I've noticed there is an open issue (https://github.com/facebook/react-native/issues/45647) with somebody assigned (sorry shubhamguptadream11 for taking your task)

Here is the app running on new arch:

https://github.com/user-attachments/assets/673f0587-6a67-47e3-8050-d6ee33a45724

## Changelog:

[IOS] [FIXED] - implement automicallyAdjustsKeyboardInsets for new arch

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

Test Plan:
1. Test out ScrollViewKeyboardInsets example
2. See if it works the same with old and new arch

Reviewed By: sammy-SC

Differential Revision: D60453404

Pulled By: cipolleschi

fbshipit-source-id: bd7ce5bac8facffc527106b50c54112acf687bc3
2024-08-06 04:15:49 -07:00
Pavel Gurkovskii 3572ef3f1b T183626616 - [KP][WP iOS v] App crashes after rotation in landscape view during playing a video. (#45846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45846

In general this diff fixes all crashes related to RTCImageUtills happened because of uncovered cases in switch.

In this current bug the problem was in this part of code
RCTTargetSize(imageSize, imageScale, frame.size, RCTScreenScale(), (RCTResizeMode)self.contentMode, YES);

when we cast UIViewContentMode to RCTResizeMode. RCTResizeMode doesnt cover all of UIViewContentMode values.

So just added default cases to swithces in places where it was lost.

Changelog:
[iOS][Fixed] - fixed crash in RCTImageUtils

Reviewed By: philIip

Differential Revision: D60523540

fbshipit-source-id: b8027537c600a7ca226e62238d16a6b05301d4de
2024-08-06 02:07:47 -07:00
Zeya Peng 67367a0bba Make normalizeEventType public (#45900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45900

Changelog: [internal]

make `normalizeEventType` public, it looks like a nice util when we want to write code to intercept event, e.g. "scroll" event could be named as "onScroll" or "topScroll", this function contains the source of truth of how RN parses it

Reviewed By: christophpurrer

Differential Revision: D60767388

fbshipit-source-id: b3880fda57e2d92d9d199db5f5d39b8a8435820c
2024-08-05 22:12:26 -07:00
Zeya Peng b0b898b460 ScrollEvent 2/n - use ScrollEvent over ScrollViewEventEmitter::Metrics (#45899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45899

Changelog: [internal]

replace ScrollViewEventEmitter::Metrics for ScrollEvent payload type created earlier
make ScrollViewEventEmitter::Metrics an alias of ScrollEvent as well

Reviewed By: christophpurrer

Differential Revision: D60767390

fbshipit-source-id: 8db88c0e1fa837b5dbad92d7bcce825882feaaf6
2024-08-05 22:12:26 -07:00
Zeya Peng e7caad2ee4 ScrollEvent 1/n - Create ScrollEvent payload (#45851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45851

Create ScrollEvent payload type, so we can unwrap the scroll event metrics if intercept it in C++

Changelog: [internal]

Reviewed By: christophpurrer

Differential Revision: D60526048

fbshipit-source-id: 219a690ccf67d0b1c90e3496b8e5970ab7e2a79b
2024-08-05 22:12:26 -07:00
Sam Zhou ae73fe462e Replace React$Element that will cause an error in the future
Summary:
For the ones where `React.MixedElement` would suffice, I change them to `React.MixedElement`. For everything else, I changed it to be `React.Element`

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60798229

fbshipit-source-id: 40176b44769aade2c6b63a680d03c10056b2ddfa
2024-08-05 18:42:05 -07:00
Sam Zhou 4f47b385fa Cleanup all uses of internal flow type React$ElementRef in react-native (#45904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45904

Flow will error on these dollar types soon. For all the ones changed here, they can all be further simplified.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60786768

fbshipit-source-id: e26bf0be1c4a933fc0bd8b59827e10cbd7242a83
2024-08-05 14:51:30 -07:00
Thibault Malbranche fbcb3d469c chore: changelog for 0.74.5 (#45898)
Summary:
Adds changelog for the 0.74.5 patch.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[Internal] [Changed] - Add 0.74.5 changelog

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

Reviewed By: christophpurrer

Differential Revision: D60768626

Pulled By: arushikesarwani94

fbshipit-source-id: 62196fc8a4fec1ff992ecc4622116b97dd96b79b
2024-08-05 13:30:07 -07:00
zhongwuzw 4e12c2e37c Fixes typo of function callFunctionOnBufferedRumtimeExecutor (#45902)
Summary:
I introduced a typo in https://github.com/facebook/react-native/issues/45486 . Thanks migueldaipre
 for the catch-up. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes typo of  function callFunctionOnBufferedRumtimeExecutor

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

Test Plan: Just a typo.

Reviewed By: cipolleschi

Differential Revision: D60775511

Pulled By: arushikesarwani94

fbshipit-source-id: da781ea5ecf2e0a15e5419430240e10194043b1b
2024-08-05 13:02:04 -07:00
Samuel Susla 9ee50e5db9 ship use of passive effects in Animated (#45893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45893

changelog: [internal]

This is mainly impact for the Event Loop where setting up of animation graph will no longer block paint.

Reviewed By: rubennorte

Differential Revision: D60648823

fbshipit-source-id: 8efa1dac2a42b14a609adae05e9266f78a181d43
2024-08-05 08:30:49 -07:00
Alex Hunt 7b34870564 Replace usage of Java OptionalInt (#45862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45862

Fixes compatibility with Android API < 24, and removes our `JOptionalInt` wrapper implementation for now.

Changelog: [Internal]

Reviewed By: robhogan, motiz88

Differential Revision: D60581676

fbshipit-source-id: 7e79fc59a4199a967e62ac3aeafc5d5681c60077
2024-08-05 08:15:45 -07:00
Jordan Brown fa3f769979 Deploy 0.242.0 to xplat (#45886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45886

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60688497

fbshipit-source-id: 09c6daeef56e87317cbdb5c9ee0a8bc0828fa4ce
2024-08-05 07:04:16 -07:00
Blake Friedman 8689aa48bb AdditionalAnimatedNode → Kotlin
Summary: Changelog: [Android][Changed] AdditionalAnimatedNode.java → Kotlin

Reviewed By: rshest

Differential Revision: D60523059

fbshipit-source-id: de4e60854a03b5a6f061882c03cf191998888015
2024-08-05 05:21:36 -07:00
generatedunixname89002005232357 a4cd5994a7 Revert D57327835 (#45884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45884

Pull Request resolved: https://github.com/facebook/react-native/pull/44569
Changelog:
[Internal] -
Reverting this diff due to internal build crashes:

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

Reviewed By: bvanderhoof

Differential Revision: D60707170

fbshipit-source-id: 95e66ebe725d0ff625b50f4711872b9f70ec2f7c
2024-08-03 00:36:01 -07:00
Thomas Nardone 8d4fd07469 Fix up UIManagerModuleConstantsHelper + test (#45877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45877

A couple fixes:
- Test was mixing up event names - refactored to make the code [hopefully] clearer
- Code potentially recreates `events` if it's a singleton map, but that was lost due to it not being returned

Changelog: [Internal] Minor fix to UIManagerModuleConstantsHelper

Reviewed By: cortinico

Differential Revision: D60609294

fbshipit-source-id: 3c82ba30b9401674e678585b1612324f885c9ae1
2024-08-02 13:58:32 -07:00
Thomas Nardone a696d2ed6b Deprecate MapBuilder and remove Kotlin usages (#45743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45743

This is a Java-centric class that can be replaced by Kotlin's map extensions.

Changelog:
[Android][Deprecated] Deprecate MapBuilder

Reviewed By: cortinico

Differential Revision: D60309106

fbshipit-source-id: 4a764fa1d59993dc735b2181a2270dc79a0e0396
2024-08-02 13:58:32 -07:00
zhongwuzw a778979ed6 Fixes main thread stuck when reload in bridgeless mode (#45486)
Summary:
In fabric bridgeless mode, when we reload, main thread may block because of dead lock. the backtrace example as below:

```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/1, stop reason = signal SIGSTOP
  * frame #0: 0x000000010a5c76f2 libsystem_kernel.dylib`__psynch_mutexwait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x00000001099e0a70 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 78
    frame https://github.com/facebook/react-native/issues/2: 0x00000001099de82b libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 217
    frame https://github.com/facebook/react-native/issues/3: 0x00007ff80030c6b9 libc++.1.dylib`std::__1::mutex::lock() + 9
    frame https://github.com/facebook/react-native/issues/4: 0x0000000106968b13 RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:35:10
    frame https://github.com/facebook/react-native/issues/5: 0x00000001069689ed RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:34:19
    frame https://github.com/facebook/react-native/issues/6: 0x00000001070691c1 RNTester`-[RCTInstance invalidate](self=0x000060000377c900, _cmd="invalidate") at RCTInstance.mm:146:31
    frame https://github.com/facebook/react-native/issues/7: 0x0000000107060fd2 RNTester`-[RCTHost didReceiveReloadCommand](self=0x0000600003d100f0, _cmd="didReceiveReloadCommand") at RCTHost.mm:317:3
    frame https://github.com/facebook/react-native/issues/8: 0x0000000106b005a5 RNTester`RCTTriggerReloadCommandListeners(reason=@"Global hotkey") at RCTReloadCommand.m:57:5
    frame https://github.com/facebook/react-native/issues/9: 0x0000000106b86da5 RNTester`__28-[RCTDevSettings initialize]_block_invoke.157(.block_descriptor=0x0000000107496170, params=0x00007ff84002f610) at RCTDevSettings.mm:201:11
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ae658e RNTester`__65-[RCTPackagerConnection reconnectingWebSocket:didReceiveMessage:]_block_invoke.68(.block_descriptor=0x0000600000c82df0) at RCTPackagerConnection.mm:293:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/12: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/13: 0x0000000109a563ee libdispatch.dylib`_dispatch_main_queue_drain + 1362
    frame https://github.com/facebook/react-native/issues/14: 0x0000000109a55e8e libdispatch.dylib`_dispatch_main_queue_callback_4CF + 31
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff800429af4 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame https://github.com/facebook/react-native/issues/16: 0x00007ff80042442f CoreFoundation`__CFRunLoopRun + 2463
    frame https://github.com/facebook/react-native/issues/17: 0x00007ff8004236ad CoreFoundation`CFRunLoopRunSpecific + 557
    frame https://github.com/facebook/react-native/issues/18: 0x00007ff8103da08f GraphicsServices`GSEventRunModal + 137
    frame https://github.com/facebook/react-native/issues/19: 0x00007ff805cc0ad1 UIKitCore`-[UIApplication _run] + 972
    frame https://github.com/facebook/react-native/issues/20: 0x00007ff805cc5551 UIKitCore`UIApplicationMain + 123
    frame https://github.com/facebook/react-native/issues/21: 0x00000001069205a0 RNTester`main(argc=1, argv=0x00007ff7b95e3b60) at main.m:15:12
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099023e0 dyld_sim`start_sim + 10
    frame https://github.com/facebook/react-native/issues/23: 0x0000000116b92366 dyld`start + 1942

(lldb) bt
* thread https://github.com/facebook/react-native/issues/3
    frame #0: 0x000000010a5c6b86 libsystem_kernel.dylib`__ulock_wait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x0000000109a46eb1 libdispatch.dylib`_dlock_wait + 46
    frame https://github.com/facebook/react-native/issues/2: 0x0000000109a46d08 libdispatch.dylib`_dispatch_thread_event_wait_slow + 40
    frame https://github.com/facebook/react-native/issues/3: 0x0000000109a5774a libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 371
    frame https://github.com/facebook/react-native/issues/4: 0x0000000109a57161 libdispatch.dylib`_dispatch_sync_f_slow + 240
    frame https://github.com/facebook/react-native/issues/5: 0x0000000106b3b33b RNTester`RCTUnsafeExecuteOnMainQueueSync(block=0x0000000106f116c0) at RCTUtils.m:291:5
  * frame https://github.com/facebook/react-native/issues/6: 0x0000000106f115ad RNTester`-[RCTFabricSurface start](self=0x000000010af0df40, _cmd="start") at RCTFabricSurface.mm:102:3
    frame https://github.com/facebook/react-native/issues/7: 0x00000001070601ce RNTester`__108-[RCTHost initWithBundleURLProvider:hostDelegate:turboModuleManagerDelegate:jsEngineProvider:launchOptions:]_block_invoke_2(.block_descriptor=0x0000600000c75590) at RCTHost.mm:211:9
    frame https://github.com/facebook/react-native/issues/8: 0x000000010706cdc8 RNTester`-[RCTInstance _loadScriptFromSource:](self=0x000060000377c900, _cmd="_loadScriptFromSource:", source=0x0000600000cd57d0) at RCTInstance.mm:472:5
    frame https://github.com/facebook/react-native/issues/9: 0x000000010706ca81 RNTester`__29-[RCTInstance _loadJSBundle:]_block_invoke.120(.block_descriptor=0x0000600000c96d00, error=0x0000000000000000, source=0x0000600000cd57d0) at RCTInstance.mm:452:9
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ab1919 RNTester`invocation function for block in attemptAsynchronousLoadOfBundleAtURL(.block_descriptor=0x00006000017b0fc0, statusCode=200, headers=6 key/value pairs, data=0x00006000002a4760, error=0x0000000000000000, done=YES) block_pointer, void (NSError*, RCTSource*) block_pointer) at RCTJavaScriptLoader.mm:318:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000106ad92a6 RNTester`__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke(.block_descriptor=0x000070000035c7a0, headers=6 key/value pairs, content=0x00006000002a4760, done=YES) at RCTMultipartDataTask.m:121:9
    frame https://github.com/facebook/react-native/issues/12: 0x0000000106ad9b4f RNTester`-[RCTMultipartStreamReader emitChunk:headers:callback:done:](self=0x00006000002b4220, _cmd="emitChunk:headers:callback:done:", data=0x00006000002a4020, headers=6 key/value pairs, callback=0x0000000106ad9230, done=YES) at RCTMultipartStreamReader.m:57:5
    frame https://github.com/facebook/react-native/issues/13: 0x0000000106ada800 RNTester`-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:](self=0x00006000002b4220, _cmd="readAllPartsWithCompletionCallback:progressCallback:", callback=0x0000000106ad9230, progressCallback=0x0000000106ab2a60) at RCTMultipartStreamReader.m:154:7
    frame https://github.com/facebook/react-native/issues/14: 0x0000000106ad9130 RNTester`-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:](self=0x00006000017b0d40, _cmd="URLSession:streamTask:didBecomeInputStream:outputStream:", session=0x000000010e02a0a0, streamTask=0x000000010c83ba00, inputStream=0x000060000300d4d0, outputStream=0x000060000300c990) at RCTMultipartDataTask.m:119:20
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff80479fdf9 CFNetwork`___lldb_unnamed_symbol2876 + 42
    frame https://github.com/facebook/react-native/issues/16: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/17: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/18: 0x0000000109a4e4ba libdispatch.dylib`_dispatch_lane_serial_drain + 1127
    frame https://github.com/facebook/react-native/issues/19: 0x0000000109a4f255 libdispatch.dylib`_dispatch_lane_invoke + 441
    frame https://github.com/facebook/react-native/issues/20: 0x0000000109a5c356 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 318
    frame https://github.com/facebook/react-native/issues/21: 0x0000000109a5b751 libdispatch.dylib`_dispatch_workloop_worker_thread + 590
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099dfb84 libsystem_pthread.dylib`_pthread_wqthread + 327
    frame https://github.com/facebook/react-native/issues/23: 0x00000001099deacf libsystem_pthread.dylib`start_wqthread + 15
```

## Changelog:

[IOS] [FIXED] - Fixes main thread stuck when reload in bridgeless mode

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

Test Plan: RNTester, enables fabric, which is very easy to repro by tapping `r`  command multiple times quickly to trigger reload.

Reviewed By: philIip

Differential Revision: D59911929

Pulled By: cipolleschi

fbshipit-source-id: e7e431a11d26c399fa767b6cbf45e16bce24b9a0
2024-08-02 13:48:31 -07:00
Ruslan Shestopalyuk 878e1f3d93 Migrate NativeArray classes to Kotlin (#44569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44569

# Changelog:
[Internal] -

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

NOTE: the `getArray`, `getMap` and `getString` being annotated as `NonNull` in the Java code is a scam - there is no guarantee that native side will send non-null to the Java side, and in practice, indeed, in certain cases it doesn't. So I opted to make it nullable instead - this way it's at least explicit and is not a ticking bomb hidden to explode behind the false sense of security.

Reviewed By: javache

Differential Revision: D57327835

fbshipit-source-id: 1b546b2ff22af2be903fe6ab91f0148b645595fb
2024-08-02 10:56:27 -07:00
Rubén Norte 631d4dea25 Migrate Web Performance API tests to Flow (#45875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45875

Changelog: [internal]

Just adopting Flow in all tests in `react-native/src/private` :)

Reviewed By: rshest

Differential Revision: D60654714

fbshipit-source-id: 34a9ae618fbd254044e2faf801adccc12fc0e244
2024-08-02 10:19:49 -07:00
Rubén Norte ed63646fc2 Move ErrorHandlers to react-native/src/private (#45876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45876

Changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D60597776

fbshipit-source-id: 1093aee0f2b84312b55a2b0c22e2b1576c60e26e
2024-08-02 10:19:49 -07:00
Rubén Norte e14b5f1d6f Move default export of PerformanceObserver to named export (#45874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45874

Changelog: [internal]

Move default export of `PerformanceObserver` to named export.

Reviewed By: sammy-SC

Differential Revision: D60597779

fbshipit-source-id: 39f82c1903aa32a5318b112cbb03b63e4e6d2fc0
2024-08-02 10:19:49 -07:00
Nicola Corti 52fc64c602 Unbreak build_android by not depending on PreferenceManager from androidx (#45872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45872

build_android is currently broken, this should fix it.

Changelog:
[Internal] [Changed] - Unbreak build_android by not depending on PreferenceManager from androidx

Reviewed By: cipolleschi, hezi

Differential Revision: D60652912

fbshipit-source-id: a089609c6643c40c95919fdc882a89406f6ce871
2024-08-02 09:14:01 -07:00
Ruslan Shestopalyuk 51278d3f30 Migrate UIManager interface to Kotlin (#44589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44589

## Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D57434432

fbshipit-source-id: ce2504d5a27a9e8dd8d8d02b052b6cf9414491ab
2024-08-02 07:10:36 -07:00
Ruslan Shestopalyuk de73e44569 Migrate Promise interface to Kotlin (#44587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44587

# Changelog:
[Internal] -

As in the title, moving towards migrating all the interfaces in react.bridge.

Reviewed By: tdn120

Differential Revision: D57433401

fbshipit-source-id: 35581d27d6d093edb1cc59b245e6468758825f68
2024-08-02 06:38:55 -07:00
Antony M. Kithinzi 491c3e9d76 chore: migrate GenerateCodegenArtifactsTaskTest to assertj (#45845)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [CHANGED] - Migrated `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenArtifactsTaskTest.kt` to assertj.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: hezi

Differential Revision: D60597025

Pulled By: cortinico

fbshipit-source-id: 4228b958c7b9e1506640b9ff217f098e2626ea81
2024-08-02 04:08:08 -07:00
Omar Bafagih ea78d68906 Migrate PackagerConnectionSettings.java to Kotlin (#45800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45800

convert PackagerConnectionSettings.java to PackagerConnectionSettings.kt

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60296462

fbshipit-source-id: 77a4ef164cd3405c3b7c85ecb301ae6e1d965e57
2024-08-01 14:28:57 -07:00
Ruslan Shestopalyuk c8a1da4c9e Migrate JavaTimerManager to Kotlin (#45820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45820

# Changelog:
[Internal] -

As in the title.

Reviewed By: mdvacca

Differential Revision: D60449157

fbshipit-source-id: c3c8ae9bcc270d421ee71deef0159477206c6ca3
2024-08-01 14:03:13 -07:00
Nicola Corti 9679756682 Re-apply Use BackgroundStyleApplicator in View setters on ReactImageView.kt
Summary:
This re-applies D60495100 after I've fixed the history for `ReactImageView`.

bypass-github-export-checks

Changelog:
[Internal] [Changed] - Re-apply Use BackgroundStyleApplicator in View setters on ReactImageView.kt

Reviewed By: NickGerleman

Differential Revision: D60578453

fbshipit-source-id: 995f5e54ea6ca3161935e8b7814df390d827a463
2024-08-01 13:31:06 -07:00
Nicola Corti fd231c5eaf Convert com.facebook.react.views.image to Kotlin
Summary:
This converts the 3 remaining files inside `com.facebook.react.views.image` to Kotlin

bypass-github-export-checks

Changelog:
[Internal] [Changed] - Convert com.facebook.react.views.image to Kotlin

Reviewed By: NickGerleman

Differential Revision: D60578452

fbshipit-source-id: 6a5951f1f74561c1c45fe697e7cfc68fcec92412
2024-08-01 13:31:06 -07:00
Nicola Corti 6393a3cd78 Back out "Convert com.facebook.react.views.image to Kotlin"
Summary:
bypass-github-export-checks

Changelog:
[Internal] [Changed] - Back out "[RN][Android] Convert com.facebook.react.views.image to Kotlin"

Original commit changeset: 72450d37969b

Original Phabricator Diff: D60170084

Reviewed By: sammy-SC, rshest

Differential Revision: D60578451

fbshipit-source-id: b6c57eaf1e3cceff43b10680f6b9abf53cbf8605
2024-08-01 13:31:06 -07:00
Nick Gerleman 5f14963da0 Breaking: Set "enableBackgroundStyleApplicator" by default (#45866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45866

This turns on enableBackgroundStyleApplicator() by default, which will get us more screenshot tests over existing apps, and let us add new screenshot tests for box-shadow against stock RNTester.

This is a breaking change, for the small number of libraries which use CSSBackgroundDrawable/ReactViewBackgroundDrawable off of a view directly, for setting or accessing styles (this was already unreliably), along with libraries which read `mBorderRadius` from views using reflection. This is more or less confined to Reanimated, react-native-navigation, and one internal library.

Users who want to access or mutate background styles should use the public `BackgroundStyleApplicator` instead.

Changelog:
[Android][Breaking] - Set "enableBackgroundStyleApplicator" by default

Reviewed By: joevilches

Differential Revision: D60365677

fbshipit-source-id: aab8588b27c1125920adb257406c53dadb356767
2024-08-01 12:06:40 -07:00
Abdelhafidh Belalia 48669af562 Android: Fix uploading GIF URI (#45826)
Summary:
In Android, when constructing a multipart body for a file and that file source is a uri (base64-encoded) we do the following:
1. Decode the base64 string into bytes
2. Create a bitmap object
3. Compress the bitmap object as PNG into new bytes

The process does an unnecessary work (bytes -> bitmap -> bytes) and creates unexpected results e.g. a GIF file will be converted into PNG when uploaded. This PR removes the unnecessary steps (2 and 3).

## Changelog:

[ANDROID] [FIXED] - Fix uploading GIF URI

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

Test Plan:
1. Upload a GIF; use URI (base64-encoded)
2. Verify that the uploaded file is a GIF

```js
const formData = new FormData();
formData.append('photo', {
  uri: GIFURI,
  type: 'image/gif',
  name: 'photo.gif',
});

fetch(UPLOAD_URL,
{
    body: formData,
    method: "POST",
}):
```

| Before | After |
|:------:|:-----:|
|   <video src="https://github.com/user-attachments/assets/6ce4769a-8fa5-4d00-8066-9a1911608632" />     |  <video src="https://github.com/user-attachments/assets/76a29d14-ce9d-48cd-94d0-7591064a5b1b" />      |

Reviewed By: cortinico

Differential Revision: D60515478

Pulled By: tdn120

fbshipit-source-id: d6ad1c42631c184c3dcdf3a956641e25d0c1b926
2024-08-01 12:04:42 -07:00
Jorge Cabiedes Acosta 54a6438eaa Fix default imageSource on Filters example (#45799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45799

No idea how I missed this but I don't think `defaultProps` is a thing in React Native? So the images were not showing

Changelog: [internal]

Reviewed By: joevilches

Differential Revision: D60392853

fbshipit-source-id: 27280033fb719340a809053d6ca98ac3f178c8c3
2024-08-01 10:38:53 -07:00
Nishan bd0aedc8c3 feat: linear gradient android (#45433)
Summary:
- Adds `background` prop that supports CSS's linear gradient. Later this can be extended to support various other gradients and possibly CSS's background image (less motivation as better solutions exists for image)
- Extended `CSSBackgroundDrawable` to draw Linear Gradient shader while preserving the border style support.
- Style supports JS object to specify `LinearGradient`, so it can support Animated libraries.

## Changelog:
[ANDROID] [ADDED] - linear gradient

<!-- 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/45433

Test Plan:
- Check out `processBackground-test.js` for supported syntax testcases.
- Checkout examples added in `LinearGradientExample.js`

Although the PR is tested well but open to any changes/feedback on the approach taken.

iOS PR - https://github.com/facebook/react-native/pull/45433. Separated the PRs to keep it easier to review. Both PRs can be reviewed individually.

Reviewed By: joevilches

Differential Revision: D60493360

Pulled By: NickGerleman

fbshipit-source-id: 762929c4fe16d87cbbd9ebe83ecce96a9e13192c
2024-08-01 09:38:51 -07:00
Ruslan Shestopalyuk 6483a28b3a Convert modules/core/ReactChoreographer to Kotlin (#45811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45811

# Changelog:
[Internal] -

Converts both ReactChoreographer.java and ChoreographerCompat.java to Kotlin.

Reviewed By: mdvacca

Differential Revision: D60445731

fbshipit-source-id: 597c9f2ea1a89ee13a210a4b3e172ea239297ae7
2024-08-01 06:59:40 -07:00
Ruslan Shestopalyuk c30ee464eb Kotlinify AnimationDriver (#45836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45836

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60502487

fbshipit-source-id: 003f2eade8f8425636b2023397ec29545175b487
2024-08-01 03:52:44 -07:00
Nick Gerleman fdfa0b17bb Enable BackgroundStyleApplicator and boxShadow for View (#45832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45832

The main one! This allows box-shadow to be used in View, and uses BackgroundStyleApplicator (if flag is enabled) for background management.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60491176

fbshipit-source-id: c068b1dc971253f1303de5bae62e42a9eceb0de6
2024-07-31 23:49:48 -07:00
Nick Gerleman 087193c98e Add missing invalidate() to setOverflow() (#45835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45835

`ReactViewBackgroundManager` will do this for us (and otherwise doesn't do anything draw related), but this will be removed when BackgroundStyleApplicator is rolled out, and not all callers use `ReactViewBackgroundManager`.

Changelog:
[Android][Fixed]

Reviewed By: philIip

Differential Revision: D60489756

fbshipit-source-id: 37cfc2b90af057bc142ad95b93e32941edb17ca5
2024-07-31 23:49:48 -07:00
Nick Gerleman 7047b7eaeb BackgroundStyleApplicator and boxShadow in TextInput (#45831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45831

Like the previous diffs, but for TextInput!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60489444

fbshipit-source-id: 13edc2fada0ef55a84916e6bdff151e4f8a16d34
2024-07-31 23:49:48 -07:00
Nick Gerleman f26027e3c0 BackgroundStyleApplicator and boxShadow in Text (#45830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45830

Like the previous diffs, but for Text!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60488060

fbshipit-source-id: 9ce89f65f44df75a83f86f14d2cbdfbf96f32a7c
2024-07-31 23:49:48 -07:00
Nick Gerleman 5d1a3bd07b Use BackgroundStyleApplicator in View setters (#45834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45834

These are very rarely called, outside of directly by the view manager, but they are still public, so we should make these work off the same composite drawable as the view managers (eventually BasrViewManager).

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60495100

fbshipit-source-id: 90f51870dd9929d1f3657d8f5368ef46216c8544
2024-07-31 23:49:48 -07:00
Nick Gerleman b988e1cb58 Handle resetting boxShadow prop (#45829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45829

`ReadableArray` here should be nullable, according to https://reactnative.dev/docs/next/native-components-android#3-expose-view-property-setters-using-reactprop-or-reactpropgroup-annotation

Filter is doing this correctly already.

That form will be used to reset state, back to no box shadows.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60465486

fbshipit-source-id: b8024ad02a0eabc0da8dfca141d51387983cc031
2024-07-31 23:49:48 -07:00
Nick Gerleman 92dca53702 Add borderStartWidth and borderEndWidth support (#45854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45854

Right now these border widths are incorporated into Yoga layout, but view manager never responds to it.

This adds the props supported by <View> to text, still missing many others. The underlying functions are aware of the spacing type,

I plan to fix this more thoroughly, across the different edges, properties, and different components, after we remove the legacy background stack, and all of these can live in a single place on BaseViewManager.

Changelog:
[Android][Fixed] - Add borderStartWidth and borderEndWidth support

Reviewed By: necolas

Differential Revision: D60560343

fbshipit-source-id: 8e1ebaa087e0728b5758850239c41aeae5d619a9
2024-07-31 22:32:23 -07:00
Kyle Rosenberg 8d6ec66b48 Update AccessibilityInfo mocks to return promises (#45825)
Summary:
Many `AccessibilityInfo` functions (`isReduceMotionEnabled`, `isBoldTextEnabled`, etc.) return promises, but the mocked versions of them in jest/setup.js aren't returning promises.

All of these functions live in [packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js), where you can verify their return types are Promises.

When using `react-native/jest-preset` and running tests that utilize one of these functions, you'll get an error:
```
AccessibilityInfo.isReduceMotionEnabled().then() is not a function
```

https://github.com/facebook/react-native/pull/29381 was opened in 2020 but closed after becoming stale. My PR is nearly identical but covers additional Promise-returning functions that have been added to `AccessibilityInfo` since then.

## Changelog:

[GENERAL] [FIXED] - Update the react-native/jest-preset mock of AccessibilityInfo to better match its API

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

Test Plan:
I've tested by making the change locally in my project's `node_modules/react-native/jest/setup.js` file and confirming that I no longer get an error when running this test:
```
it("should pass", async () => {
  await AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
    expect(enabled).toBe(false);
  });
});
```

Before:
```
TypeError: Cannot read properties of undefined (reading 'then')

  16 |
  17 |   it.only("should pass", async () => {
> 18 |     await AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
     |                                                    ^
  19 |       expect(enabled).toBe(false);
  20 |     });
  21 |   });
```

After: No type error, and test passes.

Reviewed By: robhogan

Differential Revision: D60519836

Pulled By: tdn120

fbshipit-source-id: 24fc77b0f9693e131686a0a45b81fbd33ff65f01
2024-07-31 12:35:41 -07:00
Thomas Nardone 2f651c8783 Convert common.ShakeDetector (#45744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45744

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60311462

fbshipit-source-id: 142649a18b365b0954dd138c895030fad4780ed1
2024-07-31 11:28:07 -07:00
Thomas Nardone 2962d69b67 Convert Convert ReactBuildConfig, ClearableSynchronizedPool, DebugServerException (#45680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45680

Changelog:
[Internal] [Changed] - Convert ReactBuildConfig, ClearableSynchronizedPool, DebugServerException to Kotlin

Reviewed By: rshest

Differential Revision: D60246428

fbshipit-source-id: de4584b84c18972b31370530b2ab4b2f9ab38b4a
2024-07-31 11:28:07 -07:00
Thomas Nardone 5812ee1969 Convert common.futures.SimpleSettableFuture (#45677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45677

Changelog:
[Internal] [Changed] - Convert com.facebook.react.common.futures.SimpleSettableFuture to Kotlin

Reviewed By: rshest

Differential Revision: D60237075

fbshipit-source-id: e8a94fa3bb5d09da85b13d86b55a020d42a770cd
2024-07-31 11:28:07 -07:00
Thomas Nardone fbfb430b3b Convert common/assets/ReactFontManager.java (#45668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45668

Changelog:
[Internal] [Changed] - Convert com.facebook.react.common.assets.ReactFontManager to Kotlin

Reviewed By: cortinico

Differential Revision: D60188666

fbshipit-source-id: 17ca6f162545e9185e1e0a24d8ebacf6cb49a064
2024-07-31 11:28:07 -07:00
Alan Lee 34e3a6cc88 provide default implementation for ReactHostDelegate.handleInstanceException() (#45521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45521

[ReactHostDelegate.handleInstanceException()](https://github.com/facebook/react-native/blob/a6f5e5adebed3d9da411f99548e2d8ce96636e16/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt#L48) is a no-op so providing a default implementation for this.
As a simplified solution, just throw a `RuntimeException` (on non-debug bulid) in this case. Below is the justification.

1) We may want to consider using `ExceptionsManagerModule` TurboModule in OSS to report the exception but current implementation  just [throws JavaScriptException](https://github.com/facebook/react-native/blob/a6f5e5adebed3d9da411f99548e2d8ce96636e16/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java#L67) when it is fatal

2) If the exception happens during ReactInstance initialization then we may not have Turbo Module initialized and may not be able to access it. While we might want to fix how this works in longer term but for now just throw an Exception and let the app handle it.

3) In debug build, `DevSupportManager` is called before `handleInstanceException()` which would display a RedBox so don't throw when it is a debug build.

So it seems to best for now to just throw an exception so it can be handled by the app than silently ignoring it.

Changelog:
[Android][Added] - provide default implementation for ReactHostDelegate.handleInstanceException()

Reviewed By: javache

Differential Revision: D59847543

fbshipit-source-id: 0dd3c7688d13d159dfceb8defc8d0250273ef2ff
2024-07-31 11:23:34 -07:00
omer-ayhan 84de32b2d7 chore: ☂️ Migrate BundleHermesCTaskTest.kt to AssertJ (#45806)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:
[INTERNAL] [CHANGED] - Migrate `BundleHermesCTaskTest.kt` to AssertJ testing library

<!-- 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/45806

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca

Differential Revision: D60522760

Pulled By: cortinico

fbshipit-source-id: f7847143d182b29e1bbbba738a0ddae9bf3ee59c
2024-07-31 11:08:30 -07:00
Bogusz Kaszowski 2b39e6307e chore: migrate PrepareJSCTaskTest to assertj (#45842)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[ANDROID] [CHANGED] - Migrated `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareJSCTaskTest.kt` to assertj.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca, arushikesarwani94

Differential Revision: D60519806

Pulled By: cortinico

fbshipit-source-id: 04e6a35ecafcb08e6935599d863ab62180383ac4
2024-07-31 11:01:18 -07:00
Joe Vilches acb634bc96 Fix case where certain spreads break box shadow logic (#45746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45746

Once the spread was past a certain value, it could break some of this logic by creating a null rect or negative size. This just makes it so that in those cases, inset will be a 0x0 clear region rect and outset will be nothing

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60317780

fbshipit-source-id: 021bf41d71ae69809076b4f5e6413d04cd878372
2024-07-31 10:13:20 -07:00
Joe Vilches 49a7a7d58b Get inset box shadow to play nicely with borders (#45681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45681

This diff fixes 2 related issues that arise when we add a border to the view with box shadow

1) The shadow fills the padding box and not the border box. To fix this we just need to subtract the edge insets (border width) from both the shadow size and the clear region size. We also need to change the clipping area to clip anything outside the padding box
2) The corner radius of the clear region is based on the corner insets, so border radius - border width

The first change required a bit of thinking on my part to remember what bits of the crazy arithmetic here needed to change. So I refactored a bit:

* The general theme now is that all of the rects are derived from one another, and make use of CGRectOffset and CGRectInset to make their necessary adjustments.
* We introduce `shadowFrame` which is just the frame of the shadow area - agnostic of things like blur padding and offscreen shenanigans. So its the size of the layer insetted by the border widths.
* From this we can derive our 2 offscreen rects. The `shadowCastingRect` outsets the shadow frame by the blurRadius, while the `clearRegionRect` insets by spread distance. We then use `CGRectOffset` to push it offscreen. We save this offset so we can use it later to get the CG shadow back in place (since this is all originally derived from `shadowFrame`.
* There is now a single place that dictates the size of the shadow (`shadowFrame`), and a single place that dictates the offset to push our rects offscreen. The necessary change to trace padding box and not content box therefore just needs to change `shadowFrame` as opposed to 4 other spots.
* Additionally, when we offset, we do not need to worry about things like spread and blur, since `CGRectInset` takes care of that along with the size

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60201959

fbshipit-source-id: 4ecf0e0db8ce9d54f08e89adec94d50eb19a26a3
2024-07-31 10:13:20 -07:00
Joe Vilches 4fef34e1fd Don't call cornerRadiiForBoxShadow if we don't have to (#45679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45679

`cornerRadiiForBoxShadow(cornerRadii, 0)` no-ops since there is no spread, and it returns the same type as it takes as an input, so there is no point for this complexity

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60203620

fbshipit-source-id: c1f86ce6e8fef07365ab57caa3e906f1601a0c2b
2024-07-31 10:13:20 -07:00
Joe Vilches e6ef47aff8 Simplify some clipping logic for inset shadows (#45678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45678

This doesn't need to be an explicit path, its just tracing out a rect. CG has a method for that

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60202842

fbshipit-source-id: 61faa21e57b1341c3b96961f12503eb4a7f3020b
2024-07-31 10:13:20 -07:00
Ruslan Shestopalyuk 71b5f04986 HeadlessJsTaskSupportModule.java->.kt (#45816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45816

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico, mdvacca

Differential Revision: D60446972

fbshipit-source-id: 318f091b0ee697ac241d73e309bd13ae2ffdbe19
2024-07-31 10:00:22 -07:00
Ruslan Shestopalyuk 395f46c847 Convert ExceptionManagerModule to Kotlin (#45812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45812

# Changelog:
[Internal] -

As in the title.

Reviewed By: mdvacca

Differential Revision: D60446630

fbshipit-source-id: 9d27e13735c7d2ae6f1d0e3259ef962513665050
2024-07-31 10:00:22 -07:00
Ruslan Shestopalyuk 3735cb3d4f modules/core/TimingModule to Kotlin (#45815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45815

# Changelog:
[Internal] -

As in the title.

Reviewed By: alanleedev

Differential Revision: D60446859

fbshipit-source-id: 0ca52c59e2bbaa18c751f4459afac811e9c89703
2024-07-31 08:38:18 -07:00
Ruslan Shestopalyuk 6742af4a9d DeviceEventManagerModule.java->.kt (#45811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45811

# Changelog:
[Internal] -

Converts both ReactChoreographer.java and ChoreographerCompat.java to Kotlin.

Reviewed By: alanleedev

Differential Revision: D60446332

fbshipit-source-id: b762dfcd53bb781483c8a1df19faa0c6a0065f11
2024-07-31 08:38:18 -07:00
Samuel Susla 53d2f8e8d6 do a bounds check in TouchTargetHelper (#45824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45824

changelog: [internal]

add a bounds check to prevent crash in TouchTargetHelper.

as it turns out, firstReactAncestor may be bigger than the size of pathAccumulator.

Reviewed By: christophpurrer

Differential Revision: D60449741

fbshipit-source-id: 4e981d06877e26d278c4567beebebd82262f60d0
2024-07-31 07:46:22 -07:00
Rubén Norte c3dbebff5a Force accesses to ReactFabric to always go through proxy (#45822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45822

Changelog: [internal]

## Context

`react-native/Libraries/Renderer/shims/ReactFabric` is the default module to load the RN renderer and loading it has side-effects (among other things it sets `global.RN$stopSurface`.

We introduced a proxy module (`RendererProxy`) so we could use dependency injection to overwrite the renderer module with a custom implementation (the original goal was to be able to use a renderer version that didn't pull paper and only used Fabric).

Unfortunately, using both the proxy and the module directly in some places leads to race conditions setting `global.RN$stopSurface`, which causes some screens to be rendered with one renderer and unmounted/disposed with a different one (because we accessed `ReactFabric` later and set `RN$stopSurface` from a different renderer implementation). When this happens, the unmount request in the other renderer is a no-op because no surface was renderer in it.  This leads to surfaces not being disposed.

## Changes

This modifies the proxy to add additional functions and modifies all other modules in the package to make sure that all the accesses to the renderer go through the proxy.

Reviewed By: sammy-SC

Differential Revision: D60452544

fbshipit-source-id: 1b17a95ed9b1c529718f22983dde1f00f1b2adae
2024-07-31 07:02:16 -07:00
Ruslan Shestopalyuk f8f85be8b5 Migrate react/modules/fresco to Kotlin (#45750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45750

# Changelog:
[Internal] -

This migrates the whole module of `react/modules/fresco` from Java to Kotlin.

Reviewed By: defHLT

Differential Revision: D60334554

fbshipit-source-id: b66695215b82495253aa2ac78b33c64c703347af
2024-07-31 06:52:50 -07:00
omer-ayhan 575ab78625 chore: ☂️ Migrate GenerateCodegenSchemaTaskTest.kt to AssertJ (#45807)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:
[INTERNAL] [CHANGED] - Migrate `GenerateCodegenSchemaTaskTest.kt` to AssertJ testing library

<!-- 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/45807

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: andrewdacenko

Differential Revision: D60509334

Pulled By: cortinico

fbshipit-source-id: 0702958f0c9d03994b0c9a6a1c743f5db84e5703
2024-07-31 04:53:18 -07:00
omer-ayhan 9cd3c57840 chore: ☂️ Migrate PreparePrefabHeadersTaskTest.kt to AssertJ (#45808)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:
[INTERNAL] [CHANGED] - Migrate `PreparePrefabHeadersTaskTest.kt` to AssertJ testing library

<!-- 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/45808

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: andrewdacenko

Differential Revision: D60509282

Pulled By: cortinico

fbshipit-source-id: 1b7d9f0c24bb0e8e573f685582c532a38e6b3b13
2024-07-31 04:45:02 -07:00
Nicola Corti 6484070ad7 Convert com.facebook.react.views.image to Kotlin (#45645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45645

This converts the 3 remaining files inside `com.facebook.react.views.image` to Kotlin

Changelog:
[Internal] [Changed] - Convert com.facebook.react.views.image to Kotlin

Reviewed By: javache

Differential Revision: D60170084

fbshipit-source-id: 72450d37969b84e0d31d4902c0ef0d520419f7a9
2024-07-31 04:11:59 -07:00
Deepanshu.shukla d88dd14507 fix: onChangeText should be called only once if changed via js in a multiline textinput (#45401)
Summary:
Fixes [44566](https://github.com/facebook/react-native/issues/44566)

Issue was onChangeText was called 5-6 times if maxLength was set in a multiline component and TextInput Value was changed via state update.
`if (_maxLength) {
    NSInteger allowedLength = MAX(
        _maxLength.integerValue - (NSInteger)backedTextInputView.attributedText.string.length + (NSInteger)range.length,
        0);

    if (text.length > allowedLength) {
      // If we typed/pasted more than one character, limit the text inputted.
      if (text.length > 1) {
        if (allowedLength > 0) {
          // make sure unicode characters that are longer than 16 bits (such as emojis) are not cut off
          NSRange cutOffCharacterRange = [text rangeOfComposedCharacterSequenceAtIndex:allowedLength - 1];
          if (cutOffCharacterRange.location + cutOffCharacterRange.length > allowedLength) {
            // the character at the length limit takes more than 16bits, truncation should end at the character before
            allowedLength = cutOffCharacterRange.location;
          }
        }
        // Truncate the input string so the result is exactly maxLength
        NSString *limitedString = [text substringToIndex:allowedLength];
        NSMutableAttributedString *newAttributedText = [backedTextInputView.attributedText mutableCopy];
        // Apply text attributes if original input view doesn't have text.
        if (backedTextInputView.attributedText.length == 0) {
          newAttributedText = [[NSMutableAttributedString alloc]
              initWithString:[self.textAttributes applyTextAttributesToText:limitedString]
                  attributes:self.textAttributes.effectiveTextAttributes];
        } else {
          [newAttributedText replaceCharactersInRange:range withString:limitedString];
        }
        backedTextInputView.attributedText = newAttributedText;
        _predictedText = newAttributedText.string;

        // Collapse selection at end of insert to match normal paste behavior.
        UITextPosition *insertEnd = [backedTextInputView positionFromPosition:backedTextInputView.beginningOfDocument
                                                                       offset:(range.location + allowedLength)];
        [backedTextInputView setSelectedTextRange:[backedTextInputView textRangeFromPosition:insertEnd
                                                                                  toPosition:insertEnd]
                                   notifyDelegate:YES];

        [self textInputDidChange];
      }

      return nil; // Rejecting the change.
    }}`

This is the original code snippet.
It was happening because of wrong check of maxLength with text length `if (text.length > allowedLength)` this  should be
`(text.length > _maxLength.integerValue)`  and `if (allowedLength <= 0)`  we should not change the string and fire `textInputDidChange`

## Changelog:
[IOS] [FIXED] : Fixing maxLength check which was firing onChange multiple times

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

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

Test Plan:
Tested in Ios
Ran yarn test
<img width="1661" alt="Screenshot 2024-07-12 at 1 00 28 PM" src="https://github.com/user-attachments/assets/fbad94a8-9989-4252-ad7d-e507d4eafd9e">

Reviewed By: sammy-SC

Differential Revision: D59911745

Pulled By: cipolleschi

fbshipit-source-id: 67410ec50d6a2415e568e1685699bfed02fd0a27
2024-07-31 04:06:14 -07:00
Riccardo Cipolleschi f8c13f601d Declare onUserDrivenAnimationEnded on Old Arch (#45838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45838

Some Internal tests in the old architecture were failing after landing [#45414](https://github.com/facebook/react-native/pull/45414) because the `RCTNativeAnimatedModule` in the old architecture was not declaring the event.

This change fixes it by declaring the event that is never fired in the Old Architecture as it is not needed.

## Changelog
[iOS][Added] - Declare the `onUserDrivenAnimationEnded` in the old Architecture

Reviewed By: sammy-SC

Differential Revision: D60507812

fbshipit-source-id: eb12563c6551204bcf98f3a2001e1efcf84ef05e
2024-07-31 03:47:33 -07:00
Arushi Kesarwani a5b84b9258 Migrate enableViewRecycling to ReactNativeFeatureFlags (#45654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45654

Migrate enableViewRecycling to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: mdvacca

Differential Revision: D60153238

fbshipit-source-id: 14980174cb21833e35e107dc4cf52867cd0a5f8e
2024-07-31 00:14:55 -07:00
Nick Gerleman 59da1ab160 BackgroundStyleApplicator and boxShadow in horizontal scroll views (#45809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45809

Port D60409795 from vertical scroll views to horizontal scroll views.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D60410682

fbshipit-source-id: b26e1ce2614605d56671d3cbe8e1e385174d7d40
2024-07-30 15:46:28 -07:00
Nick Gerleman d842fc6293 BackgroundStyleApplicator and boxShadow in vertical scroll views (#45803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45803

This makes the same rough changes as I made to images, to apply background styles in view manager layer, using BackgroundStyleApplicator, including new boxShadow style property.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D60409795

fbshipit-source-id: 304cb99855de72fe36af33cdda4a150e21b629b9
2024-07-30 15:46:28 -07:00
Nick Gerleman be3936762f Workaround gap between border and outer box shadow (#45797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45797

Android borders are drawn using a path generated by `addRoundRect()` inset by half the border width, using the full border width as stoke width. The edges of the ellipsis drawn for rounded borders do not line up with the math used to trace the bounding border-box path.

In a relatively similar hack to elsewhere in border drawing code for gap between content and the border, we inset the clipOut path, as if its bounding rectangle were about half a subpixel smaller, to mininally overlap the border on these edges. We then place the outer box shadows under the border in z-ordering, so that the minimal extra insetting is only visible with transparent backgrounds.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60389685

fbshipit-source-id: 8c449cc3eee1a3e4100f06fd87f27ae341e02eac
2024-07-30 15:46:28 -07:00
Nick Gerleman 32d040380f Add Image Box Shadow Examples (#45781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45781

This adds some RNTester examples for `boxShadow`, that render correctly when `ReactNativeFeatureFlags.enableBackgroundStyleApplicator()` is set!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60367850

fbshipit-source-id: 3c9ae2bf906ae923c713b5f36cd2000f612fe3dc
2024-07-30 15:46:28 -07:00
Riccardo Cipolleschi 23c5c42de0 Back out "React to onUserDrivenAnimationEnded event in JS"
Summary:
Backout of the [commit](https://github.com/facebook/react-native/commit/afa887b6225352d35ed99eb5271bef8a3fe1c7d6) to react to the new event as it is breaking internal tests.

## Changelog:
[General][Changed] - Revert React to onUserDrivenAnimationEnded event in JS

Reviewed By: mdvacca, arushikesarwani94

Differential Revision: D60467143

fbshipit-source-id: c70bb057adf49b5f26df4201f8b987bf6b876f46
2024-07-30 13:06:15 -07:00
Riccardo Cipolleschi 488faaaddb Back out "Remove _shouldEmitEvent guardrails"
Summary:
Backout of this [commit]() as the previous one was making some E2E fail and need to investigate further.

## Changelog:
[Internal] - Add back `_shouldEmitEvent` guardrails

Reviewed By: mdvacca, arushikesarwani94

Differential Revision: D60467145

fbshipit-source-id: a703022aa74ca0ed0fed05b59da68918eb2001e1
2024-07-30 13:06:15 -07:00
Rubén Norte 48421df60a Refactor setup modules in src/private/setup as side-effect free modules (#45795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45795

Changelog: [internal]

Our modules to set up the runtime have side-effects and depend on import order to work correctly. This is error-prone and complicates the migration to ESM in some cases, so this refactors all of them in `src/private/setup` to export a function instead.

Reviewed By: rshest

Differential Revision: D60382506

fbshipit-source-id: 9ac30b29659b74605d59eb97562d6cbf01f48e47
2024-07-30 10:08:22 -07:00
Rubén Norte b74c4f6643 Move setup files for PerformanceObserver to react-native/src/private/setup (#45793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45793

Changelog: [internal]

These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.

Reviewed By: rshest

Differential Revision: D60381603

fbshipit-source-id: bba62b56c42817b15bb28bce22d6c2cf668dc797
2024-07-30 10:08:22 -07:00
Rubén Norte 8a4ddab2c2 Move MutationObserver to react-native/src/private (#45791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45791

Changelog: [internal]

These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.

Reviewed By: rshest

Differential Revision: D60377869

fbshipit-source-id: 02bc0335385859c0589a494de9b59b0c2ebc06f6
2024-07-30 10:08:22 -07:00
Rubén Norte e84d313209 Move IntersectionObserver to react-native/src/private (#45792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45792

Changelog: [internal]

These files are safe to move because they haven't been enabled in OSS and people shouldn't be importing them directly.

Reviewed By: rshest

Differential Revision: D60377868

fbshipit-source-id: db0ec2839af91620fe8b6d3927ad0b809d1bdf23
2024-07-30 10:08:22 -07:00
Rubén Norte 3917b71168 Restructure files in src/private/core (#45784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45784

Changelog: [internal]

I originally created `src/private/core` as a directory to contain set up files for RN, but the name wasn't implying that and ended up holding more stuff.

This moves everything out of that directory and renames it as `src/private/setup` so it has a clearer scope.

Reviewed By: NickGerleman

Differential Revision: D60290620

fbshipit-source-id: b5dc27fbaa64df9a8a09a84f02023896f6fd2884
2024-07-30 10:08:22 -07:00
Riccardo Cipolleschi dae9c5c0f7 Remove _shouldEmitEvent guardrails (#45476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45476

Land this after [#45457](https://github.com/facebook/react-native/pull/45457) lands.

After [#45457](https://github.com/facebook/react-native/pull/45457) there is no need to check for listeners to the native event as we will have those listeners for sure.

## Changelog
[Internal] - Remove `_shouldEmitEvent` guardrails as we always have listeners

Reviewed By: sammy-SC

Differential Revision: D59811656

fbshipit-source-id: 91b572ea35562638ad64082b4b0d9af766ddc0bc
2024-07-30 08:25:22 -07:00
Riccardo Cipolleschi afa887b622 React to onUserDrivenAnimationEnded event in JS (#45414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45414

This change completes the fix for broken pressable when animations were applied to components with native driven animations.

When creating the AnimatedProps, if they are natively drive animation, we look for the AnimatedValue involved and we register a listener. This is needed to make sure that the NativeModule will send te updated value upon calling the `update` function.

Then, when observing the props lifecycle, it register a listener to the new `OnUserAnimationEnded` event, fired by the NativeAnimation module.

When the `OnUserAnimationEnded` event is fired, the AnimatedProps will update the props that depends on the user driven animation.

## Changelog
[General][Fixed] - reallign the shadow tree and the native tree when the user finishes interacting with the app.

Reviewed By: sammy-SC

Differential Revision: D59681428

fbshipit-source-id: c6690c41ea6d5517b7f8413e9dba1e12861a2400
2024-07-30 08:25:22 -07:00
Thibault Malbranche 076c28ced9 chore: changelog for 0.74.4 (#45818)
Summary:
Adds changelog for the 0.74.4 patch.

bypass-github-export-checks

## Changelog:

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

Pick one each for the category and type tags:

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

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

[Internal] [Changed] - Add 0.74.4 changelog

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

Reviewed By: cortinico

Differential Revision: D60448807

Pulled By: cipolleschi

fbshipit-source-id: 9737523dccf767091a6f1c1e076f8a192d0e5136
2024-07-30 07:46:00 -07:00
Ruslan Shestopalyuk 7903dba7ac Kotlinify FrameBasedAnimationDriver (#45764)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45764

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60348765

fbshipit-source-id: 1507d802044eb59c7d224ee313ae98c96468f0cd
2024-07-30 06:17:30 -07:00
Andrew Datsenko df7e0d0fa5 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager:interfacesAndroid (#45740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45740

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D58743877

fbshipit-source-id: 57c338728d360556221a761435009cbc2f24e5d8
2024-07-30 05:45:47 -07:00
Andrew Datsenko 995d4b4c36 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/SimpleSpringInterpolator.java (#45739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45739

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D60233508

fbshipit-source-id: fcf666cb5d2a935c85b0b4507739d002b58f8141
2024-07-30 05:40:59 -07:00
Ruslan Shestopalyuk 4d647be848 Kotlinify modules/core interfaces (#45787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45787

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60377675

fbshipit-source-id: 80670c6a996ea3bbc4adce9733be0e0f81223514
2024-07-30 05:29:58 -07:00
Ruslan Shestopalyuk 3c6ea7e7ce Kotlinify EventAnimationDriver (#45766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45766

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60348157

fbshipit-source-id: 02a7053025ede3662473c5fa2cfadd637e2413b2
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk 163db1dab1 Kotlinify InterpolationAnimatedNode (#45759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45759

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60348112

fbshipit-source-id: dad6089ba2deeb99c293eecbd663b17258f0a1f0
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk c1e0e3b09d Migrate SpringAnimation to Kotlin (#45760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45760

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60347906

fbshipit-source-id: c4cc9303aee823b2105cb871d7681a101fcdef0a
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk 2e3fa241e3 TransformAnimatedNode Java->Kotlin (#45765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45765

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60347833

fbshipit-source-id: 81a98b1e90fe6408f540741b96a15072c329f793
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk d61834c924 Kotlinify SubtractionAnimatedNode (#45763)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45763

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60347765

fbshipit-source-id: 3cf367b363f6831f0e7506b4c81c7c4ae9ba5ad6
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk ef9149b4fc ve[RN][Android] Convert StyleAnimatedNode.java->.kt (#45761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45761

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60342089

fbshipit-source-id: b780506c925e62d0b861a0c5d50794f617ab51f9
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk e51658abef Migrate DivisionAnimatedNode, Java->Kotlin (#45762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45762

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60341635

fbshipit-source-id: 2d897ee0727ba7608eced9c3b22bac852c22254f
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk 675a2a1d76 PropsAnimatedNode.java->.kt (#45757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45757

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60341400

fbshipit-source-id: 4c9e530cfce025815dd35a750a4f41960091472e
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk 23472279ca Migrate MultiplicationAnimatedNode to Kotlin (#45756)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45756

# Changelog:
[Internal] -
As in the title.

Reviewed By: cortinico

Differential Revision: D60340884

fbshipit-source-id: df1e797d20abe87569288715923df3105f14075b
2024-07-30 05:22:16 -07:00
Ruslan Shestopalyuk c707027c21 ColorAnimatedNode convert Java->Kotlin (#45752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45752

# Changelog:

[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60336724

fbshipit-source-id: 57c25014f1e00ccc340051ca64ba15900478082d
2024-07-30 05:22:16 -07:00
Riccardo Cipolleschi bd51fcd58e Add changelog for 0.75-RC6 (#45802)
Summary:
Changelog PR for 0.75.0-RC.6

## Changelog:
[Internal] - Changelog

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

Test Plan: N/A

Reviewed By: blakef

Differential Revision: D60409741

Pulled By: cipolleschi

fbshipit-source-id: 3f95c9cfcc6ba80c9287f3a72effcfe332d9f68d
2024-07-30 02:38:14 -07:00
Nick Gerleman 1c1c8335db Enable box shadows for Image (#45693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45693

This wires box shadow application for `ReactImageViewManager` to `BackgroundStyleApplicator` for setting shadows. This same logic will get copy-pasted to other view managers later up the stack (including Vito images, ScrollViews, etc, then eventually View), until we are able to consolidate to BaseViewManager.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60266016

fbshipit-source-id: eaa842f539ee1654ab719c7d341b4b748db7a15c
2024-07-29 20:02:55 -07:00
Nick Gerleman 496e77b85c Fix crash from boxShadow conditional canvas.save() (#45780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45780

D59300215 noticed that the drawable was leaking a clipping rect for the rest of the operations, and added a `save/restore` pair, but the save happens conditionally, so we can restore more often than we save, if we hit a fast path of not needing to invalidate the shadow RenderNode when drawing. This leads to the following unhandled exception:

```
java.lang.IllegalStateException: Underflow in restore - more restores than saves
    at android.graphics.Canvas.restore(Canvas.java:647)
    at com.facebook.react.uimanager.drawable.OutsetBoxShadowDrawable.draw(OutsetBoxShadowDrawable.kt:110)
    at android.graphics.drawable.LayerDrawable.draw(LayerDrawable.java:1019)
```

This change moves saving canvas context to before setting state and drawing onto the canvas, instead of the area manipulating the RenderNode.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60375357

fbshipit-source-id: 773c733fce11ce89ab6741589eea19b6f060f9a3
2024-07-29 16:10:37 -07:00
Nick Gerleman cf9bad0aae Revert D60291091: Invert podspec to allowlist platform files
Differential Revision:
D60291091

Original commit changeset: a0f7e3181ec5

Original Phabricator Diff: D60291091

fbshipit-source-id: 79c9a0510cddc06af499ab8dcdb8512aa718a07c
2024-07-29 15:54:47 -07:00
Nick Gerleman 76e8245846 Use BackgroundStyleApplicator for Image (#45692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45692

This moves to using `BackgroundStyleApplicator` instead of `ReactViewBackgroundManager`, or Fresco based drawing, for setting background/border style props when the feature gates are right.

This will be ported to Vito (and... all the other built-in views) later up the stack.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60265326

fbshipit-source-id: d9dea8d35eeb09a10d012c3ab93957dbf2ebfdd7
2024-07-29 15:12:28 -07:00
Nick Gerleman c9145cd6fe Add "enableBackgroundStyleApplicator" feature flag (#45689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45689

Going to use this to gate usage of the applicator, for each of the components, including `<View>`, which

This also conveniently sidesteps some unsavory reflection on View member happening that we can't clean up yet.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60265327

fbshipit-source-id: fabac3ac8479ff359ae6d798407047287dc712f9
2024-07-29 15:12:28 -07:00
Nick Gerleman 1a78477ce5 Add CompositeBackgroundDrawable and BackgroundStyleApplicator (#45688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45688

Box shadows are handled as part of different drawables. We have other cases where we want to show multiple drawables at once, such as for ripple feedback, or more commonly, for app-wide TextInput styles (which adds padding).

With more multi-background scenarios in the future, and CSSBackgroundDrawable already way overloaded, the arch here I want to go towards is less drawables, as hidden implementation details, with single responsibilities, more often switched out. Once path logic is extracted, this would also allow for better fast-paths, like not needing to create a (heavy) CSSBackgroundDrawable, for simple views with a color background.

`CompositeBackgroundDrawable` is then a more structured LayerDrawable, which also lets us mutate or retrieve information from specific layers, and enforces the different types of layers are correctly z-ordered.

`BackgroundStyleApplicator` is the public API for manipulating these styles, inspired by the existing `ReactViewBackgroundManager`. There are some important design differences.

1. The only per-view state is the publicly accessible background drawable. This means the applicator can be used on arbitrary views, and eventually used in BaseViewManager for all views (once all the QEs settle)
2. We have reliable accessors for every setter, which seem to be what folks use externally for animation
3. We work consistently in CSS device independent pixels (for the most part...)
4. More structure/safety in how we refer to edges vs uniform
5. Overflow state is not kept on the applicator, so views can set/keep their own defaults

Overflow clipping must still be implemented per-view, during drawing unfortunately.

Changelog:
[Android][Added] - Add BackgroundStyleApplicator for managing view backgrounds

Reviewed By: joevilches

Differential Revision: D60252279

fbshipit-source-id: 4c6da3e128d4da94f35d50c30c7c412cb513cc12
2024-07-29 15:12:28 -07:00
Eric Rozell 838d26d7b5 Invert podspec to allowlist platform files (#45734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45734

Rather than enumerating all platforms the iOS podspec should not compile this inverts the source_files field to an allowlist for only files relevant to iOS.

## Changelog

[Internal]

Reviewed By: cipolleschi

Differential Revision: D60291091

fbshipit-source-id: a0f7e3181ec527e39602c4523622f836a04183d9
2024-07-29 11:53:52 -07:00
Riccardo Cipolleschi e92ae77204 Disable E2E Template tests on main
Summary:
With the React revert from 19 to 18.3.1 of 0.75 the template is not compatible with main anymore.

As a quick solution, we are disabling the e2e tests running on main.

## Changelog
[Internal] - disable  E2E template tests

Reviewed By: cortinico

Differential Revision: D60387687

fbshipit-source-id: 74d4133477bcfdc8ba5909b46d9180ac372ec6bb
2024-07-29 08:10:34 -07:00
omerayhan-shft 6aac1de6bb chore: ☂️ Migrate GeneratePackageListTaskTest.kt to AssertJ (#45790)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:
[INTERNAL] [CHANGED] - Migrate `GeneratePackageListTaskTest.kt` to AssertJ testing library

<!-- 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/45790

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: sammy-SC

Differential Revision: D60382287

Pulled By: cortinico

fbshipit-source-id: 338c771db9d407f0d83e1c62a8c13ac26d898926
2024-07-29 08:06:28 -07:00
Andrew Datsenko bb760ee46d xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SendAccessibilityEventMountItem.java (#45737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45737

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D60234523

fbshipit-source-id: aba84bcdb15bb21a90d5547ffbab6ccb22516fd6
2024-07-29 07:09:53 -07:00
gustavoabel 3b76c8441d chore: migrate ReactActivityDelegateTest to AssertJ (#45769)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

Migrated to AssertJ within file:
- ```ReactActivityDelegateTest.kt```

#### [Android] [Changed] - Migrated ```ReactActivityDelegateTest```

<!--
[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/45769

Test Plan: Run ```./gradlew -p packages/gradle-plugin test```

Reviewed By: sammy-SC

Differential Revision: D60377393

Pulled By: cortinico

fbshipit-source-id: dc99146afdbdeef2185d9290286bfbf29751ef68
2024-07-29 06:56:05 -07:00
Miguel Daipré e2d9ff8538 feat: migrate ShareModuleTest to AssertJ (#45789)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[ANDROID] [CHANGED] - Migrated `ShareModuleTest` from junit.Assert to assertj.core.api.Assertions.

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

Test Plan: Run `./gradlew test`

Reviewed By: sammy-SC

Differential Revision: D60379426

Pulled By: cortinico

fbshipit-source-id: b49fca7aafd42a4207c76d51641caaa2e2511dc3
2024-07-29 06:52:38 -07:00
gustavoabel d32444600c chore: migrate HeaderUtilTest to AssertJ (#45770)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

Migrated to AssertJ within file:
- ```HeaderUtilTest.kt```

#### [Android] [Changed] - Migrated ```HeaderUtilTest```

<!--
[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/45770

Test Plan: Run ```./gradlew -p packages/gradle-plugin test```

Reviewed By: sammy-SC, rshest

Differential Revision: D60377228

Pulled By: cortinico

fbshipit-source-id: 5602b87ad01d2e0c4de7154117c0581b77f29901
2024-07-29 06:45:02 -07:00
Andrew Datsenko e99e5d8bc0 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions:permissionsAndroid (#45742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45742

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D60303780

fbshipit-source-id: ea5fa127762888ff81e9c452cba323399ba45ca2
2024-07-29 06:37:21 -07:00
Andrew Datsenko 7c1740a44c xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerftestDevSupportManager.java (#45684)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45684

Changelog: [Internal]

Differential Revision: D60233489

fbshipit-source-id: 00f0ab65824415242925a5a8e85793487dc251e0
2024-07-29 06:34:25 -07:00
Andrew Datsenko c6f89c300d xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java (#45723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45723

Changelog: [Internal]

Reviewed By: strulovich

Differential Revision: D60254778

fbshipit-source-id: 094d53106c37d610b240d7a30c8b2f8bb5bbc2dc
2024-07-29 06:34:25 -07:00
Andrew Datsenko cb49dfe325 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java (#45682)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45682

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60257806

fbshipit-source-id: 31fbcc257e383e2453dc6cc8db8efece9237e401
2024-07-29 06:34:25 -07:00
Andrew Datsenko 1bf89daf03 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventBeatManager.java (#45733)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45733

Reviewed By: cortinico

Differential Revision: D60233799

fbshipit-source-id: 61ebdb2833edbb29e7e4648e5c2ad2d560a47966
2024-07-29 06:29:23 -07:00
Andrew Datsenko b32f447f89 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java (#45730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45730

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60233485

fbshipit-source-id: 9910b5c5c66a72d2698233b6be0f509f14047ff0
2024-07-29 06:27:24 -07:00
Andrew Datsenko 4c47c1651b xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewManagerWithChildren.java (#45724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45724

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60285839

fbshipit-source-id: fbee32f9563acb1cdb14ddcf17b6b980b828d0c0
2024-07-29 06:27:24 -07:00
Andrew Datsenko 64240a293d xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SendAccessibilityEvent.java (#45738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45738

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D60233491

fbshipit-source-id: 232f8c652e9e3d9cb6f5bfc24cb09023df315140
2024-07-29 06:25:30 -07:00
Andrew Datsenko 8c01290b1f xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/network/OkHttpCallUtil.java (#45672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45672

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60233395

fbshipit-source-id: fdef561f48eab2ec8291fd3ea697e107249e3464
2024-07-29 06:25:05 -07:00
Riccardo Cipolleschi 3e3f9fc060 Pin maestro version
Summary:
The Maestro team just released a new version of maestro which dies in our CI

This change pins the version to something we know it's working, so we can decide when to move to the next version

## Changelog
[Internal] - Pin Maestro version

Reviewed By: cortinico

Differential Revision: D60380466

fbshipit-source-id: af842b7922736cc08300ac3bceef2d6110bcd913
2024-07-29 05:41:51 -07:00
Gabriel Donadel af2cdcb752 RNGP - Filter out null dependencies from getGradleDependenciesToApply (#45749)
Summary:
`getGradleDependenciesToApply` tries to call `implementation:` in all libraries, including the ones that are not supported on Android.

## Changelog:

[INTERNAL] [FIXED] - Filter out platform-specific libraries from the auto-linking gradle plugin

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

Test Plan: CI should be green

Reviewed By: cipolleschi

Differential Revision: D60374769

Pulled By: cortinico

fbshipit-source-id: 33c83e9cc39d81b0e5c497570a936831ebb345f9
2024-07-29 04:08:15 -07:00
Ruslan Shestopalyuk 3c63793cba Migrate JS execution related interfaces in react.bridge to Kotlin (#44588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44588

## Changelog:
[Internal] -

Converts another batch of interfaces (these are related to JS execution) inside react.bridge to Kotlin.

Reviewed By: cortinico

Differential Revision: D57433786

fbshipit-source-id: 3be5a7625df92c386c9836b77480c4fc7195769c
2024-07-29 03:37:16 -07:00
Ruslan Lesiutin 1e88fa18d4 lint[HostTargetSessionObserver.cpp]: different name for lock in callback (#45708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45708

# Changelog: [Internal]

This was originally highlighted by linter in D59975264, but I forgot to fix it.

Reviewed By: robhogan

Differential Revision: D60282937

fbshipit-source-id: 2869634f2d2111a5e2a81871b38b15a122b3ed8a
2024-07-29 02:18:26 -07:00
Nick Gerleman 2a7f969500 Add iOS native viewconfigs for boxShadow, filter, mixBlendMode (#45528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45528

Right now these exist in static view config (iOS BaseViewConfig), but not native view config, so the props don't work without bridgeless/SVCs, and we would get warnings if doing viewconfig validation.

This change adds the props to native view configs as well.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59940432

fbshipit-source-id: 89d57d4e58de2a55b749c68274ef0d2271f69100
2024-07-29 01:54:06 -07:00
Ruslan Shestopalyuk fc8a7b9deb Convert TrackingAnimatedNode to Kotlin (#45728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45728

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60286293

fbshipit-source-id: 9afcbc3bab6e393c19306a9452ff1e0c5ec1f6dc
2024-07-29 00:23:20 -07:00
Ruslan Shestopalyuk e2de11c824 Kotlinify react/animated interfaces (#45725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45725

# Changelog:
[Internal] -

The "interface" classes inside `animated` converted to Kotlin.

Reviewed By: tdn120

Differential Revision: D60284765

fbshipit-source-id: fe7bbecad706e3f58db8304a6bad23d05f999118
2024-07-28 23:26:14 -07:00
Omar Bafagih 1e6b9796f7 Convert CanvasUtil.java to Kotlin (#45748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45748

convert CanvasUtil.java to CanvasUtil.kt

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60264600

fbshipit-source-id: e6906f89de01526e6cf333c06514c86115271438
2024-07-28 20:56:39 -07:00
David Vacca 8d9bdf96f8 Migrate ReactFeatureFlags.unstable_useTurboModuleInterop to ReactNativeFeatureFlags (#45697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45697

Migrate ReactFeatureFlags.unstable_useTurboModuleInterop to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D60274330

fbshipit-source-id: 64ec9f631b4efcdb5d46859d8d949c3309c54945
2024-07-28 15:12:45 -07:00
David Vacca 484117da09 Migrate ReactFeatureFlags.unstable_useFabricInterop to ReactNativeFeatureFlags (#45686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45686

Migrate ReactFeatureFlags.unstable_useFabricInterop to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D60266583

fbshipit-source-id: 7b81f9fb6c5d83183bceabeeffb4dd2cfbab620f
2024-07-28 15:12:45 -07:00
David Vacca 3f0f100e91 Migrate traceTurboModulePromiseRejections to ReactNativeFeatureFlags (#45629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45629

Migrate traceTurboModulePromiseRejections to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D60124027

fbshipit-source-id: f2e9f3a30da86a016006766cae49e97f59b4c40b
2024-07-28 15:12:45 -07:00
David Vacca 077621f315 Migrate enableFabricLogs to ReactNativeFeatureFlags (#45603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45603

Migrate enableFabricLogs to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022935

fbshipit-source-id: 625b09412610096889a3ce2911b2751818ee2836
2024-07-28 15:12:45 -07:00
David Vacca 34fb23b08c Migrate enableEagerRootViewAttachment to ReactNativeFeatureFlags (#45604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45604

Migrate enableEagerRootViewAttachment to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022934

fbshipit-source-id: 1a1c3a030d8673dd13c7c87091210dfe8fe5a089
2024-07-28 15:12:45 -07:00
David Vacca 5386ecea80 Delete removeOutstandingSurfacesOnDestruction flag (#45630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45630

removeOutstandingSurfacesOnDestruction is safe to fully release, we are deleting the flag

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D60142272

fbshipit-source-id: 5e7470d52cfc964b72f0cec7224a234ce9e6c2c4
2024-07-28 15:04:19 -07:00
Ruslan Shestopalyuk 19a63e1b16 ObjectAnimatedNode.java->.kt (#45721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45721

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60284429

fbshipit-source-id: 056a7860b75c8f33e38daf1baffc8ad52c3b386c
2024-07-28 09:13:23 -07:00
Ruslan Shestopalyuk 9e7760210f Migrate DecayAnimation to Kotlin (#45719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45719

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60284323

fbshipit-source-id: 6cf47a9f9528067b397b0c52b763b416bf62ed9f
2024-07-28 06:01:14 -07:00
Arushi Kesarwani e86a5ee274 Migrate TrackingAnimatedNode.java to Kotlin (#45656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45656

TrackingAnimatedNode.java -> TrackingAnimatedNode.kt

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D60080041

fbshipit-source-id: b78070783cb24d4aed43827fdc866e6f9bb5a1bc
2024-07-28 06:01:14 -07:00
Arushi Kesarwani 5b51ca0b92 Migrate ValueAnimatedNode to Kotlin (#45651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45651

ValueAnimatedNode.java -> ValueAnimatedNode.kt

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D60188318

fbshipit-source-id: 37746e1a419f76b5d8ad9ce77a0e5fa9b4b47391
2024-07-28 06:01:14 -07:00
Arushi Kesarwani 377352d956 Migrate AnimatedNode.java to Kotlin (#45601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45601

AnimatedNode.java  -> AnimatedNode.kt

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D60076481

fbshipit-source-id: a969b05e9e339457526a454c13a9584363772d85
2024-07-28 06:01:14 -07:00
Ruslan Shestopalyuk 7dec080545 Convert DefaultDevLoadingView.java->.kt (#45729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45729

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60286594

fbshipit-source-id: 91582e1ba01415544cd75cdd46f9cadcacd6d89d
2024-07-28 03:00:48 -07:00
Ruslan Shestopalyuk 329ab64209 Migrate FabricEventEmitter (#45717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45717

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60283894

fbshipit-source-id: 7a4ed8082e8fd458bea5dcf576623394c164b87a
2024-07-27 22:23:14 -07:00
Ruslan Shestopalyuk 58a4e2ef14 Convert DiffClampAnimatedNode to Kotlin (#45716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45716

# Changelog:
[Internal] -

As in the title.

Reviewed By: steelrooter

Differential Revision: D60283709

fbshipit-source-id: 110e9ee9deecd0c39575b94b0604ad3fa9a9b96e
2024-07-27 12:34:34 -07:00
Ruslan Shestopalyuk c07ca78ac6 Migrate VelocityHelper.java- to Kotlin (#45715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45715

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60283416

fbshipit-source-id: 62241bc3a7bcb0a4eb95b660a01233c269296621
2024-07-27 12:34:34 -07:00
Ruslan Shestopalyuk e69b46c472 Convert BlackHoleEventDispatcher to Kotlin (#45714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45714

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60283138

fbshipit-source-id: aceffe0177fb2051e98231e01267520075012ff1
2024-07-27 12:34:34 -07:00
Ruslan Shestopalyuk 1a4075f72f Executors.java->.kt (#45702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45702

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60282843

fbshipit-source-id: b43262d62d35d9cf172b90ab0c95d100dea43e26
2024-07-27 12:34:34 -07:00
Ruslan Shestopalyuk bf0705a308 Migrate ContenstSizeChangeEvent.java->.kt (#45700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45700

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D60280502

fbshipit-source-id: 976004e2cb289b72eef02e5288026cf6e2dba832
2024-07-27 11:49:20 -07:00
Nick Gerleman 006c1391c2 Port "setAndroidLayoutDirection" to Paper (#45422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45422

When `ReactNativeFeatureFlags.setAndroidLayoutDirection()` is set, we assume in components like ReactHorizontalScrolView that the Yoga contextual layout direction has been set on the underlying component, and skip using I18nManager global direction.

These native views are also used in Paper, so we need to make the change there as well to avoid regressions.

This change mechanically ports the change from Fabric to Paper, at the same layer as used in Fabric (applying ShadowNode layout to the Android view tree).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D59708408

fbshipit-source-id: 52d6fa80c102250eae7ccccedd7184569f6a727f
2024-07-27 11:47:46 -07:00
Nick Gerleman cd0729ce90 Disable "setAndroidLayoutDirection" in default feature flags (#45753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45753

Let's turn this off, for clients where the feature flag isn't wired to a config, until the issue with `removeClippedSubviews` is resolved.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60273063

fbshipit-source-id: 6302a7e1f204459ec7f5cbdb26a521e07e023458
2024-07-27 11:47:46 -07:00
Nick Gerleman 06e38b55da Explicitly handle NaN values in PixelUtil (#45690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45690

ViewManager layer often uses `YogaConstants.UNDEFINED` (`NaN`) as null-state value. Teaching PixelUtil how to handle `NaN` values makes glue code around easier. I think this technically isn't needed, since the resultant operations would become `NaN`, but it seems like poor form/hard to reason about to propagate NaN into arithmetic or library functions.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60265329

fbshipit-source-id: b2f4abaefb30ebd58c2644d072bb7e5bc4b3ee7b
2024-07-27 11:39:27 -07:00
Nick Gerleman 244e242897 Expose more in CSSBackgroundDrawable (#45691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45691

1. Add some accessors, so we can keep accessors and setters symetric
2. Use the shared BorderStyle enum added in last diff
3. Fix some missing invalidation on setting style

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60252276

fbshipit-source-id: 3dde6ad5926f109cefc7247da4ba1894694b1867
2024-07-27 11:39:27 -07:00
Nick Gerleman 72ceae9026 Add more style value types (#45687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45687

This adds some more enums and data classes to encapsulate style values we are working with for border/background rendering. Right now, a lot of these are passed around as strings, or raw ints (of differing ordinals). These will be used as the public API of `BackgroundStyleApplicator` up the stack.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60252277

fbshipit-source-id: 0f8001869421ffffae9727c7904bf5e395505c08
2024-07-27 11:39:27 -07:00
Nick Gerleman 0c4df48ba4 Expose string types for boxShadow and filter (#45685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45685

We built these to be able to parse web style string values, but the types only allow object form, and the TypeScript type is wrong.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60263730

fbshipit-source-id: 7a6e93924a92e8e62346645cb4f8ab1a37dca34f
2024-07-27 11:39:27 -07:00
Nicola Corti a049a58790 Convert ReactImageManager to Kotlin (#45722)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45722

Splitting the ReactImageView convertion to another file, to see if this is causing further failures.

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

Reviewed By: rshest

Differential Revision: D60285050

fbshipit-source-id: 68415782a40c1eacf4e67fbdd2d70c962c0600c0
2024-07-27 10:42:29 -07:00
Nicola Corti 878802fe2a Convert com/facebook/react/views/image/MultiPostprocessor.java to Kotlin (#45712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45712

This moves the first remaining file inside views/image from Java to Kotlin

Changelog:
[Internal] [Changed] - Convert com/facebook/react/views/image/MultiPostprocessor.java to Kotlin

Reviewed By: rshest

Differential Revision: D60283278

fbshipit-source-id: 800ba559750aca0bc9bf7311d0717c6f9bf635a7
2024-07-27 10:42:29 -07:00
Nicola Corti f888f2434c Make com.facebook.react.views.image nullsafe (#45711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45711

Migrating this package in one go is proving harder than expected.
Let's split this through in smaller parts: I'm first marking the package as nullsafe.

Changelog:
[Internal] [Changed] - Make `com.facebook.react.views.image` nullsafe

Reviewed By: cipolleschi

Differential Revision: D60282604

fbshipit-source-id: 68879142a88bdc3c837dff91e53c5f5e891773f9
2024-07-27 10:42:29 -07:00
Joe Vilches 8fe3ae3ccc Fix issue where inset border radius was off when there is a border (#45658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45658

The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of `CSSBackgroundDrawable`. This logic was already present [here](https://www.internalfb.com/code/fbsource/[33e35cbf387a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java?lines=643-650), so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60083309

fbshipit-source-id: ace1ffa15fc3c0c09d4df096b604c9a2c91382c8
2024-07-26 19:01:53 -07:00
Phillip Pan a694e4b325 clean up enable_sync_void_methods_android (#45683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45683

Changelog: [Internal]

this did not make any meaningful progress, let's clean it up and revisit it later.

Reviewed By: fkgozali

Differential Revision: D60219828

fbshipit-source-id: 89a283d7c572dfcd6ef16472e81f3dce1c2cd284
2024-07-26 13:31:47 -07:00
Riccardo Cipolleschi 44d38c9d4d Run e2e tests only on main and on stable branches (#45706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45706

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change
To avoid flakyness and costs, let's run E2E tests only on main and on stable branches

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60283204

fbshipit-source-id: 806cb8905cb269f18785158dcc5777ef10e0ef44
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi c595e3da74 Add job to run maestro tests using the Android template (#45710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45710

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Add job to create a new Android app from the template and run maestro test on it

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: cortinico

Differential Revision: D60282836

fbshipit-source-id: 0c3b4c1bbacfd6c8695f987c86b7e615a3cef026
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi 806e5ffadc Add job to run maestro tests using the iOS template (#45703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45703

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Add job to create a new iOS app from the template and run maestro test on it

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282811

fbshipit-source-id: 2a1dcb1de09795bd0323357455e98a7fa379a2e7
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi a11ab3b129 Add maestro test for the template (#45713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45713

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Add Maestro flow for a new app created from the template

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282783

fbshipit-source-id: 0aa7f3fae4f5bf31518e02ddc56ca2d4fac4dfa3
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi 4adc1e3b15 Connect Android RNTester to Maestro (#45709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45709

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Connect RNTester Android to Maestro action

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282769

fbshipit-source-id: 2a20f1cb249fc5c43b0579c3309efd60369a1da6
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi d2cbbb97c3 Add maestro android action (#45707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45707

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Create a github action to run Maestro on Android

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: cortinico, blakef

Differential Revision: D60282719

fbshipit-source-id: 9544eea192894696361fada1e519caad35f74154
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi b9764c0511 Connect maestro action to RNTester (#45705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45705

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Wire RNTester to the Maestro Action

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282689

fbshipit-source-id: 51c624c2acf7a27ed5527e7453d9a04678df6c66
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi 151d4ea68c Create GHA action to run Maestro in CI (#45704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45704

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change
Create a reusable GHA to run Maestro tests on iOS

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282657

fbshipit-source-id: 3a2a427f0954b46fc6c3a8bf753e807371eb0239
2024-07-26 09:57:46 -07:00
Riccardo Cipolleschi 37cc7c7aec Create first test flow (#45574)
Summary:
## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change
Add a test flow for RNTester

## Changelog:
[Internal] - Exploration to integrate maestro

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

Test Plan: GHA

Reviewed By: blakef

Differential Revision: D60282147

Pulled By: cipolleschi

fbshipit-source-id: 4ecba84f0b2c7186de2bb9938043e73a0bd9a6bd
2024-07-26 09:57:46 -07:00
Nicola Corti 04159a53c8 Move react_codegen_* libraries for RNTester to OBJECT (#45735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45735

This merges several 2 external libraries from .so to be included inside
libappmodules.so.

Changelog:
[Internal] [Changed] - Move react_codegen_* libraries for RNTester to OBJECT

Reviewed By: rozele, rshest

Differential Revision: D60290806

fbshipit-source-id: 6bfa40995d7538e075819d916e8a204464edb75b
2024-07-26 09:56:17 -07:00
Andrew Datsenko 95475eac20 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/OnScrollDispatchHelper.java (#45676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45676

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D60233460

fbshipit-source-id: 7524fe461846466118e7037f01ac828535533d17
2024-07-26 08:53:54 -07:00
Andrew Datsenko 77dfa43e43 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java (#45673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45673

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D60233417

fbshipit-source-id: f5506b8d2bf0e2246c8578c0c1c13ddd62507ee0
2024-07-26 08:53:10 -07:00
Alex Hunt 87ff232a6b Exclude platform specific files from public-api-test (#45727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45727

All instances mirror types which are already defined in the platform-independent base module. See snapshot changes.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D60286148

fbshipit-source-id: 30665252ff5e449a2c10ff3a3e76d9337daecb80
2024-07-26 07:16:59 -07:00
Nicola Corti 6ced6fe1b5 Move react_codegen_* + react_nativemodules_* libraries to static linking (#45639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45639

There is a circular dependency between libreactnative.so and libreact_codegen_rncore.so which I'm breaking here.

Changelog:
[Internal] [Changed] - Move react_codegen_* + react_nativemodules_* libraries to static linking

Reviewed By: cipolleschi

Differential Revision: D55799200

fbshipit-source-id: 53f814636f016a8c93f40b0456686228dfb46888
2024-07-26 07:00:32 -07:00
Nicola Corti a9932f27a2 Move react_featureflags and react_render_consistency inside libreactnative.so (#45640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45640

Other two libraries that don't need to be dynamic libraries but can just be exposed via libreactnative.so

Changelog:
[Internal] [Changed] -  Move react_featureflags and react_render_consistency inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D55796945

fbshipit-source-id: be40b1523a560b2783fc7b6312326e20dc8cf595
2024-07-26 07:00:32 -07:00
Nicola Corti 52de8c70f2 Move several libs from default App CMake setup to static linking (#43909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43909

As we're moving towards a single `libreactnative.so` file, we need to remove several of our prefab targets. Here I'm cleaning up those that are not having an OnLoad.cpp file which needs to be loaded from SoLoader.

This is breaking for libraries using native dependencies via Prefab (i.e. search for `ReactAndroid::` in CMakeLists.txt files for your project).

If so, the CMakeLists.txt files should be updated as follows:

```diff
- ReactAndroid::react_render_debug
+ ReactAndroid::reactnative
```

This applies to every prefab dependencies (the example is just for `react_render_debug`

Changelog:
[General] [Breaking] - Remove several libs from default App CMake setup

Reviewed By: cipolleschi

Differential Revision: D55751683

fbshipit-source-id: 3aca7897852b5f323d60ede3c5036cae2f81e6c3
2024-07-26 07:00:32 -07:00
Nicola Corti 68453a1f90 Create the libreactnative.so dependency (#43908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43908

This creates a new dynamic library that we want to be the only .so that is loaded from apps/libraries.

Changelog:
[Internal] [Changed] - Create the libreactnative.so dependency

Reviewed By: cipolleschi

Differential Revision: D55751682

fbshipit-source-id: 50f4167dc2f9953a8673b28dba3357e19fe88d6b
2024-07-26 07:00:32 -07:00
Jakub Urban 9bddcdef85 chore: migrate assertions in all unit tests in PrepareBoostTaskTest from jUnit to AssertJ. (#45718)
Summary:
https://github.com/facebook/react-native/issues/45596

Migrated all the assertions to use `assertThat()` function from AssertJ.
Also updated the `prepareBoostTask_withMissingConfiguration_fails` test to use `assertThatThrownBy` to check if the tested task throws a given exception.

## Changelog:
Migrate tests to assertj in these files:

- `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareBoostTaskTest.kt`

[INTERNAL] [CHANGED] - Migrated PrepareBoostTaskTest from junit.Assert to assertj.core.api.Assertions.

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

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

Test Plan:
All tests pass when `./gradlew -p packages/gradle-plugin test` command is ran.

<img width="454" alt="image" src="https://github.com/user-attachments/assets/9e954f7b-2208-48a9-ae15-ab642252e6da">

Reviewed By: GijsWeterings

Differential Revision: D60284566

Pulled By: cortinico

fbshipit-source-id: 11af0a0ca574f935e6aab3a7855b5daaeab1a718
2024-07-26 05:45:26 -07:00
Henrique Cicero f4435115cc chore: Migrate FileUtilsTest.kt, NdkConfiguratorUtilsTest.kt and AgpConfiguratorUtilsTest.kt to AssertJ (#45665)
Summary:
Issue: [https://github.com/facebook/react-native/issues/45596](https://github.com/facebook/react-native/issues/45596)

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [CHANGED] - Migrated to AssertJ within files FileUtilsTest.kt, NdkConfiguratorUtilsTest.kt and AgpConfiguratorUtilsTest.kt

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: GijsWeterings

Differential Revision: D60276163

Pulled By: cortinico

fbshipit-source-id: c730acafc37606f1db8d53a61fc9443d88bccdfc
2024-07-26 05:21:33 -07:00
Nicola Corti f9ebc1d9ed Convert com.facebook.annotationprocessor.common.ProcessorBase to Kotlin (#45595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45595

Changelog: [Internal][Changed] com.facebook.annotationprocessor.common.ProcessorBase -> Kotlin

Reviewed By: tdn120

Differential Revision: D60110313

fbshipit-source-id: 42e51927bc3bd56699c79f2f51293ba68ad7df22
2024-07-26 04:51:58 -07:00
Ruslan Lesiutin b5a5e9d51c fix[HostTargetSessionObserverTest.cpp]: call unsubscribe to cleanup resource (#45701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45701

# Changelog: [Internal]

One weird thing is that this test actually never runs for Android, so its only compiled. I am not sure why exactly this one produces an error during execution, given that the next test is almost identical.

Nothing valuable from logcat, just a `SIGSEGV`. Since its something with memory, I've tried calling `unsubscribe`, same as in the next test to free memory before the test tear down (which should not run, because this test doesn't run).

Reviewed By: dmytrorykun

Differential Revision: D60282464

fbshipit-source-id: 2c7760f02c1128083f28651fe8ecd0f3cee27715
2024-07-26 03:36:29 -07:00
Nicola Corti ac0c5fb8b5 Update ccache key to use github.ref (#45698)
Summary:
Update ccache key to use github.ref

## Changelog:

[INTERNAL] - Update ccache key to use github.ref

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60277122

Pulled By: cortinico

fbshipit-source-id: 10437e56a398e817fb030d505fbdb6cf7c23031a
2024-07-26 03:02:27 -07:00
Ruslan Lesiutin 9c61d9a58a Use NativeDebuggerSessionObserver in LogBox (#45578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45578

# Changelog: [Internal]

Use previously introduced native module for managing the presence of warning notifications in LogBox:
- Don't display warnings and Fusebox migration message if there is an active debugging session
- If the session has just been started, clear warnings to hide Fusebox migration message
- If there is no active debugging session (even if there were some at some point of Host lifetime), display Fusebox migration message

See demo in test plan.

Reviewed By: huntie

Differential Revision: D59975265

fbshipit-source-id: 87d91b4d7f3c825dc795ec1b5b3073f969bc7b60
2024-07-25 11:32:08 -07:00
Ruslan Lesiutin 6fde836103 Introduce NativeDebuggerSessionObserver module (#45577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45577

# Changelog: [Internal]

This diff adds new native module, which can be used from JavaScript.

The API includes:
1. `hasActiveSession`: returns a boolean flag, which can be used for determining if 1 or more debugging sessions are active for current HostTarget.
2. `subscribe`: receives a callback, which will be executed once the debugging state changes. To be more precise, this will only be called when state is changing from no active sessions to 1 session or the other way around. Callback should expect to receive one boolean argument, which can be used for determining  if there is an active session.

Reviewed By: huntie

Differential Revision: D59975264

fbshipit-source-id: dd095954529f573f38e9fae1792465a59e639d23
2024-07-25 11:32:08 -07:00
Dmitry Rykun 8af5e893c8 Do not send state updates for loop animations (#45670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45670

**Motivation**

There is a special [code path](https://github.com/facebook/react-native/blob/bb23026daf1a853f4482be46d6f242712a6b7330/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.java#L98) for native driven looping animations that restarts the animation in native, never calling the "animation end" callback. This was designed for and works fine with the `Animated.loop(Animated.timing(...))` animations. Unfortunately, it doesn't work well with more complex animations.
Consider an `Animated.loop(Animated.sequence(Animated.timing(...)))` animation. It doesn't trigger this code path. Instead, its nested `Animated.timing` animations are continuously rescheduled from JS by the looping `Animated.sequence` as singular native driven animations. Each time they end, they fire their "animation end" callback.

This introduces a subtle breakage when those "animation end" callbacks trigger React to update its state. This in turn restarts the rendering. In case with long transitions such looping animations can restart the rendering multiple times. In worst cases it may render the app unresponsive.

**Solution**
We don't need to tell React to update its state when running looping animations. This diff introduces a mechanism, using which `Animated.loop` can tell its nested animations that they are in a loop, and and there's no need to send state updates when they finish. This is consistent with how `Animated.loop(Animated.timing(...))` behaves.

Changelog: [General][Breaking] - Looping animations will not send React state updates.

Facebook

This diff enables this new behaviour for IGVR and FBVR, it also set up the experiment for FBiOS and FB4a.

Reviewed By: javache

Differential Revision: D59970265

fbshipit-source-id: 4832ae05b82f6cc59f92f72305b68610fa422f0a
2024-07-25 10:31:10 -07:00
Pieter De Baets 71be9be939 Fix animation glitch with looping animations (#45638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45638

When looping a frame-based animation, we want to make sure to use the latest frame from the easing curve, which may not necessarily match `mToValue`.

Changelog: [Internal]

Differential Revision: D60143746

fbshipit-source-id: 68fa5421a958acc8291f396bc9f263fa110fdc54
2024-07-25 10:24:32 -07:00
Håkon Knutzen 8204134024 Use std::atomic for eliminating races in RCTCxxBridge (#45558)
Summary:
As explained in https://github.com/facebook/react-native/issues/45280, `TSan` picks up data races related to concurrent read/write to fields in `RCTCxxBridge`. See this report for reference:
```
WARNING: ThreadSanitizer: data race (pid=19983)
  Write of size 1 at 0x00010af1dfd8 by thread T13:
    #0 -[RCTCxxBridge _flushPendingCalls] <null> (RNTesterUnitTests:arm64+0x42b484)
    https://github.com/facebook/react-native/issues/1 __53-[RCTCxxBridge executeSourceCode:withSourceURL:sync:]_block_invoke <null> (RNTesterUnitTests:arm64+0x426050)
    https://github.com/facebook/react-native/issues/2 decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:ue170006]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...) <null> (RNTesterUnitTests:arm64+0x456298)
    https://github.com/facebook/react-native/issues/3 std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x455c6c)
    https://github.com/facebook/react-native/issues/4 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x3ce2e4)
    https://github.com/facebook/react-native/issues/5 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x3cdfd0)
    https://github.com/facebook/react-native/issues/6 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x4af18c)
    https://github.com/facebook/react-native/issues/7 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x51595c)
    https://github.com/facebook/react-native/issues/8 facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1::operator()() const <null> (RNTesterUnitTests:arm64+0x529df0)
    https://github.com/facebook/react-native/issues/9 decltype(std::declval<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>()()) std::__1::__invoke[abi:ue170006]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) <null> (RNTesterUnitTests:arm64+0x529b54)
    https://github.com/facebook/react-native/issues/10 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&) <null> (RNTesterUnitTests:arm64+0x529978)
    https://github.com/facebook/react-native/issues/11 std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()[abi:ue170006]() <null> (RNTesterUnitTests:arm64+0x5298dc)
    https://github.com/facebook/react-native/issues/12 std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x524518)
    https://github.com/facebook/react-native/issues/13 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const <null> (RNTesterUnitTests:arm64+0x3ce2e4)
    https://github.com/facebook/react-native/issues/14 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x3cdfd0)
    https://github.com/facebook/react-native/issues/15 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) <null> (RNTesterUnitTests:arm64+0x515384)
    https://github.com/facebook/react-native/issues/16 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ <null> (CoreFoundation:arm64+0x8dc0c)
    https://github.com/facebook/react-native/issues/17 __NSThread__start__ <null> (Foundation:arm64+0x645c60)

  Previous read of size 1 at 0x00010af1dfd8 by main thread:
    #0 -[RCTCxxBridge isLoading] <null> (RNTesterUnitTests:arm64+0x43236c)
    https://github.com/facebook/react-native/issues/1 -[RCTBridge isLoading] <null> (RNTesterUnitTests:arm64+0x3c0170)
    https://github.com/facebook/react-native/issues/2 -[RCTComponentPropsTests setUp] <null> (RNTesterUnitTests:arm64+0xe6f34)
    https://github.com/facebook/react-native/issues/3 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.134 <null> (XCTestCore:arm64+0x540d8)

  Location is heap block of size 384 at 0x00010af1de80 allocated by main thread:
    #0 calloc <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x4fc30)
    https://github.com/facebook/react-native/issues/1 _malloc_type_calloc_outlined <null> (libsystem_malloc.dylib:arm64+0xf488)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc540)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc124)
    https://github.com/facebook/react-native/issues/4 -[RCTComponentPropsTests setUp] <null> (RNTesterUnitTests:arm64+0xe6b3c)
    https://github.com/facebook/react-native/issues/5 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.134 <null> (XCTestCore:arm64+0x540d8)

  Thread T13 (tid=11290378, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x2bee4)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x6458f0)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x3bf748)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc540)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x3bc124)
    https://github.com/facebook/react-native/issues/5 -[RCTComponentPropsTests setUp] <null> (RNTesterUnitTests:arm64+0xe6b3c)
    https://github.com/facebook/react-native/issues/6 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.134 <null> (XCTestCore:arm64+0x540d8)
```

In order to fix the data races, `std::atomic` instead of primitive boolean types.

In order to reproduce my findings and verify fix:

* Clone this branch
* Run setup code as described in README
* Execute `git revert -n 11c09fdc7c442dd694909bebbbc8f21c3e69edf2`.
* Enable TSan for both RNTester and its test scheme.
* Enable Runtime issue breakpoint for TSan
* Run unit tests
* Observe the TSan breakpoint is hit (possibly other places in the codebase as well) when accessing `_loading`, `_moduleRegistryCreated`, and `_valid`.. Continue execution if other breakpoints are hit before this breakpoint.
* Execute git revert --abort
* Run the tests again and observe the TSan breakpoint does not hit said code again.

NB! While this will fix data races, it will not fix potential race conditions. I have not encountered bugs related to race conditions in `RCTCxxBridge`, but given the nature of how it is made use of concurrently, it is, in my opinion, plausible.

## Changelog:

[iOS][Fixed] Use std::atomic for eliminating races in RCTCxxBridge.

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

Test Plan: I believe there are existing Unit tests in place for verifying this fix.

Reviewed By: cipolleschi

Differential Revision: D60233758

Pulled By: dmytrorykun

fbshipit-source-id: 8aa124a0521ad43a5e17b42e0ce6d22ae6b4e667
2024-07-25 10:22:56 -07:00
Andrew Datsenko ffa68094ee Remove xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewHierarchyDumper.java (#45671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45671

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60233475

fbshipit-source-id: 3c8e73296f9f46f98d18938d91ea7692d261a462
2024-07-25 10:20:02 -07:00
Thomas Nardone 193117c988 Nullsafe react/common/build (#45652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45652

Results of arc nn on the module

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D60188665

fbshipit-source-id: d5322ed15e55a367dc1854177cd533fed90226ee
2024-07-25 08:49:04 -07:00
Nicola Corti 3df2a86a24 Update ccache path (#45674)
Summary:
The correct path for ccache storage dir is actually `/github/home/.cache/ccache`

## Changelog:

[INTERNAL] - Update ccache path

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D60236560

Pulled By: cortinico

fbshipit-source-id: bbce9081e6647e660c3f80d61d791268de5b75d1
2024-07-25 08:43:19 -07:00
Nicola Corti eae2240bfc Adding ccache for Android builds (#45662)
Summary:
This adds `ccache` on the Android build to speedup the building process.

## Changelog:

[INTERNAL] - Adding ccache for Android builds

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D60229625

Pulled By: cortinico

fbshipit-source-id: bc7e416f4ed1b4932159feb672947669bfb498d7
2024-07-25 07:33:46 -07:00
Ruslan Lesiutin ea4005bef4 Update debugger-frontend from a56e5b7...7b143e5 (#45667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45667

Changelog: [Internal] - Update `react-native/debugger-frontend` from a56e5b7...7b143e5

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

Fixes reload via RDT panel for React-heavy apps.

Reviewed By: EdmondChuiHW, hezi

Differential Revision: D60233300

fbshipit-source-id: e188135e44b016b5b0df95e4ae96482eedc85eb4
2024-07-25 07:00:17 -07:00
Riccardo Cipolleschi 949c2bbe28 Revert Refator of RuntimeScheduler to unblock CI
Summary:
A previous commit (https://github.com/facebook/react-native/pull/45616) broke the ci in OSS.

It looks like that JSI is not working well in objective-c++ files when frameworks is enabled.

We need to look into it further but we need to have green CI

## Changelog:
[Internal] - Unblock CI

Reviewed By: blakef

Differential Revision: D60232011

fbshipit-source-id: b02ae163258786ce43cc11bc94420682661a6dd0
2024-07-25 05:21:26 -07:00
Nicola Corti 9d9a8d2df6 Remove unnecessary git config --global --add safe.directory (#45663)
Summary:
`git config --global --add safe.directory` is no longer necessary because is done inside the Docker container.

## Changelog:

[INTERNAL] - Remove unnecessary git config --global --add safe.directory

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60229662

Pulled By: cortinico

fbshipit-source-id: aa817ff27adaab3e3105ab22af74a871b377295b
2024-07-25 04:13:16 -07:00
yakupozbaydar a9f5b3cacc chore: ☂️ Migrate UIManagerModuleConstantsHelperTest.kt to AssertJ (#45648)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[INTERNAL] [CHANGED] - Migrate UIManagerModuleConstantsHelperTest.kt to AssertJ testing library

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

Test Plan: Run ./gradlew -p packages/gradle-plugin test

Reviewed By: christophpurrer

Differential Revision: D60178766

Pulled By: cortinico

fbshipit-source-id: 480e2d9d4bab2ca4e46b05cda0b107ab9e024136
2024-07-25 02:25:49 -07:00
Jan Jaworski 6b9e96d63b chore: migrate tests to assertj (DialogModuleTest, ReactModuleInfoTest, FabricUIManagerTest.kt) (#45644)
Summary:
https://github.com/facebook/react-native/issues/45596

https://github.com/facebook/react-native/issues/45596#issuecomment-2247801893

## Changelog:

Migrate tests to assertj in these files:
- `packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt`
- `packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt`
- `packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/FabricUIManagerTest.kt`

Pick one each for the category and type tags:

[INTERNAL] [CHANGED] - Migrated `DialogModuleTest.kt`,`ReactModuleInfoTest.kt`, and `FabricUIManagerTest.kt`

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

Test Plan:
Run tests and verify if they pass

<img width="317" alt="image" src="https://github.com/user-attachments/assets/21a4feba-4221-4cdb-967e-e8d864ad6e93">

<img width="292" alt="image" src="https://github.com/user-attachments/assets/2947a473-6221-4b7e-84d0-9fbf0ba6adc0">

<img width="289" alt="image" src="https://github.com/user-attachments/assets/3f14cb7f-9a21-4f94-a677-a1b84ddea4b9">

Reviewed By: javache

Differential Revision: D60172126

Pulled By: cortinico

fbshipit-source-id: ffe37bae3555fc916a71e02208fc56707be6417d
2024-07-25 01:42:44 -07:00
Miguel Daipré 053865bd80 feat: migrate BuildCodegenCLITaskTest and PrepareGlogTaskTest to AssertJ (#45649)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[ANDROID] [CHANGED] - Migrated `BuildCodegenCLITaskTest`, `PrepareGlogTaskTest` from junit.Assert to assertj.core.api.Assertions.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: christophpurrer

Differential Revision: D60178114

Pulled By: cortinico

fbshipit-source-id: f0cfe9da945829a2bada8e9807eb1877240d93d6
2024-07-25 01:33:28 -07:00
Ömer Esmer e553acaf1e chore: ☂️ Migrate InteropUiBlockListenerTest.kt to AssertJ #45610 (#45635)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[INTERNAL] [CHANGED] - Migrated to AssertJ within file `InteropUiBlockListenerTest.kt`

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: realsoelynn

Differential Revision: D60183376

Pulled By: arushikesarwani94

fbshipit-source-id: 534566642e246e88367cdc72fb2284c6d1a08005
2024-07-24 18:27:51 -07:00
David Vacca 64f630df8e Delete Scheduler.reduceDeleteCreateMutationLayoutAnimation (#45628)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45628

Scheduler.reduceDeleteCreateMutationLayoutAnimation is unused, I'm deleting in this diff

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D60142585

fbshipit-source-id: 5573ca230c4007c348e64ca967604d791f69fde4
2024-07-24 16:53:53 -07:00
Kevin Gozali a634b57650 Allow passing through optional custom transform options to Metro (#45634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45634

This allows the Android runtime to pass additional options to Metro. Each app can
decide what to send based on the needs. The use case is to send
transform.xyz=somevalue to Metro.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D60155757

fbshipit-source-id: 006d5ff2e3f14634fb39d44b390f30da479b1faa
2024-07-24 14:48:54 -07:00
Kevin Gozali 8effe781d3 Allow passing through optional custom transform options to Metro (#45621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45621

This allows the iOS runtime to pass additional options to Metro. Each app can
decide what to send based on the needs. The use case is to send
`transform.xyz=somevalue` to Metro.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D60143663

fbshipit-source-id: 3e35a01a0ee121096d3a5cf0547e8e0ebf77f8ce
2024-07-24 14:48:54 -07:00
Alex Hunt 5cf72ca046 Fix translatability of modules using event-target-shim (#45646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45646

As titled. This is adapted from https://github.com/facebook/react-native/pull/45056.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D60173075

fbshipit-source-id: 9ce1c96d333b7e6b84d9b7650bc4179ebf86d267
2024-07-24 14:46:39 -07:00
Miguel Daipré 7aff1b9bd8 feat: migrate DefaultNewArchitectureEntryPointTest, InteropEventEmitterTest and InteropModuleRegistryTest to AssertJ (#45623)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[ANDROID] [CHANGED] - Migrated `DefaultNewArchitectureEntryPointTest`, `InteropEventEmitterTest`, `InteropModuleRegistryTest` from junit.Assert to assertj.core.api.Assertions.

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

Test Plan: Run `./gradlew test`

Reviewed By: cortinico

Differential Revision: D60151876

Pulled By: arushikesarwani94

fbshipit-source-id: c8b82fbfc7aae54e2524e7d8e876ee9ffbc10b9b
2024-07-24 14:38:49 -07:00
Joe Vilches ee17ca881a Let inset shadows have rounded corners (#45624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45624

Must have forgot to add this functionality in, since it was just using a Rect for the clear region. This uses the proper rounded path.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60147035

fbshipit-source-id: 3eebb2c4a56e4dfc957213e54f3d2de2c966082b
2024-07-24 14:00:05 -07:00
Joe Vilches 6fc3d359b5 Use needsInvalidateLayer, not _needsInvalidateLayer for filter and box shadow (#45622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45622

The rest of these props setters opts to use `needsInvalidateLayer`, not `_needsInvalidateLayer` the latter of which is a instance variable. This change no effect since we set `_needsInvalidateLayer` to the or of both below, but we should be consistent with the rest of the logic here.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60144215

fbshipit-source-id: b4b863d964a688c1cb9f6fada626d390681d1542
2024-07-24 14:00:05 -07:00
Joe Vilches e42533294b Don't invalidate layer for mix blend mode (#45620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45620

This does not really depend on anything in the layer. It is just a prop on the layer itself, so we can just set it in place. This pattern already happens for things like transform: https://fburl.com/code/0bhsdlcy

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60142154

fbshipit-source-id: 52ee0e1e6eacf3bba005a727a5a4325a5cc6d338
2024-07-24 14:00:05 -07:00
Joe Vilches 7ba801b7f0 Fix issue where shadows were not being cleaned up (#45613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45613

We had a bug where box shadows were not getting cleaned up. The fix here is easy - just call `[_boxShadowLayer removeFromSuperView]`. Previously we were just setting this layer to nil, which does not do the job.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60137528

fbshipit-source-id: 310df944f63ffc73ee5fe938cfb5a48674f997ab
2024-07-24 14:00:05 -07:00
Jack Su f9ac5b737a Fixed race condition issue which caused Bloks page not loading issue
Summary:
## Context

During TW Bloks testing, I frequently encounter the issue of a page not loading. After investigating further, I discovered that for one XOCReactNativeHost, there are multiple instances of ReactInstanceManager created. One of them is properly initialized with XOCLoginActivity, while the other one is not initialized and its activity is null.

When calling ReactContext onHostResume, there is a small chance that the ReactInstanceManager with a null activity will be used, resulting in a "no activity" issue.

After analyzing the construction call stack of ReactInstanceManager, it appears that there is a race condition in the function of ReactNativeHost.getReactInstanceManager https://fburl.com/code/kh6o84m9.
I noticed that two threads are calling this function simultaneously, which can lead to the creation of two instances despite the `mReactInstanceManager == null check`, as it is not within a synchronized statement.

An example of one ReactNativeHost with multiple ReactInstanceManagers can be found at https://fburl.com/code/kh6o84m9.

{F1768111631}

The following are the call stack to create the ReactInstanceManagers, the line number may have slightly shift from the prod code because of debugging info.

P1490866855
P1490869412

## About this diff
Added synchronized lock to the checking of `mReactInstanceManager == null` and make  mReactInstanceManager as volatile to avoid creating duplicated instance.

## Changelog:
[Android] [Fixed] - Made several methods in ReactNativeHost.java thread-safe to avoid race conditions

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D60088120

fbshipit-source-id: a4c1970bb54c7395dbfc3282d02bd66d9dc95df9
2024-07-24 13:47:40 -07:00
Nicola Corti cb6ea49123 Fix warning on scripts/releases-ci/__tests__/publish-updated-packages-test.js (#45643)
Summary:
This just fixes a warning in scripts/releases-ci/__tests__/publish-updated-packages-test.js that the CI is firing on every PR

## Changelog:

[INTERNAL] - Fix warning on scripts/releases-ci/__tests__/publish-updated-packages-test.js

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60170227

Pulled By: cortinico

fbshipit-source-id: 5889f7dd530cc00651d683001e1f2624bd79c27e
2024-07-24 12:41:00 -07:00
Oskar Kaczmarzyk 4cc46e3ca6 chore: tests migration to assertj (KotlinStdlibCompatUtilsTest, ModelAutolinkingDependenciesJsonTest, PathUtilsTest, DependencyUtilsTest, ProjectUtilsTest) (#45606)
Summary:
https://github.com/facebook/react-native/issues/45596

## Changelog:

Migrated to AssertJ within files:
- `KotlinStdlibCompatUtilsTest.kt`,
- `ModelAutolinkingDependenciesJsonTest.kt`,
- `PathUtilsTest.kt`,
- `DependencyUtilsTest.kt`,
- `ProjectUtilsTest.kt`.

[INTERNAL] [CHANGED] - Migrated `KotlinStdlibCompatUtilsTest`, `ModelAutolinkingDependenciesJsonTest`, `PathUtilsTest`, `DependencyUtilsTest`, `ProjectUtilsTest` from `junit.Assert` to `assertj.core.api.Assertions`.

## Test Plan

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

Reviewed By: javache

Differential Revision: D60166231

Pulled By: cortinico

fbshipit-source-id: 5092e7d0d4c8d0a8737183962bda62ed1f54ccda
2024-07-24 09:44:45 -07:00
Dan Melnic 2052a1dfa3 Fix warning C4100: 'rt': unreferenced formal parameter (#45633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45633

Changelog: [Internal]
Fix warning C4100: 'rt': unreferenced formal parameter

Differential Revision: D60152935

fbshipit-source-id: 9fe4b934721d38e7edf5c3329c40f5c0595a2897
2024-07-24 09:28:18 -07:00
Ramanpreet Nara 842c382773 Refactor: RuntimeScheduler: Make error handlers configurable (#45616)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45616

We want to eventually route all js error handling through JsErrorHandler in bridgeless.

This will help with that.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D60138415

fbshipit-source-id: de62edfe75066ba135225e24543628306aa5f4a0
2024-07-24 08:57:31 -07:00
Jakub Piasecki dc8c8ebc5b Disable JS batching when animation batch is finished on Android (#45563)
Summary:
When an animation using the native driver [is started](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/animations/Animation.js#L89), all animated operations are [queued](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js#L115). The queue is then flushed as part of [a single batch](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js#L173-L181). The problem here is that when a batch is executed, on the native side a [flag is flipped](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java#L543) and it assumes that JS will take control of the batching operation from that point onward, which is not the case. Operations are queued with the current batch number but are never executed, since the new "batch" is never finished. The case which let to figuring it out is the creation of `AnimatedInterpolation` in the [sticky header component](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js#L215).

This PR changes this by returning to the default behavior when the batch is completed.

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

## Changelog:

[ANDROID] [FIXED] - Fix scheduled animated operations not being executed in some cases

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

Test Plan: Tested on Animated examples in RNTester and on the reproducer app from the issue

Reviewed By: cipolleschi

Differential Revision: D60108049

Pulled By: dmytrorykun

fbshipit-source-id: 9c14d116b0df2c78fbbb00cf7224bddd09ae5796
2024-07-24 06:09:45 -07:00
Janic Duplessis 19cffab383 Fix legacy view interop apis not available in view method (#45609)
Summary:
When trying to use the legacy view interop with `stripe/stripe-react-native` there is an issue with the `CardField` component because it tries to access module registry inside the `view` method (https://github.com/stripe/stripe-react-native/blob/master/ios/CardFieldManager.swift#L7).

The problem is that we attach the legacy view apis after creating view, so they are not available in that method.

To fix this we can change the order of the methods and attach the apis first. Note that we also need to use the `manager` method instead of `bridgelessViewManager` since `bridgelessViewManager` is not initialized otherwise, it is initialized lazily in the `manager` method.

## Changelog:

[IOS] [FIXED] - Fix legacy view interop apis not available in view method

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

Test Plan: Tested in an app that legacy interop apis (`moduleRegistry`) is available in the `view` method in an app using RN 0.74 with bridgeless mode enabled.

Reviewed By: cipolleschi

Differential Revision: D60165191

Pulled By: dmytrorykun

fbshipit-source-id: 60187556fb36d342bb1ef084a093132bdb0496bd
2024-07-24 06:08:45 -07:00
Dong-Hwan Kim 1dcbf41725 fix: add missing submitBehavior prop type and mark blurOnSubmit prop as deprecated in typescript declaration file of TextInput (#45588)
Summary:
Hi, I just found out that https://github.com/facebook/react-native/pull/33653 adds a new prop in `TextInput` that enables multiline `TextInput` be able to submit without blurring.

It does that by adding a new prop called `submitBehavior` which accepts `'submit' | 'blurAndSubmit' | 'newline'`:
https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L195

https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L910-L928

It also marks `blurOnSubmit` prop as deprecated since it can now be handled from `submitBehavior`:
https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L896-L908

However, that PR doesn't update `TextInput.d.ts` file which results Typescript to complain that the type doesn't exist:
<img width="760" alt="text_input_error" src="https://github.com/user-attachments/assets/2235cb36-1e4e-4ec9-a8b0-c09728a3336f">

So this PR adds and updates the types in declaration file to support them in Typescript
<img width="520" alt="fixed" src="https://github.com/user-attachments/assets/a7a3a0c4-9f3e-4644-bfac-ae60ac21d0f7">

## Changelog:

[GENERAL] [FIXED] - add missing `submitBehavior` prop and mark `blurOnSubmit` prop as deprecated in Typescript declaration file of `TextInput`

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

Test Plan:
Before:
<img width="295" alt="before" src="https://github.com/user-attachments/assets/90ed0cd1-c127-4667-bf72-6b5317ea4dd6">

After:
<img width="589" alt="after1" src="https://github.com/user-attachments/assets/826002a4-45dc-4f97-882d-7622238ac766">

<img width="833" alt="after2" src="https://github.com/user-attachments/assets/467eeecd-4b0b-4740-ac78-253e3c7aa901">

Reviewed By: christophpurrer

Differential Revision: D60107516

Pulled By: dmytrorykun

fbshipit-source-id: ce79e41aefc1ef39dc1d44179405cf6a8d5e12de
2024-07-24 02:25:08 -07:00
Blake Friedman cab905bb57 Allow cache reaper to skip failing cache removal request (#45593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45593

I'm guessing either there is a race condition between Github removing cache entries when we're over budget OR there is an eventual consistency issue between reported cache entries and their removal.  Either way, this job is best efforts.  If a entry targetted for removal isn't there, great.

This change prevents the job from stopping if an entry no longer exists.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60106847

fbshipit-source-id: 252bba7bb0bbb91d279f06a39301491332cd5ace
2024-07-24 00:45:05 -07:00
bufgix d25249442d chore: ☂️ Migrate BlobModuleTest.kt to AssertJ (#45610)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[INTERNAL] [CHANGED] - Migrated to AssertJ within file `BlobModuleTest.kt`

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

Test Plan: `Run ./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca

Differential Revision: D60138457

Pulled By: cortinico

fbshipit-source-id: 8dcbede98130c24da2d81525d6596a8e4b4aa402
2024-07-24 00:14:28 -07:00
gustavoabel 7829de6221 chore: ☂️ migrate BackwardCompatUtilsTest to AssertJ (#45607)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

Migrated to AssertJ within file:
- ```BackwardCompatUtilsTest.kt```

Changelog:
[Internal] [Changed] -  chore: ☂️ migrate BackwardCompatUtilsTest to AssertJ

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

Test Plan: Run ```./gradlew -p packages/gradle-plugin test```

Reviewed By: mdvacca

Differential Revision: D60137770

Pulled By: cortinico

fbshipit-source-id: 883b2abee430ce45018808fa934a7949ae23fcaf
2024-07-24 00:08:49 -07:00
Miguel Daipré e7881c2f45 feat: migrate JsonUtilsTest, OsTest and TaskUtilsTest to AssertJ (#45608)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

Note:

The formatting changes have been altered by Android Studio. `Code -> Format Code`

## Changelog:

[INTERNAL] [CHANGED] - Migrated `JsonUtilsTest`, `OsTest`, `TaskUtilsTest` from junit.Assert to assertj.core.api.Assertions.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca

Differential Revision: D60137234

Pulled By: cortinico

fbshipit-source-id: 236dc46dd04ad1f62a5e11fd77cf2c63bec99cff
2024-07-23 16:56:59 -07:00
Rubén Norte 010c004d75 Rename track for performance.mark / measures without custom tracks as Web Performance: Timings to align with Chrome (#45597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45597

Changelog: [internal]

Minor change to align with the Chrome DevTools performance panel.

Reviewed By: sammy-SC

Differential Revision: D60115147

fbshipit-source-id: bfd7b071fc76e226783ef41bd3f13d941acccec5
2024-07-23 14:23:03 -07:00
Rubén Norte 4caf9ec7a0 Migrate CoreFeatures::enableReportEventPaintTime to new feature flags system (#45585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45585

Changelog: [internal]

Just migrates the flag to the new system.

Reviewed By: sammy-SC

Differential Revision: D60050005

fbshipit-source-id: 4da39446ecdb6cd86ccf7ee75a0d489764c37be6
2024-07-23 14:23:03 -07:00
D N bb23026daf chore: ☂️ Migrate a ClipboardModuleTest test to AssertJ (#45600)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[Internal] [Changed] - Migrate ClipboardModuleTest to Assertj

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

Reviewed By: zeyap

Differential Revision: D60120117

Pulled By: cortinico

fbshipit-source-id: 39720d81e0abad978515b8429f559df817303cd9
2024-07-23 09:47:43 -07:00
Nicola Corti 9e64d09cfb Migrate com.facebook.react.views.progressbar to Kotlin (#45594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45594

This moves all the remaining Java classes inside com.facebook.react.views.progressbar to Kotlin

Changelog:
[Internal] [Changed] - Migrate com.facebook.react.views.progressbar to Kotlin

Reviewed By: tdn120

Differential Revision: D60108654

fbshipit-source-id: 69b3597020520eb444cd1fb9020b6572b7e1d804
2024-07-23 09:14:31 -07:00
Nicola Corti bd4aec869b RNGP - Do not attempt to load JSC from other repositories (#45598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45598

I've noticed we attempt to load JSC from the Sonatype Snapshot repository.
That is inefficient as we already know that JSC is available only inside node modules.
This change makes the repository resolution stricter by better specifying which
repo can download which dependency.

Changelog:
[Internal] [Changed] - Do not attempt to load JSC from other repositories

Reviewed By: cipolleschi

Differential Revision: D60116002

fbshipit-source-id: 21a2213708f5b0103860a59f3342f1bc0f59cdb9
2024-07-23 08:12:42 -07:00
Riccardo Cipolleschi 48f6c3c485 Remove CCI leftovers (#45589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45589

I don't know why, but we had some CCI leftovers in the repo.
This cleans them up!

## Changelog:
[Internal] - Remove CCI leftovers

Reviewed By: cortinico

Differential Revision: D60048949

fbshipit-source-id: 08792abd53ba919a7afc0922d6f7c98cc9c4544e
2024-07-23 06:40:08 -07:00
Blake Friedman 014370d825 Move init deprecation notice 30 Sept → 31 Dec (#45590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45590

This gives us more wiggle room with the release of 0.76.

Changelog: [General][Changed] Move init deprecation notice 30 Sept → 31 Dec

Reviewed By: cortinico

Differential Revision: D60105868

fbshipit-source-id: d03fcf5d4a97db9b21792eff6f993e2671b276ef
2024-07-23 05:56:39 -07:00
Alex Hunt 7571e9a46a Update device APIs for macOS compatibility (#45515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45515

After some provisional hacking on macOS support for React Native DevTools last week, this revealed some incompatibilities with traditional OS X APIs, which are minimally addressed here.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59807146

fbshipit-source-id: 39c4eab723046926b0b469232152e2f994af2366
2024-07-23 05:55:47 -07:00
Nicola Corti 91ecd7eb53 RNGP - Migrate settings-plugin to AssertJ (#45575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45575

We should move over to use AssertJ as per our linter.
I'm adding it here to a first test and will use it as a reference for some OSS contributions from outside.

Changelog:
[Internal] [Changed] - Migrate settings-plugin to Assertj

Reviewed By: cipolleschi

Differential Revision: D60037797

fbshipit-source-id: 579ed7bf5fb219e25577af3ab87934503ee7898e
2024-07-23 04:41:54 -07:00
Nicola Corti fedbe2d486 Fix core autolinking not working on Windows (#45572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45572

0.75-rc.5 is currently broken on Windows.

This is due to us invoking `npx react-native-community/cli config` without
a `cmd /c` prefix.

This fixes it by using our function `windowsAwareCommandLine`.
The problem is that this required a lot of refactoring since that util was not available for the settings plugin.

Fixes #45403

Changelog:
[Internal] [Changed] - Fix core autolinking not working on Windows

Reviewed By: cipolleschi

Differential Revision: D60037587

fbshipit-source-id: eefeda7aafc43b9ce08f0f9225b0847fad2f46b7
2024-07-23 04:41:54 -07:00
Samuel Susla 7d17ae4d3b add optimised path for view preallocation on android behind feature flag (#45587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45587

changelog: [internal]

There is a way to avoid doing large number of JNI calls from JS thread for view preallocation on Android. We can move the JNI call to the main thread by creating a queue of views to be created on the JS thread and pulling it from the main thread. This way, the expensive part of JNI call (the actual call + creating JNI values) is moved to the main thread and doesn't block the JS thread from executing rendering.

Reviewed By: javache

Differential Revision: D59966062

fbshipit-source-id: af85138cfdb9b2a7a7710d79e09e165b2be55067
2024-07-23 04:10:42 -07:00
Ruslan Lesiutin 7bd5b84e32 Update debugger-frontend from a4fff8a...a56e5b7 (#45579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45579

Changelog: [Internal] - Update `react-native/debugger-frontend` from a4fff8a...a56e5b7

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

Reviewed By: robhogan

Differential Revision: D60041876

fbshipit-source-id: 48c1a314797638b140052e6f30b2597e9b8ee48a
2024-07-23 04:05:57 -07:00
wh201906 6390cf67d0 Add upper case keys to the debug key handler (#45559)
Summary:
The CLI of Metro bundler only accepts key presses when the Caps Lock is off. This is somehow inconvenient because the developers might think the Metro bundler doesn't response when the Caps Lock is on.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[GENERAL] [ADDED] - Add upper case keys to the debug key handler

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D60107316

Pulled By: dmytrorykun

fbshipit-source-id: 045dcd382d84c4781dff75a1ff913cd3ccc8d288
2024-07-23 03:57:39 -07:00
CHEN Xian-an c24929c5f4 Not all the targets have a defined symbol_type (#45591)
Summary:
Errors occurred on running `pod install`:

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

undefined method `symbol_type' for #<Xcodeproj::Project::Object::PBXAggregateTarget:0x000000010f6ea568>

[redact]/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:53:in `block in get_application_targets'
```

## Changelog:

[iOS] [Fixed] - Fix error on handling privacy manifest

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

Reviewed By: cipolleschi

Differential Revision: D60107607

Pulled By: dmytrorykun

fbshipit-source-id: 316220fe54174b18c9b61775f807d5d05d9f0240
2024-07-23 03:21:28 -07:00
David Vacca 700b403e06 Migrate excludeYogaFromRawProps to ReactNativeFeatureFlags (#45586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45586

Migrate excludeYogaFromRawProps to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022939

fbshipit-source-id: 150ecc98aa3323d5adea3a41a3d91d404c99e5a7
2024-07-22 14:20:40 -07:00
David Vacca 4d77c35584 Delete ReactFeatureFlags.rejectTurboModulePromiseOnNativeError (#45583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45583

ReactFeatureFlags.rejectTurboModulePromiseOnNativeError is not used, I'm deleteing it

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022938

fbshipit-source-id: 80f2d551b4416fae81c9081d3ddbb896e5f5a560
2024-07-22 14:20:40 -07:00
David Vacca d4a74d8b83 Migrate enableFabricRendererExclusively to ReactNativeFeatureFlags (#45584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45584

Migrate enableFabricRendererExclusively to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022933

fbshipit-source-id: 35b09673744bb5fb29b7d3b5ee4c7bb7d51a01b7
2024-07-22 14:20:40 -07:00
Nicola Corti 90e4397d99 Converted com.facebook.react.views.drawer to Kotlin (#45573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45573

This makes this module now be fully in Kotlin instead of having mixed Java/Kotlin sources.

Changelog:
[Internal] [Changed] - Converted com.facebook.react.modules.dialog to Kotlin

Reviewed By: tdn120

Differential Revision: D60035771

fbshipit-source-id: b45fd099c0b353768ab6580eb6a4a3dccf68f07d
2024-07-22 13:40:07 -07:00
Nicola Corti 0529818d36 Fix several build warnings on RN-Tester (#45569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45569

Same as title

Changelog:
[Internal] [Changed] - Fix several build warnings on RN-Tester

Reviewed By: realsoelynn

Differential Revision: D60036158

fbshipit-source-id: 549b84f52594e1a442058222a3a45118739a1eb3
2024-07-22 12:16:12 -07:00
Nicola Corti c1a8ae412b Properly annotate with @Deprecated methods that are just deprecated in JavaDoc (#45570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45570

We do have several methods/classes that are `deprecated` in the JavaDoc but not
with an annotation. That's not correct as users will never get those deprecation otherwise
and we'll be forced to keep both implementation around for a longer time.

Changelog:
[Internal] [Changed] - Properly annotate with Deprecated methods that are just deprecated in JavaDoc

Reviewed By: javache

Differential Revision: D60036159

fbshipit-source-id: 466072d6a3fb4f1220e1dc3deaa51a46c714a388
2024-07-22 06:39:04 -07:00
Rubén Norte 43c32e1e25 Fix broken overlapping measures in Perfetto integration (#45567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45567

Changelog: [internal]

(internal because our integration for Perfetto hasn't been released in OSS yet)

In our current React integration for Perfetto we're logging arbitrary time spans via `performance.measure` in specific tracks (that can be custom based on a naming scheme).

For a given track, Perfetto doesn't allow partially overlapping segments (as it's considered to always be a stack of time spans). When logging arbitrary time spans that partially overlap, Perfetto cuts the nested ones to make sure they fit into their suspected parent. This makes the logged data incorrect and makes it hard to understand the performance of an application using this data.

There's a fix for this problem: logging these arbitrary segments/time spans in separate tracks that only share the name. In this case, Perfetto groups the data in the UI but allows overlapping (as they're not really on the same track).

Reviewed By: sammy-SC

Differential Revision: D60010696

fbshipit-source-id: 378ea492c4fafbe55ef97fa91e4fa50bbc1893ae
2024-07-22 05:00:31 -07:00
Rubén Norte df9b2cef7e Prefix custom tracks for markers coming from JS with Web Performance (#45564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45564

Changelog: [internal]

(this is internal because the integration hasn't been enabled in OSS yet)

In our current React integration for Perfetto we're currently creating multiple custom tracks that are spread throughout the process section and it can be hard to identify the source of the information.

This adds a "Web Performance: " prefix to all custom tracks coming from JS to achieve 2 purposes:
* Group them together (in terms of order in the process)
* Clarify the source of the data

Reviewed By: sammy-SC

Differential Revision: D60010695

fbshipit-source-id: 081f5b6417d676c61005114337530a089142e7c6
2024-07-22 05:00:31 -07:00
Rubén Norte 2551aee4b0 Expose PerformanceObserver related classes in the global scope (#45539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45539

Changelog: [internal]

This exposes several classes (interfaces in the spec lingo) related to the Performance API to the global scope, so users can access them directly to do things like refinements using `instanceof`. This also prevents the need from importing the modules from `react-native` directly, which would prevent code sharing with Web.

Reviewed By: rshest

Differential Revision: D59859654

fbshipit-source-id: e1f7afb0c98b394b1f97c3790db2e570e6ba0cd9
2024-07-22 04:45:02 -07:00
Rubén Norte a5bd64ece8 Move classes for Event Timing API to the same module to align with existing convention (#45535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45535

Changelog: [internal]

Small refactor to group things based on the spec where they're defined.

Reviewed By: rshest

Differential Revision: D59911334

fbshipit-source-id: 1c40d6bf82b6cc7be78bd81b652d6855c39a53eb
2024-07-22 04:45:02 -07:00
Rubén Norte 2680198b09 Use the right interfaces for PerformanceLongTaskTiming (#45526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45526

Changelog: [internal]

Just using the right interfaces so we can expose them in the global scope and do refinements as necessary using `instanceof`.

Reviewed By: rshest

Differential Revision: D59911144

fbshipit-source-id: 9779e3220f2c6f81955f54506f97142f0f4ffdd4
2024-07-22 04:45:02 -07:00
Rubén Norte 2a91a703cc Improve spec-compliance of Performance interfaces (#45525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45525

Changelog: [internal]

This makes several changes to the Performance API to align it closer with the spec:
* Makes fields of `PerformanceEntry` and subclasses read-only.
* Returns instances of the correct subclass of `PerformanceEntry` to observers.
* Renames `HighResTimeStamp` as `DOMHighResTimeStamp` for alignment with the spec and native

Additionally, I realized that the way we handle `performance.measure` is a bit problematic at the moment. When we call the function, we create a `PerformanceMeasure` instance with the data we receive, and return that value. In parallel, we notify the entry to native, which will in turn notify the observers. But the observers will not get those instances we just created, but new instances of `PerformanceEntry` (not even `PerformanceMeasure`) with the resolved values. At the same time, the `PerformanceMeasure` instance we return doesn't resolve its `startTime` and `duration` based on the indicated marks (when specified as strings). We need to fix this in the future by resolving the timing data synchronously when calling `performance.measure`.

Reviewed By: rshest

Differential Revision: D59911145

fbshipit-source-id: e0be0441f307cc9bdea8795ae88b6f390780fc7b
2024-07-22 04:45:02 -07:00
Rubén Norte 9b06ac8379 Restrict durationThreshold to event entry types only (#45524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45524

Changelog: [internal]

The `durationThreshold` option is only meant to be used with `event` entry types. `mark`, `measure`, `longtask`, etc. shouldn't take that option into account, as per the spec.

Reviewed By: mdvacca

Differential Revision: D59918519

fbshipit-source-id: 0553d46944cbe80a32712ff57140763f2514f734
2024-07-22 04:45:02 -07:00
Samuel Susla 9a380363ae use constexpr string_view to avoid allocation (#45565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45565

changelog: [internal]

Simple change to avoid string allocation.

Reviewed By: christophpurrer

Differential Revision: D59964183

fbshipit-source-id: fc0f341f10ef2fb5afdc9f5593d268d4444717da
2024-07-22 04:40:42 -07:00
Pieter De Baets 235e84ccae Remove delay between instance start and surface creation (#45545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45545

ReactInstance creation in bridgeless returns a callback that requires dispatching on the UI thread to complete the init. If that thread is busy (eg with other startup tasks), we delay starting the initial surface unnecessarily.

This diff adds an experiment to return early from that startup task to allow follow-up tasks to be scheduled on the JS thread without waiting for lifecycle changes to have been applied.

Changelog: [Internal]

Reviewed By: markv

Differential Revision: D59961779

fbshipit-source-id: dd6a6fe093a32144ef6823bde5ac94a61d268fd2
2024-07-22 04:04:40 -07:00
Riccardo Cipolleschi 5bf1a77a0b Cancel test-all job is another commits get pushed in the same branch (#45568)
Summary:
CircleCI was automatically cancelling an old run if a new commit was pushed on the branch.
GitHub does not have the same behavior enabled by default.

Keep running jobs in a pipeline when there is a new commit is usually wasteful of resources and cost money we can save.

## Changelog:
[Internal] - Cancel old jobs if a new commit is pushed

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

Test Plan: Tested on GHA on this PR

Reviewed By: blakef

Differential Revision: D60035940

Pulled By: cipolleschi

fbshipit-source-id: 88b4dfc8bdd3eded6489a87db285e9544d3a1bcf
2024-07-22 03:51:33 -07:00
Douglas Lowder e42932cfc6 fix: Remove setting of process.exitCode that breaks Jest tests (#45562)
Summary:
In Node 20, the script to run unit tests in CI (`scripts/run-ci-javascript-tests.js`) will fail, even when all the Jest tests pass. This happens because one of the JS modules being tested is setting `process.exitCode` (see https://github.com/jestjs/jest/issues/9324#issuecomment-1808090455).

Changes:

- Modified the affected module to throw an exception when failing, instead of setting the exit code
- Adjusted the unit test for that module

## Changelog:

[General] [Fixed] - Remove setting of process.exitCode that breaks Jest tests

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

Test Plan:
Before this change, running `node scripts/run-ci-javascript-tests.js` would fail with Node 20.
After this change, it succeeds.

Reviewed By: blakef

Differential Revision: D60033582

Pulled By: cipolleschi

fbshipit-source-id: 71b7f4495d414e719a9bd2d892bd1bc3045ddd5d
2024-07-22 03:37:08 -07:00
Gabriel Donadel aa4f802fde Restore CLI_PATH variable in react-native-xcode script (#45560)
Summary:
When changing the `react-native-xcode.sh` logic to use the helloworld cli on https://github.com/facebook/react-native/pull/44721, the `CLI_PATH` env var was removed along with `BUNDLE_COMMAND`. Both of these values were used by Expo to override the default CLI and use our custom bundling command.

https://github.com/expo/expo/blob/10e302ee13add0e24a08c7ee792c2da50ace95a6/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj#L215C4-L215C15

This restores the `CLI_PATH` variable and set the default value as `"$REACT_NATIVE_DIR/scripts/bundle.js"`, along with the `BUNDLE_COMMAND` variable. With this Expo and other frameworks can keep the ability to easily replace the internal CLI

## Changelog:

[INTERNAL] [CHANGED] - Restore CLI_PATH variable in react-native-xcode script

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

Test Plan: Project compiles correctly on iOS

Reviewed By: robhogan

Differential Revision: D60035338

Pulled By: blakef

fbshipit-source-id: 26583d11d9f573f7cfa405b68e0cc3304c3601df
2024-07-22 03:19:39 -07:00
David Vacca 9af63956d2 Enable prop diffing for <View> (#45551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45551

This diffs toggles the new Android prop diffing mechanism for <View> components

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59613243

fbshipit-source-id: 79c1e4bf4f5a67fc516e5db7b9f4ffba0cb9b69b
2024-07-20 10:23:12 -07:00
David Vacca a052e1eefd Refactor BaseProps.resolveborderMetrics method (#45554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45554

In this diff I'm extracting the creation of borderWidth into its own method, this is necessary for next diffs of the stack.

Nh behavior change is introduced here

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59942306

fbshipit-source-id: 85d39b64deaa4e8a8632d6f4aab72f626e594b5d
2024-07-20 10:23:12 -07:00
David Vacca 6d08d3af93 Introduce Props.getDiffProps method (#45553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45553

This diff introduces a "temporary" method called getDiffProps to calculate the difference between 2 props and serialize its result into a folly::dynamic map.

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59613245

fbshipit-source-id: 3e23cde0113ac2a3904c8daa48a1ca048cd0262d
2024-07-20 10:23:12 -07:00
Nick Gerleman b18635e5ab Fix drop-shadow filter (#45556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45556

I missed updating this, and the e2e test we had isn't running, so switching JS objects to camel case broke this.

Changelog: [internal]

Reviewed By: jorge-cab

Differential Revision: D60003747

fbshipit-source-id: 6b7b1138e3ebbfdb982f5a089804351cc4b198ba
2024-07-20 07:57:03 -07:00
Alan Lee 3a5eb19731 fix ConcurrentModificationException in ReactScrollViewHelper (#45550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45550

`ConcurrentModificationException` is happening from `emitScrollEvent()`.
This usually happens if we modify the collection (add/remove) while accessing collection in a foreach loop.
Seems likely add/remove is called from a different thread while in the foreach loop.
Converting to list before we do the foreach as a quick fix.

Changelog: [Internal] - quick fix for exception

Issure reported here: https://fb.workplace.com/groups/rn.support/permalink/26557068097248454/

Reviewed By: mdvacca

Differential Revision: D59991739

fbshipit-source-id: a2fcc798430acaadd07561a5be871967cc8f2c3b
2024-07-19 18:44:48 -07:00
Peter Abbondanzo aeb020dfa3 Add null check for instance manager (#45549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45549

## Summary
Calling `getCurrentReactContext` on an unmounted `ReactRootView` could lead to a NPE. The method currently returns a nullable value so return type is the exact same. This change checks if the react instance manager is present and returns null early if not.

## Changelog:
[Android] [Fixed] - Adds a null check in react context getter

Reviewed By: zeyap

Differential Revision: D59982179

fbshipit-source-id: bac5c12e7dc4ee3296991063eb3746141b8446bc
2024-07-19 15:45:20 -07:00
Blake Friedman 123d7d4229 fix update-node-modules-cache workflow (#45547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45547

Was missing the step to checkout the repo before running yarn.

Changelog: [Internal]

Reviewed By: sammy-SC, realsoelynn

Differential Revision: D59979543

fbshipit-source-id: 2ab52efbc655cb6ff7b6544ff3939c019c5d45a6
2024-07-19 13:54:35 -07:00
Blake Friedman 4410899ec7 Only cache node_modules on main (#45544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45544

## This diff now does 5 things:
1. removes the old way we used `actions/setup-node` to manage the cache itself.
2. it creates a new `update-node-modules-cache` workflow, which is the only job that will update the node modules cache
3. it create a `yarn-install-with-cache` action that should be used install of directly calling `yarn install --non-interactive`.  This will load a cache against a hash of `package.json`.
4. updated the cache reaper to aggressively remove everything but the latest `npm-{{ hash('package.json') }}`.
5. removed a `cache-setup`, which couldn't be used (we're using artefacts now).

## Why are we doing this:
The various `node-cache-` keys for platforms and on various branches accounts for a very large proportion of the cache (10-20%).

We don't frequently change these dependencies, and even when we do running `yarn install` after loading the cache will resolve any issues.

Limiting the cache to `main` and aggressively pruning older cache entries will clean up a lot of "small win" caching.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59917944

fbshipit-source-id: 4be6f1959e8fde642a4f208f7d19aceba2c3262f
2024-07-19 13:04:07 -07:00
Nick Gerleman d9263fbdbb Enable ViewConfig validation in RNTester (#45530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45530

Enable viewconfig validation for RNTester to catch where static and native viewconfigs are mismatched, during development or contribution time. This relies on `useNativeViewConfigsInBridgelessMode()` which is already enabled in `DefaultNewArchitectureEntryPoint` on Android, and seems to be in iOS AppDelegate `RCTRootViewFactory` as well.

We put it in an early place in the bundle before first render, since we don't have RNTester preludes right now, but I think it is still early enough?

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59946366

fbshipit-source-id: ae0c23b13a566489a88a7b4e408f61dce314b003
2024-07-19 09:37:03 -07:00
Nicola Corti e50e554039 Move helloworld to build from artifacts on Android (#45517)
Summary:
This moves the `helloworld` app to build from the artifacts produced by build_npm_package so that we don't rebuild ReactNative Android from source 8 times.
It reduces build time of such jobs from 14mins to 4mins, resulting in 80mins of build time for every test_all run.

## Changelog:

[INTERNAL] - Move helloworld to build from artifacts on Android

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D59957613

Pulled By: cortinico

fbshipit-source-id: b6c4adcf804af6c8d2661cf56549d037e09aa2c1
2024-07-19 08:55:19 -07:00
szymonrybczak 353d88d54e feat: update CLI to 14.0.0 (#45540)
Summary:
Update to stable version of `react-native-community/cli`.

## Changelog:

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to `13.6.9`

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

Test Plan: n/a

Reviewed By: blakef

Differential Revision: D59960021

Pulled By: cortinico

fbshipit-source-id: 9d470699cdd2d20e08e844c92c7982056aec082c
2024-07-19 08:36:24 -07:00
Ruslan Shestopalyuk f3eaf63683 Remove inconsistency warning in viewconfig validation (#45543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45543

# Changelog:

[Internal]-

Introduced recently, this confuses viewconfig validation vs the vanilla Android view managers.

So this change effectively reverts the exposure of `ScrollView.scrollIndicatorInsets` to Android, achieving the goal in a different way (via the SVC injection workaround for the specific Android platform flavour).

Reviewed By: NickGerleman

Differential Revision: D59960782

fbshipit-source-id: 3b9a49f1466426d909e94bf4d33f1d09fbf822c2
2024-07-19 08:24:54 -07:00
Nicola Corti 818dd92a4a Align github/* action versions on major (#45542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45542

As we do have several version numbers for external actions all across the codebase,
here I'm aligning all of them to just use the majors.

I'm doing it only for GitHub first party actions as we trust them,
so minor/patch changes can safely be pulled in without code changes.

Changelog:
[Internal] [Changed] - Align github/* action versions on major

Reviewed By: cipolleschi, blakef

Differential Revision: D59959978

fbshipit-source-id: bb07ce0dfd74d9502a2ac0ea90a2b32f55d6d655
2024-07-19 05:49:03 -07:00
Riccardo Cipolleschi 84e8cb0b03 Remove CCI jobs that are on GHA (#45219)
Summary:
With the migration to GHA, we can remove all the duplicated jobs from CircleCI.
These are the only 4 jobs remained to migrate

## Changelog:
[Internal] - Remove all the jobs already migrated to GHA

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

Test Plan: CCI is green

Reviewed By: cortinico

Differential Revision: D59156888

Pulled By: cipolleschi

fbshipit-source-id: 193f1f8fa7484154d5295ac36a63bb81a159da6e
2024-07-19 05:43:10 -07:00
Nicola Corti 2e55adf339 Act On label as @react-native-bot (#45541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45541

This is another round of letting react-native-bot do the job that the
generic GitHub Action bot was doing.

Changelog:
[Internal] [Changed] - Act On label as react-native-bot

Reviewed By: cipolleschi

Differential Revision: D59959468

fbshipit-source-id: 8e0f7e2e90a40ed2aa265e637c8a809064e22747
2024-07-19 05:38:49 -07:00
Nicola Corti 6d56cea283 Fix nightly/release workflow (#45537)
Summary:
Nightly/Release workflow are currently broken due to a wrong path reference to a composite action. This fixes it.

## Changelog:

[INTERNAL] - Fix nightly/release workflow

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D59959185

Pulled By: cortinico

fbshipit-source-id: 02c556d86105eac35e152b4dc09705bc42c8031a
2024-07-19 04:17:09 -07:00
Nicola Corti 64c3fb84d5 Remove unused build-from-source input (#45533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45533

This input is unused and is causing a warning on the build pipeline.
I'm cleaning it up.

Changelog:
[Internal] [Changed] - Remove unused build-from-source input

Reviewed By: blakef

Differential Revision: D59958184

fbshipit-source-id: 23ba010da077342605afaaee122bc7ceabc89915
2024-07-19 03:23:12 -07:00
nik910 be93092c1b Adding space to $(inherited) string to avoid merging of inherited and… (#45520)
Summary:
Added space to $(inherited) string to avoid creation of wrong cpp flags in RCTAppDelegate podspec

<img width="1157" alt="Screenshot 2024-07-18 at 8 51 19 PM" src="https://github.com/user-attachments/assets/29d32d08-e81f-4c25-b8ee-5dccc0f620ea">

## Changelog:

[IOS] [FIXED] - Building of iOS project when RCTAppDelegate is used in the project

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

Test Plan: To test this you can simply change in your node modules and run pod install, the build will now work successfully

Reviewed By: cipolleschi

Differential Revision: D59950906

Pulled By: arushikesarwani94

fbshipit-source-id: 0d58620aa0be7ac4fcbcd309f06df0eef7844016
2024-07-19 02:05:24 -07:00
Nick Gerleman 245e5d9d95 Remove experimental_boxShadow from Android base view config (#45529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45529

`experimental_boxShadow` is not yet part of Android view managers, and when we enable it, we are likely to do a view manager at a time before moving to BaseViewManager.

This causes user-visible errors when viewconfig validation is turned on, since we have a static view config, but not yet a native view config.

This removes the static viewconfig for Android until we start adding setters to view manager.

It is kept in `ReactNativeStyleAttributes` (which I think can have members not in the native view-config, since it has component specific props like tintColor), and iOS base viewconfig. On Fabric iOS, this is part of BaseViewProps, and handled by RCTView, but it looks like the prop (and also `experimental_filter`, `experimental_mixBlendMode`) do not have entries in iOS RCTViewManager, which is fixed in next diff in the stack.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59939866

fbshipit-source-id: 2781029a0c29ba111ed04edfe9940c6c72f4e5ac
2024-07-18 18:19:41 -07:00
Nick Gerleman 1315d65bf5 Handle nullish values in processBoxShadow and processFilter
Summary:
Viewconfig processors may still get called for nullish values I think. Most other processors explicitly handle these (but some don't??).

This returns an empty list, like on parse error, when we have a value, but the value is nullish.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D59933611

fbshipit-source-id: 3f1d89d21977bbe01a05e708aadf1a9451d88083
2024-07-18 17:17:16 -07:00
Alex Taylor (alta) cbdb4d78c0 Update hermes-parser and related packages in fbsource to 0.23.0 (#45504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45504

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

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D59881428

fbshipit-source-id: cf8d055b3a1078895fc16ec3da26981eabc22db7
2024-07-18 13:52:22 -07:00
zhongwuzw 14de1b708a Fabric: Fixes Modal present splash when animation type is none (#41853)
Summary:
Because the modal layout is triggered by state,  it's an async operation after the first mount, so we can see the splash when present modal. now we can pass the screen size to the initial state which can layout in the first mount operation.

before:
https://github.com/facebook/react-native/assets/5061845/a39d519e-e2f6-42f1-8319-6216c88e9cf3

After:
https://github.com/facebook/react-native/assets/5061845/c7d59820-399b-4ea2-943d-d889971ea7ee

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Modal present splash when animation type is none

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

Test Plan: RNTester Modal example, present modal in none animation mode.

Reviewed By: sammy-SC

Differential Revision: D51984766

Pulled By: cipolleschi

fbshipit-source-id: 34a40e75c87f1046ab2e4df45196a277f47bd525
2024-07-18 10:08:50 -07:00
Alexander Blom a37534e6ce Fix data race in BufferedRuntimeExecutor (#45512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45512

isBufferingEnabled_ can be read (by design) from multiple threads, but
it's not atomic. Make it so.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59907026

fbshipit-source-id: ffce54a28404148b3e270fa90dfe850a334ca2f0
2024-07-18 08:19:53 -07:00
Oskar Kwaśniewski fbcb8f6b2b fix: Hermes prepare_command fails with space in path (#45316)
Summary:
This PR fixes a case where the user initializes react native in a directory that contains a space.

It was causing pod install to fail because the path to `create-dummy-hermes-xcframework.sh` script wasn't in a string.

## Changelog:

[IOS] [FIXED] - Hermes prepare_command fails with space in path

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

Test Plan:
1. Create a directory with space in path
2. Initialize React Native inside
3. Install pods
4. Check if pod install doesn't fail

Reviewed By: dmytrorykun

Differential Revision: D59912979

Pulled By: cipolleschi

fbshipit-source-id: b2c08d5035a245f8b4d6bfaf562e46d9c5d127b5
2024-07-18 07:23:32 -07:00
Samuel Susla cdd70f0397 cache JNI calls to FabricUIManager::getColor (#45501)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45501

changelog: [internal]

Implement caching for FabricUIManager::getColor. A call to FabricUIManager::getColor takes on average 0.4ms and there can be many of them. The arguments for the call keep repeating in majority of times. Employing a simple caching mechanism here to avoid unnecessary trips via JNI to reduce overhead.

The dependencies in graphics in BUCK are incorrect. I tried to separate this into multiple files and move implementation to .cpp file but this will require a bit of a more restructuring to make it possible.

Reviewed By: mdvacca, dmytrorykun

Differential Revision: D59859754

fbshipit-source-id: 748efce7f0b8c96001b6ac1a4b457b8c9d63fe9c
2024-07-18 07:06:02 -07:00
Riccardo Cipolleschi 32943263d0 Factor out build npm package (#45493)
Summary:
Factor out the Build NPM package job in a separate action for code reuse

## Changelog:
[Internal] - Factor out the Build NPM package job in a separate action for code reuse

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

Test Plan: GHA are green

Reviewed By: robhogan

Differential Revision: D59858572

Pulled By: cipolleschi

fbshipit-source-id: 561a215ba5812352034157aa254999db56fcd31e
2024-07-18 07:05:24 -07:00
Nicola Corti 278257ec11 stale-bot is @react-native-bot (#45514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45514

Let react-native-bot act on behalf of stale bot.

Changelog:
[Internal] [Changed] - stale-bot is react-native-bot

Reviewed By: cipolleschi

Differential Revision: D59909764

fbshipit-source-id: 45cef93607e657715aafe0d060ce91f9511409a3
2024-07-18 05:59:03 -07:00
Riccardo Cipolleschi 2d6d067f7a Update test-e2e-local to work with the new android artifacts (#45499)
Summary:
With the recent changes to the CI, we need to update the test-e2e-local to work with the new artifacts

## Changelog:
[Internal] - Update local-e2e-test to run with the new Android Artifacts

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

Test Plan: Tested locally.

Reviewed By: blakef

Differential Revision: D59902087

Pulled By: cipolleschi

fbshipit-source-id: 84ef78e8dba222bf8a9e3620632fb2a9d286d42b
2024-07-18 05:46:49 -07:00
Rubén Norte 15b8ac8db2 Add support for longer tasks with explicit yielding in LongTask API (#45471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45471

Changelog: [internal]

This is a React Native specific modification of the Long Tasks API that refines the logic to detect long tasks considering voluntary yielding checks.

In RN, as opposed to Web, we can have a very long task executing in the JS thread without causing any issues to the responsiveness of the app, as long as the task checks whether it should yield in short intervals. In this case, if the app always checks whether it should yield at least once every 50ms, the task will not be considered "long".

Check the new unit tests to see this behavior in practice.

Reviewed By: sammy-SC

Differential Revision: D55647992

fbshipit-source-id: 82ab41173d4d9deee65b8ade2268c40d7f58c6e2
2024-07-18 05:08:58 -07:00
Rubén Norte 64c4e385cb Implement Long Tasks API for PerformanceObserver (#45473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45473

This is a basic implementation of the Long Tasks API (https://w3c.github.io/longtasks/).

It detects and reports long tasks when using the Event Loop (in the modern RuntimeScheduler) when a new feature flag for this purpose is enabled.

This doesn't include attribution information at the moment.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D55491870

fbshipit-source-id: e1ccad9cc6a35073b31230a8cf3a4660ab9a043d
2024-07-18 05:08:58 -07:00
Rubén Norte dffc156ea7 Move timing definitions to a specific target (#45492)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45492

Changelog: [internal]

When testing the changes in https://github.com/facebook/react-native/pull/45473 / D55491870, I saw that the reported time spans for long tasks didn't perfectly align with the long tasks themselves in traces (Perfetto).

Taking a closer look, I realized that I wasn't doing the conversion between times and durations from `chrono` and `DOMHighResTimeStamp` (a `double`) correctly, and we're doing this conversion very often.

This moves the definition of `DOMHighResTimeStamp` to its own library and adds conversion methods to make sure we don't make this mistake in the future.

Reviewed By: rshest

Differential Revision: D59820241

fbshipit-source-id: c123920de56336da384ddc484f6ac9d287724301
2024-07-18 05:08:58 -07:00
Blake Friedman 9aed45a9d9 always proxy to @react-native-community/cli (#45464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45464

Previous work would cause versions >= react-native 0.76 to exit if called through `npx react-native <cmd>`. This was intended to be full deprecated and removed.  The intention was to shift users to calling react-native-community/cli directly.

This change allows commands to be proxied to react-native-community/cli but with no guarantees of success.  It's up to each framework / project to explicitly create that dependency.

This also  provides warnings, which won't go away, suggesting the supported method of calling the community CLI directly.

The outcome is that we're not going to break existing workflows.

closes: #45461

Changelog: [General][Fixed] allow proxying commands from react-native to react-native-community/cli with explicit warning

Reviewed By: cortinico

Differential Revision: D59805357

fbshipit-source-id: 21e23b082a9c709effa050d8e7dd04a40f5ab0e6
2024-07-18 04:48:19 -07:00
Nicola Corti 6e34283ab3 Remove report-app-size (#45483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45483

We don't really use this functionality and is getting harder to migrate to GHA,
hence I'm removing it.

Changelog:
[Internal] [Changed] - Remove report-app-size

Reviewed By: cipolleschi

Differential Revision: D59822862

fbshipit-source-id: 2d082454aea3b3c5863bd34556a23c2fc847f841
2024-07-18 04:34:32 -07:00
Nicola Corti fcd526d6cc Improve tests for GenerateAutolinkingNewArchitecturesFileTask (#45510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45510

This is just a quality of life improvement, where we test the C++ autolinking
code generation a bit more.

Changelog:
[Internal] [Changed] - Improve tests for GenerateAutolinkingNewArchitecturesFileTask

Reviewed By: blakef

Differential Revision: D59907847

fbshipit-source-id: e6367cc3b1c01700310437b73bc984e3666b3499
2024-07-18 04:15:44 -07:00
Nicola Corti aaeb7af700 Add react-native.config.js to autolinking lockfiles (#45511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45511

This adds react-native.config.js to autolinking default lockfiles
so autolinking can account for changes in that file.

Changelog:
[Internal] [Changed] - Add react-native.config.js to autolinking lockfiles

Reviewed By: blakef

Differential Revision: D59907268

fbshipit-source-id: d5893a3f7b4d5d9f6c6c13042aa6866ad16b2ea4
2024-07-18 04:15:44 -07:00
Riccardo Cipolleschi 0264c36dcd Add ci job to check if nightly succeeded (#45509)
Summary:
This change adds a job that runs 2 hours after the nightlies. This jobs returns successfully if the nightly has been published or it report an error in case it has failed.

We will hook this signal to the internal system to be notified about Nightlies failures

## Changelog:

[Internal] - Add jobs to check for nightlies

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

Test Plan: Test the Action on GHA

Reviewed By: blakef

Differential Revision: D59907442

Pulled By: cipolleschi

fbshipit-source-id: 3b35aa2ad69b376c65a765f740a1d6e6ed8ad99f
2024-07-18 04:12:33 -07:00
Riccardo Cipolleschi 8408b8bc96 Fix path to node in .xcode.env.local (#43333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43333

This change fixes https://github.com/facebook/react-native/issues/43285.
Basically, when using a `yarn` alias to install pods, yarn creates a copy of the `node` and `yarn` executables and the `command -v node` command will return the path to that executable.

## Changelog
[iOS][Fixed] - Do not use temporary node when creating the .xcode.env.local

Reviewed By: dmytrorykun

Differential Revision: D54542774

fbshipit-source-id: 3ab0d0bb441988026feff9d5390dcfd10869a1b5
2024-07-18 03:35:50 -07:00
Alex Taylor (alta) 9504e864bc Deploy 0.241.0 to xplat (#45507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45507

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D59891129

fbshipit-source-id: c1da0730d6c1b52cce5de730b47b3f3c854dff6b
2024-07-18 02:58:25 -07:00
Blake Friedman 6664b9b9de pass github token to cache clean action (#45508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45508

The scripts/clean-gha-cache.js uses the `gh` cli too, which expects the GITHUB_TOKEN presented GH_TOKEN.  Also allowed us to manually kick off this workflow.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D59901639

fbshipit-source-id: f3543cc83cbf67b6969abc3390790e038e06c305
2024-07-18 02:24:23 -07:00
Nick Gerleman c82edec62e FilterPrimitive -> FilterFunction (#45505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45505

These are filter functions, not primitives. Change the name to be more accurate and easier to understand.

https://drafts.fxtf.org/filter-effects/#filter-functions

changelog: [internal]

Reviewed By: joevilches

Differential Revision: D59793167

fbshipit-source-id: a0ab9bfbcab0c1e17d3094ce6ada44040aaa6afb
2024-07-17 23:22:45 -07:00
Nick Gerleman f96a4c0d5d Camelize filter function names in object notation (#45503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45503

Kebab case object literals are a pain as an API to give folks. Keep string parsing using the kebab-case web names, like in CSS, but keep object notation camelCase.

This is super super hacked up, and we should burn away all these viewconfig processors as soon as we can.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59793095

fbshipit-source-id: 888cad31142d7aeed42687ab23c2023ac7e4882d
2024-07-17 20:35:17 -07:00
Nick Gerleman 27c6fcbe72 JS plumbing to get boxShadow into native (#45452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45452

With this we enable <View> to use BoxShadow.

BoxShadow property can be a string as defined on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow

Or it can also be a list of BoxShadow primitives:
```
[
{
  offsetX: 10,
  offsetY: 5,
  color: 'red',
  inset: true,
},
{
  ...
},
]
```

The diff includes:

* Style sheet changes so typing is valid
* Process function to turn boxShadow format into parsed boxShadow primitive
* Test for process function
* View config changes on Android, iOS and ReactNativeStyleAttributes

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57872933

fbshipit-source-id: 2c5732709959bd996cce2f979549fc95cf2410e2
2024-07-17 20:35:17 -07:00
Joe Vilches 66465fb69d Remove calls to CGColorRelease in box shadow impl (#45488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45488

In certain cases where the color fails to parse, this code will throw an exception since the underlying color does not exist and we are trying to free it. We do not actually need to even do this, since we obtain the CGColor from a UIColor. The UIColor will manage the memory of the CGColor in this case so we are fine.

Source: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-SW1

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D59819536

fbshipit-source-id: ace4656475e7deecac215acb67cb419141e432ea
2024-07-17 18:27:53 -07:00
Joe Vilches 1e20e49163 Rename "spreadRadius" -> "spreadDistance" (#45481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45481

We are going with this name as it is more commonly used in the spec and makes more sense since there are no circles involved with spread

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59819180

fbshipit-source-id: cf20c22b11e9ff9935b9f54e28db37d3ea399d8f
2024-07-17 18:27:53 -07:00
Thomas Nardone b10724890e View recycling - fix API access and disable when not possible (#45484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45484

Prior to Android SDK 28, there was no way to tell if a View's pivotX or pivotY were set.  Unfortunately this breaks view recycling due to the default behavior of:
- `getPivotX()` and `getPivotY()` [initialize as 0](https://android.googlesource.com/platform/frameworks/base/+/android-8.1.0_r81/libs/hwui/RenderProperties.h#643)
- As long as they haven't been set, [they actually default to width/2 and height/2](https://android.googlesource.com/platform/frameworks/base/+/android-8.1.0_r81/libs/hwui/RenderProperties.cpp#195).

Thus even if we were to check for `getPixotX() == 0`, we wouldn't know if it was specifically set to 0 (making the pivot actually 0), or still just the default value.  We'd then need to reset the pivot any time the width or height changed.  [`View.resetPivot()`](https://developer.android.com/reference/android/view/View#resetPivot%28%29) was presumably added to fix this in API 28.

This diff adds nullability to `prepareToRecycleView()` so we can act accordingly - returning null if the view can't be recycled.

Also added a version check for [`setAnimationMatrix()`](https://developer.android.com/reference/android/view/View#setAnimationMatrix%28android.graphics.Matrix%29), which is only available in 29+.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D59827328

fbshipit-source-id: d1729bba347e8af7fb2b57c95ed2e0b66a15d155
2024-07-17 18:00:48 -07:00
Blake Friedman 17cbe7d974 GHA: create a reaper job to keep the cache < 10GB (#45500)
Summary:
This would run every 2hrs during weekdays.  It aims for 9GB (a.k.a 90%
of threshold). It'll order caches by most accessed and start trimming
removing as soon as the cumulative cache is greater than the threshold.

I've given it generous logging to help debugging and investigation about
cache hogs.

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

Test Plan:
Ran this locally using a `--dry` run:
```
  scripts git:(main) ✗ node ../clean-gha-cache.js --dry
skip 1 365.71MB 0.7hrs
skip 2 43.62MB 0.7hrs
skip 3 0.10MB 0.7hrs
skip 4 0.93MB 0.7hrs
skip 5 188.07MB 0.7hrs
skip 6 0.16MB 0.7hrs
skip 7 316.66MB 0.7hrs
skip 8 80.96MB 0.7hrs
skip 9 317.72MB 0.7hrs
skip 10 317.73MB 0.8hrs
skip 11 80.98MB 0.8hrs
skip 12 34.60MB 0.9hrs
skip 13 0.01MB 0.9hrs
skip 14 34.67MB 0.9hrs
skip 15 0.01MB 0.9hrs
skip 16 2.90MB 0.9hrs
skip 17 0.01MB 0.9hrs
skip 18 304.92MB 1.0hrs
skip 19 212.21MB 1.0hrs
skip 20 301.33MB 1.0hrs
skip 21 0.00MB 1.0hrs
skip 22 389.38MB 1.0hrs
skip 23 195.11MB 1.0hrs
skip 24 388.83MB 1.0hrs
skip 25 154.47MB 1.0hrs
skip 26 300.72MB 1.0hrs
skip 27 1.53MB 1.0hrs
skip 28 154.90MB 1.0hrs
skip 29 405.21MB 1.0hrs
skip 30 196.79MB 1.0hrs
skip 31 197.23MB 1.0hrs
skip 32 315.94MB 1.0hrs
skip 33 154.16MB 1.0hrs
skip 34 12.50MB 1.0hrs
skip 35 72.59MB 1.0hrs
skip 36 32.95MB 1.0hrs
skip 37 0.00MB 1.0hrs
skip 38 317.72MB 1.4hrs
skip 39 80.97MB 1.4hrs
skip 40 304.69MB 2.4hrs
skip 41 317.18MB 2.5hrs
skip 42 0.01MB 2.5hrs
skip 43 2.91MB 2.6hrs
skip 44 0.01MB 2.6hrs
skip 45 34.60MB 2.6hrs
skip 46 34.60MB 2.6hrs
skip 47 0.01MB 2.6hrs
skip 48 0.01MB 2.6hrs
skip 49 2.90MB 2.7hrs
skip 50 34.60MB 2.7hrs
skip 51 2.91MB 2.7hrs
skip 52 34.60MB 2.7hrs
skip 53 34.60MB 2.7hrs
skip 54 34.67MB 2.7hrs
skip 55 2.91MB 2.7hrs
skip 56 34.60MB 2.7hrs
skip 57 0.01MB 2.7hrs
skip 58 34.60MB 2.7hrs
skip 59 0.01MB 2.7hrs
skip 60 0.01MB 2.7hrs
skip 61 2.80MB 2.7hrs
skip 62 1.53MB 2.7hrs
skip 63 0.00MB 2.7hrs
skip 64 306.97MB 2.8hrs
skip 65 0.00MB 2.8hrs
skip 66 12.50MB 2.8hrs
skip 67 296.04MB 2.9hrs
skip 68 12.50MB 2.9hrs
skip 69 0.01MB 2.9hrs
skip 70 2.80MB 2.9hrs
skip 71 0.01MB 2.9hrs
skip 72 34.60MB 2.9hrs
skip 73 0.01MB 2.9hrs
skip 74 34.60MB 2.9hrs
skip 75 0.01MB 2.9hrs
skip 76 1.53MB 2.9hrs
skip 77 34.60MB 3.0hrs
skip 78 34.60MB 3.0hrs
skip 79 0.00MB 3.0hrs
skip 80 295.49MB 3.1hrs
skip 81 306.94MB 3.2hrs
skip 82 1.53MB 3.2hrs
skip 83 317.70MB 3.5hrs
skip 84 80.97MB 3.5hrs
skip 85 34.60MB 5.0hrs
skip 86 34.60MB 5.1hrs
skip 87 317.72MB 5.3hrs
skip 88 80.98MB 5.3hrs
skip 89 34.60MB 5.3hrs
skip 90 34.60MB 5.4hrs
[ 5.5hrs] 317.70MB -> gradle-transforms-v1-03ddabb4b1809dff6c857700b53007a6
[ 5.5hrs] 80.96MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-ec140aa68d9ab872dc43719cdc53fb2bc0b19cd0
[ 5.6hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.6hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-18e21417bb83369992b1f3346f5aeeb7250bd9311d5f7f9427a743031daf7d00-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b09255761a2bb17e0014cb67004cc46eff539ef428ce97265644d6e75217fd5b-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.9hrs]  2.90MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.9hrs] 291.40MB -> gradle-dependencies-v1-49635ba64c7470c5975fa812320e8669
[ 5.9hrs] 241.71MB -> gradle-transforms-v1-4903a32cb8d567063ace38e1c8e4e922
[ 5.9hrs] 54.70MB -> gradle-home-v1|Linux|build_android[24b50bfc3f2953187ad7df78a20c6c6a]-a6f5e5adebed3d9da411f99548e2d8ce96636e16
[ 5.9hrs] 317.73MB -> gradle-transforms-v1-7c27a147cb9da63a071780069b610f20
[ 5.9hrs] 80.98MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-a6f5e5adebed3d9da411f99548e2d8ce96636e16
[ 6.0hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b7217839f41b15a756f47bf4cb76a7e5770bc0986e8a5d852b9763fde7142bfd-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.9hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-1a00237c91b102b608d8562f91982c1adc1e44ee3b168f6dc0d7d60c5ca975d5-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.9hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-83993878f618c0a819bc05aa4b1fb7ec286dd41316ae29630808bf64a99f660b-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-31697fb37bd3e3292c233068c68666694ad04eb8eb75c71e0232d4aab0abd08f-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.2hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.4hrs]  0.00MB -> _state
[10.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.8hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.9hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.9hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[11.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[11.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.2hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.2hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[13.8hrs] 72.59MB -> v2-hermesc-apple--
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.5hrs] 304.91MB -> v3-hermes-artifacts-Debug-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0
[16.5hrs] 80.98MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-50f7892a1f803520f2b4dc25b99568ad0ce30ae9
[16.5hrs] 317.56MB -> gradle-transforms-v1-c63bdf2b438bb9e6966fa203418e433d
[16.5hrs] 212.20MB -> v3-hermes-artifacts-Release-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0
[16.5hrs] 80.94MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-db16a7895ee2642ec5f7f517c008973a0be3b8a1
[16.5hrs] 154.47MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-xrsimulator-Release
[16.5hrs] 317.71MB -> gradle-transforms-v1-e95e7d153c065969cb69e27e056a1539
[16.5hrs] 405.21MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-macosx-Debug
[16.5hrs] 301.33MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphonesimulator-Release
[16.5hrs] 154.18MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphoneos-Release
[16.5hrs] 389.38MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphonesimulator-Debug
Identifed 71 cache keys for removal, reducing cache from 14128.82MB -> 9199.51MB
DRY: gh cache delete 55205 --repo facebook/react-native
DRY: gh cache delete 55206 --repo facebook/react-native
DRY: gh cache delete 55254 --repo facebook/react-native
DRY: gh cache delete 55253 --repo facebook/react-native
DRY: gh cache delete 55223 --repo facebook/react-native
DRY: gh cache delete 55220 --repo facebook/react-native
DRY: gh cache delete 55219 --repo facebook/react-native
DRY: gh cache delete 55216 --repo facebook/react-native
DRY: gh cache delete 55215 --repo facebook/react-native
DRY: gh cache delete 55213 --repo facebook/react-native
DRY: gh cache delete 55209 --repo facebook/react-native
DRY: gh cache delete 55207 --repo facebook/react-native
DRY: gh cache delete 55196 --repo facebook/react-native
DRY: gh cache delete 55083 --repo facebook/react-native
DRY: gh cache delete 55084 --repo facebook/react-native
DRY: gh cache delete 55085 --repo facebook/react-native
DRY: gh cache delete 55030 --repo facebook/react-native
DRY: gh cache delete 55031 --repo facebook/react-native
DRY: gh cache delete 55191 --repo facebook/react-native
DRY: gh cache delete 55190 --repo facebook/react-native
DRY: gh cache delete 55189 --repo facebook/react-native
DRY: gh cache delete 55182 --repo facebook/react-native
DRY: gh cache delete 55181 --repo facebook/react-native
DRY: gh cache delete 55123 --repo facebook/react-native
DRY: gh cache delete 55117 --repo facebook/react-native
DRY: gh cache delete 55121 --repo facebook/react-native
DRY: gh cache delete 55167 --repo facebook/react-native
DRY: gh cache delete 55166 --repo facebook/react-native
DRY: gh cache delete 55158 --repo facebook/react-native
DRY: gh cache delete 55157 --repo facebook/react-native
DRY: gh cache delete 55156 --repo facebook/react-native
DRY: gh cache delete 55155 --repo facebook/react-native
DRY: gh cache delete 55152 --repo facebook/react-native
DRY: gh cache delete 55151 --repo facebook/react-native
DRY: gh cache delete 55148 --repo facebook/react-native
DRY: gh cache delete 55147 --repo facebook/react-native
DRY: gh cache delete 55144 --repo facebook/react-native
DRY: gh cache delete 55095 --repo facebook/react-native
DRY: gh cache delete 55091 --repo facebook/react-native
DRY: gh cache delete 55087 --repo facebook/react-native
DRY: gh cache delete 55122 --repo facebook/react-native
DRY: gh cache delete 55120 --repo facebook/react-native
DRY: gh cache delete 55116 --repo facebook/react-native
DRY: gh cache delete 55100 --repo facebook/react-native
DRY: gh cache delete 55113 --repo facebook/react-native
DRY: gh cache delete 55112 --repo facebook/react-native
DRY: gh cache delete 55109 --repo facebook/react-native
DRY: gh cache delete 55108 --repo facebook/react-native
DRY: gh cache delete 55103 --repo facebook/react-native
DRY: gh cache delete 55102 --repo facebook/react-native
DRY: gh cache delete 55094 --repo facebook/react-native
DRY: gh cache delete 55090 --repo facebook/react-native
DRY: gh cache delete 55086 --repo facebook/react-native
DRY: gh cache delete 52262 --repo facebook/react-native
DRY: gh cache delete 55037 --repo facebook/react-native
DRY: gh cache delete 55036 --repo facebook/react-native
DRY: gh cache delete 55035 --repo facebook/react-native
DRY: gh cache delete 55034 --repo facebook/react-native
DRY: gh cache delete 55033 --repo facebook/react-native
DRY: gh cache delete 55032 --repo facebook/react-native
DRY: gh cache delete 55021 --repo facebook/react-native
DRY: gh cache delete 55008 --repo facebook/react-native
DRY: gh cache delete 54980 --repo facebook/react-native
DRY: gh cache delete 55007 --repo facebook/react-native
DRY: gh cache delete 54981 --repo facebook/react-native
DRY: gh cache delete 54991 --repo facebook/react-native
DRY: gh cache delete 55006 --repo facebook/react-native
DRY: gh cache delete 54996 --repo facebook/react-native
DRY: gh cache delete 54992 --repo facebook/react-native
DRY: gh cache delete 54987 --repo facebook/react-native
DRY: gh cache delete 54994 --repo facebook/react-native
```

Reviewed By: cipolleschi

Differential Revision: D59865637

Pulled By: blakef

fbshipit-source-id: 7d7a447a3fbcd1a3a15da7a43493c8544d93c263
2024-07-17 14:57:23 -07:00
Peter Abbondanzo 0ad437390c Support loading XML assets (#45334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45334

Adds support for the `xml` file extension as a loadable asset, and lets Flow treat the type signature as an image

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58261501

fbshipit-source-id: b29cffee81d0438827529711e86267edd5d2a0f7
2024-07-17 12:37:01 -07:00
Riccardo Cipolleschi f0f9ac67f4 Update testing scripts to work with any version of React native (#45498)
Summary:
I'm picking 1630b5c743 in main as it's currently missing (available only on `0.75-stable`).

## Changelog:

[INTERNAL] - Update testing scripts to work with any version of React native

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

Test Plan: Nothing to test as this is a backport

Reviewed By: cipolleschi

Differential Revision: D59861440

Pulled By: cortinico

fbshipit-source-id: 57f642c66c7a6976f5a5cd53debaeb2e461a1f30
2024-07-17 12:18:11 -07:00
Blake Friedman 188a09ef69 fix linting noise (#45465)
Summary:
## Summary:
Fix linting warnings

Changelog: [Internal]

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

Test Plan:
```
$ eslint .
Done in 46.11s.
$ arc f
ok No lint issues.
```

Reviewed By: cipolleschi

Differential Revision: D59805820

Pulled By: blakef

fbshipit-source-id: f33d99a6a06607c3c3762881cc7c182804b981e1
2024-07-17 10:07:00 -07:00
Riccardo Cipolleschi 394aae1c1c Make the ScrollView connect with the TurboAnimatedModule to fix pressable and animated (#45457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45457

With this change, we are implementing in Android a similar logic that we implemented in iOS.
1. When the user stops dragging a scroll view, it tells native animated modle that a scroll has finished
2. NativeAnimated module asks to the NativeAnimatedNodesModule if there are native node listening to the scroll
3. In case they are, it emits an event to JS
4. JS listen to the events and resync the Shadow Tree and the Native Tree (this implemented in a previous change)

## Changelog
[Android][Fixed] - Sync the Shadow Tree and the Native Tree with Native animation when scroll is driving the animation

Reviewed By: sammy-SC

Differential Revision: D59756577

fbshipit-source-id: e558557b477f4da9da1f89fb31ba86d0ea1390a3
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi fd748ae84c Receive the onUserDrivenAnimationEnded event in JS (#45383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45383

This is the second step required to fix the onTouchMove event in the new architecture.

In this change, we are retrieving the list of nodes that are connected by the animation, and we are sending an event to the nodes so that we can trigger the commit.

## Changelog
[iOS][Added] - retrieve the tags of the nodes connected by the animation and send them to JS

Reviewed By: sammy-SC

Differential Revision: D59524617

fbshipit-source-id: 584317afa8e4cf0ad9f98f38e4e5d436c5fe3ac5
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi 7af743236f Send onScrollEnded Event to native driver (#45382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45382

This change is the first step to tr and solve the pressability's `onTouchMove` issue with animation driven natively in the New Architecture.

 The idea is to trigger a special event from native to let JS know that a scroll event has ended (`scrollViewDidEndDragging` or `scrollViewdidEndDecelerating`).

When this happens, we need to send an event to JS to let him know that it has to sync the Native Tree with the Shadow Tree.

Step 2 is to connect Native with JS

## Changelog:
[iOS][Added] - Send onScrollEnded event to NativeTurboAnimatedModule

Reviewed By: sammy-SC

Differential Revision: D59459989

fbshipit-source-id: cb425cddcdaa9d700ec40accaf4ab3ce1f3c5038
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi dbbb4069b9 Fix prepare hermes workspace warnings in GHA (#45494)
Summary:
Some of the previous commits changed the names of the parameters on one side and not in another, and GHA is emitting some warnings. This change should fix them

## Changelog:
[Internal] - Fix GHA CI warnings

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

Test Plan:
| BEFORE | AFTER |
| --- | --- |
| <img width="1507" alt="Screenshot 2024-07-17 at 14 20 54" src="https://github.com/user-attachments/assets/6703e554-ad74-4fd6-96ba-18baf5e71a52"> | <img width="1718" alt="Screenshot 2024-07-17 at 14 23 31" src="https://github.com/user-attachments/assets/8bb7bd4a-5bd4-417f-9c8a-e7e8db4ba412"> |

Reviewed By: robhogan

Differential Revision: D59857004

Pulled By: cipolleschi

fbshipit-source-id: e8c5050682aba4952e3a2b0c7a660155813d19f1
2024-07-17 08:08:11 -07:00
Blake Friedman 0731f373c1 flow semver 6.2 -> 7 type defintions (#45495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45495

Unify type definitions to semver@7, to fix a [type-sync](https://www.internalfb.com/intern/test/281475050813096/) test that was broken by D59378011.  The test is very simple and doesn't actually understand the typing.

I don't believe there is a significant difference in the typing, esp. with how we're using it.  Flow will tell us if this is the case though (🏖️ 🏰).

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D59855434

fbshipit-source-id: ae3c6b7aa81b3cde25468d72a7922bcb2b6f652f
2024-07-17 07:32:29 -07:00
Pieter De Baets 00d4d9c632 Limit sampling to 50 frames (#45478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45478

Some code is far too recursive. This consumes buffer space and causes problems for the Perfetto frontend. Let's limit it to 50 frames.

Changelog: [Internal]

Reviewed By: rubennorte, sammy-SC

Differential Revision: D59813638

fbshipit-source-id: 69068f9c2193d706ec0cc00ffc0d5950ae094e05
2024-07-17 05:30:21 -07:00
Nicola Corti c1b4133a58 Composite actions inputs should be kebab-case (#45474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45474

Our actions inputs are now a mixture of different casing.
I'm moving everything to be kebab-case

Changelog:
[Internal] [Changed] -  Composite actions inputs should be kebab-case

Reviewed By: cipolleschi

Differential Revision: D59809181

fbshipit-source-id: af6d541c2b4f5fa162dcde412fb8808bae1ef2d3
2024-07-17 03:48:36 -07:00
Nicola Corti 624f8f1919 Remove unused parameter for prepare-hermes-workspace/action.yml (#45472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45472

BUILD_FROM_SOURCE is unused here, I'm removing it.

Changelog:
[Internal] [Changed] - Remove unused parameter for prepare-hermes-workspace/action.yml

Reviewed By: cipolleschi

Differential Revision: D59808781

fbshipit-source-id: 0d6b5a877389bda0923cf6cc18e6330f82c78f57
2024-07-17 03:48:36 -07:00
Nicola Corti 37d1e8e7a0 Act as @react-native-bot on all the actions (#45480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45480

We currently use the default GITHUB_ACTION which makes a lot of interaction
appear as user "GitHub Actions". Instead we could use the `REACT_NATIVE_BOT_GITHUB_TOKEN`
which we have as secret so the bot will actually perform the actions.

Changelog:
[Internal] [Changed] - Act as react-native-bot on all the actions

Reviewed By: cipolleschi

Differential Revision: D59815201

fbshipit-source-id: 702b121ec07d0db10abf25e23f7ddf5658dd5d62
2024-07-17 03:27:12 -07:00
Nicola Corti ec140aa68d Unbreak nightlies by fixing secrets (#45491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45491

The build_android job was missing the sonatype credentials so could not
publish a -SNAPSHOT version. This fixes it.

Changelog:
[Internal] [Changed] - Unbreak nightlies by fixing secrets

Reviewed By: cipolleschi

Differential Revision: D59848810

fbshipit-source-id: 2cc1d03b090d0aeb3886590ec0696f9c3a6556b9
2024-07-17 03:00:33 -07:00
Zeya Peng a6f5e5adeb Fix react/renderer ColorTest (#45485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45485

## Changelog:

the new functions I introduced in https://github.com/facebook/react-native/pull/45365 to read color channel value, like `alphaFromColor`, will return float between 0~255 on iOS and 8bit unsigned ints on other platforms, because of different platform implementation. However that way we cannot assume consistent return value across platforms, which kind of contradicts with RN's cross platform design.

so here I make `alphaFromColor` in Color.h (the cross platform method) to always return uint8_t, while still allow `alphaFromHostPlatformColor` to return different result

[Internal] [Fixed] -

Reviewed By: christophpurrer

Differential Revision: D59826142

fbshipit-source-id: 4401918be29980474bdc8601443ae33155710f22
2024-07-16 16:35:13 -07:00
Deepanshu.shukla 50f7892a1f fix: add headers in fabric image component (#45415)
Summary:
FIXES [45404](https://github.com/facebook/react-native/issues/45404)

 sending headers from Image  component  not working in new arch , implementation was missing
```
<Image
        source={{
          uri: "http://localhost:3000/image",
          headers: {
            "test-header": 'test',
              "hello":"tested"
          }
        }}
        style={{
          width: 300,
          height: 300,
        }}
      />
```

## Changelog:
[IOS] [ADDED]- sending missing **headers** field with **Image** component in fabric

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

Test Plan:
# Tested
Attaching the below video to show how headers are getting received on server from Image component running in new arch

https://github.com/user-attachments/assets/c816265d-0bb5-4670-bde0-cfec72d7618f

Reviewed By: javache, cipolleschi

Differential Revision: D59807462

Pulled By: blakef

fbshipit-source-id: dffa4d80db58de6a81947ac876aa76ec7e62dd48
2024-07-16 16:20:11 -07:00
Rob Hogan db16a7895e jsinspector: Vendor base64 encoding, remove folly::base64 dependency (#45445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45445

Roll our own base64 encoding and revert D59685218, which fixed the missing Folly dependency implied by D54309633.

I assumed Folly base64 was already elsewhere in RN but given it isn't, and we only need simple, non-perf-sensitive encoding for the debugger (not the SIMD or delegated implementations, or decoding), it might be best to just include our own encoder.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58323859

fbshipit-source-id: 5ce98561e9ced82765e8e7c18e5d2ebfa8148c8c
2024-07-16 14:34:14 -07:00
Nicola Corti 8d0cbbf0e6 Make build_android publish to the staging repositories (#45468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45468

This should greatly reduce the time spent on build_npm_package
because we're moving all the publishing logic to build_android.

I need to do a bit more testing with nightlies to make sure that everything is published correctly.

Changelog:
[Internal] [Changed] - Make build_android publish to the stating repositories

Reviewed By: cipolleschi

Differential Revision: D59804015

fbshipit-source-id: be3f0b6e16f5fdbf760ec7a5e16c8e258e06dd28
2024-07-16 13:58:43 -07:00
Andrew Coates 892c8352ca Use more accurate type in LinkingManager spec file (#45450)
Summary:
The `LinkingModule.getInitialURL` method is declared as returning a `Proimise<string>` but looking at the implementation it can also return null:

https://github.com/facebook/react-native/blob/a96272e27eeee0c7a26e73bb32e55d3ef8d741aa/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm#L166
which is returned by
https://github.com/facebook/react-native/blob/a96272e27eeee0c7a26e73bb32e55d3ef8d741aa/packages/react-native/Libraries/Linking/Linking.js#L96
which happens to expand the type to the correct type for most external users.

React-native-window's turbomodule codegen is more type strict, and so cannot return null with the current spec.

## Changelog:

[INTERNAL] [FIXED] - Use more accurate type in LinkingManager spec file

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

Test Plan:
Type change only, so should only affect build time change which will be caught by CI.
Have verified that this type change allows react-native-windows to return null.

Reviewed By: robhogan

Differential Revision: D59816089

Pulled By: zeyap

fbshipit-source-id: 9810f150ce84b503883e72b1f29518d2e62258b6
2024-07-16 13:41:48 -07:00
Rob Hogan c085180264 jsinspector: Support UTF-8 responses to CDP's IO.read (#45426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45426

The initial implementation of `Network.loadNetworkResource` and the accompanying `IO.read` (D54202854) base64-encodes all data as if it is binary. This is the more general case, and we'll continue to base64-encode non-text resources.

In the common case of text resources (particularly JS and JSON), it'd be preferable to do as Chrome does and send UTF-8 over the wire directly. This has a few performance benefits:
 - Less CPU and RAM footprint on device (UTF-8 truncation is constant-time, fast, and in-place), similarly less decoding for the frontend.
 - 25% less data per chunk (base64 encodes 3 bytes as 4 characters), implies up to 25% fewer network round trips for large resources.

It also has the benefit of being human-readable in the CDP protocol inspector.

## Determining whether data is text
We use exactly Chromium's heuristic for this (code pointers in comments), which is based only on the `Content-Type` header, and assuming any text mime type is UTF-8.

## UTF-8 truncation
The slight implementation complexity here is that `IO.read` requests may specify a maximum number of bytes, and so we must slice a raw buffer up into valid UTF-8 sequences. This turns out to be fairly simple and cheap:
 1. Naively truncate the buffer, inspect the last byte
 2. If the last byte has topmost bit =0, it's ASCII (single byte) and we're done.
 3. Otherwise, look back at most 3 bytes to find the first byte of the code point (topmost bits 11), counting the number of "continuationBytes" at the end of our buffer. If we don't find one within 3 bytes then the string isn't UTF-8 - throw.
 4. Read the code point length, which is encoded into the first byte.
 5. Resize to remove the last code point fragment, unless it terminates correctly exactly at the end of our buffer.

## Edge cases + divergence from Chrome
Chrome's behaviour here in at least one case is questionable and we intentionally differ:
 - If a response has header "content-type: text/plain" but content eg`0x80` (not valid UTF-8), Chrome will respond to an `IO.read` with `{ "data": "", "base64Encoded": false, "eof": false }`, ie an empty string, but will move its internal pointer such that the next or some subsequent `IO.read` will have `"eof": true`. To the client, this is indistinguishable from a successfully received resource, when in fact it is effectively corrupted.
 - Instead, we respond with a CDP error to the `IO.read`. We do not immediately cancel the request or discard data, since not all `IO.read` errors are necessarily fatal. I've verified that CDT sends `IO.close` after an error, so we'll clean up that way (this isn't strictly guaranteed by any spec, but nor is `IO.close` after a resource is successfully consumed).

Changelog:
[General][Added] Debugger: Support text responses to CDP `IO.read` requests

Reviewed By: hoxyq

Differential Revision: D58323790

fbshipit-source-id: def8bf8426266f16bb305d836a6efe8927a9dfc4
2024-07-16 12:31:41 -07:00
Håkon Knutzen 0f051f6034 Add missing lock around assignment of cancellation handler in RCTImageLoader (#45454)
Summary:
When running the entire unit test suite of `RNTesterPods` with `TSan`, I saw that occasionally a data race was detected on line 843 of `RCTImageLoader`. It seems the completion handler that does contain the lock around `cancelLoad` is called concurrently with the value being assigned on line 843. Here there is no lock in place.

Here is the output of `TSan` when I comment out my fix:
```
WARNING: ThreadSanitizer: data race (pid=72490)
  Write of size 8 at 0x000144151ce8 by main thread:
    #0 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16e8030)
    https://github.com/facebook/react-native/issues/1 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/2 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/4 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Previous write of size 8 at 0x000144151ce8 by thread T4 (mutexes: write M0):
    #0 __140-[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_2 <null> (RNTesterUnitTests:arm64+0x16e8894)
    https://github.com/facebook/react-native/issues/1 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke <null> (RNTesterUnitTests:arm64+0x16e3430)
    https://github.com/facebook/react-native/issues/2 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_3 <null> (RNTesterUnitTests:arm64+0x16e52a8)
    https://github.com/facebook/react-native/issues/3 __75-[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority]_block_invoke_2 <null> (RNTesterUnitTests:arm64+0x7f24)
    https://github.com/facebook/react-native/issues/4 -[RCTConcreteImageURLLoader loadImageForURL:size:scale:resizeMode:progressHandler:partialLoadHandler:completionHandler:] <null> (RNTesterUnitTests:arm64+0x6c470)
    https://github.com/facebook/react-native/issues/5 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke.172 <null> (RNTesterUnitTests:arm64+0x16e4964)
    https://github.com/facebook/react-native/issues/6 __tsan::invoke_and_release_block(void*) <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x77ee0)
    https://github.com/facebook/react-native/issues/7 _dispatch_client_callout <null> (libdispatch.dylib:arm64+0x3974)

  Location is heap block of size 48 at 0x000144151cc0 allocated by main thread:
    #0 malloc <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x4fa48)
    https://github.com/facebook/react-native/issues/1 _malloc_type_malloc_outlined <null> (libsystem_malloc.dylib:arm64+0xf3ec)
    https://github.com/facebook/react-native/issues/2 _call_copy_helpers_excp <null> (libsystem_blocks.dylib:arm64+0x10b4)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/4 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Mutex M0 (0x000108f316e8) created at:
    #0 pthread_mutex_init <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x2cc98)
    https://github.com/facebook/react-native/issues/1 -[NSLock init] <null> (Foundation:arm64+0x5ca14c)
    https://github.com/facebook/react-native/issues/2 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/4 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/5 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Thread T4 (tid=10935088, running) is a GCD worker thread
```

## Changelog:

[iOS][Fixed] Data race in `RCTImageLoader` related to assignment of cancellation block.

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

Test Plan: There are already tests in place for `RCTImageLoader`. I hope these will cover the fix.

Reviewed By: realsoelynn

Differential Revision: D59816000

Pulled By: zeyap

fbshipit-source-id: f959d472eb60f83f39ced6711ee395949ab37e7c
2024-07-16 12:30:43 -07:00
Nicola Corti fb9ce762f7 Enable add-job-summary-as-pr-comment for failed jobs (#45479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45479

This just prints a summary on PRs if the Gradle task fails so it's easier to jump directly
to the failure.

Changelog:
[Internal] [Changed] - Enable add-job-summary-as-pr-comment for failed jobs

Reviewed By: cipolleschi

Differential Revision: D59812845

fbshipit-source-id: 2069a1c8db7d264ca1af3c1182fa443cb0a69646
2024-07-16 10:43:03 -07:00
Alex Hunt c47b04b07e Enable Fusebox by default (#45469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45469

Enables React Native DevTools by default on `main`, ahead of the 0.76 release. We've observed no new bug reports internally over the last two weeks, and are moving forward with our rollout plan.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59804882

fbshipit-source-id: 0cb6302f4d940718786db2e5d8fb652fae6a8c54
2024-07-16 10:16:25 -07:00
Nicola Corti 12f58a6452 Split the rntester APK artifacts in 4 (#45475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45475

Instead of zipping all the RNTester's APK together, let's
upload them per buildVariant so it's easier to retrieve them later.

Changelog:
[Internal] [Changed] - Split the rntester APK artifacts in 4

Reviewed By: cipolleschi

Differential Revision: D59809721

fbshipit-source-id: 2d375475d5cee71c212f4d1f3a4a9edf3442358f
2024-07-16 10:01:21 -07:00
Nicola Corti 16b9b55cf1 actions/upload-artifact to v4.x
Summary:
We don't need to specify a minor/patch for actions/upload-artifact.
We also have all sorts of different versions scattered around the codebase.
This aligns them to the latest sable in the 4.x series.

Changelog:
[Internal] [Changed] - actions/upload-artifact to v4.x

Reviewed By: cipolleschi

Differential Revision: D59811525

fbshipit-source-id: 7264db097bcb2ff34b3ace467996e8308c0f2034
2024-07-16 10:01:21 -07:00
Nick Lefever c0b288ca3f Use weak ptr for runtime shadow node reference (#45463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45463

Changelog: [Internal]

State updates will clone shadow nodes for an shadow tree revision that is outdated.

This can lead to accessing deallocated shadow node references because the JS renderer committed a newer revision and deallocated the one used by the pending state update.

By using a weak pointer to hold a reference to the runtime shadow node reference, we can only update references for wrappers that are still valid.

Reviewed By: javache

Differential Revision: D59804999

fbshipit-source-id: 89c9967d139d3cac7d7252994beae419bc591e79
2024-07-16 09:23:42 -07:00
Nicola Corti 2098806c22 Unbreak RNTester instacrashing on main (#45467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45467

This unbreaks RNTester instacrashing on main.

Changelog:
[Internal] [Changed] - Unbreak RNTester instacrashing on main

Reviewed By: javache

Differential Revision: D59806826

fbshipit-source-id: 6d5246cd02e2c364068d047b973b2954b459df1e
2024-07-16 07:42:43 -07:00
Riccardo Cipolleschi 050006a7a7 Add example for Pressability with Native Driver in RNTester (#45413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45413

## Changes
Add an example in RNTester to test that pressability with NativeDrivers works properly.

## Context
The pressability handling is a bit peculiar.
We have to handle 3 main behaviors:
* `PressIn` -> `PressOut` => triggers the `onPress`
* `PressIn` -> move inside the rectangle -> `PressOut` => triggers the `onPress`
* `PressIn` -> move outside the rectangle -> `PressOut` => cancel `onPress`.

For the first case, we detect whether the press happens inside a component in the Native layer only. And everything works.

When a move is involved, we:
1. Detect the initial press in the Native layer
2. We move the coursor and we delegate the detection of whether we are inside of a rect or not to the JS layer
3. The JS layer asks the C++ layer about the layout and decide whether we are in case 2 (move but still inside the rect) or in case 3 (move but outside the rect).

The problem is that with `nativeDriver` and animations, the C++ layer doesn't know about where the receiver view actually is.
This results in issues like the one shown by [#36504](https://github.com/facebook/react-native/issues/36504), where the onMove is not handled correctly.

## Solution
The solution is to keep detecting whether we are in the receiver view or not in the Native layer and pass the receiver view position and size back to JS so that the JS layer don't have to jump to C++ to make this decision.

We decided to pass the frame information because the JS layer is adding some padding and configurations to the final rectangle and we don't want to lose those configurations.

## Changelog
[General][Added] - Add example in RNTester to show that pressability works properly with NativeDrivers

Reviewed By: sammy-SC

Differential Revision: D58182480

fbshipit-source-id: 9ca4fb9a3ca1a8af52ccbe208cbfe8434175f87d
2024-07-16 07:20:51 -07:00
Riccardo Cipolleschi 7fd6c2c45e Fix CCI cache issues (#45460)
Summary:
CCI on main is broken. We suspect that's due to cache issues which restore a wrong layout for the Folly pod.
This PR is an attempt to fix it

## Changelog:
[Internal] - Fix missing folly base 64

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

Test Plan: CCI and GHA are green

Reviewed By: sammy-SC, huntie

Differential Revision: D59804748

Pulled By: cipolleschi

fbshipit-source-id: 44d6b169cf3319f4d7ee9e0a5833f07bc6ba4bb3
2024-07-16 06:26:07 -07:00
Pieter De Baets 5bb57eb2b3 Ignore PackagerStatusCallback on invalidated ReactInstanceManager (#45458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45458

Checking for packager is an async operation, which may return when we've already destroyed the ReactInstanceManager. Prevent the CatalystInstance from being created if the ReactInstanceManager has been invalidated.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59753247

fbshipit-source-id: e3ac2b6dd142330e2d4051519b9863584b33f8a6
2024-07-16 05:19:33 -07:00
shubhamguptadream11 b243d343fa fix: background color fix when border is dotted and dashed (#45430)
Summary:
This PR fixes these issues: https://github.com/facebook/react-native/issues/42289, https://github.com/facebook/react-native/issues/45368

## Changelog:

[IOS] [FIXED] - Message

In iOS for old/new architecture when we are trying to pass borderStyle other than 'solid' then in this
**Old Arch file**
https://github.com/facebook/react-native/blob/2eb7bcb8d9c0f239a13897e3a5d4397d81d3f627/packages/react-native/React/Views/RCTView.m#L807
**New Arch file**
https://github.com/facebook/react-native/blob/2eb7bcb8d9c0f239a13897e3a5d4397d81d3f627/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L652
 file useCoreAnimationBorderRendering is coming as nil since borderStyle passed is not **solid**. Due to which else case block executes and there we are applying backgroundColor as nil.

I just removed that hardcoded check for sold style and make sured that it is now working now with all three borderStyle 'dotted' | 'solid' | 'dashed' for Text and View both

<!-- 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/45430

Test Plan:
Tested with possible borderStyle values.

Providing the fixed screenshot here.

![simulator_screenshot_5E7DDDE7-71F2-4A35-93B3-BFD9F980EA18](https://github.com/user-attachments/assets/3949085e-946f-4669-aaf5-fe366f7e6fc4)

Reviewed By: cortinico

Differential Revision: D59755124

Pulled By: cipolleschi

fbshipit-source-id: 091bb9ba731ac93973230970b526396fd6ea2989
2024-07-16 04:39:21 -07:00
Pieter De Baets e02ca334b1 Skip getProperty calls for unreferenced props in RawPropsParser (#45456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45456

Small perf improvement when using enableCppPropsIteratorSetter

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D59699469

fbshipit-source-id: d65a5e26faf218d0b79c9ac691007310b6db4182
2024-07-16 04:38:45 -07:00
Blake Friedman b443e37a02 disable gradle home cleanup (#45459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45459

Seeing failures on main with GHA for gradle builds, in the Post Setup gradle step:

```
Could not get unknown property 'cleanupTime' for object of type org.gradle.api.internal.cache.DefaultCacheConfigurations.
```

This is a speculative change to get CI back to stable.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59802517

fbshipit-source-id: c7b5259397fddef9420570043263e92f21718934
2024-07-16 04:20:37 -07:00
Riccardo Cipolleschi 3d5daa12d4 Factor out build-android (#45455)
Summary:
This change factors out build-android job so we can reuse it

## Changelog:
[Internal] - Factor out the build-android job for code reuse

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

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D59802116

Pulled By: cipolleschi

fbshipit-source-id: 12ece8004da3bfd1f275b4af8e9822d4b0ccc0f0
2024-07-16 03:34:34 -07:00
Samuel Susla 334b5c9fdb Execute insert mount instructions after layout update and state update (#45448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45448

changelog: [internal]

I would like to experiment with executing insert mount instructions after layout and state update. It has shown small improvement in local testing

Reviewed By: mdvacca

Differential Revision: D59582123

fbshipit-source-id: 3ee6ec12a533a287ed32f7373863175f3a107548
2024-07-16 02:13:12 -07:00
Samuel Susla 4d88b20847 create hook to setup animations in passive effects (#45410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45410

changelog: [internal]

For better performance, let's test setting up the animation graph from passive effects. This will delay the work, not blocking the paint.

Reviewed By: rubennorte

Differential Revision: D59644374

fbshipit-source-id: ff951ee7c1a1d47e13c55fc7c7f6c0690aa465f7
2024-07-16 02:13:12 -07:00
Ruslan Shestopalyuk e443c1f0cf Make sure that ScrollView.scrollIndicatorInsets prop finds its way from JS into C++/Fabric (#45444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45444

## Changelog:

[Internal] -

Even though `ScrollView.scrollIndicatorInsets` isn't supported on the vanilla Android platform, it still may be used on some other variations of it, which means that the changes may not potentially find the way into C++/Fabric, opening a door of all kinds of weird corner case issues.

Reviewed By: christophpurrer

Differential Revision: D59761458

fbshipit-source-id: 4dae5c96791ca924d589a3d803d8fa60fdca1b67
2024-07-16 01:33:43 -07:00
Joe Vilches 944d40f204 Add mix-blend-mode effects to iOS (#45304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45304

Add support for most keyword values of mix-blend-mode on iOS and added RNTester Example
Missing compositing operators and global values

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59402969

fbshipit-source-id: b7e1aaed01fbf8f80e04ad0fa73d2ef63b5ad933
2024-07-15 18:10:17 -07:00
Joe Vilches a96272e27e Add drop-shadow test (#45306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45306

Adding missing drop-shadow test to rn-tester.
Added with alpha-hotdog image to show we are creating the shadow with the alpha channel of the view.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59410148

fbshipit-source-id: 5a03ee84313979f99585b8ca7e07abf9cdbe2396
2024-07-15 16:09:43 -07:00
generatedunixname89002005232357 85dd14c912 Revert D59170923 (#45447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45447

This diff reverts D59170923
Breaking OSS build

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59759991

fbshipit-source-id: 39aa0b447a90801d1da5a39461b33b4c4cc4197b
2024-07-15 13:44:09 -07:00
Nick Gerleman 2d67b723d3 Gate off "mixBlendMode" and "filter" on Paper (#45443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45443

We are only building these out for Fabric. This means only one natural iOS impl, but that other Android bits will not work fully correctly on Paper (like setting containing block for filter element). This also means we can remove view configs once we're on Fabric CSS parser. We will do the same for boxShadow once that is ready.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D59762282

fbshipit-source-id: 14ce07f04b822c6aee908894c9081419594fc484
2024-07-15 13:05:40 -07:00
Peter Abbondanzo 018d0621c1 Declare public resources from images that are loaded by name (#45421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45421

RNTester contains Android resources that are loaded by name and not resolved by Metro. As a result, these assets are not automatically linked when RNTester JS code is embedded in other projects. This is considered "legacy" loading and is generally discouraged, but is still showcased as an alernative way of loading resources.

I also modified the Image test to ensure that flag status is printed so it's obvious why the vector drawable hasn't loaded.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59585555

fbshipit-source-id: d42fb44d8846d8e7c7aa01dca4cec89ae85a9195
2024-07-15 12:39:06 -07:00
Nicola Corti 52237838dc Deprecate DeveloperSettings.isStartSamplingProfilerOnInit (#45442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45442

This deprecates also `DeveloperSettings.isStartSamplingProfilerOnInit`
so we can remove it in a future version of React Native.

This field is unused so you should not be using it at all.

Changelog:
[Android] [Changed] - Deprecate DeveloperSettings.isStartSamplingProfilerOnInit

Reviewed By: blakef

Differential Revision: D59757500

fbshipit-source-id: dc879ba46f2f937e5f259a4101646c2f060db548
2024-07-15 12:16:33 -07:00
rozele (Meta Employee) 8f27188037 Updates ViewConfig types to delegate isInAParentText context (#29872)
Summary:
## Summary

Now that HostContext determination for Fabric is a DEV-only behavior, we
can move the HostContext determination to resolve from the ViewConfig
for a given type. Doing this will allow arbitrary types to register
themselves as potential parents of raw text string children. This is the
first of two diffs for react as we'll:

1. Add the new property to the ViewConfig types
2. Update React Native to include the `supportsRawText` property for
`RCTText`, `RCTVirtualText`, `AndroidTextInput`, etc.
3. Switch the behavior of react to read from the ViewConfig rather than
a static list of types.

Changelog: [Internal]

## Test Plan

- yarn test
- yarn test --prod
- Pulled change into react-native, added `supportsRawText` props to
RCTText, RCTVirtualText, etc. ViewConfigs and confirmed everything type
checks.

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

bypass-github-export-checks

Reviewed By: poteto

Differential Revision: D59641180

Pulled By: rozele

fbshipit-source-id: a3ddb1bc810a70d5f782e708cb845e3eae136d78
2024-07-15 10:58:38 -07:00
zhongwuzw 9e2f8859c4 Reland: [iOS] Fixes ellipsis carries background from trimmed text (#45412)
Summary:
Reland https://github.com/facebook/react-native/issues/39408 . Try to fix the crash https://github.com/facebook/react-native/issues/37926#issuecomment-2225113557. cc. javache I changed the range from glyph to character because all attributes related APIs are character range.

## Changelog:

[IOS] [FIXED] - Fixes ellipsis carries background from trimmed text

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

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

Reviewed By: cipolleschi

Differential Revision: D59681679

Pulled By: javache

fbshipit-source-id: de4cb73e0304b8c0b0a40f4f6838b2c679747009
2024-07-15 10:53:35 -07:00
Blake Friedman 24997dc5ae allow use without @react-native-community/cli-server-api (#45311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45311

Allows Gradle and Xcode builds to continue without the rnc dependency.

Reviewed By: cipolleschi

Differential Revision: D59377223

fbshipit-source-id: b0daddae7377b8a0d2ee2a25b2ff10124e5db549
2024-07-15 09:28:58 -07:00
Zeya Peng 97882a16b8 Create Color<->rgba utils on all platforms (#45365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45365

## Changelog

As a followup to https://github.com/facebook/react-native/pull/45139

There I only implemented `hostPlatformColorFromRGBA` and `alpha/red/green/blueFromHostPlatformColor` on cxx platform, then used cxx platform specific method at some places. but really I should implement and use methods in `Color.h` that are platform agnostic

* cxx/android: platform color format is int32_t, RGBA are 8bit unsigned int ([0,255])
* windows: platform color format is `winrt::Windows::UI::Color` where RGBA props are 8bit unsigned ints ([0,255])
* apple: platform color format is `UIColor` where RGBA props are floats in [0,1]

[Internal]

previous change D58872165

Reviewed By: christophpurrer

Differential Revision: D59593659

fbshipit-source-id: 5d18419039817510e607d4e3f632c207d25c30a3
2024-07-15 09:23:21 -07:00
Samuel Susla ccc234986d delete remainings of DELETE_TREE instruction (#45436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45436

changelog: [internal]

In D58355433, delete tree experiment was cleaned up. These are the remainings of the experiment that are no longer used. Let's delete them to clean up dead code

Reviewed By: javache

Differential Revision: D59732137

fbshipit-source-id: a22c0b14eda70e62817e80224f367ccb9006acc9
2024-07-15 08:56:46 -07:00
Peter Abbondanzo aad9240fd4 Support loading vector drawables in ImageView (#45354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45354

Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views ([issue](https://github.com/facebook/fresco/issues/329), [issue](https://github.com/facebook/fresco/issues/1463), [issue](https://github.com/facebook/fresco/issues/2463)). Guidance has been to instead load the vector drawable onto the backing image view ourselves. On the React Native side, having the ability to load vector drawables has been requested many times ([issue](https://github.com/facebook/react-native/issues/16651), [issue](https://github.com/facebook/react-native/issues/27502)).

I went this route over using a custom Fresco decoder for XML assets because vector drawables are compiled down into binary XML and I couldn't find a trivial, performant way to parse those files in a context-aware manner. This change only accounts for vector drawables, not any of the other XML-based drawable types (layer lists, level lists, state lists, 9-patch, etc.). Support could be added easily in the future by expanding the `getDrawableIfUnsupported` function.

## Changelog

[Android] [Added] - Added support for rendering XML assets provided to `Image`

Reviewed By: javache

Differential Revision: D59530172

fbshipit-source-id: 3d427c06238287e0a3b7f9570ac20e43d76126c7
2024-07-15 08:54:48 -07:00
Nicola Corti cbcdb38433 Remove extra dot from close-pr.yml (#45441)
Summary:
This is just a minor nit to make it easier to copy-n-paste

## Changelog:

[INTERNAL] - Remove extra dot from close-pr.yml

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D59752879

Pulled By: cortinico

fbshipit-source-id: caa398010b64024e2a0259d177762fd76082507f
2024-07-15 08:36:26 -07:00
Pieter De Baets cb00ca954d Remove HasJavascriptExceptionMetadata interface (#45440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45440

We only have one type of JavaScriptException anymore, so this can be simplified.

Changelog: [Android][Removed] Removed HasJavascriptExceptionMetadata as a marker interface. Use JavascriptExecption directly

Differential Revision: D57379390

fbshipit-source-id: a088834fddb156ceed5ccc8010d3c4acd365bf29
2024-07-15 08:23:44 -07:00
Blake Friedman b7e70968fa fix config generation without community cli (#45224)
Summary:
The rn-tester android build assumes the react-native-community/cli is available.  This is no longer the case.

Changelog: [Internal]

Differential Revision: D59170923

Pulled By: blakef

fbshipit-source-id: 6f414c2be387ef46dd50ce09a98beb230c8e73b9
2024-07-15 08:00:36 -07:00
Peter Abbondanzo 1ca63e3e3d Check nullability of native view config before validation (#45420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45420

Devex improvement to skip validation when no native view config exists. Redbox is still hit, showing the true error. See test plan below before/after

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59702501

fbshipit-source-id: 9aada9813c2930ee2b4bb23e5ba8a3e546c4e9af
2024-07-15 07:00:35 -07:00
Rubén Norte 7ff1e447fd Fix broken CI due to missing dependencies (#45437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45437

https://github.com/facebook/react-native/pull/45409 broke CI because it didn't set up dependencies correctly. This should fix it.

Changelog: [internal]

Reviewed By: cipolleschi, blakef

Differential Revision: D59751194

fbshipit-source-id: 03dafb2d065b2b60142c5828f00703adae0b0052
2024-07-15 06:50:39 -07:00
Blake Friedman f57740c0fb Remove sampling profiler from dev menu (#45431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45431

This build samples using the legacy format, that have to be manually downloaded and translated by the [removed](https://github.com/react-native-community/cli/commit/aca901dba88cf58a20eef6bcc4fec932e942a99a) `npx react-native-community/cli profile-hermes` command.

Changelog: [Internal][Removed] Profiler option in Catalyst's (Bridge) dev menu

Reviewed By: cortinico

Differential Revision: D59686976

fbshipit-source-id: 90a787a98c91fb398abb10ede0cb27871ca315f9
2024-07-15 06:28:47 -07:00
Riccardo Cipolleschi d2773f0c19 Factor out build-hermesc-windows in separate action (#45432)
Summary:
This change factors out the build hermesc windows job into a separate action to reuse the code in different jobs

## Changelog:
[Internal] - Factor out build hermesc windows for code reuse

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

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D59748955

Pulled By: cipolleschi

fbshipit-source-id: bb6b96c93ec7ba6af1a210511ec672907f237b45
2024-07-15 05:50:21 -07:00
Blake Friedman 4e14c5eeab publish template on publishing release (#45327)
Summary:
Call the react-native-community/template GHA to trigger a new release when we publish a react-native release. This then waits to confirm that the package is published.

See react-native-community/template#36 for the matching change

Changelog: [General][Added] trigger template publish

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

Test Plan: Not sure on the best way forward here.

Reviewed By: cipolleschi

Differential Revision: D59467829

Pulled By: blakef

fbshipit-source-id: 091269e7ecdae5801ac7c03a1ede54452ae99b24
2024-07-15 05:35:33 -07:00
Rob Hogan 3c7e307718 jsinspector: Fix various build warnings (#45423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45423

I noticed while fixing some CI issues that `jsinspector` emits a bunch of warnings, making finding errors (especially in CI logs) awkward.

Also fix up a couple of stale comments from earlier designs of `NetworkIOAgent`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59693730

fbshipit-source-id: d032150787bda320b9c38ccf2e95139411758f47
2024-07-15 04:36:25 -07:00
Blake Friedman 9aaadd9b2e remove rnc/cli-tools version & errors deps (#45380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45380

Removed the use of version checking and error code that is in react-native-community/cli-tools.

Changelog:
[Internal] [Changed] - Removed community-cli-plugin version & error dependencies

Reviewed By: robhogan

Differential Revision: D59378012

fbshipit-source-id: b009edc615b873ff2bff31296ac5d87a4482944f
2024-07-15 04:35:26 -07:00
Blake Friedman 6547b157b5 Remove dependency on rnc/cli-tools logger (#45381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45381

Removing the remaining dependencies from the react-native-community/*. This
inlines a copy of the logger.

Changelog:
[Internal][Changed] Removed react-native-community/cli-tools logger dependency

Reviewed By: cipolleschi

Differential Revision: D59378011

fbshipit-source-id: ef93d9fff1c623658e33c36b6329f5d548f649e8
2024-07-15 04:35:26 -07:00
Rubén Norte c7fab53e50 Replace BridgelessJSCallInvoker with RuntimeSchedulerCallInvoker everywhere (#45409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45409

Changelog: [internal]

This removes `BridgelessJSCallInvoker` in favor of `RuntimeSchedulerCallInvoker`. This change should be transparent when not invoking JS callbacks using priorities, as both of them would just go directly to the scheduler using `scheduleWork`, but when priorities are specified, they'd now be honored in `RuntimeSchedulerCallInvoker`.

I realized this wasn't being used when I saw that `PerformanceObserver` callbacks were always scheduled with the highest priority, instead of with idle priority as specified in code.

Reviewed By: sammy-SC

Differential Revision: D59679512

fbshipit-source-id: 51d36d56ef1ff0b34e5157ed7b5e08de0a3884d2
2024-07-15 04:25:15 -07:00
Dmitry Rykun 2eb7bcb8d9 Prepare to using setNativeProps for Fabric native animations (#45387)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45387

This diff prepares an experiment to test `setNativeProps` for syncing the final state of native driven animations with Fabric.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59634489

fbshipit-source-id: 453c5a2f0edfea695f7564e0c5ead58db21cf61e
2024-07-13 14:34:39 -07:00
Joe Vilches 65a3259f03 Inset box shadow impl (#45337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45337

tsia. Some things to consider when reviewing:

* Made a new drawable for inset shadows
* The drawable in this class is the same size as the view with some padding. The padding is needed for 2 reasons
  * Blur near edges looks good
  * Blur artifacts can appear inside the view if the clear region barely exits the bounds of the view
* We draw the clear shape with another drawable, which solely exists so that we can get the border box path for the adjust border. We just use this path to clip out the shadow

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59300215

fbshipit-source-id: 30acc7aafd82122aa278a42d06418bb1079ca71f
2024-07-12 17:17:00 -07:00
David Vacca 0b20ea9b25 Fix comment in LayoutableShadowNode (#45419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45419

EZ fix comment in LayoutableShadowNode

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D59691737

fbshipit-source-id: 452c166dd478ac6796ae55434fb557355f10fae1
2024-07-12 15:52:19 -07:00
Rubén Norte 0ca3ed87f3 Fix incorrect application of idle priority in RuntimeScheduler (#45408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45408

Changelog: [General][Fixed] Fixed prioritization of idle priority tasks

We recently found out that idle priority tasks were never scheduled with the lowest priority possible. We didn't realize before because idle priority tasks weren't used, but now they are via `requestIdleCallback` and other mechanisms.

The problem was that the timeout for idle priority tasks was `std::chrono:milliseconds::max()`, and we compute the expiration time adding that to the current time. Doing that operation is always guaranteed to overflow, and the resulting expiration time was always in the past, resulting in the task having higher priority than any other tasks with any other priorities.

Instead of using `max()` we can just use a sensible value for idle priorities. In this case, 5 minutes should be more than enough.

Reviewed By: sammy-SC

Differential Revision: D59679513

fbshipit-source-id: 6c0f9e275818737ce804f05615c01f7ea6c126ab
2024-07-12 15:51:51 -07:00
David Vacca 9d8e52b835 Serialize TransformOrigin to folly::dynamic (#45396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45396

This diff extends TransformOrigin with a new method to serialize this Struct into a folly::dynamic map (similar to Transform)

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59613247

fbshipit-source-id: 00e4a08d1a99fe9cabb67206e21712e65b355f7f
2024-07-12 15:19:25 -07:00
David Vacca 9df4239ff9 Introduce enablePropsUpdateReconciliationAndroid feature flag (#45397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45397

This diff introduces the new feature flag named: "enablePropsUpdateReconciliationAndroid"

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59606118

fbshipit-source-id: 1c569a82e08873bdb0443f390757b526fd17e662
2024-07-12 15:19:25 -07:00
Rob Hogan 3603a22652 Include base64 in folly dependency, unbreak CI (#45417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45417

Add sources for `folly::detail::base64` to our existing `folly` dependency for Android and iOS OSS build toolchains, now a (tiny) dependency of the JS debugger since D54309633, and already part of Folly's Buck sources.

Changelog: [Internal]

Reviewed By: cipolleschi, blakef

Differential Revision: D59685218

fbshipit-source-id: bac33402927f310bf867d2c47b4ebbb9276cf545
2024-07-12 11:13:44 -07:00
kunal.chavhan 18d6028ff9 fix: select text on auto focus for TextInput (#45004)
Summary:
Fixes: https://github.com/facebook/react-native/issues/43413

This pull request addresses an issue on Android where the text selection was not working when both `selectTextOnFocus` and `autoFocus` were set to true on TextInput.
`ReactTextInputManager` was calling `setSelectAllOnFocus` on `ReactEditText` before its onLayout is called causing text selection to not work on auto focus.

Changes Made

- Added logic to wait for the ReactEditText view's layout to be drawn before attempting to select the text.
On the first layout pass, the code now explicitly calls selectAll() to select the text.
- Implemented a check to ensure selectAll() is only called during the first layout pass, avoiding unnecessary calls on subsequent layout passes.

Impact
This change ensures that text selection is properly triggered when selectTextOnFocus and autoFocus are both enabled, improving the user experience and making text input behavior consistent and reliable.

## Changelog:

[ANDROID] [FIXED]: fixed select text on auto focus for TextInput

<!-- 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/45004

Test Plan:
| Before | After |
|--------|--------|
| ![before](https://github.com/facebook/react-native/assets/61144478/02da975a-2c80-41b9-86c1-196d0324f437) | ![after](https://github.com/facebook/react-native/assets/61144478/fbe78758-04ab-460f-8ecb-b267ed07751a) |

Reviewed By: javache

Differential Revision: D59448600

Pulled By: cortinico

fbshipit-source-id: 8a594d3193f227ba2d64b808d905bab8b3d24e9b
2024-07-12 10:49:54 -07:00
Nicola Corti 44f8b08b8d Back out "Kotlinify NativeModule" (#45411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45411

Original commit changeset: 6e096552750e

Original Phabricator Diff: D55792976

Changelog:
[Android] [Fixed] - Reverted "[react-native] Kotlinify NativeModule"

Reviewed By: fabriziocucci

Differential Revision: D59680321

fbshipit-source-id: f118f436dc4086676d3ed98fa8d8b28033d9cd47
2024-07-12 09:14:31 -07:00
Nicola Corti cff0d97017 AGP to 8.5.1 (#45406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45406

Just keep our Android Gradle Plugin version up to date.

Changelog:
[Internal] [Changed] - AGP to 8.5.1

Reviewed By: cipolleschi

Differential Revision: D59677574

fbshipit-source-id: 5c80391f8c357f26a9452ac5ac059ee8f5aa569c
2024-07-12 09:00:39 -07:00
Nicola Corti b82d7e100c Gradle to 8.9 (#45407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45407

This bumps to the latest minor of Gradle

Changelog:
[Android] [Changed] - Gradle to 8.9

Reviewed By: NickGerleman

Differential Revision: D59677575

fbshipit-source-id: 05b9afc6f32a9cd11461bc04522d1e522644867e
2024-07-12 09:00:39 -07:00
Peter Abbondanzo 80a3ed7d0c Fix Android AlertFragment Title Accessibility (#45395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45395

## Changelog:

[Android] [Fixed] - Fix AlertDialog title accessibility
Pull Request resolved: https://github.com/facebook/react-native/pull/45048

Making title accessible for android AlertFragment

Reviewed By: blavalla, susnchen

Differential Revision: D58684576

fbshipit-source-id: 83c8cfe9e7aacdf587d325d957694c3c7daa360c
2024-07-12 07:50:05 -07:00
Peter Abbondanzo bac5f1ff3a Add feature flag to enable vector drawable support (#45394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45394

Changelog: [Internal]

The current `Image` implementation does not support loading [vector drawables](https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources) on Android, and support has been requested many times ([issue](https://github.com/facebook/react-native/issues/16651), [issue](https://github.com/facebook/react-native/issues/27502)). I am proposing to put support behind this feature flag in order to validate against performance regressions. Adding support will require reading files from disk to determine if the resource is actually an XML file.

Reviewed By: cortinico

Differential Revision: D59647903

fbshipit-source-id: 2445d71b6769266abe4c2dda521cc2be89bf4064
2024-07-12 07:34:01 -07:00
Blake Friedman ab485c6a94 Fix testID propogation in Fabric (#45379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45379

Fixes an accessibility issue where these values weren't being propogated for RCTTextInputComponentView

See facebook/react-native#38709

Changelog:
[iOS] [Fixed] - testID wasn't propogating to accessibilityIdentifier

Reviewed By: cipolleschi

Differential Revision: D59594049

fbshipit-source-id: 89ec15f92b423b6e18b1a5eb9d32fc4013c039ba
2024-07-12 06:17:42 -07:00
Rob Hogan 193cdc36f7 Implement Network.loadNetworkResource etc in C++ (#44845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44845

## Design
 - `NetworkIOAgent` is owned by the `HostAgent`.
 - `NetworkIOAgent` is passed any CDP requests not handled by the `HostAgent` itself, and before delegating to `InstanceAgent`.
 - It handles:
   - [`Network.loadNetworkResource`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)
   - [`IO.read`](https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-read)
   - [`IO.close`](https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-close)
 - `NetworkIOAgent.loadNetworkResource` creates a `Stream` corresponding to a single resource download/upload. A reference is held in a map `streams_` until an error, the agent is disconnected (destroyed) or it is discarded by the frontend with `IO.close`.
 - `delegate.loadNetworkResource` is called with a `stream`-scoped executor, which it uses to call back with headers, data and errors.
 - Callbacks for `IO.read` requests are held by the `Stream` until the incoming data is complete or enough data is available to fill the request (an implementation choice to optimise for fewest round trips). Any incoming data or error causes any pending requests to be rechecked.

 {F1719616688}

## Unimplemented platforms
 - Platforms may optionally implement `HostTargetDelegate.networkRequest` (as of this diff, none do). If they don't we report a CDP "not implemented" error, similar to the status quo where it was unimplemented by the C++ agent.

Changelog:
[General][Added] Debugging: implement common C++ layer of CDP `Network.loadNetworkResource`

Reviewed By: motiz88

Differential Revision: D54309633

fbshipit-source-id: 51e416e9d537b253f72693952d5fd520b6ae11b6
2024-07-12 05:21:02 -07:00
Samuel Susla 7d7d403ecf add number of instructions to systrace (#45384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45384

changelog: [internal]

add a little more information to the mounting instructions block

Reviewed By: javache, rubennorte, mdvacca

Differential Revision: D59631537

fbshipit-source-id: 140ba1834172686998c51a9645ea1e66fff1879d
2024-07-12 04:10:31 -07:00
Nick Gerleman 47261bfb79 Fix main branch iOS prerelease constant (#45398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45398

Accidentally left in a value (that Phabricator then hid) which I was using to test fixed prerelease constants in D59141948... On real releases, this is overwritten by the version stamping process.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D59668218

fbshipit-source-id: 3d04e52db75a5d8a53cf47d3a2f88b643030d94e
2024-07-12 03:43:29 -07:00
Riccardo Cipolleschi 1568a29144 Factor out build hermesc for Linux (#45402)
Summary:
This change factors out the Build HermesC for Linux job so that we can reuse the code in various workflows

## Changelog:
[Internal] - Factor out build-hermesc-linux for code reuse

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

Test Plan: GHA are green

Reviewed By: cortinico

Differential Revision: D59673895

Pulled By: cipolleschi

fbshipit-source-id: f5c680d523866442d25317e880b4803ac89c3741
2024-07-12 03:21:39 -07:00
zhongwuzw c5b87aba7c Don't set empty string when remove ccache (#45400)
Summary:
After `pod install`, it would set some empty flags, which seems useless. cc cipolleschi .

![image](https://github.com/user-attachments/assets/fb795c61-0838-4522-a34b-cde469467b3b)

## Changelog:

[IOS] [FIXED] - Don't set empty string when remove ccache

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

Test Plan: No empty flags should be set after we exec `pod install`.

Reviewed By: cortinico

Differential Revision: D59671357

Pulled By: cipolleschi

fbshipit-source-id: 26b55da9efaeed36876649cc27f09ecafaba412a
2024-07-12 02:52:22 -07:00
Wojciech Lewicki c16761da83 feat: expose prefabs for newly added targets (#45386)
Summary:
In recent commits, some new targets have been added, and they are not exposed as prefabs, yet are used in e.g. `TextLayoutManager`. They are needed then for `react-native-live-markdown`: https://github.com/Expensify/react-native-live-markdown/pull/428/commits/c1611cd98ed5009fd66c871b9999b55941086af0

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [ADDED] - expose prefabs for newly added targets

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

Test Plan: It cannot be tested inside the repo, but try to build the `example` app with new arch enabled on `Android` in the `react-native-live-markdown` repo to see that those are needed.

Reviewed By: NickGerleman

Differential Revision: D59638801

Pulled By: cortinico

fbshipit-source-id: 3d09507d72a0c4d3dbb3a2a81b753625230a04a3
2024-07-12 02:10:05 -07:00
Pieter De Baets b1c5432b13 Revert D59519171: 【iOS】Fixes ellipsis carries background from trimmed text
Differential Revision:
D59519171

Original commit changeset: 87c985859e98

Original Phabricator Diff: D59519171

fbshipit-source-id: 1686b8a406d1a9b163eb6ad0cb9827f5a0724e89
2024-07-12 01:47:21 -07:00
Nick Gerleman d68a1771f0 Revert D59566611: Fix Android removeClippedSubviews in horizontal ScrollView in RTL
Differential Revision:
D59566611

Original commit changeset: a2eb12b984dc

Original Phabricator Diff: D59566611

fbshipit-source-id: 144c479c264b8f1ca25a571ae73cc0db241e075d
2024-07-11 20:52:29 -07:00
Nicola Corti 3f8340975b Undo a breaking change with ResourceDrawableIdHelper.instance (#45389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45389

This undos a breaking change with ResourceDrawableIdHelper for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.

Changelog:
[Android] [Fixed] - Undo a breaking change with ResourceDrawableIdHelper.instance

Reviewed By: robhogan

Differential Revision: D59638043

fbshipit-source-id: ae2aab962e9a7676f0bfbae21f699e274502dc6a
2024-07-11 14:54:13 -07:00
Nicola Corti 221755c495 Undo a breaking change with I18nUtil.instance (#45390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45390

This undos a breaking change with I18nUtil for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.

Changelog:
[Android] [Fixed] - Undo a breaking change with I18nUtil.instance

Reviewed By: alanleedev

Differential Revision: D59638044

fbshipit-source-id: 1c93a98676b5b01e89be3b974961c5f3ae919511
2024-07-11 14:54:13 -07:00
Nicola Corti b24d47a9a7 Undo breaking change for ReadableMap.entryIterator for Kotlin consumers. (#45388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45388

This undos a breaking change we're about to ship in 0.75, where Kotlin users
where forced to update this callsite to be `.getEntryIterator`.

This re-introduces a `entryIterator` val so both Kotlin and Java compatibility are retained.

Changelog:
[Android] [Fixed] - Undo breaking change for ReadableMap.entryIterator for Kotlin consumers

Reviewed By: alanleedev

Differential Revision: D59637925

fbshipit-source-id: b674df86e056f17791d9cabe28557529886f1c93
2024-07-11 14:54:13 -07:00
Nicola Corti 5e31b45fc7 Undo breaking change on Dynamic.type and Dynamic.isNull (#45378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45378

Kotlin consumers of those APIs are forced with this breaking change:

```
# Before thanks to Java property conversion
Dynamic.type
# After
Dynamic.getType()
```
This restores the old more idiomatic API by moving those 2 funcitons to be vals.

Changelog:
[Android] [Fixed] - Undo breaking change on Dynamic.type and Dynamic.isNull

Reviewed By: javache

Differential Revision: D59631783

fbshipit-source-id: 8d720af34e104ee0e4f3120302a4a84fc17a7b1c
2024-07-11 12:19:55 -07:00
David Vacca 384983025a Introduce Systrace.beginSection with args (#45392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45392

In this diff I'm introducing a new overload of Systrace.beginSection to receive arguments by parameter

changelog: [Android][Added] Introduce Systrace.beginSection with arguments

Reviewed By: sammy-SC

Differential Revision: D59639329

fbshipit-source-id: 23d43e5dd48fdde9c7d49a1c10fa9ecc4c3b7196
2024-07-11 12:18:06 -07:00
Pieter De Baets b1405b5a81 Cleanup enableRemoveDeleteTreeInstruction experiment (#45385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45385

We ran various experiments with this flag, and this does not turn out to provide any significant benefits at this point to make it worth the complexity and platform divergence it introduced.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58355433

fbshipit-source-id: 4b857a5d0b8aa5915b4a880cbcae2526a16a08a9
2024-07-11 11:19:55 -07:00
zhongwuzw fcb6cdc710 【iOS】Fixes ellipsis carries background from trimmed text (#39408)
Summary:
Fixes https://github.com/facebook/react-native/issues/37926.

## Changelog:

[IOS] [FIXED] - Fixes ellipsis carries background from trimmed text

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

Test Plan:
Demo code:
```
<Text numberOfLines={1} ellipsizeMode={'tail'}>Long text <Text style={{backgroundColor: 'red'}}>Nested text</Text></Text>
```

Before fix:
![image](https://github.com/facebook/react-native/assets/5061845/05467128-a4f9-4f81-bb22-c1085a3bc721)

After fix:
![image](https://github.com/facebook/react-native/assets/5061845/b6b024ae-5329-47d3-a07c-1ba089802edd)

Reviewed By: cipolleschi

Differential Revision: D59519171

Pulled By: javache

fbshipit-source-id: 87c985859e9892fd2e4d6bb3d62b08627247df70
2024-07-11 08:46:26 -07:00
Pieter De Baets c4a6bbc8fd Do eager native module init on mqt_native thread (#45324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45324

Improve concurrency during startup of bridgeless by concurrently initializing eager native modules and triggering bundle load.

Changelog: [Android][Changed] Modules marked with needsEagerInit = true will now be created on the mqt_native thread.

Reviewed By: mdvacca

Differential Revision: D59465977

fbshipit-source-id: 55cc0f0359bafcf32dc538f4346c6a5d5546f658
2024-07-11 07:47:10 -07:00
Nicola Corti 2ea9c360dc Undo breaking change on getJsCallInvokerHolder (#45376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45376

This reduces one breaking change users are seeing on `CatalystInstance.getJsCallInvokerHolder`.
I had to specify:

```
Suppress("INAPPLICABLE_JVM_NAME")
get:JvmName("getJSCallInvokerHolder")
```

as the Kotlin compiler is unhappy with me setting a JvmName on a interface property.
More on this here: https://youtrack.jetbrains.com/issue/KT-31420

Changelog:
[Android] [Fixed] - Undo breaking change on `CatalystInstance.getJsCallInvokerHolder`

Reviewed By: javache

Differential Revision: D59631640

fbshipit-source-id: 4d5b3499e4e0e0bec1d380c4b7942ea28ae35465
2024-07-11 07:45:55 -07:00
Samuel Susla 33262c1717 remove gating for prevent double measure flag (#45375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45375

changelog: [internal]

this is shipped, let's remove gating.

Reviewed By: javache

Differential Revision: D59585030

fbshipit-source-id: 05c76099c27010a7e2e2167c5af5bb5346a00f47
2024-07-11 05:26:27 -07:00
Riccardo Cipolleschi 6e2ba742ff Factor out the CXX language standard in a separate const (#45374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45374

This change factors out the language standard in a separate constant so we can easily control it from a single place.

There are only 2 exception to this:
1. hermes-engine: the podspec is used in CI and it has no access to the rct_cxx_language_standard variable
2. Yoga: it can be used as a separate pod, outside of React Native, so it makes sense to leave it alone.

This change also fixes a problem where, in some setup, the language was set to C++14

## Changelog
[Internal] - Refactor Cxx language standard in a single constant

Reviewed By: dmytrorykun, blakef

Differential Revision: D59629061

fbshipit-source-id: 41eac64e47c14e239d8ee78bd88ea30af244d695
2024-07-11 05:25:38 -07:00
Pieter De Baets 2455a84db8 Simplify Java TurboModule lookup (#45322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45322

Instead of using multiple weak_ptr and weak_ref, use a single weak_ref to the Java object and use that to get back to the original C++ instance, without the need for additional shared_ptr.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59465976

fbshipit-source-id: d410bdacf21a1886c6ed95d2c57ac8c6e17428e3
2024-07-11 04:48:18 -07:00
Riccardo Cipolleschi 7b424f090a Factor out build hermes Macos (#45371)
Summary:
Factor out the build-hermes-macos job to reuse the code

## Changelog:
[Internal] - Factor out build hermes macos action

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

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D59627977

Pulled By: cipolleschi

fbshipit-source-id: 84226d8a2c036f816fa8ea949b467873a7eef37c
2024-07-11 03:50:15 -07:00
Miklós Fazekas 3782511350 fix: android autolinkLibrariesFromCommand should handle timeout or non zero exit code (#45333)
Summary:
Fixes: https://github.com/facebook/react-native/issues/45307

## Changelog:

[Android] [Fixed] - if `npx react-native-community/cli config` fails or timeouts proper error is shown and built is aborted, instead of leaving and empty autolinking.json

During build `npx react-native-community/cli config` is generated into autolinking.json. When command fails, we should error and should not leave and empty `autolinking.json`

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

Test Plan:
Output of the reproducer in https://github.com/facebook/react-native/issues/45307 looks like this:

```log
android % ./gradlew assembleDebug
Starting a Gradle Daemon (subsequent builds will be faster)
ERROR: autolinkLibrariesFromCommand: Failed to create /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/build/generated/autolinking/autolinking.json - process npx react-native-community/cli config  exited with error code: 126

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: Failed to create /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/build/generated/autolinking/autolinking.json - process npx react-native-community/cli config  exited with error code: 126

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 10s
8 actionable tasks: 4 executed, 4 up-to-date
```

Output if you modify the package.json to be invalid looks like this:

```log
android % ./gradlew assembleDebug
ERROR: autolinkLibrariesFromCommand: process npx react-native-community/cli config  exited with error code: 1
JSONError: JSON Error in /Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/package.json:

  35 |     "node": ">=18"
  36 |   },
> 37 |   SOMETHING_NON_JSON
     |   ^
  38 |   "packageManager": "yarn@3.6.4",
  39 |   "resolutions": {
  40 |     "rtn-centered-text": "portal:../RTNCenteredText"

Unexpected token "S" (0x53) in JSON at position 1019 while parsing near "...ode\": \">=18\"\n  },\n  SOMETHING_NON_JSON\n ..."

  35 |     "node": ">=18"
  36 |   },
> 37 |   SOMETHING_NON_JSON
     |   ^
  38 |   "packageManager": "yarn@3.6.4",
  39 |   "resolutions": {
  40 |     "rtn-centered-text": "portal:../RTNCenteredText"

    at parseJson (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/parse-json/index.js:29:21)
    at loadJson (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/loaders.js:48:16)
    at #loadConfiguration (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:116:36)
    at #loadConfigFileWithImports (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:87:54)
    at #readConfiguration (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:84:82)
    at search (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:50:63)
    at emplace (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/util.js:36:20)
    at ExplorerSync.search (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/ExplorerSync.js:78:42)
    at getUserDefinedOptionsFromMetaConfig (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/index.js:32:37)
    at mergeOptionsBase (/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/node_modules/react-native-community/cli-config/node_modules/cosmiconfig/dist/index.js:60:31)

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/boga/Work/OSS/RNMBGL/rn-fabric-boolattribute/ReproducerApp/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: process npx react-native-community/cli config  exited with error code: 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2s
8 actionable tasks: 4 executed, 4 up-to-date
```

Reviewed By: cipolleschi

Differential Revision: D59582430

Pulled By: cortinico

fbshipit-source-id: bedb9563175cc5c46f5af80cf309769e56b803cc
2024-07-11 03:43:23 -07:00
Nick Gerleman 52dc7a8326 Make ReactImageView use standardized background drawing code (#45366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45366

This updates ReactImageView to share the background drawing and clipping code used by other built-in components. This means manipulating a background drawable, and clippping at draw time, instead of using Fresco hierarchy background (in view foreground), and radii which manipulate the underlying bitmap.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D59495407

fbshipit-source-id: ce3c975e5ed323fa3d4610ec1515ef3c8dd8b2d1
2024-07-11 02:58:36 -07:00
Nick Gerleman ea6928fcb9 Fix Android removeClippedSubviews in horizontal ScrollView in RTL (#45356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45356

Subview clipping was disabled for RTL on Android due to a bug where TextInputs automatically blur when selected. This bug is reintroduced when `set_android_layout_direction` is set.

When `set_android_layout_direction` is enabled, and we use View `getLayoutDirection()` instead of `I18nManager.isRTL()`, the layout direction is not known until layer in the mounting process. This defeats the check a `setRemoveClippedSubviews()` prop setter to ignore the prop if the view is RTL (since it doesn't invalidate when a new layout direction is set).

The root cause of the underlying RTL bug is due to updating clipping status triggered by `onSizeChanged()`, which is called before `onLayout()`, where `ReactHorizontalScrollContainerView` offsets content in RTL. This also seems potentially erroneous, as we do not update the clipping rect on position change (unless that is handled elsewhere).

I moved the check to `onLayout()`, called after ReactHorizontalScrollView will change metrics, which seems to fix the issue. I then removed the exclusion in `removeClippedSubviews` prop setter.

Changelog:
[Android][Fixed] - Fix Android removeClippedSubviews in RTL

Reviewed By: mdvacca

Differential Revision: D59566611

fbshipit-source-id: a2eb12b984dc78940756804b6b7a3950377af9de
2024-07-10 20:17:03 -07:00
Jakub Piasecki 2932c0f71f Implement baseline alignment function on the new architecture (#45102)
Summary:
On the new architecture, the setup that would allow Yoga to read the baseline of a node was missing. This PR adds it:
- adds new ShadowNode trait - `BaselineYogaNode` that marks a node as having a custom baseline function
- adds `yogaNodeBaselineCallbackConnector` that's responsible for allowing Yoga to call baseline function on the node
- changes signatures of `lastBaseline` and `firstBaseline` to accept `LayoutContext` as the first argument, which is necessary to build an attributed string
- adds implementation of `lastBaseline` that's invoked by `yogaNodeBaselineCallbackConnector`
- adds methods for calculating the last baseline in platform-specific `TextLayoutManagers`, using the same approach on both Android and iOS (this differs from the old architecture where calculations were different)

## Changelog:

[GENERAL] [FIXED] - Fixed `alignItems: 'baseline'` not working correctly on the new architecture

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

Test Plan:
Tested on the relevant part of RNTester:

### Android

|Old arch|New arch before|New arch after|
|-|-|-|
|<img width="426" alt="baseline-android-old-arch" src="https://github.com/facebook/react-native/assets/21055725/08550dfc-cf30-4938-8872-9bef916dc53c">|<img width="426" alt="baseline-android-new-arch-before" src="https://github.com/facebook/react-native/assets/21055725/9e3667f7-5c42-4e23-8972-fd2e994694a4">|<img width="409" alt="Screenshot 2024-07-02 at 16 40 38" src="https://github.com/facebook/react-native/assets/21055725/13379b11-b69e-4082-81cc-dec5e6d092f2">|

### iOS

|Old arch|New arch before|New arch after|
|-|-|-|
|<img width="519" alt="baseline-ios-old-arch" src="https://github.com/facebook/react-native/assets/21055725/da3956a1-5588-4933-87ce-4b5a9c256957">|<img width="519" alt="baseline-ios-new-arch-before" src="https://github.com/facebook/react-native/assets/21055725/09aef2c1-2eec-4710-b237-0f4a0c3d52d0">|<img width="519" alt="Screenshot 2024-07-02 at 16 40 29" src="https://github.com/facebook/react-native/assets/21055725/0a8a7251-1f6f-40db-81d7-4f37142932db">|

Reviewed By: NickGerleman

Differential Revision: D59323974

Pulled By: cortinico

fbshipit-source-id: e50882d399a0791a39ce8b416ed96d8fd3c48f23
2024-07-10 12:43:42 -07:00
Jakub Piasecki 83716298f8 Fix text shadow on TextInput on Android when backgroundColor is set (#45343)
Summary:
When setting a shadow on a `Text` inside a `TextInput`, the shadow was rendered with artifacts when `backgroundColor` was set on the `TextInput`.

This is caused by how attributed strings are constructed on the new architecture - all text attributes from the text input (including background color) are propagated onto the string. Then, it's converted to a `Spannable` on Android side, which includes `ReactBackgroundColorSpan` being set on the entire text when it doesn't have a background color set explicitly. Then Android tries to render the shadow not only for the text but also for the background rect which results in the artifacts.

This PR prevents background color from the `TextInput` from being propagated onto the attributed string, so the `ReactBackgroundColorSpan` is only applied when a text fragment has its background set explicitly.

## Changelog:

[ANDROID] [FIXED] - Fixed text shadow rendering with artifacts when `backgroundColor` was set on the `TextInput`

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

Test Plan:
Checked relevant examples on RNTester

|Old arch|New arch (before)|New arch (after)|
|-|-|-|
|<img width="436" alt="Screenshot 2024-07-09 at 14 44 52" src="https://github.com/facebook/react-native/assets/21055725/64005ec4-3e42-4327-9b09-f57d3c477fb6">|<img width="436" alt="Screenshot 2024-07-09 at 14 43 03" src="https://github.com/facebook/react-native/assets/21055725/f558ad26-08de-4231-acdf-92f596ec186c">|<img width="436" alt="Screenshot 2024-07-09 at 14 41 46" src="https://github.com/facebook/react-native/assets/21055725/6b4ff6ed-5267-4f1a-a895-1bbd760f73e5">|

Reviewed By: NickGerleman

Differential Revision: D59527817

Pulled By: cortinico

fbshipit-source-id: d03d4749e4435ef04e51b1018f046be0e5e0bca4
2024-07-10 11:54:30 -07:00
Riccardo Cipolleschi 0fd4a9447e Factor out hermes slice apple (#45359)
Summary:
Factor out build-apple-slices-hermes to a seprate action to reuse code

## Changelog:
[Internal] - Refactor the CI to reuse code

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

Test Plan: GHA are green

Reviewed By: cortinico

Differential Revision: D59575467

Pulled By: cipolleschi

fbshipit-source-id: 5d253f3dd523cb70b768c62db10fb7ff39fbd49f
2024-07-10 06:38:49 -07:00
Tomek Zawadzki 778fcecf35 Update comments for ~ShadowNodeWrapper() and ~ShadowNodeListWrapper() (#45357)
Summary:
This PR updates the comments for `~ShadowNodeWrapper()` and `~ShadowNodeListWrapper()` to align them with the actual implementation that now uses `jsi::NativeState` instead of `jsi::HostObject`.

## Changelog:

[GENERAL] [FIXED] - Updated comments for `~ShadowNodeWrapper()` and `~ShadowNodeListWrapper()`

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

Reviewed By: sammy-SC

Differential Revision: D59578988

Pulled By: javache

fbshipit-source-id: 1c46ce8407fc8b337f3a6762caee3b2e0e1edfc6
2024-07-10 04:57:42 -07:00
Samuel Susla 8f98c58d38 delete background executor (#45110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45110

changelog: [internal]

Reviewed By: fkgozali, javache

Differential Revision: D58737295

fbshipit-source-id: 1f644b910e07a27cffb9107502aefd9b382d8f93
2024-07-10 04:28:22 -07:00
Samuel Susla 082706ccd4 remove event emitter from view preallocation (#45351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45351

changelog: [internal]

event emitter is always null during view preallocation. Let's just remove it completely from the method signature

Reviewed By: rubennorte

Differential Revision: D59522141

fbshipit-source-id: cb4f3b314607b4ee8b2209a8ab55e066ee7e075a
2024-07-10 04:17:55 -07:00
Riccardo Cipolleschi b4b6614034 Factor out build hermesc apple (#45346)
Summary:
Factor out the action to build hermesc for apple platform so we can reuse it across jobs

## Changelog:
[Internal] - Factor out hermesC apple to reuse code

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

Test Plan: GHA are green

Reviewed By: cortinico

Differential Revision: D59521564

Pulled By: cipolleschi

fbshipit-source-id: c99966e314b3d418d1d83d653c0be68b2931b03b
2024-07-10 01:06:39 -07:00
Robert Pasiński 9a1ae97c22 fix: Headless tasks in bridgeless mode (fixes #44255) (#45100)
Summary:
HeadlessTaskService was to create a Bridge instance in bridgeless mode.

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

## Changelog:

[ANDROID] [FIXED] - Fixed Headless JS tasks in New Architecture

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

Reviewed By: cortinico

Differential Revision: D59471277

Pulled By: arushikesarwani94

fbshipit-source-id: 400e2f67d35e015a976f3df917ca27c43e292685
2024-07-09 16:06:47 -07:00
Pieter De Baets 57e3451557 Do not mutate output of flattenStyle in TextInput (#45348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45348

flattenStyle may return an object which is already frozen (in development), so it is incorrect to further mutate this.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59525418

fbshipit-source-id: 094b7c9c952d8684e24203cc07d6bda51bdf12b5
2024-07-09 15:58:12 -07:00
Nick Gerleman 2bed2ab1a6 Fix ReactImageView.hasOverlappingRendering() (#45352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45352

We claim that we will never draw multiple elements on top of each other, which isn't correct when we have a background.

We should claim that we can draw overlapping elements if we have a background drawable which we place in the Drawee hierarchy (part of the ImageView foreground drawable), or if the underlying view has a background drawable (which is handled by `ImageView` superclass `hasOverlappingRendering()`).

The effect of this is subtle, and just means that we get correct compositing when an opacity is set on image with background.

Changelog:
[Android][Fixed] - Fix ReactImageView.hasOverlappingRendering()

Reviewed By: mdvacca

Differential Revision: D59489788

fbshipit-source-id: fe2922f064b91f1709ed546dd647d4d4112d04c1
2024-07-09 14:59:40 -07:00
Nick Gerleman 58c726a6ba Encapsulate float-ish border color APIs (#45338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45338

`CSSBackgroundDrawable` is a silly goose and reuses layout types to store color. This has extended into a really strange public API, where we use floating point colors, where the color is itself in int with packed integer color components.

This hides that away, and marks some classes with `UnstableReactNativeAPI` that I plan to hide shortly.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59488811

fbshipit-source-id: 7dc57edc9888f8a92088d2410ee71c2768ae8ec1
2024-07-09 14:59:40 -07:00
Rubén Norte 0e621295fb Propagate intersection times in image performance logging for RN (#45350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45350

Changelog: [internal]

Reviewed By: steelrooter

Differential Revision: D59524510

fbshipit-source-id: 28d38e199fcfcaf421296a4499e11138d43f3b04
2024-07-09 14:55:58 -07:00
Liron Yahdav 539788eb6e Feed React tracing into Instruments signposts API (#45169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45169

This is a follow-up to D56280451 where I made all SystraceSection calls feed into the Instruments signposts API. This will additionally do the same for all calls to nativeTraceBeginSection/nativeTraceEndSection from JSITracing.cpp.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D58895740

fbshipit-source-id: ee1cdff883ac1172f9bafe11ab950738d7ae7f82
2024-07-09 14:01:39 -07:00
Gabriel Donadel fa9fd59a1f chore: Add changelog for 0.73.9 (#45353)
Summary:
Adds changelog for the 0.73.9 patch.

## Changelog:

[Internal] [Changed] - Add 0.73.9 changelog

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

Reviewed By: NickGerleman

Differential Revision: D59538388

Pulled By: arushikesarwani94

fbshipit-source-id: 8a410c6d65bbf0ac85bde6fde826fb999181950d
2024-07-09 13:37:46 -07:00
Joe Vilches 0f87250d29 Adjust shadow's corner radius based on spread (#45336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45336

The spec says we need to adjust the border radius of the shadow if spread is present. It gets bigger for outset shadows and smaller for inset shadows.

Source https://drafts.csswg.org/css-backgrounds/#shadow-shape

> To preserve the box’s shape when spread is applied, the corner radii of the shadow are also increased (decreased, for inner shadows) from the border-box (padding-box) radii by adding (subtracting) the spread distance (and flooring at zero). However, in order to create a sharper corner when the border radius is small (and thus ensure continuity between round and sharp corners), when the border radius is less than the spread distance (or in the case of an inner shadow, less than the absolute value of a negative spread distance), the spread distance is first multiplied by the proportion 1 + (r-1)3, where r is the ratio of the border radius to the spread distance, in calculating the corner radii of the spread shadow shape.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59296120

fbshipit-source-id: e55327701547f27961a0d612ed595b4383e1d763
2024-07-09 13:24:18 -07:00
Panos Vekris 5daa899f4a remove one_sided_type_guards option from flowconfigs (on by default) (#45349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45349

This is on by default as of version 0.239.0:

https://github.com/facebook/flow/blob/v0.239/src/commands/config/flowConfig.ml#L268

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D59525192

fbshipit-source-id: b4bf456e3c03a712f4c6f5d72d157b3abf8f9895
2024-07-09 10:47:31 -07:00
Pieter De Baets ef2e9410d0 Do not mutate output of flattenStyle (#45340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45340

flattenStyle may return an object which is already frozen (in development), so it is incorrect to further mutate this.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59515063

fbshipit-source-id: 92df158d5841988d40bcd76b861963b06dad1573
2024-07-09 08:26:58 -07:00
Pieter De Baets 0733e36278 Remove TurboModule debug info (#45323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45323

We're no longer running experiments with TurboModule and legacy module rollout, so this debug info is no longer required, and adds unnecessary verbosity to TurboModule lookup errors.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D59465974

fbshipit-source-id: 87a2ebd9c05ad312889bcbd819ccbe885b429064
2024-07-09 07:34:11 -07:00
Pieter De Baets 5a62606ab3 Lookup TurboModules before fallbacks (#45320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45320

TurboModule should be the default path, and we should only fallback to the legacy native modules if we can't find a module through the TurboModule mechanism.

Changelog: [General][Changed] - TurboModules will be looked up as TurboModules first, and fallback to legacy modules after.

Reviewed By: christophpurrer

Differential Revision: D59465978

fbshipit-source-id: c5672d34e90dcee321de0a5acd3a50b6bb1092b8
2024-07-09 07:34:11 -07:00
Samuel Susla 5b03453b5f trigger image fetch during view preallocation (#45330)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45330

changelog: [internal]

With view preallocation, we want to trigger image download in case there is only a single image source even if layout hasn't been determined.

This can lead to images appearing 100s of milliseconds earlier.

This optimisation is already used by plain ImageView: https://fburl.com/code/cp87xmw7

Reviewed By: rubennorte

Differential Revision: D59465972

fbshipit-source-id: e045d6bd9d595d366541ffa32364488be4766ef8
2024-07-09 05:51:40 -07:00
Pieter De Baets 8e8e0ba13b Cleanup unstable_useTurboModuleInteropForAllTurboModules (#45319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45319

This test has been cleaned up, we can remove the callers.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D59465975

fbshipit-source-id: 01f4b24f221aa017fbfd2238f81454d38d05920a
2024-07-09 05:43:26 -07:00
Nick Gerleman 12b64b7824 Loosen SectionList renderItem required return type (#45305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45305

Allow SectionList render functions to return any React node, instead of just React.Element. This matches VirtualizedList/FlatList, and general Flow component conventions.

Changelog:
[General][Fixed] - Loosen SectionList `renderItem` required return type

Reviewed By: joevilches

Differential Revision: D59404511

fbshipit-source-id: 3055d8f01845ff5ef8ae75b87f60d8cd26dc07b4
2024-07-08 17:40:59 -07:00
Sam Zhou 3441641682 Deploy 0.239.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D59493995

fbshipit-source-id: 9f0c6d030ef44cc833940e8c33ad72b3489d3a43
2024-07-08 16:42:30 -07:00
Pieter De Baets a4a2fa6a11 Sync comments on measure and requestLayout to Fabric implementation (#45325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45325

We don't want to lose this context when we cleanup the old architecture.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D59466876

fbshipit-source-id: 3cf3c63d619d9e8535e369ec1ef7c5706431b85d
2024-07-08 14:50:31 -07:00
Samuel Susla 9fbc904592 remove gating for optimized text (#45317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45317

changelog: [internal]

ship optimized version of Text componant. In local benchmarking this version shows 35% improvement over old Text component.

Reviewed By: NickGerleman

Differential Revision: D59460871

fbshipit-source-id: c3a41d3aac4cd40e054b669d56295bcb631d8310
2024-07-08 12:39:46 -07:00
Benoit Girard c9fbc05bbc Register Thread For Hermes Sampling (#45331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45331

Let's add the a new JSRuntime API  to register the thread. This allows Hermes sampling to correctly work in Bridgeless/Activity.

## Changelog:
[General][Added] - Add experimental api to JSRuntimeFactory to initialize runtime on js thread

Reviewed By: RSNara

Differential Revision: D58787655

fbshipit-source-id: 2202271b9ad88cf8ba2145fb4e9e7bfd6e0c09fa
2024-07-08 12:20:11 -07:00
Riccardo Cipolleschi c0d56225a8 Add changelog for 0.75-RC.4 (#45332)
Summary:
Added changelog for 0.75.0-RC.4

## Changelog:
[Internal] - Add changelog for RC.4

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

Test Plan: N/A

Reviewed By: sammy-SC, GijsWeterings, arushikesarwani94, realsoelynn

Differential Revision: D59474501

Pulled By: cipolleschi

fbshipit-source-id: 8619ebe46bf4b0861bd981297b2c3b4a6e47c243
2024-07-08 11:38:34 -07:00
Riccardo Cipolleschi d6c90cf7ed Make sure to pass the BridgeProxy to view managers in the interop layer (#45329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45329

Thanks to [#45232](https://github.com/facebook/react-native/issues/45232) we found a bug in the interop layer, where we were not passing the BridgeProxy in bridgeless mode to the view managers.

This Change should fix that issue.

## Changelog:
[iOS][Fixed] - Make sure to pass the RCTBridgeProxy to  ViewManagers

Reviewed By: dmytrorykun

Differential Revision: D59468292

fbshipit-source-id: 00666be21385a735878eb567c4b8a0986c609c5f
2024-07-08 11:07:29 -07:00
Pieter De Baets 6b7076e923 Move assertion about invalidated ReactInstanceManager to UI thread (#45328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45328

This assertion is currently not actionable since the stack trace will always be just `mCreateReactContextThread`. Moving this assert is safe, as the only other place we write it is also the UI thread.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59467576

fbshipit-source-id: c4606672255149a202f99a8f787230e2a23a868a
2024-07-08 09:49:28 -07:00
Rubén Norte ef9b2baa9a Create test to move parts of TextInput state to refs to avoid unnecessary updates in effects (#45321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45321

Changelog: [internal]

This creates a variant of the internal hook in `TextInput` that handles the synchronization of the state between native and JS. The new variant moves everything that's not needed for rendering to refs instead of state.

One of the reasons for this change is that by not setting state in layout effects, we're not forcing passive effects to be flushed synchronously, which can improve perceived performance (as we can start painting before passive effects are executed).

Reviewed By: sammy-SC

Differential Revision: D59400624

fbshipit-source-id: 540c20daf49919fbfabd357a1a057ca126ec6b03
2024-07-08 09:42:46 -07:00
Rubén Norte 1265958d52 Extract TextInput synchronization mechanism to a custom hook (#45315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45315

Changelog: [internal]

This moves some logic from the `TextInput` component to its own hook. It's just a refactor in preparation for a following change were we're going to test replacing this hook with an alternative version that relies less on state (using refs for some things instead).

Reviewed By: sammy-SC

Differential Revision: D59400614

fbshipit-source-id: ea37b8514f89e94be1386774ad70d56389878886
2024-07-08 09:42:46 -07:00
Nicola Corti ca17d87ed1 Upstream CLI autolinking changes to RNGP (#45314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45314

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

I'm ustreaming two changes that happened inside the CLI/Autolinking logic that are
missing inside core autolinking.

Changelog:
[Internal] [Changed] - Upstream CLI autolinking changes to RNGP

Reviewed By: blakef

Differential Revision: D59460504

fbshipit-source-id: a6e7ab6a46fec26620dc965e77b13fdeba84fae3
2024-07-08 09:38:29 -07:00
Nicola Corti 40582d5b24 Attempt to limit the Gradle cache size (#45318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45318

I'm setting the Gradle cache to write-only for build_android on main/stable branches.
This is so we start from a fresh cache on those jobs (as they're not on the critical path for developers).

Changelog:
[Internal] [Changed] - Attempt to limit the Gradle cache size

Reviewed By: cipolleschi

Differential Revision: D59466459

fbshipit-source-id: 8b7936ebe053ae06256f8506093eb17c07219de9
2024-07-08 08:40:56 -07:00
shubhamguptadream11 ead50d6b11 fix: added showSoftInputFocus handling for iOS new architecture (#45298)
Summary:
Fixes: https://github.com/facebook/react-native/issues/45297

In iOS New Architecture When we are passing `showSoftInputOnFocus` prop to TextInput as false it should prevent soft keyboard from showing.
Here, the problem is in Fabric counterpart of TextInput, there we are not handling `showSoftInputOnFocus` props anywhere.

## Changelog:

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

Pick one each for the category and type tags:

[iOS] [ADDED] - Added handling of `showSoftInputOnFocus` props for new arch.

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

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

Test Plan:
Below is the screen recording of fix made.

https://github.com/facebook/react-native/assets/85783070/de94877a-f684-4f8d-9ec4-a16f9755663e

Reviewed By: cipolleschi

Differential Revision: D59447432

Pulled By: dmytrorykun

fbshipit-source-id: 240854bc1101bdf0b04d7978c557215ff3f8a449
2024-07-08 07:19:38 -07:00
Samuel Susla 83392a9cd9 do not call [super loadView] in RN's UIViewController (#45312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45312

changelog: [internal]

loadview shouldn't call its super method. Even though it isn't broken now, the official docs recommend against it.

https://developer.apple.com/documentation/uikit/uiviewcontroller/1621454-loadview

Reviewed By: christophpurrer

Differential Revision: D59376105

fbshipit-source-id: ee04020c008a3f208aafc79991c6ff24a71b226f
2024-07-08 06:08:58 -07:00
Kacper Rozniata 258f41a30f fix(iOS): remove deprecated method from RCTPerfMonitor & fix position (#43058)
Summary:
This PR removes usage of deprecated `statusBarFrame` method in `RCTPerfMonitor` . Instead `RCTPerfMonitor` now uses `safeAreaInsets` which also fixes issue causing Perf Monitor to appear under corner in landscape mode on e.g. `iPhone 15 Pro`. It also fixes initial position of expanded state which was causing it to render under notch.

Also removed duplicate background color setting

## Changelog:
[IOS] [REMOVED] - Remove usage of deprecated statusBarFrame method
[IOS] [FIXED] - Fix position of RCTPerfMonitor in landscape mode & expanded mode

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

Test Plan: `RNTester` builds and runs successfully, `RCTPerfMonitor` works and displays correctly

Reviewed By: dmytrorykun

Differential Revision: D59116913

Pulled By: cipolleschi

fbshipit-source-id: 0ff61f61b206c530cfb9e471bc2dc33a0a43c833
2024-07-08 04:04:06 -07:00
Damian Stasik 8c8c77b974 Remove unreachable if-condition in refresh logic (#45296)
Summary:
The `hasUnrecoverableErrors` function has been [hardcoded](https://github.com/facebook/react/blob/f38c22b244086f62ae5ed851b6ed17029ec44be5/packages/react-refresh/src/ReactFreshRuntime.js#L602) to always return false for the past 5 years, since React Refresh [can recover from all errors](https://github.com/facebook/react/pull/17438). This hardcoding was introduced in react-refresh v0.7.1, and RN currently uses v0.14.2.

## Changelog:

[INTERNAL] [REMOVED] - Remove unreachable if-condition in refresh logic

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

Test Plan: Fast Refresh should still work as expected.

Reviewed By: NickGerleman

Differential Revision: D59405648

Pulled By: arushikesarwani94

fbshipit-source-id: 6fefedb484eeab032028d738b48ac936a9044cb0
2024-07-05 15:53:43 -07:00
Deepanshu.shukla 820a88418c fix: get all bytes from the text in native event key in fabric (#45274)
Summary:
Fixes https://github.com/facebook/react-native/issues/45199.

Problem was whenever you type in TextInput **onKeypress** callback called and  event key was returned as
**keyPressMetrics.text.front();**
which basically fetch the first byte from text .
But in case of non-ascii character text  is coming like ' \804'(in octal) which means first byte was empty string .
So solution was the return whole text as it is i.e.
**keyPressMetrics.text**

## Changelog:

[IOS][FIXED]  - nativeEvent key returning empty in case any non-ascii character entered , in IOS fabric

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

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

Test Plan:
Below are the screenrecording for solution in new arch

https://github.com/facebook/react-native/assets/111736628/ea9034d3-3105-44e2-9998-4264d218ab93

Reviewed By: NickGerleman

Differential Revision: D59405313

Pulled By: arushikesarwani94

fbshipit-source-id: 65e153b933f345e3ec66a691aa8a4ab15d651440
2024-07-05 15:38:00 -07:00
Christoph Purrer 85dc2e393f Allow map type objects in Java/ObjC TM EventEmitter (#45271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45271

Changelog: [Internal] Allow map type objects in Java/ObjC TM EventEmitter

Reviewed By: rshest

Differential Revision: D59360044

fbshipit-source-id: 6fce094586ed2ad55a0d83a8a83ff554e2ba000e
2024-07-05 12:37:47 -07:00
Pieter De Baets 504240caad Fix crash in ViewManagerPropertyProcessor on older android devices (#45303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45303

`ViewManagersPropertyCache` uses reflection to find all ReactProp but fails when any symbols in the method refer to classes not available in the current build.

Work around this by extracting this helper to a separate private inner class.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59397865

fbshipit-source-id: e77d3167698e4311e8778ebab28a0c8a0d2666c2
2024-07-05 10:56:53 -07:00
fannnzhang 0847384a45 Fix Memory Leak in LogBoxModule (#45261)
Summary:
To fix [The Memory Leak Issue](https://github.com/facebook/react-native/issues/45080) This change modifies the timing of view creation in the LogModule. The motivation behind this update is to address a potential memory leak issue. Previously, views were being created and held onto, which could lead to references to the Activity being retained even when they were no longer needed. By creating the view only when the show method is called and ensuring it is removed in the hide method, we can prevent these memory leaks and improve the overall memory management and stability of the LogModule.

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

- Adjusted the timing of view creation to occur when the `show` method is called.
- Ensured that the created view can be removed in the `hide` method.
- This update addresses potential memory leaks by preventing the view from holding a reference to the Activity.

These changes improve memory management and stability within the LogModule.

Modify the timing of view creation in LogModule. The view is now created when the show method is called, and it can be removed in the hide method. This change resolves potential memory leaks caused by the view holding a reference to the Activity.

## Changelog:

[ANDROID] [FIXED] - Fix LogModule to create view when show is called

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

Reviewed By: dmytrorykun

Differential Revision: D59372962

Pulled By: cortinico

fbshipit-source-id: 6693afdb279c7164ff0f68c93f8ca8a54b1c2077
2024-07-05 08:54:25 -07:00
huzhanbo.luc b8ab0fe703 fix: on iOS not getting 304 from If-None-Match request (#45263)
Summary:
In https://github.com/facebook/react-native/issues/44483 `If-None-Match` request failed to get a 304 after a 200 response. This is caused by NSRequest's
cachePolicy which prevents sending a request to server to check 304 state and return directly a 200 response.

## Changelog:

[IOS] [FIXED] - fix: on iOS not getting 304 from `If-None-Match` request

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

Test Plan: repeat request given in https://github.com/facebook/react-native/issues/44483

Reviewed By: cortinico

Differential Revision: D59364609

Pulled By: dmytrorykun

fbshipit-source-id: 2a8b86c526320a1e9c1c58e41aa9c74beeeac2ce
2024-07-05 08:48:31 -07:00
Nicola Corti fd4531fe23 Fix NPE in FileReaderModule (#45287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45287

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

This fixes an NPE reported in OSS if you do this call in JavaScript:

```
 const fr = new FileReader();
 fr.readAsText({});
```

Changelog:
[Android] [Fixed] - Fix NPE in FileReaderModule

Reviewed By: dmytrorykun

Differential Revision: D59372620

fbshipit-source-id: ad5073376eaa26852c8277bdbb7d76b1aa480b3c
2024-07-05 08:47:30 -07:00
Rob Hogan 06fc6f2beb Use metro-babel-register for additive Babel registration (#45295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45295

When registering Babel to run RN from source, we currently call `babel/register` directly from `scripts/babel-register.js`.

This has the effect of overwriting any previous registration, which causes problems in the FB monorepo because RN also loads other projects that lie outside this registration (like Metro) from source - possibly requiring different configurations.

Moreover, if Metro is subsequently loaded from source, its own registration clobbers RN's.

Instead, this diff runs the registration through `metro-babel-register`, which maintains a cumulative list of registration directories and applies a uniform transform.

Note that this means we're not using exactly the same transform at build/publish time as for running from source - to fix that, we ought to move everything to a central `babel.config.js`, but that's a much bigger change, and this gets us close enough to unblock.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59376984

fbshipit-source-id: 0dbb00970ac87dbe40ec8904bf51ef4b1fee5e0f
2024-07-05 04:48:30 -07:00
Pieter De Baets 42f1adf49f Address lint feedback in ReactInstance (#45284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45284

Lint suggestions by Android Studio

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D59370240

fbshipit-source-id: fb57511704ad667fc152826e33e0e67719f0899c
2024-07-05 04:06:39 -07:00
Nicola Corti aeaa939793 Cleanup exports for PressableExample in RN-Tester (#45294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45294

Just doing some cleanup here as those exports are scattered around this file.

Changelog:
[Internal] [Changed] - Cleanup exports for PressableExample in RN-Tester

Reviewed By: yungsters

Differential Revision: D59376617

fbshipit-source-id: 0f6f81fca7b5cbcdc05bbb6a1f87d3ad74c20b50
2024-07-05 01:53:08 -07:00
Nicola Corti d2edc71619 Add reproducer to RN-Tester for #44610 (#45293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45293

I'm justing adding a repro to RN-Tester to further investigate:
https://github.com/facebook/react-native/issues/44610

Changelog:
[Internal] [Changed] - Add reproducer to RN-Tester for #44610

Reviewed By: yungsters

Differential Revision: D59375787

fbshipit-source-id: 3bc4f45e3686109bf731008bc27e47c4eb314e48
2024-07-05 01:53:08 -07:00
Ruslan Lesiutin 62cca7accc upgrade[react-devtools-*]: v.5.3.1 (#45291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45291

Changelog: [Internal]

Same as D59001348, via `js1 upgrade react-devtools -v ^5.3.1`
allow-large-files

Reviewed By: vzaidman

Differential Revision: D59374023

fbshipit-source-id: 7493000bff24a5e21cb77a9a5992c501ed282a92
2024-07-04 16:02:07 -07:00
Nicolas Gallagher 8f548be91c RSD sync (#45270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45270

This sync includes the following changes:
- **[499d5d3](https://github.com/facebook/react-strict-dom/commit/499d5d3)**: Skip animation setup if no style transitions //<Nicolas Gallagher>//
- **[8a98c5d](https://github.com/facebook/react-strict-dom/commit/8a98c5d)**: Remove invalid style properties from shortforms set //<Nicolas Gallagher>//
- **[ccb00ff](https://github.com/facebook/react-strict-dom/commit/ccb00ff)**: 0.0.17 //<Nicolas Gallagher>//
- **[8cd0eb0](https://github.com/facebook/react-strict-dom/commit/8cd0eb0)**: Reorganize benchmark test and mock files //<Nicolas Gallagher>//
- **[ce88e44](https://github.com/facebook/react-strict-dom/commit/ce88e44)**: Add support for experimental React Native style implementations //<Nicolas Gallagher>//
- **[111f6b1](https://github.com/facebook/react-strict-dom/commit/111f6b1)**: Install StyleX 0.7.0 //<Nicolas Gallagher>//

Reviewed By: amyogit

Differential Revision: D59343139

fbshipit-source-id: 672c7db98fd6676edfe42e818d04a96203e1c827
2024-07-04 13:04:52 -07:00
Vitali Zaidman 6565706232 Update debugger-frontend from 601b272...a4fff8a (#45292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45292

Changelog: [Internal] - Update `react-native/debugger-frontend` from 601b272...a4fff8a

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

Reviewed By: hoxyq

Differential Revision: D59376660

fbshipit-source-id: b5c9782493875ede573a61211886f0f32e9f7360
2024-07-04 10:22:26 -07:00
Tomek Zawadzki ea958c69f6 Fix dynamic_cast (RTTI) by adding key function to ShadowNodeWrapper again (#45290)
Summary:
This PR restores the virtual destructor for `ShadowNodeWrapper` which was added in https://github.com/facebook/react-native/pull/33500 and unfortunately removed in https://github.com/facebook/react-native/pull/40864.

The virtual destructor here serves as a key function. Without a key function, `obj.hasNativeState<ShadowNodeWrapper>(rt)` **does not** work correctly between shared library boundaries on Android and always returns false.

We need this pretty badly in third-party libraries like react-native-reanimated or react-native-gesture-handler.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [FIXED] - Fix dynamic_cast (RTTI) for ShadowNodeWrapper when accessed by third-party libraries again

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

Test Plan: This patch fixes an issue in Reanimated's fabric-example app.

Reviewed By: fabriziocucci

Differential Revision: D59375554

Pulled By: javache

fbshipit-source-id: 09f3eda89a67c26d6dacca3428e08d1b7138d350
2024-07-04 10:10:13 -07:00
szymonrybczak d1bf828398 fix(cli): replace querystring with URLSearchParam (#45125)
Summary:
[`querystring`](https://www.npmjs.com/package/querystring) package is deprecated. In this Pull Request I've replaced usage of `querystring` with `URLSearchParam` what is recommended by Node.js.

It's also causing a warning when installing dependencies inside a React Native app:
```
warning react-native > react-native/community-cli-plugin > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
```

## Changelog:

[INTERNAL] [FIXED] - Replace `querystring` package with `URLSearchParam`

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

Test Plan:
Params should be parsed in the same way and warning shouldn't be presented.

js1 jest xplat/js/tools/metro/packages/metro/src/cli/__tests__/parseKeyValueParamArray-test.js

Reviewed By: cipolleschi

Differential Revision: D58948498

Pulled By: GijsWeterings

fbshipit-source-id: 79b1f7b3feae230d2d3641205c513b98b3fda511
2024-07-04 08:04:56 -07:00
Nicola Corti b34b694f8e Move all custom actions to kebab-case (#45286)
Summary:
We do have a mixture of casing in the custom GH actions in our repo.
This aligns them all to be `kebab-case`

## Changelog:

[INTERNAL] - Aling all custom actions to kebab-case

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D59374046

Pulled By: cortinico

fbshipit-source-id: 030a9323e501e375585e90f10a3b29c3bb671b28
2024-07-04 07:57:03 -07:00
Pieter De Baets a7f5963377 Cleanup ReactQueueConfiguration (#45281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45281

There's a lot of unnecessary complexity here, likely from experiments long expired.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D59369955

fbshipit-source-id: beb80de2b1a9ef650db4ed59231c6b25bf6e626b
2024-07-04 06:59:26 -07:00
Jakub Piasecki b2898540c9 Update ignore file to include ReactBuildConfig in the npm package (#45279)
Summary:
Changes `.npmignore` file to only exclude the `ReactAndroid/build` directory instead of all `build` directories under `ReactAndroid` (which included the `ReactAndroid/src/main/java/com/facebook/react/common/build` package). This problem was caused by the newer version of NPM being used.

Closes https://github.com/facebook/react-native/issues/45204

## Changelog:

[ANDROID] [FIXED] - Fixed build from source failing due to a missing file

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

Test Plan:
Run `npm pack` or `npm publish -dry-run`.

Before this change it includes 3774 files in the package and `ReactBuildConfig` isn't included. After this change it includes 3775 files in the package and `ReactBuildConfig` is included.

Reviewed By: javache

Differential Revision: D59371555

Pulled By: cortinico

fbshipit-source-id: f54f1e88e30429d538b9e160e6ce20d994c5d1b8
2024-07-04 05:48:40 -07:00
Pieter De Baets f1b6218608 Remove unreferenced JSEngineResolutionAlgorithm from ReactHost API (#45269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45269

There's no callers to this property, and we already create a `jsRuntimeFactory` above in DefaultReactHost, which will actually decide which VM to use.

Changelog: [Android][Removed] Unused jsEngineResolutionAlgorithm from ReactHost

Reviewed By: cortinico

Differential Revision: D59333435

fbshipit-source-id: 21be4d138bca64c0cb78de366bf2e247b4f37650
2024-07-04 05:27:41 -07:00
Alex Hunt bf11d1efcd Update debugger-frontend from 7cd81c1...601b272 (#45282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45282

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7cd81c1...601b272

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/7cd81c1548a4bca19732037dcf82662a6ed9ca39...601b2724b9f765e413b4ccc15d972f5a28fd4f4d).

Reviewed By: EdmondChuiHW

Differential Revision: D59370791

fbshipit-source-id: efee17f3646a32a71f7aa8a16bba7af2bfd6ed34
2024-07-04 05:12:30 -07:00
Jorge Cabiedes Acosta 261f82e897 RN tester example for mix-blend-mode (#45052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45052

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58760458

fbshipit-source-id: 1aadfb000d94b827ed779170254438ed4c469a52
2024-07-03 20:55:27 -07:00
Jorge Cabiedes Acosta fd94033dc1 JS Pumbing to get mix-blend-mode into native (#45051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45051

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58753970

fbshipit-source-id: df3cf8852fbc5f2a95f442c9067358608321ed20
2024-07-03 20:55:27 -07:00
Jorge Cabiedes Acosta ec95533609 Add mix-blend-mode effects to Android (#45053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45053

Add support for most keyword values of mix-blend-mode on Android

Missing compositing operators and global values

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58752052

fbshipit-source-id: e63e01d45a7e0924f3853f08dff5cec7e2f1ceaf
2024-07-03 20:55:27 -07:00
Christoph Purrer 70bacfe098 Turbo Module EventEmitter registration must return void or Promise<void> (#45267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45267

Changelog: [Internal] Turbo Module EventEmitter registration must return void or Promise<void>

Differential Revision: D59333197

fbshipit-source-id: 461dbcb23e0ebb1c145123bf785587b06a3d6c34
2024-07-03 20:51:14 -07:00
Sam Zhou af506372ba Deploy 0.239.0 to xplat
Summary:
Changelog: [Internal]

allow-large-files

Reviewed By: alexmckenley

Differential Revision: D59348364

fbshipit-source-id: e3d56ebb78fa19b70f2a689f85882fbe3071223f
2024-07-03 16:24:35 -07:00
Nick Gerleman 95d9cdf228 Fix "Platform.constants.reactNativeVersion.prerelease" Flow and TypeScript types (#45256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45256

The actual stamped versions here are all strings.

Android interface for constants is untyped, and we always return a string here. iOS, we will try to parse the string into a double, which will fail for every prerelease version RN has ever published.

Platform on Windows seems to uniquely be doing the right thing.

Changelog:
[General][Fixed] - Fix Platform.constants.reactNativeVersion type

Reviewed By: robhogan, necolas

Differential Revision: D59141948

fbshipit-source-id: 9c758e5eb8796b03197258d87ec06b31018e211c
2024-07-03 13:51:59 -07:00
Andrew Coates 2939dfc208 Add config version, and invalidate layout on config change (#45259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45259

This is a continuation of the previous PR: https://github.com/facebook/react-native/pull/45047

I made the change more generic for allowing any kind of config change to invalidate layout.

Changelog: [Internal]

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

Reviewed By: rozele

Differential Revision: D59286992

Pulled By: NickGerleman

fbshipit-source-id: f46f35b03d5d9a743b798844ee3e1a02c271ccde
2024-07-03 12:46:18 -07:00
Alex Hunt 47bff1f49b Fix reactNativeVersion string in inspector metadata on iOS (#45266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45266

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59279156

fbshipit-source-id: b1ef0273b14e964a7413724f6d382f7a00be103e
2024-07-03 11:12:31 -07:00
Alex Hunt 09bfb68a39 Add appDisplayName to inspector host metadata (#45250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45250

Adds and implements a new `appDisplayName` field as part of `HostTargetMetadata` and the `ReactNativeApplication.metadataUpdated` CDP event.

This will be used to display the app display name in the debugger frontend.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59273360

fbshipit-source-id: d770cccadb520b9c13c7288cd690df21683d2cc1
2024-07-03 11:12:31 -07:00
Alex Hunt 9da07d70dc Implement new HostTargetMetadata fields (Android Bridgeless) (#45249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45249

Follows D58288489, D58415181.

Implements the remaining `HostTargetMetadata` fields, sent by the debugger on `ReactNativeApplication.metadataUpdated`, on **Android Bridgeless**.

This will be used to display details such as the app name and React Native version in the debugger frontend.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59271755

fbshipit-source-id: a2488fed98df0800ec0a611d2317cd40cd809aac
2024-07-03 11:12:31 -07:00
Alex Hunt 297ccf325f Implement new HostTargetMetadata fields (Android Bridge) (#45234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45234

Follows D58288489.

Implements the remaining `HostTargetMetadata` fields, sent by the debugger on `ReactNativeApplication.metadataUpdated`, on **Android Bridge** (Bridgeless to follow).

This will be used to display details such as the app name and React Native version in the debugger frontend.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58415181

fbshipit-source-id: 8aca707c0b9f6e933ac5e5b4ac47ba8d48e99241
2024-07-03 11:12:31 -07:00
Nick Gerleman 3af01a8a44 Fix default for showsHorizontalScrollIndicator and showsVerticalScrollIndicator (#45258)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45258

Setting this to false, then removing, will not reset back to default state of `true`. Add explicit defaults so that the absence of the prop will lead to scroll indicators always being shown.

Changelog:
[Android][Fixed] - Fix default for `showsHorizontalScrollIndicator` and `showsVerticalScrollIndicator`

Reviewed By: javache

Differential Revision: D59285745

fbshipit-source-id: 6a7c204cfe9c4ab9e4efbbda300cdfdaf57e8f37
2024-07-03 10:05:13 -07:00
Nick Gerleman d028a68026 Ship set_android_layout_direction by default (#45257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45257

This doesn't seem to be regressing anything, so let's ship it!

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58959236

fbshipit-source-id: af6ae5d9145160f5a567e99b5d8db2a4d19a080b
2024-07-03 09:28:27 -07:00
Cedric van Putten 30a3e6e8df refactor(dev-middleware): drop node-fetch in favor of Node built-in fetch (#45227)
Summary:
Node 22 doesn't work well with `node-fetch@2`, as one of their polyfills is using the deprecated `punycode` module. This causes unnecessary warnings like:

<img width="986" alt="image" src="https://github.com/facebook/react-native/assets/1203991/13f66c5b-b6f4-4894-8576-ca9631d93f77">

Instead of upgrading to the [much larger `node-fetch@3`](https://packagephobia.com/result?p=node-fetch%403.3.2), this change drops `node-fetch` in favor of Node's own built-in `fetch` implementation (using [undici](https://github.com/nodejs/undici#readme)).

> Note, `react-native/dev-middleware` [already has the `engines.node >= 18`](https://github.com/facebook/react-native/blob/c7988c9c82793b6b41d4c9190a28ce1202410fa0/packages/dev-middleware/package.json#L38-L40) (which is required for fetch).

## Changelog:

[GENERAL] [CHANGED] - Drop `node-fetch` in favor of Node's built-in fetch from `undici` in `react-native/dev-middleware`

<!-- 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/45227

Test Plan: See CI for passing tests

Reviewed By: NickGerleman

Differential Revision: D59202017

Pulled By: robhogan

fbshipit-source-id: 15da5d5602e63958b8a3dc581dc1512649f16c12
2024-07-03 09:14:02 -07:00
Håkon Knutzen b1ec698dc4 Fix data race related to RCTNetworkTask.status (#44694)
Summary:
Fix entails using non-synthesized getter, such that underlying backing is an std::atomic<RCTNetworkTaskStatus>.

In the greater scheme of things, I believe `RCTNetworkTask` should be improved as it has several `nonatomic` properties that are read and written to on different threads. Thread safety of this class seems to have been addressed on a per property basis, judging from the employment of `std::mutex` elsewhere in the implementation.

This is an attempt at fixing https://github.com/facebook/react-native/issues/44687.

## Changelog:

[iOS][FIXED] - Fix data race related to access on `RCTNetworkTask.status`.

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

Test Plan: Added unit test in class `RCTNetworkTaskTests`.

Reviewed By: cortinico

Differential Revision: D59217353

Pulled By: javache

fbshipit-source-id: 1af77238ddd99db21e2e53f174a81e207d5832b2
2024-07-03 08:22:26 -07:00
Nicola Corti c0977c39b9 Migrate analyse_code to GHA (#45247)
Summary:
This migrates `analyse_code` to GHA into a single job called `lint`.

## Changelog:

[INTERNAL] - Migrate analyse_code to GHA

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D59283393

Pulled By: cortinico

fbshipit-source-id: dcdc4828a551062b3706e6450614b8c94e1a7e81
2024-07-03 05:49:47 -07:00
Rubén Norte 8db2995934 Add missing invocation of item dispatch listeners when forcing batching of mount items on Android (#45264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45264

Changelog: [internal]

We added a flag to fix some issues when committing state updates synchronously from the main thread in https://github.com/facebook/react-native/pull/44015 but that implementation was incorrectly not invoking item dispatch listeners after mount.

This adds the missing logic so we can unblock shipping sync state updates.

Reviewed By: javache

Differential Revision: D59319230

fbshipit-source-id: b0ab7e7c79a3315ef29dbb024e62c10444192509
2024-07-03 05:01:02 -07:00
Sam Zhou 3c6762a5f8 Pre-suppress errors ahead of v0.239 release
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D59308716

fbshipit-source-id: d741ee004e153810fc913da96505706e43814ec1
2024-07-02 23:37:15 -07:00
Joe Vilches c247e8c8c9 Fix case where absolute nodes would sometimes not be cloned (#45240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45240

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

There was a bug where some crash would happen if a tree was cloned that had static/absolute parent/child pair inside it. This was because we were no longer calling `cloneChildrenIfNeeded` on the static parent, but would still layout the absolute child. So that child's owner would be stale and have new layout. In React Native this would lead to a failed assert which causes the crash.

The fix here is to clone the children of static nodes during `layoutAbsoluteDescendants` so that we guarantee the node is either cloned if it is going to have new layout.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59175629

fbshipit-source-id: 4d110a08ba5368704327d5ab69a8695b28e746f4
2024-07-02 15:14:33 -07:00
Thomas Nardone 0ba2e9adf2 Prevent View Preallocation (#45163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45163

Avoid view preallocation when rendering on the main thread

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D58833983

fbshipit-source-id: a942d1fac684be5a8073941dbf043ba1d738e3a0
2024-07-02 14:16:32 -07:00
Joe Vilches d99960744c Inset box shadow impl (#45242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45242

tsia, comments should explain how this works but tldr is

* Set up cropping region to only draw within the view's bounds
* Draw 2 offscreen rects to cast the shadow. One represents the bounds of the original view, the other represents the clear region. Fill these rects with EO fill algo so the intersection is clear. The disjoint will be colored and cast a shadow.
* Do that for each shadow in reverse order

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D58885576

fbshipit-source-id: 2f3a5de75e93c7d34676128bbddbe38d64f1fb59
2024-07-02 13:44:58 -07:00
Joe Vilches a3cf1624d0 Outset box shadow impl
Summary:
tisa. Algo is

* Draw offscreen rect the size of the outset shadow (so accounting for spread)
* Set g state to cast shadow in proper place ON screen
* Clear out region in view

The rects need to be offscreen for the following reasons
* We need to account for spread radius, and CGContext shadows do not have support for this. So the only way to create a bigger shadow is the create a path that is the same size as the shadow we want
* We cannot just position this rect onscreen with no offset (so the shadow is casting directly under it) since the blur will look unnatural
* Offscreen means we do not see filled shadow rect but we do see the shadow it casts by offsetting it in the proper location

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D58881588

fbshipit-source-id: 2ea1b8945a3b9f182c4fb11668ac91a0ae7846ca
2024-07-02 13:44:58 -07:00
Joe Vilches 24d7cc15db Parse raw box shadow props (#44882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44882

tsia, nothing too fancy here. Just taking the box shadows from raw props and throwing them into a struct so we can read it.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: NickGerleman

Differential Revision: D57617028

fbshipit-source-id: 29cf683b663b4903721d674efbf61a200eaf3a64
2024-07-02 13:44:58 -07:00
Christoph Purrer 3fc7ebb311 Don't include C++ bridging header in RCTTurboModule.h (#45251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45251

https://github.com/facebook/react-native/pull/44914 is causing some iOS build breaks

## Changelog:

[iOS] [Changed] - Don't include C++ bridging header in RCTTurboModule.h

Reviewed By: cortinico

Differential Revision: D59280331

fbshipit-source-id: 489bc94ee0e5073129205370245c0093c0754f58
2024-07-02 11:26:11 -07:00
Wojciech Dróżdż 27ba369f23 Add onUserLeaveHint support to ReactActivityDelegate (#43658)
Summary:
**This is a resubmission of the previous PRs. We are trying to figure out why it causes crashes in some apps.**

This PR adds `onUserLeaveHint` support into the `ReactActivityDelegate`. It allows modules to receive an event every time user moves the app into the background. This is slightly different than `onPause` - it's called only when the user intentionally moves the app into the background, e.g. when receiving a call `onPause` should be called but `onUserLeaveHint` shouldn't.

This feature is especially useful for libraries implementing features like Picture in Picture (PiP), where using `onUserLeaveHint` is the [recommended way of auto-entering PiP](https://developer.android.com/develop/ui/views/picture-in-picture#:~:text=You%20might%20want%20to%20include%20logic%20that%20switches%20an%20activity%20into%20PiP%20mode%20instead%20of%20going%20into%20the%20background.%20For%20example%2C%20Google%20Maps%20switches%20to%20PiP%20mode%20if%20the%20user%20presses%20the%20home%20or%20recents%20button%20while%20the%20app%20is%20navigating.%20You%20can%20catch%20this%20case%20by%20overriding%20onUserLeaveHint()%3A) for android < 12.

## Changelog:

[ANDROID] [ADDED] - Added `onUserLeaveHint` support into `ReactActivityDelegate`

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

Test Plan: Tested in the `rn-tester` app - callbacks are correctly called on both old and new architecture.

Reviewed By: javache

Differential Revision: D56015911

Pulled By: cortinico

fbshipit-source-id: fc41af30f697da6fe7db3dd6e579a702f90cf218
2024-07-02 10:43:29 -07:00
Rubén Norte e35a2f4a7c Set up experiment to fix incorrect state updates in smooth scroll animations on Android (#45237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45237

Changelog: [internal]

This creates a feature flag to test a fix for an incorrect state update dispatched to Fabric when using smooth scroll animations.

Specifically, when starting a smooth scroll animation from X to Y, the scroll view would set the state to Y, and then all the range from X to Y again. For example, the sequence of state updates when smooth scrolling from 0 to 5 would be `0 -> 5 -> 1 -> 2 -> 3 -> 4 -> 5`, which is obviously incorrect.

This flag prevents setting the final value before it's actually reached.

Reviewed By: javache

Differential Revision: D59233069

fbshipit-source-id: 221602d7d30635070e7776ce756e2ef438edf638
2024-07-02 07:58:37 -07:00
Rubén Norte 818e70f7eb Set up experiment to fix race conditions when doing Fabric state updates on Android (#45236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45236

Changelog: [internal]

## Context

We're currently observing inconsistencies between the state of the UI on Android and the propagated state in Fabric.

When investigating the issue, we saw that there are some state updates that were going to be dispatched from scroll views to Fabric were skipped because the state object in native was deallocated.

The reason for that is a race condition between:
1. Dispatching new state updates from the UI thread
2. Updating the state previously dispatched from the UI thread on the JS thread.

 {F1735383134}

## Changes

This creates a new feature flag to replace the weak reference with a strong one, so when the previous state is deallocated we can still access it to set new state.

The use of weak references was introduced in D44472121 to avoid holding onto JSI references (which could be contained in the state) when the runtime was deallocated, but we later introduced an explicit clean up mechanism in D45905628 that would make that unnecessary.

Reviewed By: javache

Differential Revision: D59233070

fbshipit-source-id: 018d8935f506430ecab96df0f7a998a37ee0f556
2024-07-02 07:58:37 -07:00
Nicola Corti c25246044f Migrate test_js to GHA (#45246)
Summary:
This migrates the `test_js` workflow to GHA

## Changelog:

[INTERNAL] - Migrate test_js to GHA

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

Test Plan: Will wait for CI

Reviewed By: javache

Differential Revision: D59270333

Pulled By: cortinico

fbshipit-source-id: e77eb9819e0819638c51e61b1e477ac04680a2f4
2024-07-02 05:17:33 -07:00
Nicola Corti 258ea84f46 Further refine the Gradle caching logic. (#45233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45233

We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
This changes implements it.

Changelog:
[Internal] [Changed] - Further refine the Gradle caching logic.

Reviewed By: blakef

Differential Revision: D59225944

fbshipit-source-id: b6c3a5d4d0d399d6fe42287976925c43f3f12eb7
2024-07-02 04:22:43 -07:00
Nicola Corti ffd0b39755 Changelog for 0.75.0-rc.3 (#45244)
Summary:
Just updating the changelog for 0.75.0-rc.3

## Changelog:

[INTERNAL] - Changelog for 0.75.0-rc.3

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

Test Plan: NA

Reviewed By: rshest, blakef

Differential Revision: D59269046

Pulled By: cortinico

fbshipit-source-id: b5124c1574786d90c4bb65feb24328de86169718
2024-07-02 03:25:23 -07:00
Thibault Malbranche 7edc7169c7 chore: changelog for 0.74.3 (#45238)
Summary:
Adds changelog for the 0.74.3 patch.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[Internal] [Changed] - Add 0.74.3 changelog

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

Reviewed By: cortinico

Differential Revision: D59263876

Pulled By: dmytrorykun

fbshipit-source-id: 0f16d51a01790b4ddcaca092dec7527aab386dcd
2024-07-02 02:41:49 -07:00
Wojciech Lewicki 54dadd7bda fix: add JvmStatic to all methods used in cpp (#45243)
Summary:
Following-up on https://github.com/facebook/react-native/pull/45230, I added all the needed `JvmStatic` annotations for methods used in cpp code here: https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

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

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

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

Test Plan: Try and use those methods to see that they don't crash on `cpp` side.

Reviewed By: cortinico

Differential Revision: D59264093

Pulled By: dmytrorykun

fbshipit-source-id: 07d683ee38ea1c7d9621ad2e37d04f3d484d3200
2024-07-02 02:40:49 -07:00
Christoph Purrer ad3df84668 Add EventEmitter Code-gen support for Java and ObjC Turbo Modules (#45119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45119

## Changelog:

[iOS][Added] - Add EventEmitter Code-gen support for Java and ObjC Turbo Modules

Reviewed By: RSNara

Differential Revision: D58929417

fbshipit-source-id: 5208ba5ecb5882d47c3827c2aa8e3a54a3d7f2b6
2024-07-01 14:42:46 -07:00
Pieter De Baets 9d3052378a Revert D59107105: Merge newarchdefaults jni target into fabric and turbomodule targets
Differential Revision:
D59107105

Original commit changeset: fb3b25f3ce45

Original Phabricator Diff: D59107105

fbshipit-source-id: 2197d1deb79e7fc9b3ac7b0772225e13c23e0001
2024-07-01 12:47:24 -07:00
Christoph Purrer f473a2f8f4 Add ObjC Turbo Module Event Emitter example (#44914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44914

Shows a proof of concept how '*strongly typed Turbo Module scoped*' `EventEmitters` can be used in a ObjC Turbo Module.

## Changelog:

[iOS] [Added] - Add ObjC Turbo Module Event Emitter example

Reviewed By: rshest

Differential Revision: D57650830

fbshipit-source-id: c5c2dee4766484e9e58415e33c084999a9ae3bc6
2024-07-01 09:36:51 -07:00
Pieter De Baets 8b121c5071 Use RAII for cleaning up global_refs in JavaTurboModule (#45218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45218

Noticed that when an exception occurred we would not cleanup global_refs, leaking them in the global table.

Restructure this to use RAII and rely on JNIArgs to do the cleanup as necessary.

Changelog: [Android][Internal]

Reviewed By: RSNara

Differential Revision: D59156494

fbshipit-source-id: c89552d72387bad2a120373e78a2c545415a7c82
2024-07-01 09:16:25 -07:00
Pieter De Baets c68f35d444 Merge newarchdefaults jni target into fabric and turbomodule targets (#45207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45207

These are their own shared library, and their own soloader-call, but they can easily be pulled into existing targets without causing excessive bloat.

Changelog: [Android][Removed] react_newarchdefaults is no longer a prefab, instead use fabricjni

Reviewed By: christophpurrer

Differential Revision: D59107105

fbshipit-source-id: fb3b25f3ce4511aa18126477f2beefe1292c6d09
2024-07-01 07:28:42 -07:00
Nicola Corti c911c89728 Setup git config --global --add safe.directory '*' when running jobs inside Docker (#45231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45231

Following up to cipolleschi's work, it turns out that me setting this command inside
the docker file for React Android is unneffective:
https://github.com/react-native-community/docker-android/pull/228

The reason is that the user executing is different (1001 for the Dockerfile, while GHA executes as root 1000).
So we need to set this, otherwise the nightlies will be invoked with the `-TEMP` prefix:

Changelog:
[Internal] [Changed] - Setup `git config --global --add safe.directory '*'` when running jobs inside Docker

Reviewed By: blakef

Differential Revision: D59223862

fbshipit-source-id: 26674fc8cdaebf6687407072cc4e4f5c38246845
2024-07-01 06:28:51 -07:00
Pieter De Baets de7976c69d Remove unused hybrid class from DefaultComponentsRegistry (#45205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45205

We only need a static register method, which includes the core components and the provider function. CoreComponentsRegistry isn't referenced at all in Kotlin/Java, and can be replaced with DefaultComponentsRegistry with no change in behaviour in all scenarios.

Changelog: [Android][Removed] CoreComponentsRegistry is now fully replaced by DefaultComponentRegistry.

Reviewed By: cortinico

Differential Revision: D59107106

fbshipit-source-id: e679be490f43dab52eb5e11a08aa9d0ae2a89a92
2024-07-01 05:20:31 -07:00
Gabriel Donadel 20521cc908 Fix Android autolink plugin for libraries that are platform specific (#45223)
Summary:
Fixes https://github.com/facebook/react-native/issues/45222

## Changelog:

[ANDROID] [FIXED] - Fix autolink plugin for libraries that are platform-specific

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

Test Plan: And a library that does not have Android native code such as react-native-segmented-control/segmented-control and sync gradle

Reviewed By: rshest

Differential Revision: D59221562

Pulled By: cortinico

fbshipit-source-id: 55739d63ded63e46897d0d770281f937668c1f50
2024-07-01 05:05:23 -07:00
Nicola Corti cef17ba14f Fix crash due to missing @JvmStatic to convertToCase
Summary:
Users are reporting that RN 0.75 is crashing due to us attempting to accessing a static method
on `AndroidUnicodeUtils.convertToCase` which is not static anymore due to Kotlin conversion.

Static access is inside Hermes codebase here:
https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp#L107-L109

Changelog:
[Android] [Fixed] - Fix crash due to missing JvmStatic to `convertToCase`

Reviewed By: javache

Differential Revision: D59218291

fbshipit-source-id: ac121a8bcd5fd917ee134d257f967c8e3e338ca5
2024-07-01 03:32:14 -07:00
Blake Friedman c7988c9c82 Back out "remove @react-native-community dependencies" (#45225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45225

Original commit changeset: f238e621c47d

Original Phabricator Diff: D58528447

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D59174823

fbshipit-source-id: 3c6d74aea2fd6de7cfee8f1e4389db3d63da3c4d
2024-06-28 17:01:45 -07:00
Christoph Purrer ed5f558a6c Code-generate an optional base class to use for every NativeModule (#45113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45113

## Changelog:

[iOS][Added] - Code-generate an optional base class to use for every NativeModule

Extend RN Code-gen to generate a NativeModule base class for each ObjC Turbo Modules.

Its usage is not mandatory now, but would become for future features to add

A practial first step would be to migrate

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h#L157-L160

from the `protocol` to the default `interface` and then provide a default implementation for it

Reviewed By: RSNara

Differential Revision: D58907395

fbshipit-source-id: a6b0ef97a5c7f5bb0c53a4cb6fd83d2e55306953
2024-06-28 13:29:15 -07:00
Blake Friedman d6e8c061cd fix: ios Helloworld assumes community cli is present (#45221)
Summary:
Use the hard-coded config for Helloworld instead of assuming the community cli is there to generate a config, which we can no longer assume.

Changelog: [Internal]

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

Test Plan:
This works in my local environment:
```
bundle exec pod install
```
and
```
./gradlew generateAutolinkingPackageList
```
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59162715

Pulled By: blakef

fbshipit-source-id: 95ff2c3929f12ee0ecf468cb80d2df1281eb746e
2024-06-28 12:05:14 -07:00
Christoph Purrer 84a9f5e6c8 Add Java Turbo Module Event Emitter example (#44906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44906

Shows a proof of concept how '*strongly typed Turbo Module scoped*' `EventEmitters` can be used in a Java Turbo Module.

## Changelog:

[Android] [Added] - Add Java Turbo Module Event Emitter example

Reviewed By: javache

Differential Revision: D57530807

fbshipit-source-id: 04261d8885760f0e3b3c8c1931e0d56a5d33a0df
2024-06-28 09:41:02 -07:00
Håkon Knutzen dba25fa966 Data race related to reading/writing to AllocationTestModule.valid (#45191)
Summary:
The fix entails making `AllocationTestModule.valid` an Objective-C atomic property and funneling access to the ivar via the synthesized property getter and setter.

While the data race was present in test code, it would make it more difficult to spot more severe data races with the TSan. Also, getting rid of a data race is always good.

## Changelog:

[iOS][Fixed] - Data race related to access of `AllocationTestModule.valid`

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

Test Plan: `RCTAllocationTests` will test the implementation of `AllocationTestModule`.

Reviewed By: christophpurrer

Differential Revision: D59155083

Pulled By: javache

fbshipit-source-id: e3217cffd0801377a25f04bf8ed0b4e2d1d88498
2024-06-28 08:11:34 -07:00
Blake Friedman 9269429bb9 remove @react-native-community dependencies (#44928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44928

The react-native-community/ dependencies aren't being explicitly included as part of the Framworks (RFC-0759) work.

Changelog: [General][Breaking] react-native isn't dependend on react-native-community/*

WARNING: Do not commit until we've cut 0.75, this goes in the 0.76 release only otherwise it'll break `npx react-native@latest init`.

Reviewed By: cortinico

Differential Revision: D58528447

fbshipit-source-id: f238e621c47df9e28b2e18f4137eb08e525052f6
2024-06-28 07:48:10 -07:00
Håkon Knutzen ffc16fc18b Fix data races in RCTImageLoader and RCTNetworkTask with shared atomic counters (#45114)
Summary:
In order to fix the data races described in https://github.com/facebook/react-native/issues/44715, I propose a simple solution by leveraging shared counter functions wherein `std::atomic` is the backing for the integer values.

## Changelog:

[iOS] [Fixed] - Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races.

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

Test Plan: Added unit tests for the counters in `RCTSharedCounterTests`.

Reviewed By: cipolleschi

Differential Revision: D59155076

Pulled By: javache

fbshipit-source-id: f73afce6a816ad3226ed8c123cb2ccf4183549a0
2024-06-28 07:37:45 -07:00
Alex Hunt 9833338b5d Support @//xplat/mode/no-react-fusebox (#45216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45216

Buck modifications supporting the internal React Native DevTools (Fusebox) rollout.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D59154105

fbshipit-source-id: ba22a7f2f64d199b3e4e5a83ffa5036ae36b1a3b
2024-06-28 06:44:52 -07:00
Dmitry Rykun 5532e511af Systrace instrumentation for prop parsing (#45153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45153

This diff adds more Systrace logging to the component create/update flow.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56706472

fbshipit-source-id: c94445693694dfee43f1d46881fc1e18a507eb5e
2024-06-28 06:35:32 -07:00
Oskar Kwaśniewski c5653a03fb feat: add conditionals for iOS only code in RCTDeviceInfo.mm (#45176)
Summary:
Having React Native support every Apple platform is tough to achieve as it introduces many platform-specific ifdefs.

On the other side, maintaining an OOT platform fork is already a demanding job, so to make it easier I propose adding ifdefs for iOS-specific code. Thanks to this change, OOT platforms can focus on their OS-specific features while the core is also adding iOS-specific features behind ifdefs. Fortunately, **most of the code on Apple platforms can be shared** and this PR aims to introduce better support for this and to minimize OOT fork's surface.

In this example `RCTDeviceInfo.mm` has support for handling orientation changes and the availability of this feature across Apple OS looks as follows:

| Platform  | Support |
| ------------- | ------------- |
| macOS |    |
| tvOS |    |
| visionOS |    |
| iOS/iPadOS |    |

Here is a table from `TargetConditionals.h` header file which shows the coverage of `TARGET_OS_IOS` macro. (It supports both iOS and iPadOS)

![CleanShot 2024-06-26 at 11 51 47@2x](https://github.com/facebook/react-native/assets/52801365/5f7dc99a-72b8-46ce-87d4-896bdb017269)

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [ADDED] - Conditionals for iOS only code in RCTDeviceInfo.mm

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D59106103

Pulled By: cipolleschi

fbshipit-source-id: 594a9d2451024baddfbc9cd3bc1ccfb8829fc31c
2024-06-28 06:02:38 -07:00
Kacper Rozniata c9d589dab5 fix(iOS): fix rendering RCTRedBoxExtraData (#43102)
Summary:
This PR fixes rendering of `RCTRedBoxExtraData`

I noticed that it wasn't displaying the `reload` and `dismiss` buttons, which made it impossible to close modal and to reload JS on e.g. `visionOS` (on `iOS` it could only be closed by swiping).

PR adds these buttons back and also introduces some refactoring

Before & After:

<img width="1118" alt="pr-img" src="https://github.com/facebook/react-native/assets/56474758/50e22499-9df0-45f0-84ac-2118ab7a8e6c">

## Changelog:

[IOS] [FIXED] - Fix rendering `RCTRedBoxExtraData`

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

Test Plan: Make sure that `RCTRedBoxExtraData`  displays and works as expected

Reviewed By: dmytrorykun

Differential Revision: D59108365

Pulled By: cipolleschi

fbshipit-source-id: b88c5665962d0280d68377863aa3346edfdf86b7
2024-06-28 05:58:01 -07:00
zhongwuzw 7698cd0953 Fixes Image load event in new arch (#44918)
Summary:
Fixes https://github.com/facebook/react-native/issues/44896. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes Image load event in new arch

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

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

Reviewed By: dmytrorykun

Differential Revision: D59108500

Pulled By: cipolleschi

fbshipit-source-id: 1fad4f82288141e9fc37f525be7073deb81c542c
2024-06-28 04:35:39 -07:00
imWildCat e320ab47cf fix the path of the script phase (#45208)
Summary:
Since 0.75-rc.x, I cannot run pod install because of an linking issue of react native firebase.

https://github.com/reactwg/react-native-releases/issues/341#issuecomment-2194568204

## Changelog:

[IOS][FIXED] Auto linking script of script phase

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

Test Plan: Full demo of this fix: <https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase>

Reviewed By: christophpurrer

Differential Revision: D59125585

Pulled By: blakef

fbshipit-source-id: be96d3b207eff67c5e0d777203e7fc0d10103fc0
2024-06-27 16:14:59 -07:00
Saad Najmi a557a81f96 Remove [RCTConvert UIBarStyle:] (#44597)
Summary:
Resolves https://github.com/microsoft/react-native-macos/issues/2008

Followup to https://github.com/facebook/react-native/pull/42100 / https://github.com/facebook/react-native/commit/157cb0e02b6328e8b640f2b302a11c298a240493 , let's remove the deprecated RCTConvert method.

## Changelog:

[IOS] [REMOVED] - Remove `[RCTConvert UIBarStyle:]`

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

Test Plan: CI should pass

Reviewed By: christophpurrer

Differential Revision: D59128144

Pulled By: javache

fbshipit-source-id: 3e66422a7f4a139a6d68cbdfc6aae211ea239d4e
2024-06-27 16:07:57 -07:00
Sam Zhou 1a990d1904 Deploy 0.238.3 to xplat (#45209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45209

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D59119421

fbshipit-source-id: a547a153c051c103ecd16ad0497d30d43dbe80a7
2024-06-27 14:02:03 -07:00
Tim Yung 1341169a4b RN: Remove forwardRef from ScrollView (#45197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45197

With React 19, `forwardRef` is no longer necessary because `ref` is available on props. However, this only holds true for functional components — not class components.

This eliminates the `forwardRef` invocation in `ScrollView`, while retaining the wrapper component to map `ref` to `scrollViewRef` for the class component. For now...

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59091873

fbshipit-source-id: 60afcd441aec82fa050738b5c09083f3a26378d6
2024-06-27 11:08:11 -07:00
Alex Hunt bfc51f97da Expose preprocessor flag/Buck constraint for Fusebox opt in (#45203)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45203

Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target via a [constraint setting](https://www.internalfb.com/intern/wiki/Buck-users/select-and-friends/#constraint-setting-and-c). This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout.

NOTE: This approach replaces D59014161 (reverted).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59109110

fbshipit-source-id: 7d23d9d402569b00d8dd17b9c8f3bcc108f0365f
2024-06-27 09:44:15 -07:00
Jorge Cabiedes Acosta eb9c388492 Update Filter header (#45151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45151

This change was missed when fixing hue-rotate and adding drop-shadow. I believe the only issue with this was stacking context was not being created for these two filters.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58965245

fbshipit-source-id: e6bfdb738a8bc8caa878f60420cfe8b421f64aa4
2024-06-27 09:43:39 -07:00
Nicola Corti e8d3ad7216 Let build_android produce a signed maven-local.zip archive (#45161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45161

This is part of a bigger refactoring of the Android pipelines.
As `build_android` is already building everything, let's save the maven-local
so it can be reused by other jobs (test_android_helloworld and build_npm_package).

Changelog:
[Internal] [Changed] - Let build_android produce a signed maven-local.zip archive

Reviewed By: cipolleschi, blakef

Differential Revision: D59002893

fbshipit-source-id: db03946c975b2ce91dae0c4011981b2fe9dd6113
2024-06-27 09:29:22 -07:00
Riccardo Cipolleschi 2adb389fac Disable unit tests for flakyness in CircleCI (#45133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45133

Recently, CircleCI has failed pretty often due to these tests.
The reason is that we migrated these jobs to M1 machines, as circleCI is deprecating intel ones, and on these machines the simulators tend to freeze. Hence, every often we get stuck when running the tests. :(

We are going to move to GHA, so that should not be a big issue.

## Changelog:
[Internal] - Disable unit tests in CircleCI to improve CI robustness

Reviewed By: cortinico

Differential Revision: D58948614

fbshipit-source-id: 5420bdf0fda325779a4e287e7b00c623de822ccb
2024-06-27 09:27:24 -07:00
Oskar Kwaśniewski 815c415fb9 refactor: supportedInterfaceOrientations method to use RCTKeyWindow() (#43026)
Summary:
This PR refactors `supportedInterfaceOrientations` to use RCTKeyWindow instead of `[RCTSharedApplication() keyWindow]`.

## Changelog:

[IOS] [CHANGED] - Refactor supportedInterfaceOrientations method to use RCTKeyWindow()

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

Test Plan: CI Green

Reviewed By: dmytrorykun

Differential Revision: D59109614

Pulled By: cipolleschi

fbshipit-source-id: 025534c419078dce29e1e5caacf8a1b15de1abcc
2024-06-27 07:58:50 -07:00
Tim Yung fb58494283 RN: Fix mockComponent for Functional Components (#45196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45196

Currently, `mockComponent` makes a false assumption that if a component is a function, it extends `React.Component`.

There's a bunch of problems with this mocking setup with requiring mock components that extend `React.Component`, but this change does not attemp to solve that.

This change unblocks future refactors to make native components export functional components (that are neither class component nor `forwardRef` results).

Changelog:
[General][Changed] - Fixed native component mocking in Jest unit tests to support functional components

Reviewed By: javache

Differential Revision: D59097730

fbshipit-source-id: ca2784ac3baa9ab4ab6a503c5fd6437c60179352
2024-06-27 07:26:04 -07:00
Tim Yung 3965b7d78b RN: Fix Test Case Isolation in Modal-test.js (#45195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45195

Configure `Modal-test.js` to reset modules between test cases so that there is better isolation, making the tests easier to reason about and to debug.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59097729

fbshipit-source-id: 3b9260283e171ff7fa6b7ffc56685f703875291e
2024-06-27 07:26:04 -07:00
Riccardo Cipolleschi c0b5e2e031 Bump CLI dependencies to alpha.11 (#45179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45179

## Changelog:
[General][Changed] - Bumps the CLI to alpha 11

Reviewed By: cortinico

Differential Revision: D59055459

fbshipit-source-id: 3bebe80d0cf6e7af8d7f74f3a5e4e2ccc91cf419
2024-06-27 04:11:44 -07:00
Riccardo Cipolleschi 119ab33036 Port changes in the release testing script from the release branch (#45174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45174

As per title, this port bck to main the changes we made in the release testing script.

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

Reviewed By: blakef

Differential Revision: D59054045

fbshipit-source-id: 0e93c2db94499407845b4fb2c98c8b44310e770f
2024-06-27 04:11:44 -07:00
Riccardo Cipolleschi cf8d3f8007 Port CI improvements from Release branch to main (#45175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45175

This change ports the CI improvements we made on stable branch to main.

## Changelog:
[Internal] - Port back to main improvements we made in GHA

Reviewed By: cortinico

Differential Revision: D59053873

fbshipit-source-id: 73eb7e33b9bbdc5d8c3a9294f487ad969b144bf3
2024-06-27 04:11:44 -07:00
Rubén Norte b80812a9af Avoid unnecessary creation of null shared pointers in IntersectionObserverManager (#45190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45190

Just a small follow up from the previous change to `IntersectionObserverManager`.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D59065041

fbshipit-source-id: 2944299143e6a0fe53fe64083db85635e72d71af
2024-06-27 03:36:36 -07:00
Pieter De Baets c2e080419b Fix crash on reload when useImmediateExecutorInAndroidBridgeless is enabled (#45162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45162

Previously we would crash in ReactInstance#callFunctionOnModule (P1443291303) when reloading (due to the onHostPause call) because we removed a source of synchronization by using the immediate executor.

Workaround it by making sure we always null out references to `mReactInstance` before we actually start destroying it.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59002404

fbshipit-source-id: 3ee14cd1fe7d423bb6158356bb99b3d2d6af8d6f
2024-06-27 03:25:39 -07:00
Tim Yung c128a517b8 RN: Avoid Invalidating ScrollView Children on unstable_subscribeToOnScroll (#45170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45170

Reimplements `unstable_subscribeToOnScroll` so it does not invalidate all descendant children upon first invocation per `ScrollView` instance.

Previously, the state update would cause the entire `ScrollView` component to re-render. This refactors the `enableSyncOnScroll` boolean state so that it resides in a lower level component that implicitly memoizes all of its `props` (including the `ScrollView` children).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59033393

fbshipit-source-id: 5a4b75aebdcbd0dd1dfa28511862bee495816250
2024-06-26 20:17:05 -07:00
Tim Yung 18302831c4 RN: Improvements to LogBoxInspectorHeader (#45194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45194

Makes a couple improvmeents to `LogBoxInspectorHeader`:

- Avoid eagerly initializing the `StatusBar` TurboModule until it is actually needed (which is only when the inspector is rendered on Android).
- Switch to `SafeAreaView` on iOS, for more accurate spacing (instead of the hardcoded iPhone X notch size).

Changelog:
[General][Changed] - Improve LogBox initialization performance
[iOS][Changed] - Improve LogBox safe area insets styling

Reviewed By: lyahdav

Differential Revision: D59081529

fbshipit-source-id: 01cc351fa9267f96b7a3c13cf1db80de3e597f93
2024-06-26 20:17:05 -07:00
Rubén Norte 39b33f158f Add unmount method in UIManagerMountHook and use it to notify not intersecting state in IntersectionObserver (#45186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45186

Changelog: [internal]

(this is an internal change because `IntersectionObserver` hasn't been released yet).

When testing IntersectionObserver, I realized that it wasn't triggering notifications for elements not intersecting when the surface that contained them was completely deallocated.

This is unexpected because IntersectionObserver notifications are delivered when the element is removed from the root, but not when the root itself is removed.

This fixes that behavior by:
1. Adding a method in `UIManagerMountHooks` to get a notification about the surface being unmounted. This is necessary to keep the API backwards compatible.
2. Using that method in `IntersectionObserverManager` to notify all observers (and report a change if necessary).

Reviewed By: javache

Differential Revision: D59061136

fbshipit-source-id: ef5669f9d6b08d98652489e6731902d192ec28f8
2024-06-26 11:40:21 -07:00
Alex Hunt 2cb04b4e2a Implement new HostTargetMetadata fields (iOS) (#44933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44933

Resubmission of D58288489 (reverted due to C++ types in ObjC header).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D58522256

fbshipit-source-id: 5a413f1d5cca9555e309ab07e4de0e19ad2603cc
2024-06-26 10:44:26 -07:00
Leon Xu 873ebc8055 Normalize newlines in public-api-test (#45145)
Summary:
Tests were failing on windows due to parsing CRLF line endings. This change enables the API tests for windows by normalizing line endings before parsing the file.

## Changelog:
[INTERNAL] [ADDED] - `public-api-test` now runs on Windows.

<!-- 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/45145

Test Plan: Build-time-only change; relying on CircleCI

Reviewed By: cipolleschi

Differential Revision: D59001867

Pulled By: huntie

fbshipit-source-id: a7a41945e8c93288be1d5b7b59df7f621e467657
2024-06-26 10:42:47 -07:00
Alex Hunt 2c210939d3 Unify versioning step in release process (#45185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45185

Follow-up to D59058085.

Since the release branch for 0.75 has been cut, we are able to simplify this step.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D59058084

fbshipit-source-id: 21b77a74e13bb196336a63b984f921f0c9fde587
2024-06-26 10:14:12 -07:00
Alex Hunt 5f60ad65ca Rename set-rn-version script, mark as deprecated (#45184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45184

This is a follow-up to D59055522.

> NOTE:This diff will be followed up by a merge of the set-rn-version script into set-version. (I had considered a rename to version-rn-artifacts, intentionally keeping this script separate and distinct from a future [lerna version + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)

- Rename `set-rn-version` to `set-rn-artifacts-version` (more accurate).
- Mark this script as deprecated.
    - For now, there are too many references to this script in CI test jobs to refactor away this entry point, so I am avoiding this — these should later be standardised to `set-version`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D59058085

fbshipit-source-id: 4123ac73b5c7a2e07a1d1b6da61e0ad94fc31f84
2024-06-26 10:14:12 -07:00
evanbacon 8989c9b71d mark all of react-native as client boundary for React Server Components (#43986)
Summary:
While developing React Server Component support for React Native, I've been adding this patch to the `react-native` package. It opts the entire `react-native` package out of being server rendered.

In the future, we'll want to circle back and refactor the `react-native` package to be more isomorphic so we can allow for utilities like `processColor` to be used in server bundles that target native platforms.

## Changelog:

[GENERAL] [ADDED] - Added support for importing `react-native` in a `react-server` environment for React Server Components support.

<!-- 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/43986

Test Plan:
Using react-native with this patch in a framework that supports React Server Components for native platforms, such as my unreleased branch of Expo Router, will allow for server rendering views from `react-native` to RSC Flight code with client references to the `react-native` package, e.g.

```js
import { View } from 'react-native';

export default function App() {
  return <View testID="basic-view" style={{ "backgroundColor":"#191A20" }}/>
}
```

Can be server rendered to ↓

```
2:I["/node_modules/react-native/index.bundle?platform=ios&dev=true#798513620",["..."],"View"]
1:["$","$L2",null,{"testID":"basic-view","style":{"backgroundColor":"#191A20"}}]
```

> The client boundaries (URL paths) are specific to the current Expo CLI implementation (based on Metro) and may look different in other implementations.

Reviewed By: rickhanlonii

Differential Revision: D55891243

Pulled By: TheSavior

fbshipit-source-id: d8dc9590039181ebf2c013dacca5f255d7a8f625
2024-06-26 09:25:56 -07:00
Alex Hunt ebf1a7b79b Bump packages for next major release (#45015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45015

Set package versions to `0.76.0-main` (`0.75-stable` branch was cut).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58687399

fbshipit-source-id: 27ed987e4557705845d57d64e7547cddbd982a03
2024-06-26 07:59:49 -07:00
Alex Hunt 4a6b889e93 Move all package.json updates into set-version script (#45180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45180

- Simplifies the responsibilities of `scripts/releases/set-rn-version.js`.
    - This no longer modifies `packages/react-native/package.json`, delegating this to `set-version`.
- Simplifies logic in `set-version`, **fixing behaviour** against deps in `packages/react-native/package.json`.
- This also acts as cleanup since D58469912 (template removal) — removing the unreferenced `update-template-package.js` util.

NOTE: This diff will be followed up by a merge of the `set-rn-version` script into `set-version`. (I had considered a rename to `version-rn-artifacts`, intentionally keeping this script separate and distinct from a future [`lerna version` + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D59055522

fbshipit-source-id: 79b937f9e0ac790512b180ab4147aefef7f5202c
2024-06-26 07:59:49 -07:00
Alex Hunt 616d7f2095 Fix set-version script to skip react-native interdependencies (#45028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45028

Since the addition of new workspaces to the repo which introduce interdependencies on `react-native` (`helloworld`, `react-native-test-library`), this fix is needed to preserve our current versioning strategy and bump the repo after yesterday's `0.75-stable` branch cut.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58725561

fbshipit-source-id: ab282806560f47dc5acf7e694302ca6b85649b14
2024-06-26 07:59:49 -07:00
Alex Hunt 0fb611009e Back out "Expose preprocessor flag for fuseboxEnabledDebug"
Summary:
Reverting. The behaviour of [`exported_preprocessor_flags`](https://buck.build/rule/cxx_library.html#:~:text=in%20platform_preprocessor_flags.-,exported_preprocessor_flags,-(defaults%20to%20%5B%5D) was misunderstood (applies this flag).

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: hoxyq

Differential Revision: D59058502

fbshipit-source-id: bf05fbfb3cf865ae6501545561952742ebd0a122
2024-06-26 07:12:20 -07:00
Riccardo Cipolleschi e6dd44d6e5 Create Changelog for 0.75.0-RC.2 (#45183)
Summary:
Adds the Changelog for RC.2

## Changelog:
[General][Added] - Add changelog lines for RC2

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

Test Plan: N/A

Reviewed By: huntie

Differential Revision: D59058256

Pulled By: cortinico

fbshipit-source-id: 055eab41ac67fadf9414ab58216ed9428e2b4f76
2024-06-26 06:40:00 -07:00
Riccardo Cipolleschi aead3db639 Remove the workaround to import the Paper renderer (#44814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44814

We needed this workaround to import the paper renderer in the New Architecture to make sure that the event emitter is properly registered before we use it.

With the previous change, we don't need this lines of code anymore as we are using a different mechanism for the events.

## Changelog:
[Internal] - Avoid to import the old Renderer in the New Architecture

## Facebook:
This diff was initially part of D57097880, but I split them for the OTA

Reviewed By: cortinico

Differential Revision: D58234325

fbshipit-source-id: 1335992460635e9e97ee83615f9fd2651936b32c
2024-06-26 06:38:51 -07:00
Edmond Chui c6cbaf278c Update debugger-frontend from 750ed14...7cd81c1 (#45177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45177

Changelog: [Internal] - Update `react-native/debugger-frontend` from 750ed14...7cd81c1

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/750ed147da1c0edd118f359f906d5c7553c338a8...7cd81c1548a4bca19732037dcf82662a6ed9ca39).

Reviewed By: hoxyq

Differential Revision: D59053693

fbshipit-source-id: f3b22340d3ddd6efe8f9963f025ebd47a07830ab
2024-06-26 04:27:14 -07:00
Alex Hunt 981141c9a1 Expose preprocessor flag for fuseboxEnabledDebug (#45167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45167

Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target. This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59014161

fbshipit-source-id: f05e8b01ed07da90ef6d7a66ade05f462dd82023
2024-06-26 03:53:54 -07:00
Pieter De Baets 2dfb09c51a Match convertRawProp error handling in iterator-based props parsing (#45156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45156

We don't want to bubble up exceptions from props parsing, so match the behaviour from convertRawProp and fall back to the default value when an exception is encountered.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59000397

fbshipit-source-id: f6f64a80fed98525cdd2a5b5d360c2d6ede76a12
2024-06-26 03:46:25 -07:00
Nicola Corti 88a9b6e89f Only build_android should write to the Gradle Cache (#45160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45160

This should optimize the Gradle cache, so that only `build_android` which
effectively builds everything Android related, should be allowed to write there.

More info on this strategy here:
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md

Changelog:
[Internal] [Changed] - Only build_android should write to the Gradle Cache

Reviewed By: cipolleschi

Differential Revision: D59002323

fbshipit-source-id: 31b815747efdf93bfc7baf97799e287c8dcd7f02
2024-06-26 03:40:50 -07:00
Dmitry Rykun d3e0430dea Fix output path for generated artifacts (#45165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45165

This is a fix for https://github.com/facebook/react-native/issues/45112
This diff changes the codegen so that the output path is computed relative to project root (or `path` if provided) instead of current working directory.

Changelog: [General][Fixed] - Codegen computes output path relative to project root instead of current working directory.

Reviewed By: fkgozali

Differential Revision: D59009821

fbshipit-source-id: 3a138a3508fc239c8600b8c9f242f1c665f8e3c0
2024-06-26 01:59:54 -07:00
Peng Jiang b9ec0e5a1a use view.getPaddingStart() directly (#45150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45150

As the androidx.core 1.13.1 change, ViewCompact.getPaddingStart and getPaddingEnd are deprecated.

based on the suggestion from https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#getPaddingStart(android.view.View), use: view.getPaddingStart and view.getPaddingEnd directly.
 {F1717102270}

Changelog: [Internal] - Migrating deprecated APIs with AndroidX.Core 1.13.1

Reviewed By: alanleedev

Differential Revision: D58955567

fbshipit-source-id: b84377e1ded0d94e9035dcfa4dbd9c463396a322
2024-06-26 01:47:24 -07:00
Peng Jiang 71f8d7608f use view.LAYOUT_DIRECTION_RTL directly (#45152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45152

As the androidx.core 1.13.1 change, ViewCompat.LAYOUT_DIRECTION_RTL is deprecated. Based on the suggestion from https://developer.android.com/reference/androidx/core/view/ViewCompat#LAYOUT_DIRECTION_RTL(), use view LAYOUT_DIRECTION_RTL directly and they have the same value.
 {F1716960190}

Changelog: [Internal] - Migrating deprecated APIs with AndroidX.Core 1.13.1

Reviewed By: alanleedev

Differential Revision: D58953460

fbshipit-source-id: 938200d1d0b1c7cc167f0119cc20ba72d16351a4
2024-06-26 01:47:24 -07:00
Jingbo Yang 8bd9952eaf Replace YogaConstants.UNDEFINED with Float.NaN (#45141)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45141

Reviewed By: javache, NickGerleman

Differential Revision: D58915391

fbshipit-source-id: 73ebee6abaced092366abdfc0ff41a66e7ff6c03
2024-06-25 18:48:15 -07:00
Neil Dhar 993f9fd8db Implement more missing methods on WithRuntimeDecorator (#45049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45049

WithRuntimeDecorator is missing many methods that were added after it.
Add implementations for them.

The underlying issue here is that because this inherits from
RuntimeDecorator, which implements all methods, there is no compilation
error for this runtime when we add new methods.

Changelog:
[GENERAL] [FIXED] - Add missing methods to the WithRuntimeDecorator class.

Reviewed By: avp

Differential Revision: D58752127

fbshipit-source-id: d80b4ed1c38698ed3850d0cd961bf7ddde2449a0
2024-06-25 18:11:47 -07:00
Bartłomiej Błoniarz 218ea5d44c Add missing WithRuntimeDecorator methods (#45042)
Summary:
This PR adds missing `WithRuntimeDecorator` methods related to `NativeState`. This pattern is used by reanimated to ensure no concurrent access to the runtime. Without this `override` the `RuntimeDecorator` implementation was used, bypassing our mutex.

Changelog:
[GENERAL] [FIXED] - Add missing `NativeState` methods to the `WithRuntimeDecorator` class.

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

Reviewed By: fbmal7

Differential Revision: D58744051

Pulled By: neildhar

fbshipit-source-id: 3f5c85d0bf7cd6445d0c434ac4ae7ed54df203ba
2024-06-25 18:11:47 -07:00
Gijs Weterings 295626bc35 Upgrade @grpc/grpc-js from 1.7.0 to 1.10.9 (#45131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45131

Changelog: [General][Security] Upgrade grpc/grpc-js from 1.7.0 to 1.10.9 (CVE-2024-37168)

Reviewed By: fabriziocucci

Differential Revision: D58948299

fbshipit-source-id: fc1d0047eedfd081212be68cf95fca571efd78d3
2024-06-25 17:30:10 -07:00
Gijs Weterings d538879e08 Upgrade braces from 3.0.2 to 3.0.3 (#45132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45132

Changelog: [General][Security] Upgrade braces from 3.0.2 to 3.0.3 (CVE-2024-4068)

Reviewed By: hoxyq

Differential Revision: D58948245

fbshipit-source-id: 4ef653f2574e763f3a8d227310b55e0f336f19f4
2024-06-25 17:30:10 -07:00
Gijs Weterings 13f1b9e10f upgrade ws from 7.5.1 to 7.5.10 (#45129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45129

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

Changelog: [General][Security] Update ws from 7.5.1 to 7.5.10 (CVE-2024-37890)

Reviewed By: hoxyq

Differential Revision: D58947571

fbshipit-source-id: 43ee200e02fcc17a47a30e0baaab4f01043fc6fd
2024-06-25 17:30:10 -07:00
Gijs Weterings 80cfacef78 Upgrade ws from 6.2.2 to 6.2.3 (#45130)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45130

Changelog: [General][Security] Update ws from 6.2.2 to 6.2.3 (CVE-2024-37890)

6.2.3 is a patch to mitigate a dos vuln https://github.com/websockets/ws/releases/tag/6.2.3

Reviewed By: hoxyq

Differential Revision: D58946681

fbshipit-source-id: ff73f31ffd9b14392e3bea4e616cb5f4c9b8d13f
2024-06-25 17:30:10 -07:00
Zeya Peng b5683a7516 Create util functions to convert Color <-> uint8_t RGBA values (#45139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45139

## Changelog

Sometimes we pass down int RGBA values in [0, 255] to represent color components in ReactNative;
and other times we use float. Since we introduce display P3, we probably want to use color depth more than 8bit

In the first case, when RGBA are passed down as uint8_t, we can directly calculate Color/SharedColor without normalizing them to [0,1] and scale back to [0, 255] as `colorFromComponents` does; otherwise there could be some precision loss..

So here I'm adding some new utils for that purpose: see `colorFromRGBA`, `redFromColor`, `greenFromColor`, etc

[Internal]
Examples in codebase:
* rgba in [0, 255]:
https://www.internalfb.com/code/fbsource/[67148a47147b0e15f0f0748003394040611c2bc2]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/graphics/fromRawValueShared.h?lines=28-35

* rgba in [0, 1]:
https://www.internalfb.com/code/fbsource/[67148a47147b0e15f0f0748003394040611c2bc2]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/graphics/fromRawValueShared.h?lines=37-45

https://www.internalfb.com/code/fbsource/[67148a47147b0e15f0f0748003394040611c2bc2]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/graphics/fromRawValueShared.h?lines=47-64

Reviewed By: rshest

Differential Revision: D58872165

fbshipit-source-id: 748a12a99591c895fed65cda6deeaa2a3e0c3cf5
2024-06-25 16:04:56 -07:00
Tim Yung 08b05f30c2 RN: Refactor ScrollView Native Component Imports (#45168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45168

Refactors the native component imports in `ScrollView` so that 1) they create less clutter in the `ScrollView` implementation file, and 2) they offer more efficient import inlining.

Currently, `ScrollView` has to evaluate both horizontal and vertical components even though only one may be used. Now this optimization is possible.

Changelog: [Internal]

Reviewed By: lyahdav

Differential Revision: D59015990

fbshipit-source-id: 963009821a7d3019d36a43269e9792ac1f2f38ec
2024-06-25 13:25:43 -07:00
Ruslan Lesiutin 2e03d262d4 upgrade[react-devtools-*]: v.5.3.0 (#45159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45159

Changelog: [Internal]

via `js1 upgrade react-devtools -v ^5.3.0`

allow-large-files

Reviewed By: EdmondChuiHW

Differential Revision: D59001348

fbshipit-source-id: e17e1070b38256644fa987bd00510b8a7c5d848a
2024-06-25 10:52:46 -07:00
Dmitry Rykun a44dd57f10 Update codegen artifacts for react-native-test-library (#45164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45164

Some changes have been made to the codegen since `react-native-test-library` was published. This diff updates the generated artifacts in that library.
Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D59010093

fbshipit-source-id: f11ccd3645da72d45c70581e485f8546166ca182
2024-06-25 09:57:04 -07:00
zhongwuzw 70b43bb013 Fixes js bundle failed (#45155)
Summary:
When I enabled `FORCE_BUNDLING`, it build errors like below. cc blakef
![image](https://github.com/facebook/react-native/assets/5061845/d23f6bad-ed60-4f1f-8111-2361c93e93a4)

## Changelog:

[INTERNAL] [FIXED] - Fixes js bundle failed

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

Test Plan: Enable FORCE_BUNDLING and build success.

Reviewed By: cipolleschi

Differential Revision: D59006962

Pulled By: blakef

fbshipit-source-id: 1142d1ddbae7346b67712fac0237950847211992
2024-06-25 08:57:21 -07:00
Ramanpreet Nara 7522336412 Bridgeless: Allow js bundle configuration via filepaths
Summary:
## Summary
Right now, the only way to load the javascript bundle is through the assets:// directory.

But, legacy react native also supports loading bundles via regular file urls.

If present, those file urls override the assets:// bundle urls.

This diff implements that support in bridgeless.

Changelog: [Android][Added] Allow js bundle file urls

Reviewed By: christophpurrer

Differential Revision: D58977143

fbshipit-source-id: 6f1a170546c8bbeac3a1b9d2dd5633177e33a688
2024-06-25 07:13:39 -07:00
Ramanpreet Nara 80e1dd70b0 ReactHost: Make ReactInstanceEventListener APIs public
Summary:
The ReactInstanceManager allows applications to register a ReactInstanceEventListener with itself.

Exposing a similar functionality to ReactHost. So, applications can do the same in bridgeless.

Changelog: [Android][Added] - Make ReactInstanceEventListener available on ReactHost

Reviewed By: christophpurrer

Differential Revision: D58890092

fbshipit-source-id: c18ee8a45d274c5cba859c6a5b4049904f1d308a
2024-06-25 07:13:39 -07:00
Rob Hogan 88ba9a6042 Inspector: Support /open-debugger specifying target param (#45138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45138

Add a new `/open-debugger` endpoint format that allows specifying `target` - the proxy-unique target `id`. This is logically equivalent to specifying both device and page.

Changelog:
[General][Added]: Inspector: Support `/open-debugger` specifying `target` param

Reviewed By: hoxyq

Differential Revision: D58950622

fbshipit-source-id: 9665f8a24ba2bb0561cc3c693dfb84bfffdeb4a4
2024-06-25 06:28:57 -07:00
Rob Hogan c7970379a1 Inspector: Enforce device and appId filters if both are given to /open-debugger (#45140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45140

Previously, if the `/open-debugger` endpoint was provided with both `device` and `appId` query params, we would:
 - Try to find a target with a matching `device` (note that these logical "devices" are unique per-app) - if found, use it. Otherwise,
 - Try to find a target with a matching `appId` - if found, use that.

This could go "wrong" in two ways:
 - If a `device` is given with a spurious `appId`, we'd open to a target with an `appId` differing from the one specified.
 - If the `device` has gone away but there is a different target with the same app, we'd use that as a fallback (right app, wrong device).

This applies the filters more strictly so that if both are given, both must match.

Changelog:
[General][Changed]: Inspector: Enforce device and appId filters if both are given to /open-debugger

Reviewed By: hoxyq

Differential Revision: D58951952

fbshipit-source-id: a95f1160e5c88f957445058f3273e922a5d28c1e
2024-06-25 06:28:57 -07:00
Dmitry Rykun 1fda630d87 Make RawPropsParser::iterateOverValues more performant (#45088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45088

This diff should make iterator-style prop setting more performant.
- It removes some layers of indirection. Now `ConcreteComponentDescriptor` calls into `setProp` directly.
- On both platforms, we will use `folly::dynamic` parser, it seems it is slightly faster.
- On Android, we will reuse `props->rawProps` parsed as a `folly::dynamic` representation, instead of parsing stuff twice.

Changelog: [Internal] - This hasn't been rolled out to OSS yet.

Reviewed By: javache

Differential Revision: D58593492

fbshipit-source-id: aa2dcb4e7ba2248f6ba7aa82a60355efdf769b2c
2024-06-25 05:09:08 -07:00
zhongwuzw 9b9c780cc8 Fixes TextInput crash when undo if text longer than maxLength (#45097)
Summary:
Fixes https://github.com/facebook/react-native/issues/45050 . System pass the range bigger than we allowed because we limit the maxLength. We truncated the range to fix the undo crash.

cc. cortinico .

## Changelog:

[IOS] [FIXED] - Fixes TextInput crash when undo if text longer than maxLength

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

Test Plan: Repro please see https://github.com/facebook/react-native/issues/45050.

Reviewed By: cortinico

Differential Revision: D58947130

Pulled By: cipolleschi

fbshipit-source-id: 1c09cad8ac7ee99f3a3eef93fafb5aeac425d146
2024-06-25 04:23:38 -07:00
Biki-das cf015f93ef feat:- added UIInterfaceOrientation in place of statusBarOrient… (#44825)
Summary:
This PR replaces the depreacted `statusBarOrientation` method to `interfaceOrientation`, as in the apple developer docs it clearly says the method has been deprecated
https://developer.apple.com/documentation/uikit/uiapplication/1623026-statusbarorientation

## Changelog:
[iOS] feat:- added UIInterfaceOrientation in place of statusBarOrietation.

[IOS] [ADDED] - Added RCTUIInterfaceOrientation helper method

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

Test Plan: Tried `RNTester` build after the changes and it ran successfully!

Reviewed By: cortinico

Differential Revision: D58947500

Pulled By: cipolleschi

fbshipit-source-id: 401abf1d46b415093f441d1dbee139e7aaf8712c
2024-06-25 04:14:30 -07:00
Miklós Fazekas f903f34837 Allow library podspec to declare Swift Package Manager dependencies (#44627)
Summary:
React-Native uses Cocapods for native dependency management on iOS. While CocoaPods is flexible and popular, Apple's Swift Package Manager is the new standard. Currently consuming packages available only via Swift Package Manager is not possible. This change implements a single extension so .podspec files can declare Swift Package Manager dependencies via
```ruby
ReactNativePodsUtils.spm_dependency(s,
     url: 'https://github.com/apple/swift-atomics.git',
     requirement: {kind: 'upToNextMajorVersion', minimumVersion: '1.1.0'},
     products: ['Atomics']
   )
```

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - libraries can now declare Swift Package Manager dependencies in their .podspec with `ReactNativePodsUtils.spm_dependency`

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

Test Plan:
https://github.com/mfazekas/rn-spm-rfc-poc/

Is a simple demo for the feature:

1. Podspec declare dependency with:

   ```ruby
   if const_defined?(:ReactNativePodsUtils) && ReactNativePodsUtils.respond_to?(:spm_dependency)
     ReactNativePodsUtils.spm_dependency(s,
       url: 'https://github.com/apple/swift-atomics.git',
       requirement: {kind: 'upToNextMajorVersion', minimumVersion: '1.1.0'},
       products: ['Atomics']
     )
   else
     raise "Please upgrade React Native to >=0.75.0 to use SPM dependencies."
   end
   ```

2. [`import Atomics`](https://github.com/mfazekas/rn-spm-rfc-poc/blob/e4eb1034f7498dedee4cb673d327c34a6048bda2/ios/MultiplyInSwift.swift#L1C2-L1C15) and [`ManagedAtomic`](https://github.com/mfazekas/rn-spm-rfc-poc/blob/e4eb1034f7498dedee4cb673d327c34a6048bda2/ios/MultiplyInSwift.swift#L7-L13) is used in the code

3.) `spm_dependency` causes the dependency to be added via `post_install` hook in the workspace

<img width="261" alt="image" src="https://github.com/facebook/react-native/assets/52435/ad6aee1c-ac88-4c84-8aa3-50e148c4f5b2">

4.) `spm_dependecy` causes the library to be linked with `Atomics` library

<img width="817" alt="image" src="https://github.com/facebook/react-native/assets/52435/bfc8dfc0-aeb7-4c75-acbd-937eab1cbf80">

Limitations:
1.) only works `USE_FRAMEWORKS=dynamic pod install` otherwise the linker fails [with known Xcode issue - duplicate link issue](https://forums.swift.org/t/objc-flag-causes-duplicate-symbols-with-swift-packages/27926)
2.) .xcworkspace needs to be reopened after `pod install` - this could be worked around by not removing/readding spm dependencies

### See also:

https://github.com/react-native-community/discussions-and-proposals/issues/587#issuecomment-2117025448
https://github.com/react-native-community/discussions-and-proposals/pull/787

Reviewed By: cortinico

Differential Revision: D58947066

Pulled By: cipolleschi

fbshipit-source-id: ae3bf955cd36a02cc78472595fa003cc9e843dd5
2024-06-25 03:45:07 -07:00
Moti Zilberman 4a8f0ee58a Keep HostTarget registered until ReactHostImpl/ReactInstanceManager is invalidated (#45146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45146

Changelog: [Internal]

Currently, on Android, we destroy the Fusebox `HostTarget` when we receive the `onHostDestroy` event, which (counterintuitively) does not mean the ReactHost/InstanceManager ("Java Host") is being destroyed. This can lead to situations where the `HostTarget` is destroyed too soon (e.g. when a single Java Host is reused across multiple Activities).

Now that we have the `invalidate()` method on the Java Host classes, we can tie `HostTarget`'s destruction to that instead.

Since calling `invalidate()` is explicitly optional, we also need to account for the case where the caller just lets go of the Java Host reference and expects GC to handle cleanup. This includes:

* Breaking the retain cycle between the Java Host and its C++ part. We achieve this using `WeakReference` to reference the Java Host.
* Making the C++ part of the Host safe to destroy from any thread (and in particular the finalizer thread). We achieve this by scheduling `HostTarget`'s unregistration (in C++) on the executor supplied by the Java Host.

Reviewed By: hoxyq

Differential Revision: D58284590

fbshipit-source-id: 4ee4780354fb81137b891d5891d6138ac215cbff
2024-06-24 14:35:53 -07:00
Moti Zilberman a7adfef0bb Reject debugger connections to unknown page IDs (#45148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45148

Changelog: [General][Fixed] Reconnecting to an unknown inspector page no longer results in a zombie connection

TSIA

Reviewed By: hoxyq

Differential Revision: D58954759

fbshipit-source-id: 99c5caccc3cc917e0691e94326c7a35874f9a385
2024-06-24 12:59:53 -07:00
Christoph Purrer 6daccf75da Enable EventEmitter parsing for TypeScript TM Specs (#45118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45118

## Changelog:

[General] [Fixed] - Enable EventEmitter parsing for TypeScript TM Specs

Reviewed By: rshest

Differential Revision: D58929364

fbshipit-source-id: 0f95aee2f387edf0a148b368d71b0325c805f724
2024-06-24 11:36:49 -07:00
Robert Pasiński af04eb773c fix: Improve Timers error handling and web compatibility (fixes #45085) (#45105)
Summary:
Improve compatibility with web implementations of JS timers.

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

## Changelog:

[GENERAL] [CHANGED] - Timer functions are now throwing exceptions in less cases and are instead quiet quitting (similar to browsers)
[GENERAL] [CHANGED] - Timer functions `timeout` argument is now coerced to a number

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

Test Plan: Updated RN tester

Reviewed By: christophpurrer

Differential Revision: D58952146

Pulled By: javache

fbshipit-source-id: 5b6de524f6a03f5221f0d11e0ae2a9313951c767
2024-06-24 11:24:46 -07:00
Rubén Norte 0062435d2e Rename some methods in RuntimeScheduler_Modern to refer to event loop more explicitly (#45143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45143

Changelog: [internal]

Just a small refactor of some private methods in `RuntimeScheduler_Modern` to refer to some concepts in terms of the event loop.

Reviewed By: christophpurrer

Differential Revision: D58948811

fbshipit-source-id: 979c78ccd4cf5d96f00061049366171934b43ee2
2024-06-24 10:22:38 -07:00
Blake Friedman 2d737bbf9a fix: podfile lock cache keys (#45128)
Summary:
These keys weren't evaluating`hashfiles(...)`.

{F1716603166}

## Changelog: [Internal]

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

Reviewed By: cipolleschi

Differential Revision: D58947839

Pulled By: blakef

fbshipit-source-id: d3c36235387a1c54f637b2b9bf53198bd29226e2
2024-06-24 09:40:43 -07:00
Moti Zilberman 986cf18dd2 Migrate ReactHost / ReactInstanceManager destroy() call sites to use invalidate() (#45082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45082

Changelog: [Android][Breaking] `ReactNativeHost` invalidates the instance manager on `clear()`

Changes `ReactNativeHost.clear()` to invalidate the underlying `ReactInstanceManager`, rather than merely destroying the instance.

This is technically a **breaking change** because the underlying `ReactInstanceManager` may have escaped (via `ReactNativeHost.getReactInstanceManager()`) before the `clear()` call. In my reading of the API and of usages like [this one in Expo](https://github.com/expo/expo/blob/23a905b17065703882ebeda1fc9f65a05cc69fa7/packages/expo-dev-menu-interface/android/src/main/java/expo/interfaces/devmenu/ReactHostWrapper.kt#L117), this should rarely occur in practice.

The plan:
1. D58811090: Add the basic `invalidate()` functionality.
2. **[This diff]**: Add `invalidate()` call sites where it makes sense in core.
3. [Upcoming diff]: Keep the Fusebox debugging target registered until the Host is explicitly invalidated.

Reviewed By: javache

Differential Revision: D58811091

fbshipit-source-id: 5dfebad46a2bdf3601642b3c3fe3e79e8695e193
2024-06-24 09:14:01 -07:00
Moti Zilberman a3db352e25 Add invalidate() method to ReactHost and ReactInstanceManager (#45081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45081

Changelog: [Android][Added] Add `invalidate()` method to ReactHost and ReactInstanceManager

Adds an `invalidate()` method to both `ReactHost` (Bridgeless) and `ReactInstanceManager` (Bridge). This method is an *optional* signal that the application is about to permanently stop using the Host, and that the Host can therefore fully clean up any resources it's holding.

Reusing a Host after it's invalidated is illegal and will trigger a Java assertion.

The plan:
1. **[This diff]**: Add the basic `invalidate()` functionality.
2. [Upcoming diff]: Add `invalidate()` call sites where it makes sense in core
3. [Upcoming diff]: Keep the Fusebox debugging target registered until the Host is explicitly invalidated.

Reviewed By: tdn120

Differential Revision: D58811090

fbshipit-source-id: 79b607dcc74de38b85fc0ebb4c640b9654595c9a
2024-06-24 09:14:01 -07:00
Jorge Cabiedes Acosta d11a7b0d18 Add DropShadow effect on Android (#44937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44937

Continuing CSS filters support efforts for Android this diff implements support for dropShadow.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D58488573

fbshipit-source-id: 393e43ba1e24705d8f1fc4ba3df8e12272d874b3
2024-06-24 08:45:51 -07:00
Jorge Cabiedes Acosta b56ce9d35b JS plumbing to get dropShadow into native (#44939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44939

DropShadow is a filter so we need to add the logic for sending it to native through the same process function for the other filters.

Drop shadow can have more arguments than the other filters. I'm following a similar pattern to boxShadow D57872933.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D58370127

fbshipit-source-id: dba06bb2e0ea2799d20e8b0b9065a5729df22bb6
2024-06-24 08:45:51 -07:00
Blake Friedman 9ba600c066 chore: remove lockfile from Helloworld (#45135)
Summary:
Accidentally shipped, removing.

## Changelog: [Internal]

<!-- 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/45135

Reviewed By: christophpurrer

Differential Revision: D58950410

Pulled By: blakef

fbshipit-source-id: 7bda7278f918a1e50c25f86e461e19fe7e176c5c
2024-06-24 08:08:11 -07:00
Nicola Corti 61b3c95b45 Bump CLI to 14 alpha9 (#45121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45121

As the title says

Changelog:
[Internal] [Changed] - Bump CLI to 14 alpha9

Reviewed By: cipolleschi, blakef

Differential Revision: D58945983

fbshipit-source-id: 227b56bb0441a60ce247524ac8361e5eb8674c3c
2024-06-24 06:51:29 -07:00
Riccardo Cipolleschi 42735717b5 Fix Cache checks in build_hermes_macos (#45127)
Summary:
The cache checks in GHA were performed against bool values, while the actual values are strings.
So the checks were always failing and all the steps were executed, even when not necessary.

The reason why it was failing is because, with this setup, when a cache is hit, some steps were skipped in previous jobs, making following jobs trying to execute code on not-existing files.

## Changelog:
[Internal] - Fix cache for build_hermes_macos

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

Test Plan: GHA are green again

Reviewed By: blakef

Differential Revision: D58947838

Pulled By: cipolleschi

fbshipit-source-id: 8dba216e72a3034fd4c1484418d37bfb78cf314d
2024-06-24 05:54:30 -07:00
Nick Lefever 72ce6ff03a Fix runtime shadow node reference corruption on measure (#45116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45116

Changelog: [Internal]

The UIManagerBinding `findShadowNodeByTag_DEPRECATED` method returns a shadow node and was updating the runtime reference on the shadow node with the created wrapper for the return value.

The JSObject holding the wrapper would get deallocated, which would deallocate the wrapper stored on the shadow node.

This would cause crashes on the next reference update for the shadow node, due to the shared_ptr being reassigned with the new value while it was already deallocated.

The `sendAccessibilityEvent` function calls `findShadowNodeByTag_DEPRECATED` to get the shadow node referenced by the provided react tag, which could lead to runtime shadow node reference corruption.

Reviewed By: sammy-SC

Differential Revision: D58920296

fbshipit-source-id: ddb9ed0ee64bc01934aabde7070731dc53a2db70
2024-06-24 05:20:42 -07:00
Oskar Kwaśniewski 6bb75c7b13 fix: set proper framework dependencies for built-in pods (#45104)
Summary:
Platforms like visionOS require explicit framework dependencies to be set in pods to build properly. For some reason linking on visionOS is more strict than on iOS but this might change in some future OS versions so it's good to have pods having exact dependencies.

I've discussed that earlier with Saadnajmi and cipolleschi. Let me know if you are okay with this change.

## Changelog:

[IOS] [FIXED] - set proper framework dependencies for built-in pods

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

Test Plan: CI Green

Reviewed By: dmytrorykun

Differential Revision: D58943593

Pulled By: cipolleschi

fbshipit-source-id: 3d2df4f3bbdf36704e09f5e39bfb838b2e0f3c99
2024-06-24 03:14:55 -07:00
Panos Vekris f7fe68861a set one_sided_type_guards=true in fbsource (#45107)
Summary:
This diff enables:
1.  [one-sided type guards](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) (`implies x is T`), and
2. stricter checking of type guard consistency (see [relevant docs page](https://flow.org/en/docs/types/type-guards/#toc-consistency-checks-of-type-guard-functions)).

To prevent many new errors from being introduced this diff also converts some two-sided type guards to [one-sided](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) ones.

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

Updated the flowconfigs and synced flow_runner/codemods since the change has already been applied there:
```
js1 upgrade www-shared -p flow_runner/codemods
```

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D58874409

fbshipit-source-id: 959a6773701518a1d6aa35e2ec28fd4ce12d2e75
2024-06-21 16:15:34 -07:00
Benoit Girard 8a6508c623 Increase the buffer size and try kStall to avoid dropping samples (#45111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45111

Spent time debugging this issue today:
https://fb.workplace.com/groups/1700234700326965/posts/2197109080639522

The problem is described here:
https://perfetto.dev/docs/concepts/buffers

But basically we're writing too much data, too fast and the traced process can't read it fast enough. Perfetto is doing data drop.

This diff tries to use the `kStall` mode. It doesn't seem to do much but I'll leave it in for now because it shouldn't hurt too much. It's designed for our use case.

The main fix comes from increasing the buffer size to 20MB. Since it's not on by default I think it's fine to have a really large buffer for now to unblock tracing.

Reviewed By: javache

Differential Revision: D58832598

fbshipit-source-id: 101b364e2e9e28aa6a041ded1df82d5fec1f42e1
2024-06-21 13:31:55 -07:00
Oskar Kwaśniewski 34cd195d9f fix: retrieve statusbar size using RCTUIStatusBarManager (#45103)
Summary:
This PR changes the call from `RCTSharedApplication()` to retrieve the status bar size using the `RCTUIStatusBarManager()` method, a way which supports multi-window apps.

## Changelog:

[IOS] [FIXED] - Retrieve status bar size using RCTUIStatusBarManager

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

Test Plan: Check if the perf menu pops up in the correct spot.

Reviewed By: javache

Differential Revision: D58868503

Pulled By: cipolleschi

fbshipit-source-id: db5fc80a712a8a18a2863cdfbbe44f48bafe9fc3
2024-06-21 08:27:50 -07:00
Rubén Norte a8a76f9bfa Improve profiling information for timers (#45091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45091

Changelog: [internal]

We're currently logging when we execute timers in Systrace/Perfetto, but we have no information about them whatsoever.

This adds some additional information:
  * What kind of timer it is
  * It's ID
  * And most importantly, when it was created (including the ID as well).

This allows us to know where was a specific timer scheduled and with what API.

Reviewed By: bgirard

Differential Revision: D58832112

fbshipit-source-id: 1bc11759b6c8296acf63ff3533ca1dc3428360a7
2024-06-21 05:13:20 -07:00
Rubén Norte fdf0183831 Stop defining setImmediate and clearImmediate from TimerManager when using microtasks (#45090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45090

Changelog: [internal]

The definition of these methods is redundant when using microtasks, so it's better to avoid defining them in the first place (to also detect issues if the setup is not what we expect).

Reviewed By: sammy-SC

Differential Revision: D58816582

fbshipit-source-id: dd1b07f8b11069605e3184b1272a9bbc3b44ca75
2024-06-21 05:13:20 -07:00
Irfanwani 1bec961c95 fix: post install error in iOS after running pod install, undefined method 'path' for nil:NilClass (#45095)
Summary:
After upgrading my project to the latest version of react native i.e, 0.74.2, i was getting an error when running `pod install` an the error was coming from the post install hook. Going deeper into the file tree, i found that some of the things are Nil and react native is trying to use some methods on them, so fixed those issues by using chaining operators to conditionally apply the path method on them.

## Changelog:

[Internal] - fixes the post install issue when running pod install with react native version, 0.74.2

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

Test Plan: Manually tested the fix. Works perfectly fine in both debug and production mode.

Reviewed By: cortinico

Differential Revision: D58863666

Pulled By: cipolleschi

fbshipit-source-id: 64459711dcf926b7544b99b542e9861c1c0f05ca
2024-06-21 04:36:01 -07:00
Oskar Kwaśniewski a7b2555644 feat: remove upper limit for Cocoapods version (allow for 1.15.2) (#45099)
Summary:
This PR uses a suggested solution from here: https://github.com/facebook/react-native/issues/42698 to allow users to use Cocoapods 1.15.2 which fixed issues regarding RN builds.

## Changelog:

[IOS] [FIXED] - Bump cocoapods version to 1.15.2 excluding 1.15.0, 1.15.1

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

Test Plan: CI Green

Reviewed By: blakef

Differential Revision: D58863685

Pulled By: cipolleschi

fbshipit-source-id: 0128eb0cbf83e4a3d35addbae4c31e349775688c
2024-06-21 04:12:26 -07:00
Nicola Corti e7d1708701 Fix broken unableToAddHandledRootView (#45101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45101

This test broke after I merged
https://github.com/facebook/react-native/pull/34785
yesterday.

Just fixing it in a similar way as the test above.

Changelog:
[Internal] [Changed] - Fix broken unableToAddHandledRootView

Reviewed By: rubennorte, blakef

Differential Revision: D58864166

fbshipit-source-id: 4f48dbfd5238a2811564ce02199af7fc284d39b4
2024-06-21 03:41:40 -07:00
Nicola Corti 15909fab95 packages/react-native-gradle-plugin/ -> packages/gradle-plugin/ (#44832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44832

I'm renaming this folder as now we have 2 gradle plugins + we currently have
`package/react-native-gradle-plugin/react-native-gradle-plugin/` which is confusing so we can just call this folder `packages/gradle-plugin/`
to be consistent with the NPM package name

Changelog:
[Internal] [Changed] - packages/react-native-gradle-plugin/ -> packages/gradle-plugin/

Reviewed By: blakef

Differential Revision: D58284883

fbshipit-source-id: 5a7bb40a5d80f6fbab4ffb29e44107453f1013ec
2024-06-21 01:08:00 -07:00
psionic12 3429dc1ccf Log a SoftException on SurfaceMountingManager.addRootView (#34785)
Summary:
Follow the same solution (do not throw a crash when view ID is set already) used in `ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java` for `ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java`

## Changelog

[Android] [Changed] - Log a SoftException on SurfaceMountingManager.addRootView

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

Test Plan: None

Reviewed By: cipolleschi

Differential Revision: D40022263

Pulled By: cortinico

fbshipit-source-id: d565d2831e2833ccea55f28ea16083b7bae0ed32
2024-06-20 13:16:32 -07:00
Blake Friedman 3dcf86b802 Update @react-native-community/cli to 14.0.0-alpha.7 (#45086)
Summary:
RN CLI to 14.0.0-alpha.7

## Changelog:
[General][Changed] RN CLI to 14.0.0-alpha.7

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

Test Plan:
```
yarn
```

Reviewed By: cortinico

Differential Revision: D58819145

Pulled By: blakef

fbshipit-source-id: 025f190908c52afd3f1055a665986fea4785e192
2024-06-20 11:48:18 -07:00
Jakub Piasecki 2eaf0b0848 Add an overload for createLayout to reduce code duplication (#45083)
Summary:
Adds an overload for `createLayout` method that also handles extracting paragraph attributes and scaling font size if necessary.

## Changelog:

[ANDROID] [CHANGED] - Extracted common parts related to calculating text layout to a helper

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

Test Plan: Tried out on RNTester

Reviewed By: robhogan

Differential Revision: D58818560

Pulled By: cortinico

fbshipit-source-id: a42b5de04c4a70edb88cdd734387d7e4cee94032
2024-06-20 11:09:15 -07:00
Nicola Corti 8a6b88eeaf Back out "Add Float and Int type support for Android modules" (#45087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45087

Original commit changeset: 32b3bbdf5fd2

Fixes https://github.com/facebook/react-native/issues/44963
Closes https://github.com/facebook/react-native/pull/45024

Original Phabricator Diff: D52420921

Changelog:
[Internal] [Changed] - Back out "[RN][Codegen]Add Float and Int type support for Android  modules"

Reviewed By: dmytrorykun

Differential Revision: D58820544

fbshipit-source-id: 59cd0e7cc17a681785c57b5ce1a9d50d28a348af
2024-06-20 11:06:46 -07:00
Alan Lee 8a3ffb6d23 fix TextInput 'contextMenuHidden' prop (#45014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45014

`TextInput`'s `contextMenuHidden` prop isn't working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Reference: [Android doc](https://developer.android.com/reference/android/widget/TextView#setCustomSelectionActionModeCallback(android.view.ActionMode.Callback))
> Returning false from `ActionMode.Callback.onCreateActionMode(ActionMode, android.view.Menu)` will prevent the action mode from being started.

**Changelog:** [Android][Fixed] - TextInput's `contextMenuHidden` prop bug fix

Reviewed By: javache

Differential Revision: D58684366

fbshipit-source-id: 328c267ed0e896a78e114578e3a00adf41f2e095
2024-06-20 10:38:58 -07:00
Riccardo Cipolleschi 75451d5b89 Fix yml syntax on main (#45084)
Summary:
While landing a change on GH, I forget to remove one line that does not belong to an action

## Changelog:
[Internal] - CI fix

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

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D58817768

Pulled By: cipolleschi

fbshipit-source-id: 5fc02d2d2a19dd3fe2202c93d0d1873e5dda4b82
2024-06-20 07:49:52 -07:00
Riccardo Cipolleschi 9c6c637816 Refactor Hermes workspace (#45071)
Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

## Changelog:
[Internal] - Factor out the prepare_hermes_workspace action

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

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
2024-06-20 06:50:23 -07:00
Pieter De Baets 2e6f105ef3 Pass EventDispatcher listeners by value (#45077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45077

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D58791938

fbshipit-source-id: 079fbfad4dd309a41c360e1bdb93e56f8793e6b3
2024-06-20 06:15:11 -07:00
Pieter De Baets a2cb34371e Handle textAlignment: start and make logs consistent (#45076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45076

> **start**: The same as left if direction is left-to-right and right if direction is right-to-left.

This is equivalent to `auto`, which is not actually a valid CSS value.

Changelog: [General][Added] Add support for `texAlignment: 'start'`

Reviewed By: sammy-SC

Differential Revision: D58791937

fbshipit-source-id: 09622d814212a7055f94b1f091c71edae5db117c
2024-06-20 06:15:11 -07:00
Nicola Corti a297b30377 Bump reactnativecommunity/react-native-android to 13.1 (#45073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45073

We can also remove the workaround needed for git `safe.directory`
as this is now configured inside the container as `*`

Changelog:
[Internal] [Changed] - Bump reactnativecommunity/react-native-android to 13.1

Reviewed By: blakef

Differential Revision: D58789791

fbshipit-source-id: f44163a0aa822b19e0dd1106d3f039fd0dc83186
2024-06-20 06:04:45 -07:00
Riccardo Cipolleschi ea31a79fe9 Fix build_android by setting git safe folders (#45065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45065

This fix makes sure that Android runner can run git commands.
This is porting in main the commit https://github.com/facebook/react-native/commit/fee215664287ddca31c8400c87a825c8e9822290

## Changelog
[Internal] - Make the build_android run git commands

Reviewed By: cortinico

Differential Revision: D58782969

fbshipit-source-id: ab35f7e3d1733ab770f2a397552daa1ec7c13cf7
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi 710b0e64ab Port fixes to release scripts to use GITHUB_REF and GITHUB_REF_NAME variables (#45066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45066

This changes ports in main the fixes we had to make to the release scripts to run properly in release mode.

This includes the commits:

* https://github.com/facebook/react-native/commit/375c88478c985976e1b59dfa7353042a18b4d132
* https://github.com/facebook/react-native/commit/609c7c05b13214f2a834b251de095243f8dcbf68
* https://github.com/facebook/react-native/pull/45062

## Changelog:
[Internal] - Fix release scripts to run properly in release mode

Reviewed By: cortinico

Differential Revision: D58782925

fbshipit-source-id: b096909d5f8281809ee3c2a01eefda1d19f32936
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi 90d4d55122 Port Create Release fixes from Stable to main (#45063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45063

While doing the release of 0.75, we have to fix the Create Release action a few times to get it right.
This change contains the fixes from
* https://github.com/facebook/react-native/commit/e36b46f0c970dc3f1f5b5058a8d10834acdb2667
* https://github.com/facebook/react-native/commit/1b891357b2f1995f2344cc991be423ca66fa6770
* https://github.com/facebook/react-native/commit/56e1c8bfdd57600e79c0b17de1d2fd933d20b8f9
* https://github.com/facebook/react-native/commit/03591318fbabdc0c06808316f471cc361b53c57f
* https://github.com/facebook/react-native/commit/528097709aeef434b0d85565bfd89a4a9ff5644e
* https://github.com/facebook/react-native/commit/f4b1dd1fa11374cae8a696833ad9ded0767cba8f

## Changelog
[Internal] - Backport changes to Create Release github action

Reviewed By: cortinico

Differential Revision: D58782391

fbshipit-source-id: b68088fb8c4290efcb4599d1b090b18e401e4b66
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi b04d0d0c8c Port Update the testing script to run with the community template (#45064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45064

This changes port back in main the changes we made in the Stable branch with https://github.com/facebook/react-native/commit/b236f9bd82374e5cf92e1ad622bba3b14f948a04

## Changelog:
[Internal] - Update release testing to work with the new template

Reviewed By: cortinico

Differential Revision: D58782241

fbshipit-source-id: be9f6d4310d3a83e6cc0df4bb690c746229c7ae3
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi bb886d751f Improve test stability in CI (#45070)
Summary:
This change splits the build step and the test step for running the test on iOS, so we can introduce a retry for the test only.
We are doing that because we have seen some flakyness in CI jobs as sometimes the simulator fails to install the app.

## Changelog:
[Internal] - Add retry to iOS tests

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

Test Plan: Testing in CircleCI

Reviewed By: cortinico

Differential Revision: D58786706

Pulled By: cipolleschi

fbshipit-source-id: 61363cb86dd1a496d3595b43b6331cbee7f032ea
2024-06-20 03:13:13 -07:00
Edmond Chui e5c7eb57e2 Update debugger-frontend from f7e972c...750ed14 (#45074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45074

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

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

Reviewed By: vzaidman

Differential Revision: D58790390

fbshipit-source-id: b6b15ecbd521cdb231aa9d21135aacc39f31a425
2024-06-20 02:46:03 -07:00
Rob Hogan 2a6a895b17 Debugger: j opens debugger on most recently connected target (#45060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45060

Currently, `j`, (i.e., `/open-debugger` with no parameters), connects the "first available" target, which in practice is the first page of the first connected device still connected.

In the absence of a target selection UI, a better guess at user intent is to use the *latest* target (most recently added page of most recently connected device).

Also slightly reduces CLI noise by not claiming that we're launching a debugger when there's no target, and not qualifying which target when there's only one.

Changelog:
[General][Changed] Debugger: `j` opens most recent (not first) target.

Reviewed By: huntie

Differential Revision: D58736151

fbshipit-source-id: 3d106a1fa958f9e5c91b16e04075609e1abf6e97
2024-06-19 11:28:36 -07:00
Rob Hogan 53951d7fec Debugger: Make /json/list ordered (#45069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45069

Currently, `/json/list` returns pages within each device in the iteration order of a C++ `unordered_map`, which doesn't tell us anything useful. Page IDs happen to be sequential, but only as an implementation detail.

Change this contract so that we guarantee ordering reflects addition order, allowing clients to consistently select e.g. most recently added page for a given device.

The implementation of this is as simple as switching from an `unordered_map` to a key-ordered`map`, because we already assign keys (page IDs) with an incrementing integer. Within the inspector proxy, devices already use an insertion (connection)-ordered JS `Map`, so we just document this guarantee.

Changelog:
[General][Changed] Debugger: Make `/json/list` return connection-addition-ordered targets.

Reviewed By: huntie

Differential Revision: D58735947

fbshipit-source-id: 7a132cc5e750475792a2b845afc9a42424690bf1
2024-06-19 11:28:36 -07:00
Benoit Girard 30087a6e00 Introduce FuseboxTracer for DevTools tracing (#44840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44840

Changelog: [Internal]

Introduce a simplified and minimal tracing backend for Fusebox. This backend is sufficient to implement a pretty usable performance panel.

Although the more I see how easy this is and how annoying working with Perfetto is, the more I think we should just maintain this going forward. Anyways we can figure that out incrementally. For now the plan is still for this to be temporary.

Reviewed By: motiz88

Differential Revision: D57981944

fbshipit-source-id: b3d8c6e8c5a18311bbe98254f8ddf3810fa1334b
2024-06-19 10:11:14 -07:00
Samuel Susla 82325b4260 use feature flag in render function for optimized text (#45068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45068

changelog: [internal]

In D58672844 I added gating to module.exports.

This gating is sensitive to when feature flags are initialised and causes test failures and regressions for developers. Let's move the feature flag check to component's render function. It introduces extra spread operator but it is good enough to compare new and old <Text /> component.

Reviewed By: GijsWeterings

Differential Revision: D58783941

fbshipit-source-id: f89f4f48e6aeb774ed4a84483a9f4ad59d5bc045
2024-06-19 10:06:15 -07:00
Pieter De Baets 51e464f50f Remove unnecessary synchronized collections from ReactHostImpl (#45026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45026

All callsites for these containers already explicitly synchronize using these objects, so there's no need to use a synchronized collection wrapper here.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D58724044

fbshipit-source-id: 5151ebb0ceda8656b6039d9984cc32a843051abd
2024-06-19 05:05:00 -07:00
Pieter De Baets 9b67547bec Remove enableArchitectureIndicator from AppRegistry API (#45025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45025

This API just passed through the `enableArchitectureIndicator` prop to a custom WrapperComponent, as there is no default consumer of it. Instead, each provider of a custom WrapperComponent can capture the required value of itself.

Changelog: [General][Removed] Removed enableArchitectureIndicator API which is only used internally.

Reviewed By: cortinico

Differential Revision: D58723922

fbshipit-source-id: 0c52a904424382f33caab92ac50b316ae161f877
2024-06-19 05:05:00 -07:00
Blake Friedman 927815b9f6 use correct has to label hermes cache key (#45061)
Summary:
This incorrectly used the SHA from facebook/react-native instead of
facebook/hermes to label the hermes cache key. This would bloat our
cache by ~ 1.2GB for each PR.

Changelog: [Internal]

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

Test Plan: We should remove the existing entries for v4-hermes and track the growth over time.

Reviewed By: cipolleschi

Differential Revision: D58780475

Pulled By: blakef

fbshipit-source-id: 0f192faa287f53154f1c8319be6783820d614018
2024-06-19 05:00:41 -07:00
Samuel Susla 0c2fea5c23 fix syntax error (#45058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45058

changelog: [internal]

Fix github action failure:

```
TransformError [SyntaxError]: /__w/react-native/react-native/packages/react-native/Libraries/Text/Text.js: Missing semicolon. (345:1)

  343 |     ? require('./TextOptimized')
  344 |     : Text
> 345 | ) as typeof Text;
```

Reviewed By: fabriziocucci

Differential Revision: D58779125

fbshipit-source-id: 76917aebf8ae8cfb9f2aa7a75a76383c5a832732
2024-06-19 04:59:02 -07:00
Rubén Norte 58ff2fc636 Make the instructions to regenerate feature flags easier to see in the docs (#45059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45059

Changelog: [internal]

By moving the command to a code block it's going to be easier to see it when quickly reading the README.

Reviewed By: cortinico

Differential Revision: D58779883

fbshipit-source-id: e912a58641245c6d7dc158f7af0a722e438a0cc3
2024-06-19 04:13:38 -07:00
Samuel Susla 2f0c06de10 setup gating for <TextOptimized /> (#45031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45031

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D58672844

fbshipit-source-id: 2c99d3b66665c8dc0b796713b21d91211b469d81
2024-06-18 16:23:45 -07:00
Jorge Cabiedes Acosta d8739e1d37 Add unit tests for BorderRadiusStyle (#44964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44964

Testing property priority and correct setting percentages for business logic of `BorderRadiusStyle.kt`

To prevent issues like the one fixed by D57473482

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D58705515

fbshipit-source-id: 74e9a68fc0e3d1e88b8eebbb34a1ca8c29052c21
2024-06-18 10:46:23 -07:00
Nicola Corti 3fc6963da3 Fix release regex for publish-release workflow (#45043)
Summary:
The existing regex is not workign. I've split it in two and tested it against a private repo.

## Changelog:

[INTERNAL] - Fix release regex for publish-release workflow

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

Test Plan: Tested on privare repo with GHA

Reviewed By: cipolleschi

Differential Revision: D58736292

Pulled By: cortinico

fbshipit-source-id: f07ef32dcb0059922100c555f7894bbf0c7dd8f6
2024-06-18 10:09:29 -07:00
Moti Zilberman e0fcf2983a Use hermes-parser when building Node packages (#45041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45041

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D58734657

fbshipit-source-id: d5b17bc0ee8f36bae7c594d99ce70ecea9bf4a40
2024-06-18 09:43:20 -07:00
Moti Zilberman e55ea2daf1 Fix debugger handoff logic to prevent "zombie" state (#45035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45035

Changelog: [General][Fixed] Avoid a zombie state when opening a second debugger frontend concurrently.

The problem here was that we were sending proxy-protocol messages to the device in the wrong order (`disconnect` *after* `connect`):

 {F1701266597}

The root cause was that we were depending on the outgoing debugger socket's async `close` event to trigger sending the `disconnect` message to the device. This would happen after we'd already (synchronously) sent the `connect` message.

With this diff, we send the `disconnect` message synchronously with calling `close()` on the debugger socket, which fixes the ordering problem at the source. To avoid sending duplicate `disconnect` messages (e.g. one before calling `close()` and one from the `close` event handler), we store some extra state on `Device` (`#connectedPageIds`).

Reviewed By: robhogan, huntie

Differential Revision: D58730634

fbshipit-source-id: 0f54af2e4f8071a8f6d97cc9e3d8a4ea89a46f43
2024-06-18 09:39:35 -07:00
Moti Zilberman 9cca4c1ec1 Add test for connecting multiple debuggers to a single page, reproing "zombie" state (#45034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45034

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D58728261

fbshipit-source-id: 32d4b05d69f88e68b5327dc5c8e837291e3d7726
2024-06-18 09:39:35 -07:00
Moti Zilberman 6695b6e3b8 Reuse Device instances when handing off connections based on device ID (#45027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45027

Changelog: [Internal]

Changes the device ID collision handling logic to reuse `Device` instances instead of creating new ones. This enables further refactoring of `Device` to improve session state isolation.

Reviewed By: hoxyq

Differential Revision: D58724884

fbshipit-source-id: bc11ce45ce8c80c58c32dcd1b07b28f1d1753a62
2024-06-18 09:39:35 -07:00
Riccardo Cipolleschi 4ecc165029 remove publishing jobs from cci (#45040)
Summary:
We are moving to publish from gha so we need to remove these jobs

## Changelog:

[Internal] - Remove old publishing jobs from CI

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

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D58734881

Pulled By: cipolleschi

fbshipit-source-id: 5981bfcf2aa51d55d54d08556631b30b6102a7cd
2024-06-18 09:20:30 -07:00
Nicola Corti a272e8ee66 Remove unused rn-tester e2e tests (#45032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45032

Those tests haven't been running since ~1 year now.
I know it's not ideal but I'd rather remove them instead of keeping them around not executing.
We can still revert them back from the history once we decide to revive the E2E testing effort.

Changelog:
[Internal] [Changed] - Remove unused rn-tester e2e tests

Reviewed By: cipolleschi

Differential Revision: D58729123

fbshipit-source-id: f0f47e3c2e087141fdff506b7c5c9b460263721b
2024-06-18 09:06:42 -07:00
2180 changed files with 141590 additions and 103282 deletions
+2 -170
View File
@@ -1,172 +1,4 @@
# Circle CI
This directory is home to the Circle CI configuration files. Circle is our continuous integration service provider. You can see the overall status of React Native's builds at https://circleci.com/gh/facebook/react-native
You may also see an individual PR's build status by scrolling down to the Checks section in the PR.
## Purposes
We use CircleCI for mainly 3 purposes:
1. Testing changes
2. Release Nightlies
3. Release Stable Versions of React Native
When testing changes, we run all the tests on commits that lands on `main`. For commits in PR, we try to understand which kind of changes the PR is about and we try to selectively run only the relevant tests. so, for example, if a PR only touches iOS files, we are going to run only iOS tests.
A Nighly job runs every day at around 9:00 PM, GMT. They run from `main` and they publish a version of React Native using the current state of the codebase, creating a version number that follows the format: `0.<current-version+1>.0-nightly-<YYYYMMDD>-<short-commit-hash>`.
The nightly job also publish all the monorepo packages, taking care of updating the transitive dependencies of those packages.
Stable versions are released manually by the Release Crew and they run from a stable branch. Stable branches have the shape of `0.<version>-stable`.
## How It Works?
CircleCI execution is now split in two steps:
- Setup
- Testing
The setup step takes care of analyzing the changes in the PR and of deciding which jobs needs to run.
The testing flow is a set of workflows that executes the required tests.
### Setup
The code of the setup workflow lives in the root [`config.yml`](https://github.com/facebook/react-native/blob/main/.circleci/config.yml) file.
It uses the `Continuation orb` from CircleCI to start a CI flow that depends on the changes present in the PR.
If the changes are not coming from a PR (either a simple commit or if the CI is running on main) **we always run all the tests** as a cautionary measure.
The setup job has also to expose all the pipeline parameters that we would need to pass to the actual workflow. Those parameters are **automatically forwarded** to the workflows that are started as a result of the setup.
The setup job uses a JS script to carry on its logic. The [`pipeline_selection.js`](https://github.com/facebook/react-native/blob/main/scripts/circleci/pipeline_selection.js) script can be invoked with two commands:
- `filter-jobs`
- `create-configs`
The **`filter-jobs`** command takes care of creating a JSON representation of the tests we need to run based on the changes in the PR.
The **`create-configs`** command consumes the JSON representation to create a CircleCI configuration that can then executes all the required tests.
#### Creating a Configuration
To create a configuration, the `pipeline-selection` scripts collates together various pieces of `YML` files that lives in the [`Configurations` folder](https://github.com/facebook/react-native/tree/main/.circleci/configurations).
The order in which these files are appended is **important** and it always contains the following.:
1. `top_level.yml`: this file contains some high level directives for CircleCI, like the version, the list of orbs, the cache-keys, and the pipeline parameters that can be used by the workflows.
2. `executors.yml`: this file contains the list of the executors used in our jobs and their configurations.
3. `commands.yml`: this file contains all the commands that can be used by jobs to executes. Commands are reusable functions that are shared by multiple jobs.
4. `jobs.yml`: this file contains the jobs that are used by workflows to carry on some specific tasks. They are composed of sequential commands.
5. `workflows.yml`: this file contains the shared workflows that needs to (or can) be always executed, no matter which kind of changes are pushed to CI. An example of these workflows is `analysis` (which is always executed) or `nightly` (which can be executed if a specific pipeline parameter is passed to the CI).
Then, the `pipeline_selection create-configs` attach some specific test workflows, depending on the changes that are present in the PR. These change-dependent workflows live in the [`test_workflows`](https://github.com/facebook/react-native/tree/main/.circleci/configurations/test_workflows) folder.
These workflows are:
* `testAll.yml` => runs all the possible tests. This workflow is executed on main and on PRs which change set touches both iOS and Android
* `testAndroid.yml` => runs all the build steps and Android tests. This is used on changes that happens on the Android codebase and infra (`ReactAndroid` folder)
* `testIOS.yml` => runs all the build steps and iOS tests. This is used on changes that happens on the iOS codebase and infra (`React` folder)
* `testE2E.yml` => runs the E2E tests. As of today, E2E tests can be triggered if the commit message contains the `#run-e2e-tests` tag.
* `testJS.yml` => For all the changes that do not touch native/platform code, we only run JS tests.
Notice that if there are changes on files that do not represents code (for example `.md` files like this one or the `Changelog`) we don't run any CI.
## Test workflows
The test workflows for native code are composed of 2 parts:
- building React Native
- testing
Building React Native requires us to build several parts of it:
1. We need to build the Hermes JS engine
2. We need to build Android to create prebuilds
3. We need to package everything in an npm package that will mimic a React native release
4. We need to create a local maven repository
### Building Hermes Engine
#### Android
The `build_android` workflows takes care of building the Android version of Hermes and to put it properly in a local maven repository.
See the [Build Android](#build_android) section below.
#### iOS
Hermes is a very complicated item to build for iOS.
It is composed of the Hermes compiler (HermesC) and of the actual engine.
Hermes is shipped as a universal XCFramework. This means that we need to build all the architecture slices and then put them together in the XCFramework archive.
We also need to build 2 configurations: Debug and Release.
In order to be efficient and to save costs, we parallelize the process as much as possible:
1. We prepare the environment for building Hermes.
2. We build HermesC which is required by all the slices.
3. We start 8 jobs to build all the required slices in parallel:
1. `iphone` slice, Debug mode
1. `iphonesimulator` slice, Debug mode
1. `macos` slice, Debug mode
1. `catalyst` slice, Debug mode
1. `iphone` slice, Release mode
1. `iphonesimulator` slice, Release mode
1. `macos` slice, Release mode
1. `catalyst` slice, Release mode
4. We then have 2 jobs to create the Debug and Release tarballs in parallel.
1. The Debug job receives the 4 Debug slices
1. The Release job receives the 4 Release slices
The `Debug` and `Release` tarball are then uploaded as artifacts. Notice that these we use these artifacts to **test the release** of React Native.
While building Hermes, we take also care of building the dSYMs. A dSYM (Debug Symbols) is an archive that contains the Debug Symbols that users can load to de-symbolicate the Hermes Stack traces. These symbols are published when we create a React Native release.
A lot of these build steps are automated by some shell scripts that lives in the [`react-native/packages/react-native/sdks/hermes-engine/utils` folder](https://github.com/facebook/react-native/tree/main/packages/react-native/sdks/hermes-engine/utils).
### Build Android
The android build is all managed by Gradle, so building android should be as easy as calling a [`gradle` command](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L268-L274).
The relevant part here is that the build android generates a `maven-local` repository that is passed to the [`build_npm_package`](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L1182) and that we use to test the releases.
### Build NPM package
This job is the responsible to create an NPM package that is suitable to be released or tested in CI.
If we are in a release flow (for example the Nightly workflow), it also proceed with the publication.
The job can be invoked with different parameters:
- `dry-run` => it does not publish anything, but prepare the artifacts to be used for testing
- `nightly` => it creates the artifacts and publish a nightly version of React Native.
- `release` => it creates the artifacts and publish a stable version of React Native.
The build NPM package takes all the artifacts produced in the previous steps (iOS' Hermes, iOS' Hermes dSYMs, Android's `maven-local`) and creates an npm package packing all the code.
If in a release mode, it also proceed publishing the NPM package to NPM, and the artifacts to Maven central, which we use to distribute all the artifacts.
This job also uploads the `maven-local` repository and a zipped version of the npm package to CircleCI's artifacts. We use these artifacts to **test the release** of React Native.
## Testing React Native
React Native tests runs in two different scenarios:
- RNTester
- A New App
### RNTester
RNTester is our internal testing app. It is a fully working React Native app that lives in the [`react-native/packages/rn-tester` folder](https://github.com/facebook/react-native/tree/main/packages/rn-tester) of the repository.
RNTester is an app which contains code that exercise most part of the React Native frameworks.
It also has the feature of building React Native **from source**. For that reason, it does not have to wait for the NPM package to be ready, but RNTester's tests can start as soon as the `build_android` step and the step that builds Hermes for iOS are done.
Notice the Tests on RNTester for iOS consumes the Hermes engine that is built in the previous steps.
For Android, these tests creates an APK that is uploaded as an artifact in CircleCI. We use these artifacts to **test the releases** of React Native..
### A New App
The React Native repo contains a template app in the [`react-native/packages/react-native/template` folder]() that is used to spin up a new application that is preconfigured with React Native.
We have several tests that we run starting from the template, testing various configurations:
- Debug/Release
- JSC/Hermes (two different JS engine we support)
- New/Old Architecture (two different Architectures for React Native)
We want to test all the React Native changes against the template, but we can't publish a React native version on each change that is merged. Therefore, to run tests on the template we use a NPM registry proxy called [Verdaccio](https://verdaccio.org/).
When running a Template test our CI follows roughly these steps:
1. Prepare the executor
2. Start a Verdaccio server
3. Publish on Verdaccio all the monorepo [packages](https://github.com/facebook/react-native/tree/main/packages) on which React Native depends on.
4. Publish on Verdaccio the react-native NPM package that has been created in the NPM step
5. Spin up a new React native apps from the template, downloading react-native from Verdaccio.
In this way, we are sure that we can test all the changes that happen in React Native on a new React Native app.
This directory was home to the Circle CI configuration files.
In July 2024 we moved to GitHub Actions, and week this folder for backward compatibility, as we want to keep on using Circle CI for the release of React Native <= 0.74.
+7 -108
View File
@@ -1,114 +1,13 @@
version: 2.1
# this allows you to use CircleCI's dynamic configuration feature
setup: true
orbs:
continuation: circleci/continuation@1.0.0
parameters:
# Real pipelines parameters
run_release_workflow:
default: false
type: boolean
run_nightly_workflow:
default: false
type: boolean
release_version:
default: ""
type: string
release_monorepo_packages_version:
default: ""
type: string
release_tag:
default: ""
type: string
release_dry_run:
default: false
type: boolean
workflows:
version: 2
stub:
jobs:
- circleci-stub
jobs:
choose_ci_jobs:
circleci-stub:
docker:
- image: debian:bullseye
resource_class: small
steps:
- run:
name: Install Yarn
command: |
apt update
apt install -y wget git curl jq
apt-get update
apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt install -y nodejs
npm install --global yarn
- checkout
- run:
name: Yarn Install
command: yarn install
- when:
condition:
or:
- equal: [ main, << pipeline.git.branch >> ]
- matches:
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
value: << pipeline.git.branch >>
steps:
- run:
name: "[Main or Stable] Create input for config to test everything"
command: |
mkdir -p /tmp/circleci/
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
- when:
condition:
not:
or:
- equal: [ main, << pipeline.git.branch >> ]
- matches:
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
value: << pipeline.git.branch >>
steps:
- run:
name: "[PR Branch] Filter jobs"
command: |
if [[ -z "$CIRCLE_PULL_REQUEST" ]]; then
echo "Not in a PR. Can't filter properly outside a PR. Please open a PR so that we can run the proper CI tests."
echo "For safety, we run all the tests!"
mkdir -p /tmp/circleci/
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
else
PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}"
node ./scripts/circleci/pipeline_selection.js filter-jobs
fi
- run:
name: Create config
description: Generates a configuration on the fly, depending on the files that have been modified
command: |
node ./scripts/circleci/pipeline_selection.js create-configs
- store_artifacts:
path: .circleci/generated_config.yml
destination: generated_config.yml
- continuation/continue:
configuration_path: .circleci/generated_config.yml
# our single workflow, that triggers the setup job defined above
workflows:
always-run:
jobs:
- choose_ci_jobs:
filters:
tags:
only: /.*/
- run: echo "There is nothing here, just an empty job. Everything has been moved to GitHub Action"
-564
View File
@@ -1,564 +0,0 @@
# -------------------------
# COMMANDS
# -------------------------
commands:
# Checkout with cache, on machines that are using Docker the cache is ignored
checkout_code_with_cache:
parameters:
checkout_base_cache_key:
default: *checkout_cache_key
type: string
steps:
- restore_cache:
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
- checkout
- save_cache:
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
paths:
- ".git"
setup_ruby:
parameters:
ruby_version:
default: "2.6.10"
type: string
steps:
- restore_cache:
key: *gems_cache_key
- run:
name: Set Required Ruby
command: echo << parameters.ruby_version >> > /tmp/required_ruby
- restore_cache:
key: *rbenv_cache_key
- run:
name: Install the proper Ruby and run Bundle install
command: |
# Check if rbenv is installed. CircleCI is migrating to rbenv so we may not need to always install it.
if [[ -z "$(command -v rbenv)" ]]; then
brew install rbenv ruby-build
# Load and init rbenv
(rbenv init 2> /dev/null) || true
echo '' >> ~/.bash_profile
echo 'eval "$(rbenv init - bash)"' >> ~/.bash_profile
source ~/.bash_profile
else
echo "rbenv found; Skipping installation"
fi
# Install the right version of ruby
if [[ -z "$(rbenv versions | grep << parameters.ruby_version >>)" ]]; then
# ensure that `ruby-build` can see all the available versions of Ruby
# some PRs received machines in a weird state, this should make the pipelines
# more robust.
brew update && brew upgrade ruby-build
rbenv install << parameters.ruby_version >>
fi
# Set ruby dependencies
rbenv global << parameters.ruby_version >>
if [[ << parameters.ruby_version >> == "2.6.10" ]]; then
# RubyGems 3.0.3.1 breaks Bundler
gem update --system 3.2.3
rbenv rehash
gem install bundler -v 2.4.22
else
rbenv rehash
gem install bundler
fi
bundle check || bundle install --path vendor/bundle --clean
- save_cache:
key: *rbenv_cache_key
paths:
- ~/.rbenv
- save_cache:
key: *gems_cache_key
paths:
- vendor/bundle
run_yarn:
parameters:
yarn_base_cache_key:
default: *yarn_cache_key
type: string
steps:
- restore_cache:
keys:
- << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
- << parameters.yarn_base_cache_key >>-{{ arch }}
- << parameters.yarn_base_cache_key >>
- run:
name: "Yarn: Install Dependencies"
command: |
# Skip yarn install on metro bump commits as the package is not yet
# available on npm
if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
yarn install --non-interactive --cache-folder ~/.cache/yarn
fi
- save_cache:
paths:
- ~/.cache/yarn
key: << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
build_packages:
steps:
- run:
name: Build packages
command: yarn build
brew_install:
parameters:
package:
description: Homebrew package to install
type: string
steps:
- run:
name: "Brew: Install << parameters.package >>"
command: brew install << parameters.package >>
with_rntester_pods_cache_span:
parameters:
steps:
type: steps
steps:
- run:
name: Setup CocoaPods cache
# Copy packages/rn-tester/Podfile.lock since it can be changed by pod install
command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
- restore_cache:
keys:
# The committed lockfile is generated using static libraries and USE_HERMES=1 so it could load an outdated cache if a change
# only affects the frameworks or hermes config. To help prevent this also cache based on the content of Podfile.
- *pods_cache_key
- steps: << parameters.steps >>
- save_cache:
paths:
- packages/rn-tester/Pods
key: *pods_cache_key
with_gradle_cache:
parameters:
steps:
type: steps
steps:
- restore_cache:
keys:
- *gradle_cache_key
- v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-
- v3-gradle-{{ .Environment.CIRCLE_JOB }}-
- v3-gradle-
- steps: << parameters.steps >>
- save_cache:
paths:
- ~/.gradle/caches
- ~/.gradle/wrapper
- packages/react-native/ReactAndroid/build/downloads
- packages/react-native/ReactAndroid/build/third-party-ndk
key: *gradle_cache_key
report_bundle_size:
parameters:
platform:
description: Target platform
type: enum
enum: ["android", "ios"]
steps:
- run:
name: Report size of RNTester.app (analysis-bot)
command: GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
setup_hermes_version:
steps:
- run:
name: Set up Hermes workspace and caching
command: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
cat $HERMES_VERSION_FILE > /tmp/hermes/hermesversion
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo $HERMES_TAG_SHA > /tmp/hermes/hermesversion
fi
cat /tmp/hermes/hermesversion
get_react_native_version:
steps:
- run:
name: Get React Native version
command: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in a file so we can use that file as part of the cache key.
echo "$VERSION" > /tmp/react-native-version
echo "React Native Version is $(cat /tmp/react-native-version)"
HERMES_VERSION="$(cat /tmp/hermes/hermesversion)"
echo "Hermes commit is $HERMES_VERSION"
get_react_native_version_windows:
steps:
- run:
name: Get React Native version on Windows
command: |
$VERSION=cat packages/react-native/package.json | jq -r '.version'
# Save the react native version we are building in a file so we can use that file as part of the cache key.
echo "$VERSION" > /tmp/react-native-version
echo "React Native Version is $(cat /tmp/react-native-version)"
$HERMES_VERSION=cat C:\Users\circleci\project\tmp\hermes\hermesversion
echo "Hermes commit is $HERMES_VERSION"
with_hermes_tarball_cache_span:
parameters:
steps:
type: steps
set_tarball_path:
type: boolean
default: False
flavor:
default: "Debug"
description: The Hermes build type. Must be one of "Debug", "Release".
type: enum
enum: ["Debug", "Release"]
hermes_tarball_artifacts_dir:
type: string
default: *hermes_tarball_artifacts_dir
steps:
- get_react_native_version
- when:
condition:
equal: [ << parameters.flavor >>, "Debug"]
steps:
- restore_cache:
keys:
- *hermes_tarball_debug_cache_key
- when:
condition:
equal: [ << parameters.flavor >>, "Release"]
steps:
- restore_cache:
keys:
- *hermes_tarball_release_cache_key
- when:
condition: << parameters.set_tarball_path >>
steps:
- run:
name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
command: |
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
exit 0
fi
if [ ! -d ~/react-native ]; then
echo "No React Native checkout found. Run `checkout` first."
exit 0
fi
TARBALL_FILENAME=$(node ~/react-native/packages/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
echo "$TARBALL_PATH"
if [ ! -f $TARBALL_PATH ]; then
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
exit 0
fi
echo "Found Hermes tarball at $TARBALL_PATH"
echo "export HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $BASH_ENV
- run:
name: Print Hermes version
command: |
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
TARBALL_FILENAME=$(node ~/react-native/packages/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
else
echo 'No Hermes tarball found.'
fi
- steps: << parameters.steps >>
- when:
condition:
equal: [ << parameters.flavor >>, "Debug"]
steps:
- save_cache:
key: *hermes_tarball_debug_cache_key
paths: *hermes_tarball_cache_paths
- when:
condition:
equal: [ << parameters.flavor >>, "Release"]
steps:
- save_cache:
key: *hermes_tarball_release_cache_key
paths: *hermes_tarball_cache_paths
store_hermes_apple_artifacts:
description: Stores the tarball and the osx binaries
parameters:
flavor:
default: "Debug"
description: The Hermes build type. Must be one of "Debug", "Release".
type: enum
enum: ["Debug", "Release"]
steps:
- when:
condition:
equal: [ << parameters.flavor >>, "Debug"]
steps:
- store_artifacts:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-debug.tar.gz
- when:
condition:
equal: [ << parameters.flavor >>, "Release"]
steps:
- store_artifacts:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-release.tar.gz
- store_artifacts:
path: /tmp/hermes/osx-bin/<< parameters.flavor >>/hermesc
- store_artifacts:
path: /tmp/hermes/dSYM/<< parameters.flavor >>/hermes.framework.dSYM
stop_job_if_apple_artifacts_are_there:
description: Stops the current job if there are already the required artifacts
parameters:
flavor:
default: "All"
description: The flavor of artifacts to check. Must be one of "Debug", "Release" or "All"
type: enum
enum: ["Debug", "Release", "All"]
steps:
- when:
condition:
equal: [ << parameters.flavor >>, "All"]
steps:
- run:
name: "Export files to be checked"
command: |
echo "/tmp/hermes/Release_tarball_present" > /tmp/hermes_files
echo "/tmp/hermes/Debug_tarball_present" >> /tmp/hermes_files
echo "/tmp/hermes/Release_osx_bin" >> /tmp/hermes_files
echo "/tmp/hermes/Debug_osx_bin" >> /tmp/hermes_files
echo "/tmp/hermes/Release_dSYM" >> /tmp/hermes_files
echo "/tmp/hermes/Debug_dSYM" >> /tmp/hermes_files
- when:
condition:
not:
equal: [ << parameters.flavor >>, "All"]
steps:
- run:
name: "Export files to be checked"
command: |
echo "/tmp/hermes/<< parameters.flavor >>_tarball_present" > /tmp/hermes_files
echo "/tmp/hermes/<< parameters.flavor >>_osx_bin" >> /tmp/hermes_files
echo "/tmp/hermes/<< parameters.flavor >>_dSYM" >> /tmp/hermes_files
- run:
name: Stop if files are present
command: |
files=($(cat /tmp/hermes_files))
# Initialize a flag indicating all files exist
all_files_exist=true
for file in "${files[@]}"; do
if [[ ! -f "$file" ]]; then
all_files_exist=false
echo "$file does not exist."
else
echo "$file exist."
fi
done
if [[ "$all_files_exist" == true ]]; then
echo "Tarball, osx-bin and dSYM are present. Halting this job"
circleci-agent step halt
fi
check_if_tarball_is_present:
description: "Checks if the tarball of a specific Flavor is present and adds a marker file"
parameters:
flavor:
default: "Debug"
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
type: enum
enum: ["Debug", "Release"]
steps:
- run:
name: Check if << parameters.flavor >> tarball is there
command: |
FLAVOR=debug
if [[ << parameters.flavor >> == "Release" ]]; then
FLAVOR=release
fi
if [[ -f "/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz" ]]; then
echo "[HERMES TARBALL] Found the << parameters.flavor >> tarball"
touch /tmp/hermes/<< parameters.flavor >>_tarball_present
fi
check_if_osx_bin_is_present:
description: "Checks if the osx bin of a specific Flavor is present and adds a marker file"
parameters:
flavor:
default: "Debug"
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
type: enum
enum: ["Debug", "Release"]
steps:
- run:
name: Check if macosx binary is there
command: |
if [[ -d /tmp/hermes/osx-bin/<< parameters.flavor >> ]]; then
echo "[HERMES MACOSX BIN] Found the osx bin << parameters.flavor >>"
touch /tmp/hermes/<< parameters.flavor >>_osx_bin
fi
check_if_dsym_are_present:
description: "Checks if the dSYM a specific Flavor are present and adds a marker file"
parameters:
flavor:
default: "Debug"
description: The flavor of artifacts to check. Must be one of "Debug" or "Release"
type: enum
enum: ["Debug", "Release"]
steps:
- run:
name: Check if dSYM are there
command: |
if [[ -d /tmp/hermes/dSYM/<< parameters.flavor >> ]]; then
echo "[HERMES dSYM] Found the dSYM << parameters.flavor >>"
touch /tmp/hermes/<< parameters.flavor >>_dSYM
fi
setup_hermes_workspace:
description: "Setup Hermes Workspace"
steps:
- run:
name: Set up workspace
command: |
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
with_xcodebuild_cache:
description: "Add caching to iOS jobs to speed up builds"
parameters:
steps:
type: steps
podfile_lock_path:
type: string
default: packages/rn-tester/Podfile.lock
pods_build_folder:
type: string
default: packages/rn-tester/Pods
podfile_lock_cache_key:
type: string
default: *rntester_podfile_lock_cache_key
cocoapods_cache_key:
type: string
default: *cocoapods_cache_key
steps:
- run:
name: Prepare Xcodebuild cache
command: |
WEEK=$(date +"%U")
YEAR=$(date +"%Y")
echo "$WEEK-$YEAR" > /tmp/week_year
- restore_cache:
key: << parameters.podfile_lock_cache_key >>
- restore_cache:
key: << parameters.cocoapods_cache_key >>
- steps: << parameters.steps >>
- save_cache:
key: << parameters.podfile_lock_cache_key >>
paths:
- << parameters.podfile_lock_path >>
- save_cache:
key: << parameters.cocoapods_cache_key >>
paths:
- << parameters.pods_build_folder >>
store_artifacts_if_needed:
description: "This step stores the artifacts only if we are on main or on a stable branch"
parameters:
path:
type: string
destination:
type: string
default: << parameters.path >>
when:
type: enum
enum: ['always', 'on_fail', 'on_success']
default: 'always'
steps:
- when:
condition:
or:
- equal: [ main, << pipeline.git.branch >> ]
- matches:
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
value: << pipeline.git.branch >>
steps:
- store_artifacts:
when: << parameters.when >>
path: << parameters.path >>
destination: << parameters.destination >>
prepare_ios_tests:
description: This command runs a set of commands to prepare iOS for running unit tests
steps:
- brew_install:
package: xcbeautify
- run:
name: Run Ruby Tests
command: |
cd packages/react-native/scripts
sh run_ruby_tests.sh
- run:
name: Boot iPhone Simulator
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
- run:
name: Configure Environment Variables
command: |
echo 'export PATH=/usr/local/opt/node@18/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- run:
name: "Brew: Tap wix/brew"
command: brew tap wix/brew
- brew_install:
package: applesimutils watchman
- run:
name: Configure Watchman
command: echo "{}" > .watchmanconfig
run_ios_tests:
description: This command run iOS tests and collects results
steps:
- run:
name: "Run Tests: iOS Unit and Integration Tests"
command: yarn test-ios
- run:
name: Zip Derived data folder
when: always
command: |
echo "zipping tests results"
cd /Users/distiller/Library/Developer/Xcode
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- store_artifacts_if_needed:
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- report_bundle_size:
platform: ios
- store_test_results:
path: ./reports/junit
-38
View File
@@ -1,38 +0,0 @@
# -------------------------
# EXECUTORS
# -------------------------
executors:
nodelts:
<<: *defaults
docker:
- image: *nodelts_image
resource_class: "large"
nodeprevlts:
<<: *defaults
docker:
- image: *nodeprevlts_image
resource_class: "large"
# Executor with Node & Java used to inspect and lint
node-browsers-small:
<<: *defaults
docker:
- image: *nodelts_browser_image
resource_class: "small"
node-browsers-medium:
<<: *defaults
docker:
- image: *nodelts_browser_image
resource_class: "medium"
reactnativeandroid-xlarge:
<<: *android-defaults
resource_class: "xlarge"
reactnativeandroid-large:
<<: *android-defaults
resource_class: "large"
reactnativeios:
<<: *defaults
macos:
xcode: *xcode_version
resource_class: macos.m1.medium.gen1
environment:
- RCT_BUILD_HERMES_FROM_SOURCE: true
File diff suppressed because it is too large Load Diff
@@ -1,99 +0,0 @@
tests:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
release_type: "dry-run"
requires:
- build_android
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- test_android:
requires:
- build_android
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
- test_ios_helloworld:
requires:
- build_hermes_macos
name: "Test Template with Ruby 3.2.2"
ruby_version: "3.2.2"
architecture: "NewArch"
flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_helloworld:
requires:
- build_hermes_macos
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
exclude:
# This config is tested with Ruby 3.2.2. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_rntester:
requires:
- build_hermes_macos
use_frameworks: "DynamicFrameworks"
architecture: "NewArch"
ruby_version: "3.2.2"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
- test_ios_rntester:
run_unit_tests: true
use_frameworks: "StaticLibraries"
ruby_version: "2.6.10"
requires:
- build_hermes_macos
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
architecture: ["NewArch", "OldArch"]
@@ -1,58 +0,0 @@
tests_android:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
release_type: "dry-run"
requires:
- build_android
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
## Disabled to land removing react-native/template. Re-enable once switched over
## to Helloworld.
# - test_android:
# requires:
# - build_android
# - test_android_template:
# requires:
# - build_npm_package
# matrix:
# parameters:
# architecture: ["NewArch", "OldArch"]
# jsengine: ["Hermes", "JSC"]
# flavor: ["Debug", "Release"]
@@ -1,9 +0,0 @@
tests_e2e:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- test_e2e_ios:
ruby_version: "2.7.8"
- test_e2e_android
@@ -1,86 +0,0 @@
test_ios:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_release:
name: "prepare_release (dry run test)"
version: "0.0.0"
monorepo_packages_version: "0.0.0"
tag: test
dry_run: true
- prepare_hermes_workspace
- build_android:
release_type: "dry-run"
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst", "xros", "xrsimulator"]
- build_hermes_macos:
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
release_type: "dry-run"
requires:
- build_android
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- test_ios_helloworld:
requires:
- build_hermes_macos
name: "Test Template with Ruby 3.2.2"
ruby_version: "3.2.2"
architecture: "NewArch"
flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_helloworld:
requires:
- build_hermes_macos
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
exclude:
# This config is tested with Ruby 3.2.2. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
- test_ios_rntester:
requires:
- build_hermes_macos
use_frameworks: "DynamicFrameworks"
ruby_version: "3.2.2"
architecture: "NewArch"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
- test_ios_rntester:
run_unit_tests: true
use_frameworks: "StaticLibraries"
ruby_version: "2.6.10"
requires:
- build_hermes_macos
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
architecture: ["NewArch", "OldArch"]
@@ -1,11 +0,0 @@
tests_js:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- test_js:
run_disabled_tests: false
- test_js:
name: test_js_prev_lts
executor: nodeprevlts
-149
View File
@@ -1,149 +0,0 @@
version: 2.1
# -------------------------
# ORBS
# -------------------------
orbs:
win: circleci/windows@2.4.0
android: circleci/android@2.3.0
# -------------------------
# REFERENCES
# -------------------------
references:
defaults: &defaults
working_directory: ~/react-native
environment:
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1
# The public github tokens are publicly visible by design
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: &github_analysisbot_token_a "312d354b5c36f082cfe9"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: &github_analysisbot_token_b "07973d757026bdd9f196"
# Homebrew currently breaks while updating:
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
- HOMEBREW_NO_AUTO_UPDATE: 1
android-defaults: &android-defaults
working_directory: ~/react-native
docker:
- image: reactnativecommunity/react-native-android:v13.0
environment:
- TERM: "dumb"
- GRADLE_OPTS: '-Dorg.gradle.daemon=false'
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
- ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: *github_analysisbot_token_a
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: *github_analysisbot_token_b
hermes_workspace_root: &hermes_workspace_root
/tmp/hermes
hermes_tarball_artifacts_dir: &hermes_tarball_artifacts_dir
/tmp/hermes/hermes-runtime-darwin
hermes_osxbin_artifacts_dir: &hermes_osxbin_artifacts_dir
/tmp/hermes/osx-bin
attach_hermes_workspace: &attach_hermes_workspace
attach_workspace:
at: *hermes_workspace_root
xcodebuild_derived_data_path: &xcodebuild_derived_data_path
~/Library/Developer/Xcode/DerivedData/
main_or_stable_only: &main_or_stable_only
filters:
branches:
only:
- main
- /0\.[0-9]+[\.[0-9]+]?-stable/
# -------------------------
# Dependency Anchors
# -------------------------
dependency_versions:
xcode_version: &xcode_version "15.2"
nodelts_image: &nodelts_image "cimg/node:20.2.0"
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
# -------------------------
# Cache Key Anchors
# -------------------------
# Anchors for the cache keys
cache_keys:
checkout_cache_key: &checkout_cache_key v1-checkout
gems_cache_key: &gems_cache_key v2-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}
gradle_cache_key: &gradle_cache_key v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }}
yarn_cache_key: &yarn_cache_key v6-yarn-cache-{{ .Environment.CIRCLE_JOB }}
rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ arch }}-{{ checksum "/tmp/required_ruby" }}
hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_linux_cache_key: &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
# Hermes iOS
hermesc_apple_cache_key: &hermesc_apple_cache_key v4-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v8-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v6-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v5-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v5-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v3-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v3-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v3-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
# Cocoapods - RNTester
pods_cache_key: &pods_cache_key v12-pods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
cocoapods_cache_key: &cocoapods_cache_key v12-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v11-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
# Cocoapods - HelloWorld
helloworld_cocoapods_cache_key: &helloworld_cocoapods_cache_key v2-cocoapods-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile.lock" }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
helloworld_podfile_lock_cache_key: &helloworld_podfile_lock_cache_key v2-podfilelock-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/helloworld/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
cache_paths:
hermes_workspace_macos_cache_paths: &hermes_workspace_macos_cache_paths
- ~/react-native/packages/react-native/sdks/hermes/build_macosx
- ~/react-native/packages/react-native/sdks/hermes/destroot
hermes_tarball_cache_paths: &hermes_tarball_cache_paths
- *hermes_tarball_artifacts_dir
# -------------------------
# Filters
# -------------------------
# CircleCI filters are OR-ed, with all branches triggering by default and tags excluded by default
# CircleCI env-vars are only set with the branch OR tag that triggered the job, not both.
# In this case, CIRCLE_BRANCH is unset, but CIRCLE_TAG is set.
only_release_tags: &only_release_tags
# Both of the following conditions must be included!
# Ignore any commit on any branch by default.
branches:
ignore: /.*/
# Only act on version tags.
tags:
only: /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
# -------------------------
# PIPELINE PARAMETERS
# -------------------------
parameters:
run_release_workflow:
default: false
type: boolean
run_nightly_workflow:
default: false
type: boolean
release_version:
default: ""
type: string
release_monorepo_packages_version:
default: ""
type: string
release_tag:
default: ""
type: string
release_dry_run:
default: false
type: boolean
-89
View File
@@ -1,89 +0,0 @@
# -------------------------
# WORKFLOWS
#
# When creating a new workflow, make sure to include condition:
#
# when:
# and:
# - equal: [ false, << pipeline.parameters.run_release_workflow >> ]
# - equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
#
# It's setup this way so we can trigger a release via a POST
# See limitations: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
# -------------------------
workflows:
version: 2
# Release workflow, triggered by `yarn trigger-react-native-release`
create_release:
when: << pipeline.parameters.run_release_workflow >>
jobs:
- prepare_release:
name: prepare_release
version: << pipeline.parameters.release_version >>
monorepo_packages_version: << pipeline.parameters.release_monorepo_packages_version >>
tag: << pipeline.parameters.release_tag >>
dry_run: << pipeline.parameters.release_dry_run >>
# This job will run only when a tag is published due to all the jobs being filtered.
publish_release:
jobs:
- prepare_hermes_workspace:
filters: *only_release_tags
- build_android:
filters: *only_release_tags
name: build_android_for_release
release_type: "release"
- build_hermesc_linux:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_apple:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
filters: *only_release_tags
requires:
- build_hermesc_apple
matrix:
parameters:
flavor: ["Debug", "Release"]
slice: ["macosx", "iphoneos", "iphonesimulator", "catalyst"]
- build_hermesc_windows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermes_macos:
filters: *only_release_tags
requires:
- build_apple_slices_hermes
matrix:
parameters:
flavor: ["Debug", "Release"]
# This job will trigger when a version tag is pushed (by package_release)
- build_npm_package:
name: build_and_publish_npm_package
release_type: "release"
filters: *only_release_tags
requires:
- build_android_for_release
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- poll_maven:
requires:
- build_and_publish_npm_package
analysis:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
# Run lints on every commit
- analyze_code
# Run code checks on PRs
- analyze_pr
+1 -7
View File
@@ -30,17 +30,11 @@ module.exports = {
// These rules are not required with hermes-eslint
'ft-flow/define-flow-type': 0,
'ft-flow/use-flow-type': 0,
'lint/sort-imports': 1,
// flow handles this check for us, so it's not required
'no-undef': 0,
},
},
{
files: ['*.js', '*.js.flow'],
excludedFiles: ['packages/react-native/template/**/*'],
rules: {
'lint/sort-imports': 1,
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
+3 -4
View File
@@ -1,6 +1,5 @@
[ignore]
; Ignore templates for 'react-native init'
<PROJECT_ROOT>/packages/react-native/template/.*
; Ignore build cache folder
<PROJECT_ROOT>/packages/react-native/sdks/.*
; Ignore the codegen e2e tests
@@ -62,7 +61,7 @@ munge_underscores=true
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-native/\1'
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
@@ -91,4 +90,4 @@ untyped-import
untyped-type-import
[version]
^0.238.0
^0.251.1
+1 -1
View File
@@ -1,4 +1,4 @@
name: 🐛 Bug Report
name: 🐛 React Native - Bug Report
description: Report a reproducible bug or regression in React Native.
labels: ["Needs: Triage :mag:"]
body:
@@ -0,0 +1,76 @@
name: 🔍 Debugger - Bug Report
description: Report a bug with React Native DevTools and the New Debugger
labels: ["Needs: Triage :mag:", "Debugger"]
body:
- type: markdown
attributes:
value: "## Reporting a bug for React Native DevTools"
- type: markdown
attributes:
value: |
Thank you for taking the time to report an issue for React Native DevTools, our new Debugger for React Native.
Before you continue:
* If you're using **Expo** and you're noticing a bug, [report it here](https://github.com/expo/expo/issues).
* If you've found a problem with our **documentation**, [report it here](https://github.com/facebook/react-native-website/issues/).
* If you're having an issue with **Metro** (the bundler), [report it here](https://github.com/facebook/metro/issues/).
* If you're using an external library, report the issue to the **library first**.
* Please [search for similar issues](https://github.com/facebook/react-native/issues) in our issue tracker.
Make sure that your issue is tested against the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: The list of steps that reproduces the issue.
placeholder: |
1. Install the application with `yarn android`
2. Press `j` to open the debugger
3. Do something...
validations:
required: true
- type: input
id: version
attributes:
label: React Native Version
description: The version of react-native that this issue reproduces on. Bear in mind that only issues on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) will be looked into.
placeholder: "0.76.0"
validations:
required: true
- type: textarea
id: react-native-info
attributes:
label: Output of `npx react-native info`
description: Run `npx react-native info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
...
System:
OS: macOS 14.1.1
CPU: (10) arm64 Apple M1 Max
Memory: 417.81 MB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
...
render: text
validations:
required: true
- type: textarea
id: extra
attributes:
label: Screenshots and Videos
description: |
Please provide screenshot or a video of your bug if relevant.
Issues with videos and screenshots are more likely to **get prioritized**.
+109
View File
@@ -0,0 +1,109 @@
name: build-android
description: This action builds android
inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
run-e2e-tests:
default: 'false'
description: If we need to build to run E2E tests. If yes, we need to build also x86.
runs:
using: composite
steps:
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install-with-cache
- name: Set React Native Version
shell: bash
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-read-only: "false"
- name: Restore Android ccache
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
restore-keys: |
v1-ccache-android-${{ github.job }}-
v1-ccache-android-
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Build and publish all the Android Artifacts to /tmp/maven-local
shell: bash
run: |
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
fi
TASKS="publishAllToMavenTempLocal build"
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.
export ORG_GRADLE_PROJECT_isSnapshot="true"
TASKS="publishAllToMavenTempLocal publishAndroidToSonatype build"
else
# release: we want to build all archs (default)
TASKS="publishAllToMavenTempLocal publishAndroidToSonatype build"
fi
./gradlew $TASKS -PenableWarningsAsErrors=true
- name: Save Android ccache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: maven-local
path: /tmp/maven-local
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK - hermes-debug
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-hermes-debug
path: packages/rn-tester/android/app/build/outputs/apk/hermes/debug/
compression-level: 0
- name: Upload RNTester APK - hermes-release
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-hermes-release
path: packages/rn-tester/android/app/build/outputs/apk/hermes/release/
compression-level: 0
- name: Upload RNTester APK - jsc-debug
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-jsc-debug
path: packages/rn-tester/android/app/build/outputs/apk/jsc/debug/
compression-level: 0
- name: Upload RNTester APK - jsc-release
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-jsc-release
path: packages/rn-tester/android/app/build/outputs/apk/jsc/release/
compression-level: 0
@@ -0,0 +1,103 @@
name: build-apple-slices-hermes
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of Hermes
slice:
required: true
description: The slice of hermes you want to build. It could be iphone, iphonesimulator, macos, catalyst, appletvos, appletvsimulator, xros, or xrossimulator
flavor:
required: true
description: The flavor we want to build. It can be Debug or Release
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/download-artifact@v4
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Restore Slice From Cache
id: restore-slice-cache
uses: actions/cache/restore@v4
with:
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.slice }}-${{ inputs.flavor }}
- name: Build the Hermes ${{ inputs.slice }} frameworks
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ inputs.slice }}
FLAVOR=${{ inputs.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
export RELEASE_VERSION=${{ inputs.react-native-version }}
# HermesC is used to build hermes, so it has to be executable
chmod +x ./build_host_hermesc/bin/hermesc
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
chmod +x ./utils/build-mac-framework.sh
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
chmod +x ./utils/build-ios-framework.sh
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Compress slices to preserve Symlinks
shell: bash
run: |
cd ./packages/react-native/sdks/hermes
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
- name: Upload Artifact for Slice (${{ inputs.slice }}, ${{ inputs.flavor }}}
uses: actions/upload-artifact@v4.3.4
with:
name: slice-${{ inputs.slice }}-${{ inputs.flavor }}
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}.tar.gz
- name: Save slice cache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
uses: actions/cache/save@v4
with:
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.SLICE }}-${{ inputs.FLAVOR }}
@@ -0,0 +1,227 @@
name: build-hermes-macos
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of React Native
flavor:
required: true
description: The flavor we want to build. It can be Debug or Release
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
shell: bash
run: |
FLAVOR="${{ inputs.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-macosx-${{ inputs.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-iphoneos-${{ inputs.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ inputs.flavor }}
- name: Slice cache appletvos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvos-${{ inputs.flavor }}
- name: Slice cache appletvsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvsimulator-${{ inputs.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-catalyst-${{ inputs.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-xros-${{ inputs.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-xrsimulator-${{ inputs.flavor }}
- name: Unzip slices
shell: bash
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes
ls -l .
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvsimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ inputs.flavor }} build_macosx
mv build_iphoneos_${{ inputs.flavor }} build_iphoneos
mv build_iphonesimulator_${{ inputs.flavor }} build_iphonesimulator
mv build_appletvos_${{ inputs.flavor }} build_appletvos
mv build_appletvsimulator_${{ inputs.flavor }} build_appletvsimulator
mv build_catalyst_${{ inputs.flavor }} build_catalyst
mv build_xros_${{ inputs.flavor }} build_xros
mv build_xrsimulator_${{ inputs.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
chmod +x ./utils/build-apple-framework.sh
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
BUILD_TYPE="${{ inputs.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ inputs.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ inputs.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
FLAVOR=${{ inputs.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/appletvos"
mkdir -p "$WORKING_DIR/appletvsimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_appletvos/$DSYM_FILE_PATH "$WORKING_DIR/appletvos/"
cp -r build_appletvsimulator/$DSYM_FILE_PATH "$WORKING_DIR/appletvsimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-dSYM-${{ inputs.flavor }}
path: /tmp/hermes/dSYM/${{ inputs.flavor }}
- name: Upload hermes Runtime artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
- name: Upload hermes osx artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-osx-bin-${{ inputs.flavor }}
path: /tmp/hermes/osx-bin/${{ inputs.flavor }}
- name: Upload Hermes Artifacts
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
@@ -0,0 +1,37 @@
name: build-hermesc-apple
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of React Native
runs:
using: composite
steps:
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Hermes apple cache
uses: actions/cache/restore@v4
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
- name: Build HermesC Apple
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
- name: Upload HermesC Artifact
uses: actions/upload-artifact@v4.3.4
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
@@ -0,0 +1,49 @@
name: build-hermesc-linux
description: This action builds hermesc for linux platforms
inputs:
hermes-version:
required: True
description: The version of Hermes
react-native-version:
required: True
description: The version of React Native
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
uses: actions/cache@v4
with:
key: v1-hermes-${{ github.job }}-linux-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
shell: bash
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
shell: bash
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
@@ -0,0 +1,86 @@
name: build-hermesc-windows
description: This action builds hermesc for Windows platforms
inputs:
hermes-version:
required: True
description: The version of Hermes
react-native-version:
required: True
description: The version of React Native
runs:
using: composite
steps:
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: 'D:\tmp\hermes'
- name: Set up workspace
shell: powershell
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4
with:
key: v2-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
shell: powershell
run: |
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
- name: Build HermesC for Windows
shell: powershell
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
@@ -0,0 +1,148 @@
name: build-npm-package
description: This action builds the NPM package and uploads it to Maven
inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
hermes-ws-dir:
required: 'true'
description: The workspace for hermes
gha-npm-token:
required: false
description: The GHA npm token, required only to publish to npm
default: ''
runs:
using: composite
steps:
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Create /tmp/hermes/osx-bin directory
shell: bash
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin/Release
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin/Debug
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Show /tmp/hermes directory
shell: bash
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Release ]]; then
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Debug ]]; then
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls ${{ inputs.hermes-ws-dir }}/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r ${{ inputs.hermes-ws-dir }}/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r ${{ inputs.hermes-ws-dir }}/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp ${{ inputs.hermes-ws-dir }}/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Install dependencies
uses: ./.github/actions/yarn-install-with-cache
- name: Build packages
shell: bash
run: yarn build
# Continue with publish steps
- name: Set npm credentials
if: ${{ inputs.release-type == 'release' ||
inputs.release-type == 'nightly' }}
shell: bash
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.gha-npm-token }}" > ~/.npmrc
- name: Publish NPM
shell: bash
run: |
echo "GRADLE_OPTS = $GRADLE_OPTS"
# We can't have a separate step because each command is executed in a separate shell
# so variables exported in a command are not visible in another.
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
node ./scripts/releases-ci/publish-npm.js -t ${{ inputs.release-type }}
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.4
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: ${{ inputs.release-type == 'dry-run' }}
shell: bash
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv "packages/react-native/$FILENAME" build/
echo "$FILENAME" > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.4
if: ${{ inputs.release-type == 'dry-run' }}
with:
name: react-native-package
path: build
-88
View File
@@ -1,88 +0,0 @@
name: cache_setup
description: "Cache setup"
inputs:
hermes-version:
description: "Hermes version"
required: true
react-native-version:
description: "React Native version"
required: true
outputs:
cache-hit-hermes-tarball-release:
description: "Whether the hermes tarball release cache was hit"
value: ${{ steps.cache_hermes_tarball_release.outputs.cache-hit }}
cache-hit-hermes-tarball-debug:
description: "Whether the hermes tarball debug cache was hit"
value: ${{ steps.cache_hermes_tarball_debug.outputs.cache-hit }}
cache-hit-macos-bin-release:
description: "Whether the macos bin release cache was hit"
value: ${{ steps.cache_macos_bin_release.outputs.cache-hit }}
cache-hit-macos-bin-debug:
description: "Whether the macos bin debug cache was hit"
value: ${{ steps.cache_macos_bin_debug.outputs.cache-hit }}
cache-hit-dsym-release:
description: "Whether the dsym release cache was hit"
value: ${{ steps.cache_dsym_release.outputs.cache-hit }}
cache-hit-dsym-debug:
description: "Whether the dsym debug cache was hit"
value: ${{ steps.cache_dsym_debug.outputs.cache-hit }}
runs:
using: composite
steps:
- name: Cache hermes tarball release
id: cache_hermes_tarball_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Release.tar.gz
key: v4-hermes-tarball-release-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
enableCrossOsArchive: true
- name: Cache hermes tarball debug
id: cache_hermes_tarball_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Debug.tar.gz
key: v4-hermes-tarball-debug-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
enableCrossOsArchive: true
- name: Cache macos bin release
id: cache_macos_bin_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/osx-bin/Release
key: v2-hermes-release-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache macos bin debug
id: cache_macos_bin_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/osx-bin/Debug
key: v2-hermes-debug-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache dsym release
id: cache_dsym_release
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/dSYM/Release
key: v2-hermes-release-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache dsym debug
id: cache_dsym_debug
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/dSYM/Debug
key: v2-hermes-debug-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: HermesC Apple
id: hermesc_apple
uses: actions/cache@v4.0.0
with:
path: /tmp/hermes/hermesc-apple
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
+20 -5
View File
@@ -1,29 +1,44 @@
name: create_release
description: Creates a new React Native release
inputs:
version:
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
required: true
is-latest-on-npm:
description: "Whether we want to tag this release as latest on NPM"
required: true
default: "false"
dry-run:
description: "Whether the job should be executed in dry-run mode or not"
default: "true"
runs:
using: composite
steps:
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
- name: Configure Git
shell: bash
run: yarn install --non-interactive
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Creating release commit
shell: bash
run: |
node scripts/releases/create-release-commit.js \
--reactNativeVersion "${{ inputs.version }}" \
--tagAsLatestRelease "${{ inputs.is_latest_on_npm }}" \
--dryRun "${{ inputs.dry_run }}"
--tagAsLatestRelease "${{ inputs.is-latest-on-npm }}" \
--dryRun "${{ inputs.dry-run }}"
GIT_PAGER=cat git show HEAD
- name: Update "latest" tag if needed
shell: bash
if: ${{ inputs.tag == 'latest' }}
if: ${{ inputs.is-latest-on-npm == 'true' }}
run: |
git tag -d "latest"
git push origin :latest
git tag -a "latest" -m "latest"
- name: Pushing release commit
shell: bash
if: ${{ inputs.dry_run == false }}
if: ${{ inputs.dry-run == 'false' }}
run: |
CURR_BRANCH="$(git branch --show-current)"
git push origin "$CURR_BRANCH" --follow-tags
+44
View File
@@ -0,0 +1,44 @@
name: lint
description: Runs all the linters in the codebase
inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
github-token:
description: "The GitHub token used by pull-bot"
required: true
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
shell: bash
run: yarn install --non-interactive --frozen-lockfile
- name: Run linters against modified files (analysis-bot)
shell: bash
run: yarn lint-ci
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
- name: Lint code
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
- name: Lint java
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint-java --check
- name: Run flowcheck
shell: bash
run: yarn flow-check
- name: Run typescript check
shell: bash
run: yarn test-typescript
- name: Check license
shell: bash
run: ./scripts/circleci/check_license.sh
- name: Check formatting
shell: bash
run: yarn run format-check
@@ -0,0 +1,84 @@
name: Maestro E2E Android
description: Runs E2E Tests on iOS using Maestro
inputs:
app-path:
required: true
description: The path to the .apk file
app-id:
required: true
description: The id of the app to test
jsengine:
required: true
description: The js engine we are using
maestro-flow:
required: true
description: the folder that contains the maestro tests
install-java:
required: false
default: 'true'
description: whether this action has to install java 17 or not
flavor:
required: true
description: the flavor we want to run - either debug or release
default: release
working-directory:
required: false
default: "."
description: The directory from which metro should be started
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Set up JDK 17
if: ${{ inputs.install-java == 'true' }}
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Enable KVM group perms
shell: bash
run: |
# ubuntu machines have hardware acceleration available and when we try to create an emulator, the script pauses asking for user input
# These lines set the rules to reply automatically to that question and unblock the creation of the emulator.
# source: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Build Codegen
shell: bash
if: ${{ inputs.flavor == 'debug' }}
run: ./packages/react-native-codegen/scripts/oss/build.sh
- name: Run e2e tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
arch: x86
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
avd-name: e2e_emulator
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }}
- name: Normalize APP_ID
id: normalize-app-id
shell: bash
if: always()
run: |
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-')
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT
- name: Store tests result
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
path: |
report.xml
screen.mp4
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: /tmp/MaestroLogs
+121
View File
@@ -0,0 +1,121 @@
name: Maestro E2E iOS
description: Runs E2E Tests on iOS using Maestro
inputs:
app-path:
required: true
description: The path to the .app file
app-id:
required: true
description: The id of the app to test
jsengine:
required: true
description: The js engine we are using
maestro-flow:
required: true
description: the folder that contains the maestro tests
flavor:
required: true
description: Whether we are building for Debug or Release
default: Release
working-directory:
required: false
default: "."
description: The directory from which metro should be started
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Installing Maestro dependencies
shell: bash
run: |
brew tap facebook/fb
brew install facebook/fb/idb-companion jq
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Start Metro in Debug
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
- name: Run tests
id: run-tests
shell: bash
run: |
# Avoid exit from the job if one of the command returns an error.
# Maestro can fail in case of flakyness, we have some retry logic.
set +e
echo "Launching iOS Simulator: iPhone 15 Pro"
xcrun simctl boot "iPhone 15 Pro"
echo "Installing app on Simulator"
xcrun simctl install booted "${{ inputs.app-path }}"
echo "Retrieving device UDID"
UDID=$(xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid')
echo "UDID is $UDID"
echo "Bring simulator in foreground"
open -a simulator
echo "Launch the app"
xcrun simctl launch $UDID ${{ inputs.app-id }}
if [[ ${{ inputs.flavor }} == 'Debug' ]]; then
# To give the app time to warm the metro's cache
sleep 20
fi
echo "Running tests with Maestro"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 # 25 min. CI is extremely slow
# Add retries for flakyness
MAX_ATTEMPTS=5
CURR_ATTEMPT=0
RESULT=1
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do
CURR_ATTEMPT=$((CURR_ATTEMPT+1))
echo "Attempt number $CURR_ATTEMPT"
echo "Start video record using pid: video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid"
xcrun simctl io booted recordVideo video_record_$CURR_ATTEMPT.mov & echo $! > video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid
echo '$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }}'
$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }} --debug-output /tmp/MaestroLogs
RESULT=$?
# Stop video
kill -SIGINT $(cat video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid)
done
exit $RESULT
- name: Store video record
if: always()
uses: actions/upload-artifact@v4.3.4
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
path: |
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
report.xml
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: /tmp/MaestroLogs
@@ -0,0 +1,100 @@
name: prepare-hermes-workspace
description: This action prepares the hermes workspace with the right hermes and react-native versions.
inputs:
hermes-ws-dir:
required: true
description: The hermes dir we need to use to setup the workspace
hermes-version-file:
required: true
description: the path to the file that will contain the hermes version
outputs:
hermes-version:
description: the version of Hermes tied to this run
value: ${{ steps.hermes-version.outputs.VERSION }}
react-native-version:
description: the version of React Native tied to this run
value: ${{ steps.react-native-version.outputs.VERSION }}
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "${{ inputs.hermes-version-file }}" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat ${{ inputs.hermes-version-file }})" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
shell: bash
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
id: restore-hermes
uses: actions/cache/restore@v4
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
# It happened while testing that a cache was created from the right folders
# but those folders where empty. Thus, the next check ensures that we can work with those caches.
- name: Check if cache was meaningful
id: meaningful-cache
shell: bash
run: |
if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then
echo "Found a good hermes cache"
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
- name: Download Hermes tarball
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
shell: bash
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* ${{ inputs.hermes-ws-dir }}/download/.
cp -r packages/react-native/sdks/hermes/* ${{ inputs.hermes-ws-dir }}/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
- name: Upload Hermes artifact
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-workspace
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
- name: Cache hermes workspace
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
@@ -1,4 +1,4 @@
name: prepare_ios_tests
name: prepare-ios-tests
description: Prepare iOS Tests
runs:
using: composite
@@ -1,12 +0,0 @@
name: report_bundle_size
description: Report bundle size
inputs:
platform:
description: Platform. Either ios or android
default: ios
runs:
using: composite
steps:
- name: Report size of RNTester.app (analysis-bot)
shell: bash
run: GITHUB_TOKEN=${{ secrets.PUBLIC_ANALYSISBOT_GITHUB_TOKEN }} scripts/circleci/report-bundle-size.sh ${{ inputs.platform }} || true
@@ -1,8 +1,13 @@
name: setup_hermes_workspace
description: "Setup hermes workspace"
name: restore-hermes-workspace
description: "Restore hermes workspace that has been created in Prepare Hermes Workspace"
runs:
using: composite
steps:
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: /tmp/hermes
- name: Set up workspace
shell: bash
run: |
-19
View File
@@ -1,19 +0,0 @@
name: run_e2e
description: "Run End-to-End Tests"
inputs:
platform:
description: "Platform to run tests on"
required: true
default: "js"
retries:
description: "Number of times to retry failed tests"
required: true
default: "3"
runs:
using: composite
steps:
- name: "Run Tests: ${{ inputs.platform }} End-to-End Tests"
# Disabled to remove the template from react-native
if: false
run: node ./scripts/e2e/run-ci-e2e-tests.js --${{ inputs.platform }} --retries ${{ inputs.retries }}
shell: bash
+12 -1
View File
@@ -1,9 +1,20 @@
name: Setup gradle
description: "Set up your GitHub Actions workflow with a specific version of gradle"
inputs:
cache-read-only:
description: "Whether the Gradle Cache should be in read-only mode so this job won't be allowed to write to it"
default: "true"
runs:
using: "composite"
steps:
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
# We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
cache-read-only: ${{ (github.ref != 'refs/heads/main' && !contains(github.ref, '-stable')) || inputs.cache-read-only == 'true' }}
# Similarly, for those jobs we want to start with a clean cache so it doesn't grow without limits (this is the negation of the previous condition).
cache-write-only: ${{ (github.ref == 'refs/heads/main' || contains(github.ref, '-stable')) && inputs.cache-read-only != 'true' }}
# Temporarily disabling to try resolve a cache cleanup failure
# gradle-home-cache-cleanup: true
add-job-summary-as-pr-comment: on-failure
+1 -6
View File
@@ -5,15 +5,10 @@ inputs:
description: 'The node.js version to use'
required: false
default: '18'
cache:
description: 'The package manager to use for caching dependencies'
required: false
default: 'yarn'
runs:
using: "composite"
steps:
- name: Setup node.js
uses: actions/setup-node@v4.0.0
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.cache }}
@@ -1,4 +1,4 @@
name: setup_xcode_build_cache
name: setup-xcode-build-cache
description: Add caching to iOS jobs to speed up builds
inputs:
hermes-version:
@@ -17,12 +17,12 @@ runs:
YEAR=$(date +"%Y")
echo "$WEEK-$YEAR" > /tmp/week_year
- name: Cache podfile lock
uses: actions/cache@v4.0.0
uses: actions/cache@v4
with:
path: packages/rn-tester/Podfile.lock
key: v9-podfilelock-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile') }}-{{ hashfiles('/tmp/week_year') }}-${{ inputs.hermes-version}}
key: v11-podfilelock-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ hashfiles('/tmp/week_year') }}-${{ inputs.hermes-version }}
- name: Cache cocoapods
uses: actions/cache@v4.0.0
uses: actions/cache@v4
with:
path: packages/rn-tester/Pods
key: v11-cocoapods-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-{{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
key: v13-cocoapods-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
@@ -1,37 +1,21 @@
name: test_ios_helloworld
name: test-ios-helloworld
description: Test iOS Hello World
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: choice
default: Hermes
options:
- JSC
- Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
type: choice
default: StaticLibraries
options:
- StaticLibraries
- DynamicFrameworks
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
type: choice
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup. Must be one of "OldArch" or "NewArch"
default: OldArch
options:
- OldArch
- NewArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
type: choice
default: Debug
options:
- Debug
- Release
hermes-version:
description: The version of hermes
required: true
@@ -45,17 +29,19 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
- name: Run yarn
- name: Create Hermes folder
shell: bash
run: yarn install --non-interactive
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
run: mkdir -p "$HERMES_WS_DIR"
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
@@ -78,6 +64,17 @@ runs:
args+=(--jsvm jsc)
yarn bootstrap ios "${args[@]}" | cat
else
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
# Let's ensure that the tarballs have the right names
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
fi
BUILD_TYPE="${{ inputs.flavor }}"
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
@@ -87,6 +84,7 @@ runs:
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
args+=(--prod)
@@ -1,12 +1,12 @@
name: test_ios_rntester
name: test-ios-rntester
description: Test iOS RNTester
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
default: Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
default: NewArch
@@ -15,7 +15,7 @@ inputs:
default: 2.6.10
run-unit-tests:
description: whether unit tests should run or not.
default: false
default: "false"
hermes-tarball-artifacts-dir:
description: The directory where the hermes tarball artifacts are stored
default: /tmp/hermes/hermes-runtime-darwin
@@ -28,6 +28,11 @@ inputs:
react-native-version:
description: The version of react-native
required: true
run-e2e-tests:
description: Whether we want to run E2E tests or not
required: false
default: false
runs:
using: composite
steps:
@@ -36,21 +41,19 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: ./.github/actions/yarn-install-with-cache
- name: Download Hermes
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
name: hermes-darwin-bin-${{ inputs.flavor }}
path: ${{ inputs.hermes-tarball-artifacts-dir }}
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Prepare IOS Tests
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/prepare_ios_tests
if: ${{ inputs.run-unit-tests == 'true' }}
uses: ./.github/actions/prepare-ios-tests
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
shell: bash
run: |
@@ -82,6 +85,7 @@ runs:
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
chmod +x ./destroot/bin/hermes
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
@@ -89,7 +93,7 @@ runs:
echo 'No Hermes tarball found.'
fi
- name: Setup xcode build cache
uses: ./.github/actions/setup_xcode_build_cache
uses: ./.github/actions/setup-xcode-build-cache
with:
hermes-version: ${{ inputs.hermes-version }}
- name: Install CocoaPods dependencies
@@ -114,19 +118,34 @@ runs:
bundle install
bundle exec pod install
- name: Build RNTester
if: ${{ inputs.run-unit-tests != true }}
if: ${{ inputs.run-unit-tests != 'true' && inputs.run-e2e-tests == 'false' }}
shell: bash
run: |
xcodebuild build \
set -o pipefail && xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
-sdk iphonesimulator | xcbeautify
- name: Build RNTester (E2E Tests)
shell: bash
if: ${{ inputs.run-e2e-tests == 'true' }}
run: |
set -o pipefail && xcodebuild \
-scheme "RNTester" \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-configuration "${{ inputs.flavor }}" \
-sdk "iphonesimulator" \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath "/tmp/RNTesterBuild" | xcbeautify
echo "Print path to *.app file"
find "/tmp/RNTesterBuild" -type d -name "*.app"
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
run: yarn test-ios
- name: Zip Derived data folder
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
run: |
echo "zipping tests results"
@@ -134,19 +153,14 @@ runs:
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
if: ${{ inputs.run-unit-tests == true }}
uses: actions/upload-artifact@v4.3.4
if: ${{ inputs.run-unit-tests == 'true' }}
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- name: Report bundle size
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/report_bundle_size
with:
platform: ios
- name: Store test results
if: ${{ inputs.run-unit-tests == true }}
uses: actions/upload-artifact@v2.2.4
if: ${{ inputs.run-unit-tests == 'true' }}
uses: actions/upload-artifact@v4.3.4
with:
name: test-results
path: ./reports/junit
+26
View File
@@ -0,0 +1,26 @@
name: test-js
description: Runs all the JS tests in the codebase
inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
- name: Run Tests - JavaScript Tests
shell: bash
run: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: test-js-results
compression-level: 1
path: ./reports/junit
@@ -0,0 +1,28 @@
name: yarn-install-with-cache
inputs:
update-cache:
description: Update the cache, only do this if you are update-node-modules-cache.yml
default: "false"
description: Only update node_modules if on main
runs:
using: composite
steps:
- name: Load node_modules from cache
# Restore for all branches, but save for 'main'.
uses: actions/cache/restore@v4
with:
path: node_modules/
key: node-modules-${{ hashFiles('package.json') }}
- name: Install dependencies
shell: bash
run: yarn install --non-interactive
- name: Save node_modules to the cache
if: github.ref == 'refs/heads/main' && inputs.update-cache == 'true'
uses: actions/cache/save@v4
with:
path: node_modules/
# We're assuming that variations on branches will slightly vary from main,
# so it's always important to run yarn install --non-interactive after this
# cache is restored.
key: node-modules-v1-${{ hashFiles('package.json') }}
enableCrossOsArchive: true
@@ -0,0 +1,158 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const {
publishTemplate,
verifyPublishedTemplate,
} = require('../publishTemplate');
const mockRun = jest.fn();
const mockSleep = jest.fn();
const mockGetNpmPackageInfo = jest.fn();
const silence = () => {};
jest.mock('../utils.js', () => ({
log: silence,
run: mockRun,
sleep: mockSleep,
getNpmPackageInfo: mockGetNpmPackageInfo,
}));
const getMockGithub = () => ({
rest: {
actions: {
createWorkflowDispatch: jest.fn(),
},
},
});
describe('#publishTemplate', () => {
beforeEach(jest.clearAllMocks);
it('checks commits for magic #publish-package-to-npm&latest string and sets latest', async () => {
mockRun.mockReturnValueOnce(`
The commit message
#publish-packages-to-npm&latest`);
const github = getMockGithub();
await publishTemplate(github, '0.76.0', true);
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yaml',
ref: '0.76-stable',
inputs: {
dry_run: true,
is_latest_on_npm: true,
version: '0.76.0',
},
});
});
it('pubished as is_latest_on_npm = false if missing magic string', async () => {
mockRun.mockReturnValueOnce(`
The commit message without magic
`);
const github = getMockGithub();
await publishTemplate(github, '0.76.0', false);
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yaml',
ref: '0.76-stable',
inputs: {
dry_run: false,
is_latest_on_npm: false,
version: '0.76.0',
},
});
});
});
describe('#verifyPublishedTemplate', () => {
beforeEach(jest.clearAllMocks);
it("waits on npm updating for version and not 'latest'", async () => {
const NOT_LATEST = false;
mockGetNpmPackageInfo
// template@<version>
.mockReturnValueOnce(Promise.reject('mock http/404'))
.mockReturnValueOnce(Promise.resolve());
mockSleep.mockReturnValueOnce(Promise.resolve()).mockImplementation(() => {
throw new Error('Should not be called again!');
});
const version = '0.77.0';
await verifyPublishedTemplate(version, NOT_LATEST);
expect(mockGetNpmPackageInfo).toHaveBeenLastCalledWith(
'@react-native-community/template',
version,
);
});
it('waits on npm updating version and latest tag', async () => {
const IS_LATEST = true;
const version = '0.77.0';
mockGetNpmPackageInfo
// template@latest → unknown tag
.mockReturnValueOnce(Promise.reject('mock http/404'))
// template@latest != version → old tag
.mockReturnValueOnce(Promise.resolve({version: '0.76.5'}))
// template@latest == version → correct tag
.mockReturnValueOnce(Promise.resolve({version}));
mockSleep
.mockReturnValueOnce(Promise.resolve())
.mockReturnValueOnce(Promise.resolve())
.mockImplementation(() => {
throw new Error('Should not be called again!');
});
await verifyPublishedTemplate(version, IS_LATEST);
expect(mockGetNpmPackageInfo).toHaveBeenCalledWith(
'@react-native-community/template',
'latest',
);
});
describe('timeouts', () => {
let mockProcess;
beforeEach(() => {
mockProcess = jest.spyOn(process, 'exit').mockImplementation(code => {
throw new Error(`process.exit(${code}) called!`);
});
});
afterEach(() => mockProcess.mockRestore());
it('will timeout if npm does not update package version after a set number of retries', async () => {
const RETRIES = 2;
mockGetNpmPackageInfo.mockReturnValue(Promise.reject('mock http/404'));
mockSleep.mockReturnValue(Promise.resolve());
await expect(() =>
verifyPublishedTemplate('0.77.0', true, RETRIES),
).rejects.toThrowError('process.exit(1) called!');
expect(mockGetNpmPackageInfo).toHaveBeenCalledTimes(RETRIES);
});
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
const RETRIES = 7;
const IS_LATEST = true;
mockGetNpmPackageInfo.mockReturnValue(
Promise.resolve({version: '0.76.5'}),
);
mockSleep.mockReturnValue(Promise.resolve());
await expect(async () => {
await verifyPublishedTemplate('0.77.0', IS_LATEST, RETRIES);
}).rejects.toThrowError('process.exit(1) called!');
expect(mockGetNpmPackageInfo).toHaveBeenCalledTimes(RETRIES);
});
});
});
+108
View File
@@ -0,0 +1,108 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const childProcess = require('child_process');
const usage = `
=== Usage ===
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory>
@param {string} appPath - Path to the app APK
@param {string} appId - App ID that needs to be launched
@param {string} maestroFlow - Path to the maestro flow to be executed
@param {string} flavor - Flavor of the app to be launched. Can be 'release' or 'debug'
@param {string} workingDirectory - Working directory from where to run Metro
==============
`;
const args = process.argv.slice(2);
if (args.length !== 5) {
throw new Error(`Invalid number of arguments.\n${usage}`);
}
const APP_PATH = args[0];
const APP_ID = args[1];
const MAESTRO_FLOW = args[2];
const IS_DEBUG = args[3] === 'debug';
const WORKING_DIRECTORY = args[4];
async function main() {
console.info('\n==============================');
console.info('Running tests for Android with the following parameters:');
console.info(`APP_PATH: ${APP_PATH}`);
console.info(`APP_ID: ${APP_ID}`);
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
console.info(`IS_DEBUG: ${IS_DEBUG}`);
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
console.info('==============================\n');
console.info('Install app');
childProcess.execSync(`adb install ${APP_PATH}`, {stdio: 'ignore'});
let metroProcess = null;
if (IS_DEBUG) {
console.info('Start Metro');
childProcess.execSync(`cd ${WORKING_DIRECTORY}`, {stdio: 'ignore'});
metroProcess = childProcess.spawn('yarn', ['start', '&'], {
cwd: WORKING_DIRECTORY,
stdio: 'ignore',
detached: true,
});
console.info(`- Metro PID: ${metroProcess.pid}`);
}
console.info('Wait For Metro to Start');
await sleep(5000);
console.info('Start the app');
childProcess.execSync(`adb shell monkey -p ${APP_ID} 1`, {stdio: 'ignore'});
console.info('Start recording to /sdcard/screen.mp4');
childProcess
.exec('adb shell screenrecord /sdcard/screen.mp4', {
stdio: 'ignore',
detached: true,
})
.unref();
console.info(`Start testing ${MAESTRO_FLOW}`);
let error = null;
try {
childProcess.execSync(
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${MAESTRO_FLOW} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
{stdio: 'inherit'},
);
} catch (err) {
error = err;
} finally {
console.info('Stop recording');
childProcess.execSync('adb pull /sdcard/screen.mp4', {stdio: 'ignore'});
if (IS_DEBUG && metroProcess != null) {
const pid = metroProcess.pid;
console.info(`Kill Metro. PID: ${pid}`);
process.kill(-pid);
console.info(`Metro Killed`);
process.exit();
}
}
if (error) {
throw error;
}
}
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
main();
+103
View File
@@ -0,0 +1,103 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const {run, sleep, getNpmPackageInfo, log} = require('./utils.js');
const TAG_AS_LATEST_REGEX = /#publish-packages-to-npm&latest/;
/**
* Should this commit be `latest` on npm?
*/
function isLatest() {
const commitMessage = run('git log -n1 --pretty=%B');
return TAG_AS_LATEST_REGEX.test(commitMessage);
}
module.exports.isLatest = isLatest;
/**
* Create a Github Action to publish the community template matching the released version
* of React Native.
*/
module.exports.publishTemplate = async (github, version, dryRun = true) => {
log(`📤 Get the ${TEMPLATE_NPM_PKG} repo to publish ${version}`);
const is_latest_on_npm = isLatest();
const majorMinor = /^v?(\d+\.\d+)/.exec(version);
if (!majorMinor) {
log(`🔥 can't capture MAJOR.MINOR from '${version}', giving up.`);
process.exit(1);
}
// MAJOR.MINOR-stable
const ref = `${majorMinor[1]}-stable`;
await github.rest.actions.createWorkflowDispatch({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yaml',
ref,
inputs: {
dry_run: dryRun,
is_latest_on_npm,
// 0.75.0-rc.0, note no 'v' prefix
version: version.replace(/^v/, ''),
},
});
};
const SLEEP_S = 10;
const MAX_RETRIES = 3 * 6; // 3 minutes
const TEMPLATE_NPM_PKG = '@react-native-community/template';
/**
* Will verify that @latest and the @<version> have been published.
*
* NOTE: This will infinitely query each step until successful, make sure the
* calling job has a timeout.
*/
module.exports.verifyPublishedTemplate = async (
version,
latest = false,
retries = MAX_RETRIES,
) => {
log(`🔍 Is ${TEMPLATE_NPM_PKG}@${version} on npm?`);
let count = retries;
while (count-- > 0) {
try {
const json = await getNpmPackageInfo(
TEMPLATE_NPM_PKG,
latest ? 'latest' : version,
);
log(`🎉 Found ${TEMPLATE_NPM_PKG}@${version} on npm`);
if (!latest) {
return;
}
if (json.version === version) {
log(`🎉 ${TEMPLATE_NPM_PKG}@latest → ${version} on npm`);
return;
}
log(
`🐌 ${TEMPLATE_NPM_PKG}@latest → ${pkg.version} on npm and not ${version} as expected, retrying...`,
);
} catch (e) {
log(`Nope, fetch failed: ${e.message}`);
}
await sleep(SLEEP_S);
}
let msg = `🚨 Timed out when trying to verify ${TEMPLATE_NPM_PKG}@${version} on npm`;
if (latest) {
msg += ' and latest tag points to this version.';
}
log(msg);
process.exit(1);
};
+29
View File
@@ -0,0 +1,29 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const {execSync} = require('child_process');
function run(cmd) {
return execSync(cmd, 'utf8').toString().trim();
}
module.exports.run = run;
async function sleep(seconds) {
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
}
module.exports.sleep = sleep;
async function getNpmPackageInfo(pkg, versionOrTag) {
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
resp.json(),
);
}
module.exports.getNpmPackageInfo = getNpmPackageInfo;
module.exports.log = (...args) => console.log(...args);
+1 -1
View File
@@ -24,4 +24,4 @@ jobs:
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
+20
View File
@@ -0,0 +1,20 @@
name: Keep Github Actions Cache < 10GB
on:
workflow_dispatch:
schedule:
# Run every 2hrs during weekdays
- cron: "0 0/2 * * 1-5"
jobs:
cache-cleaner:
if: github.repository == 'facebook/react-native'
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
- name: Trim the cache
run: node scripts/clean-gha-cache.js
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const checkForReproducer = require('./.github/workflow-scripts/checkForReproducer.js')
await checkForReproducer(github, context)
+26
View File
@@ -0,0 +1,26 @@
# This jobs runs every day 2 hours after the nightly job and its purpose is to report
# a failure in case the nightly failed to be published. We are going to hook this to an internal automation.
name: Check Nigthlies
on:
workflow_dispatch:
# nightly build @ 4:15 AM UTC
schedule:
- cron: '15 4 * * *'
jobs:
check-nightly:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Check nightly
run: |
TODAY=$(date "+%Y%m%d")
echo "Checking nightly for $TODAY"
NIGHTLY="$(npm view react-native | grep $TODAY)"
if [[ -z $NIGHTLY ]]; then
echo 'Nightly job failed.'
exit 1
else
echo 'Nightly Worked, All Good!'
fi
+2 -2
View File
@@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
if(!context.payload.commits || !context.payload.commits.length) return;
const sha = context.payload.commits[0].id;
@@ -48,7 +48,7 @@ jobs:
issue_number: closedPrNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request was successfully merged by ${authorName} in **${sha}**.\n\n<sup>[When will my fix make it into a release?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#when-will-my-fix-make-it-into-a-release) | [How to file a pick request?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#how-to-open-a-pick-request)</sup>`
body: `This pull request was successfully merged by ${authorName} in **${sha}**\n\n<sup>[When will my fix make it into a release?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#when-will-my-fix-make-it-into-a-release) | [How to file a pick request?](https://github.com/reactwg/react-native-releases/blob/main/docs/faq.md#how-to-open-a-pick-request)</sup>`
});
// If the PR has already been processed (labeled as Merged), skip it
+16 -8
View File
@@ -4,25 +4,29 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version of React Native we want to release. For example 0.75.0-rc.0'
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
required: true
type: string
is_latest_on_npm:
description: 'Whether we want to tag this release as latest on NPM'
is-latest-on-npm:
description: "Whether we want to tag this release as latest on NPM"
required: true
type: boolean
default: false
dry_run:
description: 'Whether the job should be executed in dry-run mode or not'
dry-run:
description: "Whether the job should be executed in dry-run mode or not"
type: boolean
default: false
default: true
jobs:
prepare_release:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-depth: 0
fetch-tags: 'true'
- name: Check if on stable branch
id: check_stable_branch
run: |
@@ -46,3 +50,7 @@ jobs:
- name: Execute Prepare Release
if: ${{ steps.check_stable_branch.outputs.ON_STABLE_BRANCH && !steps.check_if_tag_exists.outputs.TAG_EXISTS }}
uses: ./.github/actions/create-release
with:
version: ${{ inputs.version }}
is-latest-on-npm: ${{ inputs.is-latest-on-npm }}
dry-run: ${{ inputs.dry-run }}
+1 -1
View File
@@ -25,4 +25,4 @@ jobs:
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: packages/react-native-bots
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DANGER_GITHUB_API_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
@@ -1,13 +0,0 @@
name: "Validate Gradle Wrapper"
on:
push:
pull_request:
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
+68 -587
View File
@@ -1,11 +1,10 @@
name: Nightly
on:
workflow_dispatch:
# nightly build @ 2:15 AM UTC
schedule:
- cron: '15 2 * * *'
workflow_dispatch:
# nightly build @ 2:15 AM UTC
schedule:
- cron: "15 2 * * *"
jobs:
set_release_type:
@@ -27,85 +26,32 @@ jobs:
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
uses: actions/checkout@v4
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
uses: actions/checkout@v4
- name: Build HermesC Apple
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
@@ -114,93 +60,24 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
continue-on-error: true
IOS_DEPLOYMENT_TARGET: "15.1"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build Slice
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
FLAVOR=${{ matrix.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
@@ -215,292 +92,47 @@ jobs:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build Hermes MacOS
uses: ./.github/actions/build-hermes-macos
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ matrix.flavor }} build_macosx
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
mv build_catalyst_${{ matrix.flavor }} build_catalyst
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
./utils/build-ios-framework.sh build_framework
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
flavor: ${{ matrix.flavor }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build HermesC Linux
uses: ./.github/actions/build-hermesc-linux
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Linux cache
uses: actions/cache@v4.0.0
with:
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build HermesC Windows
uses: ./.github/actions/build-hermesc-windows
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Windows cache
uses: actions/cache@v4.0.0
with:
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
run: |
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- name: Build HermesC for Windows
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
build_android:
runs-on: 8-core-ubuntu
@@ -510,200 +142,49 @@ jobs:
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
run: |
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/checkout@v4
- name: Build Android
uses: ./.github/actions/build-android
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
build_npm_package:
runs-on: 8-core-ubuntu
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
HERMES_WS_DIR: /tmp/hermes
env:
HERMES_WS_DIR: /tmp/hermes
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
uses: actions/checkout@v4
- name: Build and Publish NPM PAckage
uses: ./.github/actions/build-npm-package
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Build packages
run: yarn build
# Continue with publish steps
- name: Set npm credentials
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
- name: Publish NPM
run: |
git config --global --add safe.directory /__w/react-native/react-native
echo "GRADLE_OPTS = $GRADLE_OPTS"
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
node ./scripts/releases-ci/publish-npm.js -t nightly
- name: Zip Maven Artifacts from /tmp/maven-local
working-directory: /tmp
run: zip -r maven-local.zip maven-local
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: maven-local
path: /tmp/maven-local.zip
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.1
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv packages/react-native/$FILENAME build/
echo $FILENAME > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.1
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
with:
name: react-native-package
path: build
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}"
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
+3
View File
@@ -21,6 +21,7 @@ jobs:
- name: Verify RN version
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const verifyVersion = require('./.github/workflow-scripts/verifyVersion.js')
const labelWithContext = await verifyVersion(github, context);
@@ -40,6 +41,7 @@ jobs:
- name: Add descriptive label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const addDescriptiveLabel = require('./.github/workflow-scripts/addDescriptiveLabels.js')
await addDescriptiveLabel(github, context);
@@ -52,6 +54,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const actOnLabel = require('./.github/workflow-scripts/actOnLabel.js')
await actOnLabel(github, context, {label: context.payload.label.name})
@@ -13,11 +13,11 @@ jobs:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run Yarn Install
run: yarn install
uses: ./.github/actions/yarn-install-with-cache
- name: Build packages
run: yarn build
- name: Set NPM auth token
+84 -575
View File
@@ -2,8 +2,8 @@ name: Publish Release
on:
push:
tags:
- "v0.*.*" # This should match v0.X.Y
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
- "v0.*.*" # This should match v0.X.Y
- "v0.*.*-rc.*" # This should match v0.X.Y-RC.0
jobs:
set_release_type:
runs-on: ubuntu-latest
@@ -24,86 +24,32 @@ jobs:
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
BUILD_FROM_SOURCE: true
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
outputs:
react-native-version: ${{ steps.react-native-version.outputs.version }}
hermes-version: ${{ steps.hermes-version.outputs.version }}
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat $HERMES_VERSION_FILE)" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
uses: actions/checkout@v4
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Yarn- Install Dependencies
run: yarn install --non-interactive
- name: Download Hermes tarball
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* $HERMES_WS_DIR/download/.
cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache hermes workspace
uses: actions/cache@v4.0.0
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ github.run_number }}
enableCrossOsArchive: true
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Hermes apple cache
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
uses: actions/checkout@v4
- name: Build HermesC Apple
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
@@ -111,93 +57,24 @@ jobs:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
continue-on-error: true
IOS_DEPLOYMENT_TARGET: "15.1"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, catalyst, xros, xrsimulator]
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build Slice
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Build the Hermes ${{ matrix.slice }} frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ matrix.slice }}
FLAVOR=${{ matrix.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Save slice cache
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
build_hermes_macos:
runs-on: macos-13
@@ -212,292 +89,47 @@ jobs:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build Hermes MacOS
uses: ./.github/actions/build-hermes-macos
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Setup Hermes workspace
uses: ./.github/actions/setup_hermes_workspace
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
run: |
FLAVOR="${{ matrix.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ ! contains(github.event.head_commit.message, 'Bump metro@') && steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: yarn install --non-interactive
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-macosx-${{ matrix.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphoneos-${{ matrix.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-iphonesimulator-${{ matrix.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-catalyst-${{ matrix.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xros-${{ matrix.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
uses: actions/cache@v4.0.0
with:
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-xrsimulator-${{ matrix.flavor }}
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ matrix.flavor }} build_macosx
mv build_iphoneos_${{ matrix.flavor }} build_iphoneos
mv build_iphonesimulator_${{ matrix.flavor }} build_iphonesimulator
mv build_catalyst_${{ matrix.flavor }} build_catalyst
mv build_xros_${{ matrix.flavor }} build_xros
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
./utils/build-ios-framework.sh build_framework
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
BUILD_TYPE="${{ matrix.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ matrix.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Upload darwin artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-darwin-bin-${{ matrix.flavor }}
path: /tmp/hermes/hermes-runtime-darwin
- name: Upload osx-bin
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-osx-bin-${{ matrix.flavor }}
path: /tmp/hermes/osx-bin
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: hermes-dSYM-${{ matrix.flavor }}
path: /tmp/hermes/dSYM/${{ matrix.flavor }}
flavor: ${{ matrix.flavor }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev jq zip python3
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build HermesC Linux
uses: ./.github/actions/build-hermesc-linux
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Linux cache
uses: actions/cache@v4.0.0
with:
key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
uses: actions/checkout@v4
- name: Build HermesC Windows
uses: ./.github/actions/build-hermesc-windows
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Windows cache
uses: actions/cache@v4.0.0
with:
key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
run: |
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
#New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes
#New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- name: Build HermesC for Windows
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.0
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
build_android:
runs-on: 8-core-ubuntu
@@ -507,199 +139,76 @@ jobs:
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Set React Native Version
run: node ./scripts/releases/set-rn-version.js --build-type ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Build and publish all the Android Artifacts to /tmp/maven-local
run: |
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true
shell: bash
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
uses: actions/checkout@v4
- name: Build Android
uses: ./.github/actions/build-android
with:
name: build-android-results
compression-level: 1
path: |
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports
packages/react-native-gradle-plugin/settings-plugin/build/reports
packages/react-native/ReactAndroid/build/reports
- name: Upload RNTester APK
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.0
with:
name: rntester-apk
path: packages/rn-tester/android/app/build/outputs/apk/
compression-level: 0
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
build_npm_package:
runs-on: 8-core-ubuntu
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android]
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
# Repeated here, as the environment key in this executor will overwrite the one in defaults
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }}
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }}
HERMES_WS_DIR: /tmp/hermes
env:
HERMES_WS_DIR: /tmp/hermes
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY_ENCODED }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
REACT_NATIVE_BOT_GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Create /tmp/hermes/osx-bin directory
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4.1.3
uses: actions/checkout@v4
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4.1.3
fetch-depth: 0
fetch-tags: true
- name: Build and Publish NPM PAckage
uses: ./.github/actions/build-npm-package
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4.1.3
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
- name: Publish @react-native-community/template
id: publish-template-to-npm
uses: actions/github-script@v6
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4.1.3
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {publishTemplate} = require('./.github/workflow-scripts/publishTemplate.js')
const version = "${{ github.ref_name }}"
const isDryRun = false
await publishTemplate(github, version, isDryRun);
- name: Wait for template to be published
timeout-minutes: 3
uses: actions/github-script@v6
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4.1.3
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
- name: Show /tmp/hermes directory
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
run: yarn install --non-interactive
- name: Build packages
run: yarn build
# Continue with publish steps
- name: Set npm credentials
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.GHA_NPM_TOKEN }}" > ~/.npmrc
- name: Publish NPM
run: |
git config --global --add safe.directory /__w/react-native/react-native
echo "GRADLE_OPTS = $GRADLE_OPTS"
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
node ./scripts/releases-ci/publish-npm.js -t release
- name: Zip Maven Artifacts from /tmp/maven-local
working-directory: /tmp
run: zip -r maven-local.zip maven-local
- name: Upload Maven Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: maven-local
path: /tmp/maven-local.zip
- name: Upload npm logs
uses: actions/upload-artifact@v4.3.1
with:
name: npm-logs
path: ~/.npm/_logs
- name: Build release package as a job artifact
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
run: |
mkdir -p build
FILENAME=$(cd packages/react-native; npm pack | tail -1)
mv packages/react-native/$FILENAME build/
echo $FILENAME > build/react-native-package-version
- name: Upload release package
uses: actions/upload-artifact@v4.3.1
if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run'
with:
name: react-native-package
path: build
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {verifyPublishedTemplate, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
const version = "${{ github.ref_name }}"
await verifyPublishedTemplate(version, isLatest());
- name: Update rn-diff-purge to generate upgrade-support diff
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
run: |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
-26
View File
@@ -1,26 +0,0 @@
name: Run E2E Tests
# This workflow is used to trigger E2E tests on a PR when a comment is made
# containing the text "#run-e2e-tests".
on:
issue_comment:
types: [created]
permissions:
contents: read
jobs:
rebase:
name: Trigger E2E Tests
permissions:
contents: write # for cirrus-actions/rebase to push code to rebase
pull-requests: read # for cirrus-actions/rebase to get info about PR
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '#run-e2e-tests')
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Push empty commit
run: |
git commit -m "#run-e2e-tests" --allow-empty
git push origin $(git branch --show-current)
+4 -4
View File
@@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
days-before-stale: 180
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
@@ -30,7 +30,7 @@ jobs:
- uses: actions/stale@v9
with:
ascending: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
days-before-stale: 180
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
@@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
any-of-labels: 'Needs: Author Feedback'
days-before-stale: 24
stale-issue-message: "This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days."
@@ -66,7 +66,7 @@ jobs:
- uses: actions/stale@v9
with:
ascending: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
any-of-labels: 'Needs: Author Feedback'
days-before-stale: 24
stale-issue-message: "This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days."
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,45 @@
name: Trigger E2E Tests on Comment
# This workflow is used to automatically trigger E2E tests when a comment is made
# containing the text "/run-e2e-tests".
on:
issue_comment:
types: [created]
permissions:
contents: read
jobs:
trigger-e2e-tests:
name: Trigger E2E Tests
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/test-e2e')
steps:
# This is needed because of https://github.com/actions/runner-images/issues/6283
# TL;DR: brew is not in the PATH anymore.
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install jq
run: brew install jq
- name: Run E2E Tests
run: |
# Github does not provide the branch of a PR when a comment on a PR is made
# So, given the issue number, which is the PR number, we can retrieve the branch with
# a quick API call
echo "Retrieving branch"
BRANCH=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/facebook/react-native/pulls/$PR_NUMBER | jq -r '.head.ref')
echo "Trigger Test All workflow for branch $BRANCH"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/facebook/react-native/actions/workflows/test-all.yml/dispatches \
-d "{\"ref\": \"$BRANCH\", \"inputs\": {\"run-e2e-tests\": \"true\"}}"
env:
GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
@@ -0,0 +1,18 @@
name: Update node modules cache
on:
workflow_dispatch:
push:
branches:
- main
jobs:
update_node_modules_cache:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install yarn dependencies and update cache
uses: ./.github/actions/yarn-install-with-cache
with:
update-cache: "true"
-10
View File
@@ -39,8 +39,6 @@ project.xcworkspace
/packages/react-native/ReactAndroid/external-artifacts/artifacts/
/packages/react-native/ReactAndroid/hermes-engine/build/
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
/packages/react-native/template/android/app/build/
/packages/react-native/template/android/build/
/packages/helloworld/android/app/build/
/packages/helloworld/android/build/
/packages/react-native-popup-menu-android/android/build/
@@ -108,16 +106,12 @@ package-lock.json
# Ruby Gems (Bundler)
/packages/react-native/vendor
/packages/react-native/template/vendor
/packages/helloworld/vendor
.ruby-version
/**/.ruby-version
vendor/
# iOS / CocoaPods
/packages/react-native/template/ios/build/
/packages/react-native/template/ios/Pods/
/packages/react-native/template/ios/Podfile.lock
/packages/helloworld/ios/build/
/packages/helloworld/ios/Pods/
/packages/helloworld/ios/Podfile.lock
@@ -159,9 +153,5 @@ vendor/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# E2E files
/packages/rn-tester-e2e/apps/*.apk
/packages/rn-tester-e2e/apps/*.app
# CircleCI
.circleci/generated_config.yml
+863
View File
@@ -1,5 +1,813 @@
# Changelog
## v0.76.1
### Fixed
#### Android specific
- **runtime** Made AppRegistry callable from Native code in Bridgeless (fixes headless tasks) ([f3fee67c54](https://github.com/facebook/react-native/commit/f3fee67c547ace5e08bc9e119bcb80e0f3454d30) by [@robik](https://github.com/robik))
- **runtime** Add jsBundleFile to DefaultReactNativeHost.kt ([e56bd89ef](https://github.com/facebook/react-native/commit/e56bd89eff72f1d38d2940b9dbd8f7b97037dc22))
#### iOS specific
- **codegen** Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app. ([dc7e9e2d83](https://github.com/facebook/react-native/commit/dc7e9e2d83f5af3d2a970521af4fcc7f86d2168d) by [@cipolleschi](https://github.com/cipolleschi))
- **infra** Generated NODE_BINARY in .xcode.env.local now supports paths with a space ([eeaa3ff458](https://github.com/facebook/react-native/commit/eeaa3ff458a3e5c902075bb45161d6ccde31fe53) by [@blakef](https://github.com/blakef))
- **infra** Pin Xcodeproj to < 1.26.0 ([e8776240b41](https://github.com/facebook/react-native/commit/e8776240b41a3147e95713299b69c813be60b8e8))
- **runtime** Fixed bug where background colors would sometimes animate when changing on Views ([1d6ac09530](https://github.com/facebook/react-native/commit/1d6ac09530145e6d2bf1e4dd9d40f51542d9e7f6) by [@joevilches](https://github.com/joevilches))
- **runtime** Fixes regression of RCTWindowFrameDidChangeNotification not fired ([e271b23fad](https://github.com/facebook/react-native/commit/e271b23fad89e1e7da2e91a8f1e5cbb295406c74) by [@zhongwuzw](https://github.com/zhongwuzw))
## v0.76.0
### Breaking
- **Animation** Stop sending state updates to React in looping animation ([8af5e893c8](https://github.com/facebook/react-native/commit/8af5e893c89b24dca972afe36ef442fd509d5804) by [@dmytrorykun](https://github.com/dmytrorykun))
- **devtools:** Remove Inspector Panel perf + network tabs under New Arch (see https://github.com/react-native-community/discussions-and-proposals/pull/777) ([f220bde4d7](https://github.com/facebook/react-native/commit/f220bde4d7d556b3be83cccff0eec5da22921aba) by [@huntie](https://github.com/huntie))
- **flow:** Eliminate a few React.Element type that will be synced to react-native ([39c338ff8d](https://github.com/facebook/react-native/commit/39c338ff8d3a65ec3f7a45f0b8319f70115e2fc1) by [@SamChou19815](https://github.com/SamChou19815))
- **infra** Projects that intend to use the community CLI will now have to declare that dependency instead of transitively having the react-native package include it. ([bd3a3e3de0](https://github.com/facebook/react-native/commit/bd3a3e3de08e334db6f1f248241df8ea4680724c) by [@blakef](https://github.com/blakef))
- **infra** Remove react-native-community dependencies from react-native ([9269429bb9](https://github.com/facebook/react-native/commit/9269429bb955d47088793a2e32454fddb712152b) by [@blakef](https://github.com/blakef))
- **infra:** TurboModules will be looked up as TurboModules first, and fallback to legacy modules after. ([5a62606ab3](https://github.com/facebook/react-native/commit/5a62606ab36edaffb0a5c760d2b0ed0c8e3808a8) by [@javache](https://github.com/javache))
- **text engine** Always use AttributedStringBox instead of AttributedString in TextLayoutManager ([ee597bfe2bf](https://github.com/facebook/react-native/commit/ee597bfe2bf7f11ac60dab87f47dbcb6e840749c)) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **bridging:** Deleted LongArray ([471445eb17](https://github.com/facebook/react-native/commit/471445eb1770dcb773eb463af99c9556cb070abc) by Thomas Nardone)
- **Flipper:** Update ReactNativeFlipper deprecation to ERROR ([531657b394](https://github.com/facebook/react-native/commit/531657b394aa0fac70f26d9facdb32d23a1b05d6) by [@cortinico](https://github.com/cortinico))
- **infra** Remove several libs from default App CMake setup ([52de8c70f2](https://github.com/facebook/react-native/commit/52de8c70f2d8826789e4118b0c81aa4397e833fc) by [@cortinico](https://github.com/cortinico))
- **infra:** Merge all the remaining .so libraries into libreactnative.so ([db80d78d7a](https://github.com/facebook/react-native/commit/db80d78d7a3d61d5bd6871258513f778851059f5) by [@cortinico](https://github.com/cortinico))
- **infra:** Remove several unnecessary android prefab targets. Use ReactAndroid::reactnative instead ([6e5227bd83](https://github.com/facebook/react-native/commit/6e5227bd8357dcbe12038b21066cf414e3f97e03) by [@cortinico](https://github.com/cortinico))
- **infra:** Do not depend on OSS SoLoader anymore and do not expose Fresco `api` dependency. ([6dc01dad09](https://github.com/facebook/react-native/commit/6dc01dad09c6ee2ac6793db1b11cb98faada9c3b) by [@cortinico](https://github.com/cortinico))
- **infra:** Updating `minSdkVersion` to API 24 (Android 7) ([270951a212](https://github.com/facebook/react-native/commit/270951a2123b5c51567b72a8f1a8a1608cba43d7) by [@alanleedev](https://github.com/alanleedev))
- **initialization:** `ReactNativeHost` invalidates the instance manager on `clear()`, rather than merely destroying the instance. ([986cf18dd2](https://github.com/facebook/react-native/commit/986cf18dd2f0d6ea491d521549c0bf9a323e189b) by [@motiz88](https://github.com/motiz88))
- **layout engine:** Do not implicitly convert parsed LengthPercentage to pixels ([9e48976bc2](https://github.com/facebook/react-native/commit/9e48976bc2864c6ef6995179a7dc8d1c453dcf39) by [@NickGerleman](https://github.com/NickGerleman))
- **rendering:** Set "enableBackgroundStyleApplicator" by default ([5f14963da0](https://github.com/facebook/react-native/commit/5f14963da081deeac2fb540d58c8667c2d2c5d08) by [@NickGerleman](https://github.com/NickGerleman))
#### iOS specific
- **initialization:** Add ability to control bundle loading on the new architecture similar to `loadSourceForBridge`. Removed some properties from the `RCTRootViewFactory`. ([7487a2c277](https://github.com/facebook/react-native/commit/7487a2c27713a0129ef2db70efc2fa543a8c185e) by [@alanjhughes](https://github.com/alanjhughes))
- **turbomodule** [iOS] Remove Macro for autolinking pure Cxx module([184646e491](https://github.com/facebook/react-native/commit/184646e49169110842bafa6c02e52f6eec1e0ffa) by [@philIip](https://github.com/philIip))
### Added
- **style** Add official `filter` CSSProperty. ([6b369a40d9](https://github.com/facebook/react-native/commit/6b369a40d98c2bb7f933415f62b1e2b8f4da86ed) by [@jorge-cab](https://github.com/jorge-cab))
- **style** Add official `boxShadow` CSSProperty. ([2241c3146f](https://github.com/facebook/react-native/commit/2241c3146ffbfb8b77f54599b7cebb717537c15a) by [@jorge-cab](https://github.com/jorge-cab))
- **codegen:** Add EventEmitter Code-gen support for Java and ObjC Turbo Modules ([ad3df84668](https://github.com/facebook/react-native/commit/ad3df84668f1624e830396364c331783c6f99948) by [@christophpurrer](https://github.com/christophpurrer))
- **devtools:** support for rendering Error object previews in Chrome DevTools console ([cae9ae5b48](https://github.com/facebook/react-native/commit/cae9ae5b486d04b889af9d1685bcbbb33557c791) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **devtools:** support for rendering Error objects in Chrome DevTools console ([1740a56a46](https://github.com/facebook/react-native/commit/1740a56a46ef4a364c88cebe373b4b3a5679248a) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **devtools** Add upper case keys to the debug key handler ([6390cf67d0](https://github.com/facebook/react-native/commit/6390cf67d065727c810fcf4ef32b0cac7efac8e2) by [@wh201906](https://github.com/wh201906))
- **devtools:** Debugger: Support text responses to CDP `IO.read` requests ([c085180264](https://github.com/facebook/react-native/commit/c085180264ea68f71b050cbb6b9a8274e36c3fbf) by [@robhogan](https://github.com/robhogan))
- **devtools:** Debugging: implement common C++ layer of CDP `Network.loadNetworkResource` ([193cdc36f7](https://github.com/facebook/react-native/commit/193cdc36f7de5524b509e38da8feb209d214634c) by [@robhogan](https://github.com/robhogan))
- **devtools:**: Inspector: Support `/open-debugger` specifying `target` param ([88ba9a6042](https://github.com/facebook/react-native/commit/88ba9a60428697f5957f269e85fbef3d0afc5046) by [@robhogan](https://github.com/robhogan))
- **infra:** Use PackagerAsset resolver instead of Platform.OS when its provided. ([baa366654e](https://github.com/facebook/react-native/commit/baa366654e9ee98e0400b493e7fc9578851d60d1) by [@andrewdacenko](https://github.com/andrewdacenko))
- **infra:** Add optional `PackagerAsset.resolver` prop so AssetSourceResolver can use it instead of `Platform.OS` to identify where asset is stored on device. ([3f3a85b3c5](https://github.com/facebook/react-native/commit/3f3a85b3c5be3f9fdbd63a3acfe8456b6adeb100) by [@andrewdacenko](https://github.com/andrewdacenko))
- **initialization** Add experimental api to JSRuntimeFactory to initialize runtime on js thread ([c9fbc05bbc](https://github.com/facebook/react-native/commit/c9fbc05bbca803032914be4b38ac4c9608852963) by Benoit Girard)
- **metro:** Expose `MetroConfig` type directly from `react-native/metro-config`. ([cc6d1eb844](https://github.com/facebook/react-native/commit/cc6d1eb8449c25fe3c76aaf4da5cd38b3ac0783d) by [@tjzel](https://github.com/tjzel))
- **rsc** Added support for importing `react-native` in a `react-server` environment for React Server Components support. ([8989c9b71d](https://github.com/facebook/react-native/commit/8989c9b71dcca3f39b37a32945364025732eb2c3) by [@EvanBacon](https://github.com/EvanBacon))
- **style:** Add support for `texAlignment: 'start'` ([a2cb34371e](https://github.com/facebook/react-native/commit/a2cb34371e6e52305ee58f23d3b2fefc1e8c7157) by [@javache](https://github.com/javache))
- **style:** Unhide new arch layout props ([2d6c59e1d4](https://github.com/facebook/react-native/commit/2d6c59e1d4f6ddb46373ed10c915aed4ce0c030c) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **devtools:** Enable React Native DevTools in OSS debug builds ([143f1ad298](https://github.com/facebook/react-native/commit/143f1ad29874c1e8e9561abae263cb08f4859407) by [@robhogan](https://github.com/robhogan))
- **codegen** Add support for handling `com.facebook.react.bridge.Dynamic` as parameter type in TurboModules ([d01f1b3214](https://github.com/facebook/react-native/commit/d01f1b3214b435d436fd6cf145d8e450a188301c) by [@cortinico](https://github.com/cortinico))
- **error handling:** Provide default implementation for ReactHostDelegate.handleInstanceException() ([34e3a6cc88](https://github.com/facebook/react-native/commit/34e3a6cc885a68148b1d2209adc70c8109a56a66) by [@alanleedev](https://github.com/alanleedev))
- **Image** Added support for rendering XML assets provided to `Image` ([aad9240fd4](https://github.com/facebook/react-native/commit/aad9240fd435d549812b5075767c5ea39a8fbb4f) by Peter Abbondanzo)
- **Runtime** Allow DefaultReactHost to load the js bundle via regular file urls ([7522336412](https://github.com/facebook/react-native/commit/752233641210a0b2e6bc1438f82d0aa193c2ef0d) by [@RSNara](https://github.com/RSNara))
- **runtime** Make ReactInstanceEventListener available on ReactHost ([80e1dd70b0](https://github.com/facebook/react-native/commit/80e1dd70b0b27195b9b71ea531728eef9799caa9) by [@RSNara](https://github.com/RSNara))
- **runtime** Add `invalidate()` method to ReactHost and ReactInstanceManager that destroys the `ReactHost`, including the `ReactInstance`. ([a3db352e25](https://github.com/facebook/react-native/commit/a3db352e25c01614ade3e42637e3d5726e582308) by [@motiz88](https://github.com/motiz88))
- **runtime:** Added `onUserLeaveHint` support into `ReactActivityDelegate` ([27ba369f23](https://github.com/facebook/react-native/commit/27ba369f2325db5678aaf6a18927c127921840e0) by [@behenate](https://github.com/behenate))
- **runtime:** Added a conditional check in the `resolveThemeAttribute` function to reattempt resource resolution with the "android" package name if the resource ID is 0. ([6365df54db](https://github.com/facebook/react-native/commit/6365df54dbd0a7e185cfe113a9cf0026b2bb12ef) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **style** Add BackgroundStyleApplicator for managing view backgrounds ([1a78477ce5](https://github.com/facebook/react-native/commit/1a78477ce528b36a97602d0210bd4ea8446804dc) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Linear gradient ([bd0aedc8c3](https://github.com/facebook/react-native/commit/bd0aedc8c3dbebf96e123fd1bd33f515d09e2579) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **style:** Support simple opacity in nested text ([a2d53d5ea0](https://github.com/facebook/react-native/commit/a2d53d5ea08959da0bbce3c494e06634e3d52d2a) by [@NickGerleman](https://github.com/NickGerleman))
#### iOS specific
- **accessibility:** Support LargeContentViewer on iOS for better accessibility ([6cc44d765a](https://github.com/facebook/react-native/commit/6cc44d765a1127aa4998a490e3ff90b741ef9441) by [@bacarybruno](https://github.com/bacarybruno))
- **Animated:** Declare the `onUserDrivenAnimationEnded` in the old Architecture ([f8c13f601d](https://github.com/facebook/react-native/commit/f8c13f601d5f7f159dd7a0e42b9fcc877d48d69b) by [@cipolleschi](https://github.com/cipolleschi))
- **Animated:** Retrieve the tags of the nodes connected by the animation and send them to JS ([fd748ae84c](https://github.com/facebook/react-native/commit/fd748ae84cf18c1c204a936af45bb4883d476cd7) by [@cipolleschi](https://github.com/cipolleschi))
- **brownfield:** Improve RCTAppDelegate usage for brownfield, add `automaticallyLoadReactNativeWindow` flag ([391680fe84](https://github.com/facebook/react-native/commit/391680fe844aad887e497912378c699aed13464b) by [@okwasniewski](https://github.com/okwasniewski))
- **codegen** Code-generate an optional base class to use for every NativeModule ([ed5f558a6c](https://github.com/facebook/react-native/commit/ed5f558a6cb5ff597870e7013150113b9460c0dc) by [@christophpurrer](https://github.com/christophpurrer))
- **devtools** Debugger: Implement CDP methods for loading network resources through the debug target. ([c720583f6c](https://github.com/facebook/react-native/commit/c720583f6c071959e7898befb62cd36f84c581dc) by [@robhogan](https://github.com/robhogan))
- **infra** Enable third-party podspec sources to be fetched from mirrored git repositories ([53969cb8d0](https://github.com/facebook/react-native/commit/53969cb8d0460ccb2e899ec290135f447ed5dc65) by [@RailByteOEBB](https://github.com/RailByteOEBB))
- **runtime** Added RCTUIInterfaceOrientation helper method ([cf015f93ef](https://github.com/facebook/react-native/commit/cf015f93efa888be61150915b18ae8cd12d11232) by [@Biki-das](https://github.com/Biki-das))
- **ScrollView** Send onScrollEnded event to NativeTurboAnimatedModule ([7af743236f](https://github.com/facebook/react-native/commit/7af743236f25ee03b674baf46f6506dbbc2e4fc0) by [@cipolleschi](https://github.com/cipolleschi))
- **ScrollView:** Fire onMomentumScrollEnd when UIScrollView is removed from window ([b98b9f1fa7](https://github.com/facebook/react-native/commit/b98b9f1fa7717283f368eb182a51d971b8776c80) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **style** Linear gradient ([b99675d78a](https://github.com/facebook/react-native/commit/b99675d78a8269403b68d7eae8dc67ec85aea3e6) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **TextInput** Add line break mode for TextInput components. ([fe941a8f4c](https://github.com/facebook/react-native/commit/fe941a8f4c92fa9b1f07d2dd94050c81d63c77e8) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **TextInput** Line break mode for TextInput components. ([6cab6c2a13](https://github.com/facebook/react-native/commit/6cab6c2a13b89cbee1a2c1957ea561f82cb6700a) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **TextInput** Add support for missing text content types ([d7a3e48032](https://github.com/facebook/react-native/commit/d7a3e48032fe76d118c2b5c14032d7a73319adf8) by [@krozniata](https://github.com/krozniata))
- **TextInput** Added handling of `showSoftInputOnFocus` props for new arch. ([ead50d6b11](https://github.com/facebook/react-native/commit/ead50d6b1180dbe9f8b49d646cc34f83aae41c74) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
### Changed
- **Animated:** Improved runtime performance of `Animated` ([d1ebe02c19](https://github.com/facebook/react-native/commit/d1ebe02c19a4ae78f54e2647d5b18e6bf93079c1) by [@yungsters](https://github.com/yungsters))
- **Animated:** Changed `Animated` props validation to soft errors instead of thrown errors ([0a1ba02273](https://github.com/facebook/react-native/commit/0a1ba02273693ffd605ca2aebce90746c1745a9c) by [@yungsters](https://github.com/yungsters))
- **Appearance:** Improved `Appearance.getColorScheme` performance ([8f0f50f7a1](https://github.com/facebook/react-native/commit/8f0f50f7a1729019b1b0957076edfee58a146c56) by [@yungsters](https://github.com/yungsters))
- **c++:** Removed using namespace std::placeholders ([194b642633](https://github.com/facebook/react-native/commit/194b642633d944b9e73e55b947284eabd42d55a2) by [@r-barnes](https://github.com/r-barnes))
- **devtools:** Remove `--experimental-debugger` option from start command ([94e7a87f23](https://github.com/facebook/react-native/commit/94e7a87f2344c2024817ea7e928ab81e7f57aa76) by [@huntie](https://github.com/huntie))
- **devtools:** Inspector: Enforce device and appId filters if both are given to /open-debugger ([c7970379a1](https://github.com/facebook/react-native/commit/c7970379a1e9be87be22ddcdec38752257059450) by [@robhogan](https://github.com/robhogan))
- **devtools:** Debugger: `j` opens most recent (not first) target. ([2a6a895b17](https://github.com/facebook/react-native/commit/2a6a895b17fdd4112349853e08a50c4c90886cb8) by [@robhogan](https://github.com/robhogan))
- **devtools:** Debugger: Make `/json/list` return connection-addition-ordered targets. ([53951d7fec](https://github.com/facebook/react-native/commit/53951d7fec2997487d1ee948304ab904c21338aa) by @robhogan)
- **devtools** Add Fusebox support for saving traces to disk ([1bd4a11736](https://github.com/facebook/react-native/commit/1bd4a11736c2916c9114df55395d474a801ee63b) by Benoit Girard)
- **devtools:** Simplify key handling in start command ([5a0df6d0bf](https://github.com/facebook/react-native/commit/5a0df6d0bf5e84d3f7d2a6f000e617e00b8bef02) by [@huntie](https://github.com/huntie))
- **error handling:** Improved error message for invalid filter values ([4094ce0718](https://github.com/facebook/react-native/commit/4094ce0718c54a2c9a326cc2962ea00e30b7bdf6) by [@yungsters](https://github.com/yungsters))
- **error handling:** Improve LogBox safe area insets styling ([18302831c4](https://github.com/facebook/react-native/commit/18302831c49299d326935f875655c439cc4fbe0d) by [@yungsters](https://github.com/yungsters))
- **infra:** Update all babel packages and fix tests accordingly ([b37101486b](https://github.com/facebook/react-native/commit/b37101486bd4dc26f6ec4e646e12d1484ec9479f) by [@vzaidman](https://github.com/vzaidman))
- **infra:** Upgrade pretty-format to 29.7.0 ([7bc9244d0c](https://github.com/facebook/react-native/commit/7bc9244d0cbebc310116b6b2a2baf0781073d0f5) by [@dprevost-LMI](https://github.com/dprevost-LMI))
- **infra:** Move init deprecation notice 30 Sept → 31 Dec, to give users more time to update their infrastructure ([014370d825](https://github.com/facebook/react-native/commit/014370d825b273bc96464e84ba2d57ae5cf37eda) by [@blakef](https://github.com/blakef))
- **infra:** Drop `node-fetch` in favor of Node's built-in fetch from `undici` in `react-native/dev-middleware` ([30a3e6e8df](https://github.com/facebook/react-native/commit/30a3e6e8dfcfc9597873578b8332ec027ccf1b84) by [@byCedric](https://github.com/byCedric))
- **infra:** Allow use without @react-native-community/cli-server-api ([24997dc5ae](https://github.com/facebook/react-native/commit/24997dc5ae4ed85d3965cbc6796423f5012e4eb1) by @blakef)
- **infra:** Add CLI selection of multiple debug targets ([6a24df7eaa](https://github.com/facebook/react-native/commit/6a24df7eaab2420e91b9a4fc9202c175c0802441) by [@huntie](https://github.com/huntie))
- **infra** Update Metro to "^0.81.0" ([3f8d1fa286](https://github.com/facebook/react-native/commit/3f8d1fa2862814cc8e2b091786e80231670bb876) by [@robhogan](https://github.com/robhogan))
- **initialization:** Improve `Appearance` performance overhead by lazily initializing the NativeModule ([b86e8ef95f](https://github.com/facebook/react-native/commit/b86e8ef95fc6d7e35b2e20529a52bb74780dcf1a) by [@yungsters](https://github.com/yungsters))
- **metro:** Changed Metro default config to use Hermes parser, enabling the use of advanced Flow syntax in React Native. ([320963c7cb](https://github.com/facebook/react-native/commit/320963c7cb394ccd8768003ad40c9767fdb7f4e3) by [@yungsters](https://github.com/yungsters))
- **metro:** Use Metro terminal reporter for dev-middleware logs ([2f04dfe795](https://github.com/facebook/react-native/commit/2f04dfe7951e5f4c63f94c74d7ad10cd53969da0) by [@huntie](https://github.com/huntie))
- **metro:** Fix server.end() usage following Metro bump ([02b879b1e2](https://github.com/facebook/react-native/commit/02b879b1e22dd03f52ff77d82cac3fe167aaea84) by [@huntie](https://github.com/huntie))
- **runtime:** Timer functions `timeout` argument is now coerced to a number ([af04eb773c](https://github.com/facebook/react-native/commit/af04eb773cf7531323c6a34a276098e84c6041a9) by [@robik](https://github.com/robik))
- **turbomodules:** Replace TurboReactPackage with BaseReactPackage ([e881a1184c](https://github.com/facebook/react-native/commit/e881a1184cadd45321b781d07c6154a14332c5f6) by [@philIip](https://github.com/philIip))
- **yoga** Replace YogaConstants.UNDEFINED with Float.NaN ([8bd9952eaf](https://github.com/facebook/react-native/commit/8bd9952eaf28fe8feca7490293656caeefe7897e) by Jingbo Yang)
#### Android specific
- **DevTools** Make PackagerConnectionSettings class open again ([4dd47eeb9e](https://github.com/facebook/react-native/commit/4dd47eeb9ea91455efcd0db23a02162ab338a53f) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- **infra:** Update compileSdk to 35 ([1333e0ee6a](https://github.com/facebook/react-native/commit/1333e0ee6ac78ad856b7f86234ec2606fcc48a7e) by [@alanleedev](https://github.com/alanleedev))
- **infra:** Expose jsc tooling via prefab ([e91690d929](https://github.com/facebook/react-native/commit/e91690d929d7c8b251964cae282ad8e1d95aa39a) by [@tomekzaw](https://github.com/tomekzaw))
- **infra:**Expose hermes tooling via prefab ([f41af55958](https://github.com/facebook/react-native/commit/f41af55958dfbc39c536d433c3a27db329dd05f1) by [@cortinico](https://github.com/cortinico))
- **infra:** Bump AGP to 8.6.0 ([aca31eb610](https://github.com/facebook/react-native/commit/aca31eb610c2c4d433311b1cdaf20af94fd54622) by [@cortinico](https://github.com/cortinico))
- **infra:** Gradle to 8.10.2 ([60a2706e97](https://github.com/facebook/react-native/commit/60a2706e9716d955fc0d7e15b02ad0d6efe58fc2) by [@cortinico](https://github.com/cortinico))
- **LogBox:** Modify LogBox to be usable on Android 15 ([5fe7660439](https://github.com/facebook/react-native/commit/5fe76604393a7e931559a3ef82564619885dbe43) by [@alanleedev](https://github.com/alanleedev))
- **Modal** Fix crash for Modal not attached to window manager ([73ce1984e8](https://github.com/facebook/react-native/commit/73ce1984e8411a6b4aec440a5e7aa9d2b7474984) by [@alanleedev](https://github.com/alanleedev))
- **style:** Move `experimental_boxShadow` and `experimental_backgroundImage` to BaseViewConfig ([03801f275e](https://github.com/facebook/react-native/commit/03801f275e81c27a09f717bf48322f9ab1a54fc1) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Revamp InsetBoxShadowDrawable ([d9f684b1cf](https://github.com/facebook/react-native/commit/d9f684b1cf7fb6824e25e1e948bfb30dec450464) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Support OutsetBoxShadowDrawable on Android 9+ ([f905f90468](https://github.com/facebook/react-native/commit/f905f904685cc67a948349e0d58dce8b7f524069) by [@NickGerleman](https://github.com/NickGerleman))
- **infra:** Merge libuimanagerjni.so inside libreactnative.so ([7916f7e120](https://github.com/facebook/react-native/commit/7916f7e12014c42b2bc9bfcfe053e37358fc39a4) by [@cortinico](https://github.com/cortinico))
- **infra:** Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so ([80c3aea48d](https://github.com/facebook/react-native/commit/80c3aea48d584b49fab8df3a417558cf5c5c3b12) by [@cortinico](https://github.com/cortinico))
- **infra:** Move more libraries to so-merging: rninstance, react_featureflagsjni, hermesinstancejni, fabricjni ([e864910a4d](https://github.com/facebook/react-native/commit/e864910a4d805a23244365b96e1f5e207a45a4a9) by [@cortinico](https://github.com/cortinico))
- **infra:** Move libmapbufferjni.so inside libreactnative.so ([5b761ff15c](https://github.com/facebook/react-native/commit/5b761ff15cdb2501862f07650912cbd26eaafdef) by [@cortinico](https://github.com/cortinico))
- **infra:** Move libreact_newarchdefaults.so inside libreactnative.so ([0caf3e824d](https://github.com/facebook/react-native/commit/0caf3e824d81689034ddf96d86d2362c9911d389) by [@cortinico](https://github.com/cortinico))
- **runtime:** Make `setPointerEvents` public ([010e0010a3](https://github.com/facebook/react-native/commit/010e0010a38e111df110584ebacaabe210c3f137) by [@jakex7](https://github.com/jakex7))
- **runtime:** Avoid image off-screen render ([620b1221fa](https://github.com/facebook/react-native/commit/620b1221fa7d4e0e8e070031f65fdf786e3342d0) by [@NickGerleman](https://github.com/NickGerleman))
- **kotlin:** Migrated ReactSwitch to Kotlin ([03c0e5e2af](https://github.com/facebook/react-native/commit/03c0e5e2af288e96f39fa044cbbe8ebef91bdb1e) by [@blakef](https://github.com/blakef))
- **kotlin** Migrated AdditionalAnimatedNode.java to Kotlin ([8689aa48bb](https://github.com/facebook/react-native/commit/8689aa48bb5fac6b96144c08d49b15359ef141a1) by [@blakef](https://github.com/blakef))
- **turbomodule:** Modules marked with needsEagerInit = true will now be
created on the mqt_native thread. ([c4a6bbc8fd](https://github.com/facebook/react-native/commit/c4a6bbc8fd8992059abdcfae2bc483bd29f31e79) by [@javache](https://github.com/javache))
- **error handling** Log a SoftException on SurfaceMountingManager.addRootView ([3429dc1ccf](https://github.com/facebook/react-native/commit/3429dc1ccf32b6b23f4f0ad3cfdf0d5697af665f) by [@psionic12](https://github.com/psionic12))
- **layout:** Extracted common parts related to calculating text layout to a helper ([2eaf0b0848](https://github.com/facebook/react-native/commit/2eaf0b0848d660eb19fde2921570f9e8bd2bd1de) by @j-piasecki)
- **kotlin:** Migrate StyleAnimatedNode.java to Kotlin ([ef9149b4fc](https://github.com/facebook/react-native/commit/ef9149b4fc989827ad4b781fa89f556a1fd20db4) by [@rshest](https://github.com/rshest))
#### iOS specific
- **infra** Don't include C++ bridging header in RCTTurboModule.h ([3fc7ebb311](https://github.com/facebook/react-native/commit/3fc7ebb311e86cf2e3e78efacb1860deadd54216) by [@christophpurrer](https://github.com/christophpurrer))
- **infra** Bump iOS min version for CI ([b93c2b2412](https://github.com/facebook/react-native/commit/b93c2b241247d0a7d9b79eda76af0a7bca0ac745) by [@realsoelynn](https://github.com/realsoelynn))
- **infra** Update RNTester and HelloWorld template app to `min iOS 15.1` ([e1a1cdacf2](https://github.com/facebook/react-native/commit/e1a1cdacf2d210353c06e7ab65f971f6592e8c00) by [@realsoelynn](https://github.com/realsoelynn))
- **infra** Enforce we use the correct C++ version for all, even if dependency tries to set it ([d7a8aae9ac](https://github.com/facebook/react-native/commit/d7a8aae9acc441d9b6c52484e35ba158e90b4b60) by [@Titozzz](https://github.com/Titozzz))
- **renderer** Changed border display ([94407f56d1](https://github.com/facebook/react-native/commit/94407f56d133b2ba46dc5b31679e9500470e1770) by [@coado](https://github.com/coado))
- **runtime** Refactor supportedInterfaceOrientations method to use RCTKeyWindow() ([815c415fb9](https://github.com/facebook/react-native/commit/815c415fb90944db89552a503eb53059e9f0d20b) by [@okwasniewski](https://github.com/okwasniewski))
### Deprecated
#### Android specific
- **bridging:** Deprecate MapBuilder ([a696d2ed6b](https://github.com/facebook/react-native/commit/a696d2ed6b95c07229bc0fd00aca344951689bbd) by Thomas Nardone)
#### iOS specific
- **initialization:** Deprecate turboModuleEnabled, fabricEnabled and bridgelessEnabled for the new newArchEnabled property. ([3621606c44](https://github.com/facebook/react-native/commit/3621606c4486051de8b443c443cd87f6b822d1a0) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime** Deprecated StatusBar.setNetworkActivityIndicatorVisible ([8a390ba9b8](https://github.com/facebook/react-native/commit/8a390ba9b8c1b8889dd0933fe1477083a24ff71d) by Ingrid Wang)
### Removed
- **devtools** Remove sampling profiler from dev menu ([f57740c0fb](https://github.com/facebook/react-native/commit/f57740c0fbd431991bf90f83dac5770fa74d13cf) by [@blakef](https://github.com/blakef))
#### Android specific
- **components** CoreComponentsRegistry is now fully replaced by DefaultComponentRegistry. ([de7976c69d](https://github.com/facebook/react-native/commit/de7976c69d9f837729e8822f2b89e6d08ea6883a) by [@javache](https://github.com/javache))
- **error handling** Removed HasJavascriptExceptionMetadata as a marker interface. Use JavascriptExecption directly ([cb00ca954d](https://github.com/facebook/react-native/commit/cb00ca954d1a7647900c8ff6b5792eb342735140) by [@javache](https://github.com/javache))
- **initialization** Unused jsEngineResolutionAlgorithm from ReactHost ([f1b6218608](https://github.com/facebook/react-native/commit/f1b6218608ea968f032f8344d4648651617482cf) by [@javache](https://github.com/javache))
- **infra** React_newarchdefaults is no longer a prefab, instead use fabricjni ([c68f35d444](https://github.com/facebook/react-native/commit/c68f35d4441c8a03541da17e3adc03f355e8c45e) by [@javache](https://github.com/javache))
#### iOS specific
- **runtime:** Remove `[RCTConvert UIBarStyle:]` ([a557a81f96](https://github.com/facebook/react-native/commit/a557a81f963041351e02f3b79489c6ee394ebe48) by [@Saadnajmi](https://github.com/Saadnajmi))
### Fixed
- **Animated:** Fixed undefined behavior in certain scenarios when `ReactElement` objects are supplied to Animated components ([56937d646c](https://github.com/facebook/react-native/commit/56937d646c741b32826a92a76193eadc8dc59031) by [@yungsters](https://github.com/yungsters))
- **Animated:** Realign the shadow tree and the native tree when the user finishes interacting with the app. ([a8786fc1df](https://github.com/facebook/react-native/commit/a8786fc1df60426000013bdcfb3a61bd201b6dac) by [@cipolleschi](https://github.com/cipolleschi))
- **codegen:** Fix codegen failing in a pnpm monorepo because of missing `yargs` ([3e084bc159](https://github.com/facebook/react-native/commit/3e084bc15994cf5b549d1104e906e5dbb2df4417) by [@tido64](https://github.com/tido64))
- **c++:** Upstream fixes for build errors in React Native Windows ([c722ec7c37](https://github.com/facebook/react-native/commit/c722ec7c372c44ade8439f4765b1b6470c27f470) by [@chiaramooney](https://github.com/chiaramooney))
- **c++:** Undefined behavior fix in MethodInvoker ([09e88448ce](https://github.com/facebook/react-native/commit/09e88448ce3a3047112b6f71218305d5bfe2e8bc) by Riley Berton)
- **c++:** Fix "C4715 not all control paths return a value" warning in MSVC when building ReactCommon ([c30e35fb44](https://github.com/facebook/react-native/commit/c30e35fb44affb179c9a208cf0a3e4575347e76f) by [@jonthysell](https://github.com/jonthysell))
- **c++:** Updated comments for `~ShadowNodeWrapper()` and `~ShadowNodeListWrapper()` ([778fcecf35](https://github.com/facebook/react-native/commit/778fcecf357b92f8dd5bab07914aa8563796d0f7) by [@tomekzaw](https://github.com/tomekzaw))
- **c++:** Change RawPropsParser logs from ERROR level to WARNING ([68c0720e34](https://github.com/facebook/react-native/commit/68c0720e3438f9230f6dc28956c93b58ce1f2482) by Bowen Xie)
- **devtools:** Reconnecting to an unknown inspector page no longer results in a zombie connection ([a7adfef0bb](https://github.com/facebook/react-native/commit/a7adfef0bb3df03517935e446ea0c6b506f7ed90) by [@motiz88](https://github.com/motiz88))
- **devtools:** Avoid a zombie state when opening a second debugger frontend concurrently. ([e55ea2daf1](https://github.com/facebook/react-native/commit/e55ea2daf11bb527f500323e3f1bb71f10cbe1c5) by [@motiz88](https://github.com/motiz88))
- **devtools:** Inspector-proxy no longer accidentally detaches connected devices. ([4c6bff01b3](https://github.com/facebook/react-native/commit/4c6bff01b384d7d899dd9d3beef12b878918704e) by @motiz88)
- **devtools:** Throttle reload command ([42bad68220](https://github.com/facebook/react-native/commit/42bad68220d288ef2436609ee50ad993c239b362) by [@coado](https://github.com/coado))
- **devtools** Respond with status code `200` when successfully launching RNDT ([eeb6122f39](https://github.com/facebook/react-native/commit/eeb6122f390d355191182eaee6cf126468e7b4d4) by [@byCedric](https://github.com/byCedric))
- **error reporting:** Fix logbox reporting React errors as Warnings ([cbb313253f](https://github.com/facebook/react-native/commit/cbb313253fdf96c4fca06a24ed4cbd3f3df9db80) by [@rickhanlonii](https://github.com/rickhanlonii))
- **error reporting** Restore Metro log forwarding, change notice to signal future removal ([6047f9cc09](https://github.com/facebook/react-native/commit/6047f9cc09a7a86b79084a3ff1b4303c4583d2ce) by [@huntie](https://github.com/huntie))
- **flow:** Fix parsing of modern Flow syntax when `transformer.hermesParser = false` is configured in Metro config ([1387f521fd](https://github.com/facebook/react-native/commit/1387f521fdd8f187eab7a4a6a05d4d75a96b4f88) by [@huntie](https://github.com/huntie))
- **infra:** Removed noisy ENOENT error message upon launching the debugger ([5bbf5a4878](https://github.com/facebook/react-native/commit/5bbf5a4878fd3bab7b70f91e049bb6b986fd183b) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **infra:** Ensure `--build-output` destination exists ([396bdd87d8](https://github.com/facebook/react-native/commit/396bdd87d8021902ad78b817314fdc5b6207c2ea) by [@szymonrybczak](https://github.com/szymonrybczak))
- **infra:** Fix Platform.constants.reactNativeVersion type ([95d9cdf228](https://github.com/facebook/react-native/commit/95d9cdf228e33d5651f41ebf5e14e80962fae118) by [@NickGerleman](https://github.com/NickGerleman))
- **js:** Fixes findNodeAtPoint when views were inverted ([1d1646afd1](https://github.com/facebook/react-native/commit/1d1646afd1ff4f068fc41d8b142b08d53e6cd91a) by [@zhongwuzw](https://github.com/zhongwuzw))
- **layout:** Fix handling 'auto' checks in absolute layout ([3596019489](https://github.com/facebook/react-native/commit/359601948923baf7304d223260be3926c5b81db0) by [@coado](https://github.com/coado))
- **runtime** Add missing methods to the WithRuntimeDecorator class. ([993f9fd8db](https://github.com/facebook/react-native/commit/993f9fd8db5fe4df495b3a3454273b0e11fef489) by [@neildhar](https://github.com/neildhar))
- **runtime:** Undo breaking change on ViewManagerDelegate.kt String params (ce1620616c by @cortinico)
- **runtime:** Undo breaking change on UIManager eventDispatcher accessor (55671c00e5 by @cortinico)
- **Scrollview:** Properly make ScrollView compatible with React 19 ([b395208303](https://github.com/facebook/react-native/commit/b39520830341cae8c3785250cbaf2ec99958ba69) by [@cipolleschi](https://github.com/cipolleschi))
- **Scrollview:** Make ScrollView compatible with React 19 ([8041e410e3](https://github.com/facebook/react-native/commit/8041e410e3b8ea135dc5f08daddd5ceface24439) by [@cipolleschi](https://github.com/cipolleschi))
- **SectionList:** Loosen SectionList `renderItem` required return type ([12b64b7824](https://github.com/facebook/react-native/commit/12b64b78247f2db929c6d421262bdec1f6402e0b) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Fixed `alignItems: 'baseline'` not working correctly on the new architecture ([2932c0f71f](https://github.com/facebook/react-native/commit/2932c0f71f1882607d9e579e5c09db28e131a4c9) by [@j-piasecki](https://github.com/j-piasecki))
- **style:** Linear gradient color stop spec. ([1a49892d57](https://github.com/facebook/react-native/commit/1a49892d574e3b77a75df8cfc77307a7d5daab35) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **TextInput:** Fixed fontWeight number value error for text optimized ([2a230694c4](https://github.com/facebook/react-native/commit/2a230694c421bf338699506a0044c26fd4c1eb55) by [@meetdhanani17](https://github.com/meetdhanani17))
- **typescript:** Allow read only array type for transform property ([c16defaff2](https://github.com/facebook/react-native/commit/c16defaff2964a2b30656def35eb3450cff9cd71) by [@tjzel](https://github.com/tjzel))
- **typescript:** Add missing `submitBehavior` prop and mark `blurOnSubmit` prop as deprecated in Typescript declaration file of `TextInput` ([1dcbf41725](https://github.com/facebook/react-native/commit/1dcbf41725a7296c0a0f33c4e0cc3a11e8780889) by [@thisisgit](https://github.com/thisisgit))
#### Android specific
- **Animated:** Fix scheduled animated operations not being executed in some cases ([dc8c8ebc5b](https://github.com/facebook/react-native/commit/dc8c8ebc5b7b6315b3c8e79028a80611a796ea7e) by [@j-piasecki](https://github.com/j-piasecki))
- **Animated** Sync the Shadow Tree and the Native Tree with Native animation when scroll is driving the animation ([394aae1c1c](https://github.com/facebook/react-native/commit/394aae1c1cc354eaefb762455e2bbeeec0503038) by [@cipolleschi](https://github.com/cipolleschi))
- **Appearance:** Ensure Appearance change listener does not skip events ([7041ed28f0](https://github.com/facebook/react-native/commit/7041ed28f092e7c6c1dac35f0ce6af095cd9a072) by [@vonovak](https://github.com/vonovak))
- **DevMenu:** Add missing Android implementation for DevMenu Module ([1bdae07d89](https://github.com/facebook/react-native/commit/1bdae07d89fdda486d3f9dbcc4aa5cbb026fc8b6) by [@cortinico](https://github.com/cortinico))
- **devtools** Fix issue with `NativeDevSettings.setIsDebuggingRemotely` where the app would keep on restarting if remote debugging was invoked from an action / component that was called on app start. ([beebf4a0a3](https://github.com/facebook/react-native/commit/beebf4a0a36c4ee9dc52631afdf2b25745a1b0f2) by [@Sushant-Sardeshpande](https://github.com/Sushant-Sardeshpande))
- **Image** Make Imagesource `open` for inheritance ([0e805a953d](https://github.com/facebook/react-native/commit/0e805a953d8c2e91790a2f9fa2da7850478231b7) by [@cortinico](https://github.com/cortinico))
- **Image** Fix ReactImageView.hasOverlappingRendering() ([2bed2ab1a6](https://github.com/facebook/react-native/commit/2bed2ab1a658230cb6fa23fdcb4e5a962f496e18) by [@NickGerleman](https://github.com/NickGerleman))
- **infra:** Expose `react_timing` headers in `reactnative` prefab ([b1d42c8ef2](https://github.com/facebook/react-native/commit/b1d42c8ef2eb54af48ad27d3dc121e15c07d3dba) by [@tomekzaw](https://github.com/tomekzaw))
- **infra:** RNGP - Sanitize the output of the config command ([d7884a6bb8](https://github.com/facebook/react-native/commit/d7884a6bb8f2d8fd08dfd7d2817a4fc25f61a57c) by [@cortinico](https://github.com/cortinico))
- **infra** Fix NPE in FileReaderModule ([fd4531fe23](https://github.com/facebook/react-native/commit/fd4531fe234149f4f078a1e73ec68145f9da20b3) by [@cortinico](https://github.com/cortinico))
- **infra** Properly set `REACTNATIVE_MERGED_SO` for autolinked libraries ([c005609b01](https://github.com/facebook/react-native/commit/c005609b0155223f3ae778c5cd96bc78c4dfe399) by [@cortinico](https://github.com/cortinico))
- **logging** Fix LogModule to create view when show is called ([0847384a45](https://github.com/facebook/react-native/commit/0847384a4598d9bbc8987788047bc58d7596881d) by [@fannnzhang](https://github.com/fannnzhang))
- **Modal**: Deprecating ModalHostShadowNode and ModalHostHelper classes ([77b3a8bdd6](https://github.com/facebook/react-native/commit/77b3a8bdd6164b4c2407e53cb0e27075c3ea7213) by [@alanleedev](https://github.com/alanleedev))
- **Modal** PointerEvents from Modal would not be dispatched correctly in new architecture. ([75114e3672](https://github.com/facebook/react-native/commit/75114e36726979625674b2c75a77ac330fccc4d6) by [@javache](https://github.com/javache))
- **networking** Fix uploading GIF URI ([48669af562](https://github.com/facebook/react-native/commit/48669af562d6d3ed7835816d60a2fb400a22a19b) by [@s77rt](https://github.com/s77rt))
- **RedBox:** RedBox content overlapping with system bars on Android 15 forced edge-to-edge ([97b661c3f0](https://github.com/facebook/react-native/commit/97b661c3f07ab0269b707b209139d5c1648d1e03) by [@alanleedev](https://github.com/alanleedev))
- **renderer** Fixed black strip coming when hiding status bar ([f6b6d001a0](https://github.com/facebook/react-native/commit/f6b6d001a0e0241a9d637cd5e532f0d8610d9ee1) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **renderer** Fix Android removeClippedSubviews in RTL ([ea6928fcb9](https://github.com/facebook/react-native/commit/ea6928fcb95c19e84f8f2851f28d0cd4343c6a26) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix Headless Crash `Tried to finish non-existent task with id` ([b4532adad4](https://github.com/facebook/react-native/commit/b4532adad4e38e1237631778f7b8c917a9ccf746) by [@RodolfoGS](https://github.com/RodolfoGS))
- **runtime** Optimize BaseViewManager#setTransform to ignore duplicate values ([3df0f3b9ff](https://github.com/facebook/react-native/commit/3df0f3b9ff4cc9cd6846ef02101baf8e9605d6a0) by [@javache](https://github.com/javache))
- **runtime** Make getUri and isResource open ([8c81ffa60a](https://github.com/facebook/react-native/commit/8c81ffa60a211e4ae7db50cd04de0e4a4c29df04) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **runtime** Do not destroy views when there is a touch going on for New Architecture ([6b7f68240e](https://github.com/facebook/react-native/commit/6b7f68240e08c64ced29ed3d7a1f95db96a6eef4) by [@cortinico](https://github.com/cortinico))
- **runtime** Annotate ReactRootView.createRootView with nullable ([6a1ecbb2bb](https://github.com/facebook/react-native/commit/6a1ecbb2bb3942e7487532262f2a4fc55f94fcad) by [@shwanton](https://github.com/shwanton))
- **runtime** Made several methods in ReactNativeHost.java thread-safe to avoid race conditions ([f9ac5b737a](https://github.com/facebook/react-native/commit/f9ac5b737a0e14c76f35840efcf348f1c7704363) by Jack Su)
- **runtime** Fixed Headless JS tasks in New Architecture ([9a1ae97c22](https://github.com/facebook/react-native/commit/9a1ae97c22868a312000f3ac50dacf9a8125d273) by [@robik](https://github.com/robik))
- **runtime** Fix default for `showsHorizontalScrollIndicator` and `showsVerticalScrollIndicator` ([3af01a8a44](https://github.com/facebook/react-native/commit/3af01a8a44853246d3deb957c4a1c65e43848bb5) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Adds a null check in react context getter ([aeb020dfa3](https://github.com/facebook/react-native/commit/aeb020dfa34d06b63fa0151be302287d0a3fb84f) by Peter Abbondanzo)
- **runtime** Fix ReactFragment on New Architecture ([52322fbd0e](https://github.com/facebook/react-native/commit/52322fbd0e641726b224b2b9b89d99d93dbc6e33) by [@cortinico](https://github.com/cortinico))
- **style** Don't use mGapBetweenPaths if not drawing a border ([8501b6396b](https://github.com/facebook/react-native/commit/8501b6396b0a4fd7a9bd2add2b3c8b9c755c27ae) by [@knappam](https://github.com/knappam))
- **style** Linear gradient border styles ([20e3f4518f](https://github.com/facebook/react-native/commit/20e3f4518feac70e8ac9b1cc4fc1cbb029df96e4) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **style** Gracefully handle unexpected overflow values ([82094dd9e3](https://github.com/facebook/react-native/commit/82094dd9e33d94f65fd2548f5b04a19fb89bad0f) by [@NickGerleman](https://github.com/NickGerleman))
- **style** Fix "setTranslucentBackgroundDrawable()" deprecation version ([35d9a18b81](https://github.com/facebook/react-native/commit/35d9a18b81ff9448459c9fb033f4fea1fa17dab3) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Add missing invalidate() to setOverflow() ([087193c98e](https://github.com/facebook/react-native/commit/087193c98ead8f12ec4f839dd077d5bd63075d6f) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Add borderStartWidth and borderEndWidth support ([92dca53702](https://github.com/facebook/react-native/commit/92dca5370239f2c9881455b683ff384e2187430f) by [@NickGerleman](https://github.com/NickGerleman))
- **style** Fixed text shadow rendering with artifacts when `backgroundColor` was set on the `TextInput` ([83716298f8](https://github.com/facebook/react-native/commit/83716298f8dd6a1f3128965225858b4c6d3b2477) by [@j-piasecki](https://github.com/j-piasecki))
- **Text** Fix measuring text with incorrect hyphenationFrequency ([fc8224036b](https://github.com/facebook/react-native/commit/fc8224036b4b5880c881f471e432ee5b47113b0b) by [@NickGerleman](https://github.com/NickGerleman))
- **TextInput:** fixed select text on auto focus for TextInput ([18d6028ff9](https://github.com/facebook/react-native/commit/18d6028ff908eef99aae363d8ee9a6789d264284) by [@kunalchavhan](https://github.com/kunalchavhan))
- **TextInput** TextInput's `contextMenuHidden` prop bug fix ([8a3ffb6d23](https://github.com/facebook/react-native/commit/8a3ffb6d23f169752891eddc7dad9e34cb2d861c) by [@alanleedev](https://github.com/alanleedev))
#### iOS specific
- **devtools** Fix position of RCTPerfMonitor in landscape mode & expanded mode ([258f41a30f](https://github.com/facebook/react-native/commit/258f41a30f5a797c0cfdb256a6824b7284dcc8e2) by [@krozniata](https://github.com/krozniata))
- **Appearance** Fixes Appearance user interface style when app run from background ([efa9711e35](https://github.com/facebook/react-native/commit/efa9711e35f528245cdfb6c7028129c97ae10192) by [@zhongwuzw](https://github.com/zhongwuzw))
- **c++** Fixes NSDataBigString length calculation ([bb3c51dc84](https://github.com/facebook/react-native/commit/bb3c51dc84e9514f55ca8a1e3abb1af140563c7b) by Tzvetan Mikov)
- **codegen** Codegen will start looking for codegen-enabled dependencies from the project root. ([46d17efa62](https://github.com/facebook/react-native/commit/46d17efa626cd546e839648e1a95f43a3802051c) by [@dmytrorykun](https://github.com/dmytrorykun))
- **Hermes**: Exclude dSYM from the archive ([7e14ec5177f](https://github.com/facebook/react-native/commit/7e14ec5177fd17ca9f1db384026b26ae90ab0b00) by [@cipolleschi](https://github.com/cipolleschi))
- **Image** Fixes race condition when setup image loader ([6b104bbe01](https://github.com/facebook/react-native/commit/6b104bbe015c93a40a73232fdb92a99e3799b7ac) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Image** Fixed crash in RCTImageUtils ([3572ef3f1b](https://github.com/facebook/react-native/commit/3572ef3f1b5b11c1ecfa21f0246cbba5941bbe0f) by [@pavelgurkovskiy](https://github.com/pavelgurkovskiy))
- **Image** Data race in `RCTImageLoader` related to assignment of cancellation block. ([0f051f6034](https://github.com/facebook/react-native/commit/0f051f603492f97a85e051f112d96180352bba77) by [@hakonk](https://github.com/hakonk))
- **Image** Fixes Image load event in new arch ([7698cd0953](https://github.com/facebook/react-native/commit/7698cd09536ebf99c3b56696a7bb75d714abfb18) by [@zhongwuzw](https://github.com/zhongwuzw))
- **infra** Add back the BUNDLE_COMMAND ([cf42288181](https://github.com/facebook/react-native/commit/cf422881819decccdd2b486fbb73f2192b9ec522) by [@Vin-Xi](https://github.com/Vin-Xi))
- **infra** Resolve Hermes prebuilt version based on react-native package ([b10ed0e19d](https://github.com/facebook/react-native/commit/b10ed0e19d8eec388305962667561e0cb95a3f25) by [@okwasniewski](https://github.com/okwasniewski))
- **infra** Support bundle install from outside the ios folder using --project-directory ([b22970e3cf](https://github.com/facebook/react-native/commit/b22970e3cfbe603bffea5b1c3bbf150887e3d7b8) by [@blakef](https://github.com/blakef))
- **infra** Use CONFIG_CMD if set ([774fe0cf6f](https://github.com/facebook/react-native/commit/774fe0cf6f22f832b756c166599973d9db6a93de) by [@krystofwoldrich](https://github.com/krystofwoldrich))
- **infra** Fixes FORCE_BUNDLING error when bundle js ([089e8289ba](https://github.com/facebook/react-native/commit/089e8289ba6cba0821b76207a2dce316b1621c3d) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Modal** App crash happening when navigate to a new app screen with a displaying modal ([52888c0c1e](https://github.com/facebook/react-native/commit/52888c0c1e722a799f233c2f502e01b9dd4a7174) by Zhi Zhou)
- **Networking:** Fix: on iOS not getting 304 from `If-None-Match` request ([b8ab0fe703](https://github.com/facebook/react-native/commit/b8ab0fe703f1a0aca796bc15641d029a2036105f) by [@huzhanbo1996](https://github.com/huzhanbo1996))
- **Networking** Fix data race related to access on `RCTNetworkTask.status`. ([b1ec698dc4](https://github.com/facebook/react-native/commit/b1ec698dc4baf34ba2e31b7ad43dff97c229bf99) by [@hakonk](https://github.com/hakonk))
- **RedBox** Mac Catalyst crash in RCTRedBox ([84fe531952](https://github.com/facebook/react-native/commit/84fe531952d4b97c3cb0d84322abdf8953382ad6) by [@sbuggay](https://github.com/sbuggay))
- **RedBox** Fix rendering `RCTRedBoxExtraData` ([c9d589dab5](https://github.com/facebook/react-native/commit/c9d589dab5148cbd192078967f743d38b8048c6e) by [@krozniata](https://github.com/krozniata))
- **rendering:** Properly retain/release backgroundColor in RCTBorderDrawing ([47748c7935](https://github.com/facebook/react-native/commit/47748c7935540014abed03b4d2ff809b471c4fe3) by [@Saadnajmi](https://github.com/Saadnajmi))
- **RefreshControl:** Fixed an issue where the refresh control would not behave correctly if it was offscreen. ([a8be335a37](https://github.com/facebook/react-native/commit/a8be335a37eb792a7c6ccb7f577459020a2fc43c) by [@deepanshushuklad11](https://github.com/deepanshushuklad11))
- **RefreshControl:** Fix applying of tintColor and progressViewOffset props for RefreshControl component with New Architecture enabled ([19d468fed9](https://github.com/facebook/react-native/commit/19d468fed966f2adb973ad3f19a97a5ec0372e3a) by [@TuTejsy](https://github.com/TuTejsy))
- **RefreshControl:** Passed correct title and titleColor prop to updateTitle function ([5c7a166dca](https://github.com/facebook/react-native/commit/5c7a166dcaf5400fbc4c12d4c8b451228157c036) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **runtime** Fixed a crash when navigating away from a screen that contains a scrollView ([c6f32828b9](https://github.com/facebook/react-native/commit/c6f32828b9487381dab27f645aedcdbae9dcbc7e) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime** Data race related to read/write on `ReactMarker::logTaggedMarkerImpl` ([7e41ea4c9d](https://github.com/facebook/react-native/commit/7e41ea4c9de943a5c73ca9821bf552d39aa49dcd) by [@hakonk](https://github.com/hakonk))
- **runtime** Fixes typo of function callFunctionOnBufferedRumtimeExecutor ([4e12c2e37c](https://github.com/facebook/react-native/commit/4e12c2e37cb168f09f8768941cb915e4024a1c34) by [@zhongwuzw](https://github.com/zhongwuzw))
- **runtime** Fixes main thread stuck when reload in bridgeless mode ([a778979ed6](https://github.com/facebook/react-native/commit/a778979ed604d1dc7707faf4a3836e3deba136c6) by [@zhongwuzw](https://github.com/zhongwuzw))
- **runtime** Fixing maxLength check which was firing onChange multiple times ([d88dd14507](https://github.com/facebook/react-native/commit/d88dd145074ee84de0cc4207de02a3cd79c9ceff) by [@deepanshushuklad11](https://github.com/deepanshushuklad11))
- **runtime** Use std::atomic for eliminating races in RCTCxxBridge. ([8204134024](https://github.com/facebook/react-native/commit/8204134024e81947969bd8c2ba337dc931e54bd9) by [@hakonk](https://github.com/hakonk))
- **runtime** Fix legacy view interop apis not available in view method ([19cffab383](https://github.com/facebook/react-native/commit/19cffab3837c24f2e8470a31bbd8e8338d1c1b6c) by [@janicduplessis](https://github.com/janicduplessis))
- **ScrollView** Implement automicallyAdjustsKeyboardInsets for new arch ([e4e461c9cf](https://github.com/facebook/react-native/commit/e4e461c9cf969e1a1dfca6448ca6084b7f45ef7d) by [@okwasniewski](https://github.com/okwasniewski))
- **ScrollView** Implement automicallyAdjustsKeyboardInsets for new arch ([21bdce7286](https://github.com/facebook/react-native/commit/21bdce7286fc493b9601add3bf67d549b792d29b) by [@okwasniewski](https://github.com/okwasniewski))
- **StatusBarManager** Retrieve status bar size using RCTUIStatusBarManager ([34cd195d9f](https://github.com/facebook/react-native/commit/34cd195d9fbd075a161afbfac842f896355991e1) by [@okwasniewski](https://github.com/okwasniewski))
- **style** fix: background color fix when border is dotted and dashed ([b243d343fa](https://github.com/facebook/react-native/commit/b243d343fa741de94537d8535f76714ff2985101) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **style** Fixes ellipsis carries background from trimmed text ([9e2f8859c4](https://github.com/facebook/react-native/commit/9e2f8859c4d237ae2bee4679da45038405b7074e) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text** Fixed baseline attachment position in multiline text ([9bfbf948df](https://github.com/facebook/react-native/commit/9bfbf948dfd23c891233e747cbaeeb6480f5fa41) by [@j-piasecki](https://github.com/j-piasecki))
- **Text** Clean up RCTParagraphComponentView & RCTParagraphTextView ([9239ad1c6b](https://github.com/facebook/react-native/commit/9239ad1c6bac2c2400f940708d823d7b2c2457c4) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text** Fixes Italic text not work ([9cfd9dd1c7](https://github.com/facebook/react-native/commit/9cfd9dd1c7f8c37c156f1a9ff812183f80d67926) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text** Fixes ellipsis carries background from trimmed text ([fcb6cdc710](https://github.com/facebook/react-native/commit/fcb6cdc7108103527268aef42a77e530f9482668) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text** Fixed text baseline being moved upwards in certain cases ([01f7ab814f](https://github.com/facebook/react-native/commit/01f7ab814f847eb3038efa7120d81e92e3ff4187) by [@j-piasecki](https://github.com/j-piasecki))
- **TextInput** Fixes TextInput crash when undo if text longer than maxLength ([9b9c780cc8](https://github.com/facebook/react-native/commit/9b9c780cc8b54e2c1cd61f9fac0554488f68dea8) by [@zhongwuzw](https://github.com/zhongwuzw))
### Security
- **infra:** Upgrade grpc/grpc-js from 1.7.0 to 1.10.9 (CVE-2024-37168) ([295626bc35](https://github.com/facebook/react-native/commit/295626bc35326cc68c127ff515dcbb8e9d7d44e3) by [@GijsWeterings](https://github.com/GijsWeterings))
- **infra:** Upgrade braces from 3.0.2 to 3.0.3 (CVE-2024-4068) ([d538879e08](https://github.com/facebook/react-native/commit/d538879e08360b8230410fc893a50489bad5cf60) by [@GijsWeterings](https://github.com/GijsWeterings))
- **infra:** Update ws from 7.5.1 to 7.5.10 (CVE-2024-37890) ([13f1b9e10f](https://github.com/facebook/react-native/commit/13f1b9e10f6045421808714f7e62aa17bfb3e891) by [@GijsWeterings](https://github.com/GijsWeterings))
- **infra:** Update ws from 6.2.2 to 6.2.3 (CVE-2024-37890) ([80cfacef78](https://github.com/facebook/react-native/commit/80cfacef78f34d3786d955084a8bf4d42ea37f1b) by [@GijsWeterings](https://github.com/GijsWeterings))
## v0.75.4
### Fixed
#### Android specific
- Fix Headless Crash `Tried to finish non-existent task with id` ([56a282c44d](https://github.com/facebook/react-native/commit/56a282c44d1a3ee5114c2cba36b902bc9ae123b9) by [@RodolfoGS](https://github.com/RodolfoGS))
- TextInput's `contextMenuHidden` prop bug fix ([366f1d0df3](https://github.com/facebook/react-native/commit/366f1d0df302af860b1fa9ea5f0bd757f2dec7b3) by [@alanleedev](https://github.com/alanleedev))
- RNGP - Sanitize the output of the config command ([0265ea0577](https://github.com/facebook/react-native/commit/0265ea0577963cca582682c3fc8ee97f3ebef65e) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- Convert `NSNull` to `nil` before checking `type` in `readAsDataURL` ([99ab845a5c](https://github.com/facebook/react-native/commit/99ab845a5cf0fe3463ff39b03373b95d4f5c0fac) by [@haileyok](https://github.com/haileyok))
- Add back the BUNDLE_COMMAND ([afd74ad89d](https://github.com/facebook/react-native/commit/afd74ad89de6e632eea776e6d2689e7381c4f78c) by [@Vin-Xi](https://github.com/Vin-Xi))
- Use CONFIG_CMD if set ([a4ec49cbe6](https://github.com/facebook/react-native/commit/a4ec49cbe6d0157417276731ba1608e482f3f10e) by [@krystofwoldrich](https://github.com/krystofwoldrich))
- App crash happening when navigate to a new app screen with a displaying modal ([8ec672204d](https://github.com/facebook/react-native/commit/8ec672204d5dee2b967cac08adf03c082e36ad79) by [@zhouzh1](https://github.com/zhouzh1))
## v0.75.3
### Changed
- **Infra:** Remove resolution and add commander as devDependency for the monorepo ([cf7b9b9486](https://github.com/facebook/react-native/commit/cf7b9b9486069a8a3cf4443353603fcb2174d012) by [@cipolleschi](https://github.com/cipolleschi))
- **CLI:** Bump CLI to 14.1.0 ([6a08c38263](https://github.com/facebook/react-native/commit/6a08c38263a544d88157cc3a6b1ee44ed28f7db0) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- **TypeScript:** Allow readonly array type for transform property ([c16defaff2](https://github.com/facebook/react-native/commit/c16defaff2964a2b30656def35eb3450cff9cd71) by [@tjzel](https://github.com/tjzel))
#### Android specific
- **Autolinking:** Fix autolinking issues for Pure C++ TurboModules ([833c3a2cf5](https://github.com/facebook/react-native/commit/833c3a2cf5df6b65c6fe75577da2df7c5a085e8d) by [@hsjoberg](https://github.com/hsjoberg))
- **Renderer:** Don't use mGapBetweenPaths if not drawing a border ([8501b6396b](https://github.com/facebook/react-native/commit/8501b6396b0a4fd7a9bd2add2b3c8b9c755c27ae) by [@knappam](https://github.com/knappam))
- **Image:** Make getUri and isResource open ([8c81ffa60a](https://github.com/facebook/react-native/commit/8c81ffa60a211e4ae7db50cd04de0e4a4c29df04) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **RGNP:** Remove unnecessary dependency on `gradle-tooling-api-builders` - serviceOf failure ([1067798a7e](https://github.com/facebook/react-native/commit/1067798a7e9ad06f8a22c1749e582c42348a554d) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- **Infra:** Include x86_64 slice when building for visionOS simulator
([05dec917f2](https://github.com/facebook/react-native/commit/05dec917f2e5f8288c0d9f31bc50c10bd0c0eab3) by [@okwasniewski](https://github.com/okwasniewski))
- **Infra:** Support bundle install from outside the ios folder using --project-directory ([b22970e3cf](https://github.com/facebook/react-native/commit/b22970e3cfbe603bffea5b1c3bbf150887e3d7b8) by [@blakef](https://github.com/blakef))
- **Codegen:** Codegen will start looking for codegen-enabled dependencies from the project root. ([46d17efa62](https://github.com/facebook/react-native/commit/46d17efa626cd546e839648e1a95f43a3802051c) by [@dmytrorykun](https://github.com/dmytrorykun))
## v0.75.2
### Added
#### Android specific
- **runtime:** Add support for handling `com.facebook.react.bridge.Dynamic` as parameter for TurboModules ([45cd81706d](https://github.com/facebook/react-native/commit/45cd81706d2c9ef7b792a716298cefa92ca2773a) by [@cortinico](https://github.com/cortinico))
### Changed
#### Android specific
- **ReactRootView:** Replaced `mLastHeight` with `mVisibleViewArea.height()` since mLastHeight value is not getting updated. For `width` we are already using `mVisibleViewArea.width()` ([603eb94dd9](https://github.com/facebook/react-native/commit/603eb94dd934f11ff568a3bd814e310bcbf152e1) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **ImageSource:** `open` for inheritance ([02d9979c32](https://github.com/facebook/react-native/commit/02d9979c3298ff9c5c4490847f94242d7ef9ea3a) by [@cortinico](https://github.com/cortinico))
### Removed
#### iOS specific
- **RCTBaseTextInputView:** UIReturnKeyDefault ([26aff664c0](https://github.com/facebook/react-native/commit/26aff664c07f129e64e60b42aa0c7eeaa79a93c3) by [@elencho](https://github.com/elencho))
### Fixed
- **codegen:** scripts require `yargs` ([0979921850](https://github.com/facebook/react-native/commit/0979921850b33a8c1abdf9d256138b78a403133a) by [@tido64](https://github.com/tido64))
## v0.75.1
### Changed
- **hermes:** Bump Hermes version ([f202e80177](https://github.com/facebook/react-native/commit/f202e801776794ec30b2dc25fe87e52ec77c18ab) by [@cortinico](https://github.com/cortinico))
### Removed
#### Android specific
- **renderer:** Gate off % border radii on Android Paper ([bbd5b5e157](https://github.com/facebook/react-native/commit/bbd5b5e1574499478ab0bf3fe9d2a21b02b7fedd) by [@NickGerleman](https://github.com/NickGerleman))
- **renderer:** Gate off % translate on Android Paper ([0273123dde](https://github.com/facebook/react-native/commit/0273123dde04de72da4ebfeff26b0830eea00745) by [@NickGerleman](https://github.com/NickGerleman))
## v0.75.0
### Breaking
- **codegen:** Use hasteModuleName for C++ Turbo Module enums ([b7fc5867f2](https://github.com/facebook/react-native/commit/b7fc5867f2f8248db8230ce3602077547ca971a1) by [@christophpurrer](https://github.com/christophpurrer))
- **codegen:** Use hasteModuleName for C++ Turbo Module structs ([07261d0408](https://github.com/facebook/react-native/commit/07261d0408e0250738504914ed931e71b838450e) by [@christophpurrer](https://github.com/christophpurrer))
- **codegen:** Don't support 'float' enums in Turbo Modules ([536edf3726](https://github.com/facebook/react-native/commit/536edf3726c7de161bca5075110eaad0bd58c08e) by @christophpurrer)
- **codegen:** Native modules using the codegen now throw an error when called with `null` for optional but not nullable arguments. ([67b9628af5](https://github.com/facebook/react-native/commit/67b9628af588e8fc778d732fc387dbd48acf705e) by [@rubennorte](https://github.com/rubennorte))
- **typescript:** Transform TouchableHighlight from JS `class` to `ForwardRef` component ([401f2fbb14](https://github.com/facebook/react-native/commit/401f2fbb14b1cfea93220810cce79b47720ecc72) by [@retyui](https://github.com/retyui))
- **typescript:** Transform `TouchableOpacity` from JS `class` to `ForwardRef` component ([3d00549399](https://github.com/facebook/react-native/commit/3d0054939929608d317dc1e75a21dd20b9930eda) by [@retyui](https://github.com/retyui))
- **eslint:** RN ESLint config no longer runs Prettier during ESLint ([727f30bd0b](https://github.com/facebook/react-native/commit/727f30bd0b27ff168e6a6556a9ffbc7e42dbb8f0) by [@gaearon](https://github.com/gaearon))
- **c++:** ScrollViewShadowNode.h - Make getContentOriginOffset to know info about if call-site want transform or not ([ce588db63f](https://github.com/facebook/react-native/commit/ce588db63fb6510b8c06b85a82008a72c778792d) by [@realsoelynn](https://github.com/realsoelynn))
- **c++:** RuntimeExecutor.h - Remove executeAsynchronously and executeSynchronously_CAN_DEADLOCK ([8b1a01610c](https://github.com/facebook/react-native/commit/8b1a01610c256beab43b093ced4f22eafbb943d9) by [@philIip](https://github.com/philIip))
- **c++:** JsErrorHandler.h - Rename JsErrorHandlingFunc to OnJsError ([2e3f2268dc](https://github.com/facebook/react-native/commit/2e3f2268dccff379cbf0c2767465c8d20c38fdc5) by [@RSNara](https://github.com/RSNara))
- **c++:** JsErrorHandler.h - Rename handleJsError to handleFatalError ([c041b9f40f](https://github.com/facebook/react-native/commit/c041b9f40f092d981fdfa01cd5dc3cbe6e874b5e) by [@RSNara](https://github.com/RSNara))
- **c++:** ReactPrimitives.h - Remove unused imports (folly/dynamic.h) ([4fd95b6e02](https://github.com/facebook/react-native/commit/4fd95b6e02c82386ad85cea51f118f8055e4eb50) by [@christophpurrer](https://github.com/christophpurrer))
- **c++:** LongLivedObjectCollection.h - Make `LongLivedObjectCollection::get` accept a Runtime reference as parameter. ([86a52cc2dc](https://github.com/facebook/react-native/commit/86a52cc2dc294131e138b1f6ee14b3e56e8c8572) by [@fabriziocucci](https://github.com/fabriziocucci))
- **c++:** LongLivedObject.h - Make `LongLivedObject` constructor accept a `Runtime` reference. ([3706bf077e](https://github.com/facebook/react-native/commit/3706bf077e62b82a8c15874ac1ee6f0a7497468d) by [@fabriziocucci](https://github.com/fabriziocucci))
- **c++:** Rename utils/jsi files ([d0cac87c6e](https://github.com/facebook/react-native/commit/d0cac87c6ea6caf528f0c164d4b43e3cfbb0b0b8) by [@TatianaKapos](https://github.com/TatianaKapos))
- **TextInput:** Remove deprecated onTextInput callback ([34a50ae8ef](https://github.com/facebook/react-native/commit/34a50ae8ef559f309117d5b6abe0b68b2b349fa4) by [@javache](https://github.com/javache))
- **Pressability:** Removed deprecated methods from Pressability. ([e4f3338069](https://github.com/facebook/react-native/commit/e4f3338069bfe70217a46239c468e4f12fa179fc) by [@javache](https://github.com/javache))
- **cli:** Remove the ram-bundle command. ([58b45e86a6](https://github.com/facebook/react-native/commit/58b45e86a6fd78409dc358e27ae736c95fee9f39) by [@blakef](https://github.com/blakef))
#### Android specific
- **ReactViewBackgroundDrawable:** Deprecate `ReactViewBackgroundDrawable` in favor of `CSSBackgroundDrawable` ([d7766fa927](https://github.com/facebook/react-native/commit/d7766fa9273ac47dc28935973b0402345b707885) by [@NickGerleman](https://github.com/NickGerleman))
- **ReactContext:** Make ReactApplicationContext and ReactContext abstract. Please instantiate BridgeReactContext instead (bridge mode). Or BridgelessReactContext instead (bridgeless mode). ([e69f6755c8](https://github.com/facebook/react-native/commit/e69f6755c8d73e412acc444fbb1d36cad472e1bc) by [@RSNara](https://github.com/RSNara))
- **layout:** Enable flex gap percentage value for RN. ([41a14962fc](https://github.com/facebook/react-native/commit/41a14962fc7adaf434f1634b17f3d66261e30a9f) by [@realsoelynn](https://github.com/realsoelynn))
- **layout:**: Set and require `android:supportsRtl="true"` for RTL layout ([82c6f8a580](https://github.com/facebook/react-native/commit/82c6f8a58056cfa163a61a4e6668a54625b15d06) by [@NickGerleman](https://github.com/NickGerleman))
- **turbomodule:** JSIModule - Deleting this class as you should be using `TurboModule` instead ([73b4d67a78](https://github.com/facebook/react-native/commit/73b4d67a78e003d62c660cf3c710e01b29512c4a) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **runtime:** ReactHostImpl - Removing `ReactJsExceptionHandler` param from constructor and providing a default private implementation ([fe7e7a015f](https://github.com/facebook/react-native/commit/fe7e7a015f30697c4ccffb2ba6474611efb4c08a) by [@alanleedev](https://github.com/alanleedev))
- **DevSupport:** DevSupportManagerFactory - Method `.create()` changed to take an additional parameter of type `PausedInDebuggerOverlayManager` (nullable) ([1d26907ca4](https://github.com/facebook/react-native/commit/1d26907ca4d00cfa52f6395624b3121a7e96aca1) by [@motiz88](https://github.com/motiz88))
- **runtime:** OnLoad.cpp - Make the app responsible for returning core turbomodule if not using default app setup/template ([7facb32f30](https://github.com/facebook/react-native/commit/7facb32f30d17eb27f870dd531d3dc7ebe4532f6) by [@RSNara](https://github.com/RSNara))
- **measurement:** Delete UIManagerModule.measureLayoutRelativeToParent() ([958f8e2bb5](https://github.com/facebook/react-native/commit/958f8e2bb55ba3a2ace9507a48a582f546dd3ec2) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **PopUpMenu** UIManager.showPopupMenu() and UIManager.dismissPopupMenu() have been removed ([c631e93341](https://github.com/facebook/react-native/commit/c631e93341a33031f44087bc20c7e35e053d7d93) by [@alanleedev](https://github.com/alanleedev))
- **ReactContext:** Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead. ([fb23470483](https://github.com/facebook/react-native/commit/fb234704832513d655a2890458eec66f873a5674) by [@RSNara](https://github.com/RSNara)), ([05ef779c0b](https://github.com/facebook/react-native/commit/05ef779c0b1722ad3827f382f7d3de5d0391afb0) by [@fabriziocucci](https://github.com/fabriziocucci)), ([14fb1cc335](https://github.com/facebook/react-native/commit/14fb1cc335b900666ef4fe6cec6a23a7a95bcf76) by [@RSNara](https://github.com/RSNara)), and ([f99dc486cd](https://github.com/facebook/react-native/commit/f99dc486cdd742988320a8235c180ccecdcdd0d6) by [@RSNara](https://github.com/RSNara))
- **ReactContext** Remove getJavaScriptContextHolder() from BridgelessReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode ([4595351310](https://github.com/facebook/react-native/commit/4595351310f353aad5a5f7af0fe2989650675cdc) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **ReactContext** Remove getRuntimeExecutor() from ReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode ([f7b9aafd10](https://github.com/facebook/react-native/commit/f7b9aafd10a2f76c9bbdfdd1d925b4edf7a9dac3) by [@arushikesarwani94](https://github.com/arushikesarwani94))
#### iOS specific
- **runtime:** RCTHost.h - Remove `getSurfacePresenter` and `getModuleRegistry` ([f19371f28d](https://github.com/facebook/react-native/commit/f19371f28ddbb660ed08a3e38aef85f27f0876a7) by [@cipolleschi](https://github.com/cipolleschi))
- **Image:** Remove unused RCTImageLoadingPerfInstrumentationEnabled ([f6b9a42985](https://github.com/facebook/react-native/commit/f6b9a429853aa5fcb7895a144c77b538e9017c1e) by [@realsoelynn](https://github.com/realsoelynn))
- **Error Handling:** Remove `RCTRedBox` access through `RCTBridge` ([b5db214d2a](https://github.com/facebook/react-native/commit/b5db214d2a6cc6e2336edd423ceeaec06dd7b4fc) by [@realsoelynn](https://github.com/realsoelynn))
- **runtime** EventPriority - Remove EventPriority class and always use the default EventPriority::AsynchronousBatched. This is potentially a breaking change if something in OSS sets a different priority. If a build fails because of this, simply remove the use of EventPriority. ([55ed1c26ab](https://github.com/facebook/react-native/commit/55ed1c26ab7eda2a6ed1a7c41f3018b63fdd6a99) by [@sammy-SC](https://github.com/sammy-SC))
- **PushNotificationIOS:** RCTPushNotificationManager - Deleting deprecated didReceiveLocalNotification & didReceiveRemoteNotification callbacks ([7fffe692e7](https://github.com/facebook/react-native/commit/7fffe692e715004ac4fee6418dfe8a462e180b4b))
- **PushNotificationIOS:** PushNotificationIOS - Deleting deprecated alertAction and repeatInterval ([410e3b5ebd](https://github.com/facebook/react-native/commit/410e3b5ebd70fee7243c9c1d9d217cd912c01018))
- **PushNotificationIOS:** PushNotificationIOS - Deleting old push notification implementation ([916dde4c60](https://github.com/facebook/react-native/commit/916dde4c604b4bba0e510ee1ab5c0cf5bd19ecbe) by [@philIip](https://github.com/philIip))
- **cocoapods:** Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE ([6a1509f318](https://github.com/facebook/react-native/commit/6a1509f31858fad5aa1bdae4d6b0d10c5aebfaa4) by [@cipolleschi](https://github.com/cipolleschi))
- **cocoapods:** Rename React-Codegen to ReactCodegen ([6549216b76](https://github.com/facebook/react-native/commit/6549216b765b850a5751075ce270fcb78e76b778) by [@dmytrorykun](https://github.com/dmytrorykun))
- **TextInput:** Remove deprecated onTextInput callback ([24aece35b4](https://github.com/facebook/react-native/commit/24aece35b4a2bf196ad48900cdb8a3ca6ea53288) by [@Saadnajmi](https://github.com/Saadnajmi))
### Added
- **Image:** `Image.getSize/getSizeWithHeaders` method returns a promise if you don't pass a `success` callback ([2c1bcbac81](https://github.com/facebook/react-native/commit/2c1bcbac81dc4506196c000d72d52b7e9c1c1ec1) by [@retyui](https://github.com/retyui))
- **SectionList:** Fixes SectionList Unmounting issue with separatorComponent on data addition and removal. ([6204ea36d3](https://github.com/facebook/react-native/commit/6204ea36d321c9e27757d5f36ff7e74fa68c54d5) by [@Biki-das](https://github.com/Biki-das))
- **cli:** Move cli Android build into core ([62acc29896](https://github.com/facebook/react-native/commit/62acc29896b635c9e2d62d96c3d9533bb912b3a3) by [@blakef](https://github.com/blakef))
- **cli:** Move cli iOS build into core ([98f0893f39](https://github.com/facebook/react-native/commit/98f0893f392f33af3a6b4d20d8fcb25a4aac4a92) by [@blakef](https://github.com/blakef))
- **cli:** core-cli-utils now builds for Android ([89f16da89e](https://github.com/facebook/react-native/commit/89f16da89e5670f2c7fc21100c84607daa680336) by [@blakef](https://github.com/blakef))
- **codegen:** Add EventEmitter code-gen support for C++ Turbo Modules ([fd618819c7](https://github.com/facebook/react-native/commit/fd618819c7fd61422019ee1899980cb5ec4b5440) by [@christophpurrer](https://github.com/christophpurrer))
- **codegen:** Add function to only generate RNCore components ([9a27c08fb9](https://github.com/facebook/react-native/commit/9a27c08fb9c80eb4b65a8dc7bd96db09e301bf72) by [@cipolleschi](https://github.com/cipolleschi))
- **codegen:** Skip generation of RNCore if the files have been already generated ([03ba46f7e6](https://github.com/facebook/react-native/commit/03ba46f7e69d802530d43b5516da5f77def23fbd) by [@cipolleschi](https://github.com/cipolleschi))
- **debugger:** Add `ReactNativeApplication.[enable,metadataUpdated]` CDP messages for reading host metadata ([aced4072cf](https://github.com/facebook/react-native/commit/aced4072cfebb1c41a06a2a25179c4c0bd173fe0) by [@huntie](https://github.com/huntie))
- **debugger:** Inspector proxy: Add ping/pong keepalive to debugger connections. ([704756352c](https://github.com/facebook/react-native/commit/704756352c3228037063991385bdac2544322225) by [@robhogan](https://github.com/robhogan))
- **debugger:** Support opening React DevTools from both Chrome DevTools frontend (React Native DevTools) and `react-devtools` standalone app ([430dd0be26](https://github.com/facebook/react-native/commit/430dd0be26c44821b2bdc2e818a81ac8a0b4b970) by [@hoxyq](https://github.com/hoxyq))
- **runtime:** Add ReactRootViewTagGenerator ([7dec625eca](https://github.com/facebook/react-native/commit/7dec625ecabdc23cbae37e0034d29bb7bff17755) by [@christophpurrer](https://github.com/christophpurrer))
- **runtime:** Added missing `remove` methods for `Linking.addEventListener` and `AccessibilityInfo.addEventListener` Jest mocks ([2483c63017](https://github.com/facebook/react-native/commit/2483c63017b0d47c377bf67cb7c597e2d7e57897) by [@levibuzolic](https://github.com/levibuzolic))
- **runtime:** Implement `requestIdleCallback` and `cancelIdleCallback` in the new architecture ([abfadc6083](https://github.com/facebook/react-native/commit/abfadc60832b791892f81ae3f25dd8ac10ff7a99) by [@robik](https://github.com/robik))
- **style:** Added `AppRegistry.setRootViewStyleProvider` ([dbdd4da14f](https://github.com/facebook/react-native/commit/dbdd4da14f9baf5f533e1e0ae9b98fa0c644ec14) by [@acoates-ms](https://github.com/acoates-ms))
- **turbomodule:** Add EventEmitter C++ bridging type ([2a0a11256a](https://github.com/facebook/react-native/commit/2a0a11256a9919c70989aef00631da3a0f4afb25) by [@christophpurrer](https://github.com/christophpurrer))
- **turbomodule:** Turbo Module EventEmitters as functions ([42f136d00d](https://github.com/facebook/react-native/commit/42f136d00d0917bad8928839dea01e99bb0a1c98) by [@christophpurrer](https://github.com/christophpurrer))
- **typescript:** Add missing `Header` methods ([028615180b](https://github.com/facebook/react-native/commit/028615180b1fee8a4ab38a77163aa1fbfd68c6db) by [@retyui](https://github.com/retyui))
- **typescript:** Allow to pass empty string as style ([1ea269f42c](https://github.com/facebook/react-native/commit/1ea269f42c2ef10e95fcf4751e71fba8bb5fe80d) by [@retyui](https://github.com/retyui))
#### Android specific
- **Image:** Adds a new `Image` prop `resizeMultiplier` to help increase quality of small images on low DPI devices ([b6c3433537](https://github.com/facebook/react-native/commit/b6c343353765d8b13344841613250214fe8783db))
- **PopUpMenu:** Add (optional) onPopupDismiss() callback for PopupMenuAndroid ([bc3e3360d1](https://github.com/facebook/react-native/commit/bc3e3360d1bd3fde9ab4d28c49757e3db0dad7f9) by [@alanleedev](https://github.com/alanleedev))
- **StatusBar:** Added null checks, marked null safety in StatusBarModule ([7349dabae2](https://github.com/facebook/react-native/commit/7349dabae2eae35c8c24d544d7abf0d710ca26f8))
- **StatusBar:** Added suppression for deprecated getter/setter usage in StatusBarModule ([ac51deeaf4](https://github.com/facebook/react-native/commit/ac51deeaf43723927d5000bee30d7f0b7a16575e))
- **c++:** Allow bridgeless apps to register cxx modules via cxxreactpackages ([b9e52f0807](https://github.com/facebook/react-native/commit/b9e52f08073150f702b12dc5e38929e9651b806e) by [@RSNara](https://github.com/RSNara))
- **c++:** Introduce CallInvokerHolder stable API ([69bb4fca44](https://github.com/facebook/react-native/commit/69bb4fca44c4a6c094b6c4c5c03a7e9aefa7ed1f) by [@philIip](https://github.com/philIip))
- **colors** Update ColorPropConverter to support color function values ([4fb5573796](https://github.com/facebook/react-native/commit/4fb5573796e33868aefe4ebdcb8250e171af4989) by [@ryanlntn](https://github.com/ryanlntn))
- **colors:** Add isWideColorGamutEnabled to ReactActivityDelegate ([0a9891a2f2](https://github.com/facebook/react-native/commit/0a9891a2f2bf8c18e00d7a9c0f299a4161417466) by [@ryanlntn](https://github.com/ryanlntn))
- **colors:** Extend Property Processor to support long props ([0a80270187](https://github.com/facebook/react-native/commit/0a80270187c05fe2da1f25fb8a8426fd4f03f8f2) by [@cipolleschi](https://github.com/cipolleschi))
- **colors:** Update ColorPropConverter to support color function values ([fa7dbd578d](https://github.com/facebook/react-native/commit/fa7dbd578d6e0bd394591b30671aa0ff9bddf40c) by [@ryanlntn](https://github.com/ryanlntn))
- **colors:** Update bridge to handle long values ([0dc5c5f1f4](https://github.com/facebook/react-native/commit/0dc5c5f1f43701f396d2eb49bbabd2bfd2338cf4) by [@ryanlntn](https://github.com/ryanlntn))
- **error handling**: Option to set a custom JSExceptionHandler instance ([098454d425](https://github.com/facebook/react-native/commit/098454d4250127a8b6dea8d8b36b2754953ed118))
- **gradle:** Expose prefabs for newly added targets ([c16761da83](https://github.com/facebook/react-native/commit/c16761da833f7081e9378349e7f29cefbfe36d4f) by [@WoLewicki](https://github.com/WoLewicki))
- **layout** Percentage support in translate ([c13790ff1d](https://github.com/facebook/react-native/commit/c13790ff1d11ef95ad04f7d7dc87f09a9cbf7025) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **layout:** Added support for using percentages when defining border radius related properties. ([181ed33ab0](https://github.com/facebook/react-native/commit/181ed33ab0ae3a67c5bcb73de315fb6d5e697388) by [@jorge-cab](https://github.com/jorge-cab))
- **runtime:** Add 64 bit integer (long) value support to MapBuffer ([57ed0fb309](https://github.com/facebook/react-native/commit/57ed0fb30931979742634a1faa9a4d3b5261e50d) by [@ryanlntn](https://github.com/ryanlntn))
- **runtime:** Add the `ReactMarkerConstants.CONTENT_APPEARED` support on Android in bridgeless mode. ([5da9fdf8f1](https://github.com/facebook/react-native/commit/5da9fdf8f1780d8e491f46ce721861dd4e41992b) by [@Kudo](https://github.com/Kudo))
- **runtime:** Added `onUserLeaveHint` support into `ReactActivityDelegate` ([3cf6c64a80](https://github.com/facebook/react-native/commit/3cf6c64a800f96e398ad928d32de21d9e0dfe915) by [@behenate](https://github.com/behenate))
- **runtime:** Added `onUserLeaveHint` support into `ReactActivityDelegate` ([6450d08187](https://github.com/facebook/react-native/commit/6450d08187952c157b5998e7bdc08f4b17f73281) by [@behenate](https://github.com/behenate))
- **runtime:** Added featureflag to avoid additional background threads during execution ([4324f08749](https://github.com/facebook/react-native/commit/4324f08749433cc175f85246791bf8946b6ef04a) by [@javache](https://github.com/javache))
- **runtime:** Added getNativeModule(name) to ReactContext ([fdb2427a86](https://github.com/facebook/react-native/commit/fdb2427a863809b3637678f94105fed7eceef4f6) by [@javache](https://github.com/javache))
- **runtime:** GetJavaScriptContextHolder() supported in BridgelessReactContext since it's supported in ReactContext[Bridge] ([dfa6519749](https://github.com/facebook/react-native/commit/dfa65197491cb3ddfaaeca68d6c47a5bfb93eb83) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **runtime:** Introduce BridgeReactContext ([6386988de1](https://github.com/facebook/react-native/commit/6386988de1a55d082ffc8162571398ca8e3bafd5) by [@RSNara](https://github.com/RSNara))
- **runtime:** Introduced ReactContext.hasReactInstance() to replace .hasCatalystInstance() ([3a3f3e6232](https://github.com/facebook/react-native/commit/3a3f3e6232d6eec7d8863a910e1f76a1c6003ccb) by [@RSNara](https://github.com/RSNara))
- **turbomodule:** Add BindingsInstaller for TurboModules ([d999e9bf1e](https://github.com/facebook/react-native/commit/d999e9bf1ee6cad513be38c4f2c795ab58f59aa4) by [@Kudo](https://github.com/Kudo))
#### iOS specific
- **Modal:** RCTConvert to support UIModalPresentationStyle ([2d547a3252](https://github.com/facebook/react-native/commit/2d547a3252b328251e49dabfeec85f8d46c85411) by [@vonovak](https://github.com/vonovak))
- **TextInput:** Add all supported ReturnKeyTypes ([ed9978b8de](https://github.com/facebook/react-native/commit/ed9978b8de307d11def9190a461fc18b881800e0) by [@elencho](https://github.com/elencho))
- **bridgeless** Expose host delegate methods ([f500b47a95](https://github.com/facebook/react-native/commit/f500b47a957dea5e1ca2687965fb7a6a3fa64001) by [@zhongwuzw](https://github.com/zhongwuzw))
- **c++:** Introduce CallInvoker support in bridgeless native modules ([8f9ff89093](https://github.com/facebook/react-native/commit/8f9ff8909353b0e6782278c24bd0519c5506e51d) by [@philIip](https://github.com/philIip))
- **cocoapods:** Libraries can now declare Swift Package Manager dependencies in their .podspec with `ReactNativePodsUtils.spm_dependency` ([f903f34837](https://github.com/facebook/react-native/commit/f903f3483794f0e0e0b05ac24ab761344c319d6b) by [@mfazekas](https://github.com/mfazekas))
- **color:** Add basic DisplayP3 color support ([a40bd8e34a](https://github.com/facebook/react-native/commit/a40bd8e34a4de61e9f7690f808fe978fab1df11c) by [@ryanlntn](https://github.com/ryanlntn))
- **fonts:** Update font to handle system condensed variant ([86dffb3f15](https://github.com/facebook/react-native/commit/86dffb3f155dc9652f3abc32383643498b3a21b2) by [@shidoro](https://github.com/shidoro))
- **layout:** Added support for using percentages when defining border radius related properties. ([9c4ee6df08](https://github.com/facebook/react-native/commit/9c4ee6df087f9bc3024d893f1d87d54646661512) by [@jorge-cab](https://github.com/jorge-cab))
- **layout:** Percentage support in translate in new arch. ([f997b81288](https://github.com/facebook/react-native/commit/f997b81288148b4eee30b65375059feac2a14cd8) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **runtime:** Add Instruments signposts API for SystraceSection ([840c31c3a4](https://github.com/facebook/react-native/commit/840c31c3a42c006527561cb003670845f7c921d7) by [@lyahdav](https://github.com/lyahdav))
- **runtime::** Optimize RCTKeyWindow() for iOS 15+ ([b2fba371df](https://github.com/facebook/react-native/commit/b2fba371df0edafbb3323188004fc1f6d9ab1e8a) by [@okwasniewski](https://github.com/okwasniewski))
- **swift** Set SWIFT_ACTIVE_COMPILATION_CONDITIONS to DEBUG ([756f89aa59](https://github.com/facebook/react-native/commit/756f89aa59cba78cba39b22a338a3a48bcb38f1b) by [@okwasniewski](https://github.com/okwasniewski))
- **turbomodules** Add BindingsInstaller for TurboModules ([bed487e24b](https://github.com/facebook/react-native/commit/bed487e24b90a03b282b81cee5f7d2a203963d36) by [@Kudo](https://github.com/Kudo))
- **xros:** Prebuilt version of Hermes for visionOS ([924fb3de9b](https://github.com/facebook/react-native/commit/924fb3de9bc9328c3315316fbb796b933be5bcbe) by [@okwasniewski](https://github.com/okwasniewski))
### Changed
- **Animated:** Improved performance of `Animated` components ([452373b5bf](https://github.com/facebook/react-native/commit/452373b5bf4469d42af722851035e5e9bc3acdb9) by [@yungsters](https://github.com/yungsters))
- **BlobModule:** Add info to invalid blob response error ([489df722b3](https://github.com/facebook/react-native/commit/489df722b3b9b4106d53d853d9ff6d0a3f177254))
- **BlobModule:** Trim invalid blob response error message ([30463fb007](https://github.com/facebook/react-native/commit/30463fb007966fbd8803508cda025bc62c490265))
- **Pressable:** Improve performance of `Pressable` component. ([cfa784c5ce](https://github.com/facebook/react-native/commit/cfa784c5cec060506d3d76e7819b50934f2c69be) by [@Zahoq](https://github.com/Zahoq))
- **ScrollView:** MaintainVisibleContentPosition property on ScrollView now selects the first partially visible view as the anchor, rather than the first fully visible view. ([252ef19c8d](https://github.com/facebook/react-native/commit/252ef19c8d5bc5392d900af21136b351723f3b3c))
- **StyleSheet** Optimized performance of `StyleSheet.compose` ([34331af9ce](https://github.com/facebook/react-native/commit/34331af9cea59595c903f2f95896037ab1b22b16) by [@yungsters](https://github.com/yungsters))
- **c++:** Allow invoking the AsyncCallback synchronously to allow for tight performance optimization. ([765e542c8d](https://github.com/facebook/react-native/commit/765e542c8d25401e1b8818ff3caec2796efb51b1) by [@nlutsenko](https://github.com/nlutsenko))
- **debugger:** Inspector proxy: Rewrite 127.0.0.1 to localhost in source map URLs for better IPv4->IPv6 tunnelling support. ([a52bd7dd08](https://github.com/facebook/react-native/commit/a52bd7dd080e1f0ad03209eecb69bda903470205) by [@robhogan](https://github.com/robhogan))
- **debugger:** Update Chrome launch flags for `--experimental-debugger` launch flow ([b1bb0bee41](https://github.com/facebook/react-native/commit/b1bb0bee411436587e02942d187c08938f68d114) by [@motiz88](https://github.com/motiz88))
- **deps:** Bumped @react-native-community/cli to 14.0.0
- **hermes**: Enable regenerator transform for hermes-canary ([a0237e96f1](https://github.com/facebook/react-native/commit/a0237e96f1f0b5908008c0435a4efea120e77ac4) by [@avp](https://github.com/avp))
- **hermes:** Disable Babel plugin for arrow functions for Hermes ([cdc3b9cdfc](https://github.com/facebook/react-native/commit/cdc3b9cdfc02eae3e76275b87b715c7669cc493f) by [@yungsters](https://github.com/yungsters))
- **jest**: Enables React global flag that causes Jest testing environment to require `act()` ([5a8327857b](https://github.com/facebook/react-native/commit/5a8327857bdd6c2c96e0455258cba12512ea5dc8) by [@yungsters](https://github.com/yungsters))
- **js:** Console polyfill now copies all properties from the existing `console` object ([949296571b](https://github.com/facebook/react-native/commit/949296571b36080d4ebe0bc8fac9ef3907367475) by [@motiz88](https://github.com/motiz88))
- **linter:** `no-string-refs` is now a lint error ([387250112e](https://github.com/facebook/react-native/commit/387250112e9ff5d98e4d4172a2f3696042aba857) by [@yungsters](https://github.com/yungsters))
- **react-dev-tools**: Upgrade[react-devtools-core]: ^5.3.1 ([2617ec5570](https://github.com/facebook/react-native/commit/2617ec55704d6aaa057fc20dc7e82235e1b3a799) by [@hoxyq](https://github.com/hoxyq))
- **react:** Upgrade to `react@18.3.1` ([abb7070a51](https://github.com/facebook/react-native/commit/abb7070a512133e225646be3a1392667c3f1c966) by [@yungsters](https://github.com/yungsters))
- **share** Update `Share.share()`'s argument types to be more explicit. ([8b53d41a88](https://github.com/facebook/react-native/commit/8b53d41a88c3c7c83183baa46be307102aa90d54))
- **template:** Moved the template from react-native into react-native-community/template ([07abfceae1](https://github.com/facebook/react-native/commit/07abfceae117edc8ed205fe1ebaef89ce3041386) by [@blakef](https://github.com/blakef))
- **testing**: `mockComponent` now also mocks `name` ([5062c5256e](https://github.com/facebook/react-native/commit/5062c5256e64c4db53ea7c7bfeae127715fef972) by [@yungsters](https://github.com/yungsters))
- **testing:** Allow moving SyncCallback for advanced use-cases ([43c55e98d4](https://github.com/facebook/react-native/commit/43c55e98d493d60f9a05fb4f96efd54d1ea3bce8) by [@javache](https://github.com/javache))
- **yoga**: Reduce warning level of distributed Yoga builds ([b696a7dc5e](https://github.com/facebook/react-native/commit/b696a7dc5e78dd42eb712e7c4b7d6f389526d933) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **Alert:** Migrated `AlertFragment` dialog builder to use `androidx.appcompat` (1/2) ([297ded90aa](https://github.com/facebook/react-native/commit/297ded90aa1e905a37dba316e7b19b6779c8c804))
- **Alert:** Migrated `AlertFragment` dialog builder to use `androidx.appcompat` (2/2) ([600d3f6ff1](https://github.com/facebook/react-native/commit/600d3f6ff180de87fbe950c0e7558f11915e5966))
- **deps:** Bump Fresco to 3.2.0 to fix CVE-2018-14498 ([744024be7f](https://github.com/facebook/react-native/commit/744024be7f95970bdd786931bdf10dd50c515124) by [@cortinico](https://github.com/cortinico))
- **deps:** AGP to 8.5.0 ([19f6aec4a1](https://github.com/facebook/react-native/commit/19f6aec4a104f9b0dcfe3033e3c5cb6799338982) by [@cortinico](https://github.com/cortinico))
- **deps:** Kotlin to 1.9.24 ([3f3abf5b40](https://github.com/facebook/react-native/commit/3f3abf5b40e60b7b9c02ec4942fec1be3684acc6) by [@cortinico](https://github.com/cortinico))
- **DevSupport** Expose `openDebugger()` method on `DevSupportManager` ([b309af79e8](https://github.com/facebook/react-native/commit/b309af79e8bf2eb741db83b00359a73fe1b458a5) by [@motiz88](https://github.com/motiz88))
- **DevSupport** In bridgeless, `useDevSupport` now is configurable by ReactNativeHost. ([d195fd0c06](https://github.com/facebook/react-native/commit/d195fd0c0622e9d833dacf879c7da9f5b3c5fccd) by [@javache](https://github.com/javache))
- **DevSupport:** Decouple `DevInternalSettings` from `DevSupportManagerBase` ([52cec1e798](https://github.com/facebook/react-native/commit/52cec1e798c98ee948c34fad24a7b61d29e6ce2d) by [@Kudo](https://github.com/Kudo))
- **DevSupport:** Update constructor signature of `DevServerHelper` ([a1e8118541](https://github.com/facebook/react-native/commit/a1e81185416a53c7c7d0cfc67e40079fd0073e7c) by [@huntie](https://github.com/huntie))
- **gradle:** Expose `mapbufferjni` via prefab. ([c73e22142e](https://github.com/facebook/react-native/commit/c73e22142e9958fb406d5ca7d86228f938e5c8d5) by [@tomekzaw](https://github.com/tomekzaw))
- **runtime:** Changed the `handleRemoveView` function in `ReactViewGroup.java` to ignore calls for `Views` that are not children of this `ViewGroup` ([0d7a92b551](https://github.com/facebook/react-native/commit/0d7a92b551bb8bd91aeba73316cbaf7315362094) by [@bartlomiejbloniarz](https://github.com/bartlomiejbloniarz))
- **runtime:** Enforce Activities using ReactDelegate implement DefaultHardwareBackBtnHandler. ([a2d277f740](https://github.com/facebook/react-native/commit/a2d277f740d8ee95137d42679a1ffd872962a108) by [@javache](https://github.com/javache))
- **runtime:** Simplified ReactActivityDelegate to expose a single createRootView method. ([3283202248](https://github.com/facebook/react-native/commit/3283202248a36dbda553745afc46a3e3e2ab41a6) by [@javache](https://github.com/javache))
- **runtime:** Throwing IllegalArgumentException from ReactPackage is no longer suppressed ([2584bcb6c8](https://github.com/facebook/react-native/commit/2584bcb6c842b6a4fb7148dedc66f77c0f8210bb) by [@javache](https://github.com/javache))
#### iOS specific
- **Modal:** Move the snapshotting code before the dismissal. ([30d6251b78](https://github.com/facebook/react-native/commit/30d6251b7890118290c1f7f7a9df69423e15a406) by [@cipolleschi](https://github.com/cipolleschi))
- **Networking:** Fire `onprogress` event for `XMLHttpRequest` even when the `Content-Length` header is missing in the response headers ([457d14bd1b](https://github.com/facebook/react-native/commit/457d14bd1b85b0748b0824253753c6fee7ccc8bd))
- **RCTAppDelegate:** Improve reusability for RCTRootViewFactory ([23709f7c61](https://github.com/facebook/react-native/commit/23709f7c61caebebafa9b01264176cb95204ec42) by [@Kudo](https://github.com/Kudo))
- **RCTAppDelegate:** Support `customizeRootView` from `RCTRootViewFactory` ([8956869792](https://github.com/facebook/react-native/commit/89568697920230015f6146ac67a8fff87736d7dd) by [@Kudo](https://github.com/Kudo))
- **cocoapods:** Add `DEFINES_MODULE` for React-jsinspector.podspec ([4e6186555e](https://github.com/facebook/react-native/commit/4e6186555eac8e98724e5027a882c92ee195652d) by [@Kudo](https://github.com/Kudo))
- **ruby:** Update Gemfile in template ([06eea61c19](https://github.com/facebook/react-native/commit/06eea61c19cd730cf0c14a436f042d30791c3f4a) by [@matinzd](https://github.com/matinzd))
- **runtime:** Fallback to the first `foregroundInactive` window when there are no `foregroundActive` windows in RCTKeyWindow ([42ceacd281](https://github.com/facebook/react-native/commit/42ceacd281011ba8a6833d13a083208574bd85f2) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Move `notifyObservers` straight to `RCTEventDispatcher.mm`. ([f5c888c2d7](https://github.com/facebook/react-native/commit/f5c888c2d7c6dfe009de5df2cc795aff26286c19) by [@WoLewicki](https://github.com/WoLewicki))
### Deprecated
- **cli:** npx react-native init is deprecated and will log a warning until 0.76 ([47a3f52007](https://github.com/facebook/react-native/commit/47a3f5200708fc0247d8b403dbe447af636b79cb) by [@blakef](https://github.com/blakef))
- **runtime:** Deprecate RCTRuntimeExecutorModule ([7ea84bd3eb](https://github.com/facebook/react-native/commit/7ea84bd3eb228529e341f9fab5abf6ddda961db8) by [@philIip](https://github.com/philIip))
### Removed
- **Image:** Remove non-existent methods from `<ImageBackground/>` component ([09c903c439](https://github.com/facebook/react-native/commit/09c903c43922d83ddae1602751804c34b5aeff86) by [@retyui](https://github.com/retyui))
- **TextInput:** Remove viewconfigs for onTextInput callbacks ([910cde6134](https://github.com/facebook/react-native/commit/910cde6134d5c1f6886764ab27c1102584532795) by [@javache](https://github.com/javache))
- **debugger:** `launchId` query param for `/debugger-frontend` is no longer generated automatically for each `/open-debugger` call. Caller of `/open-debugger` is now responsible for generating the `launchId`, which will be passed along to `/debugger-frontend`. ([b7de916664](https://github.com/facebook/react-native/commit/b7de91666453b832b889d9577226097aeeace1a8) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **dev-middleware:** `react-native/dev-middleware`: Remove non-standard `faviconUrl` field from CDP `/json` response ([df19e597e3](https://github.com/facebook/react-native/commit/df19e597e3e8be9c76f6dba885fd978095710f49) by [@huntie](https://github.com/huntie))
- **typescript:** Remove `tvParallaxProperties` prop from `TouchableOpacity` & add missing `focusable`, `rejectResponderTermination` props ([0a0cd6517f](https://github.com/facebook/react-native/commit/0a0cd6517fdd6fbcc751b4d9ae19106740b23703) by [@retyui](https://github.com/retyui))
- **android - Animated:** Removed `NativeAnimationsDebugModule` (already not Public API) ([95f7a5c597](https://github.com/facebook/react-native/commit/95f7a5c597eeb8db3a19777cac1ea14e58682cf0) by [@yungsters](https://github.com/yungsters))
- **ios - cocoapods: ** Delete deprecated Xcode version check ([2b85a236a1](https://github.com/facebook/react-native/commit/2b85a236a1121d86b3a99f0d9c6da0ae35817a8c) by [@naxey](https://github.com/naxey))
### Fixed
- **Animated:** Fix broken native animation in Paper ([92540a618d](https://github.com/facebook/react-native/commit/92540a618d336c747c0ebdfffdd1a2a0a82e636d) by [@sammy-SC](https://github.com/sammy-SC))
- **Animated:** Fix sequence restart failure ([a93a15aca3](https://github.com/facebook/react-native/commit/a93a15aca3e380f2f8158465b1b315ac3fab8307) by [@asyler](https://github.com/asyler))
- **Animated:** Fixed memoization for components wrapped with createAnimatedComponent ([be06fd4e22](https://github.com/facebook/react-native/commit/be06fd4e22a500128d202436600381b8bc17b3f5))
- **Button:** Adds forwardRef call to new functional component implementation of Button control. ([8e7263a415](https://github.com/facebook/react-native/commit/8e7263a415676d1fb08da027c9dc6ca9fc2b6573) by [@chiaramooney](https://github.com/chiaramooney))
- **FlatList:** Fix clicking items on the inverted FlatList on the new architecture ([3753b7a0e7](https://github.com/facebook/react-native/commit/3753b7a0e78f8820e5f5150dd9bdf1b53145a7bd) by [@kosmydel](https://github.com/kosmydel))
- **Networking** Fix fetch memory leak ([c647950e5e](https://github.com/facebook/react-native/commit/c647950e5e78f1bcd110111067b21daa44e4d464) by [@huzhanbo1996](https://github.com/huzhanbo1996))
- **TextInput** Handle `fontWeight` normalization for TextInput component ([15f27bc299](https://github.com/facebook/react-native/commit/15f27bc299a0d1e6a5dec81efb594f54039120a7) by [@NickGerleman](https://github.com/NickGerleman))
- **Touchable:** Fixed inconsistency in TouchableX component disabled / focusable behavior ([775713cef7](https://github.com/facebook/react-native/commit/775713cef7ff7b45a60c34e4f1629dc6cde1aa05) by [@rozele](https://github.com/rozele))
- **c++:** Avoid ShadowTreeRegistry::mutex_ read lock reentrancy ([1a164fae6a](https://github.com/facebook/react-native/commit/1a164fae6a27051d0a3fd9f7aa094c384c58d4c4) by [@rozele](https://github.com/rozele))
- **cli:** Allow proxying commands from react-native to react-native-community/cli with explicit warning ([9aed45a9d9](https://github.com/facebook/react-native/commit/9aed45a9d99218e7468ce2779dcbaa40cce50c83) by [@blakef](https://github.com/blakef))
- **cli:** Fix version checker not considering nightlies ([489d9f6c62](https://github.com/facebook/react-native/commit/489d9f6c624aa0b3e2607cd70e46adbb2ea7162d) by [@tido64](https://github.com/tido64))
- **codegen:** Align CodegenSchema.d.ts with CodegenSchema.js ([ea3a7143b9](https://github.com/facebook/react-native/commit/ea3a7143b9c8e886a6cf5ffd04386c3b19ef6b4a) by [@christophpurrer](https://github.com/christophpurrer))
- **codegen:** Don't break script phase and codegen when coreutils installed on macOS ([e0799536ef](https://github.com/facebook/react-native/commit/e0799536ef1b68b98fb772e256d1d72424349008) by [@blakef](https://github.com/blakef))
- **codegen:** Fixed `Props.h` created from codegen missing default initializers in C++ `struct` ([639d890dff](https://github.com/facebook/react-native/commit/639d890dff49af788fbe27c60b33f6025ec33cca) by [@alanleedev](https://github.com/alanleedev))
- **codegen:** Make sure that we can't include Codegen symbols multiple times ([46b6453eb6](https://github.com/facebook/react-native/commit/46b6453eb6fe5435a792aa4a0f9183446f4fa41f) by [@cipolleschi](https://github.com/cipolleschi))
- **codegen:** Fixed crash when passing fewer arguments than expected in native modules using codegen ([179b684e76](https://github.com/facebook/react-native/commit/179b684e7636361f7acd782cdf028c7c30b7b9fd) by [@rubennorte](https://github.com/rubennorte))
- **codegen:** Fixed crash when passing non-numeric values where RootTag is expected to methods in native modules using codegen ([abbc6eb022](https://github.com/facebook/react-native/commit/abbc6eb02251d8c510b3fb5415796a8f05388c98) by [@rubennorte](https://github.com/rubennorte))
- **codegen:** Fixes enum codegen value cases ([1a1795a537](https://github.com/facebook/react-native/commit/1a1795a537f3fdb8417149565c7bd4221af2b72e) by [@zhongwuzw](https://github.com/zhongwuzw))
- **debugger:** LogBox and Chrome DevTools stack frame collapsing patterns are now compatible with Windows file paths. ([8d0046a5e1](https://github.com/facebook/react-native/commit/8d0046a5e10ca27a073e5509ca70ffab15d2d3e9) by [@motiz88](https://github.com/motiz88))
- **debugger:** Debugger frontend socket-termination countdown now begins after the ping message is actually sent ([20462ca984](https://github.com/facebook/react-native/commit/20462ca984ae306d6ea829c381d91d4df1cb1cde) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **debugger:** Fix breakpoints opening to incorrect location or disappearing from debugger frontend UI. ([ac714b1c33](https://github.com/facebook/react-native/commit/ac714b1c3300d3a169bdcfec05d556e18a7b83ff) by [@robhogan](https://github.com/robhogan))
- **debugger:** Inspector proxy: prevent errors proxying a device message from blocking the handler queue or spamming logs. ([e05319cc87](https://github.com/facebook/react-native/commit/e05319cc872c7d99c5ba33641a7791a3db2b3415) by [@robhogan](https://github.com/robhogan))
- **error handling:** Fixed LogBox not showing correctly on the New Architecture ([db1043dfbf](https://github.com/facebook/react-native/commit/db1043dfbf15b8d2e39eeb50b315384aa39e4606) by [@rubennorte](https://github.com/rubennorte))
- **error handling:** Remove accidental duplication in React warnings in Logbox ([32c3cd3e8a](https://github.com/facebook/react-native/commit/32c3cd3e8addb924f904de19c6e311a0ddb4e963) by [@gaearon](https://github.com/gaearon))
- **error handling:** Fix logbox reporting for React errors ([64e6721b23](https://github.com/facebook/react-native/commit/64e6721b23e9f3c35d42d5b1f1b68220e46a34ed) by [@yungsters](https://github.com/yungsters))
- **error handling:** Support component stacks without source info. ([1b53051b8c](https://github.com/facebook/react-native/commit/1b53051b8c0661095dbcb7546432eeda3a129fd4) by [@rickhanlonii](https://github.com/rickhanlonii))
- **error handling:** Support component stacks without source info. ([e9e668f0ec](https://github.com/facebook/react-native/commit/e9e668f0eca625248a95c53a506d33a4ec389f70) by [@rickhanlonii](https://github.com/rickhanlonii))
- **error handling:** Support hermes component stacks with missing source info. ([82db330360](https://github.com/facebook/react-native/commit/82db33036029c232cbaec7e58f2d84c873504732) by [@rickhanlonii](https://github.com/rickhanlonii))
- **infra:** Replace deprecated babel-plugin libraries to fix deprecation warnings on installation ([6213b2a62a](https://github.com/facebook/react-native/commit/6213b2a62a2366b150e0ac60aa8693baac2bb1d1) by [@kaganece](https://github.com/kaganece))
- **jest:** Fix jest setup for Image methods (resolveAssetSource, getSize, prefetch, queryCache) ([d53cc2b46d](https://github.com/facebook/react-native/commit/d53cc2b46dee5ed4d93ee76dea4aea9da42d0158))
- **layout:** Fix duplicate rotation operations ([54f582f651](https://github.com/facebook/react-native/commit/54f582f651c68e9fa6bedb5d1546f4e5a4a64704) by [@NickGerleman](https://github.com/NickGerleman))
- **layout:** Fixed padding not being applied to inline views in text ([12aef32b82](https://github.com/facebook/react-native/commit/12aef32b82325ab143b6ed421f3cbf0f8be66f60) by [@j-piasecki](https://github.com/j-piasecki))
- **layout:** Fixup margin: auto and justification behavior for overflowed containers ([f21d9afe0b](https://github.com/facebook/react-native/commit/f21d9afe0b0ddd97d89e89886d0d8e58739174ac) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Add `collapsableChildren` prop ([7b44c8d1d0](https://github.com/facebook/react-native/commit/7b44c8d1d0a089a766c7eab1b5435b2dbf61454c) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Add missing `NativeState` methods to the `WithRuntimeDecorator` class. ([218ea5d44c](https://github.com/facebook/react-native/commit/218ea5d44cae5774b1445cbc9e07d1ea3ef773d1) by [@bartlomiejbloniarz](https://github.com/bartlomiejbloniarz))
- **runtime:** Add option for multiple `mountingOverrideDelegates` ([358fe46969](https://github.com/facebook/react-native/commit/358fe46969654932e73af94127c05e6ce5ed7049) by [@WoLewicki](https://github.com/WoLewicki))
- **runtime:** Fixed prioritization of idle priority tasks, which were incorrectly scheduled as immediate priority ([0ca3ed87f3](https://github.com/facebook/react-native/commit/0ca3ed87f3424a333c815c9d57b17f133dd19eab) by [@rubennorte](https://github.com/rubennorte))
- **runtime:** New architecture timer methods now return integers instead of an opaque object. ([a16f7dc547](https://github.com/facebook/react-native/commit/a16f7dc547e85daed7e3732142f36cce5699faa0) by [@javache](https://github.com/javache))
#### Android specific
- **Animated:** Reduce maximum log spam from FrameBasedAnimationDriver ([42299499d8](https://github.com/facebook/react-native/commit/42299499d8cac0b3e6ae7814ca375005ecfa05f0))
- **DevMenu:** ShouldShowDevMenuOrReload() in RELEASE mode ([63043b79be](https://github.com/facebook/react-native/commit/63043b79be50b2589de96c63922b7909ca1f381f) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **DevSupport:** OnKeyLongPress() in RELEASE mode ([bdcc979bab](https://github.com/facebook/react-native/commit/bdcc979bab2cb300e540c031a7c54e05b2328410) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **Modal:** Fix a crash in Modal component ([d116837da2](https://github.com/facebook/react-native/commit/d116837da2734709f5f85dac1515d118b172bdcf) by [@sammy-SC](https://github.com/sammy-SC))
- **PointerEvents:** PointerEvents were not dispatching after a scroll event ([766ece7b9b](https://github.com/facebook/react-native/commit/766ece7b9b1a578d5b7acd99bc8b0055e862fa86) by [@javache](https://github.com/javache))
- **PointerEvents:** Views would still receive hover events when nested in a view with pointer-events: "none" ([38cbc082db](https://github.com/facebook/react-native/commit/38cbc082db92abdc00a73be0485999f406a05fe6) by [@javache](https://github.com/javache))
- **ReactDelegate:** Fixing exposing ReactDelegate through ReactActivity for reload() ([e25860f07c](https://github.com/facebook/react-native/commit/e25860f07c6af8d529d618da3ded556485ca0a73) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **ScrollView:** Add support for scrollEventThrottle for ScrollView on the New Architecture. ([4d2262b8d2](https://github.com/facebook/react-native/commit/4d2262b8d2b38eddbdfb2264a33f87c28aa7712f) by [@dmytrorykun](https://github.com/dmytrorykun))
- **ScrollView:** Fix maintainVisibleContentPosition during momentum scroll ([a9e6759bb5](https://github.com/facebook/react-native/commit/a9e6759bb5d8f08c444b7a324c4488b9e5f2ed1b) by [@janicduplessis](https://github.com/janicduplessis))
- **StatusBar:** Fixed StatusBar.currentHeight calculations to honor all cutout sizes ([0b8222a854](https://github.com/facebook/react-native/commit/0b8222a854a0f0e7808d596a57596f4dd98135f2))
- **StatusBar:** Fixed StatusBar.currentHeight calculations to honor all cutout sizes ([cc485ccf7d](https://github.com/facebook/react-native/commit/cc485ccf7dddbcbdcfb03457fd2a48569fab5820))
- **Text:** Fixed `adjustFontSizeToFit` when used without `numberOfLines` ([b236e154a1](https://github.com/facebook/react-native/commit/b236e154a1e29885258d325241fb94afb80a7f57) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Fixed `adjustsFontSizeToFit` not working on Android when using the new architecture ([747a96b7b3](https://github.com/facebook/react-native/commit/747a96b7b39fa53db353ef739560e27c6679d7fc) by [@j-piasecki](https://github.com/j-piasecki))
- **autolinking:** Fix autolink plugin for libraries that are platform-specific ([20521cc908](https://github.com/facebook/react-native/commit/20521cc908a347e3a2b3ac0fd6710946f18b1510) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- **autolinking:** Fix core autolinking not working on Windows ([c8cb3d4a59](https://github.com/facebook/react-native/commit/c8cb3d4a5904a5aab7fd41bedb032a919ef0758e) by [@cortinico](https://github.com/cortinico))
- **autolinking:** If `npx react-native-community/cli config` fails or timeouts proper error is shown and built is aborted, instead of leaving and empty autolinking.json ([3782511350](https://github.com/facebook/react-native/commit/3782511350c069425ad11cdefb8c6d3f10526fc2) by [@mfazekas](https://github.com/mfazekas))
- **error handling:** Android exceptions without a message would lead to unexpected crashes ([48f48f8e67](https://github.com/facebook/react-native/commit/48f48f8e6726103d1537193d52144cbce2402168) by [@javache](https://github.com/javache))
- **error handling:** Fixed android native rejections should be instanceof Error ([62cbdbbcc6](https://github.com/facebook/react-native/commit/62cbdbbcc60f9074e47416007aef81e0792d7c95) by [@huzhanbo1996](https://github.com/huzhanbo1996))
- **error handling:** Show RedBox after reloads fail (bridgeless) ([2f8d4f0c25](https://github.com/facebook/react-native/commit/2f8d4f0c253853ec4f56cf01b41a1f73a393f804) by [@RSNara](https://github.com/RSNara))
- **gradle:** Fixed build from source failing due to a missing file ([b2898540c9](https://github.com/facebook/react-native/commit/b2898540c9ba3616f7bb8f9d3d621be1fbba0d85) by [@j-piasecki](https://github.com/j-piasecki))
- **gradle:** Make `rrc_textinput` on Android a shared library ([ea8ad6457c](https://github.com/facebook/react-native/commit/ea8ad6457c0bb55d2a1150e7af6d0d20f3237006) by [@j-piasecki](https://github.com/j-piasecki))
- **kotlin:** Fix crash due to missing JvmStatic to `convertToCase` ([cef17ba14f](https://github.com/facebook/react-native/commit/cef17ba14f435b966d2ffd9b3660ccf28fe03b6c) by [@cortinico](https://github.com/cortinico))
- **kotlin:** Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt` ([54dadd7bda](https://github.com/facebook/react-native/commit/54dadd7bda0431548760aab0fade57f083d716a8) by [@WoLewicki](https://github.com/WoLewicki))
- **layout** Propagate layout direction to Android Views and Drawables ([e16faca18c](https://github.com/facebook/react-native/commit/e16faca18c052a1c3b7ce6fb3b8236347b222e8a) by [@NickGerleman](https://github.com/NickGerleman))
- **layout:** Better overflow support for ScrollView, Text, TextInput ([bfb3b7008d](https://github.com/facebook/react-native/commit/bfb3b7008d3e83400154b0348e7ab680ee06aa8c) by [@NickGerleman](https://github.com/NickGerleman))
- **layout:** Fix cached spannable measurement path ([002396beae](https://github.com/facebook/react-native/commit/002396beae3c5d107b44968c1b1906040054e3da) by [@NickGerleman](https://github.com/NickGerleman))
- **layout:** Fixed `textAlign` not being taken into account when positioning views inlined in text ([1f08799560](https://github.com/facebook/react-native/commit/1f087995608fd016a8a3dd84c0ca88a9239d96b9) by [@j-piasecki](https://github.com/j-piasecki))
- **layout:** Resolved error "No virtual method setLeftTopRightBottom" ([08ecdee71c](https://github.com/facebook/react-native/commit/08ecdee71c9d5a4e385a585941ca93ae1002b01f) by [@mmmoussa](https://github.com/mmmoussa))
- **renderer:** Cascading renders were not mounting correctly when `batchRenderingUpdatesInEventLoop` is enabled. ([849da2146c](https://github.com/facebook/react-native/commit/849da2146ca27b7512f2f3ea0f8af8aa001e807a) by [@javache](https://github.com/javache))
- **runtime:** Fix ClassCastException in `ReactModalHostView` ([15ff82f811](https://github.com/facebook/react-native/commit/15ff82f811287f9a686d993af9ee80f891a7774f) by [@cortinico](https://github.com/cortinico))
- **runtime:** Fix a case when view preallocation or props forwarding on Android lead to dropped props update ([cf926a1329](https://github.com/facebook/react-native/commit/cf926a1329a8cd6921e9799877883ac1fbc26fbb) by [@sammy-SC](https://github.com/sammy-SC))
- **runtime:** Fix crash in `getChildAtWithSubviewClippingEnabled` ([d6a44e632a](https://github.com/facebook/react-native/commit/d6a44e632a7ffbd60b90dac410294947cd82f2d8) by [@javache](https://github.com/javache))
- **runtime:** Fix dynamic_cast (RTTI) for ShadowNodeWrapper when accessed by third-party libraries again ([ea958c69f6](https://github.com/facebook/react-native/commit/ea958c69f624be67c770384c203f86255c1eebec) by [@tomekzaw](https://github.com/tomekzaw))
- **runtime:** Fixed app reloading for `ReactActivity.getReactDelegate().reload()`. ([539922339b](https://github.com/facebook/react-native/commit/539922339b5ca1937ce3207038199a27566914fe) by [@Kudo](https://github.com/Kudo))
- **runtime:** Fixed error thrown during ReactInstance teardown ([e67d5560cf](https://github.com/facebook/react-native/commit/e67d5560cfd35f07ce74cfcc12555346a6f0e865) by [@javache](https://github.com/javache))
- **runtime:** Improved resiliency of reloads when bundle loading fails ([524e3eec3e](https://github.com/facebook/react-native/commit/524e3eec3e73f56746ace8bef569f36802a7a62e) by [@javache](https://github.com/javache))
- **runtime:** Local scheduler for thread-safe ([7dd91d3437](https://github.com/facebook/react-native/commit/7dd91d3437952cf19569efce30c823d14bdf6c9d) by [@Sunbreak](https://github.com/Sunbreak))
- **runtime:** Surfaces no longer leak activity once stopped ([af721084af](https://github.com/facebook/react-native/commit/af721084afd5ba530e47fb353e8e5b1c4d9f56b7))
- **runtime:** Tentative fix for NPE `JavaTimerManager$IdleCallbackRunnable.cancel` ([e686b4330d](https://github.com/facebook/react-native/commit/e686b4330d0a69fe78008b7eac86c54c9f96ee79) by [@cortinico](https://github.com/cortinico))
- **runtime:**: ViewManagers can pass context to their base class. ([90663081de](https://github.com/facebook/react-native/commit/90663081de872243203da99116d2cab0fbec95ff) by [@javache](https://github.com/javache))
- **runtime:** Unmount React root when activity is destroyed on Bridgeless ([33aa83a0e6](https://github.com/facebook/react-native/commit/33aa83a0e6f63d3d50d4803074ad9e2243439100) by [@fabriziocucci](https://github.com/fabriziocucci))
- **style:** Border-Radius percentages are now correctly resolved. ([082e29ed4e](https://github.com/facebook/react-native/commit/082e29ed4ecc40ed9dfeae6b1b94d5a33efddef0) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** Fix borderRadius incorrect overrides ([8d5bbca1eb](https://github.com/facebook/react-native/commit/8d5bbca1eb8b91d0f678b557996a78c091976a53) by [@jorge-cab](https://github.com/jorge-cab))
- **turbomodule:** Cover SingletonMap when parsing events exported by module ([8a15e0d97a](https://github.com/facebook/react-native/commit/8a15e0d97ad7556b9f1b4068662791a32e1ae3d2) by [@WoLewicki](https://github.com/WoLewicki))
#### iOS specific
- **Animated:** Fixes animated frame timing ([690df7a556](https://github.com/facebook/react-native/commit/690df7a5561d93da27f69ff803bed453652ad51c) by [@zhongwuzw](https://github.com/zhongwuzw))
- **ContextMenu:** Hide AutoFill from context menu when using `contextMenuHidden` ([493dbb2190](https://github.com/facebook/react-native/commit/493dbb21907c71e2a220876eddd08a5ea075e1e8) by [@jakex7](https://github.com/jakex7))
- **DevMenu:** Fix RCTPerfMonitor not showing up in scene based app ([16775215d5](https://github.com/facebook/react-native/commit/16775215d5a734288da7147db348824395198407) by [@ouabing](https://github.com/ouabing))
- **InteropLayers:** Make sure to pass the RCTBridgeProxy to ViewManagers ([d6c90cf7ed](https://github.com/facebook/react-native/commit/d6c90cf7ed80caf0fc4eb2541f3dcadc3833dd37) by [@cipolleschi](https://github.com/cipolleschi))
- **Networking:** Fixed headers content type check for iOS bundle download ([d9b0f15c84](https://github.com/facebook/react-native/commit/d9b0f15c844abce5e97edfd401656d84d0c84133) by [@jayshah123](https://github.com/jayshah123))
- **PullToRefresh:** Properly recycle the RCTPullToRefreshViewComponentView ([18f0a90358](https://github.com/facebook/react-native/commit/18f0a90358b4e7eb59871cc11a88ef9bef575246) by [@cipolleschi](https://github.com/cipolleschi))
- **RCTAppDelegate:** Added space to $(inherited) string to avoid creation of wrong cpp flags in RCTAppDelegate podspec ([be93092c1b](https://github.com/facebook/react-native/commit/be93092c1b8a079f74dcdc129afc3767f03b8a2e) by [@nikhiltekwani09](https://github.com/nikhiltekwani09))
- **RCTAppDelegate:** Add missing forward blocks to RCTRootViewFactory ([9d79f05e68](https://github.com/facebook/react-native/commit/9d79f05e68cd64bf8b213ff89a25726184ef387c) by [@okwasniewski](https://github.com/okwasniewski))
- **RCTAppDelegate:** Allow importing RCTAppDelegate in Swift ([7c953698b4](https://github.com/facebook/react-native/commit/7c953698b41af7187504fa56a9a7c943ae724cd0) by [@okwasniewski](https://github.com/okwasniewski))
- **RCTAppDelegate:** Allow usage of `RCTRootViewFactory` from Swift ([5aea518d88](https://github.com/facebook/react-native/commit/5aea518d880ff73c91b8e462b9aa40ac0d218538) by [@okwasniewski](https://github.com/okwasniewski))
- **RCTAppDelegate:** Fixed Method name in hint from customiseView to customizeRootView ([46d4b837a5](https://github.com/facebook/react-native/commit/46d4b837a581168507b569744cae459bd1f4a70c) by [@svengiebel](https://github.com/svengiebel))
- **RCTAppDelegate:** Fixes customizeRootView migration comment ([fbf9c4343a](https://github.com/facebook/react-native/commit/fbf9c4343ae922013b008a7d855c5927b7113e60) by [@zhongwuzw](https://github.com/zhongwuzw))
- **RCTAppDelegate:** Remove loadSourceForBridge in RCTRootViewFactory ([0c02b26c1e](https://github.com/facebook/react-native/commit/0c02b26c1e00ca27d7a3ba4244a0957d4cb473aa) by [@okwasniewski](https://github.com/okwasniewski))
- **SCrollView:** Preserve content offset in ScrollView when the component is suspended ([510d2906b2](https://github.com/facebook/react-native/commit/510d2906b21b8c4c063369d2c2cb391aad268fea) by [@sammy-SC](https://github.com/sammy-SC))
- **ScrollCiew:** Remove usage of deprecated scrollIndicatorInsets in RCTScrollView ([ce10ce4d98](https://github.com/facebook/react-native/commit/ce10ce4d98bc22351b9694ef0bb15ad696f3ba5f))
- **ScrollView:** Fixing scroll view breakage caused by #44789 ([f4b921c1d5](https://github.com/facebook/react-native/commit/f4b921c1d5a40c96ecce949db2fe0755c5b90f35))
- **Text:** Fixed font size enlarging when `adjustFontSizeToFit` is set ([ed7766cee9](https://github.com/facebook/react-native/commit/ed7766cee941e36af05b19a315b442edf738ef80) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Fixed text highlighting in the New Architecture ([eadcebbb3e](https://github.com/facebook/react-native/commit/eadcebbb3efe1af70f3f7321617df9bc7fde0371))
- **TextInput:** Fix Multiline TextInput with a fixed height scrolls to the bottom when changing AttributedText ([f6badca2f9](https://github.com/facebook/react-native/commit/f6badca2f9a5f1e986dd76444bebde0d6049513d) by [@fabOnReact](https://github.com/fabOnReact))
- **Touchable:** Fixed stale state on TouchableOpacity and TouchableBounce ([00055f89a0](https://github.com/facebook/react-native/commit/00055f89a0ad636c2f15b4dc94047ce6cb4a7e0f) by [@sammy-SC](https://github.com/sammy-SC))
- **UIActivityIndicatorViewStyles:** Removed references to deprecated UIActivityIndicatorViewStyles ([a23ae9c7f2](https://github.com/facebook/react-native/commit/a23ae9c7f2031b25c431b1b9791beab6b5527def))
- **accessibility:** Fix the accessibility label not being applied to text components on the new architecture ([9922628032](https://github.com/facebook/react-native/commit/9922628032ace4d87257c1b3d70c2dc6c38a60a6) by [@j-piasecki](https://github.com/j-piasecki))
- **autolinking:** Auto linking script of script phase ([e320ab47cf](https://github.com/facebook/react-native/commit/e320ab47cf855f2e5de74ea448ec292cf0bbb29a))
- **cocoapods:** Exposes react_native_pods methods through autolinking.rb ([6b56fb0d0b](https://github.com/facebook/react-native/commit/6b56fb0d0b40728d0baef8566d754d7081363584) by [@blakef](https://github.com/blakef))
- **dark mode:** Fix dark mode on initial load. ([b957513cc6](https://github.com/facebook/react-native/commit/b957513cc65b66ab0288db3fba5ccf9232f7c1fc))
- **error handling:** Add missing call to `[super viewDidLoad]` in `RCTRedBox.mm`. ([d93788301c](https://github.com/facebook/react-native/commit/d93788301c1fafceba4c3e2ceb40cd4e49c6ae8d) by [@hakonk](https://github.com/hakonk))
- **layout:** Fix `InputAccessoryView` width on device orientation change ([8597727c28](https://github.com/facebook/react-native/commit/8597727c28d9cb77012f3f4ebb032c335246d589) by [@mauriciomeirelles](https://github.com/mauriciomeirelles))
- **objc:** Fixed missing header imports ([46f53e97f0](https://github.com/facebook/react-native/commit/46f53e97f0c193d1a92ac56d23b3bef40639dd09))
- **privacy manifest:** Fix error on handling privacy manifest ([c24929c5f4](https://github.com/facebook/react-native/commit/c24929c5f4c6f88878691b5f778922864bbd5683) by [@cxa](https://github.com/cxa))
- **privacy manifest:** Fix privacy aggregation ([00b366159d](https://github.com/facebook/react-native/commit/00b366159d760b705e86ea5f7fe5dbe53a1c5e72) by [@aleqsio](https://github.com/aleqsio))
- **privacy manifest:** Privacy Manifest aggregation failing due to missing nil check ([47b42dc845](https://github.com/facebook/react-native/commit/47b42dc84560aa66af4b7dcfa5886af66d175c3c) by [@swrobel](https://github.com/swrobel))
- **runtime:** Avoid calling abstract methods in RCTComposedViewRegistry ([9bdd777fd7](https://github.com/facebook/react-native/commit/9bdd777fd766ff9a0c59e7a2136279cd91a3916b) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Extract the constants from ViewManagers in the UI Thread if needed. ([94537c7beb](https://github.com/facebook/react-native/commit/94537c7bebe23f1c9a79c7a94383ed960ebf30f7) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Fixed `HermesExecutorFactory.h` build error when importing its private header ([2d46dbe6ce](https://github.com/facebook/react-native/commit/2d46dbe6ce962bbdcae5d91afe557b46b6b7cfe4) by [@Kudo](https://github.com/Kudo))
- **runtime:** Fixes NSDataBigString length calculation ([9d637e4622](https://github.com/facebook/react-native/commit/9d637e4622781568b143b8585909b73211a0f8ba) by [@zhongwuzw](https://github.com/zhongwuzw))
- **runtime:** Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls ([3f74f69cf0](https://github.com/facebook/react-native/commit/3f74f69cf00858cd18774837bf5afc3fccdfca86) by [@zhongwuzw](https://github.com/zhongwuzw))
- **runtime:** Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races. ([ffc16fc18b](https://github.com/facebook/react-native/commit/ffc16fc18bcc44d1e98d66dbbe56fb726962fb72) by [@hakonk](https://github.com/hakonk))
- **runtime:** Let RCTHost be initialized with a function to provide the `bundleURL` so that it can connect to metro on Reload when the url changes. ([8b8b85bb1f](https://github.com/facebook/react-native/commit/8b8b85bb1f55a8090360fec84ec4f56f372ede6b) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Missing `progress` in `onProgress` native event arguments ([78ab5f4b83](https://github.com/facebook/react-native/commit/78ab5f4b836d64b71760754c7cce1315630640c7) by [@netmaxt3r](https://github.com/netmaxt3r))
- **style:** Fixed border being drawn over children when no color was set ([91c5a6d936](https://github.com/facebook/react-native/commit/91c5a6d9368b01172000763ba48e91eb1434e7d7) by [@j-piasecki](https://github.com/j-piasecki))
- **style:** Removed Legacy iOS 10 code messing with border radius ([9204e44ef5](https://github.com/facebook/react-native/commit/9204e44ef5038ed9190a7e5362a7ea3c0793b361) by [@jorge-cab](https://github.com/jorge-cab))
- **turbomodule:** Fixed race condition in native module invalidation. ([b7812a8b6c](https://github.com/facebook/react-native/commit/b7812a8b6c3afbeacaad94779cd010bcc5440785) by [@dmytrorykun](https://github.com/dmytrorykun))
- **xcode:** Do not use temporary node when creating the .xcode.env.local ([8408b8bc96](https://github.com/facebook/react-native/commit/8408b8bc96db15e265ca65fce7875ee65dcfdcec) by [@cipolleschi](https://github.com/cipolleschi))
## v0.74.6
### Added
#### Android specific
- [0.74] Add support for handling `com.facebook.react.bridge.Dynamic` as parameter for TurboModules ([a9588f3718](https://github.com/facebook/react-native/commit/a9588f3718d682cf5b10db708b429885c2a06ee9) by [@cortinico](https://github.com/cortinico))
### Changed
- Bump hermes version ([4e737b0b16](https://github.com/facebook/react-native/commit/4e737b0b1649fcfed68529370f371bc2ae9319e3) by [@blakef](https://github.com/blakef))
### Fixed
- Fix(react-native): fix codegen failing in a pnpm monorepo setup ([a90a17a8b3](https://github.com/facebook/react-native/commit/a90a17a8b3f56c5f2aa84e06c48ccc19339b70eb) by [@tido64](https://github.com/tido64))
## v0.74.5
### Fixed
#### iOS specific
- Pass the right Apple system versions to Hermes ([10e9669ad1](https://github.com/facebook/react-native/commit/10e9669ad11141b155caa606638b4c6081fcf01c) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Remove deprecated onTextInput callback ([5da40cbb1c](https://github.com/facebook/react-native/commit/5da40cbb1cab9637db477156c4501ecfcf1c3315) by [@javache](https://github.com/javache))
## v0.74.4
### Added
#### Android specific
- Stub com.facebook.react.settings on 0.74 ([13ea273850](https://github.com/facebook/react-native/commit/13ea2738508332785e6b0dd129a8cc6e66d7b3da) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- Prebuilt version of Hermes for visionOS ([924fb3de9b](https://github.com/facebook/react-native/commit/924fb3de9bc9328c3315316fbb796b933be5bcbe) by [@okwasniewski](https://github.com/okwasniewski))
### Fixed
- Don't break script phase and codegen when coreutils installed on macOS ([e0799536ef](https://github.com/facebook/react-native/commit/e0799536ef1b68b98fb772e256d1d72424349008) by [@blakef](https://github.com/blakef))
- Remove setting of process.exitCode that breaks Jest tests ([e42932cfc6](https://github.com/facebook/react-native/commit/e42932cfc6dae7fb90fa29d123be4caed89deac0) by [@@douglowder](https://github.com/douglowder))
#### iOS specific
- Make sure to pass the RCTBridgeProxy to ViewManagers ([d6c90cf7ed](https://github.com/facebook/react-native/commit/d6c90cf7ed80caf0fc4eb2541f3dcadc3833dd37) by [@cipolleschi](https://github.com/cipolleschi))
- Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races. ([ffc16fc18b](https://github.com/facebook/react-native/commit/ffc16fc18bcc44d1e98d66dbbe56fb726962fb72) by [@hakonk](https://github.com/hakonk))
- Do not use temporary node when creating the .xcode.env.local ([8408b8bc96](https://github.com/facebook/react-native/commit/8408b8bc96db15e265ca65fce7875ee65dcfdcec) by [@cipolleschi](https://github.com/cipolleschi))
- Building of iOS project when RCTAppDelegate is used in the project ([be93092c1b](https://github.com/facebook/react-native/commit/be93092c1b8a079f74dcdc129afc3767f03b8a2e) by [@nikhiltekwani09](https://github.com/nikhiltekwani09))
- Fix error on handling privacy manifest ([e39e9c4a60](https://github.com/facebook/react-native/commit/e39e9c4a60a54d3280d8516d5891cec05d5ab793) by [@cxa](https://github.com/cxa))
## v0.74.3
### Added
- Add the ReactMarkerConstants.CONTENT_APPEARED support on Android in bridgeless mode. ([3c4d7618f0](https://github.com/facebook/react-native/commit/3c4d7618f00751b08f73ffcec9ef1f69d44136da) by [@Kudo](https://github.com/Kudo))
### Changed
- Feat: update CLI to 13.6.9 ([d1e2a35061](https://github.com/facebook/react-native/commit/d1e2a3506152abde9b870b1a63f16d00ec277ea6) by [@szymonrybczak](https://github.com/szymonrybczak))
#### iOS specific
- Support `customizeRootView` from `RCTRootViewFactory` ([3c4d761](https://github.com/facebook/react-native/commit/3c4d7618f00751b08f73ffcec9ef1f69d44136da) by [@Kudo](https://github.com/Kudo))
### Fixed
- Codegen computes output path relative to project root instead of current working directory. ([d3e0430dea](https://github.com/facebook/react-native/commit/d3e0430deac573fd44792e6005d5de20e9ad2797) by [@dmytrorykun](https://github.com/dmytrorykun))
### Android specific
- Android native rejections should be instanceof Error ([f4b0fcb9](https://github.com/facebook/react-native/commit/f4b0fcb92263667754348f82030f85cc941846ba) by [huzhanbo1996](https://github.com/huzhanbo1996))
- Tentative fix for NPE `JavaTimerManager$IdleCallbackRunnable.cancel` ([988bf162a0](https://github.com/facebook/react-native/commit/988bf162a0f36d9919cebbebc1fca27b58be4ae5) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- Fixed Multiline TextInput with a fixed height scrolls to the bottom when changing AttributedText ([e210c7c5](https://github.com/facebook/react-native/commit/e210c7c5741202a6e1b372731b50fdb59a7232bb) by [@fabOnReact](https://github.com/fabOnReact))
- Fixed border being drawn over children when no color was set ([a2b52af3](https://github.com/facebook/react-native/commit/a2b52af3bcc273cf85f01510c24d4e8da1b45656) by [@j-piasecki](https://github.com/j-piasecki))
## v0.74.2
### Changed
@@ -598,6 +1406,52 @@
- Bump activesupport to minimum 6.1.7.5 CVE-2023-38037. ([07a159f279](https://github.com/facebook/react-native/commit/07a159f279cdcbed29c9c437dec1c0b8ac2d852f) by [@lunaleaps](https://github.com/lunaleaps))
## v0.73.10
### Removed
#### Android specific
- Stop emitting deprecated onTextInput events ([e6ad652c6a](https://github.com/facebook/react-native/commit/e6ad652c6ae2222e95b3dc351f28c0fa3a91d622) by [@javache](https://github.com/javache))
- RGNP - Remove unnecessary dependency on gradle-tooling-api-builders - serviceOf failure ([069d8fc249](https://github.com/facebook/react-native/commit/069d8fc2495b63a233cb30712e888f29a185098c) by [@cortinico](https://github.com/cortinico))
### Fixed
- fix(TypeScript): Allow readonly arrays in transform ([b4015c1eaa](https://github.com/facebook/react-native/commit/b4015c1eaaed5fe7281314a9c5988a4c1cade3a6) by [@tjzel](https://github.com/tjzel))
#### Android specific
- Fix TextInput 'contextMenuHidden' prop ([08eed9f093](https://github.com/facebook/react-native/commit/08eed9f093d759fadbaef86dcf54c801917b4602) by [@alanleedev](https://github.com/alanleedev))
#### iOS specific
- Fix `<KeyboardAvoidingView>` with floating keyboard on iPadOS ([3c54e1ee45](https://github.com/facebook/react-native/commit/3c54e1ee4522b26698bb3f99262a2a621b26fb64) by [@renchap](https://github.com/renchap))
- Fix the generation of .xcode.env.local ([88fb3daa7e](https://github.com/facebook/react-native/commit/88fb3daa7ef112a9e7500c32168a897d0d409456) by [@cipolleschi](https://github.com/cipolleschi))
- Fix iOS crash occurring when navigating to a new app screen with a displaying modal ([33ca0204f5](https://github.com/facebook/react-native/commit/33ca0204f5491f27f00686e4eb966eb9fee3f7f9) by [@zhouzh1](https://github.com/zhouzh1))
- Fabric: Fixes animations strict weak ordering sorted check failed ([f18ed7b6c7](https://github.com/facebook/react-native/commit/f18ed7b6c72d9b9443282b4c169bae56336dad8d) by [@zhongwuzw](https://github.com/zhongwuzw))
## v0.73.9
### Added
#### iOS specific
- Add privacy manifest aggregation. ([f4b9d09](https://github.com/facebook/react-native/commit/f4b9d098c863fa36f261e5961ad13dd4cd2706f8) by [@aleqsio](https://github.com/aleqsio))
### Changed
- Feat: update CLI to 12.3.7 ([c7a1f2428f](https://github.com/facebook/react-native/commit/c7a1f2428fd6772e34b547ea23fa1d265c5d8a62) by [@szymonrybczak](https://github.com/szymonrybczak))
### Fixed
#### iOS specific
- Remove invalidate observer instead of re-adding observer in DeviceInfo module ([9db3eb6](https://github.com/facebook/react-native/commit/9db3eb686201f6ad4fddf5300f348f0caf69cfad) by [@zhongwuzw](https://github.com/zhongwuzw))
- Fix privacy aggregation ([6983a8b](https://github.com/facebook/react-native/commit/6983a8b1b9c33ea4e580a4e94e1e9535b6cb5d81) by [@aleqsio](https://github.com/aleqsio))
- Privacy Manifest aggregation failing due to missing nil check ([115331b](https://github.com/facebook/react-native/commit/115331b213152df623ad1c7988c9295802af6850) by [@swrobel](https://github.com/swrobel))
- In privacy manifest post install script, handle the case where the file reference doesn't have a path ([86cb45e](https://github.com/facebook/react-native/commit/86cb45e57786b0a62d9c523f9d5db4f8e5dc52df) by [@robertying](https://github.com/robertying))
- Privacy Manifest aggregation failing due to no `NSPrivacyAccessedAPITypes` key ([4bb94fe](https://github.com/facebook/react-native/commit/4bb94fe1e6c6174af5c9148bfc00f4bc7a87cf19) by [@renchap](https://github.com/renchap))
## v0.73.8
### Added
@@ -713,6 +1567,15 @@
- Fix race condition between A11yManager and UIManager ([f39f34ed82](https://github.com/facebook/react-native/commit/f39f34ed82997d0595522a285c3cb8693594e718) by [@cipolleschi](https://github.com/cipolleschi))
- Fix symbol not found _jump_fcontext with use_frameworks ([a2771ce58a](https://github.com/facebook/react-native/commit/a2771ce58ac221d1ac0de265c1ce571212fbcf83) by [@cipolleschi](https://github.com/cipolleschi))
## v0.72.17
### Fixed
#### iOS specific
- Fix Privacy Manifest file path by providing targets ([da0f8ac060](https://github.com/facebook/react-native/commit/da0f8ac060d853d8229423559c9338646dd11455) by [@siddharthkul](https://github.com/siddharthkul))
- Handle the case where the file reference doesn't have a path ([b5b3f3c43d](https://github.com/facebook/react-native/commit/b5b3f3c43d02dc552c0884f9cee416c68b6eaea2) by [@robertying](https://github.com/robertying))
## v0.72.15
### Added
+2 -1
View File
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13'
gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
+1 -1
View File
@@ -90,7 +90,7 @@ PLATFORMS
DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (~> 1.13)
cocoapods (~> 1.13, != 1.15.1, != 1.15.0)
RUBY VERSION
ruby 3.2.0p0
+4 -5
View File
@@ -60,7 +60,7 @@ nexusPublishing {
tasks.register("clean", Delete::class.java) {
description = "Remove all the build files and intermediate build outputs"
dependsOn(gradle.includedBuild("react-native-gradle-plugin").task(":clean"))
dependsOn(gradle.includedBuild("gradle-plugin").task(":clean"))
subprojects.forEach {
if (it.project.plugins.hasPlugin("com.android.library") ||
it.project.plugins.hasPlugin("com.android.application")) {
@@ -86,7 +86,7 @@ tasks.register("clean", Delete::class.java) {
tasks.register("build") {
description = "Build and test all the React Native relevant projects."
dependsOn(gradle.includedBuild("react-native-gradle-plugin").task(":build"))
dependsOn(gradle.includedBuild("gradle-plugin").task(":build"))
}
tasks.register("publishAllToMavenTempLocal") {
@@ -97,10 +97,9 @@ tasks.register("publishAllToMavenTempLocal") {
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
}
tasks.register("publishAllToSonatype") {
description = "Publish all the artifacts to Sonatype (Maven Central or Snapshot repository)"
tasks.register("publishAndroidToSonatype") {
description = "Publish the Android artifacts to Sonatype (Maven Central or Snapshot repository)"
dependsOn(":packages:react-native:ReactAndroid:publishToSonatype")
dependsOn(":packages:react-native:ReactAndroid:external-artifacts:publishToSonatype")
dependsOn(":packages:react-native:ReactAndroid:hermes-engine:publishToSonatype")
}
+9
View File
@@ -900,7 +900,9 @@ declare module '@babel/traverse' {
isImportAttribute(opts?: Opts): boolean;
isImportDeclaration(opts?: Opts): boolean;
isImportDefaultSpecifier(opts?: Opts): boolean;
isImportExpression(opts?: Opts): boolean;
isImportNamespaceSpecifier(opts?: Opts): boolean;
isImportOrExportDeclaration(opts?: Opts): boolean;
isImportSpecifier(opts?: Opts): boolean;
isIndexedAccessType(opts?: Opts): boolean;
isInferredPredicate(opts?: Opts): boolean;
@@ -1215,7 +1217,9 @@ declare module '@babel/traverse' {
assertImportAttribute(opts?: Opts): void;
assertImportDeclaration(opts?: Opts): void;
assertImportDefaultSpecifier(opts?: Opts): void;
assertImportExpression(opts?: Opts): void;
assertImportNamespaceSpecifier(opts?: Opts): void;
assertImportOrExportDeclaration(opts?: Opts): void;
assertImportSpecifier(opts?: Opts): void;
assertIndexedAccessType(opts?: Opts): void;
assertInferredPredicate(opts?: Opts): void;
@@ -1571,10 +1575,15 @@ declare module '@babel/traverse' {
ImportAttribute?: VisitNode<BabelNodeImportAttribute, TState>,
ImportDeclaration?: VisitNode<BabelNodeImportDeclaration, TState>,
ImportDefaultSpecifier?: VisitNode<BabelNodeImportDefaultSpecifier, TState>,
ImportExpression?: VisitNode<BabelNodeImportExpression, TState>,
ImportNamespaceSpecifier?: VisitNode<
BabelNodeImportNamespaceSpecifier,
TState,
>,
ImportOrExportDeclaration?: VisitNode<
BabelNodeImportOrExportDeclaration,
TState,
>,
ImportSpecifier?: VisitNode<BabelNodeImportSpecifier, TState>,
IndexedAccessType?: VisitNode<BabelNodeIndexedAccessType, TState>,
InferredPredicate?: VisitNode<BabelNodeInferredPredicate, TState>,
+58 -37
View File
File diff suppressed because one or more lines are too long
-18
View File
@@ -1,18 +0,0 @@
// flow-typed signature: b1b274e8ae71623bf11c20224c446842
// flow-typed version: c6154227d1/mkdirp_v0.5.x/flow_>=v0.104.x
declare module 'mkdirp' {
declare type Options = number | {
mode?: number,
fs?: mixed,
...
};
declare type Callback = (err: ?Error, path: ?string) => void;
declare module.exports: {
(path: string, options?: Options | Callback, callback?: Callback): void,
sync(path: string, options?: Options): void,
...
};
}
-49
View File
@@ -1,49 +0,0 @@
/**
* @flow strict
* @format
*/
type PrettyFormatPlugin =
| {
test: (value: mixed) => boolean,
print: (value: mixed) => string,
}
| {
test: (value: mixed) => boolean,
serialize: (value: mixed) => string,
};
declare module 'pretty-format' {
declare module.exports: {
(
value: mixed,
options?: ?{
callToJSON?: ?boolean,
escapeRegex?: ?boolean,
escapeString?: ?boolean,
highlight?: ?boolean,
indent?: ?number,
maxDepth?: ?number,
min?: ?boolean,
plugins?: ?Array<PrettyFormatPlugin>,
printFunctionName?: ?boolean,
theme?: ?{
comment?: ?string,
prop?: ?string,
tag?: ?string,
value: ?string,
},
},
): string,
plugins: {
AsymmetricMatcher: PrettyFormatPlugin,
ConvertAnsi: PrettyFormatPlugin,
DOMCollection: PrettyFormatPlugin,
DOMElement: PrettyFormatPlugin,
Immutable: PrettyFormatPlugin,
ReactElement: PrettyFormatPlugin,
ReactTestComponent: PrettyFormatPlugin,
},
};
}
+73
View File
@@ -0,0 +1,73 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
* @oncall react_native
*/
declare type Print = (value: mixed) => string;
declare type Indent = (value: string) => string;
declare type PluginOptions = {
edgeSpacing: string,
min: boolean,
spacing: string,
};
declare type Colors = {
comment: {close: string, open: string},
content: {close: string, open: string},
prop: {close: string, open: string},
tag: {close: string, open: string},
value: {close: string, open: string},
};
declare type CompareKeys = ((a: string, b: string) => number) | null | void;
declare type PrettyFormatPlugin =
| {
print: (
value: mixed,
print?: ?Print,
indent?: ?Indent,
options?: ?PluginOptions,
colors?: ?Colors,
) => string,
test: (value: mixed) => boolean,
}
| {
serialize: (value: mixed) => string,
test: (value: mixed) => boolean,
};
declare module 'pretty-format' {
declare export function format(
value: mixed,
options?: ?{
callToJSON?: ?boolean,
compareKeys?: CompareKeys,
escapeRegex?: ?boolean,
escapeString?: ?boolean,
highlight?: ?boolean,
indent?: ?number,
maxDepth?: ?number,
maxWidth?: ?number,
min?: ?boolean,
plugins?: ?Array<PrettyFormatPlugin>,
printBasicPrototype?: ?boolean,
printFunctionName?: ?boolean,
theme?: ?{
comment?: ?string,
content?: ?string,
prop?: ?string,
tag?: ?string,
value: ?string,
},
},
): string;
declare export const plugins: {
AsymmetricMatcher: PrettyFormatPlugin,
DOMCollection: PrettyFormatPlugin,
DOMElement: PrettyFormatPlugin,
Immutable: PrettyFormatPlugin,
ReactElement: PrettyFormatPlugin,
ReactTestComponent: PrettyFormatPlugin,
};
}
+7 -10
View File
@@ -1,6 +1,3 @@
// flow-typed signature: 7bac6c05f7415881918d3d510109e739
// flow-typed version: fce74493f0/react-test-renderer_v16.x.x/flow_>=v0.104.x
// Type definitions for react-test-renderer 16.x.x
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
@@ -44,14 +41,14 @@ type ReactTestInstance = {
...
};
type TestRendererOptions = { createNodeMock(element: React$Element<any>): any, ... };
type TestRendererOptions = { createNodeMock(element: React.MixedElement): any, ... };
declare module "react-test-renderer" {
declare export type ReactTestRenderer = {
toJSON(): null | ReactTestRendererJSON,
toTree(): null | ReactTestRendererTree,
unmount(nextElement?: React$Element<any>): void,
update(nextElement: React$Element<any>): void,
unmount(nextElement?: React.MixedElement): void,
update(nextElement: React.MixedElement): void,
getInstance(): ?ReactComponentInstance,
root: ReactTestInstance,
...
@@ -60,7 +57,7 @@ declare module "react-test-renderer" {
declare type Thenable = { then(resolve: () => mixed, reject?: () => mixed): mixed, ... };
declare function create(
nextElement: React$Element<any>,
nextElement: React.MixedElement,
options?: TestRendererOptions
): ReactTestRenderer;
@@ -71,9 +68,9 @@ declare module "react-test-renderer/shallow" {
declare export default class ShallowRenderer {
static createRenderer(): ShallowRenderer;
getMountedInstance(): ReactTestInstance;
getRenderOutput<E: React$Element<any>>(): E;
getRenderOutput(): React$Element<any>;
render(element: React$Element<any>, context?: any): void;
getRenderOutput<E: React.MixedElement>(): E;
getRenderOutput(): React.MixedElement;
render(element: React.MixedElement, context?: any): void;
unmount(): void;
}
}
+229
View File
@@ -0,0 +1,229 @@
declare module 'semver' {
declare type Release =
| "major"
| "premajor"
| "minor"
| "preminor"
| "patch"
| "prepatch"
| "prerelease";
// The supported comparators are taken from the source here:
// https://github.com/npm/node-semver/blob/8bd070b550db2646362c9883c8d008d32f66a234/semver.js#L623
declare type Operator =
| "==="
| "!=="
| "=="
| "="
| "" // Not sure why you would want this, but whatever.
| "!="
| ">"
| ">="
| "<"
| "<=";
declare class SemVer {
build: Array<string>;
loose: ?boolean;
major: number;
minor: number;
patch: number;
prerelease: Array<string | number>;
raw: string;
version: string;
constructor(version: string | SemVer, options?: Options): SemVer;
compare(other: string | SemVer): -1 | 0 | 1;
compareMain(other: string | SemVer): -1 | 0 | 1;
comparePre(other: string | SemVer): -1 | 0 | 1;
compareBuild(other: string | SemVer): -1 | 0 | 1;
format(): string;
inc(release: Release, identifier: string): this;
}
declare class Comparator {
options?: Options;
operator: Operator;
semver: SemVer;
value: string;
constructor(comp: string | Comparator, options?: Options): Comparator;
parse(comp: string): void;
test(version: string): boolean;
}
declare class Range {
loose: ?boolean;
raw: string;
set: Array<Array<Comparator>>;
constructor(range: string | Range, options?: Options): Range;
format(): string;
parseRange(range: string): Array<Comparator>;
test(version: string): boolean;
toString(): string;
}
declare var SEMVER_SPEC_VERSION: string;
declare var re: Array<RegExp>;
declare var src: Array<string>;
declare type Options = {
options?: Options,
includePrerelease?: boolean,
...
} | boolean;
// Functions
declare function valid(v: string | SemVer, options?: Options): string | null;
declare function clean(v: string | SemVer, options?: Options): string | null;
declare function inc(
v: string | SemVer,
release: Release,
options?: Options,
identifier?: string
): string | null;
declare function inc(
v: string | SemVer,
release: Release,
identifier: string
): string | null;
declare function major(v: string | SemVer, options?: Options): number;
declare function minor(v: string | SemVer, options?: Options): number;
declare function patch(v: string | SemVer, options?: Options): number;
declare function intersects(r1: string | SemVer, r2: string | SemVer, loose?: boolean): boolean;
declare function minVersion(r: string | Range): Range | null;
// Comparison
declare function gt(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function gte(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function lt(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function lte(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function eq(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function neq(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): boolean;
declare function cmp(
v1: string | SemVer,
comparator: Operator,
v2: string | SemVer,
options?: Options
): boolean;
declare function compare(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): -1 | 0 | 1;
declare function rcompare(
v1: string | SemVer,
v2: string | SemVer,
options?: Options
): -1 | 0 | 1;
declare function diff(v1: string | SemVer, v2: string | SemVer): ?Release;
declare function intersects(comparator: Comparator): boolean;
declare function sort(
list: Array<string | SemVer>,
options?: Options
): Array<string | SemVer>;
declare function rsort(
list: Array<string | SemVer>,
options?: Options
): Array<string | SemVer>;
declare function compareIdentifiers(
v1: string | SemVer,
v2: string | SemVer
): -1 | 0 | 1;
declare function rcompareIdentifiers(
v1: string | SemVer,
v2: string | SemVer
): -1 | 0 | 1;
// Ranges
declare function validRange(
range: string | Range,
options?: Options
): string | null;
declare function satisfies(
version: string | SemVer,
range: string | Range,
options?: Options
): boolean;
declare function maxSatisfying(
versions: Array<string | SemVer>,
range: string | Range,
options?: Options
): string | SemVer | null;
declare function minSatisfying(
versions: Array<string | SemVer>,
range: string | Range,
options?: Options
): string | SemVer | null;
declare function gtr(
version: string | SemVer,
range: string | Range,
options?: Options
): boolean;
declare function ltr(
version: string | SemVer,
range: string | Range,
options?: Options
): boolean;
declare function outside(
version: string | SemVer,
range: string | Range,
hilo: ">" | "<",
options?: Options
): boolean;
declare function intersects(
range: Range
): boolean;
declare function simplifyRange(
ranges: Array<string>,
range: string | Range,
options?: Options,
): string | Range;
declare function subset(
sub: string | Range,
dom: string | Range,
options?: Options,
): boolean;
// Coercion
declare function coerce(
version: string | SemVer,
options?: Options
): ?SemVer
// Not explicitly documented, or deprecated
declare function parse(version: string, options?: Options): ?SemVer;
declare function toComparators(
range: string | Range,
options?: Options
): Array<Array<string>>;
}
declare module 'semver/preload' {
declare module.exports: $Exports<"semver">;
}
+1
View File
@@ -323,6 +323,7 @@ declare module "yargs" {
updateStrings(obj: { [key: string]: string, ... }): this;
usage(message: string, opts?: { [key: string]: Options, ... }): this;
usage(message: string, desc?: string, builder: CommonModuleObject["builder"], handler: CommonModuleObject["handler"]): this;
version(): this;
version(version: string | false): this;
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+4 -1
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Vendored
+7
View File
@@ -1,3 +1,8 @@
@REM Copyright (c) Meta Platforms, Inc. and affiliates.
@REM
@REM This source code is licensed under the MIT license found in the
@REM LICENSE file in the root directory of this source tree.
@rem
@rem Copyright 2015 the original author or authors.
@rem
@@ -13,6 +18,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+12 -3
View File
@@ -11,6 +11,11 @@
const {defaults} = require('jest-config');
const PODS_LOCATIONS = [
'packages/rn-tester/Pods',
'packages/helloworld/ios/Pods',
];
module.exports = {
transform: {
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$':
@@ -30,11 +35,11 @@ module.exports = {
testRegex: '/__tests__/.*-test(\\.fb)?\\.js$',
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/packages/react-native/template',
'<rootDir>/packages/react-native/sdks',
'<rootDir>/packages/react-native/Libraries/Renderer',
'<rootDir>/packages/rn-tester/e2e',
'<rootDir>/packages/react-native-test-renderer/src',
'<rootDir>/packages/react-native/sdks/hermes/',
...PODS_LOCATIONS,
],
transformIgnorePatterns: ['node_modules/(?!@react-native/)'],
haste: {
@@ -42,7 +47,11 @@ module.exports = {
platforms: ['ios', 'android'],
},
moduleFileExtensions: ['fb.js'].concat(defaults.moduleFileExtensions),
modulePathIgnorePatterns: ['scripts/.*/__fixtures__/'],
modulePathIgnorePatterns: [
'scripts/.*/__fixtures__/',
'<rootDir>/packages/react-native/sdks/hermes/',
...PODS_LOCATIONS,
],
unmockedModulePathPatterns: [
'node_modules/react/',
'packages/react-native/Libraries/Renderer',
+22 -14
View File
@@ -12,18 +12,31 @@
'use strict';
/* eslint-disable lint/sort-imports */
const metroBabelRegister = require('metro-babel-register');
const nullthrows = require('nullthrows');
const createCacheKeyFunction =
require('@jest/create-cache-key-function').default;
// eslint-disable-next-line lint/sort-imports
const {
transformSync: babelTransformSync,
transformFromAstSync: babelTransformFromAstSync,
transformSync: babelTransformSync,
} = require('@babel/core');
const generate = require('@babel/generator').default;
const createCacheKeyFunction =
require('@jest/create-cache-key-function').default;
const metroBabelRegister = require('metro-babel-register');
const nullthrows = require('nullthrows');
if (process.env.FBSOURCE_ENV === '1') {
// If we're running in the Meta-internal monorepo, use the central Babel
// registration, which registers all of the relevant source directories
// including Metro's root.
//
// $FlowExpectedError[cannot-resolve-module] - Won't resolve in OSS
require('@fb-tools/babel-register');
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/build/babel-register').registerForMonorepo();
}
const transformer = require('@react-native/metro-babel-transformer');
const metroTransformPlugins = require('metro-transform-plugins');
// Files matching this pattern will be transformed with the Node JS Babel
// transformer, rather than with the React Native Babel transformer. Scripts
@@ -34,10 +47,6 @@ const nodeFiles = /[\\/]metro(?:-[^/]*)[\\/]/;
// hook. This is used below to configure babelTransformSync under Jest.
const {only: _, ...nodeBabelOptions} = metroBabelRegister.config([]);
// Register Babel to allow the transformer itself to be loaded from source.
require('../scripts/build/babel-register').registerForMonorepo();
const transformer = require('@react-native/metro-babel-transformer');
// Set BUILD_EXCLUDE_BABEL_REGISTER (see ../scripts/build/babel-register.js) to
// prevent inline Babel registration in code under test, normally required when
// running from source, but not in combination with the Jest transformer.
@@ -90,8 +99,7 @@ module.exports = {
ast: true,
retainLines: true,
plugins: [
// TODO(moti): Replace with require('metro-transform-plugins').inlineRequiresPlugin when available in OSS
require('babel-preset-fbjs/plugins/inline-requires'),
metroTransformPlugins.inlineRequiresPlugin,
babelPluginPreventBabelRegister,
],
sourceType: 'module',
+26 -28
View File
@@ -3,6 +3,7 @@
"private": true,
"version": "1000.0.0",
"license": "MIT",
"packageManager": "yarn@1.22.22",
"scripts": {
"android": "cd packages/rn-tester && npm run android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
@@ -13,8 +14,7 @@
"flow": "flow",
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
"format": "npm run prettier && npm run clang-format",
"featureflags-check": "cd packages/react-native && yarn featureflags-check",
"featureflags-update": "cd packages/react-native && yarn featureflags-update",
"featureflags": "cd packages/react-native && yarn featureflags",
"lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck",
"lint-java": "node ./scripts/lint-java.js",
"lint": "eslint .",
@@ -22,7 +22,7 @@
"print-packages": "node ./scripts/monorepo/print",
"shellcheck": "./scripts/circleci/analyze_scripts.sh",
"start": "cd packages/rn-tester && npm run start",
"set-version": "node ./scripts/releases/set-version",
"set-version": "node ./scripts/releases/set-version.js",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
@@ -36,28 +36,29 @@
},
"workspaces": [
"packages/*",
"tools/*"
"tools/*",
"!packages/helloworld"
],
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/eslint-parser": "^7.20.0",
"@babel/generator": "^7.20.0",
"@babel/plugin-transform-regenerator": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/preset-flow": "^7.20.0",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/generator": "^7.25.0",
"@babel/plugin-transform-regenerator": "^7.24.7",
"@babel/preset-env": "^7.25.3",
"@babel/preset-flow": "^7.24.7",
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.6.3",
"@pkgjs/parseargs": "^0.11.0",
"@react-native/metro-babel-transformer": "0.75.0-main",
"@react-native/metro-config": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.77.0-main",
"@react-native/metro-config": "0.77.0-main",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-transform-define": "^2.1.2",
"babel-plugin-syntax-hermes-parser": "0.24.0",
"babel-plugin-transform-define": "^2.1.4",
"babel-plugin-transform-flow-enums": "^0.0.2",
"babel-preset-fbjs": "^3.4.0",
"chalk": "^4.0.0",
"clang-format": "^1.8.0",
"connect": "^3.6.5",
@@ -75,33 +76,30 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.22.0",
"flow-bin": "^0.238.0",
"flow-api-translator": "0.24.0",
"flow-bin": "^0.251.1",
"glob": "^7.1.1",
"hermes-eslint": "0.22.0",
"hermes-transform": "0.22.0",
"hermes-eslint": "0.24.0",
"hermes-transform": "0.24.0",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "^0.80.0",
"metro-memory-fs": "^0.80.0",
"metro-babel-register": "^0.81.0",
"metro-memory-fs": "^0.81.0",
"metro-transform-plugins": "^0.81.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.22.0",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"prettier-plugin-hermes-parser": "0.24.0",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.2"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
"ws": "^6.2.3"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.75.0-main",
"version": "0.77.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -55,7 +55,7 @@ const drawableFileTypes = new Set([
function getAndroidResourceFolderName(
asset: PackagerAsset,
scale: number,
): string | $TEMPORARY$string<'raw'> {
): string {
if (!drawableFileTypes.has(asset.type)) {
return 'raw';
}
@@ -78,7 +78,7 @@ function getAndroidResourceIdentifier(asset: PackagerAsset): string {
.toLowerCase()
.replace(/\//g, '_') // Encode folder structure in file name
.replace(/([^a-z0-9_])/g, '') // Remove illegal chars
.replace(/^assets_/, ''); // Remove "assets_" prefix
.replace(/^(?:assets|assetsunstable_path)_/, ''); // Remove "assets_" or "assetsunstable_path_" prefix
}
function getBasePath(asset: PackagerAsset): string {
+3
View File
@@ -10,6 +10,8 @@
'use strict';
export type AssetDestPathResolver = 'android' | 'generic';
export type PackagerAsset = {
+__packager_asset: boolean,
+fileSystemLocation: string,
@@ -20,6 +22,7 @@ export type PackagerAsset = {
+hash: string,
+name: string,
+type: string,
+resolver?: AssetDestPathResolver,
...
};
+24 -7
View File
@@ -11,6 +11,7 @@
let FlowParser, TypeScriptParser, RNCodegen;
const {cheap: traverseCheap} = require('@babel/traverse').default;
const {basename} = require('path');
try {
@@ -168,16 +169,32 @@ module.exports = function ({parse, types: t}) {
exit(path) {
if (this.defaultExport) {
const viewConfig = generateViewConfig(this.filename, this.code);
this.defaultExport.replaceWithMultiple(
parse(viewConfig, {
babelrc: false,
browserslistConfigFile: false,
configFile: false,
}).program.body,
);
const ast = parse(viewConfig, {
babelrc: false,
browserslistConfigFile: false,
configFile: false,
});
// Almost the whole file is replaced with the viewConfig generated code that doesn't
// have a clear equivalent code on the source file when the user debugs, so we point
// it to the location of the default export that in that file, which is the closest
// to representing the code that is being generated.
// This is mostly useful when that generated code throws an error.
traverseCheap(ast, node => {
if (node?.loc) {
node.loc = this.defaultExport.node.loc;
node.start = this.defaultExport.node.start;
node.end = this.defaultExport.node.end;
}
});
this.defaultExport.replaceWithMultiple(ast.program.body);
if (this.commandsExport != null) {
this.commandsExport.remove();
}
this.codeInserted = true;
}
},
+4 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.75.0-main",
"version": "0.77.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -25,9 +25,10 @@
"index.js"
],
"dependencies": {
"@react-native/codegen": "0.75.0-main"
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.77.0-main"
},
"devDependencies": {
"@babel/core": "^7.20.0"
"@babel/core": "^7.25.2"
}
}
+19 -12
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.75.0-main",
"version": "0.77.0-main",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,21 +22,28 @@
"dist"
],
"dependencies": {
"@react-native-community/cli-server-api": "14.0.0-alpha.2",
"@react-native-community/cli-tools": "14.0.0-alpha.2",
"@react-native/dev-middleware": "0.75.0-main",
"@react-native/metro-babel-transformer": "0.75.0-main",
"@react-native/dev-middleware": "0.77.0-main",
"@react-native/metro-babel-transformer": "0.77.0-main",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "^0.80.3",
"metro-config": "^0.80.3",
"metro-core": "^0.80.3",
"debug": "^2.2.0",
"invariant": "^2.2.4",
"metro": "^0.81.0",
"metro-config": "^0.81.0",
"metro-core": "^0.81.0",
"node-fetch": "^2.2.0",
"querystring": "^0.2.1",
"readline": "^1.3.0"
"readline": "^1.3.0",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.80.3"
"metro-resolver": "^0.81.0"
},
"peerDependencies": {
"@react-native-community/cli-server-api": "*"
},
"peerDependenciesMeta": {
"@react-native-community/cli-server-api": {
"optional": true
}
},
"engines": {
"node": ">=18"
@@ -16,8 +16,8 @@ import type {RequestOptions} from 'metro/src/shared/types.flow';
import loadMetroConfig from '../../utils/loadMetroConfig';
import parseKeyValueParamArray from '../../utils/parseKeyValueParamArray';
import saveAssets from './saveAssets';
import {logger} from '@react-native-community/cli-tools';
import chalk from 'chalk';
import {promises as fs} from 'fs';
import Server from 'metro/src/Server';
import metroBundle from 'metro/src/shared/output/bundle';
import metroRamBundle from 'metro/src/shared/output/RamBundle';
@@ -71,13 +71,13 @@ async function buildBundleWithConfig(
);
if (config.resolver.platforms.indexOf(args.platform) === -1) {
logger.error(
`Invalid platform ${
console.error(
`${chalk.red('error')}: Invalid platform ${
args.platform ? `"${chalk.bold(args.platform)}" ` : ''
}selected.`,
);
logger.info(
console.info(
`Available platforms are: ${config.resolver.platforms
.map(x => `"${chalk.bold(x)}"`)
.join(
@@ -112,11 +112,17 @@ async function buildBundleWithConfig(
try {
const bundle = await bundleImpl.build(server, requestOpts);
// Ensure destination directory exists before saving the bundle
await fs.mkdir(path.dirname(args.bundleOutput), {
recursive: true,
mode: 0o755,
});
// $FlowIgnore[class-object-subtyping]
// $FlowIgnore[incompatible-call]
// $FlowIgnore[prop-missing]
// $FlowIgnore[incompatible-exact]
await bundleImpl.save(bundle, args, logger.info);
await bundleImpl.save(bundle, args, console.info);
// Save the assets of the bundle
const outputAssets = await server.getAssets({
@@ -133,7 +139,7 @@ async function buildBundleWithConfig(
args.assetCatalogDest,
);
} finally {
server.end();
await server.end();
}
}
@@ -20,7 +20,7 @@ import {
import filterPlatformAssetScales from './filterPlatformAssetScales';
import getAssetDestPathAndroid from './getAssetDestPathAndroid';
import getAssetDestPathIOS from './getAssetDestPathIOS';
import {logger} from '@react-native-community/cli-tools';
import chalk from 'chalk';
import fs from 'fs';
import path from 'path';
@@ -35,7 +35,7 @@ async function saveAssets(
assetCatalogDest?: string,
): Promise<void> {
if (assetsDest == null) {
logger.warn('Assets destination folder is not set, skipping...');
console.warn('Warning: Assets destination folder is not set, skipping...');
return;
}
@@ -64,13 +64,13 @@ async function saveAssets(
// remove unused scales from the optimized bundle.
const catalogDir = path.join(assetCatalogDest, 'RNAssets.xcassets');
if (!fs.existsSync(catalogDir)) {
logger.error(
`Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`,
console.error(
`${chalk.red('error')}: Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`,
);
return;
}
logger.info('Adding images to asset catalog', catalogDir);
console.info('Adding images to asset catalog', catalogDir);
cleanAssetCatalog(catalogDir);
for (const asset of assets) {
if (isCatalogAsset(asset)) {
@@ -84,7 +84,7 @@ async function saveAssets(
addAssetToCopy(asset);
}
}
logger.info('Done adding images to asset catalog');
console.info('Done adding images to asset catalog');
} else {
assets.forEach(addAssetToCopy);
}
@@ -98,7 +98,7 @@ function copyAll(filesToCopy: CopiedFiles) {
return Promise.resolve();
}
logger.info(`Copying ${queue.length} asset files`);
console.info(`Copying ${queue.length} asset files`);
return new Promise<void>((resolve, reject) => {
const copyNext = (error?: Error) => {
if (error) {
@@ -106,12 +106,14 @@ function copyAll(filesToCopy: CopiedFiles) {
return;
}
if (queue.length === 0) {
logger.info('Done copying assets');
console.info('Done copying assets');
resolve();
} else {
// queue.length === 0 is checked in previous branch, so this is string
const src = queue.shift();
// $FlowFixMe[incompatible-type]
const dest = filesToCopy[src];
// $FlowFixMe[incompatible-call]
copy(src, dest, copyNext);
}
};
@@ -0,0 +1,173 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
import chalk from 'chalk';
import fetch from 'node-fetch';
type PageDescription = $ReadOnly<{
id: string,
title: string,
description: string,
...
}>;
export default class OpenDebuggerKeyboardHandler {
#devServerUrl: string;
#reporter: TerminalReporter;
#targetsShownForSelection: ?$ReadOnlyArray<PageDescription> = null;
constructor({
devServerUrl,
reporter,
}: {
devServerUrl: string,
reporter: TerminalReporter,
}) {
this.#devServerUrl = devServerUrl;
this.#reporter = reporter;
}
async #tryOpenDebuggerForTarget(target: PageDescription): Promise<void> {
this.#targetsShownForSelection = null;
this.#clearTerminalMenu();
try {
await fetch(
new URL(
'/open-debugger?target=' + encodeURIComponent(target.id),
this.#devServerUrl,
).href,
{method: 'POST'},
);
} catch (e) {
this.#log(
'error',
'Failed to open debugger for %s (%s): %s',
target.title,
target.description,
e.message,
);
this.#clearTerminalMenu();
}
}
/**
* Used in response to 'j' to debug - fetch the available debug targets and:
* - If no targets, warn
* - If one target, open it
* - If more, show a list. The keyboard listener should run subsequent key
* presses through maybeHandleTargetSelection, which will launch the
* debugger if a match is made.
*/
async handleOpenDebugger(): Promise<void> {
this.#setTerminalMenu('Fetching available debugging targets...');
this.#targetsShownForSelection = null;
try {
const res = await fetch(this.#devServerUrl + '/json/list', {
method: 'POST',
});
if (res.status !== 200) {
throw new Error(`Unexpected status code: ${res.status}`);
}
const targets = (await res.json()) as $ReadOnlyArray<PageDescription>;
if (!Array.isArray(targets)) {
throw new Error('Expected array.');
}
if (targets.length === 0) {
this.#log('warn', 'No connected targets');
this.#clearTerminalMenu();
} else if (targets.length === 1) {
const target = targets[0];
// eslint-disable-next-line no-void
void this.#tryOpenDebuggerForTarget(target);
} else {
this.#targetsShownForSelection = targets;
if (targets.length > 9) {
this.#log(
'warn',
'10 or more debug targets available, showing the first 9.',
);
}
this.#setTerminalMenu(
`Multiple debug targets available, please select:\n ${targets
.slice(0, 9)
.map(
({title}, i) =>
`${chalk.white.inverse(` ${i + 1} `)} - "${title}"`,
)
.join('\n ')}`,
);
}
} catch (e) {
this.#log('error', `Failed to fetch debug targets: ${e.message}`);
this.#clearTerminalMenu();
}
}
/**
* Handle key presses that correspond to a valid selection from a visible
* selection list.
*
* @return true if we've handled the key as a target selection, false if the
* caller should handle the key.
*/
maybeHandleTargetSelection(keyName: string): boolean {
if (keyName >= '1' && keyName <= '9') {
const targetIndex = Number(keyName) - 1;
if (
this.#targetsShownForSelection != null &&
targetIndex < this.#targetsShownForSelection.length
) {
const target = this.#targetsShownForSelection[targetIndex];
// eslint-disable-next-line no-void
void this.#tryOpenDebuggerForTarget(target);
return true;
}
}
return false;
}
/**
* Dismiss any target selection UI, if shown.
*/
dismiss() {
this.#clearTerminalMenu();
this.#targetsShownForSelection = null;
}
#log(level: 'info' | 'warn' | 'error', ...data: Array<mixed>): void {
this.#reporter.update({
type: 'unstable_server_log',
level,
data,
});
}
#setTerminalMenu(message: string) {
this.#reporter.update({
type: 'unstable_server_menu_updated',
message,
});
}
#clearTerminalMenu() {
this.#reporter.update({
type: 'unstable_server_menu_cleared',
});
}
}
@@ -9,104 +9,127 @@
* @oncall react_native
*/
import type {Config} from '@react-native-community/cli-types';
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
import {KeyPressHandler} from '../../utils/KeyPressHandler';
import {logger} from '@react-native-community/cli-tools';
import OpenDebuggerKeyboardHandler from './OpenDebuggerKeyboardHandler';
import chalk from 'chalk';
import execa from 'execa';
import fetch from 'node-fetch';
import invariant from 'invariant';
import readline from 'readline';
import {ReadStream} from 'tty';
const CTRL_C = '\u0003';
const CTRL_D = '\u0004';
const RELOAD_TIMEOUT = 500;
const throttle = (callback: () => void, timeout: number) => {
let previousCallTimestamp = 0;
return () => {
const currentCallTimestamp = new Date().getTime();
if (currentCallTimestamp - previousCallTimestamp > timeout) {
previousCallTimestamp = currentCallTimestamp;
callback();
}
};
};
type KeyEvent = {
sequence: string,
name: string,
ctrl: boolean,
meta: boolean,
shift: boolean,
};
export default function attachKeyHandlers({
cliConfig,
devServerUrl,
messageSocket,
experimentalDebuggerFrontend,
reporter,
}: {
cliConfig: Config,
devServerUrl: string,
messageSocket: $ReadOnly<{
broadcast: (type: string, params?: Record<string, mixed> | null) => void,
...
}>,
experimentalDebuggerFrontend: boolean,
reporter: TerminalReporter,
}) {
if (process.stdin.isTTY !== true) {
logger.debug('Interactive mode is not supported in this environment');
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: 'Interactive mode is not supported in this environment',
});
return;
}
const execaOptions = {
env: {FORCE_COLOR: chalk.supportsColor ? 'true' : 'false'},
};
readline.emitKeypressEvents(process.stdin);
setRawMode(true);
const onPress = async (key: string) => {
switch (key) {
const reload = throttle(() => {
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: 'Reloading connected app(s)...',
});
messageSocket.broadcast('reload', null);
}, RELOAD_TIMEOUT);
const openDebuggerKeyboardHandler = new OpenDebuggerKeyboardHandler({
reporter,
devServerUrl,
});
process.stdin.on('keypress', (str: string, key: KeyEvent) => {
if (openDebuggerKeyboardHandler.maybeHandleTargetSelection(key.name)) {
return;
}
switch (key.sequence) {
case 'r':
logger.info('Reloading connected app(s)...');
messageSocket.broadcast('reload', null);
reload();
break;
case 'd':
logger.info('Opening Dev Menu...');
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: 'Opening Dev Menu...',
});
messageSocket.broadcast('devMenu', null);
break;
case 'i':
logger.info('Opening app on iOS...');
execa(
'npx',
[
'react-native',
'run-ios',
...(cliConfig.project.ios?.watchModeCommandParams ?? []),
],
execaOptions,
).stdout?.pipe(process.stdout);
break;
case 'a':
logger.info('Opening app on Android...');
execa(
'npx',
[
'react-native',
'run-android',
...(cliConfig.project.android?.watchModeCommandParams ?? []),
],
execaOptions,
).stdout?.pipe(process.stdout);
break;
case 'j':
if (!experimentalDebuggerFrontend) {
return;
}
await fetch(devServerUrl + '/open-debugger', {method: 'POST'});
// eslint-disable-next-line no-void
void openDebuggerKeyboardHandler.handleOpenDebugger();
break;
case CTRL_C:
case CTRL_D:
logger.info('Stopping server');
keyPressHandler.stopInterceptingKeyStrokes();
openDebuggerKeyboardHandler.dismiss();
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: 'Stopping server',
});
setRawMode(false);
process.stdin.pause();
process.emit('SIGINT');
process.exit();
}
};
});
const keyPressHandler = new KeyPressHandler(onPress);
keyPressHandler.createInteractionListener();
keyPressHandler.startInterceptingKeyStrokes();
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: `Key commands available:
logger.log(
[
'',
`${chalk.bold('i')} - run on iOS`,
`${chalk.bold('a')} - run on Android`,
`${chalk.bold('d')} - open Dev Menu`,
...(experimentalDebuggerFrontend
? [`${chalk.bold('j')} - open debugger (experimental, Hermes only)`]
: []),
`${chalk.bold('r')} - reload app`,
'',
].join('\n'),
${chalk.bold.inverse(' r ')} - reload app(s)
${chalk.bold.inverse(' d ')} - open Dev Menu
${chalk.bold.inverse(' j ')} - open DevTools
`,
});
}
function setRawMode(enable: boolean) {
invariant(
process.stdin instanceof ReadStream,
'process.stdin must be a readable stream to modify raw mode',
);
process.stdin.setRawMode(enable);
}
@@ -95,13 +95,6 @@ const startCommand: Command = {
name: '--no-interactive',
description: 'Disables interactive mode',
},
{
name: '--experimental-debugger',
description:
"[Experimental] Enable the new debugger experience and 'j' to " +
'debug. This enables the new frontend experience only: connection ' +
'reliability and some basic features are unstable in this release.',
},
],
};
@@ -0,0 +1,81 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {NextHandleFunction, Server} from 'connect';
import type {TerminalReportableEvent} from 'metro/src/lib/TerminalReporter';
const debug = require('debug')('ReactNative:CommunityCliPlugin');
type MiddlewareReturn = {
middleware: Server,
websocketEndpoints: {
[path: string]: ws$WebSocketServer,
},
messageSocketEndpoint: {
server: ws$WebSocketServer,
broadcast: (method: string, params?: Record<string, mixed> | null) => void,
},
eventsSocketEndpoint: {
server: ws$WebSocketServer,
reportEvent: (event: TerminalReportableEvent) => void,
},
...
};
const noopNextHandle: NextHandleFunction = (req, res, next) => {
next();
};
// $FlowFixMe
const unusedStubWSServer: ws$WebSocketServer = {};
// $FlowFixMe
const unusedMiddlewareStub: Server = {};
const communityMiddlewareFallback = {
createDevServerMiddleware: (params: {
host?: string,
port: number,
watchFolders: $ReadOnlyArray<string>,
}): MiddlewareReturn => ({
middleware: unusedMiddlewareStub,
websocketEndpoints: {},
messageSocketEndpoint: {
server: unusedStubWSServer,
broadcast: (
method: string,
_params?: Record<string, mixed> | null,
): void => {},
},
eventsSocketEndpoint: {
server: unusedStubWSServer,
reportEvent: (event: TerminalReportableEvent) => {},
},
}),
indexPageMiddleware: noopNextHandle,
};
// Attempt to use the community middleware if it exists, but fallback to
// the stubs if it doesn't.
try {
const community = require('@react-native-community/cli-server-api');
communityMiddlewareFallback.indexPageMiddleware =
community.indexPageMiddleware;
communityMiddlewareFallback.createDevServerMiddleware =
community.createDevServerMiddleware;
} catch {
debug(`⚠️ Unable to find @react-native-community/cli-server-api
Starting the server without the community middleware.`);
}
export const createDevServerMiddleware =
communityMiddlewareFallback.createDevServerMiddleware;
export const indexPageMiddleware =
communityMiddlewareFallback.indexPageMiddleware;
@@ -14,14 +14,15 @@ import type {Reporter} from 'metro/src/lib/reporting';
import type {TerminalReportableEvent} from 'metro/src/lib/TerminalReporter';
import typeof TerminalReporter from 'metro/src/lib/TerminalReporter';
import createDevMiddlewareLogger from '../../utils/createDevMiddlewareLogger';
import isDevServerRunning from '../../utils/isDevServerRunning';
import loadMetroConfig from '../../utils/loadMetroConfig';
import * as version from '../../utils/version';
import attachKeyHandlers from './attachKeyHandlers';
import {
createDevServerMiddleware,
indexPageMiddleware,
} from '@react-native-community/cli-server-api';
import {logger, version} from '@react-native-community/cli-tools';
import {createDevMiddleware} from '@react-native/dev-middleware';
import chalk from 'chalk';
import Metro from 'metro';
@@ -33,7 +34,6 @@ export type StartCommandArgs = {
assetPlugins?: string[],
cert?: string,
customLogReporterPath?: string,
experimentalDebugger: boolean,
host?: string,
https?: boolean,
maxWorkers?: number,
@@ -51,10 +51,10 @@ export type StartCommandArgs = {
async function runServer(
_argv: Array<string>,
ctx: Config,
cliConfig: Config,
args: StartCommandArgs,
) {
const metroConfig = await loadMetroConfig(ctx, {
const metroConfig = await loadMetroConfig(cliConfig, {
config: args.config,
maxWorkers: args.maxWorkers,
port: args.port,
@@ -72,24 +72,26 @@ async function runServer(
const protocol = args.https === true ? 'https' : 'http';
const devServerUrl = url.format({protocol, hostname, port});
logger.info(`Welcome to React Native v${ctx.reactNativeVersion}`);
console.info(
chalk.blue(`\nWelcome to React Native v${cliConfig.reactNativeVersion}`),
);
const serverStatus = await isDevServerRunning(devServerUrl, projectRoot);
if (serverStatus === 'matched_server_running') {
logger.info(
console.info(
`A dev server is already running for this project on port ${port}. Exiting.`,
);
return;
} else if (serverStatus === 'port_taken') {
logger.error(
`Another process is running on port ${port}. Please terminate this ` +
console.error(
`${chalk.red('error')}: Another process is running on port ${port}. Please terminate this ` +
'process and try again, or use another port with "--port".',
);
return;
}
logger.info(`Starting dev server on port ${chalk.bold(String(port))}...`);
console.info(`Starting dev server on ${devServerUrl}\n`);
if (args.assetPlugins) {
// $FlowIgnore[cannot-write] Assigning to readonly property
@@ -98,6 +100,11 @@ async function runServer(
);
}
let reportEvent: (event: TerminalReportableEvent) => void;
const terminal = new Terminal(process.stdout);
const ReporterImpl = getReporterImpl(args.customLogReporterPath);
const terminalReporter = new ReporterImpl(terminal);
const {
middleware: communityMiddleware,
websocketEndpoints: communityWebsocketEndpoints,
@@ -111,17 +118,9 @@ async function runServer(
const {middleware, websocketEndpoints} = createDevMiddleware({
projectRoot,
serverBaseUrl: devServerUrl,
logger,
unstable_experiments: {
// NOTE: Only affects the /open-debugger endpoint
enableNewDebugger: args.experimentalDebugger,
},
logger: createDevMiddlewareLogger(terminalReporter),
});
let reportEvent: (event: TerminalReportableEvent) => void;
const terminal = new Terminal(process.stdout);
const ReporterImpl = getReporterImpl(args.customLogReporterPath);
const terminalReporter = new ReporterImpl(terminal);
const reporter: Reporter = {
update(event: TerminalReportableEvent) {
terminalReporter.update(event);
@@ -129,12 +128,15 @@ async function runServer(
reportEvent(event);
}
if (args.interactive && event.type === 'initialize_done') {
logger.info('Dev server ready');
terminalReporter.update({
type: 'unstable_server_log',
level: 'info',
data: `Dev server ready. ${chalk.dim('Press Ctrl+C to exit.')}`,
});
attachKeyHandlers({
cliConfig: ctx,
devServerUrl,
messageSocket: messageSocketEndpoint,
experimentalDebuggerFrontend: args.experimentalDebugger,
reporter: terminalReporter,
});
}
},
@@ -172,7 +174,7 @@ async function runServer(
//
serverInstance.keepAliveTimeout = 30000;
await version.logIfUpdateAvailable(ctx.root);
await version.logIfUpdateAvailable(cliConfig, terminalReporter);
}
function getReporterImpl(customLogReporterPath?: string): TerminalReporter {
@@ -1,89 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import {CLIError, logger} from '@react-native-community/cli-tools';
const CTRL_C = '\u0003';
/** An abstract key stroke interceptor. */
export class KeyPressHandler {
_isInterceptingKeyStrokes = false;
_isHandlingKeyPress = false;
_onPress: (key: string) => Promise<void>;
constructor(onPress: (key: string) => Promise<void>) {
this._onPress = onPress;
}
/** Start observing interaction pause listeners. */
createInteractionListener(): ({pause: boolean, ...}) => void {
// Support observing prompts.
let wasIntercepting = false;
const listener = ({pause}: {pause: boolean, ...}) => {
if (pause) {
// Track if we were already intercepting key strokes before pausing, so we can
// resume after pausing.
wasIntercepting = this._isInterceptingKeyStrokes;
this.stopInterceptingKeyStrokes();
} else if (wasIntercepting) {
// Only start if we were previously intercepting.
this.startInterceptingKeyStrokes();
}
};
return listener;
}
_handleKeypress = async (key: string): Promise<CLIError | void> => {
// Prevent sending another event until the previous event has finished.
if (this._isHandlingKeyPress && key !== CTRL_C) {
return;
}
this._isHandlingKeyPress = true;
try {
logger.debug(`Key pressed: ${key}`);
await this._onPress(key);
} catch (error) {
return new CLIError('There was an error with the key press handler.');
} finally {
this._isHandlingKeyPress = false;
return;
}
};
/** Start intercepting all key strokes and passing them to the input `onPress` method. */
startInterceptingKeyStrokes() {
if (this._isInterceptingKeyStrokes) {
return;
}
this._isInterceptingKeyStrokes = true;
const {stdin} = process;
// $FlowFixMe[prop-missing]
stdin.setRawMode(true);
stdin.resume();
stdin.setEncoding('utf8');
stdin.on('data', this._handleKeypress);
}
/** Stop intercepting all key strokes. */
stopInterceptingKeyStrokes() {
if (!this._isInterceptingKeyStrokes) {
return;
}
this._isInterceptingKeyStrokes = false;
const {stdin} = process;
stdin.removeListener('data', this._handleKeypress);
// $FlowFixMe[prop-missing]
stdin.setRawMode(false);
stdin.resume();
}
}
@@ -0,0 +1,44 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
type LoggerFn = (...message: $ReadOnlyArray<string>) => void;
/**
* Create a dev-middleware logger object that will emit logs via Metro's
* terminal reporter.
*/
export default function createDevMiddlewareLogger(
reporter: TerminalReporter,
): $ReadOnly<{
info: LoggerFn,
error: LoggerFn,
warn: LoggerFn,
}> {
return {
info: makeLogger(reporter, 'info'),
warn: makeLogger(reporter, 'warn'),
error: makeLogger(reporter, 'error'),
};
}
function makeLogger(
reporter: TerminalReporter,
level: 'info' | 'warn' | 'error',
): LoggerFn {
return (...data: Array<mixed>) =>
reporter.update({
type: 'unstable_server_log',
level,
data,
});
}
@@ -0,0 +1,39 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
/**
* A custom Error that creates a single-lined message to match current styling inside CLI.
* Uses original stack trace when `originalError` is passed or erase the stack if it's not defined.
*/
export class CLIError extends Error {
constructor(msg: string, originalError?: Error | string) {
super(inlineString(msg));
if (originalError != null) {
this.stack =
typeof originalError === 'string'
? originalError
: originalError.stack || ''.split('\n').slice(0, 2).join('\n');
} else {
// When the "originalError" is not passed, it means that we know exactly
// what went wrong and provide means to fix it. In such cases showing the
// stack is an unnecessary clutter to the CLI output, hence removing it.
this.stack = '';
}
}
}
/**
* Raised when we're unable to find a package.json
*/
export class UnknownProjectError extends Error {}
export const inlineString = (str: string = ''): string =>
str.replace(/(\s{2,})/gm, ' ').trim();
@@ -12,11 +12,13 @@
import type {Config} from '@react-native-community/cli-types';
import type {ConfigT, InputConfigT, YargArguments} from 'metro-config';
import {CLIError} from './errors';
import {reactNativePlatformResolver} from './metroPlatformResolver';
import {CLIError, logger} from '@react-native-community/cli-tools';
import {loadConfig, mergeConfig, resolveConfig} from 'metro-config';
import path from 'path';
const debug = require('debug')('ReactNative:CommunityCliPlugin');
export type {Config};
export type ConfigLoadingContext = $ReadOnly<{
@@ -91,20 +93,20 @@ export default async function loadMetroConfig(
throw new CLIError(`No Metro config found in ${cwd}`);
}
logger.debug(`Reading Metro config from ${projectConfig.filepath}`);
debug(`Reading Metro config from ${projectConfig.filepath}`);
if (!global.__REACT_NATIVE_METRO_CONFIG_LOADED) {
const warning = `
=================================================================================================
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config'
or it will fail to build. Please copy the template at:
https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js
https://github.com/react-native-community/template/blob/main/template/metro.config.js
This warning will be removed in future (https://github.com/facebook/metro/issues/1018).
=================================================================================================
`;
for (const line of warning.trim().split('\n')) {
logger.warn(line);
console.warn(line);
}
}
@@ -9,8 +9,6 @@
* @oncall react_native
*/
import querystring from 'querystring';
export default function parseKeyValueParamArray(
keyValueArray: $ReadOnlyArray<string>,
): Record<string, string> {
@@ -23,8 +21,11 @@ export default function parseKeyValueParamArray(
if (item.indexOf('&') !== -1) {
throw new Error('Parameter cannot include "&" but found: ' + item);
}
Object.assign(result, querystring.parse(item));
const params = new URLSearchParams(item);
params.forEach((value, key) => {
// $FlowExpectedError[prop-missing]
result[key] = value;
});
}
return result;
}
@@ -0,0 +1,184 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {Config} from '@react-native-community/cli-types';
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
import chalk from 'chalk';
import semver from 'semver';
const debug = require('debug')('ReactNative:CommunityCliPlugin');
type Release = {
// The current stable release
stable: string,
// The current candidate release. These are only populated if the latest release is a candidate release.
candidate?: string,
changelogUrl: string,
diffUrl: string,
};
interface DiffPurge {
name: string;
zipball_url: string;
tarball_url: string;
commit: {
sha: string,
url: string,
};
node_id: string;
}
type LatestVersions = {
candidate?: string,
stable: string,
};
type Headers = {
'User-Agent': string,
[header: string]: string,
};
/**
* Logs out a message if the user's version is behind a stable version of React Native
*/
export async function logIfUpdateAvailable(
cliConfig: Config,
reporter: TerminalReporter,
): Promise<void> {
const {reactNativeVersion: currentVersion} = cliConfig;
let newVersion = null;
try {
const upgrade = await getLatestRelease(currentVersion);
if (upgrade) {
newVersion = upgrade;
}
} catch (e) {
// We let the flow continue as this component is not vital for the rest of
// the CLI.
debug(
'Cannot detect current version of React Native, ' +
'skipping check for a newer release',
);
debug(e);
}
if (newVersion == null) {
return;
}
if (semver.gt(newVersion.stable, currentVersion)) {
reporter.update({
type: 'unstable_server_log',
level: 'info',
data: `React Native v${newVersion.stable} is now available (your project is running on v${currentVersion}).
Changelog: ${chalk.dim.underline(newVersion?.changelogUrl ?? 'none')}
Diff: ${chalk.dim.underline(newVersion?.diffUrl ?? 'none')}
`,
});
}
}
// $FlowFixMe
function isDiffPurgeEntry(data: Partial<DiffPurge>): data is DiffPurge {
return (
[data.name, data.zipball_url, data.tarball_url, data.node_id].filter(
e => typeof e !== 'undefined',
).length === 0
);
}
/**
* Checks via GitHub API if there is a newer stable React Native release and,
* if it exists, returns the release data.
*
* If the latest release is not newer or if it's a prerelease, the function
* will return undefined.
*/
export default async function getLatestRelease(
currentVersion: string,
): Promise<Release | void> {
debug('Checking for a newer version of React Native');
try {
debug(`Current version: ${currentVersion}`);
// if the version is a nightly/canary build, we want to bail
// since they are nightlies or unreleased versions
if (['-canary', '-nightly'].some(s => currentVersion.includes(s))) {
return;
}
debug('Checking for newer releases on GitHub');
const latestVersion = await getLatestRnDiffPurgeVersion();
if (latestVersion == null) {
debug('Failed to get latest release');
return;
}
const {stable, candidate} = latestVersion;
debug(`Latest release: ${stable} (${candidate ?? ''})`);
if (semver.compare(stable, currentVersion) >= 0) {
return {
stable,
candidate,
changelogUrl: buildChangelogUrl(stable),
diffUrl: buildDiffUrl(currentVersion, stable),
};
}
} catch (e) {
debug('Something went wrong with remote version checking, moving on');
debug(e);
}
}
function buildChangelogUrl(version: string) {
return `https://github.com/facebook/react-native/releases/tag/v${version}`;
}
function buildDiffUrl(oldVersion: string, newVersion: string) {
return `https://react-native-community.github.io/upgrade-helper/?from=${oldVersion}&to=${newVersion}`;
}
/**
* Returns the most recent React Native version available to upgrade to.
*/
async function getLatestRnDiffPurgeVersion(): Promise<LatestVersions | void> {
const options = {
// https://developer.github.com/v3/#user-agent-required
headers: {'User-Agent': '@react-native/community-cli-plugin'} as Headers,
};
const resp = await fetch(
'https://api.github.com/repos/react-native-community/rn-diff-purge/tags',
options,
);
const result: LatestVersions = {stable: '0.0.0'};
if (resp.status !== 200) {
return;
}
const body: DiffPurge[] = (await resp.json()).filter(isDiffPurgeEntry);
for (const {name: version} of body) {
if (result.candidate != null && version.includes('-rc')) {
result.candidate = version.substring(8);
continue;
}
if (!version.includes('-rc')) {
result.stable = version.substring(8);
return result;
}
}
return result;
}

Some files were not shown because too many files have changed in this diff Show More