Compare commits

...
Author SHA1 Message Date
React Native Bot ca48f3fbdc Release 0.79.3
#publish-packages-to-npm&latest
2025-06-04 16:12:56 +00:00
4f01e87336 [Local] Fix CI for 0.79-stable (#51804)
Co-authored-by: Dawid Małecki <maleckidawid@meta.com>
resolved: https://github.com/facebook/react-native/pull/51382
2025-06-04 16:03:11 +01:00
Riccardo Cipolleschi 76f3d5cab4 [LOCAL]Bump Hermes version 2025-06-04 11:15:01 +01:00
Krystof WoldrichandRiccardo Cipolleschi af21f260a1 fix(types): Reference global.d.ts using path not types (#51104)
Summary:
After https://github.com/facebook/react-native/pull/49516 TSC would not find the global types.

Types reference expect a package name but was given a path to a declaration.

TS doc: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-

This PR changes `types` to `path` to fix the issue.

`dtslint` fails with `no-bad-reference` rule, but the `../src` lives in the same package in `react-native` package.

<!-- 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] - Reference `global.d.ts` using `path` so they can be resolved by TSC

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

Test Plan:
Before the change with current RN 0.79.2 TSC would fail on resolving the global types (example from [Sentry RN SDK build](https://github.com/getsentry/sentry-react-native/commit/134d810cf95416091779806e00d3a3cc6cbace89)):

![Screenshot 2025-05-05 at 17 18 04](https://github.com/user-attachments/assets/b264c8da-aa21-49d8-9597-82586291a01a)

After the change to path TSC finds the global types.

Using TSC Version 4.9.5

Reviewed By: huntie

Differential Revision: D74208815

Pulled By: coado

fbshipit-source-id: 2fd51d79061ffb356c047604213cff7a425f167e
2025-06-04 11:06:44 +01:00
Kirill NovikovandRiccardo Cipolleschi ed7b4d86ab Allow the .pnpm folder to be discovered during code generation (#49983)
Summary:
This PR (https://github.com/facebook/react-native/pull/48182) introduced skipping hidden folders during Codegen generation.

However, when using pnpm, all files are stored in the `.pnpm` folder (see explanation here: https://pnpm.io/symlinked-node-modules-structure).

As a result, some libraries that support the new architecture but lack the `ios.codegenConfig.componentProvider` field - like [FlashList](https://github.com/Shopify/flash-list/blob/main/package.json) - will be skipped during Codegen generation.

This PR explicitly includes `.pnpm` to prevent this issue.

## Changelog:

[iOS][Fixed] - Check .pnpm folder when looking for third-party components.

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

Test Plan:
Tested on:

RN 0.78.0
PNPM: 10
Flashlist: 1.7.3

Reviewed By: cipolleschi

Differential Revision: D71047936

Pulled By: cortinico

fbshipit-source-id: fa9caab23dea8c92ef5f23c997812d348eb19e08
2025-06-04 11:03:29 +01:00
Ritesh ShuklaandRiccardo Cipolleschi a47b9aab5d Fixed borderBottomEndRadius on RTL (#51229)
Summary:
Fixes https://github.com/facebook/react-native/issues/51193
[ANDROID][FIXED] Wrong borderBottomEndRadius on RTL

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

Test Plan:
Tested with Arabic (RTL) and English(LTR)

English
<img src="https://github.com/user-attachments/assets/5bd1eca9-194c-4d83-b75f-689bc13d827b" width=200>

Arabic
<img src="https://github.com/user-attachments/assets/459320a0-6bb2-4585-97bb-bd4ded6ec399" width=200>

Reviewed By: cortinico

Differential Revision: D74709219

Pulled By: NickGerleman

fbshipit-source-id: 885bb84d97d73324983d044fd2874a457b40f646
2025-06-04 11:02:46 +01:00
Riccardo Cipolleschi e5c089669a Exclude selectively disabled libraries from codegen generation 2025-06-04 10:59:56 +01:00
aleqsioandReact Native Bot 3af9e65e3f Fix disappearing redbox on initial load of an invalid bundle. (#50867)
Summary:
Right now having a javascript error like an invalid import statement during first bundle load results in a disappearing redbox screen.

https://github.com/user-attachments/assets/ab9c64f5-6e32-481c-a58f-6d37bb920acb

The `invalidate` call removed in this PR cleans up all turbomodules, including the RedBox module, which in turns calls `dismiss` in `RCTRedBox`.

After removing this line the result is as following:

https://github.com/user-attachments/assets/6eeb4d43-f883-440f-ade3-5628f85f833a

I made sure that the `invalidate` function is still called when executing only two possible ways to reload the bundle:
- the Reload button
- Cmd+R

The HMR/hot reload is not connected if the bundle has an error on initial load, so we don't need to worry about it.

Longer term, it would be better to establish HMR and use a different redbox in this case:

![simulator_screenshot_DFF4EA47-DA12-46A9-81DF-9904B35EB1D9](https://github.com/user-attachments/assets/c46eb0e9-845a-4b62-96e2-74215cbdad18)

Doing this requires larger changes to the bundle loading flow – happy to to try and land that change if there's any guidance you could give.

## 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] – Fix disappearing redbox on initial load of an invalid bundle.

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

Test Plan: I have tested this change using RN from main and RNTester app (see videos).

Reviewed By: cortinico

Differential Revision: D73511154

Pulled By: cipolleschi

fbshipit-source-id: dfe149ebc15d845f07fd3926db2e063b468870af
2025-06-04 09:47:01 +00:00
Kacper RożniataandReact Native Bot c8fcac2765 fix(iOS): enable DEFINES_MODULE in React-jsc (#51160)
Summary:
Enables `DEFINES_MODULE` in `React-jsc.podspec`

After upgrading app to RN `0.79`, when installing pods with JSC enabled there is an error being thrown that

`The following Swift pods cannot yet be integrated as static libraries`
`The Swift pod 'RNFlashList' depends upon 'React-jsc', which does not define modules. ...`
when installing packages that use Swift

## Changelog:

[IOS] [CHANGED] -  enable `DEFINES_MODULE` in `React-jsc.podspec`

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

Test Plan: RNTester runs and builds correctly

Reviewed By: huntie

Differential Revision: D74325357

Pulled By: cipolleschi

fbshipit-source-id: b994b7e678633440d5e362ae6965b2d5188d34f1
2025-06-04 09:46:34 +00:00
zhongwuzwandReact Native Bot 8d42fc40bc iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false (#50049)
Summary:
Fixes https://github.com/facebook/react-native/issues/50026

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

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

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

Reviewed By: javache

Differential Revision: D71307864

Pulled By: cipolleschi

fbshipit-source-id: 57238296842229cf2f23a3f44134f43e27b54609
2025-06-04 09:43:59 +00:00
Christian FalchandReact Native Bot 27601849aa fix adding children (#51213)
Summary:
See https://github.com/facebook/react-native/issues/51212 - children aren't updated correctly in an old arch native view using the interop layer under Fabric.

This is caused by the mountChildComponentView method not updating the view, only adding the new view to a list that will be used on the next update to mount the child.

This commit fixes this by adding the same pattern as in unmountChildComponentView where children are inserted directly if the underlying paperview is available in the adapter - otherwise it uses the mounting list as before.

#Closes 51212

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - fixed adding child views to a native view using the interop layer

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

Test Plan:
**Previous output**:

<image src="https://github.com/user-attachments/assets/472b95e7-0921-46c9-be6a-f31759c0cd26" width="200px" />

**After fix**:

<image src="https://github.com/user-attachments/assets/554387cd-c264-483e-9c52-d9cd40b42601" width="200px" />

Reviewed By: sammy-SC

Differential Revision: D74471278

Pulled By: cipolleschi

fbshipit-source-id: 798f9e7be389359bd6e3aa1b6a6e9fb799fcb369
2025-06-04 09:41:58 +00:00
Eric RozellandReact Native Bot eeb961264e Fix issue with zIndex child removal (#49900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49900

This appears to fix an issue where removing a sibling with zIndex breaks drawing of the next sibling. The theory is that eager return in `onViewRemoved` prevents the view from reverting into a state where it no longer uses custom draw order. However, tracing back history, this eager return was [added](https://github.com/facebook/react-native/pull/43389) to fix a bug in Reanimated. cc bartlomiejbloniarz to confirm if [this Reanimated issue](https://github.com/software-mansion/react-native-reanimated/issues/5715) resurfaces from this change.

Fixes #49838

## Changelog

[Android][Fixed] Fixes issue with z-indexed sibling removal

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D70795631

fbshipit-source-id: 500af92226be29af73f36f911ffff27a0c083ae9
2025-06-04 09:41:05 +00:00
Phil PluckthunandReact Native Bot 942422c4cb fix: Align TimerManager sequential ids and function error handling with web standard (#51500)
Summary:
Calls to create timers should return sequential ids (integers greater than zero in the spec's words). This regressed in the `TimerManager` implementation, which instead starts at zero inclusively.

This has two side-effects for code assuming a spec-compliant implementation of `setTimeout` and `setInterval`:
- Calls to `clearTimeout(0)` or `clearInterval(0)` will potentially cancel scheduled timers, although it's supposed to be a noop
- Predicates like `if (timeoutId)` will fail since they assume non-negative ids

The change in this PR is to align with WHATWG HTML 8.6.2 (Timers): https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

> otherwise, let id be an [implementation-defined](https://infra.spec.whatwg.org/#implementation-defined) integer that is **greater than zero** and does not already [exist](https://infra.spec.whatwg.org/#map-exists) in global's [map of setTimeout and setInterval IDs](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#map-of-settimeout-and-setinterval-ids).

Specifically,
- we should return `0` to indicate that no timer was scheduled
- we should start generating timer IDs at `1` instead of `0`

This was previously raised in review comments here: https://github.com/facebook/react-native/pull/45092/files#r1650790008

The spec-incompliant behaviour was raised in an issue here: https://github.com/apollographql/apollo-client/issues/12632#issue-3075269978

This PR does not,
- add bounds checking on `timerIndex_` and add a search of an available id that isn't in the unordered map
- exclude `0` from being an accepted `TimerHandle` in `TimerManager::createTimer` or `TimerManager::deleteTimer` since the above bounds checking hasn't been added either

## Changelog:

[GENERAL] [FIXED] - Align timer IDs and timer function argument error handling with web standards.

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

Test Plan:
- Run `setTimeout` / `setInterval`; before applied changes the timeout for the first timer will be `0`
- Run `setTimeout(null)`; before applied changes the timer ID will be non-zero
- Run `setInterval(null)`; before applied changes an error will be thrown rather than `0` being returned

Reviewed By: cipolleschi

Differential Revision: D75145909

Pulled By: rshest

fbshipit-source-id: 6646439abd29cf3cfa9e5cf0a57448e3b7cd1b48
2025-06-04 09:39:29 +00:00
Alex HuntandGitHub cb7d0bde2b Update debugger-frontend from 97e99126...8f145a05 (S523384 mitigation) (#51569) 2025-06-04 10:38:38 +01:00
Fabrizio Cucci 07978dc2e7 Update Podfile.lock
Changelog: [Internal]
2025-05-01 18:59:24 +01:00
React Native Bot 9c5fc79581 Release 0.79.2
#publish-packages-to-npm&latest
2025-05-01 15:49:26 +00:00
Jakub GrzywaczandFabrizio Cucci a13be817cc Fix ImageSource require (#50963)
Summary:
In react-native-svg, I found that the `Image` component stopped working starting with `react-native@0.79`. After some debugging, I traced the issue to the migration of `Libraries/Image` to the new export syntax (see https://github.com/facebook/react-native/commit/8783196ee540f8f78ce60ad20800338cc7645194). To fix this, I updated the import to match other requires, similar to https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L84.

[GENERAL] [FIXED] - Fix codegen ImageSource require

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

Test Plan:
`validAttributes` process should be a function instead of object with a default property.

Before:
<img width="1041" alt="image" src="https://github.com/user-attachments/assets/9fbc9e9f-6c45-4b0b-adb8-2eb911676fe1" />

After:
<img width="1005" alt="image" src="https://github.com/user-attachments/assets/ee594103-90da-4917-8252-72f4ecfc28e1" />

Reviewed By: Abbondanzo

Differential Revision: D73778127

Pulled By: huntie

fbshipit-source-id: ae80c770e8e578794ae1356751f170ff955e1f5a
2025-05-01 15:05:09 +01:00
Riccardo CipolleschiandReact Native Bot a99773d8d7 Fix URL parsing to respect node/chromium convention (#50757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50757

We received [this issue](https://github.com/facebook/react-native/issues/50747) in OSS where the URL parsing logic does not respect node/chromium specs.

This can cause issue in usercode. This change fixes it

## Changelog:
[General][Fixed] - make sure that URLs are parsed following the node specs

Reviewed By: huntie

Differential Revision: D73101813

fbshipit-source-id: 36f1d23b3ad7882c16524843621d9ebbcc09b95d
2025-05-01 13:57:11 +00:00
22a4e060d5 Backport useShadowNodeStateOnClone and updateRuntimeShadowNodeReferencesOnCommit (and more)
* Add updateRuntimeShadowNodeReferencesOnCommit and useShadowNodeStateOnClone feature flags

* Use source shadow node state on clone

* Enable useShadowNodeStateOnClone by default on OSS

* Split shadow node reference setter and update functionality

* Move shadow node reference updates to tree commit

* Enable updateRuntimeShadowNodeReferencesOnCommit by default for OSS

---------

Co-authored-by: Nick Lefever <lefever@meta.com>
2025-05-01 14:53:38 +01:00
Fabrizio Cucci 994ab4a26e Update Podfile.lock
Changelog: [Internal]
2025-04-15 15:53:29 +01:00
Fabrizio CucciandReact Native Bot a6a511715e Fix verifyPublishedTemplate after failure for 0.79.0 (#50554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50554

This should fix the issue found during the 0.79.0 release.

https://github.com/facebook/react-native/actions/runs/14329766551/job/40166165007

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D72637751

fbshipit-source-id: 1b3ccbab162f484c96e5ff768766848f82acd818
2025-04-15 13:54:46 +00:00
React Native Bot aa51fb4cac Release 0.79.1
#publish-packages-to-npm&latest
2025-04-15 10:11:17 +00:00
Wang ChuanandFabrizio Cucci 89f4dd2a24 fix(ios): avoid incorrectly updating caret position (#50680)
Summary:
Avoid incorrectly updating caret position

Pull Request resolved: https://github.com/facebook/react-native/issues/50641

The caret position is updated incorrectly when a user is first typing if an zero-length selection is set.

[IOS] [CHANGED] - Typing into TextInput now will not cause the caret position to update to the beginning when a zero-length selection is set.

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

Test Plan:
Tested with the following code(a simplified version from the code in https://github.com/facebook/react-native/issues/50641)
```js
const [selection, setSelection] = useState({start: -1, end: -1});
const onSelectionChange = (
      evt: NativeSyntheticEvent<TextInputSelectionChangeEventData>,
    ) => {
      const {selection} = evt.nativeEvent;
      const {start, end} = selection;
      console.log('selection change: ', start, end);
      setSelection(selection);
};
return (
  <View style={{ position: 'absolute', top: 50, left: 30 }}>
    <TextInput
      placeholder="test"
      selection={selection}
      onSelectionChange={onSelectionChange}
    />
  </View>
);
```
When using the main branch, the caret position will jump back to the beginning after the first typing.
It works fine after applying this commit.

Reviewed By: fabriziocucci

Differential Revision: D72957245

Pulled By: cipolleschi

fbshipit-source-id: 3586797332b35e86b17f386a35e7d192ff758f7e
2025-04-14 15:42:35 +01:00
Riccardo CipolleschiandGitHub f3c280442d [RN][iOS] Do not generate ReactCodegen.podspec for libraries (#50646) 2025-04-14 12:34:02 +01:00
Riccardo CipolleschiandGitHub b2bacc4a9f [RN][Codegen] Do not generate Apple specific file for Android (#50655) 2025-04-14 11:17:59 +01:00
Alan HughesandReact Native Bot d068888d8a Change exception handele type in ReleaseDevSupportManager (#50400)
Summary:
In expo-updates, we would like to handle exceptions on app launch. We used to do this by reassigning our own `DefaultJSExceptionHandler` to the property on the  `ReleaseDevSupportManager `.  This class has been migrated to kotlin and is now final so we can no longer do this. Instead of having the `defaultJSExceptionHandler` typed as `DefaultJSExceptionHandler` we'd like to change it to the interface, `JSExceptionHandler` so we can do this https://github.com/expo/expo/blob/93b7e9b1724a7be11b9d79c0313a2e5a2fd5e5bf/packages/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt#L118C82-L118C97

## Changelog:

[ANDROID] [CHANGED] Change `defaultJSExceptionHandler`'s type to  `JSExceptionHandler` on the `ReleaseDevSupportManager`

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

Test Plan: RNTester runs without issue in a release build.

Reviewed By: huntie

Differential Revision: D72173667

Pulled By: cortinico

fbshipit-source-id: 978fd696322432e638a90014ff3c8c2b09fae761
2025-04-14 10:12:37 +00:00
Fabrizio Cucci 647fb382bf Update Podfile.lock
Changelog: [Internal]
2025-04-08 13:56:41 +01:00
React Native Bot c823a147e2 Release 0.79.0
#publish-packages-to-npm&latest
2025-04-08 09:14:40 +00:00
Riccardo CipolleschiandReact Native Bot e0012c0868 Pin cmake version to 3.31.6 (#50464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50464

Runners in GHA has been updated by github and they now ship with CMake 4.0. (actions/runner-images#11926)

This version is not compatible with React Native, so we are pinning cmake to 3.36.1

## Changelog:
[Internal] - Pin cmake to 3.36.1

Reviewed By: cortinico

Differential Revision: D72379834

fbshipit-source-id: ab09009102118e6590f02cf57fa6f9149482f62b
2025-04-03 14:08:54 +00:00
Fabrizio Cucci 2abcf99cb4 Update Podfile.lock
Changelog: [Internal]
2025-04-01 11:00:24 +01:00
React Native Bot 0df2a11ed0 Release 0.79.0-rc.4
#publish-packages-to-npm&next
2025-03-31 16:18:42 +00:00
Kudo ChienandFabrizio Cucci 6c907ee11b fix React-jsitooling build error for use_frameworks build (#50252)
Summary:
to resolve use_frameworks build error. this is an edge case happening only when there's objective-c files import to `React_RCTAppDelegate`. Xcode will have `include of non-modular header inside framework module` error originally. this is the generated umbrella header for jsitooling is incorrect. even the header path are correct, they are not modular headers.

~this pr adds a workaround to import header from outside the module.~ updates: this pr uses a forward declaration to prevent exposing the dependency in umbrella header.

[IOS] [FIXED] - `JSRuntimeFactoryCAPI.h` build error for  `use_frameworks` build

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

Test Plan:
to reproduce the build error, we can build `USE_FRAMEWORKS=static bundle exec pod install` from rn-tester. we also need to import `React_RCTAppDelegate` from objective-c files. in this case, we can add `import React_RCTAppDelegate;` in rn-tester's main.m

```diff
 --- a/packages/rn-tester/RNTester/main.m
+++ b/packages/rn-tester/RNTester/main.m
@@ -8,6 +8,9 @@
 #import <UIKit/UIKit.h>

 #import "AppDelegate.h"
+@import React_RCTAppDelegate;
+// This also triggers the error
+//#import <React_RCTAppDelegate/React-RCTAppDelegate-umbrella.h>

 int main(int argc, char *argv[])
 {
```

Reviewed By: fabriziocucci

Differential Revision: D71963188

Pulled By: cipolleschi

fbshipit-source-id: 5d566ae5aadb9efc032aacfe32862ea289134f87
2025-03-28 11:32:25 +00:00
Riccardo CipolleschiandReact Native Bot 0bd7b4eb47 Back out "fix: avoid race condition crash in [RCTDataRequestHandler invalidate]" (#49797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49797

Backing D70314889 as it was breaking some internal tests.

I verified that before the backout the tests were failing and after the backout they were not.

## Changelog:
[iOS][Changed] - Reverted  fix: avoid race condition crash in [RCTDataRequestHandler invalidate].

Reviewed By: Abbondanzo

Differential Revision: D70511155

fbshipit-source-id: 276f6947aa6bb648c9c9eeb5c342f336acc8a26f
2025-03-28 10:40:57 +00:00
Riccardo CipolleschiandFabrizio Cucci adb3beed64 Have react-hermes and React-renderercss define modules (#50283)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50283

In OSS we have some libraries written in Swift, like Flashlist, that depends on these pods.

However, if a pod is not configured to define modules, those pods cannot be imported by Swift. Therefore, the libraries above will failed to be installed in a project.

This change adds the defines_modules directive to those pods and make the library work again.

This fixes https://github.com/facebook/react-native/issues/50246

[Internal] - Make React-hermes and React-renderercss defines modules

Reviewed By: fabriziocucci

Differential Revision: D71892679

fbshipit-source-id: b03b65986fbdbe781b616f31dfb6bceb38b8b3b7
2025-03-27 10:27:10 +00:00
Rubén NorteandFabrizio Cucci a42971a200 Avoid errors when dispatching mount operations within mount hooks (#50091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50091

Changelog: [internal]

If a library uses mount hooks to perform mount operations, it's possible to get concurrent modifications of the list of pending surface IDs to report.

This fixes that potential error by making a copy of the list before dispatching the mount notifications.

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

Reviewed By: javache

Differential Revision: D71387739

fbshipit-source-id: 96c723ef2d6bcc659c4452434b7a4d5af26117ef
2025-03-26 13:54:31 +00:00
Rubén NorteandFabrizio Cucci 4e4b9baf3c Correctly batch reportMount calls (#50090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50090

Changelog: [internal]

I refactored `FabricUIManager` in D54547194 / https://github.com/facebook/react-native/pull/43337 and accidentally removed setting this flag to avoid scheduling redundant tasks in the UI thread to report mount. This fixes it.

Reviewed By: javache

Differential Revision: D71387374

fbshipit-source-id: cad8a3ead2434738325560902cbab817e5d5dde7
2025-03-26 13:47:29 +00:00
Fabrizio Cucci 4f838c22cd Update Podfile.lock
Changelog: [Internal]
2025-03-24 19:32:38 +00:00
React Native Bot abad2f48da Release 0.79.0-rc.3
#publish-packages-to-npm&next
2025-03-24 15:12:10 +00:00
Nicola CortiandReact Native Bot 63fdc04888 RNGP - Better compatibility with Kotlin 2.1.x (#49977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49977

See: https://github.com/facebook/react-native/issues/48274
This makes our integration with Kotlin 2.1.x easier.

Changelog:
[Android] [Changed] - Better compatibility with Kotlin 2.1.x

Reviewed By: cipolleschi

Differential Revision: D71034044

fbshipit-source-id: 9a26ed28ae4770a5c05a4113f4d86c1b97063db3
2025-03-24 10:41:38 +00:00
Riccardo CipolleschiandReact Native Bot 9805a4f89a Convert to JSException only NSException from sync methods (#50193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50193

This fix makes sure that we convert to JSException only NSException thrwn by sync methods.
Currently, nothing in the stack will be capable of understanding that js error if it is triggered by an exception raised by an asyc method.

See https://github.com/reactwg/react-native-new-architecture/discussions/276 for further details

We need to cherry pick this in 0.78 and 0.79

## Changelog:
[iOS][Fixed] - Make sure the TM infra does not crash on NSException when triggered by async method

Reviewed By: fabriziocucci

Differential Revision: D71619229

fbshipit-source-id: b87aef5dd2720a2641c8da0904da651866370dc6
2025-03-24 09:10:49 +00:00
Riccardo CipolleschiandReact Native Bot 5d26c5132c Add React-renderercss dependency for 3p libs (#50192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50192

Third party libraries depend transitively agains the React-renderercss modules because it is imported by Fabric.
Without this change, the use_frameworks on iOS does not works when a 3P library is imported.

This changes fix the behavior and we need to cherry pick them in 0.79.

## Changelog:
[iOS][Fixed] - Make sure 3p libraries depends on React-renderercss to work with use_frameworks

Reviewed By: fabriziocucci

Differential Revision: D71618395

fbshipit-source-id: 70c12dcbeb2dfa5fd7513c27d5c069a1f3c95966
2025-03-21 15:11:41 +00:00
Riccardo CipolleschiandReact Native Bot 63149256c0 Handle null params in the Interop TM layer (#49873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49873

In the old architecture, when we were passing a `null` value as a parameter in a function that accepted nullable parameter, the null value was mapped to `nil` on iOS.

After my changes in [d4236791e2](https://github.com/facebook/react-native/commit/d4236791e238a614d2fadf5c5659874d983ab029), in the New Architecture, through the interop layer, legacy modules were receiving an `NSNull` object instead of nil.

This was breaking those modules which started crashing or observing undesired behavior.

This change fixes the issue by making sure that, in those cases, a `nil` value is passed.

Note that nested objects in the old architecture were correctly receiving NSNull, so nested objects were behaving correctly already.

## Changelog:
[iOS][Fixed] - Properly pass `nil` for nullable parameters instead of `NSNull` for legacy modules

Reviewed By: javache

Differential Revision: D70723460

fbshipit-source-id: 384f48b6dbb3f54c369b31b6d2ee06069fa3591c
2025-03-19 08:00:15 +00:00
Riccardo Cipolleschi 9498b71438 [RN][iOS] Fix codegen to avoid the creation of <appName>, folders 2025-03-18 15:52:59 +00:00
Michail StrokinandReact Native Bot 669956369a marked acquireWakeLockNow as static as it was static before (#49875)
Summary:
acquireWakeLockNow was static before but wasn't marked as static in https://github.com/facebook/react-native/commit/9afad527b831ec0c5d50e88daacbaacbc476d478  when changing code to Kotlin.

This breaks react-native-firebase but I've submitted the bug report there as I guess it might be fixed there too.

## Changelog:

[ANDROID] [FIXED] - Marked acquireWakeLockNow as static

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

Test Plan: No tests as it reverts the broken change

Reviewed By: rshest

Differential Revision: D70773675

Pulled By: javache

fbshipit-source-id: d7363702dfec078b7e6d2693d05b8ab87e818522
2025-03-18 14:54:48 +00:00
Fabrizio Cucci fb7ca6a688 Update Podfile.lock
Changelog: [Internal]
2025-03-18 08:13:41 +00:00
React Native Bot 60c2fe0ef7 Release 0.79.0-rc.2
#publish-packages-to-npm&next
2025-03-17 14:46:33 +00:00
Vojtech NovakandReact Native Bot 8b0c333a99 fix(ios): enable use of multiple RCTAppDependencyProvider instances (#49889)
Summary:
instantiating multiple `RCTAppDependencyProvider` instances creates problems with their internal state, because the internal fields such as [`_thirdPartyFabricComponents` are populated once](https://github.com/facebook/react-native/blob/f5feb73022f9340583ebcf576eaedd3ca5677e1a/packages/react-native/scripts/codegen/templates/RCTAppDependencyProviderMM.template#L60) for the entire app (see [`dispatch_once`](https://developer.apple.com/documentation/dispatch/1447169-dispatch_once)).

That means when you create 2 instances, and call `thirdPartyFabricComponents` on them, the first instance will respond with a dictionary and the second with `nil`. This is unexpected.

## Changelog:

[IOS] [FIXED] - enable use of multiple `RCTAppDependencyProvider` instances

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

Test Plan:
`rnTester` - the templates are used by codegen. Running `pod install`, the files were generated correctly from the `.template` files.

I was able to verify that accessing `thirdPartyFabricComponents` on multiple instances of `RCTAppDependencyProvider` returns valid result.

<details>
<summary>screenshot</summary>

<img width="789" alt="Screenshot 2025-03-07 at 15 11 22" src="https://github.com/user-attachments/assets/9270ba90-ae7f-491a-a53a-f7e1f4606438" />

</details>

Reviewed By: javache

Differential Revision: D70892779

Pulled By: cipolleschi

fbshipit-source-id: 27c7c8fd9982b6427daec02e0de59b08ad20bfad
2025-03-17 10:09:58 +00:00
Phil PluckthunandGitHub b63040fcce [0.79] refactor(react-native-codegen): Replace jscodeshift with @babel/core (#50031)
* Replace jscodeshift with @babel/core

* Rewrite GenerateViewConfigJs with @babel/core

* Update yarn.lock

* Update snapshots

* Remove unused devDependencies

* Remove jscodeshift from root

* Format with prettier

* Import changes (literal -> stringLiteral rather than identifier in some cases)

* Update snapshots

* Update snapshots for babel-plugin-codegen

* Disable babelrc since we're only stringifying

* Revert "Remove unused devDependencies"

This reverts commit f8defcf93d.
2025-03-14 11:46:26 +00:00
zhongwuzwandReact Native Bot 15451690c0 Fixes TextInput crashes when any text is entered while running as iOS app on apple silicon mac (#49320)
Summary:
Fixes https://github.com/facebook/react-native/issues/48544. We can make `RCTWeakEventEmitterWrapper` to subclass `NSDictionary` that Textinput supports encode it.

System allowed classes are:
```
Allowed classes are:
 {(
    "'NSMorphology' (0x20088b6d8) [/System/Library/Frameworks/Foundation.framework]",
    "'NSString' (0x2003f4738) [/System/Library/Frameworks/Foundation.framework]",
    "'NSInflectionRule' (0x20088d348) [/System/Library/Frameworks/Foundation.framework]",
    "'UIColor' (0x2006c0520) [/System/iOSSupport/System/Library/PrivateFrameworks/UIKitCore.framework]",
    "'NSTextAttachment' (0x20042af98) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSShadow' (0x20042ae30) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSTextEncapsulation' (0x200897e50) [/System/Library/Frameworks/CoreText.framework]",
    "'NSTextAlternatives' (0x20042af70) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSFont' (0x20042a9f8) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSAttributedString' (0x2003f3838) [/System/Library/Frameworks/Foundation.framework]",
    "'NSData' (0x2003ed528) [/System/Library/Frameworks/CoreFoundation.framework]",
    "'NSURL' (0x2003ed938) [/System/Library/Frameworks/CoreFoundation.framework]",
    "'NSAdaptiveImageGlyph' (0x2008ae538) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSNumber' (0x2003f4238) [/System/Library/Frameworks/Foundation.framework]",
    "'NSParagraphStyle' (0x20042ad40) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSDictionary' (0x2003ed5a0) [/System/Library/Frameworks/CoreFoundation.framework]",
    "'UIFont' (0x20042c668) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSColor' (0x200412350) [/System/Library/Frameworks/AppKit.framework]",
    "'NSGlyphInfo' (0x20042aa98) [/System/Library/PrivateFrameworks/UIFoundation.framework]",
    "'NSArray' (0x2003ed460) [/System/Library/Frameworks/CoreFoundation.framework]",
    "'NSPresentationIntent' (0x20088da28) [/System/Library/Frameworks/Foundation.framework]"
)}
```

## Changelog:

[IOS] [FIXED] -  Fixes TextInput crashes when any text is entered while running as iOS app on apple silicon mac

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

Test Plan:
Run RNTester on apple silicon mac, and entered some text in textinput, no crash occured. Also, verified that the caret was not jumping around, thus preserving the original fix.

https://github.com/user-attachments/assets/6304f6e7-c663-4351-ace8-ab1842ee545f

Reviewed By: javache

Differential Revision: D69981500

Pulled By: cipolleschi

fbshipit-source-id: 2af9b280e42f621446efda9b101af50525e8fef7
2025-03-11 14:23:27 +00:00
zhongwuzwandReact Native Bot 203f886228 Call RCTInitializeUIKitProxies before bridge create (#49776)
Summary:
In bridge mode, we missed the call of `RCTInitializeUIKitProxies`, leading to UI API called on a background thread.  bridgeless is ok because we call it when create host https://github.com/facebook/react-native/pull/49600 .

```

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication connectedScenes]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c700 RCTKeyWindow + 84
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_G
Main Thread Checker: UI API called on a background thread: -[UIApplication connectedScenes]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c700 RCTKeyWindow + 84
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_G
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIScene activationState]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c808 RCTKeyWindow + 348
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL
Main Thread Checker: UI API called on a background thread: -[UIScene activationState]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c808 RCTKeyWindow + 348
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIWindowScene keyWindow]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c968 RCTKeyWindow + 700
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL
Main Thread Checker: UI API called on a background thread: -[UIWindowScene keyWindow]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x000000010695c968 RCTKeyWindow + 700
5   React                               0x0000000106942a44 -[RCTTraitCollectionProxy init] + 120
6   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
7   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
8   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
9   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
10  CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
11  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
12  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
13  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
14  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
15  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
16  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
17  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
18  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
19  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
20  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
21  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
22  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
23  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
24  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
25  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
26  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
27  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
28  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
29  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIWindow traitCollection]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x0000000106942a64 -[RCTTraitCollectionProxy init] + 152
5   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
6   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
8   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
9   CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
10  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
11  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
12  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
13  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
14  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
15  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
16  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
17  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
18  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
19  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
20  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
21  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
22  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
23  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
24  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
25  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
26  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
27  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
28  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL__N_115ReentrancyCheckENS0_7RuntimeES5_E18evaluateJavaScriptERKNSt3__110share
Main Thread Checker: UI API called on a background thread: -[UIWindow traitCollection]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x0000000106942a64 -[RCTTraitCollectionProxy init] + 152
5   React                               0x00000001069429ac __41+[RCTTraitCollectionProxy sharedInstance]_block_invoke + 36
6   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
8   React                               0x0000000106942960 +[RCTTraitCollectionProxy sharedInstance] + 88
9   CoreModules                         0x000000010538c488 -[RCTPlatform getConstants] + 80
10  CoreModules                         0x000000010538c42c -[RCTPlatform constantsToExport] + 32
11  React                               0x00000001068f2440 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 752
12  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
13  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
14  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
15  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
16  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
17  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
18  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
19  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
20  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
21  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
22  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
23  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
24  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
25  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
26  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
27  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shared_ptrIKNS0_6BufferEEERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 64
28  reacthermes                         0x00000001094736f4 _ZN8facebook3jsi20WithRuntimeDecoratorINS_5react12_GLOBAL__N_115ReentrancyCheckENS0_7RuntimeES5_E18evaluateJavaScriptERKNSt3__110share
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x00000001068dc7bc -[RCTKeyWindowValuesProxy init] + 196
5   React                               0x00000001068dc6d8 __41+[RCTKeyWindowValuesProxy sharedInstance]_block_invoke + 36
6   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
8   React                               0x00000001068dc68c +[RCTKeyWindowValuesProxy sharedInstance] + 88
9   CoreModules                         0x0000000105369ce8 -[RCTDeviceInfo init] + 124
10  React                               0x00000001068ef440 __115-[RCTModuleData initWithModuleClass:bridge:moduleRegistry:viewRegistry_DEPRECATED:bundleManager:callableJSModules:]_block_invoke + 36
11  React                               0x00000001068efca4 -[RCTModuleData setUpInstanceAndBridge:] + 1440
12  React                               0x00000001068f1e40 -[RCTModuleData instance] + 1168
13  React                               0x00000001068f2300 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 432
14  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
15  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
16  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
17  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
18  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
19  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
20  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
21  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
22  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
23  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
24  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
25  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
26  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
27  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
28  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
29  reacthermes                         0x0000000109476514 _ZN8facebook3jsi16RuntimeDecoratorINS0_7RuntimeES2_E18evaluateJavaScriptERKNSt3__110shar
Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 91600, TID: 2326173, Thread name: com.facebook.react.JavaScript, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   React                               0x00000001068dc7bc -[RCTKeyWindowValuesProxy init] + 196
5   React                               0x00000001068dc6d8 __41+[RCTKeyWindowValuesProxy sharedInstance]_block_invoke + 36
6   libdispatch.dylib                   0x0000000107bd65d0 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x0000000107bd8088 _dispatch_once_callout + 84
8   React                               0x00000001068dc68c +[RCTKeyWindowValuesProxy sharedInstance] + 88
9   CoreModules                         0x0000000105369ce8 -[RCTDeviceInfo init] + 124
10  React                               0x00000001068ef440 __115-[RCTModuleData initWithModuleClass:bridge:moduleRegistry:viewRegistry_DEPRECATED:bundleManager:callableJSModules:]_block_invoke + 36
11  React                               0x00000001068efca4 -[RCTModuleData setUpInstanceAndBridge:] + 1440
12  React                               0x00000001068f1e40 -[RCTModuleData instance] + 1168
13  React                               0x00000001068f2300 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 432
14  React                               0x00000001068f26c4 -[RCTModuleData exportedConstants] + 40
15  React                               0x00000001068fd6e8 _ZN8facebook5react15RCTNativeModule12getConstantsEv + 200
16  cxxreact                            0x00000001090e55d0 _ZN8facebook5react14ModuleRegistry9getConfigERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 1280
17  jsireact                            0x0000000108fb742c _ZN8facebook5react16JSINativeModules12createModuleERNS_3jsi7RuntimeERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 188
18  jsireact                            0x0000000108fb7120 _ZN8facebook5react16JSINativeModules9getModuleERNS_3jsi7RuntimeERKNS2_10PropNameIDE + 332
19  jsireact                            0x0000000108f9ff88 _ZN8facebook5react11JSIExecutor17NativeModuleProxy3getERNS_3jsi7RuntimeERKNS3_10PropNameIDE + 292
20  reacthermes                         0x0000000109478644 _ZN8facebook3jsi19DecoratedHostObject3getERNS0_7RuntimeERKNS0_10PropNameIDE + 92
21  hermes                              0x0000000109edb344 _ZN8facebook6hermes17HermesRuntimeImpl8JsiProxy3getEN6hermes2vm8SymbolIDE + 88
22  hermes                              0x0000000109fc5590 _ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_ + 712
23  hermes                              0x0000000109fb0e90 _ZN6hermes2vm11Interpreter17interpretFunctionILb0ELb0EEENS0_10CallResultINS0_11HermesValueELNS0_6detail20CallResultSpecializeE2EEERNS0_7RuntimeERNS0_16InterpreterStateE + 10024
24  hermes                              0x0000000109fae734 _ZN6hermes2vm7Runtime21interpretFunctionImplEPNS0_9CodeBlockE + 132
25  hermes                              0x0000000109fe92d8 _ZN6hermes2vm7Runtime11runBytecodeEONSt3__110shared_ptrINS_3hbc14BCProviderBaseEEENS0_18RuntimeModuleFlagsEN4llvh9StringRefENS0_6HandleINS0_11EnvironmentEEENSB_INS0_11HermesValueEEE + 1420
26  hermes                              0x0000000109ecde7c _ZN8facebook6hermes17HermesRuntimeImpl26evaluatePreparedJavaScriptERKNSt3__110shared_ptrIKNS_3jsi18PreparedJavaScriptEEE + 220
27  hermes                              0x0000000109ecdd04 _ZN8facebook6hermes17HermesRuntimeImpl31evaluateJavaScriptWithSourceMapERKNSt3__110shared_ptrIKNS_3jsi6BufferEEES9_RKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 116
28  hermes                              0x0000000109ecec9c _ZN8facebook6hermes17HermesRuntimeImpl18evaluateJavaScriptERKNSt3__110shared_ptrIKNS_3jsi6BufferEEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 32
29  reacthermes                         0x0000000109476514
```

## Changelog:

[IOS] [FIXED] - Call RCTInitializeUIKitProxies before bridge create

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

Test Plan:
Run RNTester in bridge mode. no UI main thread checker issue.

1. Test Headset pairing through Twilight app.
2. Test going to Horizon Worlds

|pictures of successful pairing| going into Horizon world|
|{F1975774792}{F1975774799}|{F1975774801}

Reviewed By: cipolleschi

Differential Revision: D70557608

Pulled By: sammy-SC

fbshipit-source-id: 2cbc09e126dc6f942a63b966ff32ff5801a24ec3
2025-03-11 12:04:51 +00:00
Riccardo CipolleschiandReact Native Bot 9548609c15 Fix verifyReleaseOnNPM by dropping the v in the version (#49944)
Summary:
GHA passes the version to the script with a `v` prefix. However, when we receive the version from NPM, the `v` prefix is not here.
We can fix the script by dropping the `v` when it is passed to the function.

bypass-github-export-checks

## Changelog:
[Internal] - Fix verifyPackageOnNPM

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

Test Plan: GHA

Reviewed By: cortinico, fabriziocucci

Differential Revision: D70960414

Pulled By: cipolleschi

fbshipit-source-id: 4234103ebe49cf715aea4a1473a8a60978f07a9f
2025-03-11 11:36:43 +00:00
Nicola Corti 29caa0725d Update Podfile.lock
Changelog: [Internal]
2025-03-11 11:33:30 +00:00
React Native Bot d74bb8e748 Release 0.79.0-rc.1
#publish-packages-to-npm&next
2025-03-11 08:43:20 +00:00
Riccardo CipolleschiandGitHub 7739615e0d [LOCAL][RN][iOS][OldArch] Add missing loadFromSource method in the DefaultRNFactoryDelegate (#49930) 2025-03-10 16:41:44 +00:00
Bruno AybarandReact Native Bot bcc8b27d87 Fix issue with extraModulesForBridge callback (#49849)
Summary:
Fixes https://github.com/facebook/react-native/issues/49819 . Details about how the issue was introduced in the issue description.
bypass-github-export-checks
## Changelog:

[IOS] [FIXED] - Fixed: extraModulesForBridge callback not called when New Architecture enabled

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

Test Plan:
Without the change:
1. Open `packages/rn-tester` project
2. In `AppDelegate.mm`, implement `extraModulesForBridge` and add a breakpoint / output something
3. Run the app in iOS <-- Verify that the method is not executed

With the change:

1-3. Same as above <-- verify that the method is called correctly

> [!NOTE]
> As far as I could tell, there is no test suite for this specific codepath, so I didn't write a test for this change. Happy to write one if someone can guide me a little bit.

Reviewed By: rshest

Differential Revision: D70724196

Pulled By: cipolleschi

fbshipit-source-id: cc08798d08cdbd6883347810c7d2697c358770fb
2025-03-10 14:40:47 +00:00
Riccardo CipolleschiandReact Native Bot 2f4dbc64b7 Fix bug that prevents the Old Arch from being enabled (#49896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49896

This change makes possible to opt-out from the New Architecture.

Env variables are always `string`s in ruby and the check was always failing because it was comparing it with a number (always false)

## Changelog:
[iOS][Fixed] - enable back the opt-out from the New Architecture

Reviewed By: cortinico

Differential Revision: D70789827

fbshipit-source-id: 7d3f96c3db22f2715dec2b649534b20e3273ea3e
2025-03-10 10:59:58 +00:00
Rob HoganandGitHub 8421b8a872 [0.79] Update Metro to ^0.82.0 (#49892) 2025-03-08 13:05:45 +00:00
Riccardo CipolleschiandReact Native Bot 2b0e406fef Fix TMManager moduleProviderForName (#49835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49835

The implementation of moduleProviderForName is slightly off.

This method was supposed to replace the previous ternary expression and to enhance with the module provider call.

The ternary expression used to be
```
!RCTTurboModuleInteropEnabled() || [self _isTurboModule:moduleName] ? [self _provideObjCModule:moduleName] : nil
```

However, as you can see from the current implementation, instead of calling `RCTTurboModuleInteropEnabled()` we are calling `RCTTurboModuleEnabled()` which is clearly a mistake.

On top of that, I'm also updating the guard around the `getModuleProvider` selector as it was bypassing the other checks, and that's wrong.

## Changelog:
[Internal] - Fix moduleProviderForName method

Reviewed By: RSNara

Differential Revision: D70569552

fbshipit-source-id: ed4055da9ea385ed10323ed8d7a8772010b3a105
2025-03-05 15:20:22 +00:00
Fabrizio CucciandReact Native Bot eb02343f95 Fix destructuring error in Verify Release is on NPM step
Summary:
Found this issue while releasing 0.79.0-rc.0 (see [job](https://github.com/facebook/react-native/actions/runs/13649159968/job/38156418752)).

bypass-github-export-checks

```
SyntaxError: Invalid destructuring assignment target
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/__w/_actions/actions/github-script/v6/dist/index.js:15143:16)
    at main (/__w/_actions/actions/github-script/v6/dist/index.js:15236:26)
    at /__w/_actions/actions/github-script/v6/dist/index.js:15217:1
    at /__w/_actions/actions/github-script/v6/dist/index.js:15268:3
    at Object.<anonymous> (/__w/_actions/actions/github-script/v6/dist/index.js:15271:12)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
```

## Changelog:
[Internal] -

Reviewed By: cipolleschi

Differential Revision: D70552301

fbshipit-source-id: b50e3d76c7497cc218e379400d5870531669abe1
2025-03-04 13:08:18 +00:00
Fabrizio Cucci f238aecca1 Update Podfile.lock
Changelog: [Internal]
2025-03-04 12:55:51 +00:00
React Native Bot e6a3390fb5 Release 0.79.0-rc.0
#publish-packages-to-npm&next
2025-03-04 08:15:32 +00:00
Riccardo CipolleschiandFabrizio Cucci 1961e58b13 Fix release scripts to check npm packages (#49788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49788

Release of 0.78 was successful but it failed to verify the package of NPM because of some error in the JS files.

Preparing for 0.79, I discovered some other issues in the NPM checking scripts.

This change should fix them.

## Changelog:
[Internal] - Fix publishing scripts

Reviewed By: fabriziocucci

Differential Revision: D70489717

fbshipit-source-id: 02a37d9a86fe108c7f7d2d634b8c0727dabb153d
2025-03-03 15:20:56 +00:00
Fabrizio Cucci c593bf833b Bump hermes 2025-03-03 14:55:16 +00:00
Ruslan LesiutinandFacebook GitHub Bot 81e490164f Update debugger-frontend from 3adf51a...97e9912 (#49784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49784

Changelog: [Internal] - Update `react-native/debugger-frontend` from 3adf51a...97e9912

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/3adf51aa915c2deb26f5d373751a15b4d0c8f259...97e9912605ce73b06f67fc607c1a5c434a67d6de).

Reviewed By: huntie

Differential Revision: D70487787

fbshipit-source-id: 6f3b47a254f45b770798ff3af8ade1c9a6d7fc64
2025-03-03 06:08:30 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 515ff1e626 fix: return nullptr when USE_THIRD_PARTY_JSC is set to true (#49781)
Summary:
When setting `USE_THIRD_PARTY_JSC=1`, we don't return anything from createJSRuntimeFactory function:

![CleanShot 2025-03-03 at 13 05 24@2x](https://github.com/user-attachments/assets/090ca47a-77f8-4a1b-9171-79b5e4ce91fb)

It's meant to be overwritten, but we must satisfy the compiler.

## Changelog:

[IOS] [FIXED] - return nullptr when USE_THIRD_PARTY_JSC is set to true

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D70486837

Pulled By: cipolleschi

fbshipit-source-id: c09622f75608dc203d41167fc375a000a2f12e37
2025-03-03 06:01:23 -08:00
Saad NajmiandFacebook GitHub Bot 6bc5ddea3e fix: avoid race condition crash in [RCTDataRequestHandler invalidate] (#49705)
Summary:
Upstreaming a fix by ntre that fixes a crash we saw internally related to `[_queue cancelAllOperations]`.

>Calling [_queue cancelAllOperations] will release all references to any active operations.
>If the blocks of those operations have a reference to itself, it will result in dangling pointers, which could conceptually trigger a later crash if there's a race between the operation completing and it being pulled out of the queue.
>
>Add explicit strong reference while block is running.
>For good measure, fix same pattern also in RCTFileRequestHandler.
>
>Note: separately, that this code is passing the op itself as a requestToken to [delegate URLRequest:] methods is suspect. That delegate can retain said token.

## Changelog:

[IOS] [FIXED] - avoid race condition crash in [RCTDataRequestHandler invalidate]

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

Test Plan: Tested internally, we no longer saw the crash after this fix.

Reviewed By: javache

Differential Revision: D70314889

Pulled By: cipolleschi

fbshipit-source-id: ebcecb4675bd1dda3d9ee60d69967feb4e05e11b
2025-03-03 05:58:07 -08:00
Jakub PiaseckiandFacebook GitHub Bot 13ac1a9a88 Align FlatList types with OSS (#49713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49713

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70317013

fbshipit-source-id: f131cb204135a2a41aa7d3bafe13fc7b44446036
2025-03-03 04:06:39 -08:00
Dawid MałeckiandFacebook GitHub Bot 569c01e141 Add Text to buildTypes and align Flow with TS (#49774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49774

Changelog:
[Internal] - Added Text to buildTypes and aligned Flow with TS

Reviewed By: huntie

Differential Revision: D70324061

fbshipit-source-id: 2a032317acdc0a119f5d33da86a40461f8c60ab1
2025-03-03 04:02:18 -08:00
Alex HuntandFacebook GitHub Bot 2acb407562 Update references to relocated react-native-devtools-frontend repo (#49777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49777

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D70485084

fbshipit-source-id: d6243b3bc607af39c67c3f1cebdf0b53a3502538
2025-03-03 03:49:04 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot ae7bbe06c9 fix: make React Native work without AppDelegate window property (#49748)
Summary:
This PR makes React Native not relying on the `window` property in AppDelegate. When running in SwiftUI lifecycle mode / SceneDelegate mode there is window property on AppDelegate. This PR fixes crashes that happen because RN asserts window property is there.

## Changelog:

[IOS] [FIXED] - make React Native work without AppDelegate window property

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

Test Plan: CI Green

Reviewed By: javache

Differential Revision: D70389691

Pulled By: cipolleschi

fbshipit-source-id: fe39f123b47014ba91a080239ccd298192c92a6a
2025-03-03 03:47:46 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 7ccb1e1fb0 Avoid the creation of separate folders for separate artifacts (#49760)
Summary:
When downloading artifacts using a pattern, GHA, by default, creates a folder for each artifacts and copies the artifacts in that folder.
This breaks the maven publishing which expects the artifacts in the `artifact` folder and not i a subfolder.

The `merge-multiple` option allow for the artifacts to be downloaded in the specified folder, without the extra folder in the path

## Changelog:
[Internal] - Avoid the creation of intermediate folder when downloading the artifacts

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

Test Plan:
GHA

<img width="791" alt="Screenshot 2025-03-02 at 11 08 33" src="https://github.com/user-attachments/assets/cfc85b27-117f-4d21-97ef-67493615a5a1" />

Reviewed By: fabriziocucci

Differential Revision: D70462254

Pulled By: cipolleschi

fbshipit-source-id: ed310a90bcdea55e466d4d71942a25abc6e6986a
2025-03-03 02:10:15 -08:00
Vitali ZaidmanandFacebook GitHub Bot 21c85ef52d batch debug logging for cdp messages (#49726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49726

The `InspectorProxy` debug logging became incredibly spammy making it almost unuseful unless the output is manipulated so this commit batches all these cdp messages and only desplays how many were received in the span of 5s. If no messages are received, the throttle is not triggered.

To get the actual CDP messages logged, we still log these to `Metro:InspectorProxyCDPMessages`.

Changelog:
[General][Internal] batch debug logging for cdp messages

Reviewed By: robhogan

Differential Revision: D70324724

fbshipit-source-id: a269302f52e18af6c4be651758c042596abdbad8
2025-03-03 01:49:39 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 42a7c62a6a Ensure that the artifacts have the right extension (#49755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49755

The artifacts are uploaded without the .tar.gz extension and the gradle script fails to upload them to sonatype.

This change adds the extensions.

## Changelog:
[Internal] -

Reviewed By: sammy-SC

Differential Revision: D70443149

fbshipit-source-id: c16d1842688b82ac216ffb90ecf2b75f562cca64
2025-03-01 13:05:59 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0bb6243550 Compress xcframework to let sonatype sign it (#49753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49753

Sonatype cannot sign folders. It needs a file to be signed.
To make it happen, we are compressing the xcframeworks and the dSYM with tar, and we are uploading those files instead of the folders

I also observed that the cache keys were not computed correctly, so I'm fixing them.

## Changelog:
[Internal] - use tar.gz instad of folders for dSYM and xcframeworks

Reviewed By: bvanderhoof, mofeiZ

Differential Revision: D70409314

fbshipit-source-id: 20a5ee4f24b644f4f087974ad6b0831d5769b1d9
2025-02-28 14:00:43 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 33c0112b63 Configure gradle to publish RNDependencies to Maven (#49749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49749

This change configures gradle and CI to properly publish the RNDependencies artifacts to Maven Central

## Changelog
[Internal] - Configure gradle to publish on Maven Central

Reviewed By: cortinico

Differential Revision: D70390191

fbshipit-source-id: fc1e1070325240584cb07fb17e58118c4c583fa9
2025-02-28 09:05:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot c99b2a4854 Connect the prebuild-ios workflow with other workflows (#49731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49731

This change runs the prebuilds in all the workflows we need:
- test-all
- nightlies
- create-release

## Changelog:
[Internal] - connect the rebuild-ios workflow with the other workflows

Reviewed By: cortinico

Differential Revision: D70331579

fbshipit-source-id: 6505a32672d43d06e29e68d37bd0ceff21bd7386
2025-02-28 09:05:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 2ff0220c8e Add job to build the XCFramework for ios prebuilds (#49563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49563

This change introduces a job to prebuild iOS XCFrameworks.

## Changelog:
[Internal] - Create prepare artifacts workflows

Reviewed By: cortinico

Differential Revision: D69924325

fbshipit-source-id: f2241b1db715ae7c42ce32eda55a54efa6985a9d
2025-02-28 09:05:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot da88bf0030 Add job to build the slices for ios prebuilds (#49528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49528

This change introduces a job to prebuild iOS slices.

## Changelog:
[Internal] - Create prepare artifacts workflows

Reviewed By: cortinico

Differential Revision: D69855542

fbshipit-source-id: 54d5b24b55f9e7bebdbb201073524dc4f3748e07
2025-02-28 09:05:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3c03e2b9f5 Add prepare prebuild reusable workflow (#49530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49530

This change introduces the workflow to prebuild iOS artifacts.

This will be a reusable workflow, so we can then call it as it is from test-all, nightlies and publish-release

## Changelog:
[Internal] - Create prepare artifacts workflows

Reviewed By: cortinico

Differential Revision: D69854568

fbshipit-source-id: 5dc532fa564fe7e0987ba5d133da42e04237c3cc
2025-02-28 09:05:37 -08:00
Jakub PiaseckiandFacebook GitHub Bot 167a1a30da Improve text measurement for multiline TextInput on iOS (#49711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49711

Changelog: [IOS][CHANGED] - Moved workaround for multiline text measurement with `maximumNumberOfLines` earlier in the pipeline

Reviewed By: huntie

Differential Revision: D70314397

fbshipit-source-id: ef7dbf0c4bb3d5053328d81b7d5b8208e92ee7f5
2025-02-28 07:52:03 -08:00
Samuel SuslaandFacebook GitHub Bot 2b93377a9c add e2e test for AppState module (#49680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49680

changelog: [internal]

add an end to end test for AppState module.

Reviewed By: rshest

Differential Revision: D70184850

fbshipit-source-id: ead1388ceb1018e7615e50f846f3c95224be97d0
2025-02-28 07:41:47 -08:00
Iwo PlazaandFacebook GitHub Bot 5fc2484440 Align useAnimatedValue with OSS types (#49643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49643

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Aligns `useAnimatedValue.js` with its manual .d.ts types.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70096210

fbshipit-source-id: c3cd517eccf1cb68400772ddde6e5891861c927d
2025-02-28 06:33:21 -08:00
Vitali ZaidmanandFacebook GitHub Bot 0289e4061e fix race condition in getPages test for device disconnection (#49741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49741

While the test delay `PAGES_POLLING_DELAY` is usually enough to be equal to `PAGES_POLLING_INTERVAL`, in some cases we need extra time to sync that with the polling in `Devices.js`.

Changelog:
[General][Internal] - fix test

Reviewed By: huntie

Differential Revision: D70384823

fbshipit-source-id: ccb18884d32dc27636dbbb3a9786412056f90830
2025-02-28 06:24:03 -08:00
Rubén NorteandFacebook GitHub Bot 84a1211773 Strip all "bom" types that are actually not defined in RN (#49730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49730

Changelog: [internal]

This removes all the types from "bom" that are actually not implemented in RN. For now, we're just stripping whole interfaces and not looking into specific methods/properties in interfaces that we do implement but not 100%.

`Performance`, `PerformanceObserver`, `MutationObserver` and `IntersectionObserver` are implemented but not stable yet, so they aren't exposed as globals in the types.

Reviewed By: huntie

Differential Revision: D70329185

fbshipit-source-id: 63bac619e100ca66b41df071df80dfa73d0f9651
2025-02-28 05:58:45 -08:00
Rubén NorteandFacebook GitHub Bot 52713eeff3 Refactor IntersectionObserver, MutationObserver and PerformanceObserver options as interfaces (#49737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49737

Changelog: [internal]

Just a minor change to align with similar other option bags and TypeScript definitions.

Reviewed By: huntie

Differential Revision: D70355669

fbshipit-source-id: 37c44338c7b358eb2d25e8a14c75a78545b34bf1
2025-02-28 05:58:45 -08:00
Rubén NorteandFacebook GitHub Bot eb877cba39 Remove references to service workers in RN globals (#49727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49727

Changelog: [internal]

React Native doesn't define or use Service Workers, so this entire section for types is unnecessary.

Reviewed By: cortinico

Differential Revision: D70327703

fbshipit-source-id: b998eade21d19ed124824cb255a37cb9e805d151
2025-02-28 05:58:45 -08:00
Rubén NorteandFacebook GitHub Bot e808011b26 Move environment types (globals) from flow-typed/environment to src/types (#49724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49724

Changelog: [internal]

This moves the type definitions for the globals defined by React Native from the repository root to the `react-native` package, in the same directory as the existing TypeScript definitions. This will make it easier for end users to configure the globals from RN using the right source of truth.

Reviewed By: huntie

Differential Revision: D70322032

fbshipit-source-id: 932df75ded0c254f2acb32e865cbbb9474c94159
2025-02-28 05:58:45 -08:00
Jakub PiaseckiandFacebook GitHub Bot be59427448 Align ProgressBarAndroid types with OSS (#49663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49663

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70176068

fbshipit-source-id: 0a1febb390affc2a3123e49e88b039b390a34387
2025-02-28 05:46:48 -08:00
Iwo PlazaandFacebook GitHub Bot 42cea2dc9c (reattempt) Use implicit namespace to better align Animated module with OSS types (#49685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49685

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70237239

fbshipit-source-id: f552490cb6bb721c6163272689ec9b6c68386574
2025-02-28 05:03:55 -08:00
Nicola CortiandFacebook GitHub Bot c4e952ea84 Temporarily disable Configuration Caching on CI (#49742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49742

Seems like publishing jobs are not happy with Gradle Config Caching.
I'm disabling it for now till we find out what's the root cause.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D70385662

fbshipit-source-id: 532c46ea1e578bab5f3e5d6814a7f7193e67a7ad
2025-02-28 04:25:58 -08:00
Dawid MałeckiandFacebook GitHub Bot 8919fc3243 Set optional ref on View and split View Props (#49725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49725

Changelog:
[Internal] - Set optional ref on View and split View Props

Reviewed By: huntie

Differential Revision: D70327820

fbshipit-source-id: 2021125b0aff1497df50c2be73c2ecfc7e8f1157
2025-02-28 01:15:07 -08:00
Shawn DempseyandFacebook GitHub Bot d0a101fbea Add guard for custom module provider lookup in TMManager (#49738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49738

**Context**

- D70012142 added TM module provider support
- This was causing RN MacOS to silently fail to load any platform modules since it didn't implement the delegate method

Changelog:
[iOS][Fixed] - Add guard for custom module provider lookup in TMManager

Reviewed By: sbuggay

Differential Revision: D70357542

fbshipit-source-id: 5b338616655ecb84cdb3c60e243fdb99444af657
2025-02-27 18:41:41 -08:00
generatedunixname89002005232357andFacebook GitHub Bot 587d849c23 Revert D70200854
Summary:
This diff reverts D70200854
To revert for S494669

#bypass-github-export-checks
bypass-github-export-checks

Reviewed By: NickGerleman

Differential Revision: D70347605

fbshipit-source-id: 454cb0a8f5a7562cd6602c32f4978b129821730c
2025-02-27 15:42:38 -08:00
Joe VilchesandFacebook GitHub Bot 144f44f653 Reorder the contents in ReactAccessibilityDelegate.java to be more logical (#49735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49735

I always get confused when I open this file. One of the main reasons is the order of contents is quite random, so I decided to reorder things. I tried to find a style guide on this but the [google ones](https://google.github.io/styleguide/javaguide.html#s3.4.2-ordering-class-contents) really just say do something that is logical so...

In general what I did was

* All instance variables, class variables, class constants, etc. are at the top of the class
* The constructor, `setDelegate`, `resetDelegate` methods are at the top of the class since these all deal with creating or destroying instances of this class
* Nested enums towards the bottom of the class so they are not in the way of people trying to reason about the methods and other contents (they are quite long)
* Delete random extra spaces / unneeded comments
* Move some private methods to be closer to the public methods that call them

Changelog: [Internal]

Reviewed By: mlord93

Differential Revision: D70345882

fbshipit-source-id: a8425c7b90c5d4fbea5ee5daa3c4ff9f7f189ce5
2025-02-27 15:38:15 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 19c18eb995 Add prerelease staging API for Android (#49649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49649

- Added a new template to React Native's Feature Flag's script for Canary and Experimental prerelease stages
- Added a parameter to `DefaultNewArchitectureEntryPoint.kt` to select prerelease stage

Changelog: [Android] [Added] - On `DefaultNewArchitectureEntryPoint` class add property to specify the desired release level for an application

Reviewed By: rubennorte, mdvacca

Differential Revision: D69412971

fbshipit-source-id: 1a76ac723e1e06b40aad5910604e0384b208d3a5
2025-02-27 12:38:03 -08:00
David VaccaandFacebook GitHub Bot ee7514cf49 Ensure Synchronous events are always dispatched from the UIThread (#49732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49732

Ensure Synchronous events are always dispatched from the UIThread

changelog: [internal] internal

Reviewed By: lunaleaps, NickGerleman

Differential Revision: D70203460

fbshipit-source-id: 04fa02ae731bce579a231052e5ed7953852f61bc
2025-02-27 11:08:01 -08:00
Ruslan LesiutinandFacebook GitHub Bot 8698ecad18 Emit synthetic Trace Events for non-bridgeless to fix trace representation (#49729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49729

# Changelog: [Internal]

The only data source for non-bridgeless setup is JavaScript samples.

Chrome DevTools frontend is built around an assumption that thread should have at least single timeline or user timing event to be represented on a timeline view. They do it for filtering out unnecessary workers threads and other.

We will emit 2 synthetic Trace Events that should cover these requirements and recorded traces that contain only JavaScript samples should now be displayed correctly.

This is where trace bounds are calculated - https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/3adf51aa915c2deb26f5d373751a15b4d0c8f259/front_end/models/trace/handlers/MetaHandler.ts#L169-L173

Reviewed By: huntie

Differential Revision: D70328681

fbshipit-source-id: 8eca0017d85de9ecbfb49074b439d5c4fee4aa56
2025-02-27 10:38:38 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 13177b3025 feat: warn about jsc moving to a separate repo (#49692)
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore

This PR warns about JavaScriptCore being moved in the postinstall phase:

![CleanShot 2025-02-26 at 13 35 54@2x](https://github.com/user-attachments/assets/f392f7a3-fb8b-4089-9375-2d88ba4cb60b)

as well as in the build logs:

![CleanShot 2025-02-26 at 13 35 45@2x](https://github.com/user-attachments/assets/481e44f2-c30e-43f2-8cbc-5006959a42fc)

## Changelog:

[IOS] [ADDED] - Inform users about JSC being moved to a different repo

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

Test Plan: CI Grene

Reviewed By: huntie

Differential Revision: D70321201

Pulled By: cipolleschi

fbshipit-source-id: 1a97f3bceb57079f0e63848745c1a973b6dd614d
2025-02-27 10:32:25 -08:00
Nick LefeverandFacebook GitHub Bot ed106640c3 Rename fantom_internal_flags pragma to fantom_react_fb_flags (#49728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49728

See title.

Resolving https://www.internalfb.com/diff/D70242739?dst_version_fbid=1295747645054627&transaction_fbid=1285615715828636

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D70328653

fbshipit-source-id: c3e7377760f53bc37d1a6f3e25a0053e12d4f66e
2025-02-27 09:50:45 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6312360268 Improve Codegen to support automatic registration of Cxx TM (#49624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49624

This change improves the iOS infra so that there is no need to modify the Swift AppDelegate or to create a Bridging Header.

## Problem
As of today, it is not possible to create a pure C++ TM and to register it through a Swift AppDelegate

## Solution
We can create a pod that can be imported in a Swift AppDelegate and that offer some pure Objective-C classes.

These classes contains a provider that can be instantiated in Swift.

The TurboModule manager delegate will ask the AppDelegate about the presence of some provider that can instantiate a pure C++ turbomodule with a given name.

The provider has an empty interface, but the implementation contains a function that can actually instantiate the TM. The function is implemented in an Objective-C++ class that imports the pure C++ turbomodule and creates it.

The TMManager extends the provider through a category to attaach the signature of the function that is implemented by the provider.

The last diff in this stack contains an exaple on how to implement this.

## Changelog:
[iOS][Added] - Wire codegen to the new TM provider to automatically register CXX modules.

Reviewed By: javache

Differential Revision: D70082999

fbshipit-source-id: 11d829450e1d17984d6f22ee5b8907073c59d008
2025-02-27 09:12:36 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5d5d3708df Connect the classes for C++ Module registration to TMManagerDelegate (#49611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49611

This Change connects the pod created previously to the `RCTTuboModuleManager` so that it can ask the delegate about the CxxTurboModuleProviders.

We had to introduce a `RCTFullTurboModuleManagerDelegate` that implements both the old `TurboModuleManagerDelegate` and the new Swift compatible one.

## Problem
As of today, it is not possible to create a pure C++ TM and to register it through a Swift AppDelegate

## Solution
We can create a pod that can be imported in a Swift AppDelegate and that offer some pure Objective-C classes.

These classes contains a provider that can be instantiated in Swift.

The TurboModule manager delegate will ask the AppDelegate about the presence of some provider that can instantiate a pure C++ turbomodule with a given name.

The provider has an empty interface, but the implementation contains a function that can actually instantiate the TM. The function is implemented in an Objective-C++ class that imports the pure C++ turbomodule and creates it.

The TMManager extends the provider through a category to attaach the signature of the function that is implemented by the provider.

The last diff in this stack contains an exaple on how to implement this.

## Changelog:
[iOS][Added] - Added the React-SwiftCompatibleNativeModules pod

Reviewed By: javache

Differential Revision: D70012142

fbshipit-source-id: db96c4cd3cdd1062b12f11131b7c6c51ecd74bc7
2025-02-27 09:12:36 -08:00
Nicola CortiandFacebook GitHub Bot 2062defb2d Bump AGP to 8.8.2 (#49712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49712

Just keeping AGP up to date to the latest patch version

Changelog:
[Android] [Changed] - Bump AGP to 8.8.2

Reviewed By: cipolleschi

Differential Revision: D70316244

fbshipit-source-id: 6e447bd04841d09717a1c6153b7e5c977a10787c
2025-02-27 09:05:55 -08:00
Alex Taylor (alta)andFacebook GitHub Bot daed8e2f8c Deploy 0.262.0 to xplat (#49708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49708

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D70277654

fbshipit-source-id: e215e392aa6e06181f2df03ce8b9b873807f3b86
2025-02-27 08:55:49 -08:00
Kudo ChienandFacebook GitHub Bot 90e27c2b4f show JSC removal message on Android (#49709)
Summary:
show build time jsc removal warning. https://github.com/facebook/react-native/issues/49692 but for android

![Screenshot 2025-02-27 at 3 41 43 PM](https://github.com/user-attachments/assets/a4fe6d52-5e05-45b0-a403-c71372dfba06)

## Changelog:

[ANDROID] [CHANGED] - Add a build time JSC lean core warning

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

Test Plan: - test on rn-tester. rn-tester has a jsc build variant. it shows the warning anyway. commenting out `enableHermesOnlyInVariants` will suppress the warning.

Reviewed By: rshest

Differential Revision: D70323283

Pulled By: cortinico

fbshipit-source-id: 632a8b9086c5d90d7f14ea705464356a1292bcad
2025-02-27 08:38:35 -08:00
Ruslan LesiutinandFacebook GitHub Bot 13a0b4691a Use sampling profile serializer and emit profiles in traces (#48315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48315

# Changelog: [Internal]

> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.

Use newly added serializer and record Trace Events for profiles.

Reviewed By: huntie

Differential Revision: D67353586

fbshipit-source-id: f3738418ec1d47ef4435f00120823845ea5e2fe5
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 87d4300f14 Implement sampling profile serializer (#49191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49191

# Changelog: [Internal]

In this diff we are adding another serializer, that will receive local sampling profile (in tracing domain), and will record corresponding Trace Events with `PerformanceTracer`.

It encapsulates the logic of transforming list of samples to `"Profile"` and `"ProfileChunk"` trace events, which will be parsed by Chrome DevTools later.

Reviewed By: huntie

Differential Revision: D68439735

fbshipit-source-id: 0b3f2b3aff5b79a921e0350759e93f5b05e34d8e
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 290f237cfa Expose API for registering profiles and profile chunks (#49084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49084

# Changelog: [Internal]

> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.

Added public methods to `PerformanceTracer` instance for registering `Profile` and `ProfileChunk` Trace Events.

Also created data structs in `TraceEvent.h` to simplify serialization process for objects like call frames / samples / etc.

Reviewed By: huntie

Differential Revision: D68558805

fbshipit-source-id: f5eca0435c56828909f99ec0b47841d24ee907b6
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 1aced32a1c Serialize Hermes Profile to Tracing Profile (#49082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49082

# Changelog: [Internal]

> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.

In this diff we will:
- Call newly added API in Hermes from `HermesRuntimeTargetDelegate.cpp`
- Define format for local Sampling Profile that will be used in Tracing domain
- Implement formatter for Hermes Profile -> Tracign Profile

Reviewed By: bgirard

Differential Revision: D68414421

fbshipit-source-id: 05d76e9bcff46f88a2338490a9d858cb121f72cc
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 067c5f9954 Record Event Loop tasks (#49436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49436

# Changelog: [Internal]

We will record event loop ticks and register corresponding `"RunTask"` Trace Event with our Trace Event engine.

Since this is hot path, I've added some gating under macros that are being used for Fusebox initialization.

There are also plans to add a public method to `PerformanceTracer` to get tracing status, so we could avoid cost of serialization / saving timestamps if trace is not being recorded. I believe rubennorte had plans on this, we will add it on top of that.

> Q: Why not add this to TraceSection?

Long-term, we will have a solution that will be one layer above TraceSection and this `EventLoopTaskReporterRAII`, it is risky now to modify existing `TraceSection` and rely on event names and attempt to map them to Trace Events.

Reviewed By: rubennorte

Differential Revision: D69399955

fbshipit-source-id: b26ac0c376e7dcb5755f36a27bf00dcca6cbff60
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot bf6852db2e Report JavaScript thread (#49395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49395

# Changelog: [Internal]

Adding a new method to `RuntimeTarget` that will register it for Tracing.

In our case, it will schedule a callback on JS executor that will register JavaScript thread with `PerformanceTracer`.

Reviewed By: huntie

Differential Revision: D69530984

fbshipit-source-id: 58cffe9e9c4482b494cfcfd3405f7bffa40cdc56
2025-02-27 08:32:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 72e745fc15 Scaffold support for Tracing by jsinspector (#48836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48836

# Changelog: [Internal]

When `Tracing.start` CDP method is received, here is what happens next:
- `TracingAgent`, which intercepts the event will propagate this status to `Instance` by calling `startTracing()` on `InstanceAgent`.
- `InstanceAgent` will propagate it to `Runtime` entities. The only difference, there is no concept of tracing for Runtime, it will only have an API for starting sampling profiler.

When `Tracing.end` CDP method is received, it is propagated in the same order.

There is also `collect*()` methods for collecting profiles.

This has multiple benefits:
- We can control when `Runtime` or `Instance` are recreated and can ask them to start recording trace profiles right away. This may be required when we would add support for Reload and Profile from Performance panel.
- We might leverage this setup in the future, once we add instrumentation for Network panel. `InstanceAgent` will get notified when tracing started and will correspondingly notify other part of the infrastructure that will be responsible for recording network calls.
- We remain being fully agnostic to the actual `Runtime`, see corresponding `RuntimeTargetDelegate` for `V8`. We don't have the capacity for implementing and maintaining sampling profiler capabilities for it, but this approach unblocks it from technical perspective, if someone would want to invest into this.

`InstanceProfile` is a superset of `RuntimeSamplingProfile`. In the future, `InstanceProfile` may also include things like `NetworkProfile`, or similar stuff.

The definition for `RuntimeSamplingProfile` will be added in D68414421 and relies on the availability of new API for sampling profiler in Hermes.

Reviewed By: huntie

Differential Revision: D68327630

fbshipit-source-id: f8446057f88d87b4394fb692c28b89f1b8ce4eea
2025-02-27 08:32:12 -08:00
zhongwuzwandFacebook GitHub Bot fa6d5ca572 Fabric: Fixes TurboModule method parameter Int32 type not work (#49710)
Summary:
Fixes https://github.com/facebook/react-native/issues/49688 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes TurboModule method parameter Int32 type not work

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

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

Reviewed By: cortinico

Differential Revision: D70314804

Pulled By: cipolleschi

fbshipit-source-id: 4f305b14bb735bd343ef7477b969df237418615d
2025-02-27 07:23:10 -08:00
Mateo GuzmánandFacebook GitHub Bot 63dea206ff Migrate CxxModuleWrapper & DefaultJSExceptionHandler to Kotlin (#49706)
Summary:
Migrating two more classes from com.facebook.react.bridge to Kotlin, `CxxModuleWrapper` & `DefaultJSExceptionHandler`.

## Changelog:

[INTERNAL] - Migrate CxxModuleWrapper & DefaultJSExceptionHandler to Kotlin

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

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D70317975

Pulled By: javache

fbshipit-source-id: 642d96faa131dd859f18cd811a5a223acba4c722
2025-02-27 05:23:56 -08:00
Rubén NorteandFacebook GitHub Bot 3226c328bf Remove unnecessary package data-uri-to-buffer (#49714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49714

Changelog: [internal]

This package was only needed for testing but it's actually not used.

Reviewed By: hoxyq

Differential Revision: D70318040

fbshipit-source-id: b57ec74932029368117520646972bfee83706017
2025-02-27 05:23:29 -08:00
Nick LefeverandFacebook GitHub Bot e2642d5567 Add support for setting internal feature flags (#49693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49693

Allow setting the ReactNativeInternalFeatureFlags from a Fantom test using the `fantom_internal_flags` pragma.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D70242739

fbshipit-source-id: 17a69edbd58b93f8b8060192b9881e62febf9635
2025-02-27 04:16:36 -08:00
Ruslan LesiutinandFacebook GitHub Bot d8bc7c68c0 fix[LayoutableShadowNode::findNodeAtPoint]: consider layoutMetrics.overflowInset (#49701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49701

# Changelog:
[General] [Fixed] - findNodeAtPoint now considers overflow area of the parent node

This may happen when the child overflows the parent without resizing it. For example, when child has `position: 'absolute'` and absolute coordinates.

See
- https://fb.workplace.com/groups/rn.debugger.feedback/posts/1075015864052657/
- https://fb.workplace.com/groups/rn.debugger.feedback/permalink/1180445730176336/
- https://fb.workplace.com/groups/ford.eng.discussions/permalink/1961390260971262/

for more context

Reviewed By: NickGerleman

Differential Revision: D63328182

fbshipit-source-id: 9d5ed3ec8d88d8d65455aa3664588dc7d7273888
2025-02-27 03:20:01 -08:00
Nicola CortiandFacebook GitHub Bot b95424d159 Gradle to 8.13 (#49689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49689

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

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

I'm bumping Gradle to the latest minor.
https://docs.gradle.org/8.13/release-notes.html

I'm also changing the distribution from `all` to `bin` as
this reduces the download time of the distribution.

Changelog:
[Android] [Changed] - Gradle to 8.13

Reviewed By: NickGerleman

Differential Revision: D70239710

fbshipit-source-id: 89808242a93344f540bfe82f4178cf6db72597d1
2025-02-27 03:13:26 -08:00
Rubén NorteandFacebook GitHub Bot a6dd18c2a6 Expose new DOM classes in the global scope (#49697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49697

Changelog: [internal]

These classes cannot be instantiated directly, but having access to them allows users to do `instanceof` checks, e.g.:

```
if (ref.current instanceof Element) {
  ref.current.getBoundingClientRect();
}
```

Reviewed By: yungsters

Differential Revision: D70244966

fbshipit-source-id: 3c1e3698b8851ef9ce3c2865e7435b000984c8f0
2025-02-27 03:07:54 -08:00
Rubén NorteandFacebook GitHub Bot 66495830c0 Type Node.textContent as non-nullable string (#49696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49696

Changelog: [internal]

This is just a change for convenience, as Flow is currently typing `textContent` in `Node` as `string` instead of as `string | null` as we were doing.

Our behavior was more correct, as `Document` extends `Node` and it returns `null` in that case, but to ensure a smooth migration we'll adopt the existing definition.

Reviewed By: huntie

Differential Revision: D70244963

fbshipit-source-id: ad8325d6e00c221e858e4e2d45085666ff0a0ce7
2025-02-27 03:07:54 -08:00
Dawid MałeckiandFacebook GitHub Bot 38e1444162 Add TouchableOpacity to buildTypes and align Flow with TS types (#49700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49700

Changelog:
[Internal] - Added TouchableOpacity to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69922731

fbshipit-source-id: 852b8afe99469512c0951d2fd3818fca744102fe
2025-02-27 03:02:16 -08:00
Jakub PiaseckiandFacebook GitHub Bot 2bb65717b7 Fix onContentSizeChange being dispatched too often on iOS (#49695)
Summary:
Solves the iOS part of https://github.com/facebook/react-native/issues/47186.

`onContentSizeChanged` event is sent inside the `updateLayoutMetrics` method every time it's invoked. A change in layout metrics doesn't mean that the content size also changes, like changing the position of the input.

This PR adds a condition that the content size must have changed before sending the event.

|Before this change|After this change|
|-|-|
|<video src="https://github.com/user-attachments/assets/743e1502-e13e-474e-b4a6-ef6873bf9619">|<video src="https://github.com/user-attachments/assets/fe3d3ef5-3951-4ba2-b9a1-c41439ab455c">|

In the reproducer from the issue, `SafeAreaView` is used, which at first renders its content without any insets until its state is updated with the correct insets. Both of these layouts change the layout metrics of the text input, resulting in two events before this change and a single one after.

## Changelog:

[IOS] [FIXED] - Fixed TextInput's `onContentSizeChange` event being dispatched multiple times with the same size

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

Test Plan: Tested on the reproducer from the issue

Reviewed By: NickGerleman

Differential Revision: D70247460

Pulled By: j-piasecki

fbshipit-source-id: 8a1e0d0f55b6b3f8a6d0bb176ed50e47e3b51035
2025-02-27 00:58:35 -08:00
Mateo GuzmánandFacebook GitHub Bot 8a4a6231b7 Internalize and migrate DimensionPropConverter to Kotlin (#49676)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.DimensionPropConverter).

In this PR I'm also converting this class to Kotlin as it's needed to make it internal as per https://github.com/facebook/react-native/pull/49676#issuecomment-2683579829.

## Changelog:

[INTERNAL] - Internalize and migrate com.facebook.react.bridge.DimensionPropConverter to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D70208912

Pulled By: arushikesarwani94

fbshipit-source-id: c74326ca1d82417457c2a438fa28e20f0a0eaa82
2025-02-26 17:48:07 -08:00
Rubén NorteandFacebook GitHub Bot 798f2e47aa Remove unnecessary extra prototype from ReactNativeElement (#49699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49699

Changelog: [internal]

Just a minor optimization in `ReactNativeElement`, to stop creating an unnecessary object in the prototype chain for the `super()` removal optimization.

Reviewed By: huntie

Differential Revision: D70250804

fbshipit-source-id: 1f8104f8e17f12264326cd715e07877a371f9dc5
2025-02-26 13:22:00 -08:00
Sam ZhouandFacebook GitHub Bot bf17ace09a Move react type definitions back into global libdefs
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D70261002

fbshipit-source-id: 83c0f5b2e2717e19a211553bd4b07e9481ec7c65
2025-02-26 12:20:39 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot a6607c07cd feat: js runtime switching C API for Swift (#49489)
Summary:
This PR implements a C API to switch JS Engines that can be used from Swift.

Here is an example:

```swift
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import UIKit
import RCTRuntime

class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
  override func sourceURL(for bridge: RCTBridge) -> URL? {
    self.bundleURL()
  }

  override func bundleURL() -> URL? {
    #if DEBUG
    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
    #else
    Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif
  }

  override func createJSRuntimeFactory() -> JSRuntimeFactory {
    jsrt_create_jsc_factory() // Easily switch engines here
  }
}
```

## Changelog:

[IOS] [ADDED] -  js runtime C API for Swift

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

Test Plan: CI Green

Reviewed By: huntie

Differential Revision: D69976988

Pulled By: cipolleschi

fbshipit-source-id: 9333ec62ca99a28c3121f558bbff1ce0457779e3
2025-02-26 10:56:31 -08:00
Sam ZhouandFacebook GitHub Bot 785249d05b Use builtin libdefs from flow-typed (#49702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49702

In the next version of Flow, we will stop bundling many of the builtin libdefs, and they have been moved to flow-typed. This diff checks in them to prepare for the deployment of the next version of Flow.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D70256694

fbshipit-source-id: 44e0772cc982add44723c252ea547a9cea0641e6
2025-02-26 10:55:54 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9e64099df6 Cleanup script and move the index to release (#49666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49666

This change moves the index.js file to the `releases` folder, giving it a meaningful name.

It also rename the prebuild folder to ios-prebuild to be more descriptive.

It finally removes the old scripts that this refactoring supersedes.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Move the infdex.js to the prepare-ios-prebuilds script.

Reviewed By: cortinico

Differential Revision: D70176043

fbshipit-source-id: e0c3f3bd53adf97fa388c37a746d274fd678f690
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 8b984ca2c4 Glue all the scripts together. (#49671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49671

This change refactors the script to prebuild ios dependencies by adding a script that glues all the steps together.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Add script to orchestrate all the steps

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175842

Pulled By: cipolleschi

fbshipit-source-id: e4bb4ad5d12e7ceaaca0eeee7ce6dc7269aa7bad
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 2fdb6c9832 Refactor compose-framework script (#49665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49665

This change refactors the script to prebuild ios dependencies by factoring out the code that creates the XCFrameworks

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out flow types, constants and gitignore

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175797

Pulled By: cipolleschi

fbshipit-source-id: 8eb07fd3ff9f309d5f6e4b55156c5d5cbbd41235
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 1cf751ed58 Refactor build script (#49669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49669

This change refactors the script to prebuild ios dependencies by factoring out the script that builds the frameworks

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out the script to build the frameworks.

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175778

Pulled By: cipolleschi

fbshipit-source-id: 987ea8922ab566c6601a77084226df2b6456243f
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot f7970cddf2 Add code to generate the Swift Package
Summary:
This change refactors the script to prebuild ios dependencies by:
- remove the manually maintained Package.swift
- add script to generate it starting from the configurations that we have
bypass-github-export-checks
## Changelog:

[INTERNAL] - Factor out script to generate  Package.swift file

Reviewed By: cortinico

Differential Revision: D70175760

Pulled By: cipolleschi

fbshipit-source-id: a1b0fc6dcdc1860b04ab260697f259c297338f41
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 7aa5df32a4 Refactor setupDependencies script (#49670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49670

This change refactors the script to prebuild ios dependencies by factoring out the code that setups native dependencies.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out code to setup native dependencies

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175729

Pulled By: cipolleschi

fbshipit-source-id: 4e1c19b5482b4335ab66c2b605abcb9db47091d3
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 339b0b5653 Add utils: CLI arg validation and folders utils (#49668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49668

This change refactors the script to prebuild ios dependencies by:
- factoring out CLI validation in a separate file
- factoring out the folder utilities in a separate file

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out CLI and folder utilities

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175663

Pulled By: cipolleschi

fbshipit-source-id: 5c6653aed7054658c5e265675766a28415da3918
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot 6eac2bd5b9 Configure all the third party dependencies we need (#49667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49667

This change refactors the script to prebuild ios dependencies by extracting all the dependencies' configurations in a separate file

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out all the dependencies configurations in a separate file

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175499

Pulled By: cipolleschi

fbshipit-source-id: c0eacb831e6551d39956c9835d15ab8d9e91d8f2
2025-02-26 08:19:39 -08:00
Christian FalchandFacebook GitHub Bot a860c55f38 Extract Flow types and constants (#49614)
Summary:
This change refactors the script to prebuild ios dependencies by:
- factoring out the constants
- factoring out the flow type definitions
- factoring out the .gitignore

bypass-github-export-check

## Changelog:

[INTERNAL] - Factor out flow types, constants and gitignore

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

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70172536

Pulled By: cipolleschi

fbshipit-source-id: 91589693fd24e2b0d6d67759fb9fbc86841f4d13
2025-02-26 08:19:39 -08:00
Ruslan LesiutinandFacebook GitHub Bot 5fcb69e8b7 cleanup usage of HERMES_ENABLE_DEBUGGER and define set of build-time flags for Fusebox (#49673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49673

## Changelog:
[General] [Breaking] - Deprecated usage of `HERMES_ENABLE_DEBUGGER` build-time flag for enabling React Native debugger in favour of `REACT_NATIVE_DEBUGGER_ENABLED` and `REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY`.

Reviewed By: huntie

Differential Revision: D70177232

fbshipit-source-id: 402adea7daa810c92015fd844430b26ae29bbf75
2025-02-26 07:47:03 -08:00
Pieter De BaetsandFacebook GitHub Bot 4a055f36eb Fallback to fbsystrace when Perfetto is not available (#49657)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49657

For some use-cases we still want to log using the internal fbsystrace API which allows backdating of events.

This feels a bit weird putting it in `ReactPerfettoLogger`, but maybe we should rename that to something like `TraceLogger` (like we have `TraceSection`).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70109680

fbshipit-source-id: 7757b81ec5032e3800446a88198c7da135afdd0e
2025-02-26 07:43:18 -08:00
Jakub PiaseckiandFacebook GitHub Bot 65242998ca Align Pressable types with OSS (#49631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49631

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70091770

fbshipit-source-id: 8a2fb448984fccf31c473002ffccd5ddb174b7e1
2025-02-26 07:21:43 -08:00
Rubén NorteandFacebook GitHub Bot f2c1f8b4e7 Provide access to document object in Fantom roots (#49691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49691

Changelog: [internal]

This adds a new getter for `document` in the `Root` class in Fantom tests to easily access the document instance for the root.

This isn't very useful at the moment, but will be very useful when we introduce `document.getElementById`, so we can access arbitrary nodes very easily.

Reviewed By: javache

Differential Revision: D69307130

fbshipit-source-id: 2650bc03e143ee9f0b29d0f284a2f9079ab9f765
2025-02-26 07:09:15 -08:00
Rubén NorteandFacebook GitHub Bot e3141308bb Enable DOM APIs by default in Fantom tests (#49690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49690

Changelog: [internal]

We're shipping this soon and most tests already using DOM APIs to make assertions, so it's easier if we just "ship" in tests.

Reviewed By: javache, sammy-SC

Differential Revision: D69307129

fbshipit-source-id: 75d0be013703cff7bc2bad5cd16c26bc6471e547
2025-02-26 07:09:15 -08:00
Mateo GuzmánandFacebook GitHub Bot 7e2487b6ce Migrate ProgressRequestBody to Kotlin (#49682)
Summary:
Migrate com.facebook.react.modules.network.ProgressRequestBody to Kotlin.

Note: To keep the logic the same as in Java, I had to make the params of RequestBodyUtil.createProgressRequest non-nullable again which were made nullable by mistake in https://github.com/facebook/react-native/pull/49584.

## Changelog:

[INTERNAL]- Migrate com.facebook.react.modules.network.ProgressRequestBody to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D70239855

Pulled By: cortinico

fbshipit-source-id: 03c5e0bd5c66a4d5df5e4304d4479ec576d350fd
2025-02-26 05:16:14 -08:00
Rubén NorteandFacebook GitHub Bot 1e4c0ded03 Rename INativeMethods as LegacyHostInstanceMethods (#49687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49687

Changelog: [internal]

Just a minor type rename to better reflect what this type will become soon.

Reviewed By: cortinico

Differential Revision: D70185597

fbshipit-source-id: d5a67eda44dc88dd32a5290f1d0b292ed7014006
2025-02-26 05:13:08 -08:00
Rubén NorteandFacebook GitHub Bot cd072dca99 Migrate HostInstance to an interface (#49633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49633

Changelog: [internal]

This replaces the definition of `HostInstance` to use an interface instead of an object, to better represent the underlying type (an instance of `ReactFabricHostComponent`) and simplify the migration to the new DOM API.

Reviewed By: huntie

Differential Revision: D70023947

fbshipit-source-id: bf312abf02fec48b2b5afb41053593ce542f7324
2025-02-26 05:13:08 -08:00
Nicola CortiandFacebook GitHub Bot 1fd3806ee9 Bump Node 18 -> 20 to build React Native in OSS (#49658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49658

This bumps the version of Node that we use to build React Native from 18 to 20.
We'll still be supporting building with 20, but we'll moving our toolchain to Node 20 becuase 18 is at EOL soon.

Changelog:
[General] [Changed] - Bump Node 18 -> 20 to build React Native in OSS

Reviewed By: javache, cipolleschi

Differential Revision: D70168003

fbshipit-source-id: b64ee583b2d2e72d25393119ae9e9029a74d5b13
2025-02-26 04:08:12 -08:00
Dawid MałeckiandFacebook GitHub Bot dbbdb985f5 Add SafeAreaView to buildTypes and align Flow with TS types (#49664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49664

Changelog:
[Internal] - Added SafeAreaView to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D70176107

fbshipit-source-id: 5da4ef4751c2d4a57b3ffd736294587836babecf
2025-02-26 03:15:02 -08:00
Iwo PlazaandFacebook GitHub Bot 9d92b277bf Optional post-transform pipeline for .d.ts files generated by build-types script (#49634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49634

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69992512

fbshipit-source-id: 7fc004e9460498de236a833aea5265a5fac5f490
2025-02-26 03:06:57 -08:00
Mateo GuzmánandFacebook GitHub Bot ac57ec4d0b Reland: Migrate ReactClippingViewGroup to Kotlin (#49413) (#49607)
Summary:
Reland of https://github.com/facebook/react-native/issues/49413 which was reverted due to an internal crash. I've attempted to do a solution to keep backwards compatibility but doesn't seem to work – keeping the original solution for now, perhaps something else can be cleaned up to avoid the breakage.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Verified that the update changes do not cause a crash.
Test flow:
- login to BizApp using Instagram account
- on home screen scroll down to Insights section
- it should show without crashing

Reviewed By: arushikesarwani94

Differential Revision: D70200000

Pulled By: alanleedev

fbshipit-source-id: 89bc948c1b91d9419d4b6e1885d949c4a3c20986
2025-02-26 00:32:01 -08:00
Samuel SuslaandFacebook GitHub Bot ca49b512ad Back out "remove use of RCTUnsafeExecuteOnMainQueueSync and main thread setup from RCTDeviceInfo" (#49681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49681

changelog: [internal]

Original commit changeset: e8280d2f5025

Original Phabricator Diff: D69747829

Reviewed By: NickGerleman

Differential Revision: D70200854

fbshipit-source-id: cbdd3746be4d43d320bb0f708cc1a790c010218b
2025-02-25 20:39:07 -08:00
Mateo GuzmánandFacebook GitHub Bot 0f12f99d6c Make SurfaceHandlerBinding internal (#49677)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.SurfaceHandlerBinding).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.SurfaceHandlerBinding internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D70208973

Pulled By: arushikesarwani94

fbshipit-source-id: 12b548e97db27cdb1750c54ad52b8e656fa39446
2025-02-25 19:45:52 -08:00
Joe VilchesandFacebook GitHub Bot 375817402a Fix import lint in TextProps.js (#49675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49675

tsia, lint warning

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D70189154

fbshipit-source-id: 6b4c18d6f677195c2a966c850165c44c72110bbb
2025-02-25 18:06:28 -08:00
Rubén NorteandFacebook GitHub Bot 52fb1dc3c7 Move definition of public instances to ReactNativePrivateInterface (#32446)
Summary:
## Summary

> [!NOTE]
> This only modifies types, so shouldn't have an impact at runtime.

Some time ago we moved some type definitions from React to React Native
in #26437.

This continues making progress on that so values that are created by
React Native and passed to the React renderer (in this case public
instances) are actually defined in React Native and not in React.

This will allow us to modify the definition of some of these types
without having to make changes in the React repository (in the short
term, we want to refactor PublicInstance from an object to an interface,
and then modify that interface to add all the new DOM methods).

## How did you test this change?

Manually synced `ReactNativeTypes` on top of
https://github.com/facebook/react-native/pull/49602 and verified Flow
passes.

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

Reviewed By: poteto

Differential Revision: D70091830

fbshipit-source-id: 2cc49d8ed89e8ee2531dbc4094ef9720fc3040ad
2025-02-25 17:57:17 -08:00
Rubén NorteandFacebook GitHub Bot 3cd7359750 Suppress Flow errors that will be introduced by React sync
Summary: Changelog: [internal]

Reviewed By: huntie

Differential Revision: D70178780

fbshipit-source-id: 68a67a5fc3277df44a6ffffcc8989cd18fc4b83e
2025-02-25 17:57:17 -08:00
David VaccaandFacebook GitHub Bot 5019a2ec17 Fix lints and small refactor on sync events (#49679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49679

Fix lints and small refactor on sync events

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D70196311

fbshipit-source-id: c4c3280b7f58f09073f084b71dbbb9ae66d71e67
2025-02-25 16:59:03 -08:00
David VaccaandFacebook GitHub Bot 8b4bba8305 Mark SynchronousEventReceiver as UnstableReactNativeAPI (#49678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49678

In this diff I'm undeprecating SynchronousEventReceiver and marking it as UnstableReactNativeAPI, to properly describe the status of this API.

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D70193235

fbshipit-source-id: c4818c89eecef135e9e1f82d35e7f1e2d46b1637
2025-02-25 16:59:03 -08:00
Sam ZhouandFacebook GitHub Bot 61890fe864 Cleanup uses of internal Flow types (#49683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49683

Use of these types will trigger `[internal-type]` error in the next version of Flow. This diff cleans them up ahead of the time.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D70202028

fbshipit-source-id: 97b7217040b63514f20888fb20c86596235a82a6
2025-02-25 15:29:36 -08:00
Sam ZhouandFacebook GitHub Bot 7c2687ecc2 Eliminate usage of global React types in ReactNativeTypes.js (#32330)
Summary:
DiffTrain build for [70f1d766e8ae7ca3701193abb8c8a9f2fdbdaa9d](https://github.com/facebook/react/commit/70f1d766e8ae7ca3701193abb8c8a9f2fdbdaa9d)

bypass-github-export-checks

Reviewed By: rubennorte

Differential Revision: D69932024

fbshipit-source-id: 21a5973848c91373d2f528a88350fd04e998a4d2
2025-02-25 09:37:21 -08:00
Dawid MałeckiandFacebook GitHub Bot 7856ef8409 Add Image and ImageBackground to buildTypes and align Flow with TS defs (#49659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49659

Changelog:
[Internal] - Added Image and ImageBackground to buildTypes and aligned Flow with TS defs

Reviewed By: huntie

Differential Revision: D70099485

fbshipit-source-id: 6000fc7099a4f811c451a08c4d5cf505d84ec0c9
2025-02-25 09:12:52 -08:00
Samuel SuslaandFacebook GitHub Bot 659004f16b add a flag to control if RCTTurboModuleManager._turboModuleManagerDelegateMutex is used (#49632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49632

changelog: [internal]

Add gating to experiment with removal of `_turboModuleManagerDelegateMutex`.

# Why remove _turboModuleManagerDelegateMutex?
- It is not consistently used in the class. Here is a case where access to _delegate is not protected by the mutex: https://fburl.com/code/9tay04fn
- From inspecting individual implementations of RCTTurboModuleManagerDelegates, it is not needed to synchronise access.
- It may lead to deadlocks under following conditions:
  - **A)** JavaScript thread gets hold of the `_turboModuleManagerDelegateMutex` and then tries to dispatch a block on the main thread synchronously (calling `RCTUnsafeExecuteOnMainQueueSync`). For example, when a new native module is created lazily because JavaScript used it and the native module requires main thread setup.-
  - **B)** The main thread tries to get hold of `_turboModuleManagerDelegateMutex` when it is creating a native module ([[RCTModuleRegistry moduleForName:lazilyLoadIfNecessary:]](https://fburl.com/code/lioi5zei)) from Obj-C.

Reviewed By: javache, cipolleschi

Differential Revision: D70087779

fbshipit-source-id: 1780b2f48537dd578260a96f8f498dbe11529689
2025-02-25 07:00:21 -08:00
Mateo GuzmánandFacebook GitHub Bot dcd103e122 Migrate ProgressiveStringDecoder to Kotlin (#49149)
Summary:
Migrate com.facebook.react.modules.network.ProgressiveStringDecoder to Kotlin

## Changelog:

[INTERNAL]- Migrate com.facebook.react.modules.network.ProgressiveStringDecoder to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69114070

Pulled By: rshest

fbshipit-source-id: 9f6bfc606be0236fb64216f47d8945c73faf1d1f
2025-02-25 06:59:00 -08:00
Mateo GuzmánandFacebook GitHub Bot f7f3253998 Add ProgressResponseBody test cases (#48675)
Summary:
The class is still in Java and also lacks of some tests so adding them to make it safer to migrate or for future refactors.

## Changelog:

[INTERNAL]  - Add `ProgressResponseBodyTest` test cases

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: alanleedev

Differential Revision: D68205423

Pulled By: rshest

fbshipit-source-id: edb1dcf4da34377b7b1dcfc68a6e08861421964b
2025-02-25 06:34:40 -08:00
Vitali ZaidmanandFacebook GitHub Bot 05e94848bb report proxy idle state in heartbeat events (#49635)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49635

Changelog:
[General][Internal] - report proxy idle state in heartbeat events

The proxy is considered Idle if it didn't receive any messages for 10 seconds.

Reviewed By: robhogan

Differential Revision: D70078637

fbshipit-source-id: 5b8d9a3a6e3e2568e40b3ada0a41e76b277fe66d
2025-02-25 06:29:08 -08:00
Jakub PiaseckiandFacebook GitHub Bot edfc73d1a1 Align DrawerLayoutAndroid type definitions with OSS (#49620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49620

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70081361

fbshipit-source-id: 203a9a984fddef6dfd2fce7e84ae44e8e68e8fcc
2025-02-25 05:51:21 -08:00
Mateo GuzmánandFacebook GitHub Bot 4a0a10ba50 Make ValueAnimatedNode, AnimatedNodeValueListener & InterpolationAnimatedNode internal (#49644)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [ValueAnimatedNode](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.animated.ValueAnimatedNode)
- [AnimatedNodeValueListener](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.animated.AnimatedNodeValueListener)
- [InterpolationAnimatedNode](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.animated.InterpolationAnimatedNode)

## Changelog:

[INTERNAL] - Make ValueAnimatedNode, AnimatedNodeValueListener & InterpolationAnimatedNode internal

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

Test Plan:
```bash
yarn build-android
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D70100915

Pulled By: cortinico

fbshipit-source-id: e3068326034c4a050c12be4f886546486c570b16
2025-02-25 05:34:15 -08:00
Joanna QuandFacebook GitHub Bot 4121d24454 Update deprecated enums in RCTTextPrimitivesConversions.h (#49648)
Summary:
`NSUnderlinePatternDash`/`NSUnderlinePatternDot` are [deprecated](https://developer.apple.com/documentation/uikit/nsunderlinepatterndash). Use their drop-in replacements (`NSUnderlineStylePatternDash` and `NSUnderlineStylePatternDot`) instead.

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [DEPRECATED] - Update deprecated enums in RCTTextPrimitivesConversions.h

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

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

Test Plan: Local build

Reviewed By: cortinico

Differential Revision: D70153675

Pulled By: cipolleschi

fbshipit-source-id: e64c9df1a5282a3f33f742a455c64c002f0c8044
2025-02-25 05:31:49 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot a033cf9d5e fix: remove UISceneDelegate from AppDelegate (#49628)
Summary:
After this change: https://github.com/facebook/react-native/pull/49078 UIWindowSceneDelegate is no longer needed.

This wasn't removed in the original PR.

## Changelog:

[iOS] [Removed] - Remove no longer needed UISceneDelegate

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

Test Plan: CI GREEN

Reviewed By: cortinico

Differential Revision: D70102384

Pulled By: cipolleschi

fbshipit-source-id: e33185a4becd949a9f0ec1eabeeb4fe85ef3ee79
2025-02-25 05:03:12 -08:00
Intl SchedulerandFacebook GitHub Bot acc4c9ed57 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907956139478
Sandcastle Job Instance ID: 4503601315782801
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D70170466

fbshipit-source-id: de74b0d82d1ebf3a825acfdb228822f3166d0b8b
2025-02-25 04:42:22 -08:00
Peter HsiehandFacebook GitHub Bot 823ede1fab Backout D69745459 to resolve more Twilight headset pairing issues (#49656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49656

changelog: [internal]

Differential Revision: D70116923

fbshipit-source-id: ead8b1551acd6713372e1b500d921c8590bf6ac0
2025-02-25 04:34:25 -08:00
Parsa NasirimehrandFacebook GitHub Bot d8df3a68fc chore(Android): migrate most of the files under MessageQueue to Kotlin (#48748)
Summary:
A continuation of the work done in https://github.com/facebook/react-native/pull/48652, This PR migrates every other Java file other than `QueueThreadExceptionHandler` under `com.facebook.react.bridge.queue` to Kotlin

## Changelog:

[INTERNAL] [FIXED] - Migrate most of the message queue files to Kotlin

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

Test Plan:
./gradlew test:
<img width="1567" alt="Screenshot 2025-01-16 at 21 10 47" src="https://github.com/user-attachments/assets/5bd6824d-b31c-45f8-9398-9cde658f8ff7" />

Reviewed By: cortinico

Differential Revision: D68294382

Pulled By: rshest

fbshipit-source-id: 3d919b43fea1c3656097f7730194ee8e2ac644d3
2025-02-25 04:18:37 -08:00
Mateo GuzmánandFacebook GitHub Bot 514fccf8dc Migrate ReactMarkerConstants to Kotlin (#49645)
Summary:
Migrate com.facebook.react.bridge.ReactMarkerConstants to Kotlin

## Changelog:

[INTERNAL]- Migrate com.facebook.react.bridge.ReactMarkerConstants to Kotlin

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

Test Plan:
```bash
yarn build-android
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D70120968

Pulled By: javache

fbshipit-source-id: c69ad2f3920ea877d51fd81c8b2a573844996e04
2025-02-25 04:13:59 -08:00
Samuel SuslaandFacebook GitHub Bot 91b4354fa0 add arguments to command logs (#49646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49646

changelog: [internal]

- Log command arguments so they can be asserted against in tests.

Use this in a TextInput test and add a test to check whether view command accidentally resets TextInput value to empty.

Reported: https://github.com/facebook/react-native/issues/49368?fbclid=IwZXh0bgNhZW0CMTEAAR2KUbc5F17NIX_WSJ_ojyUHQrR5UyASfSbkPl05nTj1tRV9knPI7GIFNmE_aem_O2I1F5tZTsvRX9anpv7gMg

Reviewed By: NickGerleman

Differential Revision: D70098109

fbshipit-source-id: 03482278b7adb0fa42dbc9e02e636ea1df9e6be6
2025-02-25 02:58:11 -08:00
Julian TiglerandFacebook GitHub Bot e3d607fc2e Fix new arch refresh control not shown when refreshing on mount (#49240)
Summary:
- In the old architecture on iOS, it was possible to begin refreshing a [`RefreshControl`](https://reactnative.dev/docs/refreshcontrol) backed by  [`RCTRefreshControl.m`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m) on mount (see [old arch rn-tester video](https://github.com/user-attachments/assets/0a759072-8931-438b-b9af-698b5f8fa072)).
- In the new architecture on iOS, when attempting to refresh on mount, the `RefreshControl` backed by [`RCTPullToRefreshViewComponentView.mm`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm) is not shown. Additionally, recycled `RefreshControl`s are missing their [`title`s](https://reactnative.dev/docs/refreshcontrol#title-ios) (see [new arch rn-tester video](https://github.com/user-attachments/assets/22f87a82-4703-470b-9c00-6454eb9458dd)).
- This change fixes the new arch issues mentioned above, so that the new arch behaves the same as the old arch did (see [new arch rn-tester video with fix](https://github.com/user-attachments/assets/3ab6c90c-6ad4-4dc7-b2f5-7cf1378e50b9)).
- This change also updates the rn-tester [`RefreshControlExample`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/rn-tester/js/examples/RefreshControl/RefreshControlExample.js) to include a refresh-on-mount to prevent future regressions

## Changelog:

[IOS] [FIXED] - Fix new arch RefreshControl wasn't shown when refreshing on mount
[IOS] [FIXED] - Fix new arch recycled RefreshControl was missing its title
[INTERNAL] [CHANGED] - Update rn-tester RefreshControlExample to refresh on mount

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

Test Plan:
- I created a [video](https://github.com/user-attachments/assets/0a759072-8931-438b-b9af-698b5f8fa072) of the baseline old arch behavior by overriding [`new_arch_enabled`](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/cocoapods/new_architecture.rb#L163-L165) to return `false`
- I created a [video](https://github.com/user-attachments/assets/22f87a82-4703-470b-9c00-6454eb9458dd) of the broken new arch behavior by overriding [`new_arch_enabled`](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/cocoapods/new_architecture.rb#L163-L165) to return `true`
- I applied the changes in this PR and created a [video](https://github.com/user-attachments/assets/3ab6c90c-6ad4-4dc7-b2f5-7cf1378e50b9) that confirms that the new arch with fix now behaves the same as the old arch
- I also used [patch-package](https://github.com/ds300/patch-package) to verify that the changes in this PR work as expected in my production React Native app, running `react-native@0.77.0`, with the new arch now enabled by default. Note that this app uses [`react-navigation`](https://github.com/react-navigation/react-navigation) and [`react-native-screens`](https://github.com/software-mansion/react-native-screens), which I expected might complicate the fix. The changes in this PR continue to work as expected, even with the complications of those popular libraries.

## Details:
- All of my changes were inspired by the many years of fixes that are included in [`RCTRefreshControl.m`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m), which haven't yet been included in the new [`RCTPullToRefreshViewComponentView.mm`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm)
    - My `_isBeforeInitialLayout` is inspired by the old [`_isInitialRender`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L17)
    - My `layoutSubviews` is inspired by the old [`layoutSubviews`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L43-L59)
    - My `beginRefreshingProgrammatically` is inspired by the old [`beginRefreshingProgrammatically`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L72-L107)
- I have tried to comment all of the unexpected changes. Some of these comments are taken directly from the old `RCTRefreshControl.m`
- In general, it seems like [`UIRefreshControl`](https://developer.apple.com/documentation/uikit/uirefreshcontrol) ignores many style updates, and even calls to `beginRefreshing`, until it's been added to the view hierarchy. That's why the `layoutSubviews` hack was needed in the old arch, and is similarly needed in this PR.
    - Here's a [Stack Overflow answer](https://stackoverflow.com/a/67758859) that hints at this, by saying that `beingRefreshing` needed to be called in a ViewController's `viewWillAppear` lifecycle callback
    - Here's a different [Stack Overflow answer](https://stackoverflow.com/a/32688124) that shows that `viewWillLayoutSubviews` (and by extension, all of the subviews' `layoutSubviews`) is indeed called after `viewWillAppear`
- Since `_refreshControl` effectively ignores updates until the first `layoutSubviews` call, I needed to buffer all calls to `updateProps:oldProps:` into my new `_initialProps` before finally re-calling `updateProps:oldProps:` with `_initialProps` against `PullToRefreshViewShadowNode::defaultSharedProps` in `layoutSubviews`
- Additionally, I needed to move the `if` block regarding refreshing from the top of `updateProps:oldProps:` to the bottom of it, because `_refreshControl` ignores updates that are made after the call to `beginRefreshing`

## Known issues:
- There is one small difference between the old arch and the new arch with this PR. The old arch [programmatically animates the pull down content offset](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L89-L102), whereas this PR does not. See `[scrollView setContentOffset:offset]` in the PR code.
    - I tried animating it with the block below, and this did work in the rn-tester app. However, it caused the fix to not work when used with the extremely popular `react-navigation` and `react-native-screens` libraries. In that case, the `RefreshControl` exhibited the same buggy behavior of not being shown when refreshing on mount.
    ```objective-c
    [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
        [_scrollViewComponentView.scrollView setContentOffset:offset];
    } completion:^(BOOL finished) {
        [_refreshControl beginRefreshing];
    }];
    ```
    - I thought it would be better to fix this for a larger number of real-world scenarios without animation than it would be to fix it for just the rn-tester app with animation.

Reviewed By: javache

Differential Revision: D69980100

Pulled By: cipolleschi

fbshipit-source-id: bbacd8ffffff5d87728a1c8c0063acc60215d1a6
2025-02-25 02:19:37 -08:00
Dawid MałeckiandFacebook GitHub Bot 094c5be42e Merge and align global.d.ts and globals.d.ts files (#49516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49516

Merge global.d.ts and globals.d.ts into one file and align some definitions with implementations.

Changelog:
[General][Changed] - Improve TypeScript types for `global` objects

Reviewed By: huntie

Differential Revision: D69772463

fbshipit-source-id: 4771e27a97e1e9cbc33d8f75ba11cffd4d200124
2025-02-25 01:55:26 -08:00
Dawid MałeckiandFacebook GitHub Bot 721f85adf7 Set minimum typescript version to 4.9 (#49637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49637

The dtslint requires that the minimum typescript version of 4.9 is used.

Changelog:
[General][Changed] - Increase minimum typescript version in index.d.ts

Reviewed By: huntie

Differential Revision: D69749044

fbshipit-source-id: be255d108c2e9e9452808ba3dea981a7fac0bc21
2025-02-25 01:55:26 -08:00
Dawid MałeckiandFacebook GitHub Bot 4e79ca4464 Add Touchable to buildTypes and align Flow with TS types (#49562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49562

Changelog:
[Internal]: Added Touchable to buildTypes and aligned Flow with TS types.

Reviewed By: huntie

Differential Revision: D69843245

fbshipit-source-id: 578987a277c3407890a541e442bb347311f71efa
2025-02-25 01:49:28 -08:00
Jakub PiaseckiandFacebook GitHub Bot dee6168027 Align Keyboard types with OSS (#49623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49623

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70083211

fbshipit-source-id: c91d3cd7e8f4ad8770bc686768103b43611d4ebb
2025-02-25 01:23:04 -08:00
Jakub PiaseckiandFacebook GitHub Bot 091f542a2e Add a pretransform replacing Stringish with string (#49636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49636

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70094483

fbshipit-source-id: 3ec23f19af437e28e82f73f03541cbf38469d670
2025-02-25 01:22:31 -08:00
Jakub PiaseckiandFacebook GitHub Bot 4309a5d2b1 Fix URLSearchParams common interface definition (#49640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49640

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70096501

fbshipit-source-id: 33c6406beaab06285675fdb7c2ab75ebd2bb280f
2025-02-25 01:20:23 -08:00
Joe VilchesandFacebook GitHub Bot e6af7951f8 Remove some confusing comments in ReactAccessibilityDelegate (#49655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49655

This tripped me up since this if hits for TextViews in general, not just EditText

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70139349

fbshipit-source-id: 1993dda4c6472265c5e61fa4cad4f2beaf4a9930
2025-02-24 23:55:27 -08:00
Joe VilchesandFacebook GitHub Bot 0c6dcfdd48 Use isEmpty as opposed to .size() > 0 in BaseViewManager.java (#49654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49654

This is a lint error, so figured I would fix it

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70138099

fbshipit-source-id: 489bedc28ac15bed8f98cc3eceb9e393cd4598e7
2025-02-24 23:55:27 -08:00
Soe LynnandFacebook GitHub Bot cccd93b4ed Fix typo in RCTLegacyViewMangerInteropComponentView (#49652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49652

Changelog [Internal]
Fixing simple typo

Reviewed By: shwanton

Differential Revision: D70136618

fbshipit-source-id: 994b0915c946449a7a01ab15304d35323b58b009
2025-02-24 18:29:31 -08:00
Liron YahdavandFacebook GitHub Bot 8c848b4293 Reland: Throw exception with name of TurboModule instead of deadlock during sync rendering (#49587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49587

This is a reland diff for D69805065.

The problems with the original diff were:
- wrong header search path in the `React-NativeModuleApple.podspec`
- adding an implementation `RuntimeExecutor.cpp` file to implement a function that is used by an inline function in the `RuntimeExecutor.h`.

I believe that the last point specifically was creating issues to the linker which was not able to resolve the symbols properly in transitive dependencies.

The fix was to move the implementation of `getMainThreadMutex` to be `inline`.

## Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D69922771

fbshipit-source-id: 285ce1f232e8c94b99d80aafe1ffbc473921d52f
2025-02-24 17:00:17 -08:00
Maddie LordandFacebook GitHub Bot a302fbcaaf Set ReactSurface and ReactRootView to ReactDelegate when created via ReactNavigationActivityDelegate (#49580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49580

Add setReactSurface and setReactRootView methods for custom delegates.

Reviewed By: arushikesarwani94

Differential Revision: D69925812

fbshipit-source-id: b2acd3e541bd34216d9f8cadbdf2fa5c04e46b98
2025-02-24 15:58:11 -08:00
Shawn DempseyandFacebook GitHub Bot f17c26437b Revert D69849314: Use implicit namespace to better align Animated module with OSS types
Differential Revision:
D69849314

Original commit changeset: cdaa605ba536

Original Phabricator Diff: D69849314

fbshipit-source-id: b97b049cf5f3728568a55abfb93dc67cadfa26ba
2025-02-24 15:40:33 -08:00
Rick HanlonandFacebook GitHub Bot ddf9338dfb enable owner stacks everywhere (#32376)
Summary:
this is now canary and on everywhere

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

Reviewed By: jackpope, kassens

Differential Revision: D69784493

fbshipit-source-id: 363d28c1ffe3eb264ac78f55bac105dd14f571d1
2025-02-24 11:32:49 -08:00
Rubén NorteandFacebook GitHub Bot 8989bc24b9 Refactor tracing in performance.mark and performance.measure (#49639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49639

Changelog: [internal]

This refactors some code in the performance API and Perfetto to avoid doing unnecessary work when not tracing (e.g.: string manipulation for tracks).

It also reduces the cost of logging marks/measures to tracing backends if not actively tracing (e.g.: moving the check to outside the lock).

Reviewed By: bgirard

Differential Revision: D69246772

fbshipit-source-id: 141a13f609f12be7ab8ca00f7aa1892b34770bbb
2025-02-24 10:57:29 -08:00
Rubén NorteandFacebook GitHub Bot f424b68c37 Add basic benchmarks for the Performance API (#49638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49638

Changelog: [internal]

This adds a basic benchmark for different use cases of the `performance` API.

Baseline:
| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5692.08 ± 0.33%'    | '5590.00'           | '177735 ± 0.02%'           | '178891'                  | 175683  |
| 1       | 'mark (with custom startTime)'                            | '5775.21 ± 0.27%'    | '5690.00'           | '174880 ± 0.02%'           | '175747'                  | 173154  |
| 2       | 'measure (with start and end timestamps)'                 | '6842.61 ± 0.35%'    | '6730.00'           | '147672 ± 0.02%'           | '148588'                  | 146144  |
| 3       | 'measure (with mark names)'                               | '6828.01 ± 0.75%'    | '6700.00'           | '148371 ± 0.02%'           | '149254'                  | 146456  |
| 4       | 'clearMarks'                                              | '817.04 ± 0.03%'     | '800.00'            | '1233054 ± 0.01%'          | '1250000'                 | 1223933 |
| 5       | 'clearMeasures'                                           | '835.59 ± 0.03%'     | '820.00'            | '1203121 ± 0.01%'          | '1219512'                 | 1196758 |
| 6       | 'mark + clearMarks'                                       | '6137.42 ± 1.32%'    | '5920.00'           | '167661 ± 0.02%'           | '168919'                  | 162935  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7353.85 ± 0.60%'    | '7200.00'           | '138196 ± 0.02%'           | '138889'                  | 135984  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7342.93 ± 0.66%'    | '7170.00'           | '138726 ± 0.02%'           | '139470'                  | 136186  |

Reviewed By: bgirard

Differential Revision: D66926182

fbshipit-source-id: b314b359147e758810598a241269d0c019f77466
2025-02-24 10:57:29 -08:00
zhongwuzwandFacebook GitHub Bot 929c8e4baa Fabric: disable React-Fabric stable_sort strict weak sort check in debug mode (#49422)
Summary:
Fixes assert crash in https://github.com/facebook/react-native/issues/46568#issuecomment-2653747732.

We can temporarily downgrade  _LIBCPP_HARDENING_MODE to _LIBCPP_HARDENING_MODE_EXTENSIVE, it disables strict weak ordering check in debug mode. Actually, when we sort animation mutations, we don't need it to satisfy strict weak ordering.

https://libcxx.llvm.org/Hardening.html#id3

Another solution is we make sort satisfy it, but we don't have any key to compare when two mutation is the same mutation type but not the same parentTag. Maybe we can use pointer of muation to compare?

## Changelog:

[IOS] [FIXED] - Fabric: disable  React-Fabric stable_sort strict weak sort check in debug mode

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

Test Plan: Fixes  https://github.com/facebook/react-native/issues/46568#issuecomment-2653747732.

Reviewed By: sammy-SC

Differential Revision: D69984937

Pulled By: cipolleschi

fbshipit-source-id: 2a3d17970def513c4ba915068f25338169db82d6
2025-02-24 10:25:52 -08:00
Sam ZhouandFacebook GitHub Bot 6f968f01eb Pre-suppress errors ahead of builtin libdef improvements (#49647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49647

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D70103465

fbshipit-source-id: 24f3c9fa7c56ed88609e60202d2a8c865fe18b47
2025-02-24 10:23:14 -08:00
Iwo PlazaandFacebook GitHub Bot b56548969a Use implicit namespace to better align Animated module with OSS types (#49559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49559

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69849314

fbshipit-source-id: cdaa605ba5361d3349c6dd0e84fd0fbfee263941
2025-02-24 09:20:04 -08:00
Jakub PiaseckiandFacebook GitHub Bot c66728dc35 Add ButtonProps export (#49593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49593

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69984581

fbshipit-source-id: 1a9607866dee564718081a15f9f6740dfb8dd0e4
2025-02-24 08:50:19 -08:00
Ruslan LesiutinandFacebook GitHub Bot 8bce4a37e1 Change TouchedViewDataAtPoint type in ReactNativeTypes to use supported by Flow tooling syntax (#32382)
Summary:
## Summary

The `flow-api-translator` from the `hermes` repo does not support flow
type spreads. It is currently not able to digest the ReactNativeTypes
file as it contains unsupported syntax. The simplest solution is to
change the type of the `TouchedViewDataAtPoint` to equivalent, yet
supported by the Flow tooling. In this case the intersection can be used
as
the `TouchedViewDataAtPoint` and `InspectorData` have no common
property.

## How did you test this change?

Run yarn flow native

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

Reviewed By: rickhanlonii

Differential Revision: D69661050

fbshipit-source-id: 1732bd9ac9c1af1e4c0b95758e92d9ccf3b807e6
2025-02-24 08:29:34 -08:00
Olivier BouilletandFacebook GitHub Bot e3b176a598 fix: set text position should not reset component text (#49450)
Summary:
fix: https://github.com/facebook/react-native/issues/49368
description is provided inside the ticket.
When we use TextInput on ios and manage selection with the selection prop, TextInput is reset when we change selection.

## Changelog:

[IOS] [FIXED] - Fix selection makes TextInput clear its content when using children

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

Test Plan:
Tested with sample provided in ticket.
I also test it with my app on both android and ios, but I cannot share video

Reviewed By: sammy-SC

Differential Revision: D69984616

Pulled By: cipolleschi

fbshipit-source-id: a17169608f9df0ea1cb579e6038345f8e48bbc27
2025-02-24 08:23:30 -08:00
Dawid MałeckiandFacebook GitHub Bot 92e21688db Add RefreshControl to buildTypes and align Flow with TS types (#49564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49564

Changelog:
[Internal] - Added RefreshControl to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69924368

fbshipit-source-id: 1a01ede28f9d0729c483036f8d3f9c9eced58286
2025-02-24 07:08:03 -08:00
zhongwuzwandFacebook GitHub Bot 5c1e01fdfe Fabric: Fixes shouldRasterizeIOS prop of View not work on iOS (#49615)
Summary:
The js prop name is `shouldRasterizeIOS` https://reactnative.dev/docs/view#shouldrasterizeios-ios, so we should change the prop name when parsing the props.

## Changelog:

[IOS] [FIXED] - Fabric: Fixes shouldRasterizeIOS prop of View not work on iOS

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

Test Plan:
Enable `shouldRasterizeIOS` should work in Fabric:
```
      <View shouldRasterizeIOS={true}>
```

Reviewed By: rshest

Differential Revision: D70085480

Pulled By: javache

fbshipit-source-id: 499524b7812f932b0da4a4f239ff6a79043b2f87
2025-02-24 06:47:46 -08:00
Jakub PiaseckiandFacebook GitHub Bot f8627e5627 Align ActivityIndicator with OSS types (#49519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49519

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69661567

fbshipit-source-id: 35e3849eeea188f8bdfa0664c90d3d9e5328ef80
2025-02-24 06:36:56 -08:00
Pieter De BaetsandFacebook GitHub Bot 3f3066f72b Remove unused sample turbo cxx module variants (#49629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49629

I don't think `RCTSampleTurboCxxModule_v1` does anything useful anymore since we no longer use the `getTurboModuleWithJsInvoker:` API anywhere.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D70088150

fbshipit-source-id: 6391531c412dec18c63948db883aba07ab21499e
2025-02-24 06:32:00 -08:00
Jakub PiaseckiandFacebook GitHub Bot db4086de97 Align LayoutConformance types with OSS (#49625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49625

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70084487

fbshipit-source-id: f4f0a06f3d7cf87659696ac41a27be5f5972d99f
2025-02-24 06:19:45 -08:00
Rubén NorteandFacebook GitHub Bot dbc0bf34ea Prepare for removal of types in ReactNativeTypes (#49602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after https://github.com/facebook/react/pull/32446

Reviewed By: huntie

Differential Revision: D69996009

fbshipit-source-id: 3c156b4dede8e217d6a828ab310533a2f8bfd42c
2025-02-24 05:32:43 -08:00
Rubén NorteandFacebook GitHub Bot e630b2ca18 Create specific module in RN to define the types for host instances and host components that ReactNativeTypes defines (#49601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49601

Changelog: [internal]

This creates a new module in React Native to define some of the types related to `HostInstance` that are currently defined in `ReactNativeTypes` (synced from the React repo).

We want to remove the types from `ReactNativeTypes` so this is a necessary initial step.

Reviewed By: huntie

Differential Revision: D69996010

fbshipit-source-id: 21cfed4c222e22332936e56aca895fe578809792
2025-02-24 05:32:43 -08:00
Vitali ZaidmanandFacebook GitHub Bot 14b0c27045 remove duplicate call to json stringify (#49621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49621

Changelog:
[General][Internal] - remove duplicate call to json stringify

Reviewed By: robhogan

Differential Revision: D70082245

fbshipit-source-id: 01a4277a73978fcee1fc44b5bc6ae5a728e6b504
2025-02-24 05:07:22 -08:00
Jakub PiaseckiandFacebook GitHub Bot 0a87f0cf5c Align ScrollView with the OSS types (#49617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49617

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69981167

fbshipit-source-id: d4b2661b9ec746f30b512bad2c84d4dd0c1755c7
2025-02-24 05:03:18 -08:00
Jakub PiaseckiandFacebook GitHub Bot dcaa33e6d9 Add support for numberOfLines for TextInput on iOS (#49549)
Summary:
`TextInput` component has been missing support for `numberOfLines` prop on iOS, this PR adds it.

## Changelog:

[IOS] [ADDED] - Add support for `numberOfLines` prop on `TextInput`

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

Test Plan: Tested on RNTester and added a new case utilizing the prop

Reviewed By: cipolleschi

Differential Revision: D69915133

Pulled By: j-piasecki

fbshipit-source-id: b6a86bc64bd3c2129a64e99c9bcec9cf5bfde3bc
2025-02-24 04:23:58 -08:00
Nicola CortiandFacebook GitHub Bot 53ff6133a7 Re-land: Make RedBoxContentView internal (#49596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49596

I'm relanding D69934543 as it was previsouly reverted.

I'm making this class internal as I've verified that there are no meaningful usages.

[Source](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.RedBoxContentView)

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69987752

fbshipit-source-id: 191a5f5aacbe6ff642e98d4e8c621c17156e55de
2025-02-24 03:15:56 -08:00
Dawid MałeckiandFacebook GitHub Bot b060fbe99c Add StatusBar to buildTypes and align Flow with TS types (#49598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49598

Changelog:
[Internal] - Added StatusBar to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69990300

fbshipit-source-id: 684c3692fd3cc4862fd3cd3fe4731129887b9bcc
2025-02-24 03:11:31 -08:00
Vitali ZaidmanandFacebook GitHub Bot 4e7b77eb1a create a heartbeat for device, and not only for debugger (#49618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49618

Changelog:
[General][Internal] - create a heartbeat for device, and not only for debugger.

Introducing a heartbeat for the connection between the proxy and the device similarly to the one between the proxy and the debugger. This will allow us to:
* Most importantly I'd like to track the ping-pong roundtrip to the device as well, to see if we have any anomalies there
* Terminate the connection if it is abandoned for 60seconds- this might have a real effect in some case where the device runs remotely
* Also keep that connection alive if the other side disconnects after a period of inactivity. While a no-op in our case, this is an implementation detail. It is a no-op because the WebSocket on the Device is implemented by us and is not supposed to drop connections like the browser does.

Reviewed By: robhogan

Differential Revision: D69990715

fbshipit-source-id: 6bb3a2ed3eaffff9535aa2d0fc8cff0262af022f
2025-02-24 01:57:34 -08:00
Dawid MałeckiandFacebook GitHub Bot 56ed15ee12 Add optional reference to the TouchableHighlight and new types test (#49591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49591

Changelog:
[Internal] - Added optional reference to the TouchableHighlight and new types test

Reviewed By: huntie

Differential Revision: D69984286

fbshipit-source-id: f6757720d0914ea3da3a32c824eb9aaeb5a1f39b
2025-02-24 01:32:38 -08:00
Jakub PiaseckiandFacebook GitHub Bot 7b5b7b20de Update VirtualizedSectionList props name (#49592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49592

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69984225

fbshipit-source-id: 753917f31a803c3bc8ea2e4635ec1d58cecb9224
2025-02-23 23:59:51 -08:00
Mateo GuzmánandFacebook GitHub Bot 021167ea57 Remove MessageQueueThreadHandler.java to fix CI (#49613)
Summary:
MessageQueueThreadHandler was migrated to Kotlin in https://github.com/facebook/react-native/pull/49583 but during merging the Java file was kept, this is currently breaking the `build-android` action in CI. [See this action for example](https://github.com/facebook/react-native/actions/runs/13472084782/job/37646841097?pr=49607)

## Changelog:

[INTERNAL] - Remove MessageQueueThreadHandler.java implementation to fix CI

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

Test Plan:
```bash
yarn build-android
```

Reviewed By: fkgozali

Differential Revision: D70059045

Pulled By: arushikesarwani94

fbshipit-source-id: 93665a8ac4ccc1cb1b03908179e2fcd12c61b3dd
2025-02-23 12:52:35 -08:00
Devan BuggayandFacebook GitHub Bot 1fe8d587a8 Remove sharedApplication use in SafeAreaProxy (#49612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49612

`[UIApplication sharedApplication]` is not allowed in Mac Catalyst. This #ifdef's it out which is a common pattern elsewhere.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D69971189

fbshipit-source-id: 89dbc0a02ed2a06936f910fbfc13e1fb91972540
2025-02-21 18:20:26 -08:00
Samuel SuslaandFacebook GitHub Bot 814e1ebff6 avoid sync dispatch with locked mutex in RCTKeyWindowValuesProxy (#49605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49605

changelog: [internal]

Calling `RCTUnsafeExecuteOnMainQueueSync` while holding a lock can lead to a deadlock. In this diff, we remove it from RCTKeyWindowValuesProxy.

Reviewed By: javache

Differential Revision: D69997888

fbshipit-source-id: a09fc641c9fb2aec59aef34e4047e1ef11cdaf02
2025-02-21 16:41:30 -08:00
Joe VilchesandFacebook GitHub Bot a003be0f23 Allow text links to be navigatable via keyboard by default v2 (#49381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49381

A much improved version of my previous attempt in D68306316 (https://github.com/facebook/react-native/pull/48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69551206

fbshipit-source-id: 6a88ccd507dc5534c1f494e3303c6bfc2bae5e9f
2025-02-21 16:10:03 -08:00
Joe VilchesandFacebook GitHub Bot c9e6567881 Fix issue where state updating text to remove link would break TalkBack
Summary:
Whenever we remove a link in some text we do not properly update the accessibility delegate to respond to this change. As a result we still think that there are nodes to access around the spans

Changelog: [Android][Fixed] - Fix text link accessibility on state update removal

Reviewed By: NickGerleman, mdvacca

Differential Revision: D69551906

fbshipit-source-id: f43fcf72219e76d2d0bbb29d31ab219d73413671
2025-02-21 16:10:03 -08:00
Joe VilchesandFacebook GitHub Bot d65d846ccf Move text-specific a11y logic in ReactAccessibilityDelegate to subclass (#49377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49377

ReactAccessibilityDelegate exists to handle much of the accessibility tasks in the various Views in RN. There is quite a bit of text specific logic, mostly related to virtual views and nested links within a TextView.

I decided to subclass this into a TextView-specific version because I need this delegate to reference TextView or ReactClickableSpan, which live under `react/views` while ReactAccessibilityDelegate live under `react/uimanager`. The former depends on the latter, so making the latter depend on the former would for a dependency cycle that would break builds. I thought about making a separate package for this but both `react/views` and `react/uimanager` need to include ReactAccessibilityDelegate so we would still have a cycle.

mAccessibilityLinks is only set on ReactTextViewManager, so this is purely a text thing. Subclassing is not the most ideal as it extends the inheritance chain some more but I do not see a better option.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D69499115

fbshipit-source-id: 1720d20bb56ba1e1b5bd114d32bc70e80e3b4558
2025-02-21 16:10:03 -08:00
Nicola CortiandFacebook GitHub Bot 50878c248d Reland: Make PerftestDevSupportManager internal (#49595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49595

This is a reland of D69934544 which was previously reverted.

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

I'm making this class internal as I verified that there are no meaningful OSS usages.

[Source](https://www.google.com/url?q=https://github.com/search?type%3Dcode%26q%3DNOT%2Bis%253Afork%2BNOT%2Borg%253Afacebook%2BNOT%2Brepo%253Areact-native-tvos%252Freact-native-tvos%2BNOT%2Brepo%253Anuagoz%252Freact-native%2BNOT%2Brepo%253A2lambda123%252Freact-native%2BNOT%2Brepo%253Abeanchips%252Ffacebookreactnative%2BNOT%2Brepo%253AfabOnReact%252Freact-native-notes%2BNOT%2Buser%253Ahuntie%2BNOT%2Buser%253Acortinico%2BNOT%2Brepo%253AMaxdev18%252Fpowersync_app%2BNOT%2Brepo%253Acarter-0%252Finstagram-decompiled%2BNOT%2Brepo%253Am0mosenpai%252Finstadamn%2BNOT%2Brepo%253AA-Star100%252FA-Star100-AUG2-2024%2BNOT%2Brepo%253Alclnrd%252Fdetox-scrollview-reproductible%2BNOT%2Brepo%253ADionisisChytiris%252FWorldWiseTrivia_Main%2BNOT%2Brepo%253Apast3l%252Fhi2%2BNOT%2Brepo%253AoneDotpy%252FCaribouQuest%2BNOT%2Brepo%253Abejayoharen%252Fdailytodo%2BNOT%2Brepo%253Amolangning%252Freversing-discord%2BNOT%2Brepo%253AScottPrzy%252Freact-native%2BNOT%2Brepo%253Agabrieldonadel%252Freact-native-visionos%2BNOT%2Brepo%253AGabriel2308%252FTestes-Soft%2BNOT%2Brepo%253Adawnzs03%252FflakyBuild%2BNOT%2Brepo%253Acga2351%252Fcode%2BNOT%2Brepo%253Astreeg%252Ftcc%2BNOT%2Brepo%253Asoftware-mansion-labs%252Freact-native-swiftui%2Bcom.facebook.react.devsupport.PerftestDevSupportManager&sa=D&source=editors&ust=1740080026490626&usg=AOvVaw2lrtsZSaLDgxSkejXVrRrp)

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69988162

fbshipit-source-id: 475b509417c4e6974d62bab01c089588625fcd8c
2025-02-21 14:57:12 -08:00
Nicola CortiandFacebook GitHub Bot 8cc772da9a Make PackagerStatusCheck Internal (#49575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49575

I've verified that this class is not used in OSS so I'm making it internal.

[Source](https://www.google.com/url?q=https://github.com/search?type%3Dcode%26q%3DNOT%2Bis%253Afork%2BNOT%2Borg%253Afacebook%2BNOT%2Brepo%253Areact-native-tvos%252Freact-native-tvos%2BNOT%2Brepo%253Anuagoz%252Freact-native%2BNOT%2Brepo%253A2lambda123%252Freact-native%2BNOT%2Brepo%253Abeanchips%252Ffacebookreactnative%2BNOT%2Brepo%253AfabOnReact%252Freact-native-notes%2BNOT%2Buser%253Ahuntie%2BNOT%2Buser%253Acortinico%2BNOT%2Brepo%253AMaxdev18%252Fpowersync_app%2BNOT%2Brepo%253Acarter-0%252Finstagram-decompiled%2BNOT%2Brepo%253Am0mosenpai%252Finstadamn%2BNOT%2Brepo%253AA-Star100%252FA-Star100-AUG2-2024%2BNOT%2Brepo%253Alclnrd%252Fdetox-scrollview-reproductible%2BNOT%2Brepo%253ADionisisChytiris%252FWorldWiseTrivia_Main%2BNOT%2Brepo%253Apast3l%252Fhi2%2BNOT%2Brepo%253AoneDotpy%252FCaribouQuest%2BNOT%2Brepo%253Abejayoharen%252Fdailytodo%2BNOT%2Brepo%253Amolangning%252Freversing-discord%2BNOT%2Brepo%253AScottPrzy%252Freact-native%2BNOT%2Brepo%253Agabrieldonadel%252Freact-native-visionos%2BNOT%2Brepo%253AGabriel2308%252FTestes-Soft%2BNOT%2Brepo%253Adawnzs03%252FflakyBuild%2BNOT%2Brepo%253Acga2351%252Fcode%2BNOT%2Brepo%253Astreeg%252Ftcc%2BNOT%2Brepo%253Asoftware-mansion-labs%252Freact-native-swiftui%2Bcom.facebook.react.devsupport.PackagerStatusCheck&sa=D&source=editors&ust=1740079563838123&usg=AOvVaw09B3GTFOynL-bbMHF6M4m2)

Changelog:
[Internal] [Changed] -

Reviewed By: arushikesarwani94

Differential Revision: D69933995

fbshipit-source-id: 77e308bd01fb4d51d4cf54e4666f15b532b43453
2025-02-21 14:47:32 -08:00
Mateo GuzmánandFacebook GitHub Bot 4bb03f3549 Migrate com.facebook.react.bridge.queue.MessageQueueThreadHandler to Kotlin (#49583)
Summary:
Migrate com.facebook.react.bridge.queue.MessageQueueThreadHandler to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.queue.MessageQueueThreadHandler to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69950075

Pulled By: arushikesarwani94

fbshipit-source-id: ddca07860a57816b2ff3b2b8902151686700f5c2
2025-02-21 14:31:13 -08:00
Jack PopeandFacebook GitHub Bot 07d9cf3ed0 Back out "cleanup feature flag enableFabricCompleteRootInCommitPhase" (#49565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49565

Original commit changeset: 6ed54f0fab45

Original Phabricator Diff: D69473992

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D69924542

fbshipit-source-id: 6438d1f6e21728de662a060893b0f08f9285be73
2025-02-21 14:26:37 -08:00
Joe VilchesandFacebook GitHub Bot 441744a0eb Implement view finding by native id (#49581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49581

I need to be able to find a View with a specific nativeId as part of my implementation of accessibility ordered children. This already exists in Android in `ReactFindViewUtil.kt`.

Not much to this implementation. Recursive tree searching. I do not think perf is a big deal here but if we want to optimize this we could implement some nativeId registry and try and get the UIView * from that at the expense of storing that map somewhere.

Changelog: [Internal]

Reviewed By: vincentriemer

Differential Revision: D69868430

fbshipit-source-id: b3648a8dca351bed50534cac2144d7e8ea0a207f
2025-02-21 14:10:01 -08:00
Mateo GuzmánandFacebook GitHub Bot 0aa8af906d Migrate com.facebook.react.modules.network.RequestBodyUtil to Kotlin (#49584)
Summary:
Migrate com.facebook.react.modules.network.RequestBodyUtil to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network.RequestBodyUtil to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: arushikesarwani94

Differential Revision: D69980421

Pulled By: cortinico

fbshipit-source-id: aa66661b2b79afdfd41963e7896b9a01f12af5cb
2025-02-21 12:45:00 -08:00
Henry GarantandFacebook GitHub Bot f85cca0ee5 Back out D69855097 & D69874923 to unblock Twilight headset pairing/discovery (#49600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49600

changelog: [internal]

# Context
Recent reports of unable to pair or connect to headsets in the Twilight app started ~1 day ago.

I used a bisect to narrow down the range of changes https://www.internalfb.com/mobile-bisect/Bi653128483872339, which lead to [changelog](https://www.internalfb.com/intern/changelog/?search=%7B%22key%22%3A%22AND%22%2C%22children%22%3A[%7B%22key%22%3A%22buck_target_is%22%2C%22field%22%3A%22buck_target%22%2C%22value%22%3A%22%2F%2Ffbobjc%2FApps%2FOculus%2FTwilight%3ATwilight%22%7D%2C%7B%22key%22%3A%22branch_first%22%2C%22field%22%3A%22branch%22%2C%22value%22%3A%22master%22%7D%2C%7B%22key%22%3A%22revision_first%22%2C%22field%22%3A%22revision%22%2C%22value%22%3A%22e835199c51fd1b55c3c13c5504f9b5527e201b41%22%7D%2C%7B%22key%22%3A%22branch_last%22%2C%22field%22%3A%22branch%22%2C%22value%22%3A%22master%22%7D%2C%7B%22key%22%3A%22revision_last%22%2C%22field%22%3A%22revision%22%2C%22value%22%3A%22d19e5a6cd5949d65aee30f7e8ce185979b7448af%22%7D]%7D)

From there I continued until I found the threshold
D69855097 (bad) and D69803512 (good).

I tried a direct revert of D69855097 but the changes we spread across another diff
D69874923.

Reverting the stack of these gets us to here.

Could use help understanding what's going on.

Reviewed By: sammy-SC

Differential Revision: D69987736

fbshipit-source-id: f9d16a460112374f163d235dc3e576d7ad506ebf
2025-02-21 10:56:37 -08:00
Dawid MałeckiandFacebook GitHub Bot 0d454285c7 Add Switch to buildTypes and align Flow with TS types. (#49597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49597

Changelog:
[Internal] - Added Switch to buildTypes and aligned Flow with TS types.

Reviewed By: huntie

Differential Revision: D69984618

fbshipit-source-id: 1fb978bb712be20f0e685af80bef0ac6d78b73ba
2025-02-21 09:09:01 -08:00
Nicola CortiandFacebook GitHub Bot 6dbc0558ff Cleanup enableEventEmitterRetentionDuringGesturesOnAndroid feature flag (#49590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49590

This feature flag was used to validate a fix for handling of events during
gesture on pressable. It can now be removed as the flag has been set to true for several
internal app (Twilight among others) for several months.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D69983235

fbshipit-source-id: 89b96b3e4c98ae258982341f56ddc13aa2fe51bd
2025-02-21 09:01:19 -08:00
Phil PluckthunandFacebook GitHub Bot 55acb42105 chore(community-cli-plugin): Remove extraneous @react-native/metro-babel-transformer (#49558)
Summary:
Opening this as a separate PR, since I'm not sure if I'm missing something, or if there's any intention behind this.

`react-native/metro-babel-transformer` is used by `react-native/metro-config` and is referenced in code there and as a dependency there. It's also sometimes mentioned as package for community CLI users to install directly. However, there's seemingly no reason `react-native/metro-babel-transformer` needs to depend on it, or any code that relies on it directly.

## Changelog:

[INTERNAL] [CHANGED] - Remove extraneous `react-native/metro-babel-transformer` dependency from community-cli-plugin

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

Test Plan: - n/a

Reviewed By: robhogan

Differential Revision: D69926109

Pulled By: huntie

fbshipit-source-id: b89b54890248de4954e5c0ce4afe3a5cb5bfa2c1
2025-02-21 08:43:56 -08:00
Janic DuplessisandFacebook GitHub Bot b0fd9c1556 Update androidx app compat to 1.7.0 (#49594)
Summary:
Update androidx app compat to the latest version.

This is needed as part of https://github.com/facebook/react-native/pull/49486 to have access to `fullyDrawnReporter`.

## Changelog:

[ANDROID] [CHANGED] - Update androidx app compat to 1.7.0

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

Test Plan: Tested in RN tester that it builds fine and works properly.

Reviewed By: Abbondanzo

Differential Revision: D69988202

Pulled By: cortinico

fbshipit-source-id: 0329aa84a76327db535ddba8acf059ebbf1dbdfc
2025-02-21 08:40:01 -08:00
Phil PluckthunandFacebook GitHub Bot 28458a0c79 chore(dev-middleware): Move selfsigned to package.json:devDependencies (#49556)
Summary:
This package does not seem to be referenced by anything but the tests in `packages/dev-middleware`, so seems like a pretty straightforward change to drop it from `dependencies`.

It only seems to be referenced in `packages/dev-middleware/src/__tests__/ServerUtils.js`

## Changelog:

[INTERNAL] [CHANGED] - Remove selfsigned from dev-middleware dependencies

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

Test Plan: - n/a

Reviewed By: cipolleschi

Differential Revision: D69925928

Pulled By: huntie

fbshipit-source-id: bba41f81dba054505ebf196ad37c7a718a6b16da
2025-02-21 07:50:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 4bc2c5298c Make HermesMemoryDumper internal (#49585)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.hermes.instrumentation.HermesMemoryDumper).

## Changelog:

[INTERNAL] - Make com.facebook.hermes.instrumentation.HermesMemoryDumper internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69980382

Pulled By: cortinico

fbshipit-source-id: 654d62e0961ab471d494fa9769fafa02d3808432
2025-02-21 07:28:21 -08:00
Samat OsmonovandFacebook GitHub Bot bd8c19739a Revert D69934544: Make PerftestDevSupportManager internal
Differential Revision:
D69934544

Original commit changeset: 00fc90907a27

Original Phabricator Diff: D69934544

fbshipit-source-id: 03aa1de1e594266b88b624dacec8891b1907a07f
2025-02-21 06:08:39 -08:00
Samat OsmonovandFacebook GitHub Bot e7d0271c67 Revert D69934543: Make RedBoxContentView internal
Differential Revision:
D69934543

Original commit changeset: 1fdf74a4aa34

Original Phabricator Diff: D69934543

fbshipit-source-id: 20a3f0011945fc5e1fb9efe25b81cd5e4fdd1b70
2025-02-21 06:07:03 -08:00
Phil PluckthunandFacebook GitHub Bot fd3b911533 chore(community-cli-plugin): Drop shadowed readline module (#49557)
Summary:
While `readline` is referenced in `packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js`, this references the `node:readline` module by default. The extra package seems to have been installed and included accidentally, as the `attachKeyHandlers` file uses an export from `node:readline` that's never been present in `npm:readline`.

Since the name matches but Node.js will always prefer built-in/code modules, this dependency is dangling and can never be reached, since it's name is shadowed (as also stated in their readme). This can be reproduced by comparing `require('readline')` and `require('../../node_modules/readline')` in `packages/community-cli-plugin`. The flow types also confirm this.

This overall seems highly safe to drop.

## Changelog:

[INTERNAL] [CHANGED] - Remove shadowed and unused readline npm package from community-cli-plugin

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

Test Plan:
Prior to changes applied:

```sh
$ node -e 'console.log(require("readline") === require("node:readline"))'
true
```

Reviewed By: cipolleschi

Differential Revision: D69925999

Pulled By: huntie

fbshipit-source-id: 802fdaa396630b44d5aacefeb9c2473fb53d167e
2025-02-21 05:56:51 -08:00
Jakub PiaseckiandFacebook GitHub Bot 289dba8cf2 Align InteractionManager and PanResponder types with OSS (#49517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49517

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69742877

fbshipit-source-id: ccd99b29aed4ec4ef8c0b7b2a57763f716be411e
2025-02-21 05:18:56 -08:00
Nicola CortiandFacebook GitHub Bot 5a01b0061d Make PerftestDevSupportManager internal (#49577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49577

I'm making this class internal as I verified that there are no meaningful OSS usages.

[Source](https://www.google.com/url?q=https://github.com/search?type%3Dcode%26q%3DNOT%2Bis%253Afork%2BNOT%2Borg%253Afacebook%2BNOT%2Brepo%253Areact-native-tvos%252Freact-native-tvos%2BNOT%2Brepo%253Anuagoz%252Freact-native%2BNOT%2Brepo%253A2lambda123%252Freact-native%2BNOT%2Brepo%253Abeanchips%252Ffacebookreactnative%2BNOT%2Brepo%253AfabOnReact%252Freact-native-notes%2BNOT%2Buser%253Ahuntie%2BNOT%2Buser%253Acortinico%2BNOT%2Brepo%253AMaxdev18%252Fpowersync_app%2BNOT%2Brepo%253Acarter-0%252Finstagram-decompiled%2BNOT%2Brepo%253Am0mosenpai%252Finstadamn%2BNOT%2Brepo%253AA-Star100%252FA-Star100-AUG2-2024%2BNOT%2Brepo%253Alclnrd%252Fdetox-scrollview-reproductible%2BNOT%2Brepo%253ADionisisChytiris%252FWorldWiseTrivia_Main%2BNOT%2Brepo%253Apast3l%252Fhi2%2BNOT%2Brepo%253AoneDotpy%252FCaribouQuest%2BNOT%2Brepo%253Abejayoharen%252Fdailytodo%2BNOT%2Brepo%253Amolangning%252Freversing-discord%2BNOT%2Brepo%253AScottPrzy%252Freact-native%2BNOT%2Brepo%253Agabrieldonadel%252Freact-native-visionos%2BNOT%2Brepo%253AGabriel2308%252FTestes-Soft%2BNOT%2Brepo%253Adawnzs03%252FflakyBuild%2BNOT%2Brepo%253Acga2351%252Fcode%2BNOT%2Brepo%253Astreeg%252Ftcc%2BNOT%2Brepo%253Asoftware-mansion-labs%252Freact-native-swiftui%2Bcom.facebook.react.devsupport.PerftestDevSupportManager&sa=D&source=editors&ust=1740080026490626&usg=AOvVaw2lrtsZSaLDgxSkejXVrRrp)

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D69934544

fbshipit-source-id: 00fc90907a27026269592e4cdfa8aed6e70a7c6e
2025-02-21 04:56:43 -08:00
Nicola CortiandFacebook GitHub Bot 303d379144 Make RedBoxContentView internal (#49578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49578

I'm making this class internal as I've verified that there are no meaningful usages.

[Source](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.RedBoxContentView)

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D69934543

fbshipit-source-id: 1fdf74a4aa34a641974aae71534555b86fe02d9c
2025-02-21 04:46:50 -08:00
Nicola CortiandFacebook GitHub Bot ffd426aff4 Unbreak CI due to AP Kotlin code which fails to compile (#49589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49589

We should not be attempting to compile anything related to the annotation
processor in either Kotlin or Java.
This excludes those folders from the Kotlin compilation task as the
CI is currently red because of it.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D69981620

fbshipit-source-id: 7e2d534023ab1c00e5aadf8546440a4cc4c01ec0
2025-02-21 04:41:50 -08:00
Dawid MałeckiandFacebook GitHub Bot f5837bf9f4 Add TouchableHighlight to buildTypes and move comments from TS definitions (#49560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49560

Changelog:
[Internal] - Added TouchableHighlight to buildTypes and moved comments from TS definitions

Reviewed By: huntie

Differential Revision: D69919248

fbshipit-source-id: 66b615df60862a53132bd7b2ae9f54065c444e22
2025-02-21 04:00:06 -08:00
Dawid MałeckiandFacebook GitHub Bot e96e0de756 Add TouchableNativeFeedback to buildTypes and align Flow types (#49561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49561

Changelog:
[Internal] - Added TouchableNativeFeedback to buildTypes and aligned Flow types

Reviewed By: huntie

Differential Revision: D69858177

fbshipit-source-id: 4bd55cba9a9eb1a1d304911cf929b363205a20d5
2025-02-21 04:00:06 -08:00
Dawid MałeckiandFacebook GitHub Bot b418aacd85 Add TouchableWithoutFeedback to buildTypes and align Flow with TS types (#49529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49529

Changelog:
[Internal] - Added TouchableWithoutFeedback to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69855221

fbshipit-source-id: a1de660e02a90f8e1c181b8e0c5dfdbaa4d2c75c
2025-02-21 04:00:06 -08:00
Rubén NorteandFacebook GitHub Bot f200b70354 Add Fantom test for synchronous state updates + UI consistency (#49572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49572

Changelog: [internal]

This adds a test to verify the behavior of 2 feature flags: synchronous state updates and UI consistency.

Reviewed By: javache

Differential Revision: D69932313

fbshipit-source-id: 341cfff3fa533503a293f6ccd0282442ba63d430
2025-02-21 03:21:07 -08:00
Vitali ZaidmanandFacebook GitHub Bot 4535e62414 add the event tracking when connection to debugger is closed (#49574)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49574

Changelog:
[General][Internal] add the event tracking when connection to debugger is closed

Reviewed By: huntie

Differential Revision: D69917816

fbshipit-source-id: 4a15288333c0d5b7fb821d046fa9c615bb25223e
2025-02-21 02:38:12 -08:00
Alan LeeandFacebook GitHub Bot bce6aa2828 Back out "Migrate ReactClippingViewGroup to Kotlin" (#49586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49586

Reverting https://github.com/facebook/react-native/pull/49413 as it was causing a crash with assertion failure in ReactViewGroup.addViewWithSubviewClippingEnabled()

Changelog:
[INTERNAL] revert Kotlin conversion due to crash

Reviewed By: sbuggay

Differential Revision: D69953848

fbshipit-source-id: b438fb928a4849f3dbad6a9d59d0f48449035fd6
2025-02-20 17:51:32 -08:00
David VaccaandFacebook GitHub Bot e6d0ef2832 Introduce script to generate list of legacy architecture types (#49579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49579

Introduce script to generate list of legacy architecture types

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D69937113

fbshipit-source-id: 54ba2a982128dab402acec1c40d833c71df2fabb
2025-02-20 17:06:11 -08:00
David VaccaandFacebook GitHub Bot e8afcbbc38 Migrate ReactLegacyArchitectureProcessor to kotlin (#49571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49571

Migrate ReactLegacyArchitectureProcessor to kotlin

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D69929877

fbshipit-source-id: 448c8de54cbb1f72eeee747edaf4cbb2a5fd365d
2025-02-20 17:06:11 -08:00
David VaccaandFacebook GitHub Bot 14bb32f4fc Create initial version of ReactLegacyArchitectureProcessor (#49570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49570

This diff creates a initial version of the annotation processor to output the list of types that are annotated with LegacyArchitecture

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D69929875

fbshipit-source-id: 90a8d299f4667ab8d103c061d287991dbdb291df
2025-02-20 17:06:11 -08:00
David VaccaandFacebook GitHub Bot c612662999 Mark subset of bridge classes as LegacyArchitecture (#49569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49569

In this diff I'm annotating a subset of bridge classes with LegacyArchitecture

The goal is to test the annotation processor in next diffs

changelog: [internal] internal

Reviewed By: cortinico, Abbondanzo

Differential Revision: D69929878

fbshipit-source-id: 8be4d010f6519617d334da361983dce0fa66e3b4
2025-02-20 17:06:11 -08:00
David VaccaandFacebook GitHub Bot 339297f095 Introduce ReactLegacyArchitectureProcessor annotation processor (#49568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49568

The goal of this annotation processor is to generate a file with all the types that belong to Legacy Architecture of React Native

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D69929876

fbshipit-source-id: c21bf1a868258b20be91721006d7fc8fa85adcd1
2025-02-20 17:06:11 -08:00
Douglas LowderandFacebook GitHub Bot 2c4a9d2a1b chore: make iOS glog script compatible with tvOS (#49539)
Summary:
This upstreams a change from [RNTV](https://github.com/react-native-tvos/react-native-tvos/) to allow the glog prepare script to work on both iOS and tvOS.

## Changelog:

[Internal][Changed] make iOS glog script compatible with tvOS

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

Test Plan:
- This change works well on the TV repo
- CI should pass, and iOS compilation and operation should be unchanged

Reviewed By: cortinico

Differential Revision: D69928586

Pulled By: cipolleschi

fbshipit-source-id: b5fec438151e659e98834a83effbc7e166df6aa5
2025-02-20 11:00:36 -08:00
Vitali ZaidmanandFacebook GitHub Bot a91cafd8cd add debuggerSessionIDs fields to debugger events (#49552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49552

Changelog:
[General][Internal] - expand debugger events to have DebuggerSessionIDs

Also moved the handling of these to a shared function

Reviewed By: huntie

Differential Revision: D69917817

fbshipit-source-id: 2374ac5b5dc0040b0e15028ab89fbe78026bc296
2025-02-20 10:07:19 -08:00
Jakub PiaseckiandFacebook GitHub Bot c079d5218f Partially align Utilities with OSS types (#49471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49471

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69747254

fbshipit-source-id: 70bfe94d0950d31e7f4f3c3bc4df47121e8be9c1
2025-02-20 09:12:43 -08:00
Samuel SuslaandFacebook GitHub Bot a5e853b812 initialise member variable in RCTWindowSafeAreaProxy startObservingSafeArea to prevent potential race (#49515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49515

changelog: [internal]

_currentSafeAreaInsets should be initialised as part of `startObservingSafeArea` to make sure it is set before accessed.

Even though, right now _currentSafeAreaInsets is always set before it is read because notification RCTUserInterfaceStyleDidChangeNotification fires eagerly, it might change in the future and introduce a bug.

Reviewed By: lenaic

Differential Revision: D69846681

fbshipit-source-id: f8be8a53e82020112abd170b9f20429bf7ba7011
2025-02-20 08:28:39 -08:00
Jon ThysellandFacebook GitHub Bot 94ea10c693 Fix implicit cast from double to PointerIndentifier in NativeDOM.cpp (#48578)
Summary:
When building `react-native-windows` our code analysis tools complained about an implicit `double` to `PointerIdentifier` in NativeDOM.cpp.

This PR adds an explicit cast.

Temporary downstream patch: https://github.com/microsoft/react-native-windows/commit/5957d0af6944d64513cead28186dfbcc74bbfea0

## Changelog:

[GENERAL] [FIXED] - Add explicit casts for pointerIds for PointerEvents in NativeDOM

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

Test Plan: React Native Windows builds with this change and no more warnings.

Reviewed By: rubennorte

Differential Revision: D69920656

Pulled By: cipolleschi

fbshipit-source-id: 1d81f1fbfd91fadfb676d3e65c3c9cb729c1d3dd
2025-02-20 08:25:30 -08:00
Samuel SuslaandFacebook GitHub Bot 3d1c1b50fe remove incorrect call of removeObserver from RCTDeviceInfo (#49551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49551

changelog: [internal]

in recent commit, https://github.com/facebook/react-native/commit/470bc4088957920aa55c8e5ccf3c9f4259c0694c, use of KVO was removed.
But `removeObserver` when `addObserver` was not called leads to a crash and must be removed as well.

Reviewed By: cipolleschi

Differential Revision: D69918158

fbshipit-source-id: ad65273e74545eba77ab35c5e22c28bddf072f9f
2025-02-20 08:25:29 -08:00
Mateo GuzmánandFacebook GitHub Bot 38190f530f Migrate StateWrapper to Kotlin (#49544)
Summary:
Migrate com.facebook.react.uimanager.StateWrapper to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.StateWrapper to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, NickGerleman

Differential Revision: D69890013

Pulled By: Abbondanzo

fbshipit-source-id: 859ae727167638a0ef7fa6158d27f5429921a9f9
2025-02-20 07:03:29 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0b67218a8a Add dummy cpp for renderercss (#49553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49553

The new React-renderercss pod is an header only pod. These are not allowed by Cocoapods, because it will not materialize the framework when building with then turned on.

the solution is to just add an empty source file to frorce cocoapods to materialize the .framework file and solve the dependency graph properly.

## Changelog:
[Internal] - Add dummy file to React-renderercss

Reviewed By: huntie

Differential Revision: D69920318

fbshipit-source-id: e5cc092a480f7c86eeb295ed966f85b6f55fdc54
2025-02-20 06:31:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3eec4a3ea9 Back out "Throw exception with name of TurboModule instead of deadlock during sync rendering" (#49554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49554

For some reason, this diff completely breaks the linker on iOS.

I tried to look for a fix forward, but unsuccessfully.

I'm reverting this diff to get CI green again, but this requires more investigation.

## Changelog:
[Internal] - Revert D69805065

Reviewed By: sammy-SC, huntie

Differential Revision: D69920338

fbshipit-source-id: 8e1d34b5314d8ead51c127208ae2d2250f7d3724
2025-02-20 06:31:34 -08:00
Fabrizio CucciandFacebook GitHub Bot feb27cbf0f js1 publish react-native 0.79.0-main (#49550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49550

Align remaining packages.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D69916099

fbshipit-source-id: d6f5c19c8b33e91ff0e2adac20cfe625a15e96b5
2025-02-20 06:04:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3ab568d472 Add utility function to validate args (#49522)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49522

While testing the script, sometime I obtained undesired results because I was passing the wrong values for the arguments.

This change add a simple validation function to inform the user when the arguments that are passed are not valid.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D69851416

fbshipit-source-id: c378a3ca5db942cca5178274204a0d01d1eefdf7
2025-02-20 03:28:49 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 07f05cedd5 fix typo in configuration check (#49523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49523

There was a typo when checking the configuration. The default parameter is `all`, not `All`.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D69851429

fbshipit-source-id: 7f16f5f89c90824ceb57f9980bc38a31be33ccfe
2025-02-20 03:28:49 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b8af3ad599 Cleanup old xcframework (#49524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49524

If there is already an XCFramework in the current location. xcodebuild fails to create and override the xcframework.

This change allows us to override an old xcframework and to iterate more quickly.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D69851428

fbshipit-source-id: 723b3035cec008e2bd177da4f960f2bb085ff493
2025-02-20 03:28:49 -08:00
Nicola CortiandFacebook GitHub Bot e49f2d5c50 Enable Gradle Configuration Caching on CI (#49514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49514

This attemps to enable Config Caching on CI. I'm curious to see how much time this is going to save.
There might be some problems with nigthlies so I want to make sure this is running for some days before the branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D69846848

fbshipit-source-id: 0d5c292e65a6107df62f6494a1aae9abd0e8b6cc
2025-02-20 02:42:24 -08:00
Samuel SuslaandFacebook GitHub Bot 9ece93ea67 add unit test for view culling when parent has transform (#49535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49535

changelog: [internal]

Add a unit test to cover scenario where ScrollView's parent has a transform

Reviewed By: NickGerleman

Differential Revision: D69860855

fbshipit-source-id: 1b64665c5b15ad2e5e068d4c6d56f9694ac7cf03
2025-02-20 02:32:50 -08:00
Nick GerlemanandFacebook GitHub Bot c99b71780b Add validation to Fabric parsing for transform and transformOrigin objects (#49546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49546

Right now we rely on the ViewConfig processor to fire an invariant if the values are incorrect. We really don't want to redbox in the future on invalid properties, and this won't be around for the native CSS parsing path.

This code has some problems, like... radian parsing allowing potential out-of-bounds reads, firing a native assert for valid 9 digit matrices, or the layers in conjunction treating `0.5r.degoggos00` as a valid way to say 0.5 radians. Wheeee!

This change mostly just ports over the checks from `processTransform` to validate parameters before we use them, treating the whole transform list as invalid if any part of it is broken. I moved radian and percentage parsing the the CSS data type parsers as well.

I avoided changing props structures again here.

Changelog:

[General][Changed] - Add validation to Fabric parsing for transform options

Reviewed By: javache

Differential Revision: D69823064

fbshipit-source-id: 87c6da448a4b55e0507382b98aabd62ce3e4587f
2025-02-19 19:00:55 -08:00
Nick GerlemanandFacebook GitHub Bot 4631f6b061 Increase number tokenization precision (#49545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49545

During tokenization we use 32 bit integers to store the digits before and after a decimal place.

Code interpolating strings may produce float strings with the part after digits being greater than max int, in which case we encounter integer overflow caught by UBSAN.

I was curious how libc functions for decoding floats handled this, and musl libc goes really out there, storing each intermediate digit in an array of 128 or more digits, and later using `long double`, in a shockingly complicated function. https://github.com/kraj/musl/blob/1880359b54ff7dd9f5016002bfdae4b136007dde/src/internal/floatscan.c#L63

We... probably don't need to go that far, but storing these intermediate digits as doubles should be precise enough and allow large enough values in the vast majority of cases.

Changelog: [Internal]

Reviewed By: sammy-SC, jorge-cab

Differential Revision: D69881560

fbshipit-source-id: b2158ce2c5d85157426cea9850c7f62c2eee5611
2025-02-19 19:00:55 -08:00
Liron YahdavandFacebook GitHub Bot 5e63f34ab0 Throw exception with name of TurboModule instead of deadlock during sync rendering (#49509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49509

Currently if we hit a deadlock in sync rendering due to a TurboModule initialization that requires main queue setup we don't get any information about which TurboModule caused the issue.

To help us know which TurboModules we need to fix, this instead will crash with the name of the TurboModule.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D69805065

fbshipit-source-id: f75df44f9a603a5f53a008382d32b2b5285c1162
2025-02-19 18:45:23 -08:00
Marc RousavyandFacebook GitHub Bot 778382ad3d RNGP - Add option to disable bundle compression (was: Make all React Native apps start 12% faster) (#49449)
Summary:
Okay the title is a bit clickbaity, but this is actually true. (on Android)

We (Janic, Szymon, Ruby and Me) discovered something interesting. React Native uses `mmap` for mapping the JS bundle to RAM, to avoid having to load the entire thing instantly at app startup.
Ruby doubted that this was true - so we investigated.

Apparently on Android, resources are **compressed**. And if the JS bundle is stored compressed, it has to be uncompressed before it can be loaded into RAM, hence not allowing it to be mmapp'ed! (see [`_CompressedAsset::getBuffer`](https://cs.android.com/android/platform/superproject/+/master:frameworks/base/libs/androidfw/Asset.cpp;l=903?q=Asset.cpp))

So with this PR, we now add `.bundle` files to `noCompress` in the react-native gradle plugin, which disables compression for the JS bundle.

We discovered while improving the performance of one of our clients: **Discord**.
In our tests, **this improved the TTI of the Discord app by 400ms!! (or 12%)** 🤯🚀

NOTE: Yes, the .apk will now be bigger. But; Google Play compresses it anyways, so the **download size** of your .apk will likely not increase by much. It will be bigger on disk though.

## Changelog:

[ANDROID] [CHANGED] Add option to disable bundle compression to improve startup time

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

Test Plan:
### 1. Verify compression is disabled

Build two apps, one with this patch and one without. When I did this using the RN community template, the one without this patch was 47,6 MB, and the one with this patch was 48 MB in size. So the .apk got bigger, which is what we expected

### 2. Verify app startup is faster

Use tools like react-native-performance or custom markers to measure TTI. In our tests, we shaved off 400ms from the startup time, which was about 12% of Discord's total TTI. (on a low-end Android device)
In Expensify, we improved the TTI by 14-20% with this change (source: https://github.com/Expensify/App/pull/56930)

Reviewed By: javache, cipolleschi

Differential Revision: D69742221

Pulled By: cortinico

fbshipit-source-id: bd59d77662bd30a3acdbb2e9f8d8f23db922c3f2
2025-02-19 18:42:51 -08:00
Eric RozellandFacebook GitHub Bot 41b597c736 Move U+200E character to first fragment (#49534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49534

Moving the U+200E character ensures that it gets the same font style as other fragments in the LogBox inspector. This solves an issue where the line height differential is causing issues on some out-of-tree platforms (e.g., Windows).

## Changelog

[Internal]

Reviewed By: shwanton

Differential Revision: D69857916

fbshipit-source-id: 5bc70dc0282f3ef9e9b2767ab8094e9923638e99
2025-02-19 17:41:35 -08:00
Nicola CortiandFacebook GitHub Bot fc325cfee8 Remove all the redundant public visibility modifier (#49532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49532

I've done a pass with Android Studio and removed automatically all the `public` modifier
that are not really needed.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D69857731

fbshipit-source-id: 5098a3454a66e5f1eb58ccf07006558cba360066
2025-02-19 17:40:14 -08:00
Nicola CortiandFacebook GitHub Bot fefa17aa37 Sort kotlin modifier to canonical order (#49533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49533

Android Studio is telling us that those modifiers are not sorted according to the 'canonical order'.
This is quite annoying while editing so I'm sorthing them all using the IDE inspection.
We should add a rule inside ktfmt for this, but that's another work.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D69857730

fbshipit-source-id: 3aae3d5b114cf4c629c8320a697d17fff686730b
2025-02-19 17:40:14 -08:00
Shawn DempseyandFacebook GitHub Bot 19c41f1dbd Use apple platform name for macOS instead of hardcoding iOS (#49542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49542

When fusebox loads, we display this static message on apple platforms:
```
Debugger integration: iOS Bridgeless (RCTHost)
```
We are running RN MacOS using the xplat `RCTHost` and want to show the correct platform

[Changelog] [Internal] - Use current apple platform name instead of hardcoding 'iOS'

Reviewed By: robhogan

Differential Revision: D69867335

fbshipit-source-id: 5973882c710447fdb7ef18e82ff304e4cd16a85c
2025-02-19 17:24:17 -08:00
Samuel SuslaandFacebook GitHub Bot 46ce79b08a move RCTInitializeUIKitProxies to RCTFabricSurface init (#49541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49541

changelog: [internal]

`RCTSurfacePresenter` may be initialised from a background thread. This breaks the requirement of `RCTInitializeUIKitProxies`, which must be always called on the main thread.

Differential Revision: D69874923

fbshipit-source-id: 098f543bd3a849ee9ee1b63b567290f67c0109cd
2025-02-19 15:24:41 -08:00
Mateo GuzmánandFacebook GitHub Bot e137a5280f Reland of: Make RCTLog & ExceptionDataHelper internal (#49536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49536

This is a re-land of a previous diff D69836482 which was reverted due to a build failure.

As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [RCTLog](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.RCTLog)
- [ExceptionDataHelper](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.ExceptionDataHelper)

## Changelog:

[INTERNAL] - Make RCTLog & ExceptionDataHelper internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D69863875

Pulled By: cortinico

fbshipit-source-id: 59f0ccbcbeba6e75b776d3bb8fd7c672f1b50994
2025-02-19 15:15:10 -08:00
chrsmysandFacebook GitHub Bot 36f29beac4 Fix force RTL support on new architecture. (#49455)
Summary:
This fixes an issue in Fabric where changing the layout direction and then reloading the JS bundle did not honor the layout direction until the app was restarted on iOS. This now calls  `_updateLayoutContext` whenever RCTSurfaceView is recreated which happens on bundle reload. This is not an issue on the old architecture because the layout direction is determined within the [SurfaceViews](https://github.com/facebook/react-native/blob/acdddef48eb60b002c954d7d2447cb9c2883c8b3/packages/react-native/React/Views/RCTRootShadowView.m#L18) which were recreated on bundle reload.

## Related Issues:
- https://github.com/react-native-community/discussions-and-proposals/issues/847
- https://github.com/facebook/react-native/issues/49451
- https://github.com/facebook/react-native/issues/48311
- https://github.com/facebook/react-native/issues/45661

## How can we take this further?
If we want to make it so that it doesn't require an entire bundle reload for RTL to take effect I believe these are the steps that would need to be taken:
- Make it so [RCTI18nManager](https://github.com/facebook/react-native/blob/acdddef48eb60b002c954d7d2447cb9c2883c8b3/packages/react-native/React/CoreModules/RCTI18nManager.mm#L52) exports isRTL as a method instead of consts
- Send Notification Center notif when RTL is forced on or off
- Listen for that notification RCTSurfaceView and call _updateLayoutContext similar to UIContentSizeCategoryDidChangeNotification.

## Changelog:

[iOS] [FIXED] - Layout direction changes are now honored on bundle reload.

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

Test Plan:
On the new architecture change force the layout direction and reload the bundle:
```
import React, { useCallback } from "react";
import { Button, I18nManager, StyleSheet, Text, View } from "react-native";
import RNRestart from "react-native-restart";

export default function Explore() {
    const onApplyRTL = useCallback(() => {
        if (!I18nManager.isRTL) {
            I18nManager.forceRTL(true);
            RNRestart.restart();
        }
    }, []);

    const onApplyLTR = useCallback(() => {
        if (I18nManager.isRTL) {
            I18nManager.forceRTL(false);
            RNRestart.restart();
        }
    }, []);

    return (
        <View style={styles.area}>
            <Text>Test Block</Text>
            <View style={styles.testBlock}>
                <Text>Leading</Text>
                <Text>Trailing</Text>
            </View>
            <Button title={"Apply RTL"} onPress={onApplyRTL} />
            <Button title={"Apply LTR"} onPress={onApplyLTR} />
        </View>
    );
}

const styles = StyleSheet.create({
    area: {
        marginVertical: 50,
        paddingHorizontal: 24,
    },
    testBlock: {
        paddingVertical: 10,
        flexDirection: "row",
        justifyContent: "space-between",
    },
});

```

https://github.com/user-attachments/assets/0eab0d79-de3f-4eeb-abd0-439ba4fe25c0

Reviewed By: cortinico, cipolleschi

Differential Revision: D69797645

Pulled By: NickGerleman

fbshipit-source-id: 97499621f3dd735d466f5119e0f2a0eccf1c3c05
2025-02-19 14:51:19 -08:00
Samuel SuslaandFacebook GitHub Bot d50a3b4433 do not call RCTUnsafeExecuteOnMainQueueSync with a lock in RCTWindowSafeAreaProxy (#49540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49540

changelog: [internal]

it is dangerous to call RCTUnsafeExecuteOnMainQueueSync while holding a lock. We can avoid that by keeping only the checks into shared state under a lock and rest is without lock.

This also aligns implementation with other proxy objects.

Reviewed By: javache

Differential Revision: D69856171

fbshipit-source-id: 5f7fd1ebeb642796169d77a437fbc215c3c59795
2025-02-19 14:47:18 -08:00
Dark KnightandFacebook GitHub Bot a1952b6fb7 Revert D69836482: Multisect successfully blamed "D69836482: [react-native][PR] Make RCTLog & ExceptionDataHelper internal" for one build failure
Summary:
This diff reverts D69836482
D69836482: [react-native][PR] Make `RCTLog` & `ExceptionDataHelper` internal by cortinico causes the following build failure:

Tests affected:
- [automation_twilight_x86_debug](https://www.internalfb.com/intern/test/562950071241129/)

Here's the Multisect link:
https://www.internalfb.com/multisect/21397772
Here are the tasks that are relevant to this breakage:
T215694436: Some CI signals failing for oculus_twilight

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D69860031

fbshipit-source-id: dedaba77f77467eebad279076add13bfcde45ef0
2025-02-19 11:47:35 -08:00
Mateo GuzmánandFacebook GitHub Bot 0c1e9ea983 Make DefaultDevSupportManagerFactory, InspectorFlags & JSDebuggerWebSocketClient internal (#49506)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [DefaultDevSupportManagerFactory](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.DefaultDevSupportManagerFactory)
- [InspectorFlags](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.InspectorFlags)
- [JSDebuggerWebSocketClient](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.JSDebuggerWebSocketClient)

## Changelog:

[INTERNAL] - Make DefaultDevSupportManagerFactory, InspectorFlags & JSDebuggerWebSocketClient internal

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

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69811993

Pulled By: mdvacca

fbshipit-source-id: fef52de8c9c0d15b8efd3c5dd785be4e045d2d63
2025-02-19 11:32:31 -08:00
Samuel SuslaandFacebook GitHub Bot 470bc40889 remove use of RCTUnsafeExecuteOnMainQueueSync and main thread setup from RCTDeviceInfo (#49478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49478

changelog: [internal]

Move all main thread resources that RCTDeviceInfo needs to RCTKeyWindowValuesProxy class. That way, RCTDeviceInfo does not needs to use RCTUnsafeExecuteOnMainQueueSync and doesn't require main thread setup.

Reviewed By: javache

Differential Revision: D69747829

fbshipit-source-id: e8280d2f50258ee59043b5c3865b8a95496be8b6
2025-02-19 10:29:24 -08:00
Samuel SuslaandFacebook GitHub Bot c5b926b57b move RCTAccessibilityManager away from main thread initialization (#49477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49477

changelog: [internal]

Move all main thread resources from RCTAccessibilityManager to a proxy object: RCTInitialAccessibilityValuesProxy

Reviewed By: javache

Differential Revision: D69747648

fbshipit-source-id: 5ac717b397985545c5ce2cc92ad98d69b95f52ea
2025-02-19 10:29:24 -08:00
Rob HoganandFacebook GitHub Bot cdaa1aa9aa community-cli-plugin: resolve cli-server-api via peer dependency on cli (#49518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49518

`react-native/community-cli-plugin` depends on `createDevServerMiddleware` from `react-native-community/cli-server-api`.

`react-native/community-cli-plugin` currently [declares an optional peer dependency](https://github.com/facebook/react-native/blob/bae895500052bda2f55e1832b0c8a63a1b449de3/packages/community-cli-plugin/package.json#L39-L45) on `react-native-community/cli-server-api`, however because the latter isn't a dependency of `react-native` or the community template, the peer dependency is not available to package managers that enforce isolated node_modules - see https://github.com/facebook/react-native/issues/47309.

Rather than add an unnecessary dependency to the template (like [this](https://github.com/react-native-community/template/pull/105)), my proposal is to switch to a peer dependency on only `react-native-community/cli`, because that *is* a dependency of the community template and therefore will be resolvable.

Because `react-native-community/cli` doesn't re-export `createDevServerMiddleware` from its dependency on `cli-server-api`, we need to resolve the latter through the former. This can be cleaned up once a re-export lands - https://github.com/react-native-community/cli/pull/2605.

Changelog:
[GENERAL][FIXED] Fix registering of `start` and `bundle` commands with community CLI and isolated node_modules.

Reviewed By: huntie

Differential Revision: D69848688

fbshipit-source-id: 009b8ffd43b2ab2d84fcc71e9e48382eb8950bb1
2025-02-19 10:11:03 -08:00
Samuel SuslaandFacebook GitHub Bot 0f8ef32830 initialise RN proxy object in bridge (#49527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49527

changelog: [internal]

fix a deadlock when app that doesn't use bridgeless uses UIKit proxy objects.

Reviewed By: jeffreyporter, Dawn-Top

Differential Revision: D69855097

fbshipit-source-id: a158daa2a6de1a0aebfb9fbf3d758ffa3afec7be
2025-02-19 09:29:26 -08:00
Andrew DatsenkoandFacebook GitHub Bot e85d70c8ac Create a CMake executable target (#49526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49526

Changelog: [Internal]

Introduce a binary tester for Fantom that will be used in runner when ready so OSS can run integration tests.

Here:
- Add BUCK target
- Add CMake target

Reviewed By: cortinico

Differential Revision: D69800975

fbshipit-source-id: 57e135e2a1cbfb88e0141ddc7859b9a29365ee1f
2025-02-19 09:15:07 -08:00
Dawid MałeckiandFacebook GitHub Bot 3f9e474d23 Align Flow to TS types in Modal (#49521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49521

Changelog:
[Internal] - Aligned types of the Modal between Flow and iOS

Reviewed By: huntie

Differential Revision: D69786560

fbshipit-source-id: 3bf0999db5ad57a1b9b9dd95f2b77c994fe3af6e
2025-02-19 09:12:45 -08:00
Vitali ZaidmanandFacebook GitHub Bot 1a9ec07477 warn when user tries to open DevTools, when not in debug mode (#49499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49499

Changelog:
[General][Internal] - warn when user tries to open DevTools, when not in debug mode

Reviewed By: huntie

Differential Revision: D69784836

fbshipit-source-id: aa60762f08f5dea1f91f4fd1ffc86eeb7f94e2fc
2025-02-19 08:52:05 -08:00
Mateo GuzmánandFacebook GitHub Bot 4bafd4734e Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin (#49501)
Summary:
Migrate two more `com.facebook.react.uimanager` interfaces to Kotlin

## Changelog:

[INTERNAL] - Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69836273

Pulled By: cortinico

fbshipit-source-id: cbdddc1ecf432127426fc07a9df6ed824db63e73
2025-02-19 07:30:31 -08:00
Samuel SuslaandFacebook GitHub Bot 236db59a26 Introduce EventBeat::unstable_setInduceCallback to batch sync state updates (#49520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49520

changelog: [internal]

Adds a new callback to EventBeat that is triggered in EventBeat::induce (that is when the UI thread is about to go IDLE). This will make state updates applied synchronously before the OS has a chance to paint but they will be batched. If two state updates happen in single UI tick, the will be executed at the end of UI's run loop.

The state updates are still not batched into a single commit. If two state updates happen on the same component, they are coalesced. If two state updates happen on two different components, they will generate two transactions. This is a follow up optimisation.

This feature is hidden behind `ReactNativeFeatureFlags::enableSynchronousStateUpdates` which is a preexisting feature flag. The feature flag was not rolled out yet and is not being used in any QEs at the moment.

Reviewed By: rubennorte

Differential Revision: D69848997

fbshipit-source-id: 870fd21f1d9d73d84861ddeac95b932a7fe1f5fe
2025-02-19 07:10:22 -08:00
Mateo GuzmánandFacebook GitHub Bot e5f08c7ae0 Make RCTLog & ExceptionDataHelper internal (#49502)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [RCTLog](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.RCTLog)
- [ExceptionDataHelper](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.ExceptionDataHelper)

## Changelog:

[INTERNAL] - Make RCTLog & ExceptionDataHelper internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69836482

Pulled By: cortinico

fbshipit-source-id: 16f37acbd77bf151126bff22a6010201d8174bea
2025-02-19 06:56:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 864d47822f Handle configurations and destinations in prepare-ios-prebuilds (#49498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49498

This change handles the destinations and the configurations parameter when passed to the script.

## Changelog:
[Internal] - Handle `configuration` and `destination` parameters

Reviewed By: cortinico

Differential Revision: D69787469

fbshipit-source-id: 5c4ae766dad84640fbf5340efc296355c4944e1c
2025-02-19 06:19:48 -08:00
Pieter De BaetsandFacebook GitHub Bot 6c8ace9b05 Simplify MapBuffer constructor (#49492)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49492

Was looking at more places we could be using `HybridClassBase`, and figured out how to simplify ReadableMapBuffer constructors to remove the need for explicit soloading.

Changelog: [Android][Removed] `RuntimeExecutor` and `RuntimeScheduler` constructors are now private, `MapBufferSoLoader` was removed as no longer required.

Reviewed By: cortinico

Differential Revision: D69776110

fbshipit-source-id: 11eac4c59897a02283e021ac1457ef8299b6f480
2025-02-19 06:11:31 -08:00
Iwo PlazaandFacebook GitHub Bot ee90f2d97f Prefer common interface files when building the type graph (#49494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49494

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69786939

fbshipit-source-id: 3b0481e83a528afbdf1d29734d2aea9cad740f58
2025-02-19 06:00:03 -08:00
Samuel SuslaandFacebook GitHub Bot f4927fc03c migrate RCTAppState away from main thread initialization (#49476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49476

changelog: [internal]

Introduce RCTInitialAppStateProxy to access app initial state in thread safe way.

Reviewed By: javache

Differential Revision: D69745459

fbshipit-source-id: f88a04774e064bf13904183aa3334f93cbcc5283
2025-02-19 05:37:54 -08:00
Samuel SuslaandFacebook GitHub Bot 0e540298ae remove requirement for main queue setup for RCTPlatform (#49474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49474

changelog: [internal]

Can move setup to the background setup:
1. Use RCTTraitCollectionProxy to access current trait collection to check if force touch is available.
2. UIDevice.currentDevice is thread safe and can be read safely from a background thread.

Reviewed By: rshest

Differential Revision: D69744257

fbshipit-source-id: 8857a827c3d3e03a9b2ced15e6970d728693a043
2025-02-19 05:37:54 -08:00
Samuel SuslaandFacebook GitHub Bot 29114dd914 migrate RCTAppearance away from RCTUnsafeExecuteOnMainQueueSync and main thread setup (#49473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49473

changelog: [internal]

Add RCTTraitCollectionProxy which synchronises access to current trait collection. This way, RCTAppearance does not need main thread setup and RCTUnsafeExecuteOnMainQueueSync

Reviewed By: javache

Differential Revision: D69750211

fbshipit-source-id: 8457904fa1672d4bf811c04ef69969a8f8f4d87f
2025-02-19 05:37:54 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 11377d7cb6 Update changelog for 0.78 (#49469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49469

This PR updates the changelog for 0.78 by combining all the RC into 0.78.0 stable, in preparation of the release in a couple of days.

This also adds categories to the commits and sort them alphabetically.

## Changelog:
[Internal] - Update vchangelog for 0.78

Reviewed By: cortinico, fabriziocucci

Differential Revision: D69745703

fbshipit-source-id: 825190c7a9573939ec7f1e388448142f8a8caf25
2025-02-19 05:22:30 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 601b2ec353 Honor the task provided to prepare-ios-prebuilds (#49497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49497

This change honors the task provided as an argument.

If `all` is passed, we execute all the commands.
If a specific task is passed, we only execute that command.

## Changelog:
[Internal] - Honor the task passed to the preopare-ios-script

Reviewed By: cortinico

Differential Revision: D69787470

fbshipit-source-id: 0dec13ad0b5f2cc23cc72b4a899405ac1acf4f86
2025-02-19 04:59:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ca37f2b20a Add argument parsing and help function to prepare ios build (#49496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49496

This change prepare the argument parsing to the prepare-ios-prebuilds so we can customise the behavior to simplify usage in CI.

It also adds the --help command to provide.

##changelog:
[Internal] - adds the help mfunction and argument parsing

Reviewed By: cortinico

Differential Revision: D69779877

fbshipit-source-id: d66bc19ee556229eb7167f2075b77bacce2ad5c4
2025-02-19 04:59:37 -08:00
Riccardo CipolleschiandFacebook GitHub Bot c0e43edd01 Extracted the dependencies array to separate file (#49495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49495

This change extracts the dependencies array to a separate file. This is helpful because we can use this file as cache-key to determines whether we have to rebuild the artifacts or not.

This file is also bound to grow so it will make the script more manageable.

## Changelog:
[Internal] - Move the dependencies for ios prebuilds on a separate file

Reviewed By: cortinico

Differential Revision: D69779522

fbshipit-source-id: 7ce60e426d428859f6f759d8e7b1ea499c36eff9
2025-02-19 04:59:37 -08:00
Jakub PiaseckiandFacebook GitHub Bot bae8955000 Align press and scroll events with OSS (#49424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49424

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655561

fbshipit-source-id: c36036a2abb43dd75c41582f2a27e7f9d3509044
2025-02-19 03:43:07 -08:00
Samuel SuslaandFacebook GitHub Bot 1705f96322 RCTNetworking does not require main thread setup (#49475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49475

changelog: [internal]

RCTNetworking does not need main thread setup, it doesn't access any main thread only resources.

Reviewed By: rshest

Differential Revision: D69744400

fbshipit-source-id: 25652c28d178a9e26fa0ede9b03fb87072094fb0
2025-02-19 03:37:26 -08:00
Samuel SuslaandFacebook GitHub Bot d69874fa31 reset transformation when crossing ScrollView in Fabric View Culling (#49500)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49500

changelog: [internal]

When crossing ScrollView boundary, cullingContext.transform must be reset to Transform.identity. Views are only culled within scroll view.

Reviewed By: NickGerleman

Differential Revision: D69787820

fbshipit-source-id: 5d502f764a2b1885ee4b49fc0c9ebb9d27de65dd
2025-02-19 03:20:02 -08:00
Nick GerlemanandFacebook GitHub Bot 4fa516987c Filter and Box Shadow Conversion Tests and Fixes (#49418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49418

This adds some missing validation for negative blurs which should be considered parse error. Unit tests added for the forked props parsing code to validate more generally.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69628917

fbshipit-source-id: 1451b53cfa673443f01d38bd0097c4e85c83db8b
2025-02-18 18:56:12 -08:00
Nick GerlemanandFacebook GitHub Bot 05856b4681 Wire up native filter parsing (#49505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49505

I want to go home 😭.

This is not very pretty, while we are both keeping the old path, and trying to keep the props data types undisturbed for now, and support some of the stranger syntax we ended up supporting as inputs to filters.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69562718

fbshipit-source-id: db8ff2c240b66e93a52ce2ac98e4a9ff2e7aeb4b
2025-02-18 18:56:12 -08:00
Nick GerlemanandFacebook GitHub Bot b91565dc5d Add box shadow examples which use objects and PlatformColor (#49504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49504

We didn't have these cases before.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69433955

fbshipit-source-id: 3915b63ec6972412f1882d796ae60035bb5192f3
2025-02-18 18:56:12 -08:00
Nick GerlemanandFacebook GitHub Bot 8a2602fd69 Reland 2: Wire up native box shadow parsing (#49503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49503

Relanding this change, now checking for the existing of FeatureFlags native module before checking it, with the assumption when the native module is unavailable (legacy arch) we will never do native processing, or even use the SVC.

This aligns with the approach taken in `setupTimers` for the event loop, but is probably not the right long term solution for flags API.

This also inlines a couple fixes originally up the stack, of missing propagation of inline state, and missing the gating in ReactNativeStyleAttributes.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69804412

fbshipit-source-id: 1f285994132cff75b6845b64cf26fceae37d4c92
2025-02-18 18:56:12 -08:00
Sam ZhouandFacebook GitHub Bot b53e86b4bd Deploy 0.261.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D69816782

fbshipit-source-id: c4d1e7bff3333fe8075816542d0b316408363f86
2025-02-18 18:11:49 -08:00
David VaccaandFacebook GitHub Bot 3442b3885a Implement getDelegateMethod on ReactPopupMenuManager (#49507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49507

Implement getDelegateMethod on ReactPopupMenuManager

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D69807880

fbshipit-source-id: b0168454b24a1af4e99a46e8c70ebb70162c19d0
2025-02-18 16:43:13 -08:00
Joe VilchesandFacebook GitHub Bot a3b29e1441 Fix inset shadows when blur < spread (#49448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49448

I noticed that when inset shadows have a smaller blur radius than spread its wrong and there is a gap between the edge of the box and the shadow. I think the outer rect is just defined incorrectly and we should be adjusting the paddingBox as opposed to the innerRect. The innerRect is just the padding box insetted by the spread, so that is why we see gaps if blur < spread

Changelog: [Android][Fixed] - Fix inset boxShadow when blur < spread

Reviewed By: jorge-cab

Differential Revision: D69688508

fbshipit-source-id: 911258edd9a8403c70992800c3e1a5ea044e1f3b
2025-02-18 13:11:53 -08:00
Samuel SuslaandFacebook GitHub Bot 7f6fe61299 migrate RCTSafeArea away from RCTUnsafeExecuteOnMainQueueSync (#49440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49440

changelog: [internal]

move away from RCTUnsafeExecuteOnMainQueueSync in RCTSafeArea.

Reviewed By: javache, lenaic

Differential Revision: D69662510

fbshipit-source-id: c68e42d6787b1a60ecba46d774ada40163de83fe
2025-02-18 10:05:42 -08:00
Pieter De BaetsandFacebook GitHub Bot 1954f166c9 Consolidate mode files in xplat/mode/react-native (#49463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49463

We've started accumulating mode-files in many different directories, group them all under xplat/mode/react-native for consistency

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69658995

fbshipit-source-id: 70c842d24886b9b0ef8432d105ca64cac68078db
2025-02-18 09:40:15 -08:00
Dawid MałeckiandFacebook GitHub Bot 8beae3ba52 Align types of the Libraries/PushNotificationIOS between Flow and TS (#49266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49266

Changelog:
[Internal] - Aligned types of the PushNotificationIOS between Flow and TS

Reviewed By: huntie

Differential Revision: D69309391

fbshipit-source-id: 1e99f6aa6805c25db7ede6c65305b309590ebd6a
2025-02-18 09:03:55 -08:00
Nicola CortiandFacebook GitHub Bot e41887e62f Add support for Gradle Configuration caching (#49484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49484

This is the last diff to add support for Gradle Configuration caching.
The last missing part here was the execution of the `config` command during Gradle configuration time.
Using Java processes API is not supported as the correct way to do external commands that are CC-friendly
is through the `.providers.exec` API which I'm using here.

Closes https://github.com/facebook/react-native/issues/45154

Changelog:
[Android] [Added] - Add support for Gradle Configuration caching

Reviewed By: cipolleschi

Differential Revision: D69753889

fbshipit-source-id: af1e844b38444659a908abce4029d43ad899c03d
2025-02-18 08:26:34 -08:00
Nicola CortiandFacebook GitHub Bot db679f7a20 Remove unused Gradle task packageReactNdkLibsForBuck (#49493)
Summary:
This task is unused, so we can safely remove it here.

## Changelog:

[INTERNAL] - Remove unused Gradle task `packageReactNdkLibsForBuck`

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D69781945

Pulled By: cortinico

fbshipit-source-id: cd6487faf1d169f44590a26c18a9f35eef803617
2025-02-18 08:23:59 -08:00
Jakub PiaseckiandFacebook GitHub Bot ce84922236 Convert DevMenu to use exports syntax (#49491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49491

Changelog: [General][Breaking] Deep imports to modules inside `Libraries/DevMenu` using `require` may need to be appended with `.default`

Reviewed By: cortinico

Differential Revision: D69778671

fbshipit-source-id: 19362fbb003e53609881fc19e8d2cb96677b3006
2025-02-18 08:18:58 -08:00
Mateo GuzmánandFacebook GitHub Bot 7f1edbdcb5 Migrate ReactClippingViewGroup to Kotlin (#49413)
Summary:
Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69750532

Pulled By: cortinico

fbshipit-source-id: 50ec87a71b3bd523e1a9518b8bd683a027a4b422
2025-02-18 07:57:24 -08:00
Iwo PlazaandFacebook GitHub Bot e4e03bd909 Trace the import path that leads to an untranslatable file (#49480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49480

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69752685

fbshipit-source-id: 94f70eeaec35c864c15b463f3afce929765f2c40
2025-02-18 07:37:57 -08:00
Jakub PiaseckiandFacebook GitHub Bot ebbb241bf8 Align layout event names with OSS (#49423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49423

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655570

fbshipit-source-id: bd9b3dbc70b93c5be49e6a2b1b0487d11bf5b3f1
2025-02-18 07:26:13 -08:00
Samuel SuslaandFacebook GitHub Bot b586f35292 ship fix for view commands race everywhere (#49465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49465

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69744911

fbshipit-source-id: 27e24bb8f16ed4dd3f72bb9125332d208f39ad67
2025-02-18 05:22:17 -08:00
Zhi ZhouandFacebook GitHub Bot 789ed7d5ad fix: iOS app crash caused by the request operation canceling (#48350)
Summary:
Currently we observed many iOS app crashes caused by the `[RCTFileRequestHanlder invalidate]` method, just as the below screenshot.
<img width="1008" alt="image" src="https://github.com/user-attachments/assets/d2d6714f-63d9-40ae-8de5-742cfe718a36" />

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method

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

Test Plan: I am not able to reproduce this issue locally either, so the changes in this PR are totally from my inference, I am not sure if it really makes sense, so please help take a deeper look, thanks.

Reviewed By: javache

Differential Revision: D69751695

Pulled By: cipolleschi

fbshipit-source-id: aa4654a30f5dfac99b72ed1bda0dae1e0dc881c9
2025-02-18 05:03:27 -08:00
Samuel SuslaandFacebook GitHub Bot 944d8e6f3c remove redundant main thread dispatch in RCTDeviceInfo (#49479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49479

changelog: [internal]

Notification UIApplicationDidBecomeActiveNotification is always delivered on the main thread, no need for dispatch.

Reviewed By: javache

Differential Revision: D69750103

fbshipit-source-id: 070fa7f95d8ecddff5d56ba317c8ed4f0ad880f8
2025-02-18 05:01:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 0c4855afae Migrate RuntimeScheduler & RuntimeExecutor to Kotlin (#49485)
Summary:
Converting to Kotlin two classes from `com.facebook.react.bridge`

## Changelog:

[INTERNAL] - Migrate RuntimeScheduler & RuntimeExecutor to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: sammy-SC

Differential Revision: D69775060

Pulled By: javache

fbshipit-source-id: 93f352be8b56876f99f86119e4c6a9636017a581
2025-02-18 04:00:05 -08:00
Dawid MałeckiandFacebook GitHub Bot 71bd096136 Add PermissionsAndroid to buildTypes and align Flow with TS types (#49352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49352

Changelog:
[Internal] - Added PermissionsAndroid to buildTypes and align Flow with TS types.

Reviewed By: huntie

Differential Revision: D69464744

fbshipit-source-id: 31591b2069d25a20bff569b296dcbda88d9f2148
2025-02-18 01:20:26 -08:00
Jakub PiaseckiandFacebook GitHub Bot 91edb9c184 Align LayoutAnimation types with OSS (#49467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49467

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69745571

fbshipit-source-id: 4c27b6c22126a2c8b0965e1a88f9dc310e5ff77c
2025-02-18 01:10:02 -08:00
Jakub PiaseckiandFacebook GitHub Bot 721c7fafa4 Add ReactNative to the list of translated modules (#49472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49472

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69748223

fbshipit-source-id: 97aed0dfc25de9117db3c359970dd94899dd1417
2025-02-18 00:41:51 -08:00
Alex HuntandFacebook GitHub Bot cda2d11c16 Split index.js types into index.js.flow (#49470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49470

Adds a `packages/react-native/index.js.flow` file.

**Motivation**

This is on the critical path to generating TypeScript types, and a full API snapshot, from `index.js.flow`.

As we iterate, this new file will move to closely matching `types/index.d.ts` by adding type exports (missing today) — giving us an equivalent public API in both languages.

**Motivation for this pattern**

Having a type index file:

- Will become the entry point for `yarn build-types`.
- Enables us to bypass the `module.exports` pattern in `index.js` without a runtime breaking change.
    - This pattern is preferable because:
        - 1/ Aligns with existing manual TypeScript definitions (i.e. these are **already restricted** to `import` syntax in user code)
        - 2/ Allows doc comments on original types to propagate to IDEs/users.

**Implementation notes**

NOTE: This diff has **no effect** on compiled code at runtime, and **no effect** on the current manual TypeScript API of `react-native`. It only has an effect on Flow usage in fbsource — most of which are deep type imports today.

- Exports are grouped and sorted identically to each pre-existing getter in `index.js`.

Changelog: [Internal] - Redefine root `react-native` type exports, affecting Flow usages only

Reviewed By: rubennorte

Differential Revision: D69659837

fbshipit-source-id: c65e30d1ac5c4f322cfde9335dbee80a8c9efda8
2025-02-17 13:57:48 -08:00
Rubén NorteandFacebook GitHub Bot e57cd0916c ] Fix native module check when not using batched bridge (#49483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49483

Changelog: [internal]

Reviewed By: fabriziocucci

Differential Revision: D69753755

fbshipit-source-id: fe267ed60b5f7d6baac7dee5d7be0f733b34e9e9
2025-02-17 12:49:32 -08:00
Sunny LuoandFacebook GitHub Bot 3a4798cc30 fix: Inconsistency SVG Handling between bundle command and Image.resolveAssetSource (#49452)
Summary:
ref: https://github.com/facebook/react-native/pull/28266

Currently, SVG is not recognized as an image in the CLI bundle command, as defined in [assetPathUtils.js](https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/bundle/assetPathUtils.js#L43-L50) . This is the correct behavior, as it ensures that SVG files are copied to the raw folder for Android resources.

However, there is an inconsistency with Image.resolveAssetSource, which does not follow the same classification. Instead, it resolves SVG assets to the drawable folder, leading to blank svg rendering errors in some scenario (codepush).

## Changelog

[Android][Fixed] - getAndroidResourceFolderName() should return raw folder for svg file

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

Test Plan:
1. Use svg file this way `<LocalSvg asset={require('./react-logo.svg')} />`
2. Use `react-native bundle` command to make a bundle and sideload that bundle from sdcard. The svg file should render correctly.

Reviewed By: cortinico

Differential Revision: D69750779

Pulled By: Abbondanzo

fbshipit-source-id: 3af8d4a5da07213cdbb968b070d2507ed897d194
2025-02-17 11:04:39 -08:00
Ruslan LesiutinandFacebook GitHub Bot 13dae0601d Record React Native process (#49370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49370

# Changelog: [Internal]

When we start tracing, we will record metadata event for current process.

We will base it off the assumption that the thread where we handle `Tracing.start` event is the main one.

We can't register the main thread yet:
1. We can't assume that CDP messages are handled on it - this is not the case for Windows and in a long term Inspector will be moved to its own thread
2. We don't have any similar mechanism as Runtime Executor, but for Main thread. This will require Host providing an executor for it.

I've validated at the top of the stack that not registering the main thread should not affect how trace is displayed in CDT.

Reviewed By: rozele

Differential Revision: D69465926

fbshipit-source-id: 103de1da9d00564bf201456ad04a465387c1d542
2025-02-17 09:34:33 -08:00
Ruslan LesiutinandFacebook GitHub Bot acebebfd21 Expose API for registering processes and threads (#49083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49083

# Changelog: [Internal]

> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.

Added 2 new public methods to `PerformanceTracer` instance for registering metadata Trace Events for processes and threads.

Reviewed By: huntie

Differential Revision: D68439733

fbshipit-source-id: dd9f0e72e2414b8c665c57a542cbbfe7df34a516
2025-02-17 09:34:33 -08:00
Ruslan LesiutinandFacebook GitHub Bot 71f0b4d5a0 Use real process id and thread ids (#49309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49309

# Changelog: [Internal]

Use newly added module to get real OS-level process and thread ids.

We will keep process id on an instance, because I don't think it could change over time? For thread id, we will get it at the time of event registration.

Reviewed By: rozele

Differential Revision: D69316094

fbshipit-source-id: e12f2ea147ee8bf5a0a13ef293b8d85a0b64fc02
2025-02-17 09:34:33 -08:00
Ruslan LesiutinandFacebook GitHub Bot 994d7cc2f7 Define OSCompat module (#49302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49302

# Changelog: [Internal]

Added OS-agnostic module that will implement 2 basic capabilities:
- Getting current process id
- Getting current thread id

Reviewed By: javache

Differential Revision: D69316093

fbshipit-source-id: 114d235f1137eaf9c41d95df76f15532766d1bc8
2025-02-17 09:34:33 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 74de9526ab chore(iOS): deprecate RCTAppDelegate (#49078)
Summary:
Recently, I've introduced `RCTReactNativeFactory` in this PR: https://github.com/facebook/react-native/issues/46298, which is a good successor for `RCTAppDelegate`.

### Why?

`RCTAppDelegate` introduced strong coupling between React Native and AppDelegate pattern. From iOS 13+ there is a newer equivalent (Scene Delegate) which is not possible to achieve with current architecture. The proposed solution involves migration to a `RCTReactNativeFactory` a class that encapsulates initialization logic of React Native.

This migration will make brownfield initialization easier by making it more flexible and simpler to integrate into already established apps.

### Deprecation plan

The plan I've discussed with cipolleschi involves:

- Deprecation of `RCTAppDelegate` in 0.79 (current main)
- Migration off `RCTAppDelegate` to SceneDelegate + `RCTReactNativeFactory` in 0.80

## Changelog:

[IOS] [DEPRECATED] - deprecate RCTAppDelegate

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

Test Plan: Not needed

Reviewed By: cortinico

Differential Revision: D69061022

Pulled By: cipolleschi

fbshipit-source-id: b02a0ff3f26be9320da749f38c9cf083804f9f30
2025-02-17 09:12:17 -08:00
Kudo ChienandFacebook GitHub Bot cdc166709d Allow passing custom JSRuntimeFactory to DefaultReactHost (#49366)
Summary:
an effort of lean core for jsc: https://github.com/Kudo/discussions-and-proposals/blob/%40kudo/lean-core-jsc/proposals/0836-lean-core-jsc.md

## Changelog:

[ANDROID] [CHANGED] - Allow passing custom JSRuntimeFactory to DefaultReactHost

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

Test Plan:
- ci passed
- test from https://github.com/react-native-community/javascriptcore/pull/4

Reviewed By: cipolleschi

Differential Revision: D69656837

Pulled By: cortinico

fbshipit-source-id: ba8bf744c920a70c10fe5f6743f8dd182c88c4d4
2025-02-17 07:30:45 -08:00
Vitali ZaidmanandFacebook GitHub Bot 63080727a7 minor variable names and console message contents and timing refactors (#49464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49464

Changelog:
[General][Internal] - minor variable names and console message contents and timing refactors

Reviewed By: hoxyq

Differential Revision: D69667948

fbshipit-source-id: 2305b873c85cd193cbbb63b03819a8d360e11880
2025-02-17 07:01:33 -08:00
Nicola CortiandFacebook GitHub Bot bbfccd088b RNGP - Convert if to when in getPackagingOptionsForVariant (#49426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49426

This is a nit, but I'm following up on a review comment that was left behind.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69656370

fbshipit-source-id: 76de4d77d9993bd9a35d7df019a6cebcce13d632
2025-02-17 06:51:50 -08:00
Samuel SuslaandFacebook GitHub Bot 49b7ce0856 delete RCTUIUtils (#49453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49453

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69716706

fbshipit-source-id: 46e786de85fbee142855384e2338529de6c8a644
2025-02-17 06:40:36 -08:00
Kudo ChienandFacebook GitHub Bot 176bed79b4 decouple jsc when USE_THIRD_PARTY_JSC=1 on ios (#49371)
Summary:
an effort of lean core for jsc: https://github.com/Kudo/discussions-and-proposals/blob/%40kudo/lean-core-jsc/proposals/0836-lean-core-jsc.md. this pr tries to decouple all jsc code when `USE_THIRD_PARTY_JSC=1` on ios

this pr includes these changes:
- exclude `React-jsc` pod and pod dependency when `USE_THIRD_PARTY_JSC=1`
- in objcpp code, remove `JSCExecutorFactory` / `RCTJscInstance` references when `USE_THIRD_PARTY_JSC=1`. it throws c++ errors like `No JSRuntimeFactory specified.` when no engine is specified (USE_HERMES=0 && USE_THIRD_PARTY_JSC=1). people need to override delegate methods to specify a JSRuntimeFactory.

## Changelog:

[IOS] [CHANGED] - Decouple JSC when `USE_THIRD_PARTY_JSC=1`

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

Test Plan:
- ci passed
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=1 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 USE_FRAMEWORKS=dynamic bundle exec pod install`
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=0 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 USE_FRAMEWORKS=dynamic bundle exec pod install`
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=0 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 bundle exec pod install`

Reviewed By: cortinico

Differential Revision: D69662457

Pulled By: cipolleschi

fbshipit-source-id: b272f46dde896d0981cfca75c9bfcf6775507307
2025-02-17 06:39:09 -08:00
Alex HuntandFacebook GitHub Bot 7368265107 Remove unstable_enableLogBox (#49427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49427

Also refine lint/`$FlowFixMe`s in `index.js`.

Changelog:
[General][Breaking] Remove deprecated `unstable_enableLogBox` function. LogBox is enabled by default.

Reviewed By: cortinico

Differential Revision: D69656713

fbshipit-source-id: 21ce775c84e17da036583f099a17f6524f9b9bf1
2025-02-17 05:48:06 -08:00
Alex HuntandFacebook GitHub Bot f940be1caa Remove index.js.flow shim from Node packages (#49461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49461

Flow now supports Package Exports 🎉. This means we can delete the compatiblity pattern in each of our build-enabled Node.js packages.

This simplifies the internal package structure needed to support Flow while developing from source in the monorepo — no prod impact.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D69741143

fbshipit-source-id: 070715cb6beb00eb393186dbf95856ceb87fabef
2025-02-17 05:44:22 -08:00
Mateo GuzmánandFacebook GitHub Bot d41f56176c Make ReactOverflowViewWithInset & NativeKind internal (#49456)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [NativeKind](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+com.facebook.react.uimanager.NativeKind)
- [ReactOverflowViewWithInset](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+com.facebook.react.uimanager.ReactOverflowViewWithInset&p=1)

## Changelog:

[INTERNAL] - Make ReactOverflowViewWithInset & NativeKind internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cipolleschi

Differential Revision: D69736740

Pulled By: cortinico

fbshipit-source-id: 493cd3c10c0a99126b0e9b5536468977bbe03ecc
2025-02-17 04:37:00 -08:00
Vitali ZaidmanandFacebook GitHub Bot 502033337e keep heartbeat between inspector proxy and debugger going even if not idle (#49441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49441

Changelog:
[General][Internal] - keep heartbeat between inspector proxy and debugger going even if not idle

When heartbeat was only used to keep the connection alive and to detect debugger timeouts, it was enough to send a ping every time the connection was idle for 10 seconds.

Now, when we use the heartbeat as a way to track how good is the round trip time between the inspector proxy and the debugger, we would like to make this tracking more reliable by sending a ping 10 seconds after each pong, even if the connection is not idle.

It also simplifies the code and makes it more clear by removing the confusing `shouldSetTerminateTimeout` variable.

Reviewed By: hoxyq

Differential Revision: D69665738

fbshipit-source-id: c8175b54d2b3df32ee60b316ec7bcf7bc0f0a1ee
2025-02-17 04:29:33 -08:00
zhongwuzwandFacebook GitHub Bot 16a476c0ee Fabric: Fix over reporting trait changes (#49431)
Summary:
Fixes https://github.com/facebook/react-native/issues/49330. We can keep the same logic as paper arch , please see https://github.com/facebook/react-native/pull/39439.

## Changelog:

[IOS] [FIXED] - Fabric: Fix over reporting trait changes

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

Test Plan: Repro in https://github.com/facebook/react-native/issues/49330.

Reviewed By: rshest

Differential Revision: D69740128

Pulled By: javache

fbshipit-source-id: 2946df68ab7eb88809c21dfcf33ce23f4cd6cb41
2025-02-17 04:19:28 -08:00
Mateo GuzmánandFacebook GitHub Bot e065411c91 Remove com.facebook.react.modules.network.TLSSocketFactory class (#49457)
Summary:
As part of the initiative to reduce the public API surface, I found that this class is not used in the codebase and can be removed.

[GH search for TLSSocketFactory](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+com.facebook.react.modules.network.TLSSocketFactory) – this class has some OSS usages, but all the ones I found are from old/non-active repos so that's why I think it is safe to remove but should be marked as [BREAKING] at the same time.

## Changelog:

[ANDROID] [BREAKING] - Remove com.facebook.react.modules.network.TLSSocketFactory class

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

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69736673

Pulled By: cortinico

fbshipit-source-id: 1e7abe289cd3894eff5967ae224c3fb8d0501f1a
2025-02-17 03:47:28 -08:00
Nicola CortiandFacebook GitHub Bot 43cffb96db Gradle Configuration Cache - Round 3 (#49439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49439

This is the next part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).

Here I'm removing the `onlyIf` lambdas to make some tasks CC friendly.

The problem is that some `onlyIf` lambdas can't easily be serialized. Here I'm cleaning up
the problematic one to move the condition checks at execution time

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69664732

fbshipit-source-id: a457b2fae8114568ec4e04d772c9944022b1e1a5
2025-02-17 03:35:43 -08:00
Nicola CortiandFacebook GitHub Bot 0014265795 Gradle Configuration Cache - Round 2 (#49438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49438

This is the second part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).

Here I'm making the exec tasks CC friendly.

The problem is that previously we were using explicit streams which are not CC friendly
for stderr/stdout. The solution is to create a custom task and handle files as input
properties.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69662246

fbshipit-source-id: ad7e82e52b12d508ee15b68408882fdc3516d287
2025-02-17 03:35:43 -08:00
Nicola CortiandFacebook GitHub Bot e8b7772dc9 Gradle Configuration Cache - Round 1 (#49421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49421

This is a first part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).

Here I'm making all those tasks `prepare*` CC friendly.

Those tasks were not CC friendly as they were referencing an external variable inside their body.
We don't need to know the library version, we can just substring after the first folder
and the tasks will behave as before.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69655168

fbshipit-source-id: 801d7817c7e2d7380342f175565cc9b1ff30c5d0
2025-02-17 03:35:43 -08:00
Jakub PiaseckiandFacebook GitHub Bot f15f618503 Sort entry points, add clipboard and AccessibilityInfo (#49458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49458

Changelog: [Internal]

Sorts the entry points in the TS generator script and adds `Clipboard` and `AccessibilityInfo` which, as far as I can see, require no changes for their types to align with OSS.

Reviewed By: huntie

Differential Revision: D69663092

fbshipit-source-id: cfdb9ab5c07105497a1cdf4ebdc8de1e34b510bd
2025-02-17 02:59:58 -08:00
shubhamguptadream11andFacebook GitHub Bot dc02c53c16 fix: cron timing updated and action upgrade (#49407)
Summary:
Problem: Duplicate issues were notified on discord channel in issue triaging section.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Changed cron timings to run at fix schedule and upgraded action for better debugging

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Changed cron timings to run at fix schedule and upgraded action for better debugging

Root cause:
- The cron job (cron: "0 /6 * *") is expected to run every 6 hours.
- Expected runs: 5:54 AM → 11:54 AM → 5:54 PM.
- However, the second run happened earlier at 11:37 AM instead of 11:54 AM.
- This caused duplicate pings for issues created around 5:42:24 AM.

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

Test Plan: Tested action locally

Reviewed By: cortinico, NickGerleman

Differential Revision: D69667174

Pulled By: cipolleschi

fbshipit-source-id: 3dcadc25783335c32cba8acdda26e1c755294629
2025-02-17 02:12:49 -08:00
Richard BarnesandFacebook GitHub Bot acdddef48e Enable -Wunused-variable in js/PACKAGE (#49454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49454

This diff enables compilation warning flags for the directory in question. Further details are in [this workplace post](https://fb.workplace.com/permalink.php?story_fbid=pfbid02XaWNiCVk69r1ghfvDVpujB8Hr9Y61uDvNakxiZFa2jwiPHscVdEQwCBHrmWZSyMRl&id=100051201402394).

This is a low-risk diff. There are **no run-time effects** and the diff has already been observed to compile locally. **If the code compiles, it work; test errors are spurious.**

Differential Revision: D68513114

fbshipit-source-id: 219e2b9f2961da76cec4d08cc9f77787e08a0a1e
2025-02-16 10:16:22 -08:00
Christoph PurrerandFacebook GitHub Bot 1498566c23 Align logic in BaseTextInputShadowNode to determine updateStateIfNeeded with AndroidTextInputShadowNode (#48585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48585

[Changelog] [Internal] - Align logic in BaseTextInputShadowNode to determine updateStateIfNeeded with AndroidTextInputShadowNode

As a preparation for https://github.com/facebook/react-native/pull/48165 this aligns the implementation of those 2 methods

Reviewed By: javache

Differential Revision: D68004755

fbshipit-source-id: 519247de0d081f37b5ef8ad6093b43d2c735a50e
2025-02-14 20:37:48 -08:00
Joe VilchesandFacebook GitHub Bot 103f8b3885 Fix bug where we can crash with small blurRadius
Summary:
An internal crash report notified us that we were getting an `IllegalArgumentException` in Android's `BlurMaskFilter` used in Box Shadows. The only requirement for the arguments there are that the blur radius is positive. We ensure that, but pass to `sigmaToRadius` afterwards, which does NOT ensure that. This updates that conversion so that

* We will never return negative numbers, regardless of what `PixelUtil.toDIPFromPixel` is doing
* Small enough numbers ( < 0.5) will just go through as 0.0, which is what Android does in https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/utils/Blur.cpp;l=34
* Ensure shadows check that we have a POSITIVE blur radius AFTER conversion. sigmaToRadius can still return 0 which with also throw, so gotta make sure we change our checks. Filter blurs and dropShadow should be ok, renderEffect does not mention anything about being > 0 in the docs.

Changelog: [Android] [Fixed] - Fix issue where boxShadow crashes with small blur radius

Facebook
Post alerting us of this: https://fb.workplace.com/groups/rn.panelapps/permalink/1136446121310146/

Reviewed By: NickGerleman

Differential Revision: D69683031

fbshipit-source-id: 92f0938fea65e1af280bdb12b6c3d2b9014e89c0
2025-02-14 17:44:06 -08:00
David VaccaandFacebook GitHub Bot cf81abc45e Mark LayoutAnimations classes with @LegacyArchitecture (#49445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49445

This diff marks a subset of LayoutAnimations classes with LegacyArchitecture, since these classes should not be called, loaded nor included in apk that are running in new archtictecture by default

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D69674674

fbshipit-source-id: 84c71c7491064abf8d70f52b14ddb81bd0515227
2025-02-14 14:53:25 -08:00
David VaccaandFacebook GitHub Bot 78744d4a85 Remove internal packages from public API (#49444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49444

Remove internal packages from public API

changelog: [internal] internal

Reviewed By: arushikesarwani94, alanleedev

Differential Revision: D69675450

fbshipit-source-id: 392b9658e2ae44a2df6e39be384b6b820d48f110
2025-02-14 14:53:25 -08:00
David VaccaandFacebook GitHub Bot 3673725560 Introduce internal @LegacyArchitecture annotation (#49443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49443

This diff introduces an internal annotation called LegacyArchitecture that will be used to document what classes are part of Legacy or new architecture

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D69538444

fbshipit-source-id: 5037ba03cd3b1675544f432c3981503c28606f19
2025-02-14 14:53:25 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 11e53c0369 Setup Package.swift to consume the binaries (#49435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49435

This change adds a Package.swift file that allows to consume the binary from a local path.

As soon as we publish this on Maven, we will update the path to the url.

## Changelog:
[Internal] - Add the Package.swift file to consume the binary

Reviewed By: cortinico

Differential Revision: D69660943

fbshipit-source-id: c76ff3272d106236b6cf713b7e054070a3d45176
2025-02-14 10:20:10 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 69a4d32028 Add function to package the xcframework (#49434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49434

This change adds a function to create the xcframework sarting from the various .framework's slice built before.

## Changelog:
[Internal] - Add function to create the xcframework

Reviewed By: cortinico

Differential Revision: D69660662

fbshipit-source-id: f58034c75cce3d242910d0ec1512be28059771ca
2025-02-14 10:20:10 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f05ebd5d9d Add logic to copy headers to .framework (#49433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49433

This change adds the logic to copy the Headers files from the dependency folder to the generated frameworks folder.

There is a slight possibility that this function will be implemented by the Swift PM build system, as I open [this question](https://forums.swift.org/t/xcodebuild-does-not-generate-headers-if-the-source-is-swift-pm/77856) on the Swift forums.

In that case, we would be able to drop this.

## Changelog:
[Internal] - Add function to copy headers over to the .frameworks

Reviewed By: cortinico

Differential Revision: D69656046

fbshipit-source-id: e9d4f0f53ea57bc0df86fc9194cdf9fc1f372730
2025-02-14 10:20:10 -08:00
Vitali ZaidmanandFacebook GitHub Bot 84f3cf95ea add event on debugger heartbeat and timeout (#49437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49437

* Log every heartbeat with the same sampling as CDP commands (`debugger_heartbeat`)
* Log abandoned connections due to heartbeat timeout (`debugger_timeout`)

Changelog:
[General][Added] - add inspector proxy events for debugger heartbeat (sampled) and abandoned connections

Reviewed By: robhogan

Differential Revision: D69603217

fbshipit-source-id: f40721f5dc0cc0c33e71a0d29aa50ccf4e7fee3f
2025-02-14 08:42:39 -08:00
Jakub PiaseckiandFacebook GitHub Bot 0aa89e9f1c Align View prop types with OSS (#49430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49430

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69658857

fbshipit-source-id: 55bb080f3197a7838e96e0e2cc488064881094c4
2025-02-14 08:22:51 -08:00
Mateo GuzmánandFacebook GitHub Bot deafa72682 Kotlinify ReactZIndexedViewGroup & ReactOverflowViewWithInset (#49384)
Summary:
Kotlinify 2 of the com.facebook.react.uimanager interfaces.

## Changelog:

[INTERNAL] - Kotlinify ReactZIndexedViewGroup & ReactOverflowViewWithInset

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69600758

Pulled By: cortinico

fbshipit-source-id: e88d292a94c9676789da2f96b1395694e82386ee
2025-02-14 07:29:25 -08:00
Mateo GuzmánandFacebook GitHub Bot f58d931a32 Make com.facebook.react.views.debuggingoverlay classes internal (#49341)
Summary:
As part of the initiative to reduce the public API surface, this package can be internalized. I've checked there are no relevant OSS usages:

- [DebuggingOverlay](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.debuggingoverlay.DebuggingOverlay)
- [DebuggingOverlayManager](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.debuggingoverlay.DebuggingOverlayManager)
- [TraceUpdate](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.debuggingoverlay.TraceUpdate)

## Changelog:

[INTERNAL] - Make com.facebook.react.views.debuggingoverlay classes internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69520424

Pulled By: cortinico

fbshipit-source-id: 55495329b46b7b28010ea3dcee05a5d8b10fa042
2025-02-14 07:24:32 -08:00
Vitali ZaidmanandFacebook GitHub Bot 29419ce8f0 add logs for inspector proxy connectivity (#49432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49432

Changelog:
[General][Added] - add inspector proxy info logs in regards to CDP connection to device and DevTools

Reviewed By: robhogan

Differential Revision: D69598477

fbshipit-source-id: 6efe7be886501463acbeea1c97ec84064cd84878
2025-02-14 07:19:07 -08:00
Dawid MałeckiandFacebook GitHub Bot 893d1c5fed Add I18nManager and Vibration to buildTypes and align Flow with TS types (#49420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49420

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D69460878

fbshipit-source-id: 09cc702892ed93b6d413e1700e02151aa600bd18
2025-02-14 05:45:28 -08:00
Samuel SuslaandFacebook GitHub Bot b29232d75e add unit tests to AnimatedValue to cover native node subscriptions (#48724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48724

changelog: [internal]

A change in D68154908 caused issues where AnimatedValue would oversubscribe to native module, bring apps to halt.

This is unit test to prevent that.

Reviewed By: yungsters

Differential Revision: D68265033

fbshipit-source-id: 60cc93a619a5c654dc1bf77b00b2d9be2c482894
2025-02-14 05:30:54 -08:00
Iwo PlazaandFacebook GitHub Bot fc6ca26d3f Migrate Utilities/dismissKeyboard.js, Utilities/GlobalPerformanceLogger.js & Utilities/SceneTracker.js to use export syntax (#49402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49402

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` and `Utilities/SceneTracker.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` or `Utilities/SceneTracker.js` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69599636

fbshipit-source-id: 0c450996f908d8139dd0c48677f58e07243d6150
2025-02-14 05:19:32 -08:00
Tommy NguyenandFacebook GitHub Bot a672a4d007 fix: fix @react-native-community/cli not being found in pnpm setups (#47304)
Summary:
Fix `react-native-community/cli` not being found in pnpm setups

## Changelog:

[GENERAL] [FIXED] - Fix `react-native-community/cli` not being found in pnpm setups

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

Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Run `yarn react-native config`

Reviewed By: cortinico

Differential Revision: D65209065

Pulled By: robhogan

fbshipit-source-id: 2ceb73ad140b4afe193e879779c2d8a4b9adf3fc
2025-02-14 04:56:55 -08:00
Iwo PlazaandFacebook GitHub Bot ae1a33875e Re-include ActionSheetIOS and Share in automatic type def generation (#49411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49411

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69606078

fbshipit-source-id: e5fa3b6a50a6f53436cc7429f224c9f8353d6c8c
2025-02-14 04:56:00 -08:00
Kudo ChienandFacebook GitHub Bot 66032f22b8 pull out jsctooling when useThirdPartyJSC is true (#49365)
Summary:
an effort of lean core for jsc: https://github.com/Kudo/discussions-and-proposals/blob/%40kudo/lean-core-jsc/proposals/0836-lean-core-jsc.md

## Changelog:

[ANDROID] [CHANGED] - exclude `jsctooling` when `useThirdPartyJSC` gradle property is true

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

Test Plan:
- ci passed
- test from https://github.com/react-native-community/javascriptcore/pull/4

Reviewed By: cipolleschi

Differential Revision: D69654289

Pulled By: cortinico

fbshipit-source-id: 148e07c7114dde05c2014522f9c56119f7f6f0ce
2025-02-14 03:52:30 -08:00
Jakub PiaseckiandFacebook GitHub Bot 7295a0b9df Align Blob types with OSS (#49390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49390

Na
Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69586908

fbshipit-source-id: 017c427f381e075e4f6a440ab30ae0df79573793
2025-02-14 03:18:48 -08:00
Nicola CortiandFacebook GitHub Bot e78a6d844c RNGP - Do not access .project inside GenerateCodegenArtifactsTask (#49400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49400

We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.

This fixes it for the `GenerateCodegenArtifactsTask` task.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69592464

fbshipit-source-id: 72bab3f29299313875f2e7abd1b701c9d74bd2a1
2025-02-14 02:56:32 -08:00
Nicola CortiandFacebook GitHub Bot 0ce56ad953 RNGP - Do not access .project inside GenerateCodegenSchemaTask (#49399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49399

We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.

This fixes it for the `GenerateCodegenSchemaTask` task.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69592463

fbshipit-source-id: 56e78b1bdc113ae402cc90960faa05cd73d5b97d
2025-02-14 02:56:32 -08:00
Nicola CortiandFacebook GitHub Bot 0dd901701a RNGP - Do not access .project inside BuildCodegenCLITask (#49398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49398

We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.

This fixes it for the `BuildCodegenCLITask` task.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69592465

fbshipit-source-id: fc69896b61968ace7b7762f873cfa7eaa50c8b17
2025-02-14 02:56:32 -08:00
David VaccaandFacebook GitHub Bot 8c80087c3e Create fantom benchmarking test to verify impact of props parsing (#49417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49417

In this diff I'm introducing a fantom benchmarking test to verify impact of props parsing in Fabric (testing for 100, 1000 and 1500 nested views)

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D69624243

fbshipit-source-id: fe71668fe97558d2b6072fe49c9910cb978f7f78
2025-02-13 21:30:40 -08:00
David VaccaandFacebook GitHub Bot b3c41cef98 EZ refactor in ViewManager (#49415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49415

Refactoring NAME -> TAG for consistency with other classes

changelog: [internal] internal

Reviewed By: Abbondanzo

Differential Revision: D69622546

fbshipit-source-id: 314db29ddfdbbd7fc614b355b9b18c0a8afe31df
2025-02-13 18:27:59 -08:00
Sam ZhouandFacebook GitHub Bot b45851aecf Deploy 0.261.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D69622197

fbshipit-source-id: 3ddf9f8cb015825ea76be39a28525b75bbc8c03f
2025-02-13 18:13:15 -08:00
Christoph PurrerandFacebook GitHub Bot 629c289d74 Add missing break; in RCTEventDispatcher.mm (#49416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49416

[Changelog] [Internal] - Add missing break; in RCTEventDispatcher.mm

This fixes a compile error if a stricter warning setting is used as otherwise compilation fails with
```
react-native-github/packages/react-native/React/CoreModules/RCTEventDispatcher.mm:110:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
  110 |         default:
      |         ^
react-native-github/packages/react-native/React/CoreModules/RCTEventDispatcher.mm:110:9: note: insert 'break;' to avoid fall-through
  110 |         default:
      |         ^
      |         break;
1 error generated.
Interaction with installer failed.
```

Reviewed By: joevilches

Differential Revision: D69625062

fbshipit-source-id: 071ddf113afbc8d8d0870282fc83d762f1f80616
2025-02-13 17:03:44 -08:00
David VaccaandFacebook GitHub Bot b467a7453e Enforce that ViewManagers using codegen override getDelegate() method (#49414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49414

In this we are enforcing that that ViewManagers using codegen override getDelegate() method.

For now we are logging a softException to get signal from production without crashing the app

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69621301

fbshipit-source-id: 1434fb3f3c7e5ebebee172ec1d7ad6c21eb453ae
2025-02-13 16:33:37 -08:00
Nick GerlemanandFacebook GitHub Bot 8671529367 Back out "Back out "Back out "[RN][CSS] Wire up native box shadow parsing""" (#49412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49412

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D69619783

fbshipit-source-id: cffb2f45c30bf1f43914224bc2e46a2653bd0bdb
2025-02-13 16:05:32 -08:00
Riccardo CipolleschiandFacebook GitHub Bot dd0e1f24d1 Add build function to the prepare-ios-script (#49363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49363

This change adds the `build()` function that calls xcodebuild to prepare the ReactNativeDependencies.framework

This functio creates the frameworks in the /react-native/third-party/.build folder

## Changelog:
[Internal] - Add build folder to the `prepare-ios-script`

Reviewed By: cortinico

Differential Revision: D69533218

fbshipit-source-id: edc9281e9270970084aa0f56b52ced4579df3473
2025-02-13 13:55:51 -08:00
Riccardo CipolleschiandFacebook GitHub Bot dd4d4e2923 Add SwiftPM package to build dependencies for iOS (#49361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49361

This change adds the Package.swift file that we will use to build the dependencies for React Native

## Changelog:
[Internal] - Swift PM file to build ReactNativeDependencies

Reviewed By: cortinico

Differential Revision: D69518776

fbshipit-source-id: 85006c3c5933cc6a5fd772f7b014a823d7bb99b3
2025-02-13 13:55:51 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b98362e311 Add code to keep only required files for dependencies (#49360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49360

We don't need the whole dependencies archiveto build the dependencies. But usually we only need a subset of them.

This change add a functionality to the script to remove the unnecessary files.

## Changelog:
[Internal] - Add feature to remove unnecessary files from 3p dependencies.

Reviewed By: cortinico

Differential Revision: D69518656

fbshipit-source-id: b071626a1894261b75023023b7f7eeb2730282a2
2025-02-13 13:55:51 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 7db0abf61b [Download and patch Glog dependency (#49336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49336

This change adds the step to download the glog dependency and run the prepare_glog script that we have in the codebase

## Changelog:
[Internal] - Download Glog and patch it.

Reviewed By: cortinico

Differential Revision: D69466238

fbshipit-source-id: df0b4e29d4ff7d0d61f92a52141935472fa964fe
2025-02-13 13:55:51 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9f23118716 Add function to download dependencies (#49335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49335

This change adds a function in the prebuild script to download a 3p dependency in the react native monorepo.

## Changelog:
[Internal] - Add function to download 3rd party dependencies

Reviewed By: cortinico

Differential Revision: D69464429

fbshipit-source-id: 2d035168c2390eb9fa9e2338976fce15d86fb68c
2025-02-13 13:55:51 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 47c2c01ded Prepare flow script for iOS prebuilds (#49334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49334

This diff adds a script in the `react-native/script/releases` folder that we will use as base to prepare prebuilds for iOS

The script can be invoked from the repository root with
```
node scripts/releases/prepare-ios-prebuilds.js
```

## Changelog:
[Internal] - Add scripts to prepare ios prebuilds

Reviewed By: cortinico

Differential Revision: D69461691

fbshipit-source-id: 8d33955dd799f95c43de565e48360558d7d946d4
2025-02-13 13:55:51 -08:00
Rob HoganandFacebook GitHub Bot 1a890a55de Add changelog for 0.77.1 (#49409)
Summary:
## Changelog:

[Internal] Changelog for 0.77.1

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

Reviewed By: cipolleschi

Differential Revision: D69603525

Pulled By: robhogan

fbshipit-source-id: 9ff79ce3c5d515d9684fc741829680f27a30b067
2025-02-13 13:54:31 -08:00
Iwo PlazaandFacebook GitHub Bot 028c0b36f6 Migrate Utilities/deepFreezeAndThrowOnMutationInDev.js, Utilities/defineLazyObjectProperty.js, Utilities/DeviceInfo.js & Utilities/FeatureDetection.js to use export syntax (#49408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49408

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates Utilities/deepFreezeAndThrowOnMutationInDev.js, Utilities/defineLazyObjectProperty.js, Utilities/DeviceInfo.js & Utilities/FeatureDetection.js to use the export syntax.
- Updates deep-imports of files that were migrated to a single export default to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Utilities/deepFreezeAndThrowOnMutationInDev`, `Utilities/defineLazyObjectProperty`, `Utilities/DeviceInfo` or `Utilities/FeatureDetection` with `require` syntax may need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69602536

fbshipit-source-id: 7ec06995a1d244b95d4f970551955d9e6013de13
2025-02-13 13:11:20 -08:00
Sam ZhouandFacebook GitHub Bot a1eb6de691 Pre-suppress errors ahead of 0.261.1 release in xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D69610953

fbshipit-source-id: 3eec28d72e26c2f48542523dd610590e298eba69
2025-02-13 13:04:53 -08:00
Iwo PlazaandFacebook GitHub Bot d98116aa44 Migrate Libraries/Utilities/Platform to use export syntax (#49306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49306

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/Platform.*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/Platform` with `require` syntax needs to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69404025

fbshipit-source-id: f21501ca5b7e8e6a9e3e501781ed36e7d2bfd4a4
2025-02-13 11:58:41 -08:00
Iwo PlazaandFacebook GitHub Bot 7aef81b984 Migrate Utilities/infoLog, Utilities/logError, Utilities/mapWithSeparator & Utilities/warnOnce to use export syntax (#49406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49406

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates Utilities/infoLog, Utilities/logError, Utilities/mapWithSeparator & Utilities/warnOnce to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Utilities/infoLog`, `Utilities/logError`, `Utilities/mapWithSeparator` or `Utilities/warnOnce` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69601174

fbshipit-source-id: 821f9ae59d4f898c95631eb7a9aeed138ace3567
2025-02-13 11:16:27 -08:00
Iwo PlazaandFacebook GitHub Bot 152587cda0 Migrate Utilities/binaryToBase64, Utilities/DevSettings, Utilities/PolyfillFunctions & Utilities/RCTLog to use export syntax (#49403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49403

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` & `Utilities/RCTLog` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` or `Utilities/RCTLog` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69600476

fbshipit-source-id: 3f8ac3a35031e8b20446abc8f52a2817cb31b6d2
2025-02-13 11:13:25 -08:00
Iwo PlazaandFacebook GitHub Bot 827a847791 Migrate Utilities/BackHandler.*.js, Utilities/DevLoadingView.js and Utilities/HMRClient*.js to use export syntax (#49369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49369

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/BackHandler.*.js`, `Utilities/DevLoadingView.js` and `Utilities/HMRClient*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/BackHandler`, `Utilities/DevLoadingView.js` or `Utilities/HMRClient*.js` with `require` syntax needs to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69539527

fbshipit-source-id: c10b3523bbcc52bba5b6c27721c33b1e0d9d5104
2025-02-13 10:41:17 -08:00
David VaccaandFacebook GitHub Bot 6632d30678 Remove legacy codegen of $PropSetter classes for ShadowNode classes on apps running on new architecture by default (#49405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49405

This diff removes legacy codegen of $PropSetter classes for ShadowNode classes when the app has UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE enabled

These classes are not used in the new architecture, let's just remove them from the apk.

This change won't affect OSS

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69569205

fbshipit-source-id: 178051b9f10576226fd746f9eab1b56b2934ea0b
2025-02-13 10:31:42 -08:00
David VaccaandFacebook GitHub Bot a43c6b15bb Remove legacy codegen of $PropSetter classes for ViewManagers that are migrated to new architecture (#49404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49404

This diff disables codegen of legacy $PropSetter for viewManagers that implement the interface com.facebook.react.uimanager.ViewManagerWithGeneratedInterface.

This logic will only be enabled for apps that are configured with BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE = true

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67412734

fbshipit-source-id: 682725714dc41f5f34d95d4d9a13ab09726b28f7
2025-02-13 10:31:42 -08:00
Alan LeeandFacebook GitHub Bot 141fb23bba fix Modal crash when calling syncSystemBarsVisibility() (#49386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49386

It appears that `currentActivity.decorView` sometime is not attached to a window during the process of creating a Dialog for currently unknown reasons causing a crash.
Add check to skip call to `syncSystemBarsVisibility()` in such case as current code cannot function without valid RootWindowInsets.

Changelog:
[Android][Fixed] - fixed crash with Modal when trying to call syncSystemBarsVisibility()

Reviewed By: cortinico

Differential Revision: D69578581

fbshipit-source-id: de23e2ba9f485e38b7014dd7151253e56976ad43
2025-02-13 10:25:42 -08:00
DawidandFacebook GitHub Bot 6b2c40c64f Fix(iOS): onPress fails for Text with nested View (#49393)
Summary:
On the new architecture the `RCTParagraphTextView` is used to draw text on iOS but React doesn't know about it. The hit test stops propagation on the first encountered  UIView of this type. The suggested solution is to add a dummy hit test for `RCTParagraphTextView` that returns always `null`, allowing further search of the touch target.

## 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] - Fixed onPress for Text with nested View.

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

Test Plan:
| Before       | After        |
|--------------|--------------|
|<video src="https://github.com/user-attachments/assets/745f555a-d4b6-4285-91a7-0e9ea9f43d84"> | <video src="https://github.com/user-attachments/assets/9896848f-13ca-4b57-bcc9-bead478ab078">  |

<details>
 <summary>code</summary>

```ts
import {SafeAreaView, StyleSheet, Text, View, findNodeHandle} from 'react-native';

function App() {
  return (
    <SafeAreaView style={styles.container}>
      <Text
        ref={e => console.log(`Outer Text: ${findNodeHandle(e)}`)}
      >
        With Nested View
        <View ref={e => console.log(`View: ${findNodeHandle(e)}`)}>
          <Text
            ref={e => console.log(`Inner Text: ${findNodeHandle(e)}`)}
            onPress={() => {
              console.log('1. text pressed');
            }}
            style={styles.pressableText}
          >
            Pressable Text
          </Text>
        </View>
      </Text>
      <Text>
        Without Nested View
        <Text
          onPress={() => {
            console.log('2. text pressed');
          }}
          style={styles.pressableText}
        >
          Pressable Text
        </Text>
      </Text>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    gap: 10,
  },
  pressableText: {
    fontSize: 18,
    color: 'blue',
    backgroundColor: 'transparent',
  },
  nestedView: {
    backgroundColor: 'red',
    height: 100,
  },
  pressable: {
    backgroundColor: 'blue',
    height: 100,
    width: 100,
  },
});

export default App;

```

</details>

Reviewed By: cipolleschi

Differential Revision: D69591520

Pulled By: coado

fbshipit-source-id: eb75c2d8a01a82d4493a1a982e98ca74efc9d94f
2025-02-13 10:17:40 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 31a8bb386d feat: add jsitooling package (#49348)
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore

This PR adds `jsitooling` package that third party JS engines can use (in that case javascriptcore). It's required because React-Runtime needs to depend on third-party engine on iOS, and the third-party engine needed to depend on React-Runtime to get access to the `JSRuntimeFactory` and Cocoapods doesn't support circular dependencies...

Now third-party engine can depenend on jsitooling package and provide JSRuntimeFactory

## Changelog:

[INTERNAL] [ADDED] - jsitooling package

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D69535475

Pulled By: cipolleschi

fbshipit-source-id: f8d68b7957b7d69c13246ce3040a08256f2ebcd6
2025-02-13 08:49:42 -08:00
Alex HuntandFacebook GitHub Bot 41dd822762 Fix rn-tester convenience scripts (#49401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49401

These scripts erroneously invoked `npm`, requiring `--` to forward args.

Discovered while testing https://github.com/facebook/react-native/pull/49353.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D69594024

fbshipit-source-id: a6e8cccaf994f1472b51155d36a49ed17cd291dc
2025-02-13 07:57:05 -08:00
Nicola CortiandFacebook GitHub Bot 6c3c8b7ca3 Do not reference react-native info in the Issue Template (#49367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49367

Users should use `npx react-native-community/cli info` instead.
This updates the issue template.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69533810

fbshipit-source-id: 7fd1718c96f1b160ed53cd17752f64d887143662
2025-02-13 07:37:00 -08:00
Fabrizio CucciandFacebook GitHub Bot 8bda8af7a7 Add changelog entry for 0.78.0-rc.5 (#49392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49392

As per title

 Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D69590898

fbshipit-source-id: a1c1ff97a69de75ee7616e309d493de49565820b
2025-02-13 07:21:56 -08:00
Nicola CortiandFacebook GitHub Bot d8b95044d2 Cleanup react-native-info package (#49364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49364

We're not actively using/maintaining this package. Let's clean it up.
We can still restore if necessary.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D69533629

fbshipit-source-id: 940057df9a5fffa738435c92136e95a764ec98ff
2025-02-13 06:54:50 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 7dc85d0e97 feat(ios): encapsulate device info listeners (#49162)
Summary:
This PR encapsulates device info listeners removing additional logic from RCTAppDelegate which is a prerequisite for https://github.com/facebook/react-native/pull/49078

Now we use KVO (Key Value Observation) to listen to window size changes making this module's logic encapsulated + allows to use it in brownfield scenarios.

To keep backward compatibility RCTDeviceInfo still emits `RCTWindowFrameDidChangeNotification`

## Changelog:

[IOS] [ADDED] - encapsulate device info listeners

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

Test Plan: Check if window size change listener is fired

Reviewed By: sammy-SC

Differential Revision: D69116660

Pulled By: cipolleschi

fbshipit-source-id: b9a57c70826b10cd27d102337eb1e35da1b365c9
2025-02-13 06:28:44 -08:00
Alex HuntandFacebook GitHub Bot f9bffef6c7 Remove Remote Debugging logs check (#49391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49391

Further cleanup of Remote JS Debugging.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D69589296

fbshipit-source-id: 78c916d9419d839f01b8f31726d59fe9b7c970b7
2025-02-13 05:11:35 -08:00
Jakub PiaseckiandFacebook GitHub Bot 88fc9a3415 Align AppState types with TypeScript definitions (#49248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49248

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69176965

fbshipit-source-id: ffc82068dcf1451b858c3465c40f22427d4dd158
2025-02-13 04:14:15 -08:00
Jakub PiaseckiandFacebook GitHub Bot 43cf02336d Update ignore files and translate script (#49389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49389

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69586220

fbshipit-source-id: a6c2f5e91055a6449087db3107c137dc49ea6d91
2025-02-13 03:59:37 -08:00
Jakub PiaseckiandFacebook GitHub Bot 4f20362b07 Migrate files in Libraries/StyleSheet to use export syntax (#49303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49303

Changelog: [General][Breaking] Deep imports to modules inside `Libraries/StyleSheet` using `require` may need to be appended with `.default`

Reviewed By: huntie

Differential Revision: D69400980

fbshipit-source-id: 053f40a8677ac877b93c27e87422ea0ef540c272
2025-02-13 03:45:13 -08:00
Mateo GuzmánandFacebook GitHub Bot 04b40852fa Make BlackHoleEventDispatcher & InterpolatorType internal (#49380)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [BlackHoleEventDispatcher](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+com.facebook.react.uimanager.events.BlackHoleEventDispatcher)
- [InterpolatorType](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+com.facebook.react.uimanager.layoutanimation.InterpolatorType)

## Changelog:

[INTERNAL] - Make BlackHoleEventDispatcher & InterpolatorType internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69558346

Pulled By: arushikesarwani94

fbshipit-source-id: 48b2f267f3efb78c6d66a67fb94c2d3271558df0
2025-02-13 02:46:39 -08:00
Vitali ZaidmanandFacebook GitHub Bot b0974135bf increase ping-pong timeout before killing WS connection to DevTools (#49358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49358

When the network is under strain, the code responsible for detecting if the inspector proxy's connection to the client has been lost may incorrectly assume the connection is dead. This false positive occurs because the system assumes that if a pong is not received within 5 seconds of a ping, the other side has disconnected. However, I was able to consistently reproduce scenarios where a delay of more than 5 seconds (even more than 20 seconds) was followed by a return to normal ping-pong communication without any issues.

Since I can't think of any issues with increasing this number, I'm increasing it to 60s.

Changelog:
[General][Fixed] - Disconnections of DevTools when the network is under significant strain.

Reviewed By: robhogan, huntie

Differential Revision: D69523906

fbshipit-source-id: 50db1e7bbe690b42421bc226aa30fd6571ba2257
2025-02-12 23:45:01 -08:00
Panos VekrisandFacebook GitHub Bot 413730ecb3 Back out "Deploy 0.261.0 to xplat"
Summary:
Original commit changeset: cf5953b1afc2

Original Phabricator Diff: D69562137

Reviewed By: SamChou19815

Differential Revision: D69570236

fbshipit-source-id: 7cfa9cf51aa3662d4339e020f8ae5065c8f5c358
2025-02-12 19:14:21 -08:00
Sam ZhouandFacebook GitHub Bot 9a401c8103 Deploy 0.261.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D69562137

fbshipit-source-id: cf5953b1afc242bf2571ad7c4362ef9485d8e846
2025-02-12 18:12:54 -08:00
Nick GerlemanandFacebook GitHub Bot 1663dc1978 Back out "Back out "[RN][CSS] Wire up native box shadow parsing"" (#49376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49376

We can reland this now that D69520832 update feature flags infra.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D69548370

fbshipit-source-id: ec1187dffdca4d9d4064235e9ef6336e66521d26
2025-02-12 16:59:44 -08:00
Mateo GuzmánandFacebook GitHub Bot 1d8021d821 Fix up KDoc annotations post Kotlin migrations (#49375)
Summary:
When generating documentation using dokka, I found out that some references to classes in the comments were not linking correctly anymore after the files were migrated to Kotlin. In this PR I'm migrating the JavaDoc `link` references to Kotlin KDoc `[]` syntax.

## Changelog:

[INTERNAL] - Fix up KDoc annotations post Kotlin migrations

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

Test Plan: Manually review that the references link correctly in the Kotlin files

Reviewed By: arushikesarwani94

Differential Revision: D69549229

Pulled By: mdvacca

fbshipit-source-id: 6b7727f00a28ecfe2fca86948245d1f4e88e935c
2025-02-12 15:37:46 -08:00
David VaccaandFacebook GitHub Bot a0088d9f2b Migrate ReactStage to kotlin (#49378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49378

Migrate ReactStage to kotlin

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D69544706

fbshipit-source-id: 2c9ddae499f1110a3ed60e9cc02cddc19f4b306f
2025-02-12 15:26:23 -08:00
Jan KassensandFacebook GitHub Bot 14fcaf9791 cleanup feature flag enableFabricCompleteRootInCommitPhase (#49372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49372

Changelog: [Internal]

Reviewed By: poteto

Differential Revision: D69473992

fbshipit-source-id: 6ed54f0fab45b95e47afa3ff343de061e7c40ce7
2025-02-12 13:12:07 -08:00
Mateo GuzmánandFacebook GitHub Bot 1b066bac9a Migrate BlobCollector to Kotlin (#49148)
Summary:
Migrate com.facebook.react.modules.blob.BlobCollector to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.blob.BlobCollector to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, fabriziocucci

Differential Revision: D69522998

Pulled By: javache

fbshipit-source-id: a0255d1cdb51ee1f8aa73a07419e228871e56538
2025-02-12 09:04:48 -08:00
Mateo GuzmánandFacebook GitHub Bot c5b9e8e7d4 Migrate OkHttpClientProvider to Kotlin (#49108)
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin. Also, as follow up from https://github.com/facebook/react-native/pull/48958 I'm cleaning up the reflection on `OkHttpClientProviderTest` as we can make `sClient` and `sFactory` internal.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69050956

Pulled By: javache

fbshipit-source-id: 62dcf8e8f999f3b687c57ed02e9ac1f2db8183ea
2025-02-12 09:04:48 -08:00
Eli WhiteandFacebook GitHub Bot 60e3921f9c Initial Open Sourcing of React Native Compatibility Check (#49340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49340

This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.

This is useful for:

- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native

Check out the Readme for more information

Changelog: [General][Added] Open Sourcing React Native's Compatibility Check

Reviewed By: panagosg7

Differential Revision: D69476742

fbshipit-source-id: 8af6039839c5475c1258fa82d9750a9320cf0751
2025-02-12 08:24:13 -08:00
Nicola CortiandFacebook GitHub Bot d11f622699 monitor-new-issues should ping the Issue Triager Oncall (#49359)
Summary:
This updates the Issue Triaging bot to ping the oncall

## Changelog:

[INTERNAL] -

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

Test Plan: Nothing to test

Reviewed By: cipolleschi

Differential Revision: D69527137

Pulled By: cortinico

fbshipit-source-id: 7291054a734bf9f7240002773b716b2057aa8eca
2025-02-12 08:15:43 -08:00
Jakub PiaseckiandFacebook GitHub Bot 2a99b22a44 Update module resolution for type generation (#49351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49351

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69521547

fbshipit-source-id: 5d37875da91341ad1882733f5ee842a819558f85
2025-02-12 07:34:36 -08:00
Alex HuntandFacebook GitHub Bot 0d66c524cf Restore Metro log streaming via CLI flag (#49353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49353

This change adds an opt-in to restore JavaScript log streaming via the Metro dev server, [removed from React Native core in 0.77](https://reactnative.dev/blog/2025/01/21/version-0.77#removal-of-consolelog-streaming-in-metro).

Users can opt into this legacy behaviour by adding the `--client-logs` flag to `npx react-native-community/cli start`.

- The default experience remains without streamed JS logs.
- The existing "JavaScript logs have moved! ..." notice is printed in all cases, and we do not advertise the new flag for new users.
- Under non-Community CLI dev servers (i.e. Expo), log streaming is restored implicitly.

We will clean up this functionality again when we eventually remove JS log streaming over `HMRClient`, tasked in T214991636.

**Implementation notes**

- Logs are always sent over `HMRClient` (previous status quo), even with log streaming off in the dev server. This is a necessary evil to be able to flag this functionality in a user-accessible place, and to move fast for 0.78.
- Necessarily, emitting `fusebox_console_notice` moves to the dev server itself, on first device (Fusebox) connection.

Changelog:
[General][Added] - Add opt in for legacy Metro log streaming via `--client-logs` flag

Reviewed By: robhogan

Differential Revision: D69469039

fbshipit-source-id: be99d02a3b1c977a59bf7d2726f0e6cf2e60b28a
2025-02-12 07:17:15 -08:00
Pieter De BaetsandFacebook GitHub Bot 403719c371 Remove CountingOutputStream (#49275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49275

This is a copied guava class and is only used in one spot.  Remove it and just count directly in ProgressRequestBody.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D69323277

fbshipit-source-id: 5260004a4431f03733882b6ee83a341d8bf29bb0
2025-02-12 06:21:45 -08:00
Iwo PlazaandFacebook GitHub Bot 2b30aa5cc8 Migrate Libraries/Utilities/differ/*.js to export syntax (#49332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49332

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/differ/*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates codegen with a compat layer
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/differ/...` with `require` syntax need to be appended with '.default'.

Reviewed By: yungsters

Differential Revision: D69467423

fbshipit-source-id: 2e58a0b9711e9bdf5ca907a5b2252584f6fec9bc
2025-02-12 05:30:20 -08:00
Pieter De BaetsandFacebook GitHub Bot 9073817925 Add more test coverage for $ReadOnlyArray<UnsafeMixed> in component codegen (#49349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49349

Follow-up on D69454101 to add more test coverage for `$ReadOnlyArray<UnsafeMixed>` as a component prop. The new type was missing from the CodegenSchema, which revealed some gaps in tests.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D69488035

fbshipit-source-id: 19895e55e5ec4d89a790f1c388de9eea025a316c
2025-02-12 04:20:08 -08:00
Rubén NorteandFacebook GitHub Bot 96a8a3da48 Only log errors accessing feature flags in JS if the native module itself is not defined (#49350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49350

Changelog: [internal]

Reviewed By: GijsWeterings

Differential Revision: D69520832

fbshipit-source-id: fb72103705c930eb5f0944c931b4fdeabde841ae
2025-02-12 04:07:10 -08:00
Jakub PiaseckiandFacebook GitHub Bot 1d7de4261f Add transform that replaces empty type with never (#49331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49331

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69465686

fbshipit-source-id: ef5e5eeedb6cd1bc89529d11bbf1ff7490daf704
2025-02-12 03:20:15 -08:00
Dawid MałeckiandFacebook GitHub Bot bf282146b6 Add UIManager to build-types and align Flow with TS defs (#49322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49322

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D69241595

fbshipit-source-id: 00dafa499fe70f47395ab363f6565619e1877bae
2025-02-12 02:00:10 -08:00
Tommy NguyenandFacebook GitHub Bot 7926d656b3 fix: fix @react-native-community/cli-platform-* packages not being found in monorepos (#47308)
Summary:
Fix `react-native-community/cli-platform-*` packages not being found in monorepos.

Note that we are making the assumption that `process.cwd()` returns the project root. This is the same assumption that `react-native-community/cli` makes. Specifically, `findProjectRoot()` has an optional argument that defaults to `process.cwd()`:

- [`findProjectRoot()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-tools/src/findProjectRoot.ts)
- Which gets called without arguments in [`loadConfig()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-config/src/loadConfig.ts#L89)
- `loadConfig()` gets called from [`setupAndRun()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli/src/index.ts#L196), also without project root set

As far as I can see, the project root argument is only ever used in tests.

## Changelog:

[GENERAL] [FIXED] - Fix `react-native-community/cli-platform-*` packages not being found in monorepos

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

Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Cherry-pick https://github.com/facebook/react-native/pull/47304
3. Cherry-pick https://github.com/facebook/react-native/pull/47308
4. Run `react-native config` inside `packages/test-app`
5. Verify that `projects` is populated

**Before:**

```js
  "healthChecks": [],
  "platforms": {},
  "assets": [],
  "project": {}
}
```

**After:**

```js
  "healthChecks": [],
  "platforms": {
    "ios": {},
    "android": {}
  },
  "assets": [],
  "project": {
    "ios": {
      "sourceDir": "/~/packages/test-app/ios",
      "xcodeProject": {
        "name": "SampleCrossApp.xcworkspace",
        "path": ".",
        "isWorkspace": true
      },
      "automaticPodsInstallation": false,
      "assets": []
    },
    "android": {
      "sourceDir": "/~/packages/test-app/android",
      "appName": "app",
      "packageName": "com.msft.identity.client.sample.local",
      "applicationId": "com.msft.identity.client.sample.local",
      "mainActivity": "com.microsoft.reacttestapp.MainActivity",
      "assets": []
    }
  }
}
```

Reviewed By: cortinico

Differential Revision: D69465533

Pulled By: robhogan

fbshipit-source-id: 3d6cf32752a7a41d9c7e84f35b0f26ae7d7a971f
2025-02-12 00:34:32 -08:00
Nick GerlemanandFacebook GitHub Bot d08f9accf0 Back out "Wire up native box shadow parsing" (#49345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49345

This diff is causing an error to be logged for every user. Even if it's noise, its more trouble than its worth. Let's revert until feature flags check fixed.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D69504966

fbshipit-source-id: 13caf715cef9a4cc6c9b7c68d3003fbced870d34
2025-02-12 00:11:32 -08:00
Rick HanlonandFacebook GitHub Bot 578e99a013 Add a healthy number of inital e2e tests (#49338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49338

This doesn't cover all cases, but is a good start.

Where relevant, I call out inline places where there are KPs with LogBox that will be fixed separately.

## Changelog

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69443040

fbshipit-source-id: 7281f30aa705ae812d5b5f5f9ad03b37358de059
2025-02-11 19:33:07 -08:00
Rick HanlonandFacebook GitHub Bot 1aa0ddd88b Update fantom test, add helpers (#49337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49337

*Note: This diff adds helpers and updates the one test we have. The next diff adds a bunch of tests, see that diff for how these helpers are used to scale to a large number of tests.*

-----

## Overview

Adds helpers for the LogBox e2e test to make it easier to write simple, readable, tests with a healthy level of abstraction over the e2e APIs.

## API
The helpers expose an ability to render a component, and return methods to get the UI state:

```
// Returns the LogBox inspector UI as an object.
getInspectorUI: () => ?InspectorUI,

// Returns the LogBox notification UI as an object.
getNotificationUI: () => ?NotificationUI,
```

These return objects that represent the main text elements in the UI like `title` and `message`.

The helpers also provide methods for interacting with the LogBox UI:

```
// True if the LogBox inspector is open.
isOpen: () => boolean,

// Tap the notification to open the LogBox inspector.
openNotification: () => void,

// Tap to close the notification.
dimissNotification: () => void,

// Tap the minimize button to collapse the LogBox inspector.
mimimizeInspector: () => void,

// Tap the dismiss button to close the LogBox inspector.
dismissInspector: () => void,

// Tap the next button to go to the next log.
nextLog: () => void,

// Tap the previous button to go to the previous log.
previousLog: () => void,
```

## Example test
This allows writing tests like:

```
test('should log error', () => {
  const logBox = renderLogBox(<ComponentThatErrors />);

  // Should show notification
  expect(logBox.isOpen()).toBe(false);
  expect(logBox.getNotifciationUI()).toEqual({
    count: '!',
    message: 'error message',
  });

  // Tap the notification
  logBox.openNotification();

  // Should show log
  expect(logBox.isOpen()).toBe(true);
  expect(logBox.getInspectorUI()).toEqual({
    header: 'Log 1 of 1',
    title: 'Console Error',
    message: 'error message',
    stackFrames: [
      'ComponentThatErrors'
    ],
    componentStackFrames: [
      '<ComponentThatErrors />',
    ],
    isDismissable: true,
  });
})
```

## Changelog

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69443041

fbshipit-source-id: c81ccd56a39d01d61814d29515b587096c0509c0
2025-02-11 19:33:07 -08:00
Samuel SuslaandFacebook GitHub Bot 00abe54707 account for tunnelled components like Modal in view culling (#49344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49344

changelog: [internal]

restart culling context when coming across a component like Modal.

Reviewed By: alanleedev

Differential Revision: D69490655

fbshipit-source-id: bda67fd271134dceb2669d9d71c9de3041d085a9
2025-02-11 18:59:28 -08:00
David VaccaandFacebook GitHub Bot 46653fa548 Raise java source and target versions for ReactModuleSpecProcessor from 8 -> 11 (#49342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49342

Raise java source and target versions for ReactModuleSpecProcessor from 8 -> 11

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69478204

fbshipit-source-id: 4059391041443d0418c363c1e627b6d4c38b9ff0
2025-02-11 18:53:05 -08:00
David VaccaandFacebook GitHub Bot 5cb71ef181 Raise source and target version of Prop annotation processor from 7 to 11 (#49343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49343

Raise source and target version of annotation processor from 7 to 11

This is unused in OSS

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69478025

fbshipit-source-id: 28c6ed5889db423c43a36ccee396083ae7e78e5f
2025-02-11 18:53:05 -08:00
Joe VilchesandFacebook GitHub Bot a733930017 Add e2e tests for fixed transform cases (#49318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49318

tsia see previous diffs for fix. Added more tests to box shadow, filter, and borders

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69416675

fbshipit-source-id: ae1e33750b56c1a4720e04e29fc110f1e11c0b3d
2025-02-11 15:44:59 -08:00
Nick GerlemanandFacebook GitHub Bot ba4a0cc23e Wire up native box shadow parsing (#49317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49317

This hooks into `enableNativeCSSParsing()` to optionally bypass viewconfig processor, and lets us parse the raw strings (or objects composed of string) in native.

Right now, to not disturb too much while this is in experimentation, this is  just a facade over existing types and props storage, and we ignore any non-px lengths.

Also need to prepend

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69337482

fbshipit-source-id: 6093e312e0d1dc1855713da20b72bf75b98af3ea
2025-02-11 13:20:32 -08:00
Nick GerlemanandFacebook GitHub Bot b1bd540045 <react/renderer/css> OSS build logic (#49316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49316

This hooks up some build logic for `react/renderer/css`. A bit funky right now since header only, and might need to change later (it isn't neccesarily guaranteed to be header only in the future).

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D69426450

fbshipit-source-id: 77e0ef409f34daf003d28a5cd70de935bd180440
2025-02-11 13:20:32 -08:00
Andrew DatsenkoandFacebook GitHub Bot 6ec1d9d843 Add .toMatch API (#49328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49328

Changelog: [Internal]
Add missing `.toMatch` expect API

Reviewed By: rubennorte

Differential Revision: D69462225

fbshipit-source-id: aefe02e6a1f8f15c8c30c26492fa926e7d6e4e8e
2025-02-11 11:21:33 -08:00
Wu ZhongandFacebook GitHub Bot 6a3e275d14 Reland RNTester: Fixes turbo module examples error in bridgeless mode (#49329)
Summary:
Reland https://github.com/facebook/react-native/issues/48362.

## Changelog:

[IOS] [FIXED] - RNTester: Fixes turbo module examples error in bridgeless mode

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

Test Plan: RNTester turbomodule examples in bridgeless can work as expected.

Reviewed By: christophpurrer

Differential Revision: D69463612

Pulled By: cortinico

fbshipit-source-id: 8613b001ebbe64ce0d505f5515bb7a4b6a64dbe7
2025-02-11 10:56:19 -08:00
Qian WuandFacebook GitHub Bot df3a60293c Revert D69277991: Initial Open Sourcing of React Native Compatibility Check
Differential Revision:
D69277991

Original commit changeset: 886a983d4b17

Original Phabricator Diff: D69277991

fbshipit-source-id: f69d528d87c22d03b0c3e654733c8efa89104df0
2025-02-11 10:35:55 -08:00
Andrew DatsenkoandFacebook GitHub Bot 9799e34211 Add .toHaveLength (#49327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49327

Changelog: [Internal]
Add missing `.toHaveLength` expect API

Reviewed By: rubennorte

Differential Revision: D69241817

fbshipit-source-id: 11c7f314a30fd1db3c00b8665b613d290d50ad81
2025-02-11 10:32:27 -08:00
David VaccaandFacebook GitHub Bot 5444c76433 Configure all feature flags of NewArchitecture on canary (#49333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49333

The rollout of "new architecture everywhere" should be enabled in OSS canary releases. This diff updates the ReactNativeFeatureFlags.config.js to reflect that all of the feature flags used by the new architecture are enabled by default in experimental and canary releases. Note that these feature flags were already enabled in OSS when new architecture was enabled.

changelog: [internal] internal

Reviewed By: rubennorte, NickGerleman

Differential Revision: D69419662

fbshipit-source-id: 6ecf9e38bb2fd0d3c0f7129ae16fcef8755b5da2
2025-02-11 10:14:02 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot e7de582798 feat(iOS): centralize JS engine dependency configuration (#49297)
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore

This PR centralizes the setup of js engine dependencies which need to be defined when building with dynamic frameworks. This will allow us to change linked framework if using a third party one in the future

## Changelog:

[INTERNAL] [CHANGED] - centralize JS engine dependency configuration

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

Test Plan: CI Green (Build needs to go properly)

Reviewed By: javache

Differential Revision: D69396641

Pulled By: cipolleschi

fbshipit-source-id: deedd12084f563f73f12f8617fdca0a6d680bf5a
2025-02-11 10:03:07 -08:00
Alex Taylor (alta)andFacebook GitHub Bot 32fcd2733e Deploy 0.260.0 to xplat (#49319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49319

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D69438322

fbshipit-source-id: 1906cfc76125e1bb7244b2a40536c3268a914ecf
2025-02-11 09:34:17 -08:00
Jakub PiaseckiandFacebook GitHub Bot aedf8c1dba Update virtualized-lists types to align them closer to TS definitions (#49264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49264

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69308531

fbshipit-source-id: 29f1726026aa55e4e17616e7880c7d30eae13b8f
2025-02-11 09:25:22 -08:00
Jakub PiaseckiandFacebook GitHub Bot b8e2bcd60d Update types in virtualized-lists so that they produce valid TS output (#49263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49263

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69308533

fbshipit-source-id: 36dd38a5bfce3b19eabcf04ef5f14e006d581bcd
2025-02-11 09:25:22 -08:00
Jakub PiaseckiandFacebook GitHub Bot 1cf4c84ba0 Update files in packages/virtualized-lists to use export syntax (#49262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49262

Changelog: [General][Breaking] Deep imports into `react-native/virtualized-lists` with require syntax may need to be appended with `.default`

Reviewed By: huntie

Differential Revision: D69308532

fbshipit-source-id: 6de15d46e0931616bc9849edbccb7cf745e15dd5
2025-02-11 09:25:22 -08:00
Rubén NorteandFacebook GitHub Bot 3a8837de4b Type event options as interface instead of objects (#49204)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49204

Changelog: [internal]

We don't copy the options object and just access the individual properties, so using an interface is enough, and has the benefit of not having to create object copies to pass down to subclasses.

Reviewed By: yungsters

Differential Revision: D69182824

fbshipit-source-id: 9819e5627d72761c78d0f39a1861a3239066dbb2
2025-02-11 09:14:29 -08:00
Eli WhiteandFacebook GitHub Bot 6590bb3e14 Initial Open Sourcing of React Native Compatibility Check (#49311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49311

This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.

This is useful for:

- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native

Check out the Readme for more information

Changelog: [General][Added] Open Sourcing React Native's Compatibility Check

Reviewed By: yungsters

Differential Revision: D69277991

fbshipit-source-id: 886a983d4b17609ce771cdd93b75f34bbd8417dc
2025-02-11 08:23:16 -08:00
Iwo PlazaandFacebook GitHub Bot 28945c68da Migrate files in Libraries/Modal and Libraries/Network to use export syntax (#49035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49035

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates files in `Libraries/Modal/*.js` and `Libraries/Network/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/Modal` and `Libraries/Network` with `require` syntax may need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68827032

fbshipit-source-id: 98149055f82edad96e74371a79f05f88a8ab3b66
2025-02-11 07:47:24 -08:00
Pieter De BaetsandFacebook GitHub Bot abd7259de4 Allow UnsafeMixed as Array value in codegen (#49324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49324

Provide Android component codegen a bit more flexibility by allowing `$ReadOnlyArray<UnsafeMixed>` and avoid casting in the view manager.

Changelog: [General][Added]

Reviewed By: fabriziocucci

Differential Revision: D69454101

fbshipit-source-id: c210647deffeb01b7db8aa07266e58c42acf14ba
2025-02-11 07:11:18 -08:00
Fabrizio CucciandFacebook GitHub Bot aaa72799e2 Add changelog entry for v0.78.0-rc.4 (#49326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49326

As per title.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D69458244

fbshipit-source-id: 12fdc52ab578cd16e91207de76bc827b534a8635
2025-02-11 06:46:16 -08:00
Ruslan LesiutinandFacebook GitHub Bot 0aefeb06d2 Update debugger-frontend from 0db2088...3adf51a (#49299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49299

Changelog: [Internal] - Update `react-native/debugger-frontend` from 0db2088...3adf51a

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

Reviewed By: huntie

Differential Revision: D69387439

fbshipit-source-id: e8cf7e4d9e9faca99187a19943b2549e6b6214ad
2025-02-11 06:38:14 -08:00
Ruslan LesiutinandFacebook GitHub Bot 999f99b41f Update debugger-frontend from d126cc8...0db2088 (#49267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49267

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

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

Reviewed By: robhogan

Differential Revision: D69307173

fbshipit-source-id: 400f8ec259264d3a6bbea43c3ad2f02440d4294a
2025-02-11 06:38:14 -08:00
Ruslan LesiutinandFacebook GitHub Bot 5c88633035 Roll out 6.1.1 on fbsource (#49255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49255

# Changelog:
[General] [Changed] - upgrade React DevTools to 6.1.1.

allow-large-files

Reviewed By: huntie

Differential Revision: D69302964

fbshipit-source-id: 80f7f720fc37564260435a23c9de7779ceab3668
2025-02-11 06:38:14 -08:00
Nicola CortiandFacebook GitHub Bot e6690cb4a7 Disable console logging for hermesc (#49301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49301

The hermesc logging is extremely noisy and not relevant for the users. I'm disabling it for the task that runs metro+hermesc (only for the hermesc) part.

Changelog:
[Internal] [Changed] - Disable console logging for hermesc

Reviewed By: robhogan

Differential Revision: D69399156

fbshipit-source-id: e5f8722b33d30675aba5a8aa82c456be21254b0c
2025-02-11 06:11:08 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 444c7d4eff Allow multiple RN instances to run at the same time (#49300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49300

With the refactor of the AppDelegate in favor ReactNativeFactory, the users can now instantiate multiple instances of react native.
However, currently, if you try to run multiple instances, the app will crash with the message:

```
libc++abi: terminating due to uncaught exception of type std::runtime_error: Feature flags cannot be overridden more than once
```

This happens also when the feature flags we would like to set are the same that we already applied. This should be an allowed scenario because reapplying the excatly same features flags should have no effect on React native and that's not the use case we want to forbid.

With this change, we are creating a static variable that checks whether we already apply that set of feature flags and it allows you to create multiple instances by keeping the same flags

## Changelog:
[iOS][Fixed] - Allow multiple RN instances to run at the same time

Reviewed By: rubennorte

Differential Revision: D69398441

fbshipit-source-id: a377c6a1402d38d66d348fa8c6a65e645973aadc
2025-02-11 05:54:39 -08:00
Jakub PiaseckiandFacebook GitHub Bot f1a3ff0dd1 Update RCTDeviceEventEmitter singleton instantiation (#49085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49085

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68953499

fbshipit-source-id: ea469813593cc4bcb746345a78c68dc7b0b4d56d
2025-02-11 05:42:24 -08:00
Jakub PiaseckiandFacebook GitHub Bot 7dbfc1099c Align EventEmitter definitions with TypeScript (#49206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49206

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68953500

fbshipit-source-id: 0e936e8423f8792db34d6b44b1620dde5bd13a47
2025-02-11 05:42:24 -08:00
Mateo GuzmánandFacebook GitHub Bot 9612241597 Make Overflow internal (#49235)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.style.Overflow).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.style.Overflow internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cipolleschi

Differential Revision: D69307164

Pulled By: cortinico

fbshipit-source-id: 778e36456c673e6472458c3076638eb7fd70c1de
2025-02-11 05:38:46 -08:00
zhongwuzwandFacebook GitHub Bot 62831e740c RNTester: Fixes turbo module examples error in bridgeless mode (#48362)
Summary:
In https://github.com/facebook/react-native/issues/47598 , we removed `__turboModuleProxy ` in bridgeless mode, it would produce error in rntester turbomodule examples, fix it by change `__turboModuleProxy` to `nativeModuleProxy`. RSNara can you please help to review? :)

before:
![image](https://github.com/user-attachments/assets/bf8edc50-6dbc-4465-9936-36ec9112761b)

After:
![image](https://github.com/user-attachments/assets/2d5c1546-d758-4692-a9a7-5cf195edc015)

## Changelog:

[IOS] [FIXED] - RNTester: Fixes turbo module examples error in bridgeless mode

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

Test Plan: RNTester turbomodule examples in bridgeless can work as expected.

Reviewed By: shwanton

Differential Revision: D67603884

Pulled By: cortinico

fbshipit-source-id: d905fa0535da5fde5e7ebff1d453ea761be9f42f
2025-02-11 05:28:58 -08:00
Mateo GuzmánandFacebook GitHub Bot 18992d2ebe Make ReactPackageLogger internal (#49236)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.ReactPackageLogger).

## Changelog:

[INTERNAL] - Make com.facebook.react.ReactPackageLogger internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cipolleschi

Differential Revision: D69307159

Pulled By: cortinico

fbshipit-source-id: 397be796bc9cc7acd633b461d40fcf1989708b4c
2025-02-11 04:03:09 -08:00
Samuel SuslaandFacebook GitHub Bot abb9f4f152 remove unused macros from Differentiator (#49310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49310

changelog: [internal]

These macros were unused, let's remove them.

Reviewed By: NickGerleman

Differential Revision: D69402801

fbshipit-source-id: ac701eb3dbd942ae217725563723f3ebfecd06cc
2025-02-11 03:00:45 -08:00
Samuel SuslaandFacebook GitHub Bot 022a0fb65a extract TinyMap into internal header (#49308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49308

changelog: [internal]

move TinyMap class to its own file in internal folder.

Reviewed By: NickGerleman

Differential Revision: D69402458

fbshipit-source-id: e16d5f33ef0e704e3336cf6f13f510206d7f5e5d
2025-02-11 03:00:45 -08:00
Samuel SuslaandFacebook GitHub Bot a1ed021dc3 refactor private parts of Differentiator.h to internal files (#49307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49307

changelog: [internal]

There were parts of Differentiator that were leaking outside of "mounting" module. This diff moves them to "internal" folder and changes buck so they can't be imported from outside the module.

Reviewed By: NickGerleman

Differential Revision: D69401878

fbshipit-source-id: 8aa8c96e91b088dab4f9c8b9a5e6937e09be7eb4
2025-02-11 03:00:45 -08:00
Samuel SuslaandFacebook GitHub Bot 174a0de1e1 handle transform in view culling (#49304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49304

changelog: [internal]

View culling must take transform into account when calculating whether a frame is visible or not. This diff adds that.

Reviewed By: NickGerleman

Differential Revision: D69394909

fbshipit-source-id: 4c588a64f2c8e2d35fb7d606d26adc09d3502780
2025-02-11 03:00:45 -08:00
Ingrid WangandFacebook GitHub Bot fffd6d75b4 Suppress deprecated status bar APIs in RCTStatusBarManager (#49315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49315

Changelog: [iOS][Fixed] Suppressed iOS 13 deprecation warnings in RCTStatusBarManager

Reviewed By: NickGerleman

Differential Revision: D69334478

fbshipit-source-id: b643c52d928f95f33659a643d0cc1d7de1f65563
2025-02-10 18:44:22 -08:00
Joe VilchesandFacebook GitHub Bot f835b824f4 Ensure filterLayer, backgroundImageLayer, and backgroundColorLayer are the same size/shape as the owning View (#49278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49278

The previous diff (https://github.com/facebook/react-native/pull/49272) fixed an issue where we used frame to get the size of a sublayer. This is problematic in that it scales things twice if a scaling transform is applied. I looked to see where else we do this and we have this problem (sometimes) with background color and filter.

To fix this in the general case I created a helper to size a layer to the same shape as the View's layer - so using bounds for the size, (0,0) for position on the frame, and cornerRadius/mask for border radius considerations. The only 3 layers that should be the exact same size are backgroundColorLayer, backgroundImageLayer, and filterLayer

Changelog: [iOS] [Fixed] - Fix cases where background color, filter, and background image were sized incorrectly if there was a scaling transform

Reviewed By: jorge-cab

Differential Revision: D69321790

fbshipit-source-id: 70b5d18fa01967896b1bfffdb5684c2c907f3549
2025-02-10 17:22:14 -08:00
Joe VilchesandFacebook GitHub Bot acaf94dc21 Fix issue where scaling transform + box shadow break the shadow (#49272)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49272

Turns out bounds does not account for the proper size if a scaling transform is applied while frame does. Using the example listed in https://github.com/facebook/react-native/issues/49134, the size of the frame is the expected 240, but the size of the bounds is 200.

We had a mismatch where we use bounds everywhere in shadow image creation, but use the frame when asking for the size of the box shadow layer. What ends up happening is we have a 240x240 layer that is getting scaled again.

I refactored the shadow creation to just take a CGSize instead of a whole CALayer (which we had only used for its size anyway) so that we can be consistent with frame and bounds, and use bounds everywhere so that we only scale once.

Changelog: [iOS] [Fixed] - Fix cases where background color, filter, and background image were sized incorrectly if there was a scaling transform

Reviewed By: jorge-cab

Differential Revision: D69320213

fbshipit-source-id: a913e0df91d78ec9665752acefcae755ab607ac8
2025-02-10 17:22:14 -08:00
Lauren TanandFacebook GitHub Bot 7d3fee7730 Apply fixup patch to fbsource
Summary:
Changelog: [Internal]

This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
diff-train-source-id: 7e59b47d91fda2c6ef8946499d9e4457522a90d5

Generated by: https://www.internalfb.com/intern/sandcastle/job/4503601290447444/

GitHub Repo: facebook/react

Reviewed By: mofeiZ

Differential Revision: D69418289

fbshipit-source-id: 48636ba5bedfef7a09e0802f2a640be0417cdb7c
2025-02-10 16:18:39 -08:00
Nick GerlemanandFacebook GitHub Bot 75edf3af50 CMake "react_render_" to "react_renderer_" (#49284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49284

All of the CMake library names in the "renderer" directory use "render" for the name, missing the last two letters of the directory name.

eye_twitch

I don't think fixing that should be breaking, since 3p libraries need to rely on the merged library anyway, so let's fix that and find/replace all these.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D69338892

fbshipit-source-id: d3b306ad0ea191728dfbacf9e2aaa12b00caa619
2025-02-10 14:32:26 -08:00
Nick GerlemanandFacebook GitHub Bot c37a2e9aa8 Disable warnings for mismatched SVC processor when enableNativeCSSParsing() (#49313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49313

When the flag is enabled, we expect legacy native viewconfigs to add processor, where SVCs do not, and instead parse in native. Don't emit warnings in this case.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D69337802

fbshipit-source-id: f4c354c3b7b6ecbe4a8a72a37ea6d60dcc336b67
2025-02-10 14:32:26 -08:00
Nick GerlemanandFacebook GitHub Bot 69c3c55ddb Add "enableNativeCSSParsing" feature flag (#49314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49314

Add a flag which we will use to prefer Fabric CSS parser to ViewConfig processors. We will use this to experiment on iOS, where we are using Fabric props (until Props 2.0 for Android).

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69337803

fbshipit-source-id: e3d4faeecbadb138c0a58f3fca6dba79eb7b13fa
2025-02-10 14:32:26 -08:00
David VaccaandFacebook GitHub Bot c60f6fbb2a Make UIBlock.execute params non nullable
Summary:
Make UIBlock.execute params non nullable to avoid breaking changes for kotlin usages in OSS

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69407325

fbshipit-source-id: 5fc01fba9baba97e21a388d02cf98d5aebb5ac20
2025-02-10 14:12:32 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d4236791e2 Properly handle null values coming from JS (#49250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49250

The TurboModule System decided to ignore the Null values when they are coming to JS. However, in iOS, null value can be mapped to `[NSNull null];` and this value is a valid value that can be used on the native side.

In the old architecture, when the user were sending a null value from JS to a native module, the Native side was receiving the value.

In the New Architecture, the value was stripped away.

This change allow us to handle the `null` value properly in the interop layer, to restore the usage of legacy modules in the New Arch.

I also tried with a more radical approach, but several tests were crashing because some modules do not know how to handle `NSNull`.

See discussion happening here: https://github.com/invertase/react-native-firebase/issues/8144#issuecomment-2548067344

## Changelog:
[iOS][Changed] - Properly handle `null` values coming from NativeModules.

Reviewed By: sammy-SC

Differential Revision: D69301396

fbshipit-source-id: be275185e2643092f6c3dc2481fe9381bbcf69e9
2025-02-10 10:14:08 -08:00
Iwo PlazaandFacebook GitHub Bot e74246bd66 Migrate files in Libraries/PermissionsAndroid and Libraries/PushNotificationIOS to use export syntax (#49046)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49046

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates files in `Libraries/PermissionsAndroid/*.js` and `Libraries/PushNotificationIOS/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/PermissionsAndroid` and `Libraries/PushNotificationIOS` with `require` syntax has to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68832494

fbshipit-source-id: 4c44667856f5ad76b32a27a603a6538704c3192c
2025-02-10 09:47:27 -08:00
Jakub PiaseckiandFacebook GitHub Bot d4506c30d7 Use local version of flow-api-translator when building TS types (#49294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49294

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69237317

fbshipit-source-id: 8cfffb85cbb05cd1edb18358dbdea68aac84f988
2025-02-10 08:33:12 -08:00
Samuel SuslaandFacebook GitHub Bot b8b586b649 remove unused feature flag: enableGranularShadowTreeStateReconciliation (#49292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49292

changelog: [internal]

remove feature flag enableGranularShadowTreeStateReconciliation which was introduced in August 2023 and isn't rolled out.

Reviewed By: rshest

Differential Revision: D69393016

fbshipit-source-id: a1730f9811b1d8476d845e0303647b4d85f6b4a0
2025-02-10 08:08:35 -08:00
chrsmysandFacebook GitHub Bot e7556e921c Ensure the performance monitor stays on top of newly added views. (#49288)
Summary:
I noticed that the performance monitor UI gets hidden under newly presented UI. This change ensures that the performance monitor container is brought to the front of the window whenever stats are updated.

## Changelog:
[IOS] [FIXED] - Issue where performance monitor would be hidden under newly presented views.

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

Test Plan:
### Before

https://github.com/user-attachments/assets/b2d787a3-2fec-4863-87a6-2244d2727dee

### After

https://github.com/user-attachments/assets/0700e4af-3ca1-4e67-a5e1-19b13f6ca1c9

Reviewed By: rshest, cipolleschi

Differential Revision: D69394527

Pulled By: javache

fbshipit-source-id: 07fc0804f765c25046bd83a5f8549084973586dc
2025-02-10 07:45:17 -08:00
zhongwuzwandFacebook GitHub Bot f2c78af56a Reland: [iOS] [Fabric] Fixes crash of dynamic color when light/dark mode changed (#49265)
Summary:
Reland https://github.com/facebook/react-native/issues/48496 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes crash of dynamic color when light/dark mode changed

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

Test Plan: RNTester -> PlatformColor example -> changed the dark/light mode in the system settings -> go back to App and pop and push the PlatformColor example, it would crash:

Reviewed By: javache

Differential Revision: D69309825

Pulled By: cipolleschi

fbshipit-source-id: 7a533a73ef343b071000388b653b2d1d0c54ae88
2025-02-10 06:44:43 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot b1735bc593 fix: make React native compatible with Ruby 3.4.0 (#49293)
Summary:
Hey,

This PR fixes compatibility with Ruby 3.4.0 as it removed some libraries from the standard library.

When installing pods I encountered this error:

![CleanShot 2025-02-10 at 11 26 20@2x](https://github.com/user-attachments/assets/7f7dc302-7f54-45dc-a4d9-9f011d5cc003)

After adding those dependencies, the error is gone:

![CleanShot 2025-02-10 at 11 27 01@2x](https://github.com/user-attachments/assets/386315d4-c6bd-4722-b63d-61ec1f44846f)

## Changelog:

[IOS] [FIXED] - Compatibility with Ruby 3.4.0

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

Test Plan: Install pods on Ruby 3.4

Reviewed By: vzaidman

Differential Revision: D69397346

Pulled By: cipolleschi

fbshipit-source-id: 2e29c0529e5342b8d29f2d296bd11802cb5a2885
2025-02-10 06:38:26 -08:00
Alex HuntandFacebook GitHub Bot 1cfc53bb70 Improve error log for failed open-debugger fetch (#49295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49295

Motivated by https://github.com/facebook/react-native/issues/49287.

This improves on the less useful output of "fetch failed" currently. We expect failing to make a request to the dev server (made from the dev server!) to be a rare edge case, in which case we want to log as much info as possible.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D69395983

fbshipit-source-id: ee96d72ade5a887d190397c3b798a5b545152587
2025-02-10 06:01:48 -08:00
Pieter De BaetsandFacebook GitHub Bot 4e2f5bd7ea Complete rollout of shouldSkipStateUpdatesForLoopingAnimations (#49296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49296

Already fulled out by default in OSS and internally.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D69395210

fbshipit-source-id: 39b0d6f7a1a186d132d93105e360717835b442c5
2025-02-10 05:53:42 -08:00
Samuel SuslaandFacebook GitHub Bot e692ae1506 avoid copy of shadowView in Differentiator (#49268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49268

changelog: [internal]

ShadowView has three shared_ptr and copying those can be avoided here. Let's use std::move.

Reviewed By: NickGerleman

Differential Revision: D69303346

fbshipit-source-id: b13103369f6423610dd8f8ccb293e59f04acc5dc
2025-02-10 05:01:42 -08:00
Dawid MałeckiandFacebook GitHub Bot 13f4b7619d Generate TS types for LogBox and Systrace (#49160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49160

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D69053361

fbshipit-source-id: f877efe11aa9cd29257d3ac34b040e70ec8746d5
2025-02-10 04:09:03 -08:00
kewdeandFacebook GitHub Bot 385dd59c0a perf: fast _getFreeIndex (#48925)
Summary:
The performance of `_getFreeIndex` is quite terrible since the `timersID` array can get quite large when you spawn a lot of promises or timers. We profiled our application for 28 seconds on RN 0.71.11 and noticed that the `indexOf` into this array was consuming almost a second.

The hermes version that we are using has a pretty slow  `indexOf` compared to other engines, and the static hermes will improve it by 12x but for the time being, this is a perf issue. https://github.com/facebook/hermes/pull/1447

We avoid having to use `indexOf` by maintaining a list of the free ids.

**Before - Samsung Galaxy A52 for 28 seconds of profiling**
![image](https://github.com/user-attachments/assets/e669ed62-58d8-4d11-8a85-a82816b3792d)

**After - Samsung Galaxy A52 for 28 seconds of profiling**
![image](https://github.com/user-attachments/assets/48cd369f-0887-4683-920c-43068d0228b0)

## Changelog:

[INTERNAL] [FIXED] - Improve performance of _getFreeIndex

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

Test Plan: -  Tests pass, promises resolve and reject correctly, setTimeout works as expected

Reviewed By: javache

Differential Revision: D69059102

Pulled By: cipolleschi

fbshipit-source-id: d7de2c4adcf4dfc1d15e597e2a801e23c8d652aa
2025-02-10 03:43:58 -08:00
Mateo GuzmánandFacebook GitHub Bot fd36a51456 Remove unnecessary RobolectricTestRunner usage (#49290)
Summary:
Was going through some tests and I notice several files that use `RobolectricTestRunner` unnecessarily. This PR cleans that up.

## Changelog:

[INTERNAL] - Remove unnecessary RobolectricTestRunner usage

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

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

Reviewed By: cipolleschi

Differential Revision: D69383948

Pulled By: cortinico

fbshipit-source-id: 6102319115240267ba83a086d03a850d1b7cdae5
2025-02-10 02:32:12 -08:00
Jakub PiaseckiandFacebook GitHub Bot c0415adb11 Add transform that replaces requires with imports (#49228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49228

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69247874

fbshipit-source-id: 8b4ea4b358c1c8714237e0109cf5a9492528016b
2025-02-10 01:32:35 -08:00
Rob HoganandFacebook GitHub Bot 47a21740cd Scripts: remove checked-in debugger; statements (#49289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49289

These snuck in, presumably accidentally, via https://github.com/facebook/react-native/pull/49164.

This interferes with running test suites with a debugger connected (e.g, when debugging Jest itself).

(Aside: we should probably enable [`eslint/no-debugger`](https://eslint.org/docs/latest/rules/no-debugger) to catch these)

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D69377992

fbshipit-source-id: 5d51d18be76f9b01852b2e5b7297b95452f36d55
2025-02-10 00:52:43 -08:00
David VaccaandFacebook GitHub Bot b45a3e5cd8 Introduce new BuildConfig to determine if the new architecture is fully enabled into an Android app (#49283)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49283

In this diff I'm introducing a new BuildConfig called UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE to determine if the new architecture is fully enabled into an Android app at build time, fully enabled means:
- no interop
- all view managers migrated to new API
- all native modules migrated to new API
- legacy architecture can be stripped

This BuildConfig is different from ReactNativeFeatureFlags.enableBridgelessArchitecture() because the latter is controlled at runtime, BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE is used at the build system level and it can be accessed from proguard to optimize code that's unused when the app is fully running in the new architecture. Additionally we will use the BuildConfig to assert that some classes and methods are not loaded or executed.

changelog: [Android][Changed] Introduces BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE to determine if the new architecture is fully enabled into an Android app

Reviewed By: cortinico

Differential Revision: D69206248

fbshipit-source-id: f60a059be8333d3051eb7d2efac79939a479f6f8
2025-02-09 02:17:38 -08:00
Nick GerlemanandFacebook GitHub Bot 7b7c45030b Filter function parsing (#49281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49281

Adds `CSSFilterFunction`, decomposing to the various filter types, alongside `CSSFilterList`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69212763

fbshipit-source-id: 8aade5ef4725aaad2548b6ef30d8aa1298803cd5
2025-02-07 18:14:42 -08:00
Nick GerlemanandFacebook GitHub Bot 8bd01c7d01 Fix incorrect tokenization of non-exponential numbers ending with "E" (#49280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49280

We were incorrectly consuming an `E` at the end of number tokens, even if not followed by a digit, which breaks dimension tokens where the unit starts with "E", like `em`. Follow the spec the right way:

https://www.w3.org/TR/css-syntax-3/#consume-number

> If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E) or U+0065 LATIN SMALL LETTER E (e), optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+), followed by a digit, then...

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69330975

fbshipit-source-id: a9bd5bceac9efbf02c1b7fb60659093774bb7228
2025-02-07 18:14:42 -08:00
Nick GerlemanandFacebook GitHub Bot f40d69f06d Reduce transform parsing duplication (#49279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49279

I ended up using this same pattern for filter parsing where the logic betweeen functions is very similar. Let's deduplicate the logic for transform parsing a bit. This also separates `rotate()` and `rotateZ()` types, to be handled the same at a different layer.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69326443

fbshipit-source-id: 9bf910c6d4e07748ff032433167576f9d58cd8d6
2025-02-07 18:14:42 -08:00
Sam ZhouandFacebook GitHub Bot 722f5ba786 Remove global React$ type references (#49276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49276

This diff replaces the remaining `React$` global types in the codebase, in preparation for their removal in Flow.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69322418

fbshipit-source-id: 058a2489ce8e6bf59df2ec4e61e9708f63561671
2025-02-07 18:01:43 -08:00
Thomas NardoneandFacebook GitHub Bot 94b5d4b53f Flip SurfaceMountingManager null view state SoftException to not crash (#49271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49271

This error is somewhat expected, so causing the red box error popup is a bit too disruptive.  Flip it to a no-crash exception.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D69125274

fbshipit-source-id: 0dc7ac59ac8637bdabde25bd8886b1aebf175395
2025-02-07 15:10:36 -08:00
Peter AbbondanzoandFacebook GitHub Bot 58e163c74e Replace magic number for unset child view id (#49277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49277

Replaces the `-1` magic number representing unset children with a named constant

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D69324509

fbshipit-source-id: 64fb6c920a7715f5d15d3955564a8bf2b6ce404a
2025-02-07 15:10:23 -08:00
David VaccaandFacebook GitHub Bot 847f8902ff Update non-codegen ViewManagerInterfaces to extend ViewManagerWithGeneratedInterface (#49274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49274

In this diff I'm updating all the non-codegen ViewManagerInterfaces to extend ViewManagerWithGeneratedInterface to make it consistent with codenerated ViewManagerInterfaces

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69206247

fbshipit-source-id: 6a577d9ee7410be990a03e78847333b61b429e88
2025-02-07 14:28:12 -08:00
David VaccaandFacebook GitHub Bot 6e0e72df71 Update documentation for OSSReleaseStageValue
Summary:
Update documentation for OSSReleaseStageValue

changelog: [internal] internal

Reviewed By: cortinico, alanleedev

Differential Revision: D69268799

fbshipit-source-id: 9f2fa5fc8363c5afd159f9a785d9b613548d8734
2025-02-07 13:46:51 -08:00
Thomas NardoneandFacebook GitHub Bot 83fd1742da Lazily create args in ResponseUtil (#49270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49270

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D69316855

fbshipit-source-id: 1c7f58cb9364540c5bf7309b6c2f81162efcc178
2025-02-07 12:39:11 -08:00
Rob HoganandFacebook GitHub Bot fc15260f1c Update monorepo Jest to 29.7.0 (#49261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49261

Update the version of Jest used in React Native and Metro's own tests from `^29.6.3` to `^29.7.0`

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69307514

fbshipit-source-id: 686935ed4ba1334d445217fd2f8a303b774b6c4a
2025-02-07 11:27:18 -08:00
Samuel SuslaandFacebook GitHub Bot 14540e6abf refactor Point.h and add unit tests (#49249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49249

changelog: [internal]

- Make all Point methods inline as per [C++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f5-if-a-function-is-very-small-and-time-critical-declare-it-inline).
- Add unit tests for Point.
- Use default == and != operator.

Reviewed By: javache

Differential Revision: D69239807

fbshipit-source-id: c5926d587a7888f54895cb7b1a62a23dc26242a3
2025-02-07 09:37:55 -08:00
Samuel SuslaandFacebook GitHub Bot 947d9c3897 introduce Fabric View Culling (#49198)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49198

changelog: [internal]

The work done on the main thread should scale with what is on the screen. React Native shouldn’t block the main thread for off screen elements that do not affect what is shown to the end user. When React schedules a commit, only views needed to achieve a screen full of content should be materialised and added to the host platform’s view hierarchy.

With Fabric View Culling, views that do not contribute pixels to the screen will not materialize and updates to them will be skipped. React Native will focus system resources on what is visible to the end user.

Fabric View Culling maximises benefits from view recycling. Each UI element such as text, image, or video is recycled individually. As soon as an item goes off screen, it can be reused anywhere in the UI and pieced together with other items to create new UI elements. Such recycling reduces the need of having multiple view types and improves memory usage and scroll performance.

In the example bellow, view B will not be mounted because the user can't see it.
 {F1974949953}

The difference in number of allocated views:
Please note, the screenshots below are from Xcode View Hierarchy debugger. To show how many views are allocated in memory, I disabled [removeClippedSubviews](https://reactnative.dev/docs/scrollview#removeclippedsubviews) flag globally.
|Before|After:
| {F1974949979}| {F1974949981}

# Disclaimer, this is not a complete implementation
This implementation is not complete and it is missing to handle edge cases.
Things that are missing:
- Transform style is not taken into account.
- removeClippedSubviews is not respected. Fabric View Culling happens unconditionally for every scroll view.
- Fabric View Culling does not respect when ScrollView has overflow set to visible.
- Fabric View Culling is only performant enough on iOS.
- [enableSynchronousStateUpdates](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js#L248) must be enabled for Fabric View Culling to work correctly.

Reviewed By: javache

Differential Revision: D63458372

fbshipit-source-id: c93ec434081f2be8a446212e2c0681f8ae4e90f9
2025-02-07 09:37:55 -08:00
Samuel SuslaandFacebook GitHub Bot 68a17f2651 add getOverflowInsetFrame to LayoutMetrics (#49197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49197

changelog: [internal]

Adds new method to LayoutMetrics that calculates frame adjusted for overflow inset.

For example, for the following view hierarchy. it would produce a frame that would fully contain view A and view B.
```
┌─────────────┐
│<View A />   │
│     ┌───────┴─────┐
└─────┤<View B />   │
      │             │
      └─────────────┘
```

See tests for more details

Reviewed By: javache, lenaic

Differential Revision: D68775683

fbshipit-source-id: b8f7c42cfca7dba8dcae75cae5e6944bd1082957
2025-02-07 09:37:55 -08:00
Samuel SuslaandFacebook GitHub Bot 4fa2064905 introduce feature flag for View Culling (#49196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49196

changelog: [internal]

introduces feature flag for Fabric View Culling. Not used anywhere yet.

Reviewed By: christophpurrer

Differential Revision: D68775684

fbshipit-source-id: 612362dd142cea48f38e00e65e942bcfd8580da2
2025-02-07 09:37:55 -08:00
Alex HuntandFacebook GitHub Bot f96f1a6e11 Add signedsource and generated header to build-types (#49259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49259

Also exclude `types_generated/` under ESLint + Prettier — paired with the removed `format` annotation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D69306215

fbshipit-source-id: f2bfbeb3ce691ebf86b63fc498ae3847873c83ee
2025-02-07 08:40:09 -08:00
Alex HuntandFacebook GitHub Bot 0d7379b9fe Tree-shake non-type imports (#49258)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49258

Updates dependency resolution in `yarn build-types` to happen after the `translateFlowToFlowDef` step. This means that we prune all non-type imports, massively reducing the input files of the program when building types only.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D69302812

fbshipit-source-id: aa80bea17cb584b747cb31c003e87fe00afd1e16
2025-02-07 08:40:09 -08:00
Alex HuntandFacebook GitHub Bot a7a513fc96 Add module resolution to build-types (#49257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49257

Adds minimal dependency resolution to `yarn build-types`.

- This enables us to opt in React Native APIs by entry point, with the build script resolving all necessary dependencies. Improves correctness and removes concern of globbing paths manually.

Other notes:

- The `ActionSheetIOS.js` entry point is temporarily disabled as input; needs further work.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D69255015

fbshipit-source-id: 2d99c014b50e41e4695549f46ca874a2b546f545
2025-02-07 08:40:09 -08:00
Tim YungandFacebook GitHub Bot 5635d5c0a3 RN: Avoid Rejections in InteractionManagerStub (#49241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49241

In auditing differences between `InteractionManager` and `InteractionManagerStub` (used to evaluate to entirely remove the former all together), I noticed a behavioral disparity with how errors are handled.

In `InteractionManager`, the promise that's returned is never rejected, whereas `InteractionManagerStub` propagates errors by rejecting the promise that's returned. This changes `InteractionManagerStub` to behave like `InteractionManager` for the purpose of comparing apples-to-apples.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D69275495

fbshipit-source-id: 05439a0cadc1f76b34a3f1457f7db31d6bda2a90
2025-02-07 08:18:42 -08:00
Rob HoganandFacebook GitHub Bot 57c291bbc4 Fantom: Use hierarchical resolution within node_modules in Metro config
Summary:
Fantom was disabling Metro hierarchical lookup in all cases when `JS_DIR` is set. The intention is that `node_modules` folders other than the configured `JS_DIR/public/node_modules` are not used.

However, this leads to incorrect resolution where a transitive dependency is not hoisted. If the origin of the resolution is already inside `node_modules`, we must perform a hierarchical lookup to avoid picking up just whichever version happens to be hoisted to `node_modules` root.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69303559

fbshipit-source-id: 12068fb0bebb8c2f81b64c23b952a623cb6fd792
2025-02-07 07:52:43 -08:00
Rubén NorteandFacebook GitHub Bot 10e47e69aa ] Add Fantom test placeholder for LogBox (#49252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49252

Changelog: [internal]

This adds a Fantom test placeholder for LogBox, which shows what type of tests we could be writing for this.

It also adds a few ids in LogBox components so we can inspect them in tests and make assertions on them.

Reviewed By: javache

Differential Revision: D69301572

fbshipit-source-id: 89a332a47c300c1dc18937cd91206ce6d820b6aa
2025-02-07 07:47:32 -08:00
Rubén NorteandFacebook GitHub Bot b006080949 Expose rootTag in Root (#49251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49251

Changelog: [internal]

Components like `AppContainer` require passing the rootTag as a prop, but we don't have access to it from Fantom unless we render something in the root and access it via the RootTagContext. This exposes the rootTag of the Root as a method so we can use it in initial render too.

Reviewed By: javache

Differential Revision: D69301571

fbshipit-source-id: 429fb56d937d3dffeb3c17a70d136ba4925ece8e
2025-02-07 07:47:32 -08:00
Rubén NorteandFacebook GitHub Bot 9a1dadf799 Introduce Fantom.dispatchNativeEvent utility (#49254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49254

Changelog: [internal]

This is just a convenience method to do:

```
Fantom.dispatchNativeEvent(node, 'click');
```

Instead of:

```
runOnUIThread(() => {
  enqueueNativeEvent(node, 'click');
});

runWorkLoop();
```

Which is too verbose and people rarely need this level of granularity in tests.

Note that, in Fabric, we have methods called `dispatchEvent` that don't match 1:1 with this API. In that case, `dispatchEvent` is more aligned with Fantom's `enqueueNativeEvent`.

Reviewed By: javache

Differential Revision: D69302382

fbshipit-source-id: 6f71a5ace11c81f551df2c2837881dbc6f48e7ba
2025-02-07 07:47:32 -08:00
Rubén NorteandFacebook GitHub Bot 03c7316ab0 Rename dispatchNativeEvent as enqueueNativeEvent (#49253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49253

Changelog: [internal]

Renaming this low level method as `enqueue` is more accurate in this case than `dispatch`, which is misleading because it actually doesn't dispatch it to JS.

We should also rename this in Fabric, but that's a larger and breaking change, so just making the change in Fantom for now. This is a trade-off between convenience/ergonomics of the testing API vs. alignment with the internal nomenclature. In this case we favor the first.

Reviewed By: javache

Differential Revision: D69302383

fbshipit-source-id: 7e163920ace709503367bf68baab5e9f2bf8ae3f
2025-02-07 07:47:32 -08:00
Dawid MałeckiandFacebook GitHub Bot 09740c9001 Add Share path to build-types script and align Flow with TS types (#49167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49167

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D69119294

fbshipit-source-id: 5d7a10fee47da8d8ffa07f8481060d0176618ce9
2025-02-07 04:56:26 -08:00
Mateo GuzmánandFacebook GitHub Bot 2e7c84ba00 Make MultiPostprocessor internal (#49237)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.image.MultiPostprocessor).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.image.MultiPostprocessor internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cipolleschi

Differential Revision: D69293117

Pulled By: cortinico

fbshipit-source-id: 7e2713520a5a4fe492fb9d25cdd92c46746ded40
2025-02-07 04:01:37 -08:00
Nicola CortiandFacebook GitHub Bot 5ab6e7ad3f Remove unnecessary public modifiers from ComponentNameResolver (#49231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49231

Those public modifier have no meaning as the class is internal. I'm removing them.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D69252048

fbshipit-source-id: b51e5ac20338a01291d6cd04ee4c990cc8a6a755
2025-02-07 02:39:12 -08:00
Pieter De BaetsandFacebook GitHub Bot f25e35ae4a Revert visibility change of ReactCookieJarContainer (#49247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49247

This was incorrectly made internal in https://www.internalfb.com/diff/D66724567

Changelog: [Android][Removed] Made ReactCookieJarContainer internal.

Reviewed By: cortinico, andrewdacenko

Differential Revision: D69254203

fbshipit-source-id: 5c4ba9b4f9a8e53002df25b55f0c8762874e6736
2025-02-07 02:39:01 -08:00
Nicola CortiandFacebook GitHub Bot 2f784ce9a5 Undo a breaking change on ReactOverflowView (#49229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49229

This interface was converted to Kotlin, but the single method should have been converted to a `val`.
People kotlin consumers could call ReactOverflowView.overflow; now they need to call getOverflow().

Changelog:
[Internal] [Changed] - Undo a breaking change on ReactOverflowView

Reviewed By: NickGerleman

Differential Revision: D69250226

fbshipit-source-id: 5c7cca8c83f5c76a9cc1d254f8aa51409150c356
2025-02-07 02:10:38 -08:00
Nicola CortiandFacebook GitHub Bot 5a4962a0c1 Undo breaking change in ReactPointerEventsView due to Kotlin conversion (#49233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49233

I'm converting the function inside ReactPointerEventsView from `fun` to `val`.
This Kotlin conversion resulted in a breakign change for Kotlin consumer which I believe can be prevented
if we do this change instead.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D69252562

fbshipit-source-id: b277c6720f3156ed532bf5f2253d54cd72e38050
2025-02-07 02:07:24 -08:00
Janic DuplessisandFacebook GitHub Bot 2aed264695 Fix exclude .d.ts test in GenerateCodegenSchemaTaskTest (#49238)
Summary:
I wanted to test exclusion of .d.ts files in https://github.com/facebook/react-native/pull/49227, but it also has node_modules so it will not test that condition correctly.

## Changelog:

[INTERNAL] [FIXED] - Fix exclude .d.ts test in GenerateCodegenSchemaTaskTest

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

Test Plan: Run tests

Reviewed By: cipolleschi

Differential Revision: D69291695

Pulled By: cortinico

fbshipit-source-id: 46b9367f3466b9cd49232a0565e5778a06b43990
2025-02-07 01:55:34 -08:00
Nick GerlemanandFacebook GitHub Bot b34e63539d Disallow invalid unitless lengths in filters (#49242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49242

Same bug as in D68740553, copy/pasted. Unitless numbers are not valid <length> apart from `0`.

Changelog:
[General][Breaking] - Disallow invalid unitless lengths in filters

Reviewed By: javache

Differential Revision: D69210768

fbshipit-source-id: c20a3aa1e9dbc84f636235a70c58e4d96dbe86b9
2025-02-06 21:02:24 -08:00
Nick GerlemanandFacebook GitHub Bot e2a776f322 transformOrigin Parsing (#49216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49216

Should be able to replace `processTransformOrigin`.

As part of this, I discovered `processTransformOrigin` has a bug where it does not correctly support `center left` or `center right` syntax since it assumes first occurrence of `center` is for the horizontal

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69204030

fbshipit-source-id: 8001ef4f0b54fcbe93855920260e077b89669f6d
2025-02-06 21:02:24 -08:00
Nick GerlemanandFacebook GitHub Bot 36adaf4c0b Transform parsing (#49189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49189

Allow parsing the set of currently supported transform functions, and lists of them, using `CSSTranformFunction` (which may decompose to e.g. `CSSScaleX`), and `CSSTransformList`.

A bit more duplication than I would like here, but a lot of these have subtle differences.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69153280

fbshipit-source-id: ef8e93c8a49a7f1b98bd7c57614aa1c84417120d
2025-02-06 21:02:24 -08:00
Peter AbbondanzoandFacebook GitHub Bot 99212cf6f3 Backout of "[xplat/js][RN][metro][socialvr] Update monorepo Jest to 29.7.0" (#49239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49239

Changelog: [Internal]

Reverts https://github.com/facebook/react-native/pull/49213 which is causing some internal test failures

Reviewed By: makovkastar

Differential Revision: D69266554

fbshipit-source-id: bc70286c049b90813ee7ff641adabdf98ea890e0
2025-02-06 19:20:10 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5d4f9467d9 Add changelog for 0.75.5 (#49234)
Summary:
Add changelog for 0.75.5

## Changelog:
[Internal] - Add changelog for 0.75.5

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D69256092

Pulled By: cipolleschi

fbshipit-source-id: 946d9edabe1e808d2a916892ab1a978bd7f5855f
2025-02-06 14:40:18 -08:00
Nicola CortiandFacebook GitHub Bot 442a368af5 Remove unnecessary public modifiers from FrescoBasedReactTextInlineImageViewManager (#49230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49230

Those public modifier have no meaning as the class is internal. I'm removing them.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D69251378

fbshipit-source-id: 4c3747510d18330dcdb8a0798e92736c4ab65a03
2025-02-06 13:32:53 -08:00
shubhamguptadream11andFacebook GitHub Bot ea876054cf feat: added new workflow for issue monitoring in react native (#49225)
Summary:
While triaging issues in the React Native repository, we face two major challenges:

- Missing Issues: The large volume of issues makes it difficult to ensure that none are overlooked.
- Ownership: There is no structured process to determine who should handle which issue.

To address these challenges, we are setting up this action.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Added a new workflow to monitor new issue in repo.

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

Here we are using this github action: https://github.com/react-native-community/repo-monitor to monitor new issues and then notify it on specific discord server to notify someone.

Currently this action runs every 6 hours.

Requirements:
- We need following inputs to make this workflow run:
   -  `DISCORD_WEBHOOK_URL` to be added in secrets [Needed for posting message in specific channels]
   -  `role_id`: To notify a group.

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

Test Plan: NA

Reviewed By: cipolleschi

Differential Revision: D69254130

Pulled By: cortinico

fbshipit-source-id: 43a57f8f3bf161042a9432d02f292896ea8f7622
2025-02-06 13:15:29 -08:00
Janic DuplessisandFacebook GitHub Bot e9e0d8c2f7 Improve input files for codegen gradle task (#49227)
Summary:
In some projects we have conventions of using .tsx extension even for files without react components, we had issues where codegen wasn't updated properly.

I debugged the files included in a large project and made some improvements:

- Include tsx and jsx files
- exclude nested node_modules
- exclude ts type def files

## Changelog:

[ANDROID] [FIXED] - Improve input files for codegen gradle task

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

Test Plan: Tested in a large app using codegen. I inspected the files that are included in the task inputs and made sure it works with first party and 3rd party modules.

Reviewed By: cipolleschi

Differential Revision: D69254204

Pulled By: cortinico

fbshipit-source-id: 368408e9719e9b5c9839dd873430b86ae4a062c7
2025-02-06 11:52:25 -08:00
Nicola CortiandFacebook GitHub Bot a5d9044158 Fix minor typo in 0.78 changelog (#49232)
Summary:
Just a minor typo in the changelog for 0.78

## Changelog:

[Internal] [Changed] -

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

Test Plan: ¯\\_(ツ)_/¯

Reviewed By: cipolleschi

Differential Revision: D69252846

Pulled By: cortinico

fbshipit-source-id: 97010601482199c87d7a9da06e5e32a4bfa8a552
2025-02-06 11:40:10 -08:00
zhongwuzwandFacebook GitHub Bot 1e9ac296a5 Added custom load js block in bridge mode (#48845)
Summary:
`loadSourceForBridge` is broken after we refactor the appdelegate. So let's add it back.

## Changelog:

[IOS] [FIXED] - Added custom load js block in bridge mode

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

Test Plan: Custom Appdelegate's `loadSourceForBridge` can be called in bridge mode.

Reviewed By: robhogan

Differential Revision: D68832046

Pulled By: cipolleschi

fbshipit-source-id: dcea791e6d8243fdb2f45a33af175aee1a4e1223
2025-02-06 08:55:33 -08:00
Alex HuntandFacebook GitHub Bot b54efb8d0d Update multi-platform handling in build-types, add debug logs (#49224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49224

Refactor / quality pass.

- Remove `micromatch`, replace with glob ignores.
- Move and simplify platfom-specific file logic: mutate `files` as a single `Set`, reduce iterations.
    - This is reconfigured so that the input file path globs need only match `*.js` sources.
- Introduce `debug` logs and expose convenience `--debug` script flag.
- Move output error detection into inner function implementation.

Changelog: [Internal]

Metro changelog: Internal

Reviewed By: j-piasecki

Differential Revision: D69240543

fbshipit-source-id: c2faef8212a2995936362b3d33d189c405bd879d
2025-02-06 08:49:29 -08:00
Mateo GuzmánandFacebook GitHub Bot a1b05c5b86 Make SynchronousEventReceiver internal (#49218)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.events.SynchronousEventReceiver).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.events.SynchronousEventReceiver internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69242334

Pulled By: cortinico

fbshipit-source-id: 8ac7ff7d5bed43fff72233c3faa5ad9bded81ef1
2025-02-06 08:31:27 -08:00
Andrew DatsenkoandFacebook GitHub Bot 1d5cdf10fc Add .nthCalledWith and .toHaveBeenNthCalledWith (#49221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49221

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: cortinico

Differential Revision: D69133125

fbshipit-source-id: fe4e54cbb3646c154108cee6ead9a64c3e75c1b7
2025-02-06 08:02:32 -08:00
Mateo GuzmánandFacebook GitHub Bot 5506441df9 Remove unused ViewUtils object (#49219)
Summary:
As part of the initiative to reduce the public API surface, I found that this object is unused and can be removed. I've also checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.common.ViewUtils).

## Changelog:

[INTERNAL] - Remove unused com.facebook.react.views.common.ViewUtils object

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, fabriziocucci

Differential Revision: D69239590

Pulled By: javache

fbshipit-source-id: 14881f68903c8fa87966f35e6d5627e8580c9cc2
2025-02-06 07:19:07 -08:00
Mateo GuzmánandFacebook GitHub Bot 62c9ff6264 Kotlinify MessageQueueThreadPerfStats, ReactQueueConfiguration and QueueThreadExceptionHandler (#49215)
Summary:
Migrating a class holder and two remaining interfaces from com.facebook.react.bridge.queue to Kotlin

## Changelog:

[INTERNAL] - Kotlinify MessageQueueThreadPerfStats, ReactQueueConfiguration and QueueThreadExceptionHandler

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cipolleschi

Differential Revision: D69236832

Pulled By: cortinico

fbshipit-source-id: 765632740ce5023229d8dd2ddec4c069840c1d33
2025-02-06 07:06:17 -08:00
Rubén NorteandFacebook GitHub Bot c169250a36 Implement test.only in benchmarks (#49222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49222

Changelog: [internal]

This implements `test.only` in Fantom benchmarks, so we can focus on a specific case to speed up iteration.

Reviewed By: sammy-SC

Differential Revision: D69241220

fbshipit-source-id: 42b02fcb4d693988da4fa15a0c6bd7e90e473b9f
2025-02-06 05:50:19 -08:00
Rubén NorteandFacebook GitHub Bot 1902c3c4d5 Rename add as test in benchmarking API (#49223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49223

Changelog: [internal]

Renames `suite.add()` as `suite.test()` for symmetry with Jest.

We'll also allow `test.only` in a following change for quick iteration.

Reviewed By: rshest

Differential Revision: D69241221

fbshipit-source-id: d141f80dc0c8e51b419ce233bca68bf0755fd356
2025-02-06 05:50:19 -08:00
Nicola CortiandFacebook GitHub Bot e96396bd18 Fix @react-native/popup-menu-android not building for 3rd party developers (#49212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49212

Currently, developers can't use `popup-menu-android` at all because the Gradle file we publish is referencing
internal machinery.

I'm adding a pre-publish script that manipulates the Gradle. This is the easiest solution without having to do
crazy setup inside RNGP or having duplicated version codes around in the monorepo.

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

Changelog:
[Android] [Fixed] - Fix react-native/popup-menu-android not building for 3rd party developers

Reviewed By: cipolleschi

Differential Revision: D69192874

fbshipit-source-id: 9f9e8a0a6e76308e598a09f4c70dbc659c238b00
2025-02-06 05:47:37 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot ecad90ad8b fix: move view flattening props to cross platform type interface (#49220)
Summary:
Hey!

Since new architecture introduced View Flattening on iOS, props responsible for disabling this feature on specific views should be defined in cross platform interface.

Reference: https://github.com/reactwg/react-native-new-architecture/discussions/110

## Changelog:

[GENERAL] [CHANGED] - move view flattening props to cross platform type interface

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D69239454

Pulled By: javache

fbshipit-source-id: a89cb9fbaec63bbcb7691df067d5d3a375a8a66e
2025-02-06 04:12:56 -08:00
Jakub PiaseckiandFacebook GitHub Bot eae7d3c6a1 Update types exposed by Alert and the module structure (#49157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49157

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69044715

fbshipit-source-id: 05486d9c9be161a3604ef535d260f525d7c9e9d1
2025-02-06 03:59:28 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9d4c4b2741 Fix typo in verifyReleaseOnNPM-test file (#49207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49207

Renamed `verifyReleaseOnNPM-test` to `verifyRNReleaseOnNpm-test`.

## Changelog:
[Internal] - rename a test file for CI script

Reviewed By: huntie

Differential Revision: D69183614

fbshipit-source-id: 7a2c2804617f380758a53438598bb6fe0e27e68d
2025-02-06 03:39:15 -08:00
Dawid MałeckiandFacebook GitHub Bot 5f110c416b Add Settings path to build-types script and align Flow with TS types (#49175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49175

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D69121991

fbshipit-source-id: 022d56e823aae884ce10fd24cc9701b02db19e9f
2025-02-06 03:02:42 -08:00
Nicola CortiandFacebook GitHub Bot 091f8cf506 Add changelog for 0.76.7 (#49214)
Summary:
Add changelog for 0.76.7

## Changelog:

[Internal] [Changed] -

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D69198059

Pulled By: cortinico

fbshipit-source-id: 0f9c22ad8d175d1afab4f9eb59753834b079d756
2025-02-06 02:49:48 -08:00
Rob HoganandFacebook GitHub Bot d5c1647a29 Update monorepo Jest to 29.7.0 (#49213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49213

Update the version of Jest used in React Native and Metro's own tests from `^29.6.3` to `^29.7.0`

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D69188217

fbshipit-source-id: 0748db5428e422c048454b7d129cbdd4dab6d687
2025-02-05 21:42:48 -08:00
Nick LefeverandFacebook GitHub Bot 04279cea78 Remove RSNRU feature flag after holdout cleanup (#49146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49146

Runtime Reference ShadowNode Update is enabled by default and no longer referenced in the RN holdout. This diff:
- removes the feature flag
- removes all references to the feature flag, enabling it
- updates the unit test for RSNRU

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D69061234

fbshipit-source-id: 0dab0b5cae99e83297f34645dee58ae9b3c0dc5f
2025-02-05 18:55:46 -08:00
Thomas NardoneandFacebook GitHub Bot ca5ce205f7 Add separate flags for recycling View, Text components (#49211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49211

Add more control over view recycling behavior by splitting out each component that currently supports it.

Changelog:[Android][Added] Feature flags for recycling View, Text components separately

Reviewed By: sammy-SC, mdvacca

Differential Revision: D69190841

fbshipit-source-id: 6d85fee7103bf928e4f5bf6946bab3ff4cae4053
2025-02-05 18:36:06 -08:00
Tim YungandFacebook GitHub Bot fb8a6a5bb0 Animated: Avoid In-Band State Update (#49184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49184

D65645985 shipped a refactor to `Animated`, so that it would use a custom `useAnimatedPropsMemo` instead of `useMemo`. This significantly improved update performance by no longer invalidating the `AnimatedProps` on effectively every update to `Animated` components.

However, this was measured to increase memory usage. After a few experiments, we identified that use of the in-band state update was responsible for the memory regression. While this requires further root cause investigation, this diff attempts to mitigate the memory regression.

This diff introduces a feature flag that enables an implementation that minimizes duplicated work, such as unnecessarily computing `compositeKey` or creating new instances of `AnimatedProps`. In addition, this implementation strives to do so without significantly degrading when an update is interrupted by a concurrent update.

Changelog:
[General][Changed] - Introduced a feature flag to test an optimization in `Animated` to reduce memory usage.

Reviewed By: rickhanlonii

Differential Revision: D69135223

fbshipit-source-id: a2699a314625e7570698bc41455b139711cfd7e3
2025-02-05 16:24:37 -08:00
David VaccaandFacebook GitHub Bot bdb394f754 Extend ReactNativeFeatureFlags to support prereleaseChannels (#49141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49141

This diff extends ReactNativeFeatureFlags to support prereleaseChannels, the goal is to be able to configure what release channel each feature flag will be enabled / disabled

changelog: [internal] internal

Reviewed By: rubennorte

Differential Revision: D68583324

fbshipit-source-id: 09fde8511dcf5dff63821f15afe0a2530a0845fd
2025-02-05 13:36:21 -08:00
Mateo GuzmánandFacebook GitHub Bot dab8f6097e Make ProcessorBase internal (#49181)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.annotationprocessors.common.ProcessorBase).

## Changelog:

[INTERNAL] - Make com.facebook.annotationprocessors.common.ProcessorBase internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D69178806

Pulled By: cortinico

fbshipit-source-id: 3f4b211fcdfdb5e0614b7d25f29879984b7ae255
2025-02-05 12:53:49 -08:00
Andrew DatsenkoandFacebook GitHub Bot 2080f64f03 Add .lastCalledWith and .toHaveBeenLastCalledWith (#49210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49210

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69131600

fbshipit-source-id: bf7a740a4e830c5ce3403d8489bc3439428ee7b4
2025-02-05 12:52:21 -08:00
Peter AbbondanzoandFacebook GitHub Bot 6c87b748f3 Remove loadVectorDrawablesOnImages feature flag (#49183)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49183

The feature has been released to all for quite some time now and the holdout group has finally been unlinked. This removes all references to the feature flag and a few indicators that the feature is enabled/disabled from RNTester

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D69146787

fbshipit-source-id: 8a7f01016a715e61541910630d8c3ceb84ec5c82
2025-02-05 11:10:29 -08:00
Andrew DatsenkoandFacebook GitHub Bot b30a5f8ab2 Add .toBeCalledWith and .toHaveBeenCalledWith (#49177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49177

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69123826

fbshipit-source-id: 53c550970d1cd2434f52a400ad18c8611f187176
2025-02-05 10:51:08 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3033aaaef1 Remove last remnant of CircleCI from comments (#49203)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49203

There are some leftover references to CircleCI in some comments. Let's remove it.

## Changelog:
[Internal] - Remove remaining CircleCI references from comments

Reviewed By: huntie

Differential Revision: D69182573

fbshipit-source-id: ea6cfe98422527d094ad4410cdd2a1a87dd61ddb
2025-02-05 09:55:00 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 07699e5838 Remove last remnant of CircleCI from npm-utils (#49202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49202

There are some leftover references to CircleCI in these scripts. Let's remove it.

## Changelog:
[Internal] - Remove remaining CircleCI references from npm-utils scripts

Reviewed By: huntie

Differential Revision: D69182550

fbshipit-source-id: d8707abba3e01c26c8d7170522333dcbc039c19d
2025-02-05 09:55:00 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 1dd464d84e Remove last remnant of CircleCI from CI scripts (#49201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49201

There are some leftover references to CircleCI in these scripts. Let's remove it.

## Changelog:
[Internal] - Remove remaining CircleCI references from CI scripts

Reviewed By: huntie

Differential Revision: D69182535

fbshipit-source-id: 4e825b65b5f5ca6ce16f5c7ac2f79088cf2d1ace
2025-02-05 09:55:00 -08:00
Andrew DatsenkoandFacebook GitHub Bot 33ff0c4789 Update toBeCalled and toBeCalledTimes aliases (#49200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49200

Changelog: [Internal]
Update to `toBeCalled` and `toBeCalledTimes` aliases - forward them using prototype so number of frames matches when thrown.

Reviewed By: rubennorte

Differential Revision: D69182276

fbshipit-source-id: c20469959dc2e0f5c3686c90e27cd80117ad5fb7
2025-02-05 08:26:50 -08:00
Jakub PiaseckiandFacebook GitHub Bot 289bdb6b1b Enable TypeScript generation for ToastAndroid (#49095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49095

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68958757

fbshipit-source-id: 3e06201936e2beda4d6a0e591dcd4a619b169795
2025-02-05 08:15:17 -08:00
Jakub PiaseckiandFacebook GitHub Bot 43f07ae9a5 Update common interface shadowing for type generation (#49205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49205

Changelog: [Internal]

Updates how name shadowing works for the TS type generation prototype to align more with how Flow does it - `.js.flow` files shadow every other file with the same name, then `.js` file (if exists) is treated as the common interface.

The script still uses `.flow.js` for common interface, which will be changed in another diff.

Reviewed By: huntie

Differential Revision: D68958772

fbshipit-source-id: caa390711f2bcd7666d875703fc316d874500a0d
2025-02-05 08:15:17 -08:00
Andrew DatsenkoandFacebook GitHub Bot 87bdfda020 Add .toContain and .toContainEqual (#49178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49178

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69130272

fbshipit-source-id: 77f45c501444700b0839a5aa7fcff807ba70641c
2025-02-05 07:43:50 -08:00
Nicola CortiandFacebook GitHub Bot c4822419c4 Add retry to yarn-install step (#49199)
Summary:
`yarn install` is failing sporadically with a 500. This should mitigate this flakyness.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: rubennorte

Differential Revision: D69180877

Pulled By: cortinico

fbshipit-source-id: 5276e2744c73df896b4bcadfecf3db61d57d198c
2025-02-05 06:43:39 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a52f5514ed Automate the check for the Release on NPM (#49164)
Summary:
One of the steps we perform when doing a release is to run `npm view react-native` to verify that the release has been published and it is available with the right tag.
As of today, we check this manually.

This change aims at automating this check so that we don't have to do it manually ourselves.

## Changelog:
[Internal] - Releases: automate the npm view check

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

Test Plan:
Created a veriftyReleaseOnNPM-tests.js jest test to verify that the script works fine.

<img width="667" alt="Screenshot 2025-02-04 at 15 18 24" src="https://github.com/user-attachments/assets/cf08155f-80da-4e15-a922-5c16f3fd806e" />

Reviewed By: cortinico

Differential Revision: D69118622

Pulled By: cipolleschi

fbshipit-source-id: a8d40cd2fcb164d8f7174de680b340510f3e8551
2025-02-05 06:33:57 -08:00
Nicola CortiandFacebook GitHub Bot bf4c887e1d Cleanup public modifiers inside LayoutDirectionUtil (#49172)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49172

Those public keywords are unnecessary, let's remove them.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D69120493

fbshipit-source-id: dbc46f340f33c54c1986813eb6a51f5cfec4790d
2025-02-05 06:28:29 -08:00
Nicola CortiandFacebook GitHub Bot 8b8b05cd1e Make WindowUtil internal (#49171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49171

This makes the `WindowUtil` class internal. I've verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.views.view.WindowUtil

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D69120492

fbshipit-source-id: ac6fe5d6a799f5eb0e572844464dc2139b5a63c9
2025-02-05 06:28:29 -08:00
Alex HuntandFacebook GitHub Bot eacd793930 Back out "Remove internal XHRInterceptor API" (#49195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49195

Reverts https://github.com/facebook/react-native/pull/49132. Turns out this is still load bearing / hard to extract.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D69177405

fbshipit-source-id: 2de0270974fa8a72a006ef16b3e472287d035065
2025-02-05 06:25:26 -08:00
Mateo GuzmánandFacebook GitHub Bot 628002205c Make AndroidChoreographerProvider internal (#49182)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.internal.AndroidChoreographerProvider).

## Changelog:

[INTERNAL] - Make com.facebook.react.internal.AndroidChoreographerProvider internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D69176905

Pulled By: cortinico

fbshipit-source-id: 63edb5a88279a5c68f9cd5afe48bbaf88a9684ff
2025-02-05 06:23:22 -08:00
Rubén NorteandFacebook GitHub Bot 6554a99c0d Add option to enable test only mode in benchmarks (#49193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49193

Changelog: [internal]

Adds an option to force test-only mode in Fantom benchmarks.

Reviewed By: javache

Differential Revision: D69176982

fbshipit-source-id: 97b23604961eb4ee8747b278a8439d0b0075dc07
2025-02-05 04:29:19 -08:00
Rubén NorteandFacebook GitHub Bot 95160c1e6b Fix testOnly behavior in CI (#49192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49192

Changelog: [internal]

We refactored the public API of Fantom benchmarks in https://github.com/facebook/react-native/pull/49014 but that refactor broke test only mode, as we started overriding the options after setting them. This fixes that.

Reviewed By: javache

Differential Revision: D69176983

fbshipit-source-id: 9afc2d2f27fb2ee0aa452d4b02c28531acf40b8e
2025-02-05 04:29:19 -08:00
Nick GerlemanandFacebook GitHub Bot 1def9fdbc9 Allow parsing lists of compound data types (#49188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49188

This allows creating lists of a compound data type, storing each element as a variant of the possible types, instead of as the specified type.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69142157

fbshipit-source-id: d742d81a6517b24f24827727cd777550f2ad274f
2025-02-04 21:51:21 -08:00
Nick GerlemanandFacebook GitHub Bot 62ea6e891c react/utils/toLower (#49187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49187

`tolower` is not `constexpr`. Share some quick utilities for char to lowercase, and case insensitive comparision that does not create new string.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69134770

fbshipit-source-id: 57a84f2d1a441e5a4c07c0db96cb6c133770fb51
2025-02-04 21:51:21 -08:00
Nick GerlemanandFacebook GitHub Bot 75097b2599 CSSCompoundDataType (#49186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49186

Next up for transforms, and for some future cases, it is convenient to be able to export a single marker type like `CSSTransform`, that can expand to a variant of multiple possible types of different shape (e.g. `CSSMatrix3D` vs `CSSScale`).

It is also best (for code size) to only have a single representation of compound types (e.g. `<CSSLength, CSSPercentage>` generates a separate copy of code compared to `<CSSPercentage, CSSLength>`).

This diff introduces `CSSCompoundDataTypes` which allows composing types, which are then flattened out to discrete types during parsing. For simplicity, `CSSCompoundDataType` cannot currently be nested inside of other `CSSCompoundDataType`, though this could be added in the future.

```
/**
 * Marker for the <length-percentage> data type
 * https://drafts.csswg.org/css-values/#mixed-percentages
 */
using CSSLengthPercentage = CSSCompoundDataType<CSSLength, CSSPercentage>;
```

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69089416

fbshipit-source-id: 8645009f06eb14b1ac4437a4fc4dd6b9ad3f88a2
2025-02-04 21:51:21 -08:00
Nicola CortiandFacebook GitHub Bot b345cecaaa Centralize yarn install to use actions/yarn-install (#49174)
Summary:
This centralizes the invocation of yarn install to be via the `actions/yarn-install`.
It will make it easier to add a retry if we want for all the `yarn install` steps in all the workflows.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D69121525

Pulled By: cortinico

fbshipit-source-id: 135da2e172cdf95b2a0ef8fd3d25996ab9317167
2025-02-04 21:12:19 -08:00
Andrew DatsenkoandFacebook GitHub Bot b0501a5be2 Add .toStrictEqual (#49176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49176

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69123117

fbshipit-source-id: 11c326f7ac4df80852409a1c9d72c911ceff21f7
2025-02-04 13:52:57 -08:00
Nick GerlemanandFacebook GitHub Bot 6a683cb268 Cleanup CSSKeyword (#49155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49155

This does some code cleanup for CSS keywords to reduce boilerplate, duplication, better isolate namespace, fix a typo, and ensure we get a warning (unused variable) if we miss handling a defined keyword.

We technically don't need `CSSKeyword` at all anymore, and don't need to overlay each keywords values to be the same, though having a pattern where each keyword set uses ordinal values from CSSKeyword forces folks to look and add the enum to the list, and include the header defining the data types for keyword sets, instead of each set looking a little magic.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69083181

fbshipit-source-id: b2764e87c2a127d73f816327c4edd45151ea8d82
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot 0cea462113 Font Variant Parsing (#49151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49151

This diff is... maybe an argument against a global list of interned keywords (it works better in some other contexts though), and this structure is likely to change later when we reintroduce what was previously `CSSPropertyDescriptor` (a list of allowed keywords per property).

But... we're going to roll with this for now to replace the ViewConfig processor (which string splits) in the most over-engineered way possible.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68851566

fbshipit-source-id: 71022f051b112adc03bd182d433e3d890e6023f2
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot b985831702 CSSWhitespaceSeparatedList (#49152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49152

For parsing a variable number of whitespace separated data types.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68849561

fbshipit-source-id: be3314990d9e7c202c02deba463d79e50985c0b7
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot 68946780d0 Support parsing <shadow> (#48991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48991

This adds support for parsing the `<shadow>` data type. In combination with `CSSCommaSeparatedList`, we can now parse box shadow expressions.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68744811

fbshipit-source-id: bac7be0faf8cd8eee04f21651180151edeef7294
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot 1624cdb29e Fix missing handling of "inset" CSS Keyword (#48990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48990

tsia

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68743950

fbshipit-source-id: 4c4814e3e83be92aea56992cc7d2c830edca99dd
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot f77fced5e2 CSSCommaSeparatedList (#48987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48987

Adds a data type parser for a variable number of values of a given single data type (at least 1).

E.g. `CSSCommaSeparatedList<CSSShadow>` will represent the syntax of `<shadow>#` (ie the value produced by box-shadow).

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D68738165

fbshipit-source-id: 6dd17b3da24b1c24808e49834a29a237c0115fab
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot 6482204523 CSSDataTypeParser consume() function (#48986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48986

This adds a new `consume()` function to data type parsers which passes a raw parser. This can be used for types which are compounds of other data types, where we may want to accept more than the first token.

This will be used for shadow parsing, but also fixes a hypothetical future bug with ratios. E.g. `calc(foo) / calc(bar)` may be a valid ratio, not starting with a token. We instead just want to try to parse a number data type from the stream.

The form of parsing a preserved token + rest is removed, with the assumption that anything parsing more than a single token should use compound parsing.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68735370

fbshipit-source-id: 660e0b4a496136c8a559f4ba47bc1bd8d17aa116
2025-02-04 12:16:40 -08:00
Nick GerlemanandFacebook GitHub Bot 966f2a2983 Do not consume component value on visitor failure (#48985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48985

This reverts some of the behavior I added in D68357624, since peeking a component value is non-obviously more expensive than manually copying the parser, and needing to peek will be a pain for flat lists of values (like for box-shadow).

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D68733518

fbshipit-source-id: 7b4a061d1649019274441ae0e82609f771dd2916
2025-02-04 12:16:40 -08:00
Andrew DatsenkoandFacebook GitHub Bot a702238bed Add .toBeFalsy and .toBeTruthy (#49169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49169

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119852

fbshipit-source-id: dfda47dcc61f17ecbd205863d83b268005c74a83
2025-02-04 10:54:19 -08:00
Edmond ChuiandFacebook GitHub Bot 92fede1a1d report Network inspection capability to CDT frontend (#49142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49142

Changelog: [Internal] ground work for Network panel

Report Network inspection capability from the target.

If `true`, CDT frontend will read it and enable the Network panel. See https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/146

Reviewed By: hoxyq

Differential Revision: D69059543

fbshipit-source-id: 887aef82a2b942965922323bbcdfd5cae7fad3b7
2025-02-04 09:27:50 -08:00
Ruslan LesiutinandFacebook GitHub Bot fbfb251177 Enable profiling builds identification for iOS (#49137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49137

# Changelog: [Internal]

Similarly as D66501768, adding new `profiling` query parameter to inspector url for registering profiling fields.

Reviewed By: huntie

Differential Revision: D69057572

fbshipit-source-id: d11d88c7e5260d4ca405564d180d8a0edcb39596
2025-02-04 09:26:11 -08:00
Ruslan LesiutinandFacebook GitHub Bot 90f6e1010d Enable RCT_REMOTE_PROFILE for iOS builds with Fusebox enabled in production (#49136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49136

# Changelog: [Internal]

Same as D64110061, but for iOS.

Reviewed By: javache

Differential Revision: D69051435

fbshipit-source-id: 1294e4f19315376c7a202f493f07994b09bbe932
2025-02-04 09:26:11 -08:00
Nicola CortiandFacebook GitHub Bot e4babdd224 Make ReactYogaConfigProvider internal (#49170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49170

This makes the `ReactYogaConfigProvider` class internal. I've verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.ReactYogaConfigProvider

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D69120491

fbshipit-source-id: 3de342364897c09747ca724d26db437c81e235a1
2025-02-04 09:17:14 -08:00
Andrew DatsenkoandFacebook GitHub Bot e0f514d860 Add .toBeDefined and .toBeUndefined (#49168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49168

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119330

fbshipit-source-id: 2da7643cd969587b3aabe17d8c9eb405bc814b7b
2025-02-04 09:11:00 -08:00
Andrew DatsenkoandFacebook GitHub Bot 13b57781ba Add .toBeCalled and .toBeCalledTimes (#49165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49165

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69118825

fbshipit-source-id: bed276d8ba544b2351157052c3b37ebcc7398129
2025-02-04 08:26:06 -08:00
evanbaconandFacebook GitHub Bot 9350d6f2f5 React: Update conditional compilation for RCTKeyCommands to include only simulator and Mac Catalyst (#49154)
Summary:
Support distributing Expo Dev Clients to TestFlight. Expo Dev Clients are like custom versions of Expo Go that you can use to connect to a dev server or test remote updates with. Currently they can only be distributed through AdHoc provisioning because Apple rejects the use of private symbols. The symbols in question are used for simulator builds to support reloading when the "R" key is pressed (amongst other features). This is not imperative since there are a number of systems for reloading the app such as pressing R in the CLI window, but it's also not relevant to a physical phone where there is no keyboard.

## Changelog:

[IOS] [FIXED] - Remove private symbols for non-simulator and non-catalyst builds.

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

Test Plan:
- I built an deployed an app with this patch enabled to TestFlight to ensure the submission wouldn't fail. This can be reproduced locally with:
- `npx create-expo`
- Add the patch (ensure it's set with a `prepare` script).
- Following `eas.json`:
```json
{
  "cli": {
    "version": ">= 14.7.0",
    "appVersionSource": "remote"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "resourceClass": "large",
      "autoIncrement": true
    },
    "production": {
      "autoIncrement": true
    }
  },
  "submit": {
    "production": {},
    "development": {}
  }
}
```
-  Then building and deploying to TestFlight: `npx eas-cli@latest build -p ios -s --profile development`

Reviewed By: huntie

Differential Revision: D69106388

Pulled By: cipolleschi

fbshipit-source-id: 773a897ff5061929367b72188f06a08213c7dd46
2025-02-04 07:47:33 -08:00
Nicola CortiandFacebook GitHub Bot 55b3839183 Convert com.facebook.react.devsupport.RedBoxDialogSurfaceDelegate to Kotlin (#49091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49091

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: Abbondanzo

Differential Revision: D68954219

fbshipit-source-id: 4d82a8965207916acec4fa3779627b9e93bb8b10
2025-02-04 07:02:40 -08:00
Nicola CortiandFacebook GitHub Bot 95f9ca5b5b Convert com.facebook.react.devsupport.RedBoxContentView to Kotlin (#49090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49090

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D68954222

fbshipit-source-id: d24ceefb1419d24546ae362a6f37625e724c658b
2025-02-04 07:02:40 -08:00
Mateo GuzmánandFacebook GitHub Bot b76895d6f4 Make BorderRadiusStyle internal (#49150)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.style.BorderRadiusStyle).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.style.BorderRadiusStyle internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69111932

Pulled By: cortinico

fbshipit-source-id: 2c6fbec27140e6fef78ee3077d8a64369f56b143
2025-02-04 06:57:17 -08:00
Pieter De BaetsandFacebook GitHub Bot 64fa41a573 Default XMLHttpRequest's trackingName to null (#49161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49161

Avoid special strings, and default to null to mean undefined or unknown. This save us from bridging an unnecessary string but also makes the fallback name for logging network requests clearer.

Changelog: [Internal]

Reviewed By: bgirard

Differential Revision: D69058211

fbshipit-source-id: d83f424e0c2c23842554a8e4e616cad39719f311
2025-02-04 06:11:52 -08:00
Rubén NorteandFacebook GitHub Bot d2a6ff0c37 Add method to take a save a JS memory heap snapshot (#49125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49125

Changelog: [internal]

This adds support for taking JS memory heap snapshots from Fantom tests via `Fantom.saveJSMemoryHeapSnapshot`. This can be used in one-off tests to do memory analysis and determine the existence of leaks:

```
// Warm up

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/1.heapsnapshot');

// Do work

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/2.heapsnapshot');

// Clean up

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/3.heapsnapshot');
```

Load these snapshots in Chrome and select "Objects allocated between 1 and 2" in the dropdown to see the potentially leaked objects.

In the future we could introduce additional utilities to analyze the snapshots and do the detection automatically, e.g.:

```
// Warm up

const baseline = Fantom.takeJSMemoryHeapSnapshot();

// Do work

const before = Fantom.takeJSMemoryHeapSnapshot();

// Clean up

const after = Fantom.takeJSMemoryHeapSnapshot();

const leaks = findMemoryLeaks(baseline, before, after);
expect(leaks.sizeKB()).toBeLessThan(THRESHOLD);
```

Reviewed By: rshest

Differential Revision: D68953788

fbshipit-source-id: 6b3899297837c582a7b7235909d59b3e1631913d
2025-02-04 04:51:00 -08:00
Mateo GuzmánandFacebook GitHub Bot 360cbf7433 Make ResponseUtil internal (#49153)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.network.ResponseUtil).

## Changelog:

[Android][Breaking] - Make com.facebook.react.modules.network.ResponseUtil internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: fabriziocucci

Differential Revision: D69111691

Pulled By: javache

fbshipit-source-id: 985677316be7546d06119826bb53b78e1ae11d75
2025-02-04 04:21:27 -08:00
Mateo GuzmánandFacebook GitHub Bot 1c51b77868 Fix Android Image defaultSource runtime error (#49097)
Summary:
Fixes https://github.com/facebook/react-native/issues/49075

The Image `defaultSource` prop is causing a runtime error from 0.77 just by using it in the Image component (see error in the linked issue). This might be a regression from some changes in the prop processing logic from either https://github.com/facebook/react-native/issues/47710, https://github.com/facebook/react-native/issues/47713 or https://github.com/facebook/react-native/issues/47754.

## Changelog:

[ANDROID] [FIXED] - Fix Image defaultSource runtime error

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

Test Plan:
- Verify it doesn't throw any error on runtime anymore for Android.
- iOS behaviour should not be impacted as changes are Android specific

In the RNTester, you can use the following component:

```tsx
import * as React from 'react';
import {Image, View} from 'react-native';

function Playground() {
  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Image
        defaultSource={require('../../assets/bandaged.png')}
        source={{
          uri: 'https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_4x3.jpg',
        }}
        style={{width: 200, height: 200}}
      />
    </View>
  );
}
```

Also, this `defaultSource` prop is ignored in debug builds for Android ([as per the docs](https://reactnative.dev/docs/image#defaultsource)) – but I've verified we get the defaultSource as a string, which is what we expect on the native side:

<details>
<summary>Screenshot of the Android logs</summary>

![image](https://github.com/user-attachments/assets/e62ae2c3-6a93-4e44-a2d7-c913f5db2173)

</details>

Reviewed By: javache

Differential Revision: D69052723

Pulled By: cortinico

fbshipit-source-id: 2860dd4c18cefcfcbc4e39f94dfa6305f45773a3
2025-02-04 03:51:29 -08:00
Tim YungandFacebook GitHub Bot bc4dee94fe Animated: Stabilize allowlist in useAnimatedPropsMemo (#49140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49140

Similar to the change made in `useAnimatedProps`, except for `useAnimatedPropsMemo`. (This is just split out to make the changes easier to review.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D69058338

fbshipit-source-id: 033853673d8fe1442b37bb0c0adc7cb22557c334
2025-02-03 16:49:40 -08:00
Tim YungandFacebook GitHub Bot 5d4907dde7 Animated: Stabilize allowlist in useAnimatedProps (#49143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49143

Within the implementation of Animated, the `allowlist` value passed into `unstable_createAnimatedComponent` and `useAnimatedProps` is stable, meaning that it cannot change from commit to commit. However, this semantic is not codified because `allowlist` is a prop.

This refactors `useAnimatedProps` to be created by a new `createAnimatedPropsHook` function which accepts an `allowlist` argument, codifying that its value is stable for the lifetime of the hook returned.

This permits React to avoid checking whether `allowlist` has changed from commit to commit.

For now, I've left `useAnimatedProps` as a deprecated module that returns a hook with an empty `allowlist`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D69058336

fbshipit-source-id: dbcf4ca4e389f3682864a9794eacbe0af23659db
2025-02-03 16:49:40 -08:00
Nick GerlemanandFacebook GitHub Bot 1e5cc693fc Add equality operators to CSS data types (#48989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48989

tsia

Also added a quick helper to CSSColor used later.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68741768

fbshipit-source-id: e0b4c75c15891e4957c7e05a7a89820c1bea72c3
2025-02-03 16:04:07 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8af482cc4d Add Changelog for 0.78.0-rc3 (#49147)
Summary:
Add Changelog for 0.78.0-rc3

## Changelog:
[Internal] - Add Changelog for 0.78.0-rc3

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

Test Plan: N/A

Reviewed By: NickGerleman

Differential Revision: D69069136

Pulled By: cipolleschi

fbshipit-source-id: 3314a715a82e1af5e4f907bb0f6aad2f6b9b3cd7
2025-02-03 15:31:30 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 480b2335c9 Remove circleci folder (#49121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49121

This change removes the scripts/circleci folder and the last poll-maven script which was not used.

## Changelog:
[Internal] - Remove the circleci folder script

Reviewed By: cortinico, huntie

Differential Revision: D69047603

fbshipit-source-id: a4f1f100d71d792edf42c8d4cb6a0b8d8e7e5260
2025-02-03 14:07:07 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ae7175d0ab Move analisys scripts to .github folder (#49123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49123

Previously, we used to have CI workflows scripts in a `react-native/scripts/circleci` folder.
Now that we are not using CircleCI anymore, we move those scripts to the `.github/workflow-scripts` folder.

## Changelog:
[Internal] - Move ci scripts to the `.github/workflow-scripts` folder

Reviewed By: cortinico, huntie

Differential Revision: D69047581

fbshipit-source-id: 6a5d8525e526cc7521d42e2be9530deb09914fdc
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d654ae51bb Remove references from CircleCI from the release scripts (#49122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49122

This change updates the Release testing and the release scripts by removing any reference to CircleCI

## Changelog:
[Internal] - Remove CircleCI references from Release and Release testing scripts

Reviewed By: cortinico, huntie

Differential Revision: D69047479

fbshipit-source-id: 14a394b879c03cd81a8d043036c43839a38602c7
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 870aca62de Remove references of CircleCI from the readme (#49120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49120

This change removes any reference of CircleCI from the READMEs in React Native

## Changelog
[Internal] - Remove CircleCI references

Reviewed By: cortinico, huntie

Differential Revision: D69047437

fbshipit-source-id: 602350372c1d869098be0c8da7cb3db2077474d8
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 839eb44300 Remove CircleCI configuration (#49119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49119

This change removes the .circleci folder and the workflow that we run on CircleCI

## Changelog:
[Internal] - Remove CircleCI config

Reviewed By: cortinico, huntie

Differential Revision: D69047483

fbshipit-source-id: 0020a4ff69d035e939e01079059ba2743aee55fe
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6c6d3413cf Remove CircleCI references from gradle and android (#49118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49118

We finished the migration away from CircleCI, so we are cleaning up the codebase.

This change updates references to CircleCI from gradle.

## Changelog:
[Internal] - Remove references from CircleCI in RNGP

Reviewed By: cortinico

Differential Revision: D69047484

fbshipit-source-id: 4ab40be62e6769eb3a8f65136464eed6628d47a4
2025-02-03 10:02:19 -08:00
Nicola CortiandFacebook GitHub Bot e0da0fe710 Convert com.facebook.react.devsupport.PausedInDebuggerOverlayDialogManager to Kotlin (#49088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49088

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D68954221

fbshipit-source-id: 40dd1227f6cd042b1ea47b1e5b77347a3cdcb136
2025-02-03 09:41:20 -08:00
Rubén NorteandFacebook GitHub Bot 7e12060420 Move Fantom-related specs to src/private/testing/fantom/specs (#49101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49101

Changelog: [internal]

We can move this out of the deprecated directory. Also added a `.npmignore` entry so this won't be published to npm with the package.

Reviewed By: lenaic

Differential Revision: D68896208

fbshipit-source-id: ec85236aeeabdc9abcd870f0f4c1322eeb3cc659
2025-02-03 09:15:31 -08:00
Rubén NorteandFacebook GitHub Bot 2f27327f33 Rename src/private/specs as src/private/specs_DEPRECATED (#49068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49068

Changelog: [internal]

Renamed directory to better signal it's deprecated and added README.md to clarify intent.

Reviewed By: huntie

Differential Revision: D68895998

fbshipit-source-id: 5bc70d0782194db27c27cc89cc402d99f11aafa4
2025-02-03 09:15:31 -08:00
Rubén NorteandFacebook GitHub Bot c8ecc32ece Move geometry to its own directory outside dom (#49100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49100

Changelog: [internal]

This API isn't part of the DOM standard so can be moved out.

Reviewed By: huntie

Differential Revision: D68896484

fbshipit-source-id: 5d275beb909ce5c5ce0eddb6c6e04cf7491aa1cb
2025-02-03 09:15:31 -08:00
Alex HuntandFacebook GitHub Bot 4348a57503 Fix build-types script, align internal babel-register (#49133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49133

Follow up to D68960540.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D69053411

fbshipit-source-id: ffc8aba923aab8f4cd0d74fb61c49893ff09b6c1
2025-02-03 08:32:39 -08:00
Mateo GuzmánandFacebook GitHub Bot 1a67214a3a Make SystraceRequestListener internal (#49107)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.fresco.SystraceRequestListener).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.fresco.SystraceRequestListener internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69046100

Pulled By: javache

fbshipit-source-id: 0cb4c6eda385f458c3e4b02068ce77f2dd15af23
2025-02-03 08:15:25 -08:00
kirillzyuskoandFacebook GitHub Bot 243aecc095 fix: avoid ConcurrentModificationException (#49109)
Summary:
Fixes a `ConcurrentModificationException` when iterating over `TextWatcher` `mListeners` array.

If you open Android open source code (`TextView` class), then we can see that Android iterates with `for/n` loop (not `for/:`):

```java
    void sendAfterTextChanged(Editable text) {
        if (mListeners != null) {
            final ArrayList<TextWatcher> list = mListeners;
            final int count = list.size();
            for (int i = 0; i < count; i++) {
                list.get(i).afterTextChanged(text);
            }
        }

        notifyListeningManagersAfterTextChanged();

        hideErrorIfUnchanged();
    }
```

<hr>

We can catch the `ConcurrentModificationException` with old code, when for example we have 3 listeners:

- 0 is `EmojiTextWatcher` (seems like it's added by OS);
- 1 is `OnlyChangeIfRequiredMaskedTextChangedListener` (added by `react-native-text-input-mask`);
- 2 is a listener that attached by `react-native-keyboard-controller`.

On every afterTextChanged [input-mask-android](https://github.com/RedMadRobot/input-mask-android/tree/df452edc0c52a37e5082adcfc3d05d77b5aa34e8) [removes](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L212) the listener and [adds](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L231) it back.

The oversimplified version of the code can be next:

```java
public class MyClass {
    public static void main(String args[]) {
        ArrayList<Integer> mListeners = new ArrayList<>();
        mListeners.add(0);
        mListeners.add(1);
        mListeners.add(2);

        Iterator<Integer> iterator = mListeners.iterator();

        while (iterator.hasNext()) {
            Integer listener = iterator.next();

            // Check if the listener is equal to 1
            // 1 is OnlyChangeIfRequiredMaskedTextChangedListener and we simulate the behavior of this class
            if (listener == 1) {
                int i = mListeners.indexOf(listener);

                if (i >= 0) {
                    mListeners.remove(i);
                }

                // Add the removed element at the end
                mListeners.add(listener);
            }
        }

        // Print the modified list
        System.out.println(mListeners);
    }
}
```

Key points are:
- if we have only [0, 1] listener, then it works well and `ConcurrentModificationException` will not be thrown, because we modify last element;
- if we have `[0, 1, 2]` then exception will be thrown.

So in this PR I decided to re-work code to match what Android has. With `for/n` approach `ConcurrentModificationException` will not be thrown, because we don't check array immutability in this case.

More information also can be found here: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/324

## Changelog:

[ANDROID] [CHANGED] - avoid `ConcurrentModificationException` when iterating over `mListeners` `TextWatcher` array

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

Reviewed By: cortinico

Differential Revision: D69050984

Pulled By: javache

fbshipit-source-id: 9c6a7a428467fa5e546d70549dfcc91d6b2e58d2
2025-02-03 07:27:58 -08:00
Alex HuntandFacebook GitHub Bot 880fd927a9 Remove internal XHRInterceptor API (#49132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49132

Follows D68780147 and D68953084. We're able to safely remove this API by relocating the implementation into the one dependent internal test call site.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D69049203

fbshipit-source-id: 82c4b15d7f6736aed21171eeec1c197d2f34b33e
2025-02-03 06:56:08 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3bd3f101b9 Be less strict with method parsing of TurboModule Interop Layer (#49072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49072

We have instance of apps crashing when enabling the New Architecture because of the TurboModule interop layer.

What's happening is that when the module is loaded, the TM Interop Layer tries to parse the method definition to expose them in JS. However, for some libraries in the Legacy Architecture, it is possible to define a method in Objective-C and to define a different signature in Swift.

For example, the [`RNBluetoothClassic` library](https://github.com/kenjdavidson/react-native-bluetooth-classic) defines a selector in objective-c which [has the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.m#L134-L136)

```
RCT_EXTERN_METHOD(available: (NSString *)deviceId
                  resolver: (RCTPromiseResolveBlock)resolve
                  rejecter: (RCTPromiseRejectBlock)reject)
```

And the method is inmplemented in Swift with [the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.swift#L502-L505):

```
func availableFromDevice(
        _ deviceId: String,
        resolver resolve: RCTPromiseResolveBlock,
        rejecter reject: RCTPromiseRejectBlock
    )
```

When the TurboModule interop layer tries to parse the method, it receives the `accept:resolver:rejecter:` signature, but that signature is not actually defined in as a method in the module instance, and it crashes.

This crash was not happening in the Old Architecture, which was handling this case gracefully. Notice that the specific method from the example is not working in the Old Architecture either. However, the app is not crashing in the old architecture.

This change adds the same graceful behaviors plus it adds a warning in development to notify the developer about which methods couldn't be found in the interface.

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

## Changelog:
[iOS][Fixed] - Avoid crashing the app when the InteropLayer can't find some methods in the native implementation.

Reviewed By: javache

Differential Revision: D68901734

fbshipit-source-id: 844d1bf29423d5c601b583540e86d57dfffd1428
2025-02-03 06:50:05 -08:00
Pieter De BaetsandFacebook GitHub Bot e5ba5791b2 Enable -Wundef for react-native targets (#49041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49041

Prevent the class of issues seen in D68797482 by making `#if FOO` where `FOO` is not defined an error.

Changelog: [Internal]

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D68824244

fbshipit-source-id: 1291c5f2f84ecb023ba76a015716cc7c9ae0f89e
2025-02-03 06:29:28 -08:00
Pieter De BaetsandFacebook GitHub Bot 4799463435 Fix incorrect noexcept attributes (#49127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49127

These tests are marked as noexcept, but they can indeed throw exceptions: they trigger synchronous commits, which may cause exceptions in the mounting layer.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69049587

fbshipit-source-id: 02c6187c8d0e043c9840aad9c9e4d27866898b4a
2025-02-03 06:15:36 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot ae59702f8e fix(iOS): bring back enableFixForViewCommandRace feature flag (#49126)
Summary:
As pointed out by RyanCommits the ReactNativeFactory PR removed `enableFixForViewCommandRace` feature flag by mistake. Reference: https://github.com/facebook/react-native/pull/46298/files

This PR re-adds the feature flag.

## Changelog:

[IOS] [FIXED] - Re-enable enableFixForViewCommandRace feature flag

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

Test Plan: Not needed, the feature flag was there before refactor.

Reviewed By: huntie

Differential Revision: D69049668

Pulled By: cipolleschi

fbshipit-source-id: b7bf382c76878e72619145283fa8cc2c1046b486
2025-02-03 06:12:12 -08:00
Alex HuntandFacebook GitHub Bot fb493fd72d Restore XMLHttpRequest setInterceptor API, rename as DO_NOT_USE (#49081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49081

Follows D68780147. We are depending on this API in one internal E2E test. Rename as `__setInterceptor_DO_NOT_USE`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D68953084

fbshipit-source-id: 66b685a90b6e7f18646752dc90892963d16f9a83
2025-02-03 05:55:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot 8d90be814e Refactor ActionSheetIOS to better align with OSS types (#49094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49094

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68957719

fbshipit-source-id: 4e4738a619583000ea6fe78808d46e300428504a
2025-02-03 04:47:06 -08:00
Alex HuntandFacebook GitHub Bot 71ad6369ce Remove unused nativeNetworkInspection flag, clarify static experiment key (#49096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49096

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D68958813

fbshipit-source-id: d2222e8bcc1bc0664cf93d9017a796016ee270a2
2025-02-03 04:10:18 -08:00
Alex HuntandFacebook GitHub Bot 3cf400a51b Convert build scripts to regular Flow syntax (#49103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49103

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D68960540

fbshipit-source-id: 0ac01529eaea97db98b85b6021532092997d633b
2025-02-03 03:49:23 -08:00
Alex HuntandFacebook GitHub Bot e1575857dd Relocate babel-register script (#49102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49102

Moves this script one level up. In the next diff, will be used to support execution of scripts themselves, as well as `packages/`.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D68960279

fbshipit-source-id: 7b62420c269dc1c1366ac9a827db078d34cb86c5
2025-02-03 03:49:23 -08:00
Mateo GuzmánandFacebook GitHub Bot 3a5e217df6 Add CountingOutputStream tests (#49058)
Summary:
Working on migrating some of the com.facebook.react.modules.network classes to Kotlin, I'm creating some test cases here for `CountingOutputStream` before migrating that class.

## Changelog:

[INTERNAL] - Add CountingOutputStream tests

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D68903427

Pulled By: rshest

fbshipit-source-id: f71926cf526a65b2434aaa762007e0b4ca5dd1a4
2025-02-03 03:43:55 -08:00
Nicola CortiandFacebook GitHub Bot bdbd0fa0ca Convert com.facebook.react.devsupport.IInspectorPackagerConnection to Kotlin (#49092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49092

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D68954220

fbshipit-source-id: fbdf391152578ba5cc0b0a9b303a5a6700bfdb0e
2025-02-03 01:47:18 -08:00
Nicola CortiandFacebook GitHub Bot 17f7bf3773 Convert com.facebook.react.devsupport.HMRClient to Kotlin (#49089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49089

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D68954223

fbshipit-source-id: 6dd6e33ade211a6df2eea7a8dd761cc427bfd5c3
2025-02-03 01:47:18 -08:00
Edmond ChuiandFacebook GitHub Bot e45883e44f enable Network.enable behind feature flag (#49098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49098

Changelog: [Internal][Added] enable Network.enable behind feature flag (in preparation for Network Panel)

Respond to `Network.enable` calls. Params are currently not supported. https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enable

Reviewed By: huntie

Differential Revision: D68959142

fbshipit-source-id: 78a195979c39b1199be2fd8f9bdcfe4fe51dd6dd
2025-01-31 19:28:45 -08:00
Nicola CortiandFacebook GitHub Bot 4523fdd932 Internalize com.facebook.react.devsupport.inspector (#49086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49086

Making all the classes inside `com.facebook.react.devsupport.inspector` internal.
Those should have not been exposed in the first place.

I've verified that there are no usages for those clases in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+%22import+com.facebook.react.devsupport.inspector.%22

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68954014

fbshipit-source-id: 02e0ab566977383105d5d42336123335309cfc34
2025-01-31 12:49:45 -08:00
Intl SchedulerandFacebook GitHub Bot cc74db2bba translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907955550893
Sandcastle Job Instance ID: 1654683818
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D68971915

fbshipit-source-id: c58b74d0998bd485dcd608defee0948409a503b4
2025-01-31 12:00:18 -08:00
Thomas NardoneandFacebook GitHub Bot 7cfb19e7e3 Add ReactBuildConfig.ENABLE_PERFETTO (#48981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48981

Add entry for this flag in ReactBuildConfig

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68725330

fbshipit-source-id: afce4093665ba0c78f4630ab412297219f65d157
2025-01-31 10:02:12 -08:00
Mateo GuzmánandFacebook GitHub Bot 491ede6404 Migrate com.facebook.react.packagerconnection interfaces to Kotlin (#49025)
Summary:
Migrate com.facebook.react.packagerconnection interfaces to Kotlin. Also, moving to `org.mockito.kotlin` instead of `org.mockito.Mockito` for JSPackagerClientTest to make it compatible with the migrated files.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.packagerconnection interfaces to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, Abbondanzo

Differential Revision: D68842336

Pulled By: tdn120

fbshipit-source-id: c3062675b5535277970fd97490720739fc748f2a
2025-01-31 09:19:52 -08:00
Alex HuntandFacebook GitHub Bot cd78f44e58 Remove unused checkForGitChanges script (#49099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49099

Changelog: [Internal]

Reviewed By: EdmondChuiHW

Differential Revision: D68960652

fbshipit-source-id: 138e83dfedef7ea717502a1e964eb802dae678c4
2025-01-31 09:18:31 -08:00
Nicola CortiandFacebook GitHub Bot d37a8d2830 Convert com.facebook.react.devsupport.inspector to Kotlin (#49087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49087

I'm moving the whole module to be in Kotlin and updating the BUCK file.
Those files also have 0 usages in OSS so not a breaking change.

Changelog:
[Internal] [Changed] -

Reviewed By: robhogan

Differential Revision: D68953731

fbshipit-source-id: d8238bf805661cbdd6fb070a60f3e32b44ec9832
2025-01-31 07:50:28 -08:00
Dawid MałeckiandFacebook GitHub Bot 5c2153784d Create lint rule preventing uses of CommonJS exports (#49079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49079

The rule disallows using CommonJS exports in react-native and assets/registry package.

## Changelog:
[Internal] - Created a lint rule that prevents using CommonJS exports

Reviewed By: huntie

Differential Revision: D68951212

fbshipit-source-id: 1c9a1581af951d2a876b348981f0e5a81c99109a
2025-01-31 07:13:54 -08:00
Jakub PiaseckiandFacebook GitHub Bot c3ea606660 Align TextInput types with TypeScript (#48972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48972

Changelog: [Internal]

Align TextInput types with TypeScript definitions.

Reviewed By: huntie

Differential Revision: D68713179

fbshipit-source-id: bb36d9333e45f2a30db91a17b8698b34cd792eb6
2025-01-31 04:54:42 -08:00
Jakub PiaseckiandFacebook GitHub Bot e815fdae53 Align TextInput event types with TypeScript (#48971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48971

Changelog: [Internal]

Mosltly align event types of TextInput components with TypeScript definitions.

Reviewed By: mellyeliu, thatmichael85

Differential Revision: D68713180

fbshipit-source-id: d8e9c0458466ef492fecf516fd58bc5459b35e26
2025-01-31 04:54:42 -08:00
Alex HuntandFacebook GitHub Bot 21541b51b3 Apply stripPrivateProperties transform to public-api-test (#49064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49064

Update `public-api-test` to disregard all object/type members prefixed with an underscore (`_`). These are considered existing internal APIs.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68895376

fbshipit-source-id: db581df7cc37802fa5f7d3aa4d7c07514223209a
2025-01-31 04:27:13 -08:00
Rubén NorteandFacebook GitHub Bot 3d4906e7ec Optimize data structure to store listeners in EventTarget (#48964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48964

Changelog: [internal]

This replaces the data structure used to store listeners in `EventTarget`, from a map of arrays to a map of maps.

This essentially optimizes listener registration/deregistraton at the expense of event dispatching. Given that it'll be common to have many nodes registering to events that are never dispatched, this might be the right trade-off.

* Before:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)    | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | ---------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4624.68 ± 0.49%'     | '4570.00'              | '218089 ± 0.02%'           | '218818'                  | 216232  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '5771.34 ± 0.99%'     | '5670.00'              | '175389 ± 0.02%'           | '176367'                  | 173270  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '48207.35 ± 1.18%'    | '47290.00'             | '20964 ± 0.04%'            | '21146'                   | 20744   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '185005.29 ± 0.16%'   | '184060.00'            | '5410 ± 0.05%'             | '5433'                    | 5406    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '286630.57 ± 0.11%'   | '285560.00'            | '3491 ± 0.06%'             | '3502'                    | 3489    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '4435944.62 ± 0.27%'  | '4425840.00 ± 30.00'   | '226 ± 0.12%'              | '226'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1734.88 ± 0.57%'     | '1670.00'              | '594938 ± 0.01%'           | '598802'                  | 576411  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '266031.11 ± 0.68%'   | '261810.00'            | '3781 ± 0.15%'             | '3820'                    | 3759    |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '124768.56 ± 0.39%'   | '121160.00'            | '8112 ± 0.16%'             | '8254'                    | 8015    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '27141326.31 ± 0.15%' | '27298945.00 ± 115.00' | '37 ± 0.15%'               | '37'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '142646.24 ± 0.49%'   | '137460.00'            | '7123 ± 0.19%'             | '7275'                    | 7011    |

* After:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)   | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | --------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4518.27 ± 0.51%'     | '4460.00'             | '223269 ± 0.02%'           | '224215'                  | 221324  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '6563.10 ± 0.98%'     | '6450.00'             | '154311 ± 0.02%'           | '155039'                  | 152367  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '65429.69 ± 0.25%'    | '64840.00'            | '15330 ± 0.05%'            | '15423'                   | 15284   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '181104.21 ± 0.13%'   | '180300.00'           | '5525 ± 0.05%'             | '5546'                    | 5522    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '367231.05 ± 0.10%'   | '366035.00 ± 5.00'    | '2724 ± 0.07%'             | '2732'                    | 2724    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '6269141.58 ± 0.24%'  | '6253275.00 ± 155.00' | '160 ± 0.11%'              | '160'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1665.23 ± 0.51%'     | '1610.00'             | '618122 ± 0.01%'           | '621118'                  | 600517  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '97724.12 ± 1.34%'    | '94640.00'            | '10433 ± 0.14%'            | '10566'                   | 10233   |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '116915.60 ± 0.54%'   | '113380.00'           | '8707 ± 0.17%'             | '8820'                    | 8554    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '12276537.38 ± 0.42%' | '11924070.00 ± 10.00' | '82 ± 0.35%'               | '84'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '133307.67 ± 0.58%'   | '128340.00'           | '7666 ± 0.20%'             | '7792'                    | 7502    |

Reviewed By: rshest

Differential Revision: D68671944

fbshipit-source-id: 1a555ba9400e5830b4a56cdf12fd9418cd4a2a4f
2025-01-31 04:00:31 -08:00
Rubén NorteandFacebook GitHub Bot 1f8ace8cce Expand benchmarks for EventTarget to include perf for addEventListener (#49070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49070

Changelog: [internal]

Adds benchmarks for `addEventListener` in benchmark file for `EventTarget`.

Baseline:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)    | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | ---------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4624.68 ± 0.49%'     | '4570.00'              | '218089 ± 0.02%'           | '218818'                  | 216232  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '5771.34 ± 0.99%'     | '5670.00'              | '175389 ± 0.02%'           | '176367'                  | 173270  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '48207.35 ± 1.18%'    | '47290.00'             | '20964 ± 0.04%'            | '21146'                   | 20744   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '185005.29 ± 0.16%'   | '184060.00'            | '5410 ± 0.05%'             | '5433'                    | 5406    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '286630.57 ± 0.11%'   | '285560.00'            | '3491 ± 0.06%'             | '3502'                    | 3489    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '4435944.62 ± 0.27%'  | '4425840.00 ± 30.00'   | '226 ± 0.12%'              | '226'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1734.88 ± 0.57%'     | '1670.00'              | '594938 ± 0.01%'           | '598802'                  | 576411  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '266031.11 ± 0.68%'   | '261810.00'            | '3781 ± 0.15%'             | '3820'                    | 3759    |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '124768.56 ± 0.39%'   | '121160.00'            | '8112 ± 0.16%'             | '8254'                    | 8015    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '27141326.31 ± 0.15%' | '27298945.00 ± 115.00' | '37 ± 0.15%'               | '37'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '142646.24 ± 0.49%'   | '137460.00'            | '7123 ± 0.19%'             | '7275'                    | 7011    |

Reviewed By: lenaic

Differential Revision: D68708145

fbshipit-source-id: b3f2f1f9e239856dcc9d8e699edf4ed2ada404dd
2025-01-31 04:00:31 -08:00
Dawid MałeckiandFacebook GitHub Bot 4ccb2f2aa2 Add transform that strips private properties in build types script (#49060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49060

We want to hide private properties from JS public API interface. The stripPrivateProperties transform removes all private nodes of type ObjectTypeProperty, Property, PropertyDefinition and MethodDefinition. There is also a change in transforms reducer that incorporates `print` function from hermes-transform which modifies the code base on the transformed ast (transformed.mutatedCode seems to be a code before the transform operation).

## Changelog:
[Internal] -  Added transform that strips private properties in build-types script

Reviewed By: huntie

Differential Revision: D68892853

fbshipit-source-id: 5035fd4339aa6294d972e7aff0eb563f48d4c3d2
2025-01-31 02:02:08 -08:00
Nicola CortiandFacebook GitHub Bot 64c2a52ca9 Remove unnecessary public keyword (#49062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49062

Another round of cleanup for the `public` keyword that I found around.
Those are unnecessary here as those classes are `internal` and we should remove them.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68894182

fbshipit-source-id: 6f7bac6051e17785a1bfb0d544950250429c71cb
2025-01-30 14:13:57 -08:00
Nicola CortiandFacebook GitHub Bot 9afa3596cb Make DevSettingsActivity internal (#49073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49073

This activity should be internal as it's exposed by ReactNative's Debug Manifest.
No need to have it public. I checked that there are no OSS usages of it:

https://www.google.com/url?q=https://github.com/search?type%3Dcode%26q%3DNOT%2Bis%253Afork%2BNOT%2Borg%253Afacebook%2BNOT%2Brepo%253Areact-native-tvos%252Freact-native-tvos%2BNOT%2Brepo%253Anuagoz%252Freact-native%2BNOT%2Brepo%253A2lambda123%252Freact-native%2BNOT%2Brepo%253Apvinis%252Freact-native---investigation%2BNOT%2Brepo%253Abeanchips%252Ffacebookreactnative%2BNOT%2Brepo%253AfabOnReact%252Freact-native-notes%2BNOT%2Buser%253Ahuntie%2Bcom.facebook.react.devsupport.DevSettingsActivity&sa=D&source=editors&ust=1738261498882961&usg=AOvVaw295OXKV-8dAbdsMTY5usSx

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68904656

fbshipit-source-id: b98b417e60a3e8ebba0c9946959ee43ea963b066
2025-01-30 12:21:54 -08:00
Alex HuntandFacebook GitHub Bot 9ba4dd81db Delete Libraries/JSInspector (#49019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49019

Removes the `JSInspector` class and its dependencies.

- This was related to the legacy `ReactCommon/inspector/` subsystem (D4021490) — which added a compat layer from JavaScriptCore to CDP for an earlier version of Chrome debugging.
- The JS components of this system (`JSInspector.js`, `NetworkAgent.js`) were added in D4021516.

`ReactCommon/inspector/` has since been deleted and these components are no longer load bearing.

- We intend to replace this logic (at least, the archaic `XHRInterceptor` behaviour, which worked at one point) with native debugger `Network` domain support in our C++ layer.

**Changes**

- Remove all modules under `Libraries/JSInspector/`.
- Remove all `XHRInterceptor` call sites.
- Remove the `JSInspector.registerAgent()` mount point in `setUpDeveloperTools.js`.
- Exclude `Libraries/Core/setUp*` from `public-api-test` (these are side-effect setup files with no exported API).

Changelog:
[General][Breaking] - Remove legacy Libraries/JSInspector modules

Reviewed By: christophpurrer

Differential Revision: D68780147

fbshipit-source-id: 3d11cc89886a91055e6b69ac6f0609c288965801
2025-01-30 11:30:05 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot accde40e1b Fix gapbetween making backgroundColor render when width/height is 0 (#49074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49074

This used to not be noticeable when we were clipping the background even without a border, after fixing that, we got line when the width/height was 0

This is again not an issue with new Background and Border since they take a slightly different approach

Diff that caused the issue D68279400

ie.
 {F1974794589}

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68843649

fbshipit-source-id: a25ace46b604690e3385c49d6f4bb3a4163bc594
2025-01-30 11:04:19 -08:00
Vitali ZaidmanandFacebook GitHub Bot 566a45e28c adjust rntester readme to use "yarn prepare-ios" (#49067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49067

## Changelog:

[Internal] [Fixed] - fixed rntester readme to guide users to launch the correct ios prepare command

Reviewed By: cipolleschi

Differential Revision: D68897627

fbshipit-source-id: 93d30b2728f452e27448d0ef468ee148296f2324
2025-01-30 08:45:24 -08:00
Iwo PlazaandFacebook GitHub Bot 8783196ee5 Migrate files in Libraries/EventEmitter and Libraries/Image to use export syntax (#49020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49020

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates the `Libraries/EventEmitter/*.js` and `Libraries/Image/*.js` files to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/EventEmitter` and `Libraries/Image/*.js` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68780876

fbshipit-source-id: bd8e702aba33878e38df6d9c89bec27e7c8df0ac
2025-01-30 07:27:03 -08:00
Rubén NorteandFacebook GitHub Bot 82cc465645 Clean up disableEventLoopOnBridgeless feature flag (#49065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49065

Changelog: [internal]

Cleaning up the flag because it's no longer necessary.

Reviewed By: sammy-SC

Differential Revision: D68892995

fbshipit-source-id: 4e0290bfb11181dc388e6590af1b82581588b9ee
2025-01-30 07:20:52 -08:00
Iwo PlazaandFacebook GitHub Bot 4101a2f0b6 Add compat layer for react-native-codegen and processColorArray (#49063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49063

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Updates react-native-codegen to generate ViewConfigs that are compatible with react-native both before and after the export syntax migration.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68894819

fbshipit-source-id: fca46c1b91c15e22f1e1128ce8621c05341e2fe6
2025-01-30 07:16:54 -08:00
Rubén NorteandFacebook GitHub Bot 105e3ab837 Implement additional traversal methods on ReactNativeDocument (#49013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49013

Changelog: [internal]

Adds `Document`-specific traversal methods to `ReactNativeDocument`:
* `childElementCount`
* `children`
* `firstElementChild`
* `lastElementChild`

Reviewed By: yungsters

Differential Revision: D67693032

fbshipit-source-id: 1e3279586ece809c5c3584279c07f991cadf0fc6
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 2436e3ba84 Implement ReactNativeDocument (#49012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49012

Changelog: [internal]

(This is internal for now, until we rollout the DOM APIs in stable).

This refines the concept of root elements from the merged proposal for [DOM Traversal & Layout APIs](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0607-dom-traversal-and-layout-apis.md).

The original proposal included a reference to have the root node in the tree as `getRootNode()` and no other methods/accessors to access it.

This makes the following changes:
* The root node is a new abstraction in React Native implementing the concept of `Document` from Web. `node.getRootNode()`, as well as `node.ownerDocument` now return instances to this node (except when the node is detached, in which case `getRootNode` returns the node itself, aligning with the spec).
* The existing root node in the shadow tree is exposed as the `documentElement` of the new document instance. It would be the first and only child of the document instance, and the topmost parent of all the host nodes rendered in the tree.

In terms of APIs:
* Implements `getRootNode` correctly, according to the specified semantics.
* Adds `ownerDocument` to the `ReadOnlyNode` interface.
* Adds the `ReactNativeDocument` interface, which extends `ReadOnlyNode` (with no new methods on its own, which will be added in a following PR).

NOTE: This is currently gated under `ReactNativeFeatureFlags.enableDOMDocumentAPI` feature flag, which is disabled by default.

Reviewed By: yungsters

Differential Revision: D67526381

fbshipit-source-id: dff3645469e7ea2b2026dbbaa94d9fd0e00291be
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 3dab9c66ba Expose new method in Fabric renderer to access root instance from root tag (#49011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49011

Changelog: [internal]

This exposes the new `getPublicInstanceFromRoot` method from the React renderer in our RN façades, preparing for the new change to implement the document interface in RN.

Reviewed By: javache

Differential Revision: D68767143

fbshipit-source-id: 9a3403f9bc1612b402305695d084497a46ee4480
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 8f7f3be9af Add support for document instance in React Native (#32260) (#49051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49051

## Summary

We're adding support for `Document` instances in React Native (as
`ReactNativeDocument` instances) in
https://github.com/facebook/react-native/pull/49012 , which requires the
React Fabric renderer to handle its lifecycle.

This modifies the renderer to create those document instances and
associate them with the React root, and provides a new method for React
Native to access them given its containerTag / rootTag.

## How did you test this change?

Tested e2e in https://github.com/facebook/react-native/pull/49012
manually syncing these changes.

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

Reviewed By: javache

Differential Revision: D68839346

fbshipit-source-id: 589ddce15d0f32ba3eab1c03306c405d38616723
2025-01-30 07:11:43 -08:00
Iwo PlazaandFacebook GitHub Bot 4d6785bdb5 Migrate LayoutAnimation and Linking libraries to use export syntax (#49021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49021

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates files in `Libraries/LayoutAnimation/*.js` and `Libraries/Linking/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/LayoutAnimation` and `Libraries/Linking` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68782429

fbshipit-source-id: c9ea4fadbc44587a165d311b054fcd03444842c8
2025-01-30 07:07:08 -08:00
Alex HuntandFacebook GitHub Bot 45a2d9c5a8 Delete deprecated YellowBox API (#49061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49061

Changelog:
[General][Breaking] - Remove deprecated `YellowBox` and `console.ignoredYellowBox` APIs. Use `LogBox`.

Reviewed By: cortinico, hezi

Differential Revision: D68893550

fbshipit-source-id: 5030a20a2d1a60ca37eaf928339b8dd5d5abaa27
2025-01-30 06:49:13 -08:00
Rubén NorteandFacebook GitHub Bot 252294bc76 Improve naming for benchmark suite options (#49014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49014

Changelog: [internal]

Use better names for the Fantom benchmarking API than the ones defined in `tinybench`:
* `time` => `minDuration`
* `iterations` = `minIterations`
* `warmupTime` => `minWarmupDuration`
* `warmupIterations` => `minWarmupIterations`

Reviewed By: rshest

Differential Revision: D68710952

fbshipit-source-id: 05dc1145a72a50ea73de7ccbb08bb28d7975245f
2025-01-30 03:24:39 -08:00
Tommy NguyenandFacebook GitHub Bot ee8088b615 fix(dev-middleware): add missing invariant dependency (#49047)
Summary:
`dev-middleware` uses `invariant` but does not declare it as a dependency. Under certain hoisting scenarios, or when using pnpm, this will cause `dev-middleware` to fail while being loaded.

## Changelog:

[GENERAL] [FIXED] - add missing `invariant` dependency

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

Test Plan: n/a

Reviewed By: cortinico

Differential Revision: D68835789

Pulled By: huntie

fbshipit-source-id: 13718f4970ed55e6e062b7c2bd719be977abdd0c
2025-01-30 01:58:27 -08:00
David VaccaandFacebook GitHub Bot 40575f26d2 Internalize ReactBridge (#49049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49049

ReactBridge can be internalize, there are no usages in OSS

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D68540710

fbshipit-source-id: ce7fe6ca52186414650dcc529c5891dc59cab51a
2025-01-29 17:32:25 -08:00
Erica KleinandFacebook GitHub Bot 04afbd90e6 Back out "Fabric: Fixes crash of dynamic color when light/dark mode changed" (#49054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49054

Original commit changeset: 01959845b742

Original Phabricator Diff: D68157559

Reviewed By: javache

Differential Revision: D68861984

fbshipit-source-id: c2e6fcf5d626447bd658b047adbb64947c2a5266
2025-01-29 15:55:32 -08:00
Rubén NorteandFacebook GitHub Bot 2c406d8b49 Remove logged errors for feature flags not implemented in native when skipNativeAPI is used (#49050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49050

Changelog: [internal]

We added support for feature flags that don't have a native module definition so we could handle cases where the JS changes progressed faster than native ones, but we recently saw that when native catches up, the API starts logging an error through `console.error` about the native module method not being available.

That's an expected result of this feature and it's when we can clean up the code in JS, so we shouldn't be logging errors in that case.

This removes the error for them specifically.

Reviewed By: elicwhite

Differential Revision: D68843247

fbshipit-source-id: 730f3eba8c26959825cd9c3897f055a02a5f9591
2025-01-29 12:17:45 -08:00
Rubén NorteandFacebook GitHub Bot 17c34295a1 Migrate mounting tests to Fantom (#49018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49018

Changelog: [internal]

Migrates the mounting layer logs from C++ (640 lines of code) to Fantom (248 lines!!!).

This is 1:1 translation of the test.

Reviewed By: javache

Differential Revision: D67549200

fbshipit-source-id: 735fa3203cd04dd5b3b4b5174e0c96fdc2354993
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot bb24ad0397 Print nativeID in debug props for Props (#49017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49017

Changelog: [internal]

The debug string for props doesn't log `nativeID` so we can't access it in Fantom. This fixes that to simply future tests.

Reviewed By: javache

Differential Revision: D68779903

fbshipit-source-id: 9800ef2b6d173e2fc8e21d3d910139a30ae91342
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot 9c521bb68c Improve format of mounting logs (#49016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49016

Changelog: [internal]

This replaces the existing string-based logs with something more structured, and increases the coverage to properly log all operations.

As part of this work I had to refactor how we record mutations so they would be done while applying the mutations, and not before/after where necessary metadata might not be available yet/anymore.

Reviewed By: sammy-SC

Differential Revision: D67549201

fbshipit-source-id: 0bcb1642a6b3d7e704f4ee24a550d4189c406aed
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot fb9b476d12 Rename getMountingLogs as takeMountingManagerLogs (#49015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49015

Changelog: [internal]

This name better reflects the fact that we're emptying the buffer when calling it.

Reviewed By: javache

Differential Revision: D67549202

fbshipit-source-id: 7523a130f26bced122acd4f50b45c2b61a39bba9
2025-01-29 11:31:51 -08:00
Christoph PurrerandFacebook GitHub Bot 67981efa14 Fix Turbo Module example in RNTester in bridgeless mode (#49028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49028

## Changelog: [General] [Fixed]] - Fix Turbo Module example in RNTester in bridgeless mode

Reviewed By: cortinico, philIip

Differential Revision: D68810934

fbshipit-source-id: 5eab0e72fe383974fe02747acd1683a995300d4d
2025-01-29 11:06:49 -08:00
Rubén NorteandFacebook GitHub Bot a8bf742f29 Unbreak Flow
Summary:
Changelog: [internal]

Fixes broken Flow check after some files were moved.

bypass-github-export-checks

Reviewed By: elicwhite

Differential Revision: D68844033

fbshipit-source-id: edf5bc58c5ce94ef5c089998b52a4bb72a2d3997
2025-01-29 11:05:03 -08:00
Rubén NorteandFacebook GitHub Bot ea1260accb Set up test to validate refactor of XHR, FileReader and WebSocket classes to use the built-in EventTarget implementation (#48930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48930

Changelog: [internal]

This creates new versions of `XMLHttpRequest`, `FileReader` and `WebSocket` that extend the new built-in `EventTarget` implementation, instead of the implementation from the `event-target-shim` package.

It also sets up a test to choose between the 2 implementations at runtime to verify correctness and performance. This doesn't use the RN feature flags infra because we use this flag very early on startup, before we have a chance to set overrides. We could use a native feature flag instead but it'd slow down the rollout of the test.

Reviewed By: yungsters

Differential Revision: D68625226

fbshipit-source-id: bff715c43a237b65d5a02a3fdb56f3275689ea46
2025-01-29 10:06:08 -08:00
Rubén NorteandFacebook GitHub Bot d80284c607 Make some objects read-only in event-related APIs (#49045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49045

Changelog: [internal]

Making some objects read-only to reflect usage and allow callers to pass both read-only and writable objects.

Reviewed By: yungsters

Differential Revision: D68831136

fbshipit-source-id: e9a2d96ec0abd13f609d26d376e6da946f802011
2025-01-29 10:06:08 -08:00
Rubén NorteandFacebook GitHub Bot 4ba0e79712 Refactor NetworkOverlay to use a symbol instead of a public property in XHR (#48928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48928

Changelog: [internal]

Just a minor change to reduce the number of Flow errors we will get when we refactor XHR soon.

Reviewed By: javache

Differential Revision: D68625224

fbshipit-source-id: e952f3f52de8081a0773ef3a01e1259c3be67a92
2025-01-29 10:06:08 -08:00
Alex HuntandFacebook GitHub Bot 389779c348 Move XHRInterceptor to src/private/inspector/ (#49023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49023

Changelog:
[General][Breaking] - Move `XHRInterceptor` API to `src/private/`

Reviewed By: christophpurrer

Differential Revision: D68781897

fbshipit-source-id: af52f65b0f64da68a78babf326a1a9b8a1fc1d96
2025-01-29 09:56:54 -08:00
Alex HuntandFacebook GitHub Bot 0bde08fe67 Move Libraries/Inspector/ to src/private/ (#49022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49022

These modules support the in-app Inspector Overlay.

Breaking change that's unlikely to hit any users. Unreferenced by Expo.

Changelog:
[General][Breaking] Move `Libraries/Inspector/` modules to `src/private/`

Reviewed By: cortinico

Differential Revision: D68781896

fbshipit-source-id: 8fcd72d56684319019f64a375c2e2ef317a47c13
2025-01-29 09:56:54 -08:00
Ian ElliottandFacebook GitHub Bot 9a9aa19387 Upgrade cross-spawn to 7.0.5 (#48750)
Summary:
Bump cross-spawn 7.0.5

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

Test Plan: Sandcastle

Reviewed By: huntie

Differential Revision: D68282390

Pulled By: ide-2

fbshipit-source-id: 1bc81b4fbda986c7820e214364dcc322f8729baa
2025-01-29 09:44:16 -08:00
Rubén NorteandFacebook GitHub Bot 8678d15892 Prepare ReactNativePrivateInterface for new React renderer calls to handle root/document nodes (#49010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49010

Changelog: [internal]

This adds a stub method for `ReactNativePrivateInterface.createPublicRootInstance`, which just returns `null` for now, so we can synchronize the React renderer that will try to use it to create root instances.

Initially, this will not do anything and React will just pass the `null` value around. When we implement the document API, we will return a proper instance and React will pass it to `createPublicInstance` so we can link things at runtime.

Reviewed By: javache

Differential Revision: D68561173

fbshipit-source-id: 632a7c3523910059a1f63f35b5f0f52f5660a961
2025-01-29 09:39:49 -08:00
Rubén NorteandFacebook GitHub Bot 7cdc3d81ad Abstract away use of shadow nodes as native node references (#49009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49009

Changelog: [internal]

Native APIs so far have returned instance handles from React to reference nodes in the rendered UI tree, but now that we're adding support for the document API, this isn't sufficient to represent all types of nodes. Both for the document and for its `documentElement`, we don't have an instance handle from React that links to the node, but we're going to represent that differently.

This is a refactor so the existing methods use a mostly opaque `NativeNodeReference` type so we can implement it as a union of React instance handles and the future types we're going to introduce to support document.

Reviewed By: javache

Differential Revision: D67704855

fbshipit-source-id: 0568143d9ce39be65986e1a4b92fdaebd79e4f66
2025-01-29 09:39:49 -08:00
Rubén NorteandFacebook GitHub Bot 591b0ffc0e Add basic benchmarks for rendering views (#49008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49008

Changelog: [internal]

We're modifying some core APIs in the RN render in following diffs, so this adds a simple benchmark as a safety mechanism to verify those don't regress performance significantly.

Reviewed By: yungsters

Differential Revision: D68772175

fbshipit-source-id: 3bc446e68495dc04590b613297baa00589fb5f8d
2025-01-29 09:39:49 -08:00
Rickard ZrinskiandFacebook GitHub Bot 97cf42f979 Fix maxFontSizeMultiplier prop on Text and TextInput components in new architecture (#47614)
Summary:
The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in https://github.com/facebook/react-native/issues/47499.

bypass-github-export-checks

## Changelog:

[GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture

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

Test Plan:
I have not added any automated tests for this change but try to do so if requested. I have however added examples to RN Tester for both the Text and TextInput components, as well as compared the behaviour with Paper / Old Architecture. Both on version 0.76.

Noticed now I didn't do exactly the same steps in both videos, oops! Be aware that reapplying changes made in the Settings are currently half-broken on the new architecture, thus I'm restarting the app on Android and iOS. But this issue is unrelated to my changes. I've tested on main branch and it has the same issue.

Here are comparison videos between Paper and Fabric on iOS *after* I've made my fix.

### Text
| Paper  | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> |

### TextInput
| Paper  | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> |

Reviewed By: Abbondanzo

Differential Revision: D65953019

Pulled By: cipolleschi

fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
2025-01-29 09:27:44 -08:00
Alex HuntandFacebook GitHub Bot 97ee93fd5a Add Content-Type header to dev server requests (#49042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49042

Minor fix to align with adjacent `/open-stack-frame` call: https://fburl.com/code/o9rwbmxr.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D68830215

fbshipit-source-id: 87ef0c14bdedd34153014721b85bd24af24c1db7
2025-01-29 09:18:46 -08:00
Pieter De BaetsandFacebook GitHub Bot 26afc804b7 Error when tests finish with pending tasks (#49032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49032

Add a native API to validate the RuntimeScheduler has no pending tasks, and automatically validate after every test that there's no pending tasks left to execute.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D68797481

fbshipit-source-id: dbbef894a57bd29eb5a033ac8aaeedef770dcba2
2025-01-29 08:49:49 -08:00
Mateo GuzmánandFacebook GitHub Bot 2f6cb8ba08 Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin (#49026)
Summary:
Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D68794415

Pulled By: Abbondanzo

fbshipit-source-id: 690d69e8360fb51eb0232b2ed2b4676e0d1a9ee6
2025-01-29 07:09:04 -08:00
Pieter De BaetsandFacebook GitHub Bot e4d1cf8ce9 Delete RawProps assignment operators (#49030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49030

Overwriting another RawProps object via `operator=` is rarely what we want, and these objects should be considered immutable once constructed.

This will catch issues such as D68633985

Changelog: [General][Changed] Removed `RawProps::operator=`

Reviewed By: sammy-SC

Differential Revision: D68797484

fbshipit-source-id: 766a65db1dbf4485c78007f8f69cc9426d27a943
2025-01-29 06:16:20 -08:00
Jakub PiaseckiandFacebook GitHub Bot 5d7fedacd0 Add flow definitions for Alert and align them with TypeScript (#49006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49006

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774525

fbshipit-source-id: 509f26b0f5f0d309502681f3228ae519689d480a
2025-01-29 05:36:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot 8058aab0d6 Ignore implementation files when .flow.js file exists during type translation (#49039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49039

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774523

fbshipit-source-id: 07776e7e0d551e3bad5a30eff1de8a76769e5761
2025-01-29 05:36:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot df6be9f665 Use alert to test type generation prototype (#49038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49038

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774524

fbshipit-source-id: 791da64babebc8d08f671262fa63f67aff2c0942
2025-01-29 05:36:53 -08:00
Pieter De BaetsandFacebook GitHub Bot 90c6f7eab8 Fix ScrollEvent DebugStringCovertible (#49029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49029

This was never being compiled, because we didn't import the header that set `RN_DEBUG_STRING_CONVERTIBLE`

Will look at enabling `-Wundef` to catch these.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D68797482

fbshipit-source-id: 6a01192c799903b6f956f9b0acea94bd93183f3b
2025-01-29 05:05:04 -08:00
Nicola CortiandFacebook GitHub Bot 6307fe869f Remove unused methods from TurboModulePerfLogger (#49033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49033

Those methods are not used at all in the codebase, let's clean them up.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68826893

fbshipit-source-id: 36e2f0ae247ed72305c1d9d346c6cf32cef6f8f2
2025-01-29 05:04:27 -08:00
Nicola CortiandFacebook GitHub Bot 71d39c5cfd Migrate TurboModulePerfLogger to Kotlin + internalize it. (#49034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49034

This class was still in Java. I'm converting it to Kotlin + I'm making it internal.
As this class was inside the `com.facebook.react.internal.turbomodule.core` package,
we don't consider this a breaking change.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68826892

fbshipit-source-id: b1f7aea984ab333faea66a9e8ccbb1492767333e
2025-01-29 05:04:27 -08:00
Iwo PlazaandFacebook GitHub Bot e767dc3458 Migrate files in Libraries/Lists to export syntax (#49024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49024

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates files in `Libraries/Lists/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/Lists` with `require` syntax may need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68783945

fbshipit-source-id: 7563155254fed40b6fe7d280d9e040ea24a5c870
2025-01-29 04:15:30 -08:00
Ruslan LesiutinandFacebook GitHub Bot dd240edd6d Explicitly check that Debugger domain is disabled before starting Tracing (#49007)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49007

# Changelog: [Internal]

Before sending `Tracing.start`, CDT will also send `Debugger.disable`.

You don't want to hit your breakpoints when you are profiling an appplication, this is by design.

We won't just delegate this to Hermes to handle. We will explicitly check that this condition is satisfied on React Native side. This is done to avoid regression in case the implementation details will change on CDT side.

Later in D68414421, we will also check that samples JavaScript stack don't contain debugger frames. This is necessary to distinguish garbage collector frames from debugger frames, which share the same type in Hermes VM - "Suspend".

We need garbage collector frames. If debugger frame was found we would throw an error, because this is unexpected after Debugger domain was disabled.

Right now Hermes is not disabling local VM Debugger on `Debugger.disable` method - this is a known bug, which I am addressing in a stack from D68772900.

Reviewed By: huntie

Differential Revision: D68776863

fbshipit-source-id: 4346ac5eb850578265a179b5fd687539ae7d15bc
2025-01-29 03:51:58 -08:00
Nicola CortiandFacebook GitHub Bot bd050ac191 Remove unused FallbackJSBundleLoader (#49005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49005

This is essentially dead code. Not used at all but publicly exposed.
I found no meaningful usages in OSS so this is safe to remove:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Apvinis%2Freact-native---investigation+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.bridge.FallbackJSBundleLoader

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68773273

fbshipit-source-id: 96a028cb0caf95ee899db1488dbf5ae82cc567f9
2025-01-29 03:51:35 -08:00
Fabrizio CucciandFacebook GitHub Bot 7377d57874 Add changelog entry for v0.78.0-rc.2 (#49031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49031

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68826401

fbshipit-source-id: ce2d6d95f41d6ce9059dbbba1fecd991fbafd0f3
2025-01-29 03:44:53 -08:00
Nick GerlemanandFacebook GitHub Bot 8e2de303e3 Disallow invalid unitless lengths in box shadows (#48988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48988

The only unitless `<length>` value allowed is `0`, so most of the examples in the `processBoxShadow` unit tests are parse errors on web 🫠. Lets update the tests, and disallow these invalid values.

Changelog:
[General][Breaking] - Disallow invalid unitless lengths in box shadows

Reviewed By: jorge-cab

Differential Revision: D68740553

fbshipit-source-id: ea935819f773c5d516dd9b3367e5d2c808941c28
2025-01-28 22:47:40 -08:00
Nick GerlemanandFacebook GitHub Bot 3b5dc5626b Fix some CSSRatio Behavior (#48984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48984

Noticed this in conjunction with another change, that I misinterpreted the ratio spec a bit. Ratios with a part less than zero are parse errors, while degenerate ratios are not (Chrome and Firefox both treat like this).

Removing usage of visitorless `consumeComponentValue()` here in preparation for next diff.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68733519

fbshipit-source-id: 9afc7b7295b067a3e1469e2f80f5c9a6bea41fae
2025-01-28 17:38:50 -08:00
Nolan O'BrienandFacebook GitHub Bot 2ed0ba0722 Improve definitions in METAXXHashUtils (#49027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49027

Make constants more specific to `METAHash` (avoid potential conflicts) and unify the APIs with a shared attribute definition (will be used to mark these APIs as unavailable from Swift).

## Changelog:

[iOS] [Changed] - Change prime constants to have prefix in order to avoid any potential conflicts

Reviewed By: adamjernst

Differential Revision: D68790450

fbshipit-source-id: 69c8b73063cf57d6a4ec25f6cd52a906c77694f0
2025-01-28 16:35:40 -08:00
Nicola CortiandFacebook GitHub Bot d797b7aa4d Minor Kotlin cleanup (#49000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49000

Just found those nits around while looking at the codebase.
This clears things out and should have no runtime impact.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68768384

fbshipit-source-id: bd3a30f1792a6f662d1f5b25855c89b6d43e72bb
2025-01-28 11:37:53 -08:00
Iwo PlazaandFacebook GitHub Bot c93bd436a5 Migrate Libraries/ReactNative/*.js to use export syntax. (#48650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48650

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates the `Libraries/ReactNative/*.js` files to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/ReactNative` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D68109193

fbshipit-source-id: 3444bf6b2152f7ed72d2923149a10041d718aaf0
2025-01-28 11:21:55 -08:00
zhongwuzwandFacebook GitHub Bot cbaff1c7aa Fabric: Fixes crash of dynamic color when light/dark mode changed (#48496)
Summary:
The reason is when light/dark mode changed, the `hash` value also changed because we used `color.getColor()`. leads to size balanced break.

```
Assertion failed: (index_.size() == lru_.size()), function size, file EvictingCacheMap.h, line 439.

(lldb) bt
* thread https://github.com/facebook/react-native/issues/1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001089a9108 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x0000000105de3408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
  * frame https://github.com/facebook/react-native/issues/4: 0x00000001073e386c React_FabricComponents`folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::size(this=0x0000600003900348) const at EvictingCacheMap.h:439:5
    frame https://github.com/facebook/react-native/issues/5: 0x00000001073e34f4 React_FabricComponents`void folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::setImpl<facebook::react::AttributedString>(this=0x0000600003900348, key=0x000000016b9f20a8, value=nullptr, promote=true, pruneHook=folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void> >::PruneHookCall @ 0x000000016b9f1cc8) at EvictingCacheMap.h:674:27
    frame https://github.com/facebook/react-native/issues/6: 0x00000001073deb88 React_FabricComponents`folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::set(this=0x0000600003900348, key=0x000000016b9f20a8, value=ptr = 0x60000024ae20 strong=2 weak=1, promote=true, pruneHook=folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void> >::PruneHookCall @ 0x000000016b9f1d98) at EvictingCacheMap.h:346:5
    frame https://github.com/facebook/react-native/issues/7: 0x00000001073d91dc React_FabricComponents`facebook::react::SimpleThreadSafeCache<facebook::react::AttributedString, std::__1::shared_ptr<void>, 256>::get(this=0x0000600003900348, key=0x000000016b9f20a8, generator= Lambda in File RCTTextLayoutManager.mm at Line 337) const at SimpleThreadSafeCache.h:40:12
    frame https://github.com/facebook/react-native/issues/8: 0x00000001073d9058 React_FabricComponents`-[RCTTextLayoutManager _nsAttributedStringFromAttributedString:](self=0x0000600003900340, _cmd="_nsAttributedStringFromAttributedString:", attributedString=AttributedString @ 0x000000016b9f20a8) at RCTTextLayoutManager.mm:337:42
    frame https://github.com/facebook/react-native/issues/9: 0x00000001073d6378 React_FabricComponents`-[RCTTextLayoutManager drawAttributedString:paragraphAttributes:frame:drawHighlightPath:](self=0x0000600003900340, _cmd="drawAttributedString:paragraphAttributes:frame:drawHighlightPath:", attributedString=AttributedString @ 0x000000016b9f23a8, paragraphAttributes=ParagraphAttributes @ 0x000000016b9f2378, frame=(origin = (x = 0, y = 0), size = (width = 92, height = 21.666748046875)), block=0x00000001061602d0) at RCTTextLayoutManager.mm:73:56
    frame https://github.com/facebook/react-native/issues/10: 0x000000010616020c RCTFabric`-[RCTParagraphTextView drawRect:](self=0x000000012beb9dc0, _cmd="drawRect:", rect=(origin = (x = 0, y = 0.000081380208335701809), size = (width = 92, height = 21.666666666666664))) at RCTParagraphComponentView.mm:346:3
    frame https://github.com/facebook/react-native/issues/11: 0x0000000186043e60 UIKitCore`-[UIView(CALayerDelegate) drawLayer:inContext:] + 584
    frame https://github.com/facebook/react-native/issues/12: 0x000000018af40080 QuartzCore`CABackingStoreUpdate_ + 244
    frame https://github.com/facebook/react-native/issues/13: 0x000000018b0bec88 QuartzCore`invocation function for block in CA::Layer::display_() + 108
    frame https://github.com/facebook/react-native/issues/14: 0x000000018b0b5524 QuartzCore`-[CALayer _display] + 1596
    frame https://github.com/facebook/react-native/issues/15: 0x000000018b0c7e74 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 392
    frame https://github.com/facebook/react-native/issues/16: 0x000000018affca50 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 464
    frame https://github.com/facebook/react-native/issues/17: 0x000000018b02b260 QuartzCore`CA::Transaction::commit() + 652
    frame https://github.com/facebook/react-native/issues/18: 0x000000018b02c7b4 QuartzCore`CA::Transaction::flush_as_runloop_observer(bool) + 68
    frame https://github.com/facebook/react-native/issues/19: 0x0000000185ad6c1c UIKitCore`_UIApplicationFlushCATransaction + 48
    frame https://github.com/facebook/react-native/issues/20: 0x0000000185a07ccc UIKitCore`__setupUpdateSequence_block_invoke_2 + 352
    frame https://github.com/facebook/react-native/issues/21: 0x000000018505d28c UIKitCore`_UIUpdateSequenceRun + 76
    frame https://github.com/facebook/react-native/issues/22: 0x0000000185a07670 UIKitCore`schedulerStepScheduledMainSection + 168
    frame https://github.com/facebook/react-native/issues/23: 0x0000000185a06aa8 UIKitCore`runloopSourceCallback + 80
    frame https://github.com/facebook/react-native/issues/24: 0x000000018041b7c4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame https://github.com/facebook/react-native/issues/25: 0x000000018041b70c CoreFoundation`__CFRunLoopDoSource0 + 172
    frame https://github.com/facebook/react-native/issues/26: 0x000000018041ae70 CoreFoundation`__CFRunLoopDoSources0 + 232
    frame https://github.com/facebook/react-native/issues/27: 0x00000001804153b4 CoreFoundation`__CFRunLoopRun + 788
    frame https://github.com/facebook/react-native/issues/28: 0x0000000180414c24 CoreFoundation`CFRunLoopRunSpecific + 552
    frame https://github.com/facebook/react-native/issues/29: 0x000000019020ab10 GraphicsServices`GSEventRunModal + 160
    frame https://github.com/facebook/react-native/issues/30: 0x0000000185ad82fc UIKitCore`-[UIApplication _run] + 796
    frame https://github.com/facebook/react-native/issues/31: 0x0000000185adc4f4 UIKitCore`UIApplicationMain + 124
    frame https://github.com/facebook/react-native/issues/32: 0x0000000104521f68 RNTester.debug.dylib`main(argc=1, argv=0x000000016b9f5af8) at main.m:15:12
    frame https://github.com/facebook/react-native/issues/33: 0x00000001045b9410 dyld_sim`start_sim + 20
    frame https://github.com/facebook/react-native/issues/34: 0x0000000104796274 dyld`start + 2840
```

## Changelog:

[IOS] [FIXED] - Fabric: Fixes crash of dynamic color when light/dark mode changed

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

Test Plan:
RNTester -> PlatformColor example -> changed the dark/light mode  in the system settings -> go back to App and pop and push the PlatformColor example, it would crash:

![Simulator Screen Recording - iPhone 16 - 2025-01-05 at 15 46 08](https://github.com/user-attachments/assets/f6faaf80-ad03-49c6-9a56-b1117bdc2659)

Reviewed By: sammy-SC

Differential Revision: D68157559

Pulled By: cipolleschi

fbshipit-source-id: 01959845b742ce748186d3877b2792f0f9132ff5
2025-01-28 11:20:18 -08:00
Vitali ZaidmanandFacebook GitHub Bot ff2e40371e don't inline sourceMapURL in Debugger.scriptParsed (#49001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49001

In {D42973408}, `Debugger.scriptParsed` was tweaked to be intercepted in `inspector-proxy`, which:
1. Rewrote the `sourceMapURL` to be relative to debugger.
2. Attempted to fetch the contents of the source map from `sourceMapURL` after re-writing again to a server-relative URL, and if successful replaced `sourceMapURL` with a base64 data URL.

1 is still needed until we have `Network.loadNetworkResource`, but 2 was only needed for frontends that did not support http fetch, and is not needed with Fusebox.

Changelog: [General][Changed] `Debugger.scriptParsed` now includes the field `sourceMapURL` as a (rewritten) remote url as opposed to base64 data url

Reviewed By: robhogan

Differential Revision: D68708899

fbshipit-source-id: 95242582c79ce4e9a573d4a3e639b0dc3290869e
2025-01-28 11:09:32 -08:00
Nicola CortiandFacebook GitHub Bot 362a191aee Convert CxxCallbackImpl to Kotlin (#49004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49004

This just converts yet another class to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D68772336

fbshipit-source-id: 428cb3a0d54bf7a22f0e4eb07268cdc27ef6f2c3
2025-01-28 11:01:59 -08:00
Iwo PlazaandFacebook GitHub Bot 156ee5bee7 Migrate StyleSheet/processColorArray.js to use export syntax (#48905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48905

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates `Libraries/StyleSheet/processColorArray.js` to use `export` syntax.
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updated View Config codegen (requires an MSDK bump).
- Updates the public API snapshot *(intented breaking change)*

Changelog:
[General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: robhogan

Differential Revision: D68564304

fbshipit-source-id: 2fbd058be1a715cccfce4f2a68146118d8ac66ad
2025-01-28 09:46:50 -08:00
Iwo PlazaandFacebook GitHub Bot aac312da8e Migrate DrawerAndroid, ProgressBarAndroid, SafeAreaView, ScrollView, TextInput, ToastAndroid, UnimplementedView and View components to export syntax (#48807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48807

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68436127

fbshipit-source-id: e3496fe69d66932dd4ed82f41d810f3ef1f850f5
2025-01-28 09:06:57 -08:00
Ruslan LesiutinandFacebook GitHub Bot 600d814381 Update debugger-frontend from 7727db8...d126cc8 (#48979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48979

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7727db8...d126cc8

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

Reviewed By: huntie

Differential Revision: D68717476

fbshipit-source-id: ac2fd0551b069ae9077646ecb6b22f066e3e567c
2025-01-28 08:36:10 -08:00
Ruslan LesiutinandFacebook GitHub Bot 07860545f5 Roll out 6.1.0 on fbsource (#48963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48963

# Changelog:
[General] [Changed] - upgrade React DevTools to 6.1.0.

allow-large-files

Reviewed By: robhogan

Differential Revision: D68705543

fbshipit-source-id: 293034cc3e4cb93fed6a05df905ee63ea5382562
2025-01-28 08:36:10 -08:00
Dawid MałeckiandFacebook GitHub Bot 89af3e804f Add explicit type for Symbol.iterator in URLSearchParams (#48999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48999

Changelog:
[General][Changed] - Added explicit type for Symbol.iterator in URLSearchParams

Reviewed By: cortinico

Differential Revision: D68766996

fbshipit-source-id: 47aeed737134628b838e9382b04e0bb95513bee0
2025-01-28 08:07:13 -08:00
Rubén NorteandFacebook GitHub Bot c925872e72 Throw an error when calling root.render outside of a task (#49003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49003

Changelog: [internal]

I was adding a benchmark for rendering thousands of views and it was surprisingly fast, until I realized I wasn't wrapping the call to `root.render` in `runTask`, which means the benchmark wasn't really doing the rendering, only scheduling a microtask that was never executed.

This is a safety mechanism to prevent those mistakes.

Reviewed By: sammy-SC

Differential Revision: D68771170

fbshipit-source-id: 5bd8e6ba9e1168db2320572c99b3a01ebd6aeeed
2025-01-28 07:26:23 -08:00
Cedric van PuttenandFacebook GitHub Bot 32fe244744 fix(react-native): pass the protocol from bundle URL to HMR client on Android (#48998)
Summary:
This is another attempt at fixing the Android HMR client for HTTPS proxied Metro instances. The previous one unintentionally [caused the following error](https://github.com/facebook/react-native/pull/48970#issuecomment-2617047184):

```
java.lang.AssertionError: Method overloading is unsupported: com.facebook.react.devsupport.HMRClient#setup
```

This PR removes the overloading, and only adds the `scheme` property as a parameter to the existing `.setup` method. Aligning with the exact behavior we have on iOS.

The alternative fix, which should NOT be backward breaking (if this is) - is to move this "infer the protocol from the bundle URL" to the JS side of the HMR client. Where we don't just always default to `http`, but instead default to `https IF port === 443, otherwise http`. It's a bit more hacky, but shouldn't cause any other issues. _**Ideally**_, we have the same working behavior on both Android and iOS without workarounds.

<details><summary>Alternative workaround</summary>

See [this change](https://github.com/facebook/react-native/compare/main...byCedric:react-native:patch-2).

<img width="1179" alt="image" src="https://github.com/user-attachments/assets/47c365bc-6df8-43e6-ad7d-5a667e350cd4" />

</details>

See full explanation on https://github.com/facebook/react-native/issues/48970

> We've noticed that the HMR on Android doesn't seem to be connecting when using a HTTPS-proxied Metro instance, where the proxy is hosted through Cloudflare. This is only an issue on Android - not iOS - and likely caused by the HMR Client not being set up properly on Android.
>
>- On Android, we run `.setup('android', <bundleEntryPath>, <proxiedMetroHost>, <proxiedMetroPort>, <hmrEnabled>)` in the [**react/devsupport/DevSupportManagerBase.java**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java#L689-L691) file.
>- On iOS, we run `[self.callableJSModules invokeModule:@"HMRClient" method:@"setup" withArgs:@[ RCTPlatformName, path, host, RCTNullIfNil(port), @(isHotLoadingEnabled), scheme ]];` in the [**React/CoreModules
/RCTDevSettings.mm**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/React/CoreModules/RCTDevSettings.mm#L488-L491) file.
>
>Notice how Android does not pass in the scheme/protocol of the bundle URL, while iOS actually does? Unfortunately, because the default protocol (`http`) mismatches on Android when using HTTPS proxies, we actually try to connect the HMR client over `http` instead of `https` - while still using port 443 - which is rejected by Cloudflare's infrastructure even before we can redirect or mitigate this issue. And the rejection is valid, as we basically try to connect on `http://<host>:443` (the source URL is `https`, so the port is infered as `443`).
>
>This change adds scheme propagation to Android, exactly like we do on iOS for the HMR Client.

## Changelog:

[ANDROID] [FIXED] Pass the bundle URL protocol when setting up HMR client on Android

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

Test Plan:
See full explanation on https://github.com/facebook/react-native/issues/48970

> It's a little bit hard to test this out yourself, since you'd need a HTTPS-based proxy and reject HTTP connections for HTTPS/WSS Websocket requests.
>
>You can set this up through:
>- `bun create expo@latest ./test-app`
>- `cd ./test-app`
>- `touch .env`
>- Set `EXPO_PACKAGER_PROXY_URL=https://<proxied-metro-hostname>` in **.env**
>- Set `REACT_NATIVE_PACKAGER_HOSTNAME=<proxied-metro-hostname>` in **.env**
>- `bun run start`
>
>Setting both these envvars, the bundle URL in the manifest is set to `https://...` - which triggers this HMR issue on Android. You can validate the **.env** setup through:
>
>```bash
>curl "http://localhost:8081" -H "expo-platform: android" | jq .launchAsset.url
>```
>
>This should point the entry bundle URL towards the `EXPO_PACKAGER_PROXY_URL`.

Reviewed By: cortinico

Differential Revision: D68768351

Pulled By: javache

fbshipit-source-id: 49bf1dc60f11b2af6e57177141270632d62ab564
2025-01-28 07:20:32 -08:00
Alex HuntandFacebook GitHub Bot bb1e3cdb04 Update cli-server-api middleware imports (#48997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48997

Follows https://github.com/react-native-community/cli/pull/2584.

- Also add FIXME comment flagging potential core APIs gap without CLI.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68766565

fbshipit-source-id: 60747715f76c4323e306c39ab0613fb4818b4914
2025-01-28 07:11:13 -08:00
Eric RozellandFacebook GitHub Bot 037504cc7b Fix durability of PerformanceObserver mark/measure example (#48940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48940

The PerformanceObserver (marks and measures) example clears it's output each time a new PerformanceObserver event fires, which makes it not particularly useful.

This change makes it so the output is only updated if a non-empty list of performance events is observed.

## Changelog

[Internal]

Reviewed By: rubennorte

Differential Revision: D68634361

fbshipit-source-id: 71b97e1c66aabd090cae63d55c8fa0a425d0c2f4
2025-01-28 07:08:11 -08:00
Iwo PlazaandFacebook GitHub Bot 48d900b703 Migrate files in Libraries/Inspector to use export syntax (#48931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48931

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling

## This diff
- Updates files in Libraries/Inspector to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Inspector` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: robhogan

Differential Revision: D68629285

fbshipit-source-id: ee0904ea5e8f9389aecfb197d05225c88137fb08
2025-01-28 06:13:07 -08:00
Mateo GuzmánandFacebook GitHub Bot 9572bcf028 Add OkHttpClientProvider tests (#48958)
Summary:
Currently, the class OkHttpClientProvider is still in Java. Adding some tests before migrating it to Kotlin

## Changelog:

[INTERNAL] - Add OkHttpClientProvider tests

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

Test Plan:
```bash
./gradlew :packages:react-native:ReactAndroid:test -Dtest.single=com.facebook.react.modules.network
```

Reviewed By: javache

Differential Revision: D68706173

Pulled By: cortinico

fbshipit-source-id: 7b4b1cbe17ff39d3775075682dcb8d253892e062
2025-01-28 06:04:05 -08:00
VidocqHandFacebook GitHub Bot 2ae45ec3ce fix TextInput dataDetectorTypes (#48952)
Summary:
Setting `dataDetectorTypes` has no effect. As I am new to the react native codebase, it seems like `dataDetectorTypes` has not implemented on new arch yet.

issue: https://github.com/facebook/react-native/issues/48951

## Changelog:

[IOS] [FIXED] - implement `dataDetectorTypes` in the same way as the old architecture

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

Test Plan: <img width="356" alt="image" src="https://github.com/user-attachments/assets/192a683c-f7b7-48ac-98cd-76866901f008" />

Reviewed By: javache

Differential Revision: D68715166

Pulled By: cipolleschi

fbshipit-source-id: 612119e7453da012e6f75e1fc3a22ddedcb569a4
2025-01-28 05:07:26 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 98b8f17811 Add extra parameter to define whether codegen is invoked by lib or app (#48995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48995

This change adds an extra parameter to the codegen script that allow our users to trigger codegen for Apps or for Libraries.

When running codegen for Apps, we have to generate some extra files that are not needed by the Libraries. This is causing issues to our library maintainers and this change will provide more flexibility in the DevX of libraries.

The default value is App, so if the new parameter is not passed, nothing will change in the current behavior.

## Changelog:
[iOS][Added] - Add the `source` parameter to generate-codegen-artifacts to avoid generating files not needed by libraries.

Reviewed By: cortinico

Differential Revision: D68765478

fbshipit-source-id: 8030b4472ad4f5058e58b1c91089de5122a4f60a
2025-01-28 05:06:54 -08:00
Nicola CortiandFacebook GitHub Bot 08ddc11269 Stable API - Refactor and remove unnecessary RuntimeConfig (#48934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48934

This class is publicly exposed but effectively unused at all (neither internally, nor externally).
I'm removing it as this should not affect anyone.

Changelog:
[Android] [Breaking] - Removed `RuntimeConfig` class for Hermes which was unused.

Reviewed By: tdn120

Differential Revision: D68631945

fbshipit-source-id: 6a62ccda9e62f4bae650c11bc17a95efc8c88baf
2025-01-28 04:58:35 -08:00
Alex HuntandFacebook GitHub Bot 514ec4192f Remove hanging reference to Remote Debugging endpoint on Android (#48996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48996

Follows https://github.com/react-native-community/discussions-and-proposals/discussions/872.

Changelog:
[Android][Removed] - Remove `DevSupportManagerFactory.launchJSDevtools` API

Reviewed By: hoxyq

Differential Revision: D68766564

fbshipit-source-id: a9dad3a81ecc3fc03f056d4ccac8aa3e489cf242
2025-01-28 04:55:49 -08:00
CHOIMINSEOKandFacebook GitHub Bot 541e655832 fix wrong cocoapods script on new_architecture.rb (#48992)
Summary:
It seems that the `new_architecture.rb` script has an incorrect dependency configuration. The decision to install either “hermes-engine” or “React-jsc” should depend on whether Hermes is enabled or not. However, in the current `new_architecture.rb` setup, the build script toggles between “hermes-engine” and “React-jsi”.

```
        if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
            spec.dependency "hermes-engine"
        else
            spec.dependency "React-jsi" // <=  this must be "React-jsc", not "React-jsi"
        end
```
https://github.com/facebook/react-native/blob/701622506248022c3a2fcea1c0066bba6e80232a/packages/react-native/scripts/cocoapods/new_architecture.rb#L141

When you try to use reanimated in brownfield app, you can reproduce runtime exception by this.

Reproduce Repo: https://github.com/CHOIMINSEOK/FullScreenOverlayIssue
script patch for this issue : https://github.com/CHOIMINSEOK/FullScreenOverlayIssue/blob/main/rn-app/.yarn/patches/react-native-reanimated-npm-3.16.7-1e7cd6d376.patch

## Changelog:

[IOS] [FIXED] - fix wrong cocoapods script on new_architecture.rb

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

Test Plan: I have no idea how to test regression.

Reviewed By: cortinico

Differential Revision: D68763630

Pulled By: cipolleschi

fbshipit-source-id: 7c2a0ea48815be5d77be7ed7aceed6a5bf574349
2025-01-28 04:53:23 -08:00
zhongwuzwandFacebook GitHub Bot c8f1506f13 Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method (#48948)
Summary:
`shouldBridgeUseCustomJSC` comes from https://github.com/zhongwuzw/react-native/commit/cb3e575deb8a2be972298b12761ed9ee8f0ae63d, seems it's not working anymore. So we can clean up it .

## Changelog:

[IOS] [REMOVED] - Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method

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

Test Plan: Everything should works.

Reviewed By: christophpurrer

Differential Revision: D68728588

Pulled By: javache

fbshipit-source-id: 8a762b5f3d6272fa7be57e0b17cb655eba743b5d
2025-01-28 04:37:37 -08:00
Rubén NorteandFacebook GitHub Bot e8eae9448f Remove expected ESLint error (#48980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48980

Changelog: [internal]

This will be properly removed soon, but disabling for now to avoid showing up in all PRs.

Reviewed By: cortinico

Differential Revision: D68719573

fbshipit-source-id: 6a631ba2556f1399d0ade52f19b79f5a3212e007
2025-01-28 03:32:15 -08:00
Mateo GuzmánandFacebook GitHub Bot 7016225062 Sync Modal system bars visibility with current activity (#48516)
Summary:
Fixes https://github.com/facebook/react-native/issues/37801

This PR fixes the system bars visibility not being in sync as with the activity it is displayed on.

Here I am also taking into account the feedback given in [this PR](https://github.com/facebook/react-native/pull/36854) which was also aiming to address this issue. Unfortunately, I tried in multiple ways to get this to work by simply extending the whole system bars behaviour in the dialog with the activity system bars behaviour but found out that that solution won't work as we [currently clear the flag "FLAG_NOT_FOCUSABLE"](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt#L314) and unless we remove that line, extending the behaviour won't work. Removing that line is not an option as it would cause other side effects in the dialog itself.

With the above said, I ended up doing this in a more explicit way, by checking whether the status or navigation bars are hidden in the activity and then hiding then as well in the dialog or otherwise, similar as we are currently doing with the status bars appearance.

## Changelog:

[ANDROID] [FIXED] - Sync Modal system bars visibility with current activity

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

Test Plan:
In order to test this, you need to trigger any method that hides or shows the system bars using `window.insetsController`. Here a very small example of it:

```kt
fun toggleSystemBarsVisibility(shouldHide: Boolean) {
  val window = currentActivity?.window
  val controller = window?.insetsController
  if (shouldHide) {
    controller?.hide(WindowInsets.Type.systemBars())
  } else {
    controller?.show(WindowInsets.Type.systemBars())
  }
}
```

You can do this optionally from JS to make testing different cases easier. Below is a screen recording of how the solutions looks like:

<details>
<summary>Screen recording showcasing the solution in the test plan</summary>

https://github.com/user-attachments/assets/c497c1cb-5e65-4f31-98cc-aefd2d7b0339
</details>

Reviewed By: mdvacca, Abbondanzo

Differential Revision: D67906071

Pulled By: alanleedev

fbshipit-source-id: cbb2d15520d7729a9e9eafb5f5efb8d20d796c60
2025-01-27 18:02:46 -08:00
Dmitry RykunandFacebook GitHub Bot 409047bb6d Remove some code duplication in ConcreteComponentDescriptor::cloneProps (#48938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48938

Simple cleanup. Move the instantiation of shadowNodeProps outside of the IF statement.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D68634269

fbshipit-source-id: 40a103060fc96a5c74c7d81f7d6e8ac0565948c8
2025-01-27 16:24:27 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f8d5e3b3f0 Fix innerBoxShadows not getting border-radius applied (#48983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48983

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68734160

fbshipit-source-id: 05edb5c1f97353517ade58ca690d58cbe4bd1068
2025-01-27 16:03:13 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f7d78f81cc Fix elevation with border-radius set (#48982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48982

We were missing a conversion to px on the `getOutline()` function of `CompositeBackgroundDrawable` which led to incorrect elevation prop rendering

Changelog: [Android][Fixed] - Elevation prop on android has incorrect border-radius

Reviewed By: NickGerleman

Differential Revision: D68724947

fbshipit-source-id: b3a7a4919bfd7c60fac7c3d6e3ba760e3f74d190
2025-01-27 14:41:16 -08:00
Pieter De BaetsandFacebook GitHub Bot 6e9a4627c4 Revert D68711137: fix(react-native): pass the protocol from bundle URL to HMR client on Android
Differential Revision:
D68711137

Original commit changeset: 230c1c91c818

Original Phabricator Diff: D68711137

fbshipit-source-id: 00cc23468596d8b75800d7dd388b2c51518d79e6
2025-01-27 14:41:14 -08:00
Nick GerlemanandFacebook GitHub Bot 9aae84a688 Remove some web debugging remnants (#48054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48054

Web debugging should be fully removed as of recent, so lets remove some of the gunk that was powering it, and checks for that environment.

I did some string searches for the following:

* isAsyncDebugging
* debugRemotely
* isDebuggingRemotely
* isRemoteDebuggingAvailable
* WebSocketExecutor
* JavaJSExecutor
* ProxyJavaScriptExecutor
* RELOAD_APP_EXTRA_JS_PROXY
* getJSBundleURLForRemoteDebugging
* onReloadWithJSDebugger
* setRemoteJSDebugEnabled
* WebsocketJavaScriptExecutor
* createRemoteDebuggerBundleLoader

1. `expo-modules-core` exposes its own `isAsyncDebugging` by checking for `nativeCallSyncHook`, but does not depend on `DebugEnvironment`.
2. `expo-dev-menu` does read `isDebuggingRemotely` from `DevSettings`.
3. Realm does a check in Native using `objc_lookUpClass("RCTWebSocketExecutor")` but will gracefully handle `nil` if it does not exist
4. Some more usages (e.g. `onReloadWithJSDebugger`) in vendored packages of `expo-dev-launcher` for RN 0.74

I created an issue for Expo mentioning both here: https://github.com/expo/expo/issues/33371

Changelog:
[General][Breaking] - Remove some web debugging remnants

Reviewed By: huntie

Differential Revision: D66553934

fbshipit-source-id: deec382b1c8bda393fddb8682aa91b26afd9fbe3
2025-01-27 14:40:33 -08:00
zhongwuzwandFacebook GitHub Bot 3e2e8ec757 Bridge: Fixes HostTarget use after free when deallocated bridge (#48847)
Summary:
Fixes https://github.com/facebook/react-native/issues/48805 .

## Changelog:

[IOS] [FIXED] - Bridge: Fixes HostTarget use after free when deallocated bridge

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

Test Plan:
Test code:
```
  __weak RCTAlertManager *weakModule;
  autoreleasepool {
    RCTAlertManager *module = [RCTAlertManager new];
    RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:[self sourceURLForBridge:nil]
                                              moduleProvider:^{
      return @[ module ];
    }
                                               launchOptions:nil];
    weakModule = module;
    (void)bridge;
  }
```

Reviewed By: realsoelynn

Differential Revision: D68495576

Pulled By: huntie

fbshipit-source-id: c3086a429f24488ac286ff22d039b8f049ccbffd
2025-01-27 12:15:37 -08:00
Nick GerlemanandFacebook GitHub Bot 1593142648 Support parsing hwb() functions (#48913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48913

This brings us to parity with normalize-color, and is mostly similar to hsl, with the notable exception there is not a separate alpha variant, and only modern function syntax is supported. Again, I took the math from normalize-color, and sanity tested it against reference function provided by Color Spec.

I'm going to let that cap off color function support for now, and leave the rest as TODO.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68594471

fbshipit-source-id: 95702d576e068655d34e52a714d38e4fd718bbc9
2025-01-27 12:07:21 -08:00
Nick GerlemanandFacebook GitHub Bot 676359efd9 Breaking: Remove incorrect hwb() syntax support from normalize-color (#48912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48912

The implementation of `hwb()` color functions added in https://github.com/facebook/react-native/pull/34600 is pretty flawed.

`hwb()` color functions do not allow comma delimited values. So most of the examples in the unit test here will fail to parse on web. Like `hsl()`, these should also allow numeric non-hue components (instead of just %), and angle values for hue (instead of just numbers), and this is also missing support for alpha values, though these are less dangerous compared to allowing and encouraging incorrect delimiters.

https://www.w3.org/TR/css-color-4/#the-hwb-notation

These were added for web compat, and the examples fail to parse on web, so I'm opting to just remove this incorrect support before implementing this more correctly in the Fabric CSS parser in next diff. I did not attempt to fix the other issues I discovered with the PR implementation in the last couple diffs, around mixing and matching syntax allowed in legacy/modern, along with allowing inconsistent delimiters.

Changelog:
[General][Breaking] - Remove incorrect hwb() syntax support from normalize-color

Reviewed By: lenaic

Differential Revision: D68591172

fbshipit-source-id: 36d670b096ae9fac4bc24938877ad083d4dd336a
2025-01-27 12:07:21 -08:00
Christoph PurrerandFacebook GitHub Bot a419315543 Use uint32_t for httpStatus (#48946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48946

[Changelog] [Internal] - [jsinspector-modern] Use uint32_t for httpStatus

Reviewed By: hoxyq

Differential Revision: D68676415

fbshipit-source-id: 748a2167fa695151095b74cf901f13951f28b0fa
2025-01-27 11:51:13 -08:00
Alex HuntandFacebook GitHub Bot 45cd63c259 Back out "Migrate Libraries/Utilities/*.js to use export syntax." (#48976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48976

Changelog: [Internal] - Will reattempt

Differential Revision: D68713280

fbshipit-source-id: 069d7dfd9846ab6272865b83163e772a6b17936a
2025-01-27 11:18:56 -08:00
Tim YungandFacebook GitHub Bot 50b75a74d1 Animated: Setup scheduleAnimatedCleanupInMicrotask Feature Flag (#48878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48878

Creates a new `scheduleAnimatedCleanupInMicrotask` feature flag to experiment with deferring the `AnimatedProps` cleanup using the microtask queue.

This is different from the previous approach of deferring invocation of the completion callback, which impacted the timing of composite animations such as `Animated.parallel` and `Animated.sequence`, because we are deferring detaching the `AnimatedNode` graph instead. This will only impact the timing of completion callbacks as a result of invalidating `AnimatedProps` (either by passing in new `AnimatedValue` instances or unmounting the component).

This should minimally impact scheduling and have lower risk of user-visible behavior change because React already provides minimal guarantees around when updates are committed (and effects attached/detached).

This also enables us to significantly simplify the current convoluted dance we do to optimized around reference counting in the AnimatedNode graph.

Changelog:
[General][Changed] - When an Animated component is updated or unmounted, `AnimatedNode` instances will now detach in a microtask instead of synchronously in the commit phase of React. This will cause the completion callback of finished animations to execute after the commit phase instead of during it.

Reviewed By: rickhanlonii

Differential Revision: D68527096

fbshipit-source-id: 99346b8ddbf6a01725376c692b0351be679b9e89
2025-01-27 11:04:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e77fe5c471 Bump React Native monorepo packages (#48975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48975

After cutting 0.78-stable, we need to bump the monorepo packages to `0.79.0-main`

## Changelog:
[Internal] - Bump monorepo packages to `0.79.0-main`

Reviewed By: cortinico, huntie

Differential Revision: D68715005

fbshipit-source-id: cb5abbf05e8638683687be8d61d66b3037111572
2025-01-27 11:01:34 -08:00
Samuel SuslaandFacebook GitHub Bot 6acd541f94 disable failing Differentiator test (#48973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48973

changelog: [internal]

This test is broken, let's disable it until it is fixed.

Reviewed By: javache

Differential Revision: D68709385

fbshipit-source-id: f61b287ad7ef921dd26fa290cc7a484d0b550091
2025-01-27 10:24:20 -08:00
Nicola CortiandFacebook GitHub Bot a08a6c9adc Remove unnecessary visiblity modifiers for internal classes (#48968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48968

I've noticed we have a lot of `public` and `protected` modifiers for classes that are actually `internal`.
Those are unnecessary as the class itself is `internal` and there is no way to extend the visibility of single fields.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68707255

fbshipit-source-id: 5b93d01dceba1b5031ac608e58ec898c1a1eaf51
2025-01-27 10:17:31 -08:00
Cedric van PuttenandFacebook GitHub Bot ba894c908a fix(react-native): pass the protocol from bundle URL to HMR client on Android (#48970)
Summary:
We've noticed that the HMR on Android doesn't seem to be connecting when using a HTTPS-proxied Metro instance, where the proxy is hosted through Cloudflare. This is only an issue on Android - not iOS - and likely caused by the HMR Client not being set up properly on Android.

- On Android, we run `.setup('android', <bundleEntryPath>, <proxiedMetroHost>, <proxiedMetroPort>, <hmrEnabled>)` in the [**react/devsupport/DevSupportManagerBase.java**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java#L689-L691) file.
- On iOS, we run `[self.callableJSModules invokeModule:@"HMRClient" method:@"setup" withArgs:@[ RCTPlatformName, path, host, RCTNullIfNil(port), @(isHotLoadingEnabled), scheme ]];` in the [**React/CoreModules
/RCTDevSettings.mm**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/React/CoreModules/RCTDevSettings.mm#L488-L491) file.

Notice how Android does not pass in the scheme/protocol of the bundle URL, while iOS actually does? Unfortunately, because the default protocol (`http`) mismatches on Android when using HTTPS proxies, we actually try to connect the HMR client over `http` instead of `https` - which is rejected by Cloudflare's infrastructure even before we can redirect or mitigate this issue.

This change adds scheme propagation to Android, exactly like we do on iOS for the HMR Client.

## Changelog:

[ANDROID] [FIXED] Pass the bundle URL protocol when setting up HMR client on Android

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

Test Plan: It's a little bit hard to test this out yourself, since you'd need a HTTPS-based proxy and reject HTTP connections for HTTPS/WSS Websocket requests.

Reviewed By: fabriziocucci

Differential Revision: D68711137

Pulled By: javache

fbshipit-source-id: 230c1c91c8189c0a109d20defe085966ac8f5721
2025-01-27 09:43:55 -08:00
Nicola CortiandFacebook GitHub Bot e05a2735cd Add Changelog for 0.74.7 (#48974)
Summary:
Changelog for 0.74.7

## Changelog:

[Internal] [Changed] -

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D68714820

Pulled By: cortinico

fbshipit-source-id: 42ee0e2cb83cf2ee16161468d1127fa2a8cc73bb
2025-01-27 09:37:04 -08:00
Håkon KnutzenandFacebook GitHub Bot 2a18d83521 Make RCTDeviceInfo._invalidated std::atomic<BOOL> (#48890)
Summary:
When running the tests associated with `RNTestPods` with `TSan` enabled, I get a data race:

```
WARNING: ThreadSanitizer: data race (pid=28047)
  Read of size 1 at 0x000144c30be9 by thread T32:
    #0 -[RCTDeviceInfo invalidate] <null> (RNTesterUnitTests:arm64+0x434bf8)
    https://github.com/facebook/react-native/issues/1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64+0x5e7fc)
    https://github.com/facebook/react-native/issues/2 decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:de180100]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...) <null> (RNTesterUnitTests:arm64+0x2a19d4)
    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+0x2a16ec)
    https://github.com/facebook/react-native/issues/4 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const <null> (RNTesterUnitTests:arm64+0x2455d4)
    https://github.com/facebook/react-native/issues/5 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x245404)
    https://github.com/facebook/react-native/issues/6 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x2c85b4)
    https://github.com/facebook/react-native/issues/7 -[RCTCxxBridge _tryAndHandleError:] <null> (RNTesterUnitTests:arm64+0x27c9e8)
    https://github.com/facebook/react-native/issues/8 __NSThreadPerformPerform <null> (Foundation:arm64+0x76c5e8)
    https://github.com/facebook/react-native/issues/9 __NSThread__start__ <null> (Foundation:arm64+0x76c27c)

  Previous write of size 1 at 0x000144c30be9 by thread T30:
    #0 -[RCTDeviceInfo invalidate] <null> (RNTesterUnitTests:arm64+0x434c1c)
    https://github.com/facebook/react-native/issues/1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64+0x5e7fc)
    https://github.com/facebook/react-native/issues/2 decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:de180100]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...) <null> (RNTesterUnitTests:arm64+0x2a19d4)
    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+0x2a16ec)
    https://github.com/facebook/react-native/issues/4 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const <null> (RNTesterUnitTests:arm64+0x2455d4)
    https://github.com/facebook/react-native/issues/5 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x245404)
    https://github.com/facebook/react-native/issues/6 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x2c85b4)
    https://github.com/facebook/react-native/issues/7 -[RCTCxxBridge _tryAndHandleError:] <null> (RNTesterUnitTests:arm64+0x27c9e8)
    https://github.com/facebook/react-native/issues/8 __NSThreadPerformPerform <null> (Foundation:arm64+0x76c5e8)
    https://github.com/facebook/react-native/issues/9 __NSThread__start__ <null> (Foundation:arm64+0x76c27c)

  Location is heap block of size 48 at 0x000144c30bd0 allocated by main thread:
    #0 calloc <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x53b90)
    https://github.com/facebook/react-native/issues/1 _malloc_type_calloc_outlined <null> (libsystem_malloc.dylib:arm64+0xf8dc)
    https://github.com/facebook/react-native/issues/2 -[RCTModuleData setUpInstanceAndBridge:] <null> (RNTesterUnitTests:arm64+0x32715c)
    https://github.com/facebook/react-native/issues/3 __25-[RCTModuleData instance]_block_invoke <null> (RNTesterUnitTests:arm64+0x32a288)
    https://github.com/facebook/react-native/issues/4 RCTUnsafeExecuteOnMainQueueSync <null> (RNTesterUnitTests:arm64+0x3d6e1c)
    https://github.com/facebook/react-native/issues/5 -[RCTModuleData instance] <null> (RNTesterUnitTests:arm64+0x329d78)
    https://github.com/facebook/react-native/issues/6 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke <null> (RNTesterUnitTests:arm64+0x287e74)
    https://github.com/facebook/react-native/issues/7 __wrap_dispatch_group_async_block_invoke <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x7cffc)
    https://github.com/facebook/react-native/issues/8 _dispatch_client_callout <null> (libdispatch.dylib:arm64+0x3c04)
    https://github.com/facebook/react-native/issues/9 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.136 <null> (XCTestCore:arm64+0x2d068)

  Thread T32 (tid=4154385, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x3027c)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x76bec4)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x23d638)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23addc)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23aa4c)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageLoaderUsesImageDecoderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0xc578)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x132cdc)

  Thread T30 (tid=4154383, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x3027c)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x76bec4)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x23d638)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23addc)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23aa4c)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageDecoding] <null> (RNTesterUnitTests:arm64+0xa8d0)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x132cdc)
```

The proposed solution is making the `BOOL` ivar in question a `std::atomic<BOOL>` instead.

## Changelog:

[IOS][FIXED] Data race related to read/write of RCTDeviceInfo._invalidated.

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

Test Plan: Existing tests in `RNTesterPods` and manually running RNTester application.

Reviewed By: christophpurrer

Differential Revision: D68629011

Pulled By: javache

fbshipit-source-id: 229d0db4aa13253b96ce0a20c9795c17e344cfc1
2025-01-27 09:20:47 -08:00
Rubén NorteandFacebook GitHub Bot f282baa26a Implement CustomEvent (#48922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48922

Changelog: [internal]

This is a basic subclass of Event that allows setting custom values (as opposed to `Event` that is meant to be used as a superclass).

Reviewed By: yungsters

Differential Revision: D67804060

fbshipit-source-id: 9e140cc436f8e230f37275a74df23efd4841071b
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 8445ebc248 Create module to handle event handler attributes (#48920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48920

Changelog: [internal]

Implements a module with helpers to define event handler IDL attributes in classes extending `EventTarget`. E.g.:

```
import {getEventHandlerAttribute, setEventHandlerAttribute} from '../path/to/EventHandlerAttributes';

class EventTargetSubclass extends EventTarget {
  get oncustomevent(): EventListener | null {
    return getEventHandlerAttribute(this, 'customEvent');
  }
  set oncustomevent(listener: EventListener | null) {
    setEventHandlerAttribute(this, 'customEvent', listener);
  }
}

const eventTargetInstance = new EventTargetSubclass();

eventTargetInstance.oncustomevent = (event: Event) => {
  console.log('custom event received');
};
eventTargetInstance.dispatchEvent(new Event('customEvent'));
// Logs 'custom event received' to the console.

eventTargetInstance.oncustomevent = null;
eventTargetInstance.dispatchEvent(new Event('customEvent'));
// Does not log anything to the console.

```

Reviewed By: javache

Differential Revision: D67839560

fbshipit-source-id: f301d174fa9a4c010940b875cadfc31298947c26
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 9fbc02a031 Move all properties of EventTarget to symbols to avoid polluting the global scope (#48962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48962

Changelog: [internal]

We moved away from private fields for `EventTarget` for performance, in favor of normal fields prefixed with underscore, but this would pollute the global scope when we make it extend `EventTarget`.

This refactors the implementation to use symbols for all properties to avoid that problem, leaving only `addEventListener` and `removeEventListener` as regular properties in the prototype.

Performance-wise this is neutral or a slight improvement according to the existing benchmark.

Reviewed By: javache

Differential Revision: D68672215

fbshipit-source-id: b329548efce6059ae2b9f33afa0719e057d3b8ba
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot b28ab79f1b Make constants in Event more spec compliant (#48918)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48918

Changelog: [internal]

Makes the constants read-only and accessible through `Event.prototype` as well.

Reviewed By: yungsters

Differential Revision: D67830012

fbshipit-source-id: 730622a642f08f532cebd4c183d859ccb2ca0641
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot e04e502f77 Further optimizations for event dispatching (#48426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48426

Changelog: [internal]

This improves the performance of DOM `Event` interface implementation by migrating away from private fields.

Reviewed By: yungsters

Differential Revision: D67751821

fbshipit-source-id: e58e5a9cbb04e7d91cbc676ec7d1b00fff357e2e
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 47e490f084 Make EventTarget compatible with the existing implementation of ReadOnlyNode (#48427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48427

Changelog: [internal]

The `ReactNativeElement` class was refactored for performance reasons, and the current implementation does **NOT** call `super()`, and it inlines the parent constructor instead.

When it eventually extends `EventTarget`, things won't work as expected because the existing `EventTarget` implementation has constructor dependencies.

This refactors the current implementation of `EventTarget` to eliminate those constructor side-effects, and eliminates the constructor altogether.

This breaks encapsulation, but it has some positive side-effects on performance:
1. Creating `EventTarget` instances is faster because it has no constructor logic.
2. Improves memory by not creating maps to hold the event listeners if no event listeners are ever added to the target (which is very common).
3. Improves the overall runtime performance of the methods in the class by migrating away from private methods (which are known to be slow on the babel transpiled version we're currently using).

Extra: it also simplifies making window/the global scope implement the EventTarget interface :)

## Benchmark results

Before:

| Latency average (ns) | Latency median (ns) | Samples | Task name                                              | Throughput average (ops/s) | Throughput median (ops/s) |
| ---|--- |--- |--- |---|---|
| 8234.22 ± 0.27%      | 8132.00             | 121445  | dispatchEvent, no bubbling, no listeners               | 122323 ± 0.02%             | 122971                   |
| 9001.22 ± 0.41%      | 8883.00             | 111097  | dispatchEvent, no bubbling, single listener            | 111981 ± 0.02%             | 112575                   |
| 51777.94 ± 0.58%     | 51247.00            | 19314   | dispatchEvent, no bubbling, multiple listeners         | 19393 ± 0.04%              | 19513                    |
| 8256.65 ± 0.29%      | 8152.00             | 121115  | dispatchEvent, bubbling, no listeners                  | 122031 ± 0.02%             | 122669                   |
| 9064.32 ± 0.44%      | 8933.00             | 110323  | dispatchEvent, bubbling, single listener per target    | 111265 ± 0.02%             | 111944                   |
| 51879.66 ± 0.27%     | 51447.00            | 19276   | dispatchEvent, bubbling, multiple listeners per target | 19325 ± 0.04%              | 19437               |

After:

| Latency average (ns) | Latency median (ns) | Samples | Task name                                              | Throughput average (ops/s) | Throughput median (ops/s)|
| ---------------------|---------------------|---------|--------------------------------------------------------|----------------------------|--------------------------|
| 5664.62 ± 0.50%      | 5588.00             | 176535  | dispatchEvent, no bubbling, no listeners               | 178219 ± 0.02%             | 178955                   |
| 7232.86 ± 0.50%      | 7131.00             | 138258  | dispatchEvent, no bubbling, single listener            | 139540 ± 0.02%             | 140233                   |
| 50957.51 ± 0.71%     | 50336.00            | 19625   | dispatchEvent, no bubbling, multiple listeners         | 19751 ± 0.04%              | 19866                    |
| 5692.36 ± 0.50%      | 5618.00             | 175675  | dispatchEvent, bubbling, no listeners                  | 177315 ± 0.02%             | 177999                   |
| 7277.82 ± 0.38%      | 7181.00             | 137404  | dispatchEvent, bubbling, single listener per target    | 138560 ± 0.02%             | 139256                   |
| 50493.64 ± 0.28%     | 50105.00            | 19805   | dispatchEvent, bubbling, multiple listeners per target | 19855 ± 0.04%              | 19958                    |

Reviewed By: yungsters

Differential Revision: D67758408

fbshipit-source-id: f8da1788251c9e21377de5ab730875bcc7610361
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 07df02d14d Add regression test for EventTarget (#48431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48431

Changelog: [internal]

Adds a regression test to make sure we implement the correct spec-compliant behavior for a possible bug in ~~the Web spec~~ __Chrome__: https://github.com/whatwg/dom/issues/1346

Edit: the bug is in the Chrome implementation, not in the spec.

Reviewed By: javache

Differential Revision: D67758702

fbshipit-source-id: ecaeacac3bce286e692880f05d70297ba0c2c736
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 3c50d87d05 Add benchmark for EventTarget (#48886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48886

Changelog: [internal]

Creates a benchmarks to measure the performance of `EventTarget`.

Reviewed By: javache

Differential Revision: D67750677

fbshipit-source-id: 7023d5f3bcdc5eec1f5f03298781800d2f9bfe16
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot e5024a08d1 Implement Event and EventTarget (#48429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48429

Changelog: [internal]

This implements a (mostly) spec-compliant version of the [`Event`](https://dom.spec.whatwg.org/#interface-event) and [`EventTarget`](https://dom.spec.whatwg.org/#interface-eventtarget) Web interfaces.

It does not implement legacy methods in either of the interfaces, and ignores the parts of the spec that are related to Web-specific quirks (shadow roots, re-mapping of animation events with webkit prefixes, etc.).

IMPORTANT: This only creates the interfaces and does not expose them externally yet (no `Event` or `EventTarget` in the global scope).

Reviewed By: yungsters

Differential Revision: D67738145

fbshipit-source-id: c86db29821552cc1a1b6e1023cc3a21ae55febd5
2025-01-27 07:48:50 -08:00
Thomas NardoneandFacebook GitHub Bot fc98babe3e Nullsafe jcf/react/animated (#48932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48932

Results of running nullsafe script with `--patch=apply_fixmes`, `--patch=mark_nullsafe`, with minimal manual fixes to get all checks passing.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68629827

fbshipit-source-id: f9d3e741c634743731bdc2870cdccbf73ab58cc1
2025-01-27 07:21:12 -08:00
Mateo GuzmánandFacebook GitHub Bot bbd1e0ff17 Fix FlatList dark mode examples (#48873)
Summary:
- Fix FlatList Nested and Multicolumn dark mode examples
- Convert MultiColumn example from class to functional component
- Fixing several FlowFixMe annotations for both examples

## Changelog:

[INTERNAL] - Fix FlatList dark mode examples

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

Test Plan:
<details>
<summary>Screenshots</summary>

| Before                           | After                          |
|------------------------------------|------------------------------------|
| ![Image 1](https://github.com/user-attachments/assets/c22cbbc1-26e0-4e6b-a21a-0e0a47a23fc2) | ![Image 2](https://github.com/user-attachments/assets/bea957e5-9633-4d1f-91ed-0f4eac58b723) |
| ![Image 3](https://github.com/user-attachments/assets/0d601cdc-a84d-4b06-9f15-ebf793414f53) | ![Image 4](https://github.com/user-attachments/assets/4b605fa5-98d9-4d62-9108-1f7c7148a445) |

</details>

Reviewed By: cortinico

Differential Revision: D68630288

Pulled By: Abbondanzo

fbshipit-source-id: 41c240e4f8c6e6eacf537d53ab4a06bb0b7ef0de
2025-01-27 07:05:50 -08:00
Matthew HoranandFacebook GitHub Bot c499ae1192 Fixes for Keyboard Observer, KeyboardAvoidingView on iOS (#48131)
Summary:
**Convert keyboard position to window coordinate space on iOS**
The keyboard frame passed to keyboardWillChangeFrame is in the screen's coordinate space [1]. It needs to be converted to the window's coordinate space to support Slide Over and Stage Manager.

[1] https://developer.apple.com/documentation/uikit/uikeyboardframeenduserinfokey?language=objc

|Before|After|
|---|---|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 18 58 31](https://github.com/user-attachments/assets/6af21fde-32f1-4b15-83be-09a6dbae8784)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 01 27](https://github.com/user-attachments/assets/c63c2bef-c1a6-4ad4-91cf-74629c26dbb0)|

**Improve detached keyboard detection on iOS**
The iOS keyboard may be in one of three states:
1) floating (previously supported with a width check)
2) split
3) or undocked.

In addition, when using Stage Manager, the keyboard may be wider than the window itself. This would cause the floating keyboard check to incorrectly set the bottom position to zero.

Instead, rely on the fact that the UIKeyboardWillHideNotification notification is sent when the keyboard is in any detached state.

This requires listening for UIKeyboardWillShowNotification instead of UIKeyboardWillChangeFrameNotification. This is fine, since the show notification is also sent when the keyboard resizes while open.

Combined with the coordinate system adjustments in the previous commit, this also fixes an issue with Stage Manager, since the keyboard may be attached yet wider than the application window.

|Before|After|
|---|---|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 18 58 40](https://github.com/user-attachments/assets/4e747ece-b084-49ad-a8d6-5dfe623ae597)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 01 41](https://github.com/user-attachments/assets/50391302-4c83-4aa3-a96b-6056bba891ec)|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 48 19](https://github.com/user-attachments/assets/576691b3-6b84-41cf-87f4-0cf52fc405d4)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 05 33](https://github.com/user-attachments/assets/4bb60ca6-beb3-471e-bc71-38a18fc9c0f1)|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 48 55](https://github.com/user-attachments/assets/baf456fb-aa61-455b-9c20-a01a6a979cb5)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 05 56](https://github.com/user-attachments/assets/0b7fe954-a72f-407a-bb41-0f47253c9448)|

## 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] - Keyboard events are converted to window coordinate space
[iOS] [FIXED] - Improve detached keyboard detection, support Stage Manager on iOS

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

Test Plan: See screenshots above.

Reviewed By: yungsters

Differential Revision: D67337314

Pulled By: cipolleschi

fbshipit-source-id: abe872ac8c83336f316917074f72cdb23a39caab
2025-01-27 06:57:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4141560afc Call cocoapods passing the RCT_IGNORE_PODS_DEPRECATION flag (#48967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48967

This change updates the core-cli-utils package to call `pod install` by passing the `RCT_IGNORE_PODS_DEPRECATION` flag.

## Changelog:
[iOS][Changed] - Ignore deprecation warning when calling pod install through core-cli-utils

Reviewed By: cortinico

Differential Revision: D68704956

fbshipit-source-id: 5ce56e3ec8c5718f6403f8871bebf6aceeeb407b
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot cc1e8d1523 Move running codegen to core-cli-utils (#48965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48965

Running codegen should not be a Cocoapods responsibilities, but it should be something that runs before Cocoapods to ensure that the code is already in the right place.

This change moves the invocation of Codegen to the react-native's core-cli-utils so that frameworks can integrate better with it.

It should also make it easier to migrate away from Cocoapods.

## Changelog:
[iOS][Changed] - Invoke Codegen as part of the Core-cli-utils package

Reviewed By: cortinico

Differential Revision: D68706136

fbshipit-source-id: 548c9ffad62bc561fcc948babaf75de5dad82f86
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 2527d29a96 Update Gemfile (#48966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48966

In our previous fix for concurrent-ruby, we have been a bit too strict. Version 1.3.4 is a valid and working version. The broken version is 1.3.5.

## Changelog:
[iOS][Changed] - Fix Gemfile versions

Reviewed By: cortinico

Differential Revision: D68706060

fbshipit-source-id: 8ab7a4df0eb83a82603729ff8460e64908ddc465
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f15094ef88 Stop running Codegen on Pod install when a flag is passed (#48961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48961

One of Cocoapods responsibility is to run Codegen while creating the Xcode workspace. Moving away from Cocoapods, this is a step we need to move to a different place.

This change let us to disable running codegen at cocoapods time when we pass the `RCT_SKIP_CODEGEN=1` or when we pass the `RCT_IGNORE_PODS_DEPRECATION=1` flag calling pod install.

When calling `pod install` with `RCT_IGNORE_PODS_DEPRECATION` we are either:
* using one of the Scripts provided by Expo or by the Community CLI
*or*
* we are preparing the project using the legacy mode and, therefore, we want to keep running codegen.

## Changelog
[iOS][Changed] - Stop running codegen when running pod install

Reviewed By: cortinico

Differential Revision: D68704604

fbshipit-source-id: 252e90544886c3dbfd7eff38c344dd4784a0af38
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e3def00d7a Warn users when calling pod install (#48960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48960

We are moving away from Cocoapods toward alternative solution.

We are adding this deprecation message to help inform our users that this change is happening.

Part of the Cocoapods tasks will be moved to an alternative script that will be invoked by Expo and by the Community CLI. The warning message tells the users what to do as an alternative to `pod install`.

## Changelog:
[iOS][Deprecated] - deprecate calling `pod install` directly

Reviewed By: cortinico

Differential Revision: D68704127

fbshipit-source-id: df93008afc055254d0c0da09566c84af99248310
2025-01-27 06:52:35 -08:00
Iwo PlazaandFacebook GitHub Bot bdc23fa2b4 Migrate files in Libraries/Interaction to use export syntax (#48933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48933

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling

## This diff
- Updates files in Libraries/Interaction to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Interaction` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68629953

fbshipit-source-id: 526b18d9b64c4b27b6e3198a9725075fa11e345a
2025-01-27 06:32:58 -08:00
Samuel SuslaandFacebook GitHub Bot 0f0344984f ship useOptimisedViewPreallocationOnAndroid everywhere and remove gating (#48903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48903

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D68490542

fbshipit-source-id: f743e9c82328c5f06b431cffe77f9a28608535b9
2025-01-27 06:26:35 -08:00
Edmond ChuiandFacebook GitHub Bot 46e86dca87 Update tests to support new didOpen delegate fn
Summary:
Changelog: [General][Fixed] Update tests to support new `didOpen` delegate fn

Add support for the new `didOpen` delegate function in tests.

To follow up separately: the borked tear down sequence when these two tests are ran together (they pass when ran individually)

```
buck2 test @//fbobjc/mode/buck2/ios-tests fbsource//xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern:testsAppleMac -- ReactInstanceIntegrationTest RuntimeTargetDebuggerSessionObserverTest
```

Reviewed By: hoxyq

Differential Revision: D68632974

fbshipit-source-id: 59da6d9e2d09f2c7e219c1902dd6f9b8ddfee9dc
2025-01-27 05:53:15 -08:00
Mateo GuzmánandFacebook GitHub Bot 53d94c3abe Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin (#48945)
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D68705783

Pulled By: arushikesarwani94

fbshipit-source-id: 9c2cc2927eae50d0dce91384bf945a8c795c0bbd
2025-01-27 04:48:22 -08:00
Samuel SuslaandFacebook GitHub Bot 1257122a02 introduce Fantom.flushAllNativeEvents (#48943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48943

changelog: [internal]

A new helper function on Fantom flushAllNativeEvents, which will flush all pending native events.

Reviewed By: javache

Differential Revision: D68566753

fbshipit-source-id: 6cb19416e39807b9b381ff068cea5c2458101174
2025-01-27 04:42:44 -08:00
Samuel SuslaandFacebook GitHub Bot aa5760837c introduce Fantom.scrollTo (#48907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48907

changelog: [internal]

Introduce new function `Fantom.scrollTo`, which will fake a scroll to particular position.
Calling the method will call onScroll event using codepath that iOS uses. It will also set C++ state so the new scroll position is observable from JavaScript.

Reviewed By: javache

Differential Revision: D68554703

fbshipit-source-id: 2fc71e96836a03ec343053ceed85764c4bc2f5c7
2025-01-25 14:58:28 -08:00
Samuel SuslaandFacebook GitHub Bot 84b8e6a531 unify Fantom calling convention to Fantom.foo (#48924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48924

changelog: [internal]

All other Fantom tests are using Fantom.foo style instead of `foo`. Let's unify codebase on this.

Reviewed By: christophpurrer

Differential Revision: D68552829

fbshipit-source-id: eeefc449b1f33161b3583dd68b08f83455d1a959
2025-01-25 14:58:28 -08:00
David VaccaandFacebook GitHub Bot e44b2fa973 Migrate ReactBridge to kotlin (#48904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48904

Migrate ReactBridge to kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68540709

fbshipit-source-id: 35a6d19f940dabdecbe7b7f835953d9f07f7222b
2025-01-24 16:17:58 -08:00
Pieter De BaetsandFacebook GitHub Bot 73968dc778 Cleanup initEagerTurboModulesOnNativeModulesQueueAndroid flag (#48917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48917

Cleaning up this flag which has already been rolled out

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68622852

fbshipit-source-id: 5767515d02ce9804976a1363532e1e626aeae0d8
2025-01-24 10:57:41 -08:00
Pieter De BaetsandFacebook GitHub Bot 7f62ff6b02 Cleanup completeReactInstanceCreationOnBgThreadOnAndroid and useImmediateExecutorInAndroidBridgeless flags (#48916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48916

Cleaning up this feature flag since we no longer require this gating. This was already fulled rulled out as default.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68621578

fbshipit-source-id: 3fd3ad007b8beb8e2525ffa7b4da372be1dbbd94
2025-01-24 10:57:41 -08:00
Tim YungandFacebook GitHub Bot b186d8f9b8 Animated: Hoist Non-Lifecycle Logic from useAnimatedPropsLifecycle (#48877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48877

This is a minor refactor to hoist logic that is not actually specific to the `AnimatedProps` lifecycle out of the hook named `useAnimatedPropsLifecycle`.

This will make it easier to iterate on the implementation of `useAnimatedPropsLifecycle` using a feature flag in a subsequent diff.

This has no behavior change.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D68516034

fbshipit-source-id: 2cd6d9b0f2a5c0ada10cf01c8c14ed5510fbf25a
2025-01-24 10:48:44 -08:00
Nicola CortiandFacebook GitHub Bot 54e0b69e7e Stable API - Make AnimatedNodeWithUpdateableConfig internal (#48900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48900

I've verified that this interface is not used externally, so I'm making it internal.
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Apvinis%2Freact-native---investigation+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3Amolangning%2Freversing-discord+com.facebook.react.animated.AnimatedNodeWithUpdateableConfig+

Changelog:
[Android] [Removed] - Stable API - Make `AnimatedNodeWithUpdateableConfig` internal as it was not used in OSS

Reviewed By: tdn120, mdvacca

Differential Revision: D68562055

fbshipit-source-id: 0f06c22dc096efabce9fb937f099775effbff3f6
2025-01-24 10:22:23 -08:00
David VaccaandFacebook GitHub Bot 2fa0494bc4 Internalize ReactNativeFeatureFlags generated accessor classes (#48909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48909

Internalize ReactNativeFeatureFlags generated accessor classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68579670

fbshipit-source-id: 63606793e2a63f1901c7de2cb40e68c27193259d
2025-01-24 10:15:58 -08:00
David VaccaandFacebook GitHub Bot c0ad6a4cd5 Internalize ReactNativeFeatureFlags Accessor interfaces & Classes (#48910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48910

Internalize ReactNativeFeatureFlags Accessor interfaces & Classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68579453

fbshipit-source-id: 9549221b47e93a9c8a3161c3914ece849f7f9a52
2025-01-24 10:15:58 -08:00
Nicola CortiandFacebook GitHub Bot c495a8ab1b Remove unused AndroidUnicodeUtils. (#48919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48919

I suspect this class is unused and we should not be building it.
The same `AndroidUnicodeUtils.java` is provided by facebook/hermes instead.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120, mdvacca

Differential Revision: D68623307

fbshipit-source-id: 0a290d31e3b1103947a9dd3c46821958be9223e7
2025-01-24 10:03:04 -08:00
Iwo PlazaandFacebook GitHub Bot 52ffda7e55 Migrate Libraries/Utilities/*.js to use export syntax. (#48665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48665

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling

## This diff
- Updates files in Libraries/Utilities to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the `Platform` module, which happened to touch a lot of test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Utilities` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68152910

fbshipit-source-id: 07f3a0957f1dbaf44f53974c6f28b273558406eb
2025-01-24 09:17:55 -08:00
Iwo PlazaandFacebook GitHub Bot 1be7e1a95f Migrate Libraries/Text, Libraries/Share and Libraries/Settings to use export syntax (#48901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48901

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` to use `export` syntax.
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*

Changelog:
[General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68562844

fbshipit-source-id: bd71a341e33d3629121aa61549139c4b1cd62c3f
2025-01-24 08:49:15 -08:00
Ruslan LesiutinandFacebook GitHub Bot b578647980 Use custom tracks for measures (#48926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48926

# Changelog: [Internal]

Leverage [`devtools` field](https://developer.chrome.com/docs/devtools/performance/extension#devtools_object) inside [`detail` object](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#detail) to make extension tracks work.

Right now we are only specifying track name, later we could use many more fields:
```
interface ExtensionTrackEntryPayload {
  dataType?: "track-entry"; // Defaults to "track-entry"
  color?: DevToolsColor;    // Defaults to "primary"
  track: string;            // Required: Name of the custom track
  trackGroup?: string;      // Optional: Group for organizing tracks
  properties?: [string, string][]; // Key-value pairs for detailed view
  tooltipText?: string;     // Short description for tooltip
}
```

In the next few diffs I will extend the spec of the local implementation for `performance.measure` and `performance.mark` to get this propagated correctly.

Reviewed By: huntie

Differential Revision: D68624603

fbshipit-source-id: 99a5d233ee1dbcd690ad8a6802ca993071f63f2c
2025-01-24 08:41:48 -08:00
Ruslan LesiutinandFacebook GitHub Bot 2e5fa4e35d Migrate to Inspector trace (#48923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48923

# Changelog: [Internal]

Starting from this diff, React Native will emit inspector traces, the ones that will have the same UI as if it was recorded in a browser.

We are going to fake it by sending "TracingStartedInPage" event. For a corresponding logic on Chrome DevTools Frontend side, see [this](https://github.com/ChromeDevTools/devtools-frontend/blob/192673131cf3e6e0bcdb4a97bd0bd39c75f1b3c2/front_end/models/trace/handlers/MetaHandler.ts#L68-L80) as a starting point.

Because of this, custom tracks are now grouped under "Timings" track, although with a better color scheme:
- We no longer need the logic for placing tracks under arbitrary thread ids to have them grouped.
- The real support for extension tracks (custom tracks for Performance panel) will be added in the next diff.

Reviewed By: huntie

Differential Revision: D68439734

fbshipit-source-id: 8e5c525a71578375904edc6d473308eb710b5867
2025-01-24 08:41:48 -08:00
Ruslan LesiutinandFacebook GitHub Bot 4b7906bc15 Switch from single Complete event to a pair of Async Nestable events (#48906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48906

# Changelog: [Internal]

It looks like on `Chrome` side, Complete events (`ph="X"`) are only used for Renderer-related events.

For user-land events with duration (non-instant events), there is a [set of supported types](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L62-L65), which don't include `"X"`.

Later, pair of such events will form a [performance measure event](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L2256-L2258).

Reviewed By: huntie

Differential Revision: D68564754

fbshipit-source-id: dac87ab06c47925a70e03f43f0628364217a06a2
2025-01-24 08:41:48 -08:00
Vitali ZaidmanandFacebook GitHub Bot d85294b953 fix ignoring of temp local project settings for RNTester
Summary: Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D68625659

fbshipit-source-id: b5ce8ff04b5bb678b5fd19bc6fa5d1c5451df3a9
2025-01-24 07:53:32 -08:00
Andrew DatsenkoandFacebook GitHub Bot 1b050b571e Upgrade undici to 5.28.5 (#48898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48898

Changelog: [Internal]

GitHub has identified a security vulnerability in a package dependency defined in the repository, facebook/react-native.

Package name: undici
Affected versions: >= 4.5.0, < 5.28.5
Fixed in version: 5.28.5
Severity: MODERATE

Identifiers
GHSA-c76h-2ccp-4975
CVE-2025-22150

References
https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975
https://nvd.nist.gov/vuln/detail/CVE-2025-22150
https://github.com/nodejs/undici/commit/711e20772764c29f6622ddc937c63b6eefdf07d0
https://github.com/nodejs/undici/commit/c2d78cd19fe4f4c621424491e26ce299e65e934a
https://github.com/nodejs/undici/commit/c3acc6050b781b827d80c86cbbab34f14458d385
https://hackerone.com/reports/2913312
https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f
https://github.com/nodejs/undici/blob/8b06b8250907d92fead664b3368f1d2aa27c1f35/lib/web/fetch/body.js#L113
https://github.com/advisories/GHSA-c76h-2ccp-4975

Reviewed By: NickGerleman

Differential Revision: D68561080

fbshipit-source-id: 7aa71e959ac38f3e0f49d8503a471f60d2f44c5d
2025-01-24 07:06:10 -08:00
Samuel SuslaandFacebook GitHub Bot 70fa456ddc remove explicit calls to root.destroy (#48927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48927

changelog: [internal]

Remove explicit calls to root.destroy() in favour of automated system that will call it and check for memory leaks.

Reviewed By: rubennorte

Differential Revision: D68624917

fbshipit-source-id: 44be1dee9a56ec31bea5a9eefdda086a4cb4248f
2025-01-24 07:03:27 -08:00
Iwo PlazaandFacebook GitHub Bot e5818d92a8 Migrate files in Libraries/Core to export syntax (#48889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48889

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/Core` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections
- Appends `.default` to requires of the changed files.
- Changed `* as ExceptionsManager` to `ExceptionsManager` in import statements throughout product code.
- Updates test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Core` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
[General][Breaking] - `Libraries/Core/ExceptionsManager` now exports a default `ExceptionsManager` object, and `SyntheticError` as a secondary export.

Reviewed By: huntie

Differential Revision: D68553694

fbshipit-source-id: 51c9a404b2762cb1cdb5f56cae3a683ccdfffc7f
2025-01-24 05:43:28 -08:00
Dawid MałeckiandFacebook GitHub Bot d2adb976ab Replace $FlowFixMe in WebSocketInterceptor callbacks (#48702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48702

Changelog:
[General][Changed] - Improved types in WebSockertInterceptor callbacks

Reviewed By: cortinico

Differential Revision: D68210857

fbshipit-source-id: 4f2a47be6f96e26db25edbaffcbe97b76ffbdc33
2025-01-24 04:51:43 -08:00
Rubén NorteandFacebook GitHub Bot 348b917c58 Move methods to access internals of DOM nodes to a separate module (#48854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48854

Changelog: [internal]

Moves the internals to access instance handle and shadow node from public instances from `ReadOnlyNode` to `NodeInternals` so it's more obvious when people are reaching into internal APIs/state.

Reviewed By: javache

Differential Revision: D67654404

fbshipit-source-id: 1063bc9451eeacb79af34614df3be02466f93fa3
2025-01-24 04:42:45 -08:00
Ruslan LesiutinandFacebook GitHub Bot ad67f8099b add optional id field (#48897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48897

# Changelog: [Internal]

Adds optional `id` field to Trace Event spec. This field will be required once we are going to emit trace with real custom tracks.

For custom tracks, we would need to emit pair of trace events:
1. Begin Event with type `b`.
2. End Event with type `e`.

They are [matched](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/helpers/Trace.ts#L261-L294) by Chrome DevTools frontend by `id` and `name` fields.

Reviewed By: huntie

Differential Revision: D68559862

fbshipit-source-id: 732ae52691e31213f9c63474905eb7c1b12adb8c
2025-01-24 04:38:18 -08:00
Ruslan LesiutinandFacebook GitHub Bot df4d9d1cce Split stopTracingAndCollectEvents (#48795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48795

# Changelog: [Internal]

Splitting `PerformanceTracer::stopTracingAndCollectEvents()` into 2 separate methods.

Once we add logic for starting and stopping tracing on `InstanceAgent`:
- We would need to stop tracing everywhere synchronously
- Populate data sources in `PerformanceTracer`, like JavaScript samples
- Collect all events from different data sources in one payload via `PerformanceTracer::collectEvents()`

Reviewed By: huntie

Differential Revision: D68331485

fbshipit-source-id: 0d6b21a522d841f7f734e2fad2e0fc533097fdee
2025-01-24 04:27:55 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 6c6e0a9085 Fix anti-aliasing on older Android devices
Summary:
On older Android versions clipping doesn't have anti-aliasing by default which means that clipping with no border will always make the background not have anti-aliasing.

This is fixed by default on new Background and Border drawables since rendering logic is separated

Moving the clipping logic so it only runs when we have a border.

https://github.com/facebook/react-native/issues/41226

Changelog: [Android] [Fixed] - Fixed anti-aliasing not showing on older Android versions

Reviewed By: javache

Differential Revision: D68279400

fbshipit-source-id: e2383c71bd1ca89f66f42630b3712bb4cc5cd7ac
2025-01-23 20:52:48 -08:00
Joe VilchesandFacebook GitHub Bot 1b710a0cb2 Back out "Allow text links to be navigatable via keyboard by default"
Summary:
This was causing links to not ellipsize and be scrollable. Gonna revert while I see if I can workaround

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68596950

fbshipit-source-id: 432a059d0b10acbb45d34e0c98763680d280937b
2025-01-23 19:19:13 -08:00
David VaccaandFacebook GitHub Bot 5ea7594b5c Fully rollout enableDeletionOfUnmountedViews feature flag (#48872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48872

enableDeletionOfUnmountedViews feature flag has been enabled for 4 months with no errors on production, also it's been enabled in OSS since 0.76.
This diff removes the feature flag and fully rollout this fix

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D68511227

fbshipit-source-id: a42481c57aaab2e8c45b952af5e044bf60740df3
2025-01-23 17:38:38 -08:00
Nick GerlemanandFacebook GitHub Bot fae6edb65c Support parsing hsl() and hsla() functions (#48843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48843

Adds support for hsl() and hsla() funtions. This supports more modern syntax options than normalize-color, like number components, optional alpha, and fills in missing support for angle units. The underlying math was lifted pretty much directly from normalize-color though.

An aside, std::remainder for these is not guaranteed to be constexpr, but Clang is still okay with rgb function parsing to be contexpr because we never try to evaluate non-constexpr function?

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68473990

fbshipit-source-id: 2a71d8367b22f9d1ba6a66598d40ef2683847704
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 91add1e4e0 Remove redundant check in CSSRatio (#48842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48842

This is a result of inlining isinf previously but we can never be negative infinity because we can never be less than zero.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68474836

fbshipit-source-id: bfce78c4bd269ff2afac99c03250ede676ee1029
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot a4b112cb0b Do not consume delimeter when not consuming component value (#48841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48841

Right now during parsing we can ask for a next component value, with a delimeter, and even if we don't have a component value to consume, we will consume the delimeter.

This is kind of awkward since e.g. trailing comma can be consumed, then we think syntax is valid. Let's try changing this.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68474739

fbshipit-source-id: 47a942681bc8472ca28470eba821d4d95306ae5d
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 5b3d8d3410 More spec compliant rgb function parsing (#48839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48839

In the last diff I mixed and matched `<legacy-rgb-syntax>` and `<modern-rgb-syntax>` a bit to keep compatiblity with `normalze-color`.

Spec noncompliant values have only been allowed since https://github.com/facebook/react-native/pull/34600 with the main issue being that legacy syntax rgb functions are allowed to use the `/` based alpha syntax, and commas can be mixed with whitespace. This seems like an exceedingly rare real-world scenario (there are currently zero usages of slash syntax in RKJSModules validated by `rgb\([^\)]*/`), so I'm going to instead just follow the spec for more sanity.

Another bit that I missed was that modern RGB functions allow individual components to be `<percentage>` or `<number>` compared to legacy functions which only allow the full function to accept one or the other (`normalize-color` doesn't support `<percentage>` at all), so I fixed that as well.

I started sharing a little bit more of the logic here, to make things more readable when adding more functions.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68468275

fbshipit-source-id: f1dfab51b91a3f64436c2559daa3d1e8891db889
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 24393c7dde Add CSSDelimeter::OptionalWhitespace and CSSDelimeter::CommaOrWhitespaceOrSolidus (#48828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48828

1. Rename `CSSComponentValueDelimeter` to `CSSDelimeter` bc the names are getting way too long.
2. Make the distinction between `Whitespace` and `OptionalWhitespace`. Note that for property values, and function blocks, the value parser will already remove trailing/leading whitespace, but it's weird that whitespace unlike others was not required to be present
3. Add `CSSDelimeter::CommaOrWhitespaceOrSolidus` for simpler parsing in the common pattern of alpha values, and move CSSColor function parsing to use that

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68461968

fbshipit-source-id: 388056e47dfe6ca6003b44e82e00fe416706330b
2025-01-23 16:19:48 -08:00
David VaccaandFacebook GitHub Bot d40f90b5e7 Migrate PackagerStatusCheck to Kotlin (#48838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48838

Migrate PackagerStatusCheck to Kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68467780

fbshipit-source-id: ace98692ebcf96bf0ca36640183c432121d95519
2025-01-23 14:57:33 -08:00
Chi TsaiandFacebook GitHub Bot d9d824055e Add createFromUtf16 JSI method (#48211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48211

Adding the default implementation for `createFromUtf16` method for JSI
String and PropNameId.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D67070206

fbshipit-source-id: 47297e6ae3028ee0e101628aab5bc076fcbbdebc
2025-01-23 14:54:17 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f89f191c26 Go back to object approach instead of manual drawable layer handling for CompositeBackgroundDrawable (#48835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48835

D65907786 ended up regressing a bit of the performance gains from new Background and Border Drawables. changing back to the previous approach.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68354292

fbshipit-source-id: f2db6d7ad5c1590d5d4d8261d76281f3592f488a
2025-01-23 12:39:25 -08:00
Samuel SuslaandFacebook GitHub Bot 0353648f46 add tests for ScrollView.onScroll (#48891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48891

changelog: [internal]

add two tests covering onScroll: one for the case where onScroll is triggered multiple times during one UI tick and one where it is triggered once per UI tick.

Reviewed By: rubennorte

Differential Revision: D68499566

fbshipit-source-id: ee25227b620569e3a43038575f04b0a325e5e38b
2025-01-23 11:47:31 -08:00
Samuel SuslaandFacebook GitHub Bot f695411bf3 add isUnique option to Fantom.dispatchNativeEvent (#48801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48801

changelog: [internal]

Adds isUnique option to Fantom.dispatchNativeEvent.

isUnique controls whether only the last event of the same type and target is dispatched to JavaScript or all events are queued and dispatched.

Reviewed By: rubennorte

Differential Revision: D68416157

fbshipit-source-id: 415e7db7d258d60a6bc510d929091153bfdccb3f
2025-01-23 11:47:31 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b9f418e9bc Fix images not displayed when extension is implicit (#48888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48888

We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension.

We previously had a fix attempt iwith [this pr](https://github.com/facebook/react-native/pull/46971), but this was breaking some internal apps.

This second attempt should work for both cases.

## Changelog:
[iOS][Fixed] - Load images even when the extension is implicit

Reviewed By: cortinico

Differential Revision: D68555813

fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
2025-01-23 11:37:16 -08:00
Nicola CortiandFacebook GitHub Bot 3702c986ed RNGP - Update comment on INCLUDE_JITPACK_REPOSITORY_DEFAULT (#48896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48896

This comment is not exact and should be updated.

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D68556425

fbshipit-source-id: 67427ff325809907fdeba1c6a90b84b97713bf5e
2025-01-23 10:52:34 -08:00
Edmond ChuiandFacebook GitHub Bot 9b977def6c Fix app lagging while attempting a connection to Metro (#48895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48895

Changelog:
[General][Breaking][Fixed] - removed a long-running loop causing the app to lag while attempting a connection to Metro

Round 2: Sorry I broke VR/Java apps in D68023397. Helpful teammates have reverted and Jedi landed it via D68522537.

This diff adds the missing method call that caused the crash:

```
makeNativeMethod(
  "didOpen",
  JCxxInspectorPackagerConnectionWebSocketDelegate::didOpen
)
```

Test plan has been updated to include testing VR Store.

This error wasn't caught by existing automated tests, because it only impacts development builds while using Metro. vzaidman is leading the effort to bring Jest E2E tests on React Native DevTools, which could catch crashes like this.

Original summary in D68023397:

D65952134 fixed the auto-reconnection between Metro and the device.

There's an existing "constructed = connected" contract as [discussed](https://www.internalfb.com/diff/D65952134?dst_version_fbid=3741052436109227&transaction_fbid=581445277659906):

https://www.internalfb.com/code/fbsource/[1592525fbcbb]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/WebSocketInterfaces.h?lines=16-20

In compliance, busy-waiting was [introduced](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=427393513742494) in V4 to wait for the connection result in the constructor.

xArthasx [discovered](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=1406890420289706) a performance issue from this impl via a profiling result.

In favour of async connection results, we're going back to V3 design with the imperative `isConnected()` check to the interface. xArthasx has confirmed this fixes the perf issue.

While I haven't found a compelling reason against removing this contract from the initial design in D52134592, please let me know if I've missed one.

This also means there was a scenario where messages were sent before the websocket is open. Those were dropped silently previously (before the busy-waiting while loop was introduced):

https://www.internalfb.com/code/fbsource/[f7113e167ee1]/fbobjc/VendorLib/SocketRocket/src/SocketRocket/SRWebSocket.m?lines=630-637

This means message senders must now consider the connection state, e.g. by maintaining a pre-connection message queue, if they need to guarantee the messages to be sent.

Reviewed By: robhogan

Differential Revision: D68559198

fbshipit-source-id: afb3d8bfbf949c3324cbf126e9f3e3fc25e50541
2025-01-23 10:43:59 -08:00
Iwo PlazaandFacebook GitHub Bot ecae8a2908 Remove seemingly unused AnimatedWeb file. (#48894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48894

## Motivation
In our efforts to migrate the RN codebase to modern Flow (to enable ingestion by modern Flow tooling) I stumbled upon the `AnimatedWeb.js` file, which does not seems to be imported anywhere throughout the monorepo.

Searching on GitHub for imports to this file in OSS projects returned no results.

In case this file has actual uses outside of Meta (e.g. in OSS), I'll abandon the diff 🙌

## This diff
- Removes `Libraries/Animated/AnimatedWeb.js` file

Changelog:
[General][Breaking] Removed `Libraries/Animated/AnimatedWeb.js` file.

Reviewed By: cortinico

Differential Revision: D68558237

fbshipit-source-id: 319b5e59eb83e518cd123b9f74642e90f0003a4a
2025-01-23 10:32:59 -08:00
Ruslan LesiutinandFacebook GitHub Bot a995ecc9c6 Encapsulate Trace Event format (#48648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48648

# Changelog: [Internal]

This is the pre-requisite before adding a formatter for conversion from Hermes format-agnostic API for JavaScript samples to Trace Events.

This struct will probably be used a lot around this module and big enough for a separate header.

Reviewed By: huntie

Differential Revision: D68104202

fbshipit-source-id: 93f2816de5a87471c5f7761468ccc52a34a895d6
2025-01-23 10:29:48 -08:00
Rubén NorteandFacebook GitHub Bot 0736234e90 Use test name as a hint for benchmarks (#48882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882

Changelog: [internal]

The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.

This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.

Reviewed By: andrewdacenko

Differential Revision: D68102300

fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
2025-01-23 10:26:47 -08:00
Rubén NorteandFacebook GitHub Bot 8702ed5f37 Improve format of benchmark results (#48881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48881

Changelog: [internal]

Small improvement in the printed benchmark results.

Reviewed By: andrewdacenko

Differential Revision: D68552379

fbshipit-source-id: 39312a757a9de57e462c17a9f1455dfe8cab53f1
2025-01-23 10:26:47 -08:00
Andrew DatsenkoandFacebook GitHub Bot c5bab82a60 migrate console-itest to beforeEach/afterEach (#48821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48821

Changelog: [Internal]
Add setup and teardown to console-itest

Reviewed By: rubennorte

Differential Revision: D68454178

fbshipit-source-id: 277e1125248b860a6fe085a5e47dddf4c5cd12da
2025-01-23 09:45:21 -08:00
Andrew DatsenkoandFacebook GitHub Bot cf6b807745 Add support for (before|after)(Each|All) methods (#48820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48820

Changelog: [Internal]
Add capability to setup / teardown tests

Reviewed By: rubennorte

Differential Revision: D68454176

fbshipit-source-id: 93c19c91dfe2b8b98385547da24955fd31adbf0b
2025-01-23 09:45:21 -08:00
Iwo PlazaandFacebook GitHub Bot da695f3a20 Migrated components to export syntax (part 4) (#48808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48808

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*
- Synchronizes `GoodwillVideoEditorCandidateImage.js` with www, as it was using `require`s that would result in invalid code after this Diff's changes. Added `ReactNativeImage` shim.

Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: yungsters

Differential Revision: D68436611

fbshipit-source-id: 14f33e375e60429ea2340fb49ddf9dc6eb79594f
2025-01-23 09:03:46 -08:00
Samuel SuslaandFacebook GitHub Bot 56a60601da add tests for TextInput.onChange and TextInput.onChangeText (#48899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48899

changelog: [internal]

Add tests for `TextInput.onChange` and `TextInput.onChangeText`.

Reviewed By: rubennorte

Differential Revision: D68498998

fbshipit-source-id: 212bc251700b343f7290fb7e2a5f2ddfdb68dfd1
2025-01-23 08:59:13 -08:00
Iwo PlazaandFacebook GitHub Bot 7df73eebdc Migrated Libraries/WebSocket/* to export syntax. (#48884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48884

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/WebSocket` to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates mocks.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/WebSocket` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: cortinico

Differential Revision: D68554260

fbshipit-source-id: 90a660fe9e76b255171189101819253521354fda
2025-01-23 08:55:25 -08:00
Alex HuntandFacebook GitHub Bot b8ee2b3503 Add source transformation pipeline to build-types (#48893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48893

Updates `build-types` to support source file AST transforms, and templates out an initial `stripPrivateProperties` transform.

- Also, parallelise file translation via `Promise.all`.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D68558012

fbshipit-source-id: 6eb3881fcf30bf8f4ba045522f6569fbbad14f62
2025-01-23 08:29:09 -08:00
Rubén NorteandFacebook GitHub Bot 8a2b44568d Partially restore feature flag to disable event loop on bridgeless (#48892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48892

Changelog: [internal]

Reviewed By: javache, Abbondanzo

Differential Revision: D68557746

fbshipit-source-id: d94877d03dc6ea2bf6bca45da77a0a769fa0efeb
2025-01-23 08:12:35 -08:00
Ritesh Kumar ShuklaandFacebook GitHub Bot 317f130267 Update info.ts (#48876)
Summary:
Found this while I was trying to make my own react native info for CI. For android Podfile.lock is being read instead of gradle.properties

## Changelog:

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

Pick one each for the category and type tags:
[INTERNAL][FIXED] - Fixed React native info where Podfile.lock was being read for android

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

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

Reviewed By: blakef

Differential Revision: D68553964

Pulled By: cortinico

fbshipit-source-id: 7d6391195dab0c2230fe86fb465de6d3f94ccbef
2025-01-23 07:19:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot dab9b3b440 Stop generating the ReactCodegen.podspec in Cocoapods (#48815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48815

In an effort to reduce the responsibility of Cocoapods in React Native, we are moving the generation of the Reactcodegen podspec from Cocoapods itself to the codegen infrastructure.

This reduce the responsibility of Cocoapods and allow us to migrate away from it with more ease.

## Changelog:
[iOS][Changed] - Generate the ReactCodegen.podspec as part of codegen instead of as part of pod install.

Reviewed By: cortinico

Differential Revision: D68418268

fbshipit-source-id: 004ac5b6b3563bf96cc38942f2b48b6f269541c3
2025-01-23 05:38:20 -08:00
Samuel SuslaandFacebook GitHub Bot 3e29cbe1d0 add test for TextInput blut and focus (#48862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48862

changelog: [internal]

Add simple tests that use new `Fantom.dispatchNativeEvent` and `Fantom.runOnUIThread`.

Reviewed By: rubennorte

Differential Revision: D68492472

fbshipit-source-id: 33537ed7a728c2cc01abdcc5aa178b3afa3779fa
2025-01-23 05:30:24 -08:00
Samuel SuslaandFacebook GitHub Bot 864c34e9f6 add event category to Fantom.dispatchNativeEvent (#48855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48855

changelog: [internal]

add event category argument to Fantom.dispatchNativeEvent.

This gives tests option to control whether an event is continuous, discrete etc.

Reviewed By: rubennorte

Differential Revision: D68413879

fbshipit-source-id: f0c365df505a325440693ca7c3408dd612614946
2025-01-23 04:02:06 -08:00
Alex HuntandFacebook GitHub Bot d4c1c7bfe3 Move experimental type generation into dedicated script (#48867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48867

Also:
- Rename output dir to `types_generated/`.
- Support source patterns outside of the `react-native` package.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D68498211

fbshipit-source-id: 7f9f540efd6d3d2c70b8b1721738f3fea569641d
2025-01-23 02:39:32 -08:00
Ruslan LesiutinandFacebook GitHub Bot 8a586f2fa1 Move setUpReactDevTools to InitializeCore (#48871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48871

# Changelog: [Internal]

Forward-fixing D68380665.

Requirements:
- `setUpReactDevTools` should be called before `setUpErrorHandling` to avoid React DevTools mutating `console.error` call arguments.
- `setUpReactDevTools` should be called after `setUpTimers`, because it is using `queueMicrotask`, see https://fb.workplace.com/groups/rn.panelapps/permalink/1120810879540337/.
- `setUpTimers` should be called after `polyfillPromise`, because it uses on `global.Promise`.

I went over bundles, which are not using `InitializeCore` and using either `setUpErrorHandling` or `setUpDeveloperTools` and updated their order of initialization accordingly.

Reviewed By: javache

Differential Revision: D68510100

fbshipit-source-id: 4331dcc7a7cb1dc438ca2ed5ccae49e736c41b2a
2025-01-22 22:06:43 -08:00
David VaccaandFacebook GitHub Bot c5af75294a Migrate SurfaceHandlerBinding to kotlin (#48870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48870

Migrate SurfaceHandlerBinding to kotlin

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68480893

fbshipit-source-id: a326d2646212598ded962d25cb8d1caf7a2ed6aa
2025-01-22 22:06:37 -08:00
Tim YungandFacebook GitHub Bot d1028885ee Back out "Fix app lagging while attempting a connection to Metro"
Summary: Reverts {D68023397}

Reviewed By: Abbondanzo

Differential Revision: D68522537

fbshipit-source-id: 1c331969fea898fdee06dd988f86c5e1f034684f
2025-01-22 15:12:57 -08:00
David VaccaandFacebook GitHub Bot 159fc9922c Migrate FabricUIManagerProviderImpl to kotlin (#48869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48869

Migrate FabricUIManagerProviderImpl to kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68480341

fbshipit-source-id: bf0f548230f9c8bcba07fe32a1fde5d9a1d72550
2025-01-22 13:20:37 -08:00
Joe VilchesandFacebook GitHub Bot 98b0991128 Allow text links to be navigatable via keyboard by default (#48773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48773

This diff contains 2 fixes with regards to clickable text accessibility on Android.

1. It allows nested `Text` links to be accessible via keyboard. The accessibility here is a bit unique. The clickable text is not focused in the classical since that Android provides on `View`s (after all, the part being focused is not even a `TextView`. Its a `Span` in a `TextView`). However, it is [selected](https://developer.android.com/reference/android/widget/TextView#setSelected(boolean)), and pressing enter while it is selected will press the text, so for all intents and purposes it is focused. Some quirks here, though, are that you cannot press tab to cycle through the links in text, you have to use arrow keys. And the arrow keys no longer let you move around to the next item (as they are stuck being used to navigate the links). I *could* override this behavior but I do not see much of a point as long as one can actually get to everything on screen in a semi-logical way. Anyway, the fix here is using [`LinkMovementMethod`](https://developer.android.com/reference/android/text/method/LinkMovementMethod) to navigate between clickable spans, which is exactly what that class exists for. Note that I override this class so that touching the links does not actually highlight them like you see in the videos.
2. In the case we state update and remove the "click-ability" of the text, this diff makes it so that Explore By Touch no longer can focus on the link. The code was in the same area so I decided to just lump that together :P

Changelog: [Android] [Fixed] - Allow text links to be navigable via keyboard by default

Reviewed By: javache

Differential Revision: D68306316

fbshipit-source-id: a72145f6b60caf2a8077e1bd2ca987bdde0b82ab
2025-01-22 12:16:14 -08:00
Samuel SuslaandFacebook GitHub Bot 4d96467954 add payload to Fantom.dispatchNativeEvent (#48794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48794

changelog: [internal]

Add payload argument to Fantom.dispatchNativeEvent. For example, in `TextInput.onChange` event, new value of input field must be present in the event payload.

Reviewed By: rubennorte

Differential Revision: D68410469

fbshipit-source-id: eb915f9f961efdfe9902f060173072c6259b7eea
2025-01-22 12:16:11 -08:00
Chi TsaiandFacebook GitHub Bot 7b0f83165e Fix unicode character usage in windows tests (#48840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48840

MSVC unicode handling is causing our windows test to fail. To fix,
simply replace the special characters with the their explicit UTF-16
encoding.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D68466808

fbshipit-source-id: 1bfc689972e1e5862fe6525bc48d5ebc508a95da
2025-01-22 12:07:20 -08:00
David VaccaandFacebook GitHub Bot 2c50e7043b Implement prop diffing for nativeForegroundAndroid prop (#48834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48834

Implement prop diffing for nativeForegroundAndroid prop

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D60001410

fbshipit-source-id: c6b5b71ddb66136f9cf61e2cca5aeb6e1274841e
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 48fad21759 Implement prop diffing for accessibility props in <View> (#48833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48833

This diff implements the diffing for accessibility props of <View>

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D59972041

fbshipit-source-id: 171381744e0e695cbc144507fa86b2d2ef536c30
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 2e8720af44 Implement prop diffing for transform props in <View> (#48832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48832

This diff implements the diffing for transform props of <View>

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D59972039

fbshipit-source-id: e4c3beff4c6411595ab83ff62b54b948f9337851
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 9a5e365865 Implement prop diffing for border props in <View> (#48831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48831

This diff implements the diffing for border props of <View>

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59972037

fbshipit-source-id: b93a0962616222686a4340cd1e7f2943bd3bc140
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 4396487742 Implement prop diffing for event props in <View> (#48830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48830

This diff implements the diffing for event props of <View>

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D59972038

fbshipit-source-id: ddd42068a74862f44ecf374e12d80aaaf493e04f
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 92d79461e9 Implement prop diffing for basic props in <View> (#48829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48829

This diff implements the diffing for basic props of <View>

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59972040

fbshipit-source-id: 148b5fc9b73887c153535648182386d75bf9381b
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 5ee2289298 Introduce getDiffProps for <View> (#45552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45552

In this diff I'm overriding the getDiffProps for  ViewProps.
The goal is to verify what's the impact of calculating diffs of props in Android, starting with ViewProps.
Once we verify what are the implication we will automatic implement this diffing.

The full implementation of this method will be implemented in the following diffs

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59969328

fbshipit-source-id: ce141528581e46e9ced4175dca040ddf8bed5ddb
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 33e0bab567 Mark MemoryPressureRouter as nullsafe (#48740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48740

Mark MemoryPressureRouter as nullsafe

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68275418

fbshipit-source-id: 8437f017f020e4e9f66916df2661850702b77486
2025-01-22 11:55:11 -08:00
Jin LeeandFacebook GitHub Bot 9b06d0d8a9 Back out "Disable weak event emitter in AttributedString for Apple Silicon Mac running iOS build app" (#48868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48868

Original commit changeset: ac48be3305eb

Original Phabricator Diff: D68093083

Changelog: [iOS][Removed] - Removed workaround for a iOS build app running on Apple Silicon Mac(in Xcode Destination: "Mac(Designed for iPad)") TextInput crash due to serialization attempt of WeakEventEmitter

Reviewed By: javache

Differential Revision: D68452788

fbshipit-source-id: 9d3466950c43a10f36ca594997ae5a586d1a2a00
2025-01-22 11:52:34 -08:00
Rubén NorteandFacebook GitHub Bot 04f9451dab Modify public API script to make it opt-in in src/private, instead of opt-out (#48866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48866

Changelog: [internal]

The current test to create a snapshot of the public API was recently modified to include `src/private` but excluding certain directories from it.

This replaces the opt-out with an opt-in mechanism, where we only use it where necessary (new DOM APIs, etc.).

Reviewed By: huntie

Differential Revision: D68496269

fbshipit-source-id: 6ae056008a6189b493cb27811d21a8619e79009d
2025-01-22 11:24:25 -08:00
Rubén NorteandFacebook GitHub Bot e2c433b657 Move some internal modules to internals directories (#48859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48859

Changelog: [internal]

Just to make it easier to distinguish between public and private APIs, until we have proper support to extract that automatically.

Reviewed By: huntie

Differential Revision: D68496270

fbshipit-source-id: 83cdf95f7f33eab8835b0913cc468ccaf5e47730
2025-01-22 11:24:25 -08:00
Dawid MałeckiandFacebook GitHub Bot 8befab1760 Replace $FlowFixMe in ScrollViewNativeComponentType (#48858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48858

Changelog:
[General][Changed] - Replaced $FlowFixMe with PressEvent in ScrollViewNativeComponentType

Reviewed By: fabriziocucci

Differential Revision: D68496466

fbshipit-source-id: 19c5738a906908336ef93e339092e6cb6fa2d860
2025-01-22 11:23:21 -08:00
Christoph PurrerandFacebook GitHub Bot d154cd5ba1 Fix data race in TraceSection.h (#48774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48774

[Changelog] [Internal] - Fix data race in TraceSection.h

## Issue
The `instrumentsLogHandle` variable is a static variable that is initialized lazily when the `getOrCreateInstrumentsLogHandle()` function is called. However, this initialization is not thread-safe. Multiple threads may call this function simultaneously, leading to a data race on the `instrumentsLogHandle` variable.

Reviewed By: lyahdav, javache

Differential Revision: D68366837

fbshipit-source-id: d61b85a0299a8d42b9fbcfdbecae78eb410d748f
2025-01-22 10:41:42 -08:00
Dawid MałeckiandFacebook GitHub Bot e31ff4212b Added type for _captureRef in SectionList (#48863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48863

Changelog:
[General][Changed] - Added explicit type for argument in _captureRef in SectionList

Reviewed By: huntie

Differential Revision: D68493326

fbshipit-source-id: 906a13b13e9fc7ee2c61a8d5c7caa72c0656440f
2025-01-22 10:34:21 -08:00
Dawid MałeckiandFacebook GitHub Bot 1be2ba4597 Replace $FlowFixMe in ScrollView (#48857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48857

Changelog:
[General][Changed] - Improved types in ScrollView

Reviewed By: huntie

Differential Revision: D68496037

fbshipit-source-id: b044e884fb78bb92c0da5acd7570a87ff328a479
2025-01-22 10:00:50 -08:00
Edmond ChuiandFacebook GitHub Bot 0e5adb9128 Fix app lagging while attempting a connection to Metro (#48642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48642

Changelog:
[General][Breaking][Fixed] - removed a long-running loop causing the app to lag while attempting a connection to Metro

D65952134 fixed the auto-reconnection between Metro and the device.

There's an existing "constructed = connected" contract as [discussed](https://www.internalfb.com/diff/D65952134?dst_version_fbid=3741052436109227&transaction_fbid=581445277659906):

https://www.internalfb.com/code/fbsource/[1592525fbcbb]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/WebSocketInterfaces.h?lines=16-20

In compliance, busy-waiting was [introduced](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=427393513742494) in V4 to wait for the connection result in the constructor.

xArthasx [discovered](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=1406890420289706) a performance issue from this impl via a profiling result.

In favour of async connection results, we're going back to V3 design with the imperative `isConnected()` check to the interface. xArthasx has confirmed this fixes the perf issue.

While I haven't found a compelling reason against removing this contract from the initial design in D52134592, please let me know if I've missed one.

This also means there was a scenario where messages were sent before the websocket is open. Those were dropped silently previously (before the busy-waiting while loop was introduced):

https://www.internalfb.com/code/fbsource/[f7113e167ee1]/fbobjc/VendorLib/SocketRocket/src/SocketRocket/SRWebSocket.m?lines=630-637

This means message senders must now consider the connection state, e.g. by maintaining a pre-connection message queue, if they need to guarantee the messages to be sent.

Reviewed By: christophpurrer

Differential Revision: D68023397

fbshipit-source-id: dd80acf75790e77454798c96f06bb0a4ee6afe61
2025-01-22 09:49:01 -08:00
Marc RousavyandFacebook GitHub Bot f830f2c667 feat: Add getConcretePropsShared() (#48710)
Summary:
Adds `getConcretePropsShared()` to `ConcreteShadowNode.h`.

I need this in Nitro Views to update state in-place without throwing away the old state object and creating a new one each time.

From reading the code it seems like you use this pattern a lot tho where you create new State objects each time - so let me know if my thing is a bad idea..

## Changelog:

- [INTERNAL] [ADDED] Add `getConcretePropsShared()` to `ConcreteShadowNode.h`

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

Test Plan: Use in Nitro

Reviewed By: sammy-SC

Differential Revision: D68495697

Pulled By: javache

fbshipit-source-id: e2caa34befcaef2191ec161442c40596cc7de132
2025-01-22 09:17:31 -08:00
Tim YungandFacebook GitHub Bot ab77bdf471 Animated: Feature Flags Cleanup (#48509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48509

Cleans up the following feature flags from `Animated`:

- `enableAnimatedAllowlist`
- `enableAnimatedPropsMemo`
- `useInsertionEffectsForAnimations`

This will significantly simplify some future planned work here (e.g. T209740497).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D67867115

fbshipit-source-id: adf35c70d95f42c240342fda3b4f2e9b4bdfe30a
2025-01-22 08:54:58 -08:00
Rubén NorteandFacebook GitHub Bot 0883207e44 Clean up feature flag to disable event loop on bridgeless (#48851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48851

Changelog: [internal]

Remove the feature flag to disable the event loop on bridgeless, as we no longer have a use case for it. From now on, we can be 100% certain that Bridgeless == Event Loop!

Reviewed By: sammy-SC

Differential Revision: D68270102

fbshipit-source-id: c661bf11f51d4044f9f485b971c43f03197e2983
2025-01-22 08:24:29 -08:00
Iwo PlazaandFacebook GitHub Bot bdb5804f32 Migrated Core/ReactNativeVersion to use export syntax. (#48853)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48853

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates the `ReactNativeVersion` template to use `export` syntax.
- Regenerates the `ReactNativeVersion.js` file with the new template.
- Updates jest mock.
- Updates the public API snapshot *(intented breaking change)*

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D68492723

fbshipit-source-id: daa55d3d553aca562cf2e091cd24546681a8db2f
2025-01-22 07:41:04 -08:00
Arushi KesarwaniandFacebook GitHub Bot 44da5d2ee0 Make setLayoutAnimationEnabledExperimental a no-op in Bridgeless (#48856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48856

Refactor setLayoutAnimationEnabledExperimental in BridgelessUIManager.js to be a no-op in the new architecture

Changelog:
[Android][Fixed] - Make `setLayoutAnimationEnabledExperimental` a no-op in Bridgeless

Reviewed By: javache

Differential Revision: D68313694

fbshipit-source-id: 7a79fad72b1eeda5af3ff629a609d53e4f08f26d
2025-01-22 07:16:44 -08:00
Tim YungandFacebook GitHub Bot c8a387c2d1 VirtualizedList: Delete Batchinator (#48515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48515

Deletes `Batchinator`, inlines the timer, and cleans up the `disableInteractionManagerInBatchinator` feature flag.

Changelog:
[Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D67885194

fbshipit-source-id: 5f3ec71a02cf1f1b382b41a480beed28fc8c5439
2025-01-22 07:14:37 -08:00
Samuel SuslaandFacebook GitHub Bot ff0bcb2427 introduce Fantom.dispatchNativeEvent (#48793)
Summary:
changelog: [internal]

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

Adds new method `dispatchNativeEvent` to Fantom give option to dispatch fake native events.

The API is expanded in subsequent diffs. The version introduced in this diff supports only dispatching event without payload and without any options.

Reviewed By: rubennorte

Differential Revision: D68331986

fbshipit-source-id: 075360e1d6874794ba6df966087fbe6a0a820cbc
2025-01-22 06:55:18 -08:00
Dawid MałeckiandFacebook GitHub Bot a24f9ef825 Add type for _lastNativeRefreshing and change React import in RefreshControl (#48809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48809

Changelog:
[General][Changed] - Added explicit type for _lastNativeRefreshing and changed React import syntax in RefreshControl

Reviewed By: cortinico

Differential Revision: D68437259

fbshipit-source-id: e3e842870c485b235e41e1a634b55f2f12b63115
2025-01-22 06:04:25 -08:00
Iwo PlazaandFacebook GitHub Bot ce412746b1 Migrated components to export syntax (part 2) (#48767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48767

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: yungsters

Differential Revision: D68335872

fbshipit-source-id: eb0c67039edfe92e9e133726f6b01900dd2c2322
2025-01-22 03:43:59 -08:00
Dawid MałeckiandFacebook GitHub Bot b200c7cb2f Replace $FlowFixMeProps in UnimplementedView (#48810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48810

Changelog:
[General][Changed] - Improved Props type in UnimplementedView

Reviewed By: cortinico

Differential Revision: D68437542

fbshipit-source-id: 134b834d77f65a94a6488c21298d79b060ea8109
2025-01-22 03:28:28 -08:00
Dawid MałeckiandFacebook GitHub Bot cd7a30ce48 Replace $FlowFixMe in InteractionManager (#48797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48797

Changelog:
[General][Changed] - Replaced $FlowFixMe in InteractionManager to Function type

Reviewed By: cortinico

Differential Revision: D68416677

fbshipit-source-id: 4b2adf299021c9008c73e2374092a7ad52da2245
2025-01-22 03:27:05 -08:00
Jakub PiaseckiandFacebook GitHub Bot f1a33c5982 Add generated types to the gitignore (#48848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48848

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68489815

fbshipit-source-id: ddb6e19e1ef060f537bfeacf6d8a916e08cff75b
2025-01-22 03:07:08 -08:00
Mateo GuzmánandFacebook GitHub Bot 480ee4b935 Migrate com.facebook.react.modules.network interfaces to Kotlin (#48679)
Summary:
Migrate com.facebook.react.modules.network interfaces to Kotlin: `ProgressListener`, `CustomClientBuilder` and `NetworkInterceptorCreator`.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network interfaces to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D68186452

Pulled By: mdvacca

fbshipit-source-id: 814bf4c525ba1da49e26046345c71abf2c1e39ce
2025-01-21 21:24:46 -08:00
David VaccaandFacebook GitHub Bot c871c4c93b Delete ViewHierarchyUtil (#48837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48837

ViewHierarchyUtil is a class with package visibility and it is not used, let's delete it

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D68467507

fbshipit-source-id: d1bd5b279a26fcecb4fed590ad2de75937b54aa6
2025-01-21 20:30:29 -08:00
Nick GerlemanandFacebook GitHub Bot 8803dca0bb Support parsing rgb() and rgba() functions into CSSColor (#48827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48827

This teaches the CSSColor parser how to handle these functions.

There are a surprising amount of edge cases here, including many syntactic options added by the CSS Color Module 4 spec, and some technically invalid examples supported by normalize-color, sometimes working in Chrome.

I used the combination of the spec, and existing functionality and tests for `normalize-color`, with the end result supporting a superset of the functionality of both, while being a bit more permissive than either.

I still need to add support for the other color functions, and will probably want to share code here, but for now, just implemented everything for the rgb values as a start.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68362477

fbshipit-source-id: 62973ba2f8361b6a43c7cf9a96029147f84582d2
2025-01-21 20:20:04 -08:00
Nick GerlemanandFacebook GitHub Bot fe3e3a54a3 Simplify consuming solidus separated component values (#48826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48826

This ends up being a not uncommon pattern, so lets make it a bit easier.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68359563

fbshipit-source-id: 94283c8815cf9dd2f6c0d52762d21232383fb311
2025-01-21 20:20:04 -08:00
Nick GerlemanandFacebook GitHub Bot e73d4ff015 Simplify "rollback" on optional or invalid syntax (#48825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48825

Right now we preserve the state of the CSSSyntaxParser across multiple data type parse attempts, so long that a data type parser consumes an additional component value. This requires data type parsers to be careful to not consume additional forward tokens if it may lead to parse error. We can make this model a lot simpler by instead resetting the parser to original state on data type parse error.

We also introduce `peekComponentValue`, and visitor-less `consumeComponentValue` as a convenience, to allow data type parsers to view future component values without advancing, even if the data type parser does return a value, without needing to manually clone the parser.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68357624

fbshipit-source-id: 6ff77bab8ac9eabd5dccea52daa85bbd32b5f2b6
2025-01-21 20:20:04 -08:00
David VaccaandFacebook GitHub Bot 4ed2b35bf6 Fix execution of early InteropEvents (#48823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48823

This diff is fixing the execution of Events that are sent early in the rendering of surfaces.

This diff fixes a bug in the queueing of events that are built with not surfaceId (-1), the fixes is to call getSurfaceManagerForView() to retrieve the proper surfaceId (as we do in the execution of events)

calling getSurfaceManagerForView() has a perf hit, we believe this won't be a problem because this method will only be called in edge cases (no surfaceId and early execution of events)

changelog: [Android][Fixed] Fix execution of early InteropEvents

Reviewed By: shwanton, lenaic

Differential Revision: D68454811

fbshipit-source-id: a79be0b392004e645c48d1683bba774b6b597ca0
2025-01-21 19:03:24 -08:00
David VaccaandFacebook GitHub Bot 2a9a13d567 Reduce visibility of methods in FabricUIManager (#48824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48824

Reduce visibility of methods in FabricUIManager and fix lint warnings

changelog: [Android][Breaking] Reduce visibility of  FabricUIManager.setBinding() method, unused outside of react native

Reviewed By: philIip

Differential Revision: D68459708

fbshipit-source-id: 59081b9a87607b1d35c3fc88bb16e5980cfbd721
2025-01-21 18:58:15 -08:00
David VaccaandFacebook GitHub Bot 10f4772551 Migrate SelectionWatcher to Kotlin (#48747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48747

Migrate SelectionWatcher to Kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68284145

fbshipit-source-id: 40b7d00fe0be75c5387a169038b1c58a048ac88a
2025-01-21 18:58:13 -08:00
Liron YahdavandFacebook GitHub Bot 6cbdc94456 Add feature flag to enable running JS GC on memory pressure with Bridgeless (#48771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48771

Pre Bridgeless RN iOS apps relied on [RCTCxxBridge](https://www.internalfb.com/code/fbsource/[44b3ff81a2875d66675774f2c71643622ea03c36]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=376) to tell Hermes to GC when the OS detects memory pressure. With bridgeless we don't use RCTCxxBridge so we don't get that behavior anymore. This adds a feature flag to experiment with getting the same behavior with Bridgeless.

Changelog: [iOS] [Added] - Add feature flag to enable running JS GC on iOS memory pressure with Bridgeless

Reviewed By: yungsters

Differential Revision: D68290689

fbshipit-source-id: d4df16f44e56ad22c2d3d4073b8a870bd7ade645
2025-01-21 17:41:42 -08:00
Tim YungandFacebook GitHub Bot 0ead7de5e8 VirtualizedList: More Resilient Unit Tests (#48819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48819

Currently, `VirtualizedList-test.js` has a subtle dependency on how asynchronous operations are queued. Specifically, it depends on...

- `Batchinator` to use `setTimeout` for...
- `InteractionManager` to use `setImmediate` for...
- `InteractionManager` to resolve a promise via microtask.

As a consequence, any changes to this queueing logic (e.g. eliminating the unnecessary `setImmediate` and microtask) unnecessarily breaks these unit tests.

This changes the Jest unit tests to instead use `jest. advanceTimersToNextTimer(<step>)` instead of `jest.runOnlyPendingTimers()` so that the unit tests are no longer dependent on these specific queueing logic.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D68449850

fbshipit-source-id: 382b1c0a0d8fade873ccf17a9deb3622a83b8163
2025-01-21 16:43:36 -08:00
Nicola CortiandFacebook GitHub Bot 9afad527b8 Convert HeadlessJsTaskService to Kotlin (#48800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48800

This just converts yet another class from Java to Kotlin

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D68417564

fbshipit-source-id: 167a27f7f80125cc81a4a0ad57952f1149ef4d7d
2025-01-21 11:02:17 -08:00
Nicola CortiandFacebook GitHub Bot acaf31d175 Collapse the 0.77 changelog (#48811)
Summary:
This collapses all the 0.77 changelog from the various RCs into a single entry.

## Changelog:

[Internal] [Changed] -

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

Test Plan: N/A

Reviewed By: robhogan

Differential Revision: D68438948

Pulled By: cortinico

fbshipit-source-id: 0ef57432901198602863e9769cd2662a0f4e30f6
2025-01-21 10:06:22 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 0141a44026 fix(ios): add missing nonnull annotations (#48817)
Summary:
This PR adds missing nonnull annotations to make working with Swift better 👍🏻

## Changelog:

[IOS] [ADDED] - Missing nonnull annotations for RCTArchConfiguratorProtocol, RCTUIConfiguratorProtocol.h

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

Test Plan: CI Green

Reviewed By: cortinico, dmytrorykun

Differential Revision: D68443519

Pulled By: cipolleschi

fbshipit-source-id: 53bf128c65421789034f45f637a08ed996684c6f
2025-01-21 09:48:40 -08:00
Marc RousavyandFacebook GitHub Bot f2553d39da feat: Add REACT_NATIVE_VERSION_* definitions to ReactNativeVersion.h (#48813)
Summary:
The `ReactNativeVersion.h` file currently contains a `struct` that holds the React Native version (e.g. `1000.0.0`, as individual ints).

For some libraries, we need to conditionally compile out code when using an older React Native version, and that's where library authors usually set compiler flags that hold the react native version - those are usually resolved using a `node require.resolve` script in the Podspec or build.gradle, adding unnecessary complexity.

With this PR this becomes obsolete as we now create a `#define` that holds the React Native version directly - so e.g.

```cpp
#define REACT_NATIVE_VERSION_MAJOR 0
#define REACT_NATIVE_VERSION_MINOR 67
#define REACT_NATIVE_VERSION_PATCH 1
```

..which we can then use to conditionally compile some code in our libraries:

```cpp
#include <React/ReactNativeVersion.h>
#if REACT_NATIVE_VERSION_MINOR >= 76
  // new stuff
#else
  // fallback
#endif
```

## Changelog:

[INTERNAL] [ADDED] - Added `REACT_NATIVE_VERSION_*` C++ defines to `ReactNativeVersion.h`

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

Test Plan: Just import the header in a library and check if the defines exist!

Reviewed By: cortinico

Differential Revision: D68441049

Pulled By: javache

fbshipit-source-id: 55ac8875e1a3f8ad8b9d12795fed4204e9c5bb77
2025-01-21 09:00:20 -08:00
Fabrizio CucciandFacebook GitHub Bot 00c6b21ecb Build codegen CLI when running yarn test-e2e-local (#48816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48816

Given the recent changes, the error mentioned in [this](https://fb.workplace.com/groups/1374515773430764/permalink/1406615956887412)  post can show up also when testing iOS.

So here we are building the codegen when running `yarn test-e2e-local` regardless by the platform.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D68441078

fbshipit-source-id: 9067545b61be59ec595142c2e4ba888e20d9a13a
2025-01-21 07:58:52 -08:00
Fabrizio CucciandFacebook GitHub Bot 037687df53 Update changelog for 0.78.0-rc.1 (#48806)
Summary:
Changelog for 0.78.0-rc.1

## Changelog:
[Internal] Changelog

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D68436101

Pulled By: fabriziocucci

fbshipit-source-id: f7f519a43a045a41ed45eb5b590b8130d97f3592
2025-01-21 07:07:29 -08:00
Dawid MałeckiandFacebook GitHub Bot b634fa1edb Add explicit type for _memoizedRenderer and change React and View import in FlatList (#48798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48798

Changelog:
[General][Changed] - Added explicit type for _memoizedRenderer and changed React and View import in FlatList

Reviewed By: cortinico

Differential Revision: D68417026

fbshipit-source-id: 0af75381f6f8c33be10add940f0791b059de3473
2025-01-21 07:06:39 -08:00
Mateo GuzmánandFacebook GitHub Bot 4f99f0bb1a Convert com.facebook.react.modules.network.ResponseUtil to Kotlin (#48781)
Summary:
As in the title, follow up from https://github.com/facebook/react-native/issues/48075 which added unit tests for this class.

## Changelog:

[INTERNAL] - Convert com.facebook.react.modules.network.ResponseUtil to Kotlin

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

Test Plan:
```bash
./gradlew :packages:react-native:ReactAndroid:test -Dtest.single=com.facebook.react.modules.network
```

Reviewed By: javache

Differential Revision: D68393938

Pulled By: Abbondanzo

fbshipit-source-id: ed214b29ad9248c2da2e2653e75447b0a7e05a26
2025-01-21 07:06:19 -08:00
Mateo GuzmánandFacebook GitHub Bot 299a7a959d Improve ToastAndroid jsdocs (#48779)
Summary:
Was looking into improving some of the type definitions for the `ToastAndroid` component and found out also that some of the options don't work anymore from API 30 – I revamped a bit these definitions to reflect that as I saw questions about it online. These updates could also be added to the website later.

## Changelog:

[GENERAL][CHANGED] - Improve ToastAndroid jsdocs

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

Test Plan: Check the jsdocs look good when using the `ToastAndroid` component in the code.

Reviewed By: cortinico

Differential Revision: D68393949

Pulled By: Abbondanzo

fbshipit-source-id: 4be318062483db5be3825b7b21f540030f6c5b10
2025-01-21 07:03:39 -08:00
Dawid MałeckiandFacebook GitHub Bot 44d84f2af6 Add type for export object in AssetRegistry (#48734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48734

Changelog:
[General][Changed] - Added type for exported object in AssetRegistry

Reviewed By: cortinico

Differential Revision: D68272679

fbshipit-source-id: 1202009f886b2d35528009a3ac58aab24af9ef82
2025-01-21 07:02:21 -08:00
Iwo PlazaandFacebook GitHub Bot 9eeef22a67 Migrated components to export syntax (part 1) (#48765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48765

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: cortinico

Differential Revision: D68330077

fbshipit-source-id: 6bf00c82f72dbcaaa26470d7ea0917639fc3de4a
2025-01-21 07:00:35 -08:00
Dawid MałeckiandFacebook GitHub Bot 379242eb83 Change ScrollView and React imports in NetworkOverlay (#48796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48796

Changelog:
[Internal] - Changed ScrollView and React imports in NetworkOverlay

Reviewed By: cortinico

Differential Revision: D68416261

fbshipit-source-id: 3159e14747fe43f25b479f7ef31bdb7daf0a1eb9
2025-01-21 06:59:52 -08:00
Iwo PlazaandFacebook GitHub Bot 09700327f7 Migrated BugReporting, ErrorUtils, Vibration & YellowBox to use export syntax. (#48763)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48763

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/BugReporting`, `Libraries/vendor`, `Libraries/Vibration` and `Libraries/YellowBox` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/BugReporting`, `Libraries/vendor`, `Libraries/Vibration` and `Libraries/YellowBox` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: cortinico

Differential Revision: D68329075

fbshipit-source-id: 7079a54ce3631171f8d7559bc33cab014df1d16d
2025-01-21 01:49:27 -08:00
Iwo PlazaandFacebook GitHub Bot 9a70bc0418 Migrated files in Libraries/Blob to use export syntax. (#48761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48761

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in Libraries/Blob to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Blob` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: cortinico

Differential Revision: D68326103

fbshipit-source-id: ff0b5e0125987ed44b34c35f39af1eefa9799d8f
2025-01-21 01:41:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 140b3b38df Add prepare-ios script (#48799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48799

This change moves the same scripts we have to prepare the HelloWorld project to RNTester.
This is something we forgot to do when we were decoupling the reacrt-native from the community CLI.
This is also the base to start deprecating cocoapods and add more configuration steps for the project.

## Changelog:
[Internal] - Copy cli.js script from HelloWorld to RNTester

Reviewed By: cortinico

Differential Revision: D68413419

fbshipit-source-id: 7cf19d86bd3c1beb0c1e7f3380331174352a1651
2025-01-20 12:20:36 -08:00
Rick HanlonandFacebook GitHub Bot b1b5a9e2e5 Improve ExceptionManager tests (#48787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48787

For reasons that will become clear in the next diff, I'm adding more assertions for things like LogBox being called, and the console being called. I also updated the patterns of things like `toHaveBeenCalledWith` vs `toBeCalledWith` so they're consistent throughout the file.

## Changelog:
[internal] - Add tests to ExceptionManager

Reviewed By: hoxyq

Differential Revision: D68397529

fbshipit-source-id: b05073630969c40a86546a6f5c4244836b636ee1
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot e015d1b19a ensure react dev tools is patched before console.error (#48784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48784

React requires React DevTools to be the first patch for console methods, because it assumes it is the _last_ on the stack called before calling the real console.

This is because React DevTools adds additional formatting for things like StrictMode dimming, and component stack formatting for browser specific consoles like Chrome and Firefox, where the DevTool extension runs.

If it's not the first patch, then other patches (like logging, or LogBox) will pick up the DevTools additions and include them, which breaks other tools (like the issue show in the screen below).

This diff ensures React DevTools is patched before the React Native console reporter by moving it to `setupErrorHandling`.

## Changelog:

[General] [Fixed] - Always patch React DevTools first so StrictMode dim chars are excluded from logs/logbox.

## Other places?
I'm not sure how we should handle this for the console polyfill or inside useAlwaysAvailableJSErrorHandling yet.

## Screens

### Before
3 errors, 1 with ANSI dim chars:
 {F1974436874}

### After
Just 1:
 {F1974436879}

Reviewed By: hoxyq

Differential Revision: D68380665

fbshipit-source-id: 4f5353bb8da0038088c05ef7414bf91e965c73e2
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot 0affa544c3 Show component code frame, if available (#48785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48785

## Overview
This change adds code frames for component stacks if it differs from the call stack frame.

## Background
After adding native stack based stack frames, which we already symbolicate, we had the capability to show a code frame for component stacks as well as the stack frame (if they differ).

However, this usually wasn't that useful, because the native component stack was unlikely to be more useful than the component stack (see the comparisons below for key errors).

## Owner stacks

With owner stacks the component frame is a lot more useful and in many cases are better at showing the location than the call stack frame.

## Example Screens

Before:
{F1974436645}

After (with owner stacks):
{F1974436723}

Changelog:
[General][Added] - Add owner stack code frames to LogBox

Reviewed By: hoxyq

Differential Revision: D68285627

fbshipit-source-id: 541cecbd4786fffd1970d2e85e659757e3f81604
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot 967ef32154 Add support for owner stacks (#48782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48782

React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because:
- not all console.error calls are replaced, creating inconsistency
- oss web users don't append component stacks to console.log any more
- component stacks can be accessed for DEV modals like logbox with `captureOwnerStack`
- owner stacks are already added to the console with createTask if you use console.error directly
- the redirection is the single greatest source of fragility in the logbox reporting pipeline

So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks.

## Example Screen
Before:
{F1974436644}

After:
{F1974436645}

## Changelog:

[General] [Added] - Add full owner stack support to React Native

Reviewed By: hoxyq

Differential Revision: D68285628

fbshipit-source-id: 9772593d7ac6e012392d18c6796580c14c852074
2025-01-20 08:35:32 -08:00
Dawid MałeckiandFacebook GitHub Bot 1536a7f196 Remove context in addEventListener in Linking (#48726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48726

Changelog:
[General][Changed] - Removed context from addEventListener arguments in Linking

Reviewed By: rshest

Differential Revision: D68215201

fbshipit-source-id: 011bcd59fe8101df5ecd1b72bb75febdcb60a511
2025-01-20 07:17:38 -08:00
Dawid MałeckiandFacebook GitHub Bot f4b3f1daa3 Change InspectorAgent import syntax in NetworkAgent (#48729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48729

Changelog:
[Internal] - Changed InspectorAgent import syntax in NetworkAgent

Reviewed By: rshest

Differential Revision: D68270365

fbshipit-source-id: d8cea061d82f6fd4c36830820ef8fef2115f1d43
2025-01-20 05:38:58 -08:00
Dawid MałeckiandFacebook GitHub Bot 3c02738ec4 Add explicit types for Types and Properties in LayoutAnimation (#48728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48728

Changelog:
[General][Changed] - Improved types for exported Types and Properties in LayoutAnimation

Reviewed By: rshest

Differential Revision: D68270119

fbshipit-source-id: 7e9e6e6f20b6c17990b40d423eb4571807004b49
2025-01-20 05:36:41 -08:00
Dawid MałeckiandFacebook GitHub Bot 812c3b33cd Replaced $FlowFixMe in CodegenTypes
Summary:
Changelog:
[General][Changed] Replaced $FlowFixMe in CodegenTypes with Object type

Reviewed By: elicwhite, rshest

Differential Revision: D68327690

fbshipit-source-id: 34b354cd52c786788e86cc4bd7723ddf1e3881fc
2025-01-20 05:30:39 -08:00
Dawid MałeckiandFacebook GitHub Bot 8df6cfa56b Replace $FlowFixMe in RCTDeviceEventEmitter (#48758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48758

Changelog:
[General][Changed] - Replaced $FlowFixMe in RCTDeviceEventEmitter with any

Reviewed By: rshest

Differential Revision: D68327375

fbshipit-source-id: 30f65308f81d6349c191900ce16036741e71efae
2025-01-20 05:29:30 -08:00
Dawid MałeckiandFacebook GitHub Bot 286a360d9b Replace $FlowFixMe in NativeModules (#48757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48757

Changelog:
[General][Changed] - Replaced $FlowFixMe in NativeModules with any type

Reviewed By: elicwhite, rshest

Differential Revision: D68327176

fbshipit-source-id: 9cde462853012bbe40d0caa40d0c18fa32c699a1
2025-01-20 05:25:50 -08:00
Dawid MałeckiandFacebook GitHub Bot 5b07743ae9 Add src/private directory in public-api-test.js (#48641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48641

Changelog:
[Internal] - Added src/private directory to API snap generation in public-api-test.js

Reviewed By: cortinico

Differential Revision: D68102311

fbshipit-source-id: 655734689bbc788f8b4699f787832cfc8c9b2504
2025-01-20 04:26:48 -08:00
Nick GerlemanandFacebook GitHub Bot 22e7691473 Split value parsing tests (#48770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48770

Splits CSSValueParserTest to be file per data type to better match new structure, before we introduce more complexity and tests for CSS colors.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68351049

fbshipit-source-id: 1a4218e49c8c8adb056fac1dd67f064a4f890775
2025-01-17 15:44:48 -08:00
Nick GerlemanandFacebook GitHub Bot 743de70141 Add CSSComponentValueDelimiter::CommaOrWhitespace (#48769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48769

Must function notations do not require delimiting commas, with color function "legacy" syntax being an exception.

E.g.

```
rgb() = [ <legacy-rgb-syntax> | <modern-rgb-syntax> ]
rgba() = [ <legacy-rgba-syntax> | <modern-rgba-syntax> ]
<legacy-rgb-syntax> =   rgb( <percentage>#{3} , <alpha-value>? ) |
                  rgb( <number>#{3} , <alpha-value>? )
<legacy-rgba-syntax> = rgba( <percentage>#{3} , <alpha-value>? ) |
                  rgba( <number>#{3} , <alpha-value>? )
<modern-rgb-syntax> = rgb(
  [ <number> | <percentage> | none]{3}
  [ / [<alpha-value> | none] ]?  )
<modern-rgba-syntax> = rgba(
  [ <number> | <percentage> | none]{3}
  [ / [<alpha-value> | none] ]?  )
```

Theoretically, this should mean an expression like `rgb(1, 2 0)`, which mixes both comma and whitespace delimeters would be malformed, but both Chrome, and RN's existing `normalize-color` package support this, so to make this pattern easier, we add the ability to scan based on using either whitespace or comma as component value delimiter.

Interestingly, the current spec revision also allows `rgb` function with alpha, or `rgba` function without alpha, which Chrome correctly supports, but `normalize-color` does not.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68349385

fbshipit-source-id: 05cd756ee20227af4d9ec20edc9e7cfc8cc2c071
2025-01-17 15:44:48 -08:00
Nick GerlemanandFacebook GitHub Bot c33dd62afd Restrict CSSDataTypeParser function and simple block parsing to block scope (#48768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48768

Right now, if something like `CSSColor` accepted a function notation block (e.g. for `rgb()` syntax), it is given a syntax parser which may extend beyond the scope of the current function block.

This is confusing, but also problematic for the `CSSSyntaxParser` block visiting logic to validate a correct scope exit.

This change makes it so that the `CSSSyntaxParser` passsed to `CSSDataTypeParser` for function and simple blocks is limited to the syntax within the given block. This prevents extra visiblity beyond the block we are trying to parse, and allows the function/simple block visitor to reliably fail parsing if the block is not correctly terminated, or there are unconsumed component values within the block not handled by the data type parser.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68340127

fbshipit-source-id: 402f2eabdf6df7bce99223c966f22c2158103be5
2025-01-17 15:44:48 -08:00
Iwo PlazaandFacebook GitHub Bot 135277ace1 Migrate AppState and BatchedBridge files to use export syntax. (#48737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48737

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in Libraries/AppState and Libraries/BatchedBridge to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/BatchedBridge` and `Libraries/AppState` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: robhogan

Differential Revision: D68275767

fbshipit-source-id: 97dc84c04a8dd9c9022e53fc4595302efc848338
2025-01-17 11:19:43 -08:00
Nicola CortiandFacebook GitHub Bot d9a77e1d02 RNGP - Do not access project. during task execution. (#48745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48745

This is the first step in a series of diff to make RNGP more Gradle-compliant (specifically for the sake of configuration caching).

Specifically the problem in those 2 tasks is that we're accessing `project.copy()` and other
functions from the `project` field.

The project should never be accessed at execution time. See more on this here:
https://docs.gradle.org/8.12/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

This diff fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68282777

fbshipit-source-id: 6d474f266b5bc50fba57c8cd478173c995864bbc
2025-01-17 08:56:46 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6f6a438330 Make sure the New Architecture is the default (#48764)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48764

When working on the [commit](https://github.com/facebook/react-native/commit/eced906bedf0c3d2bbc592cc27965c88278abae3) I forgot a bit that makes sure the New Architecture was the default.

This is change set the New Arch as default properly in RCTAppDelegate. Plus it refreshes the GHA caches by updating the Podfile.lock

## Changelog:
[Internal] - Ensure that the New Arch is turned on in RCTAppDelegate

Reviewed By: alanleedev

Differential Revision: D68329797

fbshipit-source-id: 9df5f805f7d3506129909f0adae5ff597f33ce3c
2025-01-17 08:28:27 -08:00
Jakub PiaseckiandFacebook GitHub Bot 25c0b7ff5e Bootstrap experimental types build for main package (#48661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48661

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

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D68102875

fbshipit-source-id: abb77737dc2f46d6caba0d9a4c44b26e8a595cff
2025-01-17 07:58:08 -08:00
Dawid MałeckiandFacebook GitHub Bot b9df812b67 Added types in TouchHistoryMath (#48730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48730

Changelog:
[General][Changed] - Added types in TouchHistoryMath

Reviewed By: rshest

Differential Revision: D68271085

fbshipit-source-id: b5ce3134d7bd7cb23b94761079d1d7753aaa97c1
2025-01-17 07:27:42 -08:00
Mateo GuzmánandFacebook GitHub Bot e39776b1b8 Fix Alert and SafeAreaView examples in dark mode (#48752)
Summary:
Fix Alert and SafeAreaView examples in dark mode. Converting also SafeAreaView examples into functional components

## Changelog:

[INTERNAL] - Fix Alert and SafeAreaView examples in dark mode

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

Test Plan:
<details>
<summary>Screenshots</summary>

| After | Before |
|--------|-------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 10 12](https://github.com/user-attachments/assets/9cbe4403-47bd-452a-9b36-a75a24f792e4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 09 47](https://github.com/user-attachments/assets/47706394-f394-4a3e-936c-da2f0716a274) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 07 31](https://github.com/user-attachments/assets/5835e4f9-7f5e-4a9d-963d-501a1a577da7) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 15 20 26](https://github.com/user-attachments/assets/d9ff678f-dce3-4684-9a15-bf11c2bab4bd) |

</details>

Reviewed By: cortinico

Differential Revision: D68322518

Pulled By: rshest

fbshipit-source-id: 9f153862efff7ef1e834bac9843f4042dbefbd1b
2025-01-17 06:20:53 -08:00
Yajur GroverandFacebook GitHub Bot 8c06f57860 Add default case to facebook::react::displayModeToInt() (#48711)
Summary:
In the `displayModeToInt()` function, there is no default case defined which is causing the following warning in React Native Windows when trying to build on the New Architecture:
```
##[error]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Error C2220: the following warning is treated as an error
D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): error C2220: the following warning is treated as an error [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
##[warning]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value
D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
```

Adding the default case removes the warning and resolves the issue. Not sure if using the -1 value in this case is appropriate.

## 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] - Add default case to `displayModeToInt()` function

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

Test Plan: Tested on React Native Windows New Arch application and was able to build successfully.

Reviewed By: javache

Differential Revision: D68265335

Pulled By: rshest

fbshipit-source-id: 4724a4c7391b9bf651a122f5de227a0c5e0b6212
2025-01-17 05:14:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot eced906bed Re-enable the New Architecture by default (#48755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48755

When [cleaning up the pre-alpha flags](https://github.com/facebook/react-native/commit/9a4b2cecd57dc797f90280be33eb4c80a06aaf72), we disabled the new architecture by default by mistake.

This change fixes that.

## Changelog:
[Internal] - Restore the New Arch by default

Reviewed By: GijsWeterings

Differential Revision: D68323159

fbshipit-source-id: cae96fc7c50319808e0afecf46ebf927e4db254a
2025-01-17 05:07:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a7aed70ab1 Fix Dependencies of RCTFabric for RCTInterpolateColorInRange (#48753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48753

[This commit](https://github.com/facebook/react-native/commit/cc89ddd50bed869013082ad98eb0555a386cf7c9) introduced a dependency between RCTFabric and RCTAnimation because RCTFabric is now using `RCTInterpolateColorInRange` which is defined in `RCTAnimation`.

To unblock the CI, I'm adding the dependency to the RCTFabric.podspec

However, I'm not convinced that this is the proper fix. We should move the function to a common dependency between RCTFabric and RCTAnimation. Probably in `RCTUtils`.

## Changelog:
[Internal] - Fix CI by making RCTFabric depend on RCTAnimation

Reviewed By: GijsWeterings

Differential Revision: D68322935

fbshipit-source-id: 57c8833e348fb69dc1b1703ffeedd3383405b4f8
2025-01-17 05:07:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a0ddcd256a Only include ReactCommon and ios platform for TextInput (#48754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48754

The React-FabricComponent was importing some non-existent files when we build for iOS with cocoapods.

This change fixes it.

## Changelog
[Internal] -  Only include ReactCommon and ios platform for TextInput

Reviewed By: GijsWeterings

Differential Revision: D68319960

fbshipit-source-id: 45ddd7765f6afc0efef6dc1dadea782871fbd779
2025-01-17 05:07:05 -08:00
Sam ZhouandFacebook GitHub Bot 7278ff01d7 Deploy 0.259.1 to xplat (#48751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48751

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D68294434

fbshipit-source-id: 8827369836906464566069cf22b584a4c672ec92
2025-01-16 16:29:30 -08:00
nishan (o^▽^o)andFacebook GitHub Bot cc89ddd50b feat: linear gradient px and transition hint syntax support (#48410)
Summary:
- Adds support for color transition hint syntax in linear gradients. e.g. `linear-gradient(red, 20%, green)`
- Adds `px` support. Combination of `px` and `%` also works.
- Simplified color stops parsing.
- The `processColorTransitionHint` and `getFixedColorStops` is moved to native code so it can support combination of `px` and `%` units as it requires gradient line length, which is derived from view dimensions and gradient line angle.
- Follows CSS [spec](https://drafts.csswg.org/css-images-4/#coloring-gradient-line) (Refer transition hint section) and implementation is referred from [blink engine source](https://github.com/chromium/chromium/blob/a296b1bad6dc1ed9d751b7528f7ca2134227b828/third_party/blink/renderer/core/css/css_gradient_value.cc#L240).

## Changelog:

[GENERAL] [ADDED] - Linear gradient color transition hint syntax and `px` unit support.

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

Test Plan:
Added testcase in processBackgroundImage-test.ts and example in LinearGradientExample.js

<img width="500" alt="Screenshot 2025-01-05 at 11 38 13 PM" src="https://github.com/user-attachments/assets/62858bb7-1dbf-40cf-8dd4-ec0daf84ac1b" />

## Todo

Add testcases for `getFixedColorStops` and `processColorTransitionHint` in native code for both platforms. That's the only downside of moving it out of JS 🤦

Reviewed By: NickGerleman

Differential Revision: D67870375

Pulled By: joevilches

fbshipit-source-id: b91d741f3108c25df8000d220726bf180c64be60
2025-01-16 15:00:37 -08:00
Pieter VanderwerffandFacebook GitHub Bot c65117eba9 Deploy 0.259.0 to fbsource (#48744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48744

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D68279682

fbshipit-source-id: 2a7e19b75863d5fd31037e04fa334efda28de79e
2025-01-16 11:43:13 -08:00
Nick GerlemanandFacebook GitHub Bot 69f761f1ac Allow parser to support generic data types (#48718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48718

This diff looks a bit scary, but it's mostly just structural changes of existing code and some deletion, on a well tested path 😅.

The current parser implementation tries to special case "basic" data types. When I was looking at how to add in support for more complex values, such as lists, function notations, and more compounded types, this distinction ends up not making much sense.

Instead of treating some types as basic, this diff instead moves to a model where a user can declare any structure as a `CSSDataType`, so long as they also supply a parser, which may be visited when iterating through CSS syntax blocks (preserved tokens, function blocks, or simple blocks, which probably won't be used). The user then specifies a list of supported CSS data types to parse, which invokes said parser, calling any defined methods for specific syntax. E.g.

```cpp
struct CSSNumber {
  float value{};
};

template <>
struct CSSDataTypeParser<CSSNumber> {
  static constexpr auto consumePreservedToken(const CSSPreservedToken& token)
      -> std::optional<CSSNumber> {
    if (token.type() == CSSTokenType::Number) {
      return CSSNumber{token.numericValue()};
    }

    return {};
  }

  // Could also accept function block here as well (e.g. for future math
  // expressions)
};

static_assert(CSSDataType<CSSNumber>);
```

```cpp
// Can be one of std::monostate (variant null-type), CSSWideKeyword,
// CSSNumber, CSSLength, or CSSPercentage. In this case, a CSSLength.
auto value = parseCSSProperty<CSSNumber, CSSLength, CSSPercentage>("5px");
```

This breaks a whole lot of assumptions I made a year ago, especially around `CSSValueVariant` which must now be able to handle arbitrary values. For now, for the sake of simplicity, I threw this out, and migrated parser code to use plain-old `std::variant`, which has a downside of being a bit less optimized in terms of storage. I also ended up completely throwing out `CSSDeclaredStyle`, since it would majorly need to change, and we're not going to be migrating style storage quite yet. This change also broke the `CSSProperties.h` property definitions and parsing shorthand a bit, which we will need for value processing later. I also opted to delete this for now (a big centralized list is the wrong structure anyways), but will likely copy bits from its source history later.

Another particular hairy bit, that likely won't bite us in practice, is that some strings may be parseable under different data types. This just adds caller requirement to order the types correctly, instead of precedence being implemented as part of the parser.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68245734

fbshipit-source-id: 132b11053cf41f57483c89176a9a6dceebb69fad
2025-01-16 11:42:34 -08:00
Nick GerlemanandFacebook GitHub Bot 2b925c8358 Fix unintentional fallthrough in keyword parsing (#48717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48717

tsia

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68246769

fbshipit-source-id: a5192880423cb00616981f4e1b24b7819062bc3b
2025-01-16 11:42:34 -08:00
Nick GerlemanandFacebook GitHub Bot ddf68eb949 Handle "transparent" color ident (#48716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48716

`transparent` is specced as a special `<named-color>` outside the table the others were derived from. Let's add it, since it is supported today by `normalizeColor`.

https://www.w3.org/TR/css-color-4/#named-colors

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68246770

fbshipit-source-id: 3ff7ed68ebb3d6bc59b24a25d35342620670f0c3
2025-01-16 11:42:34 -08:00
Nicola CortiandFacebook GitHub Bot de5bccf080 Cleanup prealpha logic from the JS Publishing Scripts (#48691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48691

We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68206014

fbshipit-source-id: f05eeae3997d52df1127852e03437a387a01f5ad
2025-01-16 11:36:42 -08:00
David VaccaandFacebook GitHub Bot 878185678f Migrate ContentSizeWatcher to kotlin (#48743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48743

Migrate ContentSizeWatcher to kotlin
changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68278772

fbshipit-source-id: ba3c88be13aad3c49a8dd3771332b48725ea76c1
2025-01-16 11:36:06 -08:00
David VaccaandFacebook GitHub Bot c5041ea099 Migrate ScrollWatcher to Kotlin (#48742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48742

Migrate ScrollWatcher to Kotlin

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68278771

fbshipit-source-id: 550c3b6c83999b1d610cb3d75ec91f552d89c028
2025-01-16 11:36:06 -08:00
Nicola CortiandFacebook GitHub Bot 40c18e1259 Remove last tasks.creating invocation inside hermes-engine (#48739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48739

Follow-up to https://github.com/facebook/react-native/pull/48603
I realized there is one last `tasks.creating` invocation inside `hermes-engine` that needs migration. This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D68276984

fbshipit-source-id: d58cf64cf41c7943464f15d12c7a04c3cc43ec7d
2025-01-16 11:00:59 -08:00
Rob HoganandFacebook GitHub Bot f30c46efbd Fix "paused on debugger" overlay icon (#48736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48736

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

This icon was broken by D65457771, identified in [OSS testing for the 0.77 release](https://github.com/reactwg/react-native-releases/issues/724).

By explicitly setting the image for the `Disabled` state to the same as `Normal`, we get the same behaviour as the deprecated [`adjustsImageWhenDisabled = NO`](https://developer.apple.com/documentation/uikit/uibutton/adjustsimagewhendisabled?language=objc) without the need for `configurationUpdateHandler`.

Changelog: [iOS][Fixed] Restore "Paused in debugger" overlay icon

Reviewed By: cipolleschi

Differential Revision: D68274336

fbshipit-source-id: 3f4b84eb7cfb518ca953c721da9885df8f98b437
2025-01-16 10:51:58 -08:00
Samuel SuslaandFacebook GitHub Bot 6fa4cc6085 Back out "Animated: Optimize onUserDrivenAnimationEnded Deopt" (#48733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48733

Original commit changeset: e7d7e486bbfd

Original Phabricator Diff: D67872307

changelog: [internal]

Reviewed By: yungsters

Differential Revision: D68268701

fbshipit-source-id: 1eb0dcb257c2d568cbc02ab2aa4a16b161797b24
2025-01-16 10:48:23 -08:00
Samuel SuslaandFacebook GitHub Bot 67fc85615a Back out "fix Pressable when transform style is animated" (#48732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48732

Original commit changeset: e2ac108b064a

Original Phabricator Diff: D68154908

changelog: [internal]

please read summary in D68268701

Reviewed By: yungsters

Differential Revision: D68268700

fbshipit-source-id: ba908e0be5bd171d818efe1bcbb3a97279bafafe
2025-01-16 10:48:23 -08:00
Samuel SuslaandFacebook GitHub Bot b059050c87 Back out "Animated: Defer onAnimatedValueUpdate on Attach + Native" (#48731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48731

Original commit changeset: 2089100a773e

Original Phabricator Diff: D68236594

changelog: [internal]

please read summary in D68268701

Reviewed By: yungsters

Differential Revision: D68268698

fbshipit-source-id: f122336209c4a5ec480d7a6a37224391eb1d2311
2025-01-16 10:48:23 -08:00
iwaterandFacebook GitHub Bot 0511e2e49a Disable weak event emitter in AttributedString for Apple Silicon Mac running iOS build app (#48583)
Summary:
https://github.com/facebook/react-native/issues/48225 fixed the same problem on Mac Catalyst build, but this crash also happen on a iOS build app running on Apple Silicon Mac.
The weak event emitter in AttributedString attributes is causing a serialization error when typing into a TextInput in a iOS build app running on Apple Silicon Mac.

## Changelog

[iOS][Fixed] - Workaround for a iOS build app running on Apple Silicon Mac(in Xcode Destination: "Mac(Designed for iPad)") TextInput crash due to serialization attempt of WeakEventEmitter

## 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

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

Reviewed By: javache

Differential Revision: D68093083

Pulled By: cipolleschi

fbshipit-source-id: ac48be3305eb01ff2b62d63283b929e8ab6b250c
2025-01-16 10:09:03 -08:00
Peter AbbondanzoandFacebook GitHub Bot 8a12672e8a Declare shared interface for accessibility delegate methods (#48543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48543

Introduces a shared interface for methods that need to be called by the `ReactScrollViewAccessibilityDelegate`

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D67948151

fbshipit-source-id: 9bafaa0b5f9ad5ba2fd73b7b1929d784fa4951c9
2025-01-16 10:05:30 -08:00
Rob HoganandFacebook GitHub Bot b1938e9026 Add changelog for 0.77.0-rc.7 (#48738)
Summary:
Changelog for 0.77.0-rc.7

## Changelog:
[Internal] Changelog

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D68276563

Pulled By: robhogan

fbshipit-source-id: ae57d179d98cd5200a449adbc1b38909633b10d1
2025-01-16 09:56:25 -08:00
Nicola CortiandFacebook GitHub Bot 44b18b9207 Use Gradle configuration avoidance API (#48603)
Summary:
Since we updated Gradle, I've noticed several warnings related to configuration avoidance API:
https://docs.gradle.org/current/userguide/task_configuration_avoidance.html

We should be using tasks.registerting rather than tasks.creating as this is going to break in Gradle 9/10.
This PR fixes it.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: javache

Differential Revision: D68270870

Pulled By: cortinico

fbshipit-source-id: 0ed44d903692c20d102143082fd0939f4dbeaa88
2025-01-16 08:49:32 -08:00
Peter AbbondanzoandFacebook GitHub Bot bc810e5115 Only apply event throttling to scroll view events (#48712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48712

Currently, all scroll events can be throttled by the `scrollEventThrottle` value when the intention is only to throttle `onScroll` calls. As a result, the scroll view helper unintentionally drops events unrelated to scrolling, like momentum begin/end. It's imperative that these momentum events dispatch so the scroll view does not lock itself in an "animated" state on the JS side; if locked in an animation state, children of the scroll view will not receive touch events. This can happen when the throttle is sufficiently high and momentum scrolling completes before the throttle time has elapsed.

Changelog:
[Android][Fixed] - Scroll view throttle no longer impacts events other than `onScroll`

Reviewed By: javache, rshest

Differential Revision: D68234045

fbshipit-source-id: d5c11412d3f273811a45e6f61af08d3fcf9f61d5
2025-01-16 07:46:03 -08:00
Parsa NasirimehrandFacebook GitHub Bot 166347ead9 chore(Android): migrate MessageQueueThread and it's implementation to Kotlin (#48652)
Summary:
Continuing our usual journey, this time migrating MessageQueueThread. Was not expecting to see that many assertions in ReactContext.
One important thing to note on this PR: I had to add an extra Throw RuntimeException to `startNewBackgroundThread`. It already had one from the`dataFuture.getOrThrow()`, but if your thread is not associated with a Looper, calling `myLooper` (Line 203 of MessageQueueThreadImpl) Can return null. Until now, this would have been a `NPE`, i just decided to make it a `RuntimeException` with the message `Looper not found for thread`. Let me know if you want me to make that function return a nullable, or throw another message or exception, or if you want me to treat Looper as Nullable in the whole class.

## Changelog:

[INTERNAL] [FIXED] - Migrate MessageQueueThread and MessageQueueThreadImpl to Kotlin

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

Test Plan: <img width="1318" alt="Screenshot 2025-01-13 at 21 03 00" src="https://github.com/user-attachments/assets/462cc8af-4648-4437-9260-5ffa6c69e763" />

Reviewed By: tdn120

Differential Revision: D68155120

Pulled By: rshest

fbshipit-source-id: 1082a832df5b1d8ee64ca7be26e4b85e79152f88
2025-01-16 07:34:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 9f1236eff2 Fix RTL examples in dark mode (#48719)
Summary:
RTL examples are not visible in dark mode.

## Changelog:

[INTERNAL] - Fix RTL examples in dark mode

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

Test Plan:
<details>
<summary>Before and after screenshots</summary>

| Before                                                                                     | After                                                                                     |
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| ![Screenshot_1737000292](https://github.com/user-attachments/assets/4f36c5d3-ea51-4e9a-a962-b6cafbeb82da) | ![Screenshot_1737000381](https://github.com/user-attachments/assets/42f87100-6452-465b-b1de-e5dd26542459) |
</details>

Reviewed By: Abbondanzo

Differential Revision: D68265351

Pulled By: rshest

fbshipit-source-id: c4abcc3d11240c77248475ee34fbe4f5196e7834
2025-01-16 06:53:09 -08:00
Dawid MałeckiandFacebook GitHub Bot c720000ae0 Change Promise import syntax (#48725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48725

Changelog:
[Internal] - Changed Promise import syntax

Reviewed By: cipolleschi

Differential Revision: D68214422

fbshipit-source-id: 1a92449dfae85148c680e449348fef0830c38769
2025-01-16 06:13:48 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 918638c1be Fix crash in TouchEvent when initialized with scroll MotionEvent action (#48723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48723

## Changelog:
[Internal] -

In certain scenarios `TouchEvent` can be initialized with "unexpected" event actions, such as `ACTION_SCROLL`.

This caused an exception , even though such scenarios may be legitimate.

Reviewed By: javache

Differential Revision: D68265040

fbshipit-source-id: d31881e03d9110bb4f6af38548a4f73a41c54d2b
2025-01-16 04:35:51 -08:00
Dawid MałeckiandFacebook GitHub Bot 0e6cb590ec Replace $FlowFixMe generated in StaticRenderer snap and migrate to the 'export' syntax (#48667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48667

Changelog:
[General][Changed] - refactored StaticRenderer syntax

Reviewed By: javache, elicwhite

Differential Revision: D68155216

fbshipit-source-id: a9ea2adef8e2d5aeaac5be4ec4a021595c4edf1f
2025-01-16 04:23:20 -08:00
Nicola CortiandFacebook GitHub Bot 1b15f57c25 No need to invoke 'input keyevent 82' on test-e2e-local (#48707)
Summary:
The testing script is making unnecessary call to `input keyevent 82` which causes the Android device to
open the menu.

## Changelog:

[Internal] [Changed] -

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

Test Plan: Tested local with local device

Reviewed By: cipolleschi

Differential Revision: D68215641

Pulled By: cortinico

fbshipit-source-id: 3e2653d8aa0c1e6606d9921f7b3794d0d27ef3f0
2025-01-16 04:11:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 198adb47af Fix ruby (#48721)
Summary:
Following the suggestions [here](https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror), it seems that concurrent-ruby has been released tonight and it is bugged. Let's pin it to the right version.

## Changelog:
[iOS][Changed] - Pin 'concurrent-ruby' to a working version

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

Test Plan: GHA

Reviewed By: robhogan

Differential Revision: D68262719

Pulled By: cipolleschi

fbshipit-source-id: fc6410e28cc96f9d3769d3082a77cac0a3efe6db
2025-01-16 02:57:24 -08:00
Dawid MałeckiandFacebook GitHub Bot fa2fac1372 Replace $FlowFixMe in WebSocketEvent (#48693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48693

Changelog:
[General][Changed] - Improved eventInitDict type in WebSocketEvent class

Reviewed By: elicwhite, cortinico

Differential Revision: D68207452

fbshipit-source-id: 55bb62134c2d67f250c5079304a9c2758d9361df
2025-01-16 02:19:54 -08:00
Dawid MałeckiandFacebook GitHub Bot 9a29264ffb Set explicit types in I18nManager exports
Summary:
Changelog:
[Internal] - Added explicit types in I18nManager exports

Reviewed By: elicwhite

Differential Revision: D68214193

fbshipit-source-id: 960ef7b9c0171aed983f4db620bb895ccbff6cd2
2025-01-16 02:08:37 -08:00
Dawid MałeckiandFacebook GitHub Bot 595d8c7fa1 Replace import syntax in ReactNativeTestTools (#48687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48687

Changelog:
[Internal] - Replaced React and ReactTestRenderer import syntax in ReactNativeTestTools

Reviewed By: javache

Differential Revision: D68205425

fbshipit-source-id: 9dd31b57f3d09f602f8e5746b70e16edaf11cb4e
2025-01-16 02:07:05 -08:00
Dawid MałeckiandFacebook GitHub Bot 68ae3ca5e9 Change flatten import syntax in StyleSheet (#48705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48705

Changelog:
[Internal] - Changed flatten import syntax in StyleSheet

Reviewed By: elicwhite

Differential Revision: D68213648

fbshipit-source-id: bf6c33387ae9d36b6ce41b57639948c2b4902e55
2025-01-16 02:04:05 -08:00
Dawid MałeckiandFacebook GitHub Bot df9d43f02b Replace $FlowFixMe in TextAncestor (#48704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48704

Changelog:
[General][Changed] - Improved types in TextAncestor

Reviewed By: fabriziocucci

Differential Revision: D68213115

fbshipit-source-id: d71a2703799b518eb1adb70fb5792165b5956868
2025-01-16 01:48:51 -08:00
Tim YungandFacebook GitHub Bot 843582b8b5 Animated: Defer onAnimatedValueUpdate on Attach + Native (#48715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48715

{D68154908} fixed a problem with the `onAnimatedValueUpdate` listener not being correctly attached if `__attach` were called before `__makeNative` (which sets `__isNative` to true).

We're potentially seeing production symptoms of stuttering interactions and user responsiveness, after queuing up many operations. Our hypothesis is that in scenarios where `ensureUpdateSubscriptionExists` is being called during `__makeNative` (instead of during `__attach`), a backup of operations occurs leading to these symptoms.

This diff attempts to validate and mitigate this hypothesis by deferring `ensureUpdateSubscriptionExists` to when an `AnimatedValue` instance has had both `__attach` and `__makeNative` invoked.

Changelog:
[Internal]

Differential Revision: D68236594

fbshipit-source-id: 2089100a773ebfc161fb5b567123eb58a893939f
2025-01-15 17:00:44 -08:00
Tim YungandFacebook GitHub Bot e0c0476553 RN: Re-enable useInsertionEffectsForAnimations (#48708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48708

{D68171721} [facebook/react-native#48678](https://github.com/facebook/react-native/pull/48678) mitigated the bug that necessitated this revert.

Changelog:
[General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects.

Reviewed By: sammy-SC

Differential Revision: D68217144

fbshipit-source-id: 6796440f2839d897158528642e07869951651327
2025-01-15 10:32:27 -08:00
Devan BuggayandFacebook GitHub Bot e566c1ec06 Implement escape/cancel key press callback for TextInput (#48680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48680

## Changelog:

[General] [Added] - Adds the escape key to the key press event handler payload.

Reviewed By: shwanton

Differential Revision: D68186072

fbshipit-source-id: 01786c309bff4991c12fa667e933ff6105efe638
2025-01-15 08:34:55 -08:00
Iwo PlazaandFacebook GitHub Bot c89c5d7e3d Migrated Alert/*.js and ActionSheetIOS/*.js to use export syntax. (#48703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48703

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling

## This diff
- Updates files in Libraries/Alert and Libraries/ActionSheetIOS to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the related modules
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Alert` and `Libraries/ActionSheetIOS` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Differential Revision: D68210738

fbshipit-source-id: a984034b165908f75485f2bad33fcccadd865494
2025-01-15 08:23:49 -08:00
Dawid MałeckiandFacebook GitHub Bot 1126bbb149 Add explicit type to supported commands in TextInputNativeCommands (#48688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48688

Changelog:
[General][Changed] - Added explicit type to supported commands in TextInputNativeCommands

Reviewed By: cortinico

Differential Revision: D68205568

fbshipit-source-id: 53501cdeaf4d790b36156b59f76686e8fef5cc5f
2025-01-15 08:15:37 -08:00
Dawid MałeckiandFacebook GitHub Bot f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Fabrizio CucciandFacebook GitHub Bot e8a64fd638 Migrate rn-tester/IntegrationTests/ImageCachePolicyTest.js to function components (#48701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48701

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68153254

fbshipit-source-id: 24789c814550cd592cb68a0576c5037088734a75
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 8c64e0868e Migrate rn-tester/IntegrationTests/SimpleSnapshotTest.js to function components (#48700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48700

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152855

fbshipit-source-id: 121cb5dd65673121a021da12d10c7a7e118bd0dc
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 086e93d227 Migrate rn-tester/IntegrationTests/AppEventsTest.js to function components (#48699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48699

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152557

fbshipit-source-id: 9fa6cad408f6fbd3da513623379b864d0c33c63d
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot f864d6b533 Migrate rn-tester/IntegrationTests/ImageSnapshotTest.js to function components (#48698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48698

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152467

fbshipit-source-id: 0f747f1646be5a3ca010c2c0e0591f13bfcaf2f4
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot d1153ff468 Migrate rn-tester/IntegrationTests/PromiseTest.js to function components (#48697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48697

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152416

fbshipit-source-id: 32d6d503ed119f8d7e5b9c139060b61ef44b8768
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 1a1714300e Migrate rn-tester/IntegrationTests/SyncMethodTest.js to function components (#48696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48696

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152294

fbshipit-source-id: 16b36d4702159528fe99c1a7d54c2c7b58d30349
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot c33954c80d Migrate rn-tester/IntegrationTests/GlobalEvalWithSourceUrlTest.js to function components (#48695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48695

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152232

fbshipit-source-id: 918236f8c9789efab9cc43b85e53fa398909808c
2025-01-15 06:11:21 -08:00
Tim YungandFacebook GitHub Bot 00d272fb3b Animated: Fix onUserDrivenAnimationEnded w/ Insertion Effects (#48678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48678

While diagnosing a recent issue in which `AnimatedValue` instances were not being correctly updated as expected, the insertion effects feature flag was identified as a root cause.

Upon further investigation, it appears that this is because the `onUserDrivenAnimationEnded` listener was not implemented the same way in the two feature flag states:

- When `useInsertionEffectsForAnimations` is disabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in a passive effect, after all nodes have been attached.
- When `useInsertionEffectsForAnimations` is enabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in an insertion effect when attaching nodes.

The bugs occurs because `useAnimatedProps` checks whether native driver is employed to decide whether to listen to `onUserDrivenAnimationEnded`. However, we do not know whether native driver will be employed during the insertion effect. (Actually, we do not necessarily know that in a passive effect, either... but that is a separate matter.)

This fixes the bug when that occurs when `useInsertionEffectsForAnimations` is enabled, by moving the listening logic of `onUserDrivenAnimationEnded` into a passive effect. This is the same way that it is implemented when `useInsertionEffectsForAnimations` is disabled.

Changelog:
[Internal]

Reviewed By: javache, sammy-SC

Differential Revision: D68171721

fbshipit-source-id: 50b23348fd4641580581cacebc920959651f96a7
2025-01-15 05:40:15 -08:00
Mateo GuzmánandFacebook GitHub Bot e7378f0d9e Migrate HeaderUtil to Kotlin (#48676)
Summary:
Migrate `HeaderUtil` to Kotlin.

## Changelog:

[INTERNAL] - Migrate `HeaderUtil` to Kotlin

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

Test Plan:
The file had tests:

```bash
yarn test-android
```

Reviewed By: fabriziocucci

Differential Revision: D68205283

Pulled By: javache

fbshipit-source-id: 23ad7726a5e597d5012eec6b194af3b1e10a8b7a
2025-01-15 04:45:02 -08:00
Nicola CortiandFacebook GitHub Bot d90c278672 Reformat MutationObserver test to comply with yarn lint --fix (#48692)
Summary:
Whenever I run `yarn lint --fix` I noticed that this test is not formatted correctly. This fixes it.

## Changelog:

[Internal] [Changed] -

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

Test Plan: CI

Reviewed By: sammy-SC

Differential Revision: D68207001

Pulled By: cortinico

fbshipit-source-id: 2a6c44ca02249f6662b03c87f0c4d4f3eb5a3054
2025-01-15 04:43:50 -08:00
Nicola CortiandFacebook GitHub Bot 9a4b2cecd5 Cleanup prealpha logic from Cocoapods (#48690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48690

We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68205691

fbshipit-source-id: 22a3416335052a4bf6a76faa6e6af622254a6e56
2025-01-15 04:30:37 -08:00
Nicola CortiandFacebook GitHub Bot 63442d3757 RNGP - Cleanup prealpha logic from the Gradle Plugin (#48689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48689

We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.

Changelog:
[Internal] [Changed] - RNGP - Cleanup prealpha logic from the Gradle Plugin

Reviewed By: cipolleschi

Differential Revision: D68205665

fbshipit-source-id: 81d5257544df97b566421164944e3b6e71f06635
2025-01-15 04:30:37 -08:00
LeviandFacebook GitHub Bot c09b71b990 Fabric: Support stylistic sets for fontVariant (#48674)
Summary:
In the old arch, stylistic sets were supported however in the new arch support was not added. It seems that fontVariant support was actually initially missed on iOS fabric however a limited version was added in https://github.com/facebook/react-native/pull/44112 . I referenced that PR and also old arch implementation for these changes.
<img width="480" alt="Screenshot 2025-01-14 at 11 15 18 AM" src="https://github.com/user-attachments/assets/ec32a356-fadd-4281-83b9-15871bbcd18f" />

## 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
-->

[GENERAL] [ADDED] - Support stylistic sets for fontVariant

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

Test Plan:
- Verified that the "Unsupported FontVariant" native log no longer displays on both platforms
- On iOS was easy to test in the tester app as SF supports stylistic sets by default:
```
<Text>
  Stylistic{'\n'}
  <Text>Normal: ${'\n'}</Text>
  <Text style={{fontVariant: ['stylistic-four']}}>
    Stylistic Four: $
  </Text>
</Text>
```

<img width="391" alt="Screenshot 2025-01-14 at 11 59 29 AM" src="https://github.com/user-attachments/assets/1ede258e-783f-448f-8300-4c8c710796ef" />

- On Android I could not find any system fonts that support stylistic sets by default so I added Raleway and confirmed with a W character
![image](https://github.com/user-attachments/assets/e4b661ba-0013-4e60-90d0-1864be538159)

I did not add font variant example to the tester apps as I felt it could be confusing for people at a glance to understand why there is only a system font example on iOS and why I chose the specific stylistic set.

Reviewed By: cipolleschi

Differential Revision: D68205738

Pulled By: javache

fbshipit-source-id: 03ce572d3c8ecafca71fe00fc0e88eeafc2558bb
2025-01-15 04:23:39 -08:00
Pieter De BaetsandFacebook GitHub Bot a18bc58645 Provide default implementation of ViewManager#getDelegate (#48664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48664

Simplify ViewManager base-class by making `ViewManager`'s delegate non-nullable and using a single path for updating properties.

The ViewManagerDelegate API can map back to the original ViewManagerSetter API transparently, allowing us to remove the codepath from `ViewManagerPropertyUpdater`.

Changelog: [Android][Removed] `ViewManagerPropertyUpdater.updateProps` is deprected, use the related ViewManager APIs instead

Reviewed By: mdvacca, rshest

Differential Revision: D68120420

fbshipit-source-id: cd8b906dc36d4803dbe09ee0283654285eb81fd4
2025-01-15 04:05:47 -08:00
Pieter De BaetsandFacebook GitHub Bot 54ac150324 Convert com.facebook.react.uimanager.ViewManagerPropertyUpdater to Kotlin (#48658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48658

Migrate to Kotlin before I make further changes to this. Generics are really tricky due to our previous usage of raw generics on the Java side, but were worked around by some combination of unchecked cast and `Nothing`

Changelog: [Internal]

Reviewed By: mdvacca, rshest

Differential Revision: D68102210

fbshipit-source-id: 90013f09db0826f571a4e2a84132ae3b49fa299d
2025-01-15 04:05:47 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5b1877fb3f Create changelog for 0.78.0-rc.0 (#48685)
Summary:
Add changelog for 0.78.0-rc.0

## Changelog:
[Internal] - Add changelog for 0.78.0-rc.0

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D68205113

Pulled By: cipolleschi

fbshipit-source-id: f3f572e1da475ef6229b2432d3fff821ec2f5ae1
2025-01-15 03:06:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 559d070e8e Use RNTester App downloaded from CI instead of building (#48637)
Summary:
This change improves the E2E testing by downloading the iOS RNTesterApp that is built in CI instead of building it locally. This should let us save 10 to 20 minutes when we test a new release.

## Changelog:
[Internal] - Use the RNTester app built in CI for release testing on iOS

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

Test Plan:
- build the app in ci
- run `yarn test-e2e-local -c <my-token>` and `yarn test-e2e-local -h false -c <my-token>` and verify that the iOS app is not built, but run in the simulator

Reviewed By: cortinico

Differential Revision: D68161477

Pulled By: cipolleschi

fbshipit-source-id: 577d110f9ff0197a2d3348a08a60e60a4d0a752b
2025-01-15 01:04:29 -08:00
Joe VilchesandFacebook GitHub Bot 3420eb87b0 Allow text inputs to handle native requestFocus calls (#48547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48547

For some unknown reason, we have been swallowing [`requestFocus`](https://developer.android.com/reference/android/view/View#requestFocus(int) calls since `TextInput` is a controlled component - meaning you can control this components value and focus state from JS. This decision was originally made pre 2015 and I cannot find the reason why

I do not think this makes sense. We can still request focus from JS, while allowing the OS to request focus as well in certain cases and we would still be controlling this text input.

This is breaking keyboard navigation. Pressing tab or arrow keys will no-op if the next destination is a `TextInput`. This is because Android will call `requestFocus` from [here](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/ViewRootImpl.java;l=7868?q=performFocusNavigation) when handling key events. Notably, Explore By Touch (TalkBack) swiping gestures WOULD focus `TextInputs` since they go through `ExploreByTouchHelper` methods which we override to call the proper `requestFocusInternal()` method.

**In this diff**: I move the logic in `requestFocusInternal()` into `requestFocus`.

Changelog: [Android] [Fixed] - TextInputs can now receive focus via external keyboard

Reviewed By: NickGerleman

Differential Revision: D67953398

fbshipit-source-id: 506006769a7c8a63f0a9b7ce27cfbe8578777790
2025-01-14 16:31:52 -08:00
Rayner KristantoandFacebook GitHub Bot 0f1d4704df Revert D68017325: Migrate StyleSheet/*.js to use export statements
Differential Revision:
D68017325

Original commit changeset: 3c5b94742f10

Original Phabricator Diff: D68017325

fbshipit-source-id: d7ea1edfe9cca151560e9c0e5554a07153cdb8da
2025-01-14 15:22:26 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b3648be84f Bump maestro to see if it improves stability (#48677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48677

E2E tests are flaky again.
Let's bump maestro to see if stability improves.

This will also remove some noise from the logs, make them easier to read.

## Changelog
[Internal] - Bump maestro version

Reviewed By: cortinico

Differential Revision: D68160005

fbshipit-source-id: 40a25f974dfda75785bf08d8d236e771b44d13cf
2025-01-14 13:32:51 -08:00
Fabrizio CucciandFacebook GitHub Bot 9d1e24cb2f Migrate rn-tester/IntegrationTests/IntegrationTestHarnessTest.js to function components (#48671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48671

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68151272

fbshipit-source-id: 5d42da93ab4fe8aaf34b8916a6d0a234f51c235a
2025-01-14 12:18:41 -08:00
Samuel SuslaandFacebook GitHub Bot 2204ec94d4 fix Pressable when transform style is animated (#48672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48672

## Changelog:

[General] [Fixed] - Buttons becoming unresponsive when transform is animated

# The problem

D67872307 changes when `ensureUpdateSubscriptionExists`  is called to in `__attach`. This breaks the functionality because `__attach` is called before flag `__isNative` is set and subscriptions are never setup.

# Fix

The diff sets up subscriptions in `__makeNative` method.

Reviewed By: yungsters

Differential Revision: D68154908

fbshipit-source-id: e2ac108b064a66dda08902653d6bd20286f92458
2025-01-14 11:05:07 -08:00
Luna WeiandFacebook GitHub Bot e3c63cfd34 Remove native optionality (#48653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48653

Changelog:
[General][Changed] - Mark intersectionRect required in NativeIntersectionObserverEntry

Reviewed By: rubennorte

Differential Revision: D68120751

fbshipit-source-id: 196b3d48cf33721031a0c2a9fa0a55d250926cbe
2025-01-14 09:58:50 -08:00
Dawid MałeckiandFacebook GitHub Bot 48cafc0b69 Replace $FlowFixMe in StatusBar (#48662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48662

Changelog:
[General][Changed] - Improved types in StatusBar by adding StackProps

Reviewed By: javache

Differential Revision: D68152452

fbshipit-source-id: a1ec30526e78eb7205e786ae1d0209037e4a0aba
2025-01-14 09:51:04 -08:00
Nicola CortiandFacebook GitHub Bot 6368555ab0 RN-Tester: Reorder buttons in the New Architecture sample (#48666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48666

The New Architecture sample is getting too big and the two views are not visible anymore.
I'm fixing this but having buttons side by side.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D68153245

fbshipit-source-id: 5557fd40f81078fe3994d8efe0e73784e043ed78
2025-01-14 09:15:36 -08:00
Nicola CortiandFacebook GitHub Bot ef7f714f57 Remove unnecessary LICENSE-docs (#48670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48670

The `LICENSE-docs` was needed when this repo was also containing the reactnative.dev docs.
As this is not the case anymore, this file is unncessary.

Changelog:
[Internal] [Changed] - Remove unnecessary LICENSE-docs

Reviewed By: cipolleschi

Differential Revision: D68156336

fbshipit-source-id: 489bf2cb95916c20eb61bfb00e34b8e271bc08e3
2025-01-14 08:53:58 -08:00
Fabrizio CucciandFacebook GitHub Bot 51fb5ab87a Migrate rn-tester/IntegrationTests/AccessibilityManagerTest.js to function components (#48663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48663

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68151132

fbshipit-source-id: 6fd9c4999a95a6888795c5200aafb15ff623479f
2025-01-14 08:45:21 -08:00
Thomas NardoneandFacebook GitHub Bot a511c1bdee Fix null safety in views/text/frescosupport (#48612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48612

Manual fixes to resolve nullsafe issues.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67992722

fbshipit-source-id: a26cde9788bc3456ec756326208b4907ad989d4e
2025-01-14 08:28:03 -08:00
Thomas NardoneandFacebook GitHub Bot 8b8b0ba5dc Mark nullsafe fixmes in views/text/frescosupport (#48613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48613

First step for nullsafe - annotate and mark fixmes

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67992721

fbshipit-source-id: 0c0a3ac7d4442d35bba1f48d6aabf13a3a1d47c2
2025-01-14 08:28:03 -08:00
Samuel SuslaandFacebook GitHub Bot c799aa07e2 Back out "RN: Enable useInsertionEffectsForAnimations" (#48669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48669

Original commit changeset: d09b2f1b7607

Original Phabricator Diff: D65906157

## Changelog:

[General] [Fixed] - Buttons becoming unresponsive when transform is animated

Reviewed By: yungsters

Differential Revision: D68152746

fbshipit-source-id: aa0c0aa3243c67c95128a75b40dd6aa1251abbca
2025-01-14 08:20:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f44ff97c47 Properly test JSC for template_app e2e tests (#48656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48656

While working on 0.78, I realize we were not testing the template app with JSC.

This change should fix this.

## Changelog:
[Internal] - Disable Hermes for the JSC E2E tests with Maestro

Reviewed By: cortinico, fabriziocucci

Differential Revision: D68147849

fbshipit-source-id: 4fbe005b5d04d6163a37041d1bd57fd48a9dfda8
2025-01-14 08:11:25 -08:00
Dawid MałeckiandFacebook GitHub Bot 9f7bacaa6b Add explicit types for methods from AnimatedImplementation in AnimatedMock (#48610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48610

Changelog:
[Internal] - Improved typings for AnimatedImplementation methods exported from AnimatedMock

Reviewed By: huntie

Differential Revision: D68019816

fbshipit-source-id: ee73213c0b519be9b72b8dfb2e91a125021de63e
2025-01-14 07:31:54 -08:00
Wojciech LewickiandFacebook GitHub Bot 07769d4d7e feat: Make DefaultReactNativeHost.clear() also invalidate DefaultReactHost (#48338)
Summary:
On bridgeless mode, `reactHost` is kept in memory even after destroying the `DefaultReactNativeHost` in brownfield scenario. Since it keeps references to the modules, they are not deallocated, and their `initialize` methods are not fired again when creating new instance of `react-native` later. It breaks the behavior of e.g. `react-native-screens`, which wants to listen for mutations and should get new `FabricUIManager`: https://github.com/software-mansion/react-native-screens/blob/20b7e83782cd5f79ddd0d61dadc13eeb4db4b258/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt#L45.

In this commit we change the `DefaultReactNativeHost.clear()` method to also invalidate the instance retained inside `DefaultReactHost`

## Changelog:

[ANDROID] [FIXED] - Make DefaultReactNativeHost.clear() also invalidate DefaultReactHost

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

Test Plan: In brownfield scenario, destroy the instance of RN and see that modules are also destroyed.

Reviewed By: cipolleschi

Differential Revision: D67977140

Pulled By: cortinico

fbshipit-source-id: 1804f093ab1a905bef499078ddec32a13c50cc85
2025-01-14 07:31:35 -08:00
Dawid MałeckiandFacebook GitHub Bot 8b5e2ea683 Replace ExactReactElement_DEPRECATED in ScrollViewStickyHeader (#48659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48659

Changelog:
[Internal] - Replaced ExactReactElement_DEPRECATED with React.Node as a children type in ScrollViewStickyHeader

Reviewed By: fabriziocucci

Differential Revision: D68151420

fbshipit-source-id: d4406de67176ae1fea95b8b2ea85f41dc7f5045e
2025-01-14 07:16:41 -08:00
Nicola CortiandFacebook GitHub Bot b7eccf23de Back out "Do not reset rn-artifacts-version on release branch" (#48651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48651

Original commit changeset: dace7c931ec3

Original Phabricator Diff: D67975049

Reviewed By: cipolleschi

Differential Revision: D68114130

fbshipit-source-id: 9fb1707191037127b9ae985d2e3298a64e911590
2025-01-14 07:09:27 -08:00
Nicola CortiandFacebook GitHub Bot 85f9939031 Fix crash for Hermes Release due to HermesExecutor migration (#48660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48660

RN-Tester is currently instacrashing on release due to a migration to Kotlin for HermesExecutor
This fixes it.

Changelog:
[Internal] [Changed] - Fix crash for Hermes Release due to HermesExecutor migration

Reviewed By: javache

Differential Revision: D68151666

fbshipit-source-id: 31f404ec518831cf2151dc670cdf8553427ae8ab
2025-01-14 06:12:00 -08:00
Iwo PlazaandFacebook GitHub Bot e4d969a4ab Migrate StyleSheet/*.js to use export statements (#48609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48609

# Motivation
This is an attempt at modernizing the export syntax in some of the files in `Libraries/StyleSheet/`. It will allow these files to get properly ingested by modern Flow tooling.

# This diff
- Migrates the use of `module.exports` into `export default` for files located in `Libraries/StyleSheet/*.js`. Some files were omitted due to ballooning complexity, but will be addressed in other Diffs.
- Updating internal *require*s to use ".default", no product code seems to be affected.
- Migrating `require`s into `import`s where applicable, taking into account the performance implications (context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3638114866420225/)
- Updates the current iteration of API snapshots (intended).
- Updates `react-native-codegen`'s require of processColorArray, analogous to D42346452.

Changelog:
[General][Breaking] - Deep imports from some files in `StyleSheet/` can break when using the `require()` syntax, but can be easily fixed by appending `.default`

Reviewed By: javache

Differential Revision: D68017325

fbshipit-source-id: 3c5b94742f101db0b2914c91efab6003dba2b61a
2025-01-14 05:34:18 -08:00
Fabrizio CucciandFacebook GitHub Bot d95909ea15 Migrate rn-tester/js/components/RNTesterTitle.js to function components (#48649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48649

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68099051

fbshipit-source-id: 867010b692e6d71e4683cc12b4455be730413268
2025-01-14 03:20:05 -08:00
Fabrizio CucciandFacebook GitHub Bot 817cb17f78 Migrate rn-tester/js/examples/Layout/LayoutExample.js to function components (#48646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48646

As per title.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68098856

fbshipit-source-id: ad878569f5b88afa57895b4b08de32c880ee8242
2025-01-14 03:20:05 -08:00
Dawid MałeckiandFacebook GitHub Bot 2056794d24 Refactor import syntax that caused $FlowFixMe generation in snap (#48639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48639

Changelog:
[Internal] - refactored import syntax in File, ElementProperties, Inspector, InspectorOverlay, InspectorPanel, PerformanceOverlay, Modal, YellowBoxDeprecated

Reviewed By: andrewdacenko

Differential Revision: D68099152

fbshipit-source-id: a0d840a6000fd3974a3ce4673455180a8be66288
2025-01-14 03:08:44 -08:00
Dawid MałeckiandFacebook GitHub Bot 647ca90a30 Replace $FlowFixMe in AnimatedWeb (#48633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48633

Changelog:
[General][Changed] - Improved types in AnimatedWeb

Reviewed By: huntie

Differential Revision: D68092072

fbshipit-source-id: 396efffc64030b0b2d4085f969b92c422b227c0d
2025-01-14 02:59:52 -08:00
David VaccaandFacebook GitHub Bot 2d320fbd76 Cache ViewManagerDelegate on ViewManagers (#48550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48550

Cache ViewManagerDelegate on ViewManagers

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67957883

fbshipit-source-id: 8ec2f34fca04833e391b0bd5b9329cdc9ee12f08
2025-01-13 23:39:45 -08:00
Fabrizio CucciandFacebook GitHub Bot 980458c061 Migrate rn-tester/js/components/RNTesterButton.js to function components (#48645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48645

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68098118

fbshipit-source-id: 09f9c318afc210ca2ce6967dac7109544ef6717c
2025-01-13 13:07:44 -08:00
Pieter De BaetsandFacebook GitHub Bot 5a290c4cab Fix nullability of ViewManagerDelegate method args (#48602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48602

See context in D64532446 / https://github.com/facebook/react-native/pull/47086

These argument types were already consumed as nullable in various OSS libraries, which prevents correct Kotlin migration of this code.

Changelog: [Android][Changed] Deprecated ViewManagerDelegate#setProperty and ViewManagerDelegate#receiveCommand

Reviewed By: mdvacca

Differential Revision: D67277871

fbshipit-source-id: a0743584891c7b2b4b50fff11de15da0078d5a1a
2025-01-13 10:54:37 -08:00
Fabrizio CucciandFacebook GitHub Bot 90d2f65301 Migrate rn-tester/js/examples/AppState/AppStateExample.js to function components (#48644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48644

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095480

fbshipit-source-id: 2487fa5e66d672883cbfde0c68348a90db09d484
2025-01-13 10:47:13 -08:00
Fabrizio CucciandFacebook GitHub Bot 05e8007e12 Migrate rn-tester/js/examples/OrientationChange/OrientationChangeExample.js to function components (#48643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48643

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095232

fbshipit-source-id: fdf45a3bb64c590ea21222a02ae94d975579db49
2025-01-13 10:47:13 -08:00
Fabrizio CucciandFacebook GitHub Bot 1e0009407d Migrate rn-tester/js/components/TextInlineView.js to function components (#48640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48640

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095013

fbshipit-source-id: a593af63029352844e544245d88e7b4c9d7eb75c
2025-01-13 08:59:43 -08:00
Parsa NasirimehrandFacebook GitHub Bot 12e321daf0 chore(Android): Migrate Hermes Executor to Kotlin (#48617)
Summary:
Migrating HermesExecutor and it's factory to Kotlin. Not sure if the TAG in HermesExecutorFactory is needed anymore or not, but the rest of the changes are pretty bog standard

## Changelog:

[INTERNAL] [FIXED] - Migrate HermesExecutor and HermesExecutorFactory to Kotlin

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

Test Plan:
`./gradlew test`:
<img width="1266" alt="Screenshot 2025-01-11 at 04 01 12" src="https://github.com/user-attachments/assets/c0f1402c-796b-45fa-9ee3-41c5a5ffc356" />

Reviewed By: tdn120

Differential Revision: D68094681

Pulled By: cortinico

fbshipit-source-id: 16eae5c7c24886421cbd2cbf213295134a9c01cf
2025-01-13 08:44:05 -08:00
Thomas NardoneandFacebook GitHub Bot c7785e7ead Convert ReactTextInlineImageShadowNode (#48576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48576

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D67981753

fbshipit-source-id: 5d8a2408af9af350c0d3b369677ff8ee00335554
2025-01-13 08:39:18 -08:00
Rubén NorteandFacebook GitHub Bot fe8d102663 Create placeholder for User Timing API tests (#48634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48634

Changelog: [internal]

Just a placeholder to add new tests in the future.

Reviewed By: sammy-SC

Differential Revision: D68093342

fbshipit-source-id: 1e1d7fd71865763ef66b3bb1c76ff8b8ebca9fd9
2025-01-13 07:01:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 671520943f Remove build codegen from Cocoapods (#48631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48631

This step is already carried out by [generate-artifact-executor](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor.js#L385) if needed.

We can remove it from cocoapods and this will make it easier to migrate away from them.

For 3rd party apps that uses a specific version of React Native, codegen is shipped in NPM as already built in the react-native/codegen package.

This change really affects only the React Native monorepo.

## Changelog
[Internal] - Remove build codegen step from cocoapods

Reviewed By: cortinico

Differential Revision: D68019743

fbshipit-source-id: 7aaf9275886ba8b86d38d943d2b26bd8eed11aa8
2025-01-13 07:00:12 -08:00
Mateo GuzmánandFacebook GitHub Bot d4407d6f77 Fix RNTester strict mode warnings (#48619)
Summary:
While investigating https://github.com/facebook/react-native/issues/22186, some false positives showed up as some of the examples also have non-strict mode compatible code.

In this PR:

- Converting from class to functional components some TextInput and Image examples that were using `UNSAFE_` lifecycles.
- Unifying the auto-expanding example as it was exactly the same for iOS and Android.

## Changelog:

[INTERNAL] - Fix RNTester strict mode warnings for TextInput and Image examples

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

Test Plan:
- Wrapped the the entry app component in `RNTesterAppShared.js` with `StrictMode` and verified that no warnings are shown anymore for the updated components.
- Checked the examples are still working as they were.

Reviewed By: fabriziocucci

Differential Revision: D68094402

Pulled By: rshest

fbshipit-source-id: e13878cb290735095afaef3d0377fd6dab33c380
2025-01-13 05:11:13 -08:00
6cb2684b43 fix modal becoming unresponsive with PullToRefresh
Summary:
## Changelog:

[iOS] [Fixed] - Fix app becoming unresponsive when RefreshControl is used inside of <Modal />

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

This is a UIKit bug. Switching to `didMoveToSuperview` resolves it.

Reviewed By: cipolleschi

Differential Revision: D68025099

fbshipit-source-id: 5d5e730f002ca93748674655a8393b770dc11611

Co-authored-by: kkafar <kacperkafara@gmail.com>
2025-01-13 04:53:04 -08:00
Mateo GuzmánandFacebook GitHub Bot cc4e4c7fec Fix RNTester strict mode warnings (#48620)
Summary:
Follow up from https://github.com/facebook/react-native/issues/48619. While investigating https://github.com/facebook/react-native/issues/22186, some false positives showed up as some of the examples also have non-strict mode compatible code.

In this PR: Converting from class to functional components some `AnExApp` examples that were using `UNSAFE_` lifecycles.

## Changelog:

[INTERNAL] - Fix RNTester strict mode warnings for AnExApp examples

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

Test Plan:
- Wrapped the the entry app component in `RNTesterAppShared.js` with `StrictMode` and verified that no warnings are shown anymore for the updated components.
- Checked the examples are still working as they were.

Reviewed By: rshest

Differential Revision: D68092958

Pulled By: cipolleschi

fbshipit-source-id: 0f2cea3c679f8db0f13054e2851a73dc23a4c906
2025-01-13 04:46:57 -08:00
Ilia SidorenkoandFacebook GitHub Bot 2f2281718a Resolve master specs repo warning shown in pod install (#48628)
Summary:
Fix for https://github.com/facebook/react-native/issues/48627

## Changelog:

[IOS] [FIXED] - Resolve "Your project does not explicitly specify the CocoaPods master specs repo" `pod install` warning

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

Test Plan:
1. Run `bundle exec pod install`
2. Observe the warning no longer showing

Reviewed By: rshest

Differential Revision: D68094563

Pulled By: fabriziocucci

fbshipit-source-id: 8f7ef67e4c5f71af65b7958e67bb58e7277a3e0e
2025-01-13 04:33:27 -08:00
Dawid MałeckiandFacebook GitHub Bot f832c450a5 Replace $FlowFixMe in BoxInspector and refactor (#48601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48601

Changelog:
[General][Changed] - Improved types in BoxInspector and refactored a code

Reviewed By: NickGerleman

Differential Revision: D68017470

fbshipit-source-id: f55b958aeee44babb41cea996f944cbc551a7a7b
2025-01-13 02:11:33 -08:00
Dawid MałeckiandFacebook GitHub Bot 49e5c58c59 Replace $FlowFixMeProps in StyleInspector and refactor (#48608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48608

Changelog:
[General][Changed] - Improved types in StyleInspector and refactored a code

Reviewed By: fabriziocucci

Differential Revision: D68018846

fbshipit-source-id: ce737ec28a54c5d80d98f79380327b049c3e394b
2025-01-13 02:09:30 -08:00
Dawid MałeckiandFacebook GitHub Bot 2959d49e8d Replace $FlowFixMeProps in ElementBox and refactor (#48605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48605

Changelog:
[General][Changed] - Improved types in ElementBox and refactored a code

Reviewed By: NickGerleman

Differential Revision: D68018112

fbshipit-source-id: 369b5fb06d1f9d0bd450f487ab792b23b1d094af
2025-01-13 00:19:36 -08:00
Dawid MałeckiandFacebook GitHub Bot 48a7840919 Replace $FlowFixMe in BorderBox (#48593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48593

Changelog: [General][Changed] - Improve types on BorderBox

Reviewed By: NickGerleman

Differential Revision: D68014754

fbshipit-source-id: ab6af9ffb4a80a4040011c1a27ede95ea2c59171
2025-01-13 00:17:56 -08:00
Samuel SuslaandFacebook GitHub Bot 83699228c0 isolate use of folly to interpolateViewProps on Android (#48556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48556

Changelog: [Internal]

the only place in view module that uses folly is `ViewPropsInterpolation.h` and that is only on Android.
This diff makes that dependency explicit and make it android only.

Reviewed By: javache

Differential Revision: D67942951

fbshipit-source-id: 2a1a41f5a4caba553e81d4bb78ac9c84ba90b60b
2025-01-10 16:15:05 -08:00
Christoph PurrerandFacebook GitHub Bot 55d0bc4b77 Align logic in BaseTextInputShadowNode to calculate placeholder string with AndroidTextInputShadowNode (#48584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48584

[Changelog] [Internal] - Align logic in BaseTextInputShadowNode to calculate placeholder string with AndroidTextInputShadowNode

As a preparation for https://github.com/facebook/react-native/pull/48165 this aligns the implementation of those 2 methods

Reviewed By: NickGerleman

Differential Revision: D68004218

fbshipit-source-id: 722a33bb2665c59347ef1b0cd8ed7b35a05b2113
2025-01-10 15:35:34 -08:00
Eli WhiteandFacebook GitHub Bot cf5ab03d43 Include cxx modules in codegen schema (#48581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48581

Previously the CXX only modules were not being inclued in the schema for these apps, and therefore weren't being caught by the compat check.

Reviewed By: cipolleschi

Differential Revision: D68000360

fbshipit-source-id: 5d56bc840bd220f3b8b814e5d90eb49d9a2beb0b
2025-01-10 14:38:57 -08:00
David VaccaandFacebook GitHub Bot db57080e08 Refactor ViewManager codegen to use new ViewManagerInterface (#48549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48549

Refactor ViewManager codegen to use new ViewManagerInterface

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67957884

fbshipit-source-id: 7abcd453580ab2219770fd1aff780ba2977dfc8a
2025-01-10 13:58:28 -08:00
David VaccaandFacebook GitHub Bot 40a0cdbc99 Introduce ViewManagerInterface (#48548)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48548

In this diff I'm introducing the new public API ViewManagerInterface, this will be used in the next diffs of the stack to be implemented by all viewManagerInterfaces that are code-gen when using the new architecture

changelog: [Android][Changed] Introduce new public API ViewManagerInterface

Reviewed By: javache

Differential Revision: D67957886

fbshipit-source-id: 372bf99e4c977c3a4d2252b54371ec9f0dae6e9f
2025-01-10 13:58:28 -08:00
Christoph PurrerandFacebook GitHub Bot 6865e5a993 Preparation for sharing common ShadowNode functionality in BaseTextInputShadowNode for Android (#48582)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48582

[Changelog] [Internal] - Preparation for sharing common ShadowNode functionality in BaseTextInputShadowNode for Android

As a preparation for https://github.com/facebook/react-native/pull/48165 this change aligns the order of methods between:
- BaseTextInputShadowNode.h
- AndroidTextInputShadowNode.h

to make it easier for future changes to look at the delta between both implementations.

The goal is land https://github.com/facebook/react-native/pull/48582 which aligns the RN iOS and RN Android implementation

Reviewed By: NickGerleman

Differential Revision: D68001423

fbshipit-source-id: 5a5efa6542de676bd175744e7313c2b819e67f11
2025-01-10 13:28:16 -08:00
Nick GerlemanandFacebook GitHub Bot e53b76b6c6 Cleanup enableAndroidLineHeightCentering flag (#48577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48577

This has been enabled by default for about two and a half months. Let's clean up the old path.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67985133

fbshipit-source-id: 024c1b3f10d7d23caba04ed4b6eec122de1a7c14
2025-01-10 13:08:45 -08:00
Nicola CortiandFacebook GitHub Bot 2ab9a8c135 Cleanup enableAlignItemsBaselineOnFabricIOS (#48607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48607

This feature flag acted as a killswitch but it was effectively never used, so we can clean it up now.

Changelog:
[Internal] [Changed] - Cleanup `enableAlignItemsBaselineOnFabricIOS`

Reviewed By: cipolleschi

Differential Revision: D68018624

fbshipit-source-id: 2340b505021a6632b07a3a872e35b35522b6f361
2025-01-10 11:15:03 -08:00
Nicola CortiandFacebook GitHub Bot a40a885d88 Fix test-e2e-local with RNTester due to unbuilt codegen (#48558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48558

Running `yarn test-e2e-local -t "RNTester" -p "Android" -h true -c <TOKEN>`
currently fails if you start from RNTester Android.

That's because codegen is not built. This commit fixes it.

Changelog:
[Internal] [Changed] - Fix test-e2e-local with RNTester due to unbuilt codegen

Reviewed By: cipolleschi

Differential Revision: D67972074

fbshipit-source-id: c5c721a913b655675ed6e03e60efbb5ccdf613b2
2025-01-10 08:46:37 -08:00
Pieter De BaetsandFacebook GitHub Bot f6f7de61f4 Drop dependency on native/fb (#48568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48568

We only need this dependency for internal builds, as we only rely on fbjni, which is its own open-source project.

This code was forked for open-source and not synced in anyway, which is a potential liability.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D67796633

fbshipit-source-id: 8609783ed0921a53a823658b9fd07a57651e91fe
2025-01-10 08:16:26 -08:00
Pieter De BaetsandFacebook GitHub Bot b0466d8cdd Remove unnecessary interpolation for logcat logging (#48567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48567

We don't need the `FBLOG_PRI` macro which does unnecessary additional interpolation, and can instead directly call `__android_log_write`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D67461225

fbshipit-source-id: 3f2c881ce996b9638ef62e40ecc05f3e5a3e6ac1
2025-01-10 08:16:26 -08:00
Nicola CortiandFacebook GitHub Bot 7dcbc799eb Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26 (#48606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48606

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

The app is currently crashing on Android API lvl 26 attempting to invoke the method
`setEventEmitterCallback` which is defined inside BaseJavaModule.

I'm not entirely sure why this is happening only for API lvl 26, but I've verified
that by having the method protected, this doesn't happen anymore.

The visibility is consistent with the field `mEventEmitterCallback` which is also
protected and accessed to codegen. So let's keep them aligned for consistency.

Changelog:
[Android] [Fixed] - Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26

Reviewed By: cipolleschi

Differential Revision: D68018506

fbshipit-source-id: 87eda718c9774b584abdf771eaad5833d452a1ea
2025-01-10 07:56:17 -08:00
Nicola CortiandFacebook GitHub Bot 4c7c836ebf AGP to 8.8.0 (#48604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48604

Just keeping our dependency up to date.

Changelog:
[Android] [Changed] - Bumped Android Gradle Plugin (AGP) to 8.8.0

Reviewed By: cipolleschi

Differential Revision: D68017839

fbshipit-source-id: 6a452d60cce9bb60e67013eab0bef27e2f2adfc0
2025-01-10 07:38:19 -08:00
Nicola CortiandFacebook GitHub Bot 7bb92a3c2d refactor: Remove unnecessary parameter from configureRepositories (#48596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48596

The second parameter of `configureRepositories` was unused. Let's remove it.

Changelog:
[Internal] [Changed] - refactor: Remove unnecessary parameter from configureRepositories

Reviewed By: cipolleschi

Differential Revision: D68016105

fbshipit-source-id: 9fa05cd33e2f7a6986cf1fcdef0d75e74f315843
2025-01-10 07:38:08 -08:00
Nicola CortiandFacebook GitHub Bot a98528e609 Make the addition of JitPack repository configurable (#48595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48595

Historically React Native used to include the JitPack repository be default in the default repositories.

This sadly exposes React Native projects to supply chain attacks as explained here:
https://blog.oversecured.com/Introducing-MavenGate-a-supply-chain-attack-method-for-Java-and-Android-applications/

Moreover, artifacts on Jitpack are not GPG signed it's complicated to verify the identity of artifact authors.
I'm introducing a Gradle property to control if Jitpack should be included by default or not.

User can control this behavior by changing their `gradle.properties` file as such:

```
includeJitpackRepository=false
```

The default value of this property is currently true, but we're looking into changing it to false in the future.

Changelog:
[Android] [Added] - Make the addition of JitPack repository configurable

Reviewed By: cipolleschi

Differential Revision: D68016028

fbshipit-source-id: 392513fef389a4835b4e00a8184459e00d51fdd0
2025-01-10 07:38:08 -08:00
Nicola CortiandFacebook GitHub Bot c85be01cba Add .kotlin/ to gitignore (#48598)
Summary:
Adding .kotlin to gitignore. This folder starts to get used with K2 (with Kotlin 2.0) so we should be
adding it to the gitignore files

## Changelog:

[INTERNAL] - Add .kotlin to gitignore

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D68018000

Pulled By: cortinico

fbshipit-source-id: 78be3597071d07d105145d8ba94cd83cbf4f21bc
2025-01-10 07:35:12 -08:00
Rubén NorteandFacebook GitHub Bot fd0894b1c7 Add support for the columns option in console.table (#48592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48592

Changelog: [General][Added] Add support for the second parameter of `console.table` to specify a list of columns to print in the table.

Reviewed By: javache

Differential Revision: D67803665

fbshipit-source-id: 354476404bad7cd2d280c8b3d963d5acba41f86b
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot 7154c62afb Improve formatting of table in console.table (#48591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48591

Changelog: [General][Changed] Improved formatting of values logged via `console.table` (including Markdown format).

This provides several improvements over the format of tables logged via `console.table`:
* Markdown format for easy integration in existing documents.
* Increased alignment with the spec and Chrome/Firefox implementations:
  * Added index columns.
  * Logged all available columns.
  * Format for all types of values (including objects, functions, etc.).

Reviewed By: javache

Differential Revision: D67794858

fbshipit-source-id: 464c938ed51f28a8e071bc46f0f5b0d970005873
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot caa77fbe2b Prevent console.table from modifying passed values (#48590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48590

Changelog: [General][Fixed] Modified `console.table` to avoid mutating the received argument.

Reviewed By: sammy-SC

Differential Revision: D67791795

fbshipit-source-id: a889fe95914cf7850e6429742845b126917babc7
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot 7f985f29e3 Add tests for console.table (#48589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48589

Changelog: [internal]

Added basic tests for the current implementation of the `console.table` polyfill (not the CDP implementation).

Reviewed By: sammy-SC

Differential Revision: D67791579

fbshipit-source-id: 80d64903a92e87e0724ed302ec0521419f45f9a7
2025-01-10 05:41:37 -08:00
Nicola CortiandFacebook GitHub Bot a28d3961bd Do not reset rn-artifacts-version on release branch (#48572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48572

Because of this extra step on build-android, we're seeing the version 1000.0.0-<SHA>
on commits on the release branch. This prevents it.

Changelog:
[Internal] [Changed] - Do not reset rn-artifacts-version on release branch

Reviewed By: cipolleschi

Differential Revision: D67975049

fbshipit-source-id: dace7c931ec310538c11c4b9e544fdc2241a1d0c
2025-01-10 03:44:04 -08:00
Rubén NorteandFacebook GitHub Bot deea42329e Remove verification function from ReactFabricPublicInstance benchmark (#48588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48588

Changelog: [internal]

This has proved to be very CI and makes it fail a lot, so we're removing this for now.

Reviewed By: javache

Differential Revision: D67985917

fbshipit-source-id: 5ec7c1387ddfb8fb2a4e90450a98cb3caea9399f
2025-01-10 03:35:04 -08:00
Samuel SuslaandFacebook GitHub Bot bb6bbfc261 remove folly::tryTo (#48557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48557

changelog: [internal]

delete use of folly::tryTo from react native.

Reviewed By: christophpurrer

Differential Revision: D67942789

fbshipit-source-id: 976caa12b6ff6063041be3259aa8ebd642ca3ca0
2025-01-10 03:23:11 -08:00
Jakub PiaseckiandFacebook GitHub Bot 1051bd8f3e Explicitly type UIManagerProperties (#48587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48587

Changelog: [Internal]

Reviewed By: cortinico, huntie

Differential Revision: D67977469

fbshipit-source-id: 0f866aeaa3d19ba2bc01d2e4685487c9b1a3329f
2025-01-10 02:26:57 -08:00
Peter AbbondanzoandFacebook GitHub Bot 071506fa61 Add tinted vector drawable example to RNTester (#48541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48541

Shows how to use tintColor in conjunction with new XML file format, and serves as a good E2E test bench to ensure that drawables don't accidentally reuse the same state (if the underlying implementation isn't careful enough to call `buildCopy`, both icons will render red)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64136753

fbshipit-source-id: 3bd0933e587364425ac14a0635690d4b274a55fe
2025-01-09 19:56:12 -08:00
Nick GerlemanandFacebook GitHub Bot 9b646c8b7b Fix incorrect height of single line TextInput without definite size (#48523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48523

Current AndroidTextInputShadowNode logic measures the height of the TextInput by fitting text into the constraints of the TextInput box. This results in the wrong height for single line TextInputs, since a single line TextInput is infinitely horizontally scrollable (whearas the outer TextInput component itself has a fixed width).

After this change, we measure text under single line textinputs with an infinite width constraint, then clamp to the final constraints of the TextInput, to better emulate what is happening under the hood.

iOS ended up solving this in a slightly different way, by measuring paragraph with `maximumNumberOfLines={1}` when not multiline, but think this is a bit more fraught. E.g. up until recently, it would have meant that the width could have been less than max width, depending on where line-breaking happened. I ended up duplicating the new logic to use for both instead (D66914447 will eventually deduplicate).

Changelog:
[Android][Fixed] - Fix incorrect height of single line TextInputs without definite size

Reviewed By: christophpurrer

Differential Revision: D67916827

fbshipit-source-id: b827185c4640835481794cb985c2b62dcf643abe
2025-01-09 10:57:05 -08:00
Rubén NorteandFacebook GitHub Bot 8310d651e0 Mark benchmark API as unstable (#48570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48570

Changelog: [internal]

We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations.

Reviewed By: andrewdacenko

Differential Revision: D67975844

fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478
2025-01-09 10:11:18 -08:00
Samuel SuslaandFacebook GitHub Bot 8d67d51bdc remove use of folly::init (#48573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48573

changelog: [internal]

remove main.cpp for cxxreact/tests. It is not needed for tests to work and it breaks build for C++ only tests.

Reviewed By: javache

Differential Revision: D67975182

fbshipit-source-id: b9cbc5b5b6a87aafc69448e99877e664ed2d5af2
2025-01-09 08:43:22 -08:00
Alex HuntandFacebook GitHub Bot b5155fba89 Replace $FlowFixMe in DrawerLayoutAndroid (#48569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48569

Changelog:
[General][Changed] - Improve types on DrawerLayoutAndroid

Reviewed By: cipolleschi

Differential Revision: D67975172

fbshipit-source-id: 922d51d78b9e035f7703b1d53af39fa6dae8060b
2025-01-09 07:47:58 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f7977387f4 Update classification of Fixed (#48561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48561

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the `Fixed` entries.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: cortinico

Differential Revision: D67972217

fbshipit-source-id: 343dd5a4e8a6cd6d6806447063594ba466db3b1e
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot efb2aa0d5b Update classification of Deprecated (#48562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48562

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the `Changed` entries.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: cortinico

Differential Revision: D67941153

fbshipit-source-id: 59bc5a8a37242a1a5dc17baa4d85d0e18df35d46
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 36daa41c26 Update classification of Changed (#48563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48563

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the `Changed` entries.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: cortinico

Differential Revision: D67941107

fbshipit-source-id: 2352c901810587a0d4d5ccbbaa09960f03999378
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 16b047968f Update classification of Added (#48564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48564

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the `Added` entries.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: cortinico

Differential Revision: D67940751

fbshipit-source-id: 345bd0e4e9564a1d8d16418f31ee6a917f27b202
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d9af80f471 Update classification of RCs (#48565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48565

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the entries in the RCs.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: cortinico

Differential Revision: D67940292

fbshipit-source-id: 3373d2f2879c7137ad93b4b53672a0f8e322776f
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot cdc8c9db09 Start fixing changelog for 0.77 (#48528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48528

The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.

In this diff I took care of fixing the `Breaking Changes` and the `Removed` entries.

We need to go through all the other classes of entries.

## Changelog:
[Internal] - Refine 0.77 changelog

Reviewed By: robhogan, cortinico

Differential Revision: D67937294

fbshipit-source-id: 18278abae4680a9dab3f46e41c1b7f7f8a7ad367
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 85745f3551 Add Changelog for 0.76.6 (#48566)
Summary:
Add changelog for 0.76.6

## Changelog:
[Internal] - Add Changelog for 0.76.6

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D67973501

Pulled By: cipolleschi

fbshipit-source-id: a3c5c78620dfd7bb1c917dfc33d98801abe0a373
2025-01-09 06:51:53 -08:00
Samuel SuslaandFacebook GitHub Bot 1cbcea49bf write fantom tests percentage based width and height (#48560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48560

changelog: [internal]

add tests for width and height and margin style. Covering percentage-based dimensions and invalid inputs.

The test coverage is needed to make removal of folly::tryTo safe.

Reviewed By: rubennorte

Differential Revision: D67942139

fbshipit-source-id: c1e517dfb102eea892c998cf6ff4190fa69cdfa7
2025-01-09 06:09:36 -08:00
Rubén NorteandFacebook GitHub Bot e7a37c1b5f Move assets for feature flags docs to a __docs__ directory (#48555)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48555

Changelog: [internal]

Small move to align with the existing convention.

Add `README.md` file for feature flags in JS directory, to link to canonical docs.

Reviewed By: huntie

Differential Revision: D67897751

fbshipit-source-id: d5091ab4537701ee5cfdf29ebd0fe79e858e3134
2025-01-09 05:31:19 -08:00
Rubén NorteandFacebook GitHub Bot f1cbf25c09 Extract common logic in ErrorHandlers to a shared method (#48366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48366

Changelog: [internal]

Just removing some unnecessary duplication from this file.

Reviewed By: christophpurrer

Differential Revision: D67407220

fbshipit-source-id: 2f3e1ac4dddb7f8ede75175242e4b37e628196a0
2025-01-09 04:35:08 -08:00
Nicola CortiandFacebook GitHub Bot 1282361573 Silence the eden info output from react-native-codegen (#48540)
Summary:
We currently see this error message on console:
![Screenshot 2025-01-08 at 19 09 47](https://github.com/user-attachments/assets/3b384772-9abc-40a5-83b3-9b4ccce85f4a)

This will silence it by piping stderr to /dev/null

## Changelog:

[INTERNAL] - Silence the `eden info` output from react-native-codegen

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

Test Plan: CI

Reviewed By: robhogan

Differential Revision: D67948411

Pulled By: cortinico

fbshipit-source-id: f805634a65713f4f9bc2dce6d781664e7564bc96
2025-01-09 04:01:29 -08:00
Rubén NorteandFacebook GitHub Bot 742e14d47f Add a few more tests to ReactNativeElement (#48428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48428

Changelog: [internal]

Adding a few more tests for `ReactNativeElement` for symmetry with future tests for when it implements `EventTarget`.

Reviewed By: javache

Differential Revision: D67738147

fbshipit-source-id: 04c8f3539fefd15f7c778986eb9e39f2c2386b6a
2025-01-09 03:45:27 -08:00
Nicola CortiandFacebook GitHub Bot 5e6478954c Gradle to 8.12 (#48539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48539

This keeps our Gradle version up to date ahead of the branch cut for 0.78.
https://docs.gradle.org/current/release-notes.html

Changelog:
[Android] [Changed] - Bump Gradle to 8.12

Reviewed By: NickGerleman

Differential Revision: D67946619

fbshipit-source-id: 0b5ea8d9543ca565ea8b3bdd48e5fc711f832ce8
2025-01-09 03:10:02 -08:00
David VaccaandFacebook GitHub Bot cfec590f6a Defining constant'types for API stability (#48546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48546

Defining constant'types for API stability

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D67953794

fbshipit-source-id: 7f833d1999340a6a4073f3eb303251c52d9d6fc6
2025-01-08 16:15:58 -08:00
David VaccaandFacebook GitHub Bot a79a1123c9 Internalize RootViewManager (#48545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48545

RootViewManager is meant to be used by the internals of React Native, ther are no external usages. I'm internalizing it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67952865

fbshipit-source-id: 4c7f7de01c4de7ae00f62bd4f5b49e0082ec3f2b
2025-01-08 16:15:58 -08:00
Peter AbbondanzoandFacebook GitHub Bot dc5535cf88 Improve documentation for AssetSourceResolver (#48532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48532

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D67942309

fbshipit-source-id: 0f3901bfcd58863adf6dc8466bb5d587438e0d2c
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 6feb90bb29 Replace custom XmlFormat with Fresco built-in (#48533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48533

Replaces the custom `XmlFormat` introduced in https://github.com/facebook/react-native/pull/46711 with the built-in support from Fresco. Fresco utilizes a very similar approach to load binary XML files and offers the XML format as part of its built-in `DefaultImageFormats`

Changelog:
[Android][Changed] - Replaced custom XML decoder with Fresco's built-in decoder

Reviewed By: NickGerleman

Differential Revision: D66553842

fbshipit-source-id: 096e60140f893d461be1cdb48e250749e58bbb4c
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 819b5c2c8d Bump Fresco to 3.6.0 (#48542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48542

Updates Fresco from 3.5.0 to 3.6.0. Picks up a few new features and bug fixes for XML drawables, including a required fix that [automatically supplies the XML drawable factory to Fresco's PipelineDraweeControllerBuilder](https://github.com/facebook/fresco/commit/e6b052610aab461601cfabc00f7240758a415878). Without this change, we cannot switch from RN's custom XmlFormat to Fresco's built-in format

Changelog:
[Android][Changed] - Update Fresco to 3.6.0

Reviewed By: NickGerleman, rshest

Differential Revision: D67950225

fbshipit-source-id: 9afd87565a5f069493c9c5ef87977cbd6d7cf3d4
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 218815959b xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java (#48530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48530

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D67912326

fbshipit-source-id: b03be79dfbf3bf8d92b11eb6228ecc36282b29cf
2025-01-08 14:46:01 -08:00
David VaccaandFacebook GitHub Bot 843588ffe5 Refactor PointerEvents strings as constants (#48537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48537

Refactor PointerEvents strings as constants

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D67924567

fbshipit-source-id: 7d9976d293cef3eeedbbb72abd20d8f877b768d0
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot e4ec22de9d Delete POSITION_SPACING_TYPES from ViewProps (#48536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48536

POSITION_SPACING_TYPES is not being used, let's delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924569

fbshipit-source-id: 6cc4b0537032f4a4b54dbd728ca52ba216fd6cee
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot c17e6ce0f0 Delete ON_LAYOUT constant (#48535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48535

ON_LAYOUT is not being used, lets delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924570

fbshipit-source-id: b5522317c943c07f8617508c0345b18a6f31ce7e
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot 98b413416c Delete unused constants in ViewProps (#48534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48534

IS_ATTACHMENT is unused, let's delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924566

fbshipit-source-id: 49718f4ce667abe919a314a853dbd7853bfe1292
2025-01-08 11:37:47 -08:00
Nick GerlemanandFacebook GitHub Bot f7a5db3c06 Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints (#48525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48525

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

`TextMeasureCacheKey` hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of `Text` in one dimension,  and measures via `YGMeasureModeExactly`, we can have a minimum size corresponding specific to the style in which the text was laid out.

Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints

Reviewed By: christophpurrer

Differential Revision: D67922414

fbshipit-source-id: 0ee0220059fc4e4645b1684c42a0587fe728bedd
2025-01-08 10:33:25 -08:00
Tim YungandFacebook GitHub Bot 85e58f334e Prettier: Cleanup eslint-plugin-prettier Dependency (#48524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48524

I've confirmed that we are no longer using `eslint-plugin-prettier` in Metro or React Native. This removes it from the package dependencies.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D67920511

fbshipit-source-id: 9c8036ccfb94d974d344d861942c076dc2b70125
2025-01-08 09:42:59 -08:00
Tim YungandFacebook GitHub Bot 6d67d6a7f6 Animated: Optimize onUserDrivenAnimationEnded Deopt (#48511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48511

{D60499583} added a new`onUserDrivenAnimationEnded` listener that requires `AnimatedValue` instances to have up-to-date values reported by `onAnimatedValueUpdate` (if native driver is in use).

Previously, the only way to ensure `onAnimatedValueUpdate` events were always fired to update JavaScript values in `AnimatedValue` instance was to attach a listener — even an empty one. This is exactly what D60499583 did: it traverses `props` for `AnimatedNode` instances and attaches listeners to them.

However, this is really inefficient and makes the code extra convoluted. Instead, this diff changes `AnimatedValue` so that it always subscribes to changes in `__attach`, and then it cleans up the extraneous props traversal and "empty listener" logic.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D67872307

fbshipit-source-id: e7d7e486bbfd9ef03e2dd9f201089e2f68b2dbb2
2025-01-08 09:03:17 -08:00
Sam ZhouandFacebook GitHub Bot abf0384434 Deploy 0.258.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67927891

fbshipit-source-id: ac9c7bd87e9f1e2fecdbd7141cd0e5c5a62c7ce6
2025-01-08 08:47:41 -08:00
Pieter De BaetsandFacebook GitHub Bot a62230a54d Merge copies of GuardedFrameCallback (#48529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48529

These classes are identical and we already have a dependency on :uimanager in fabric.

Looking at OSS, I found no usages of `fabric.GuardedFrameCallback`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67913226

fbshipit-source-id: 97d7a9b45b877b98e9549c71135bd9b21386d78c
2025-01-08 07:40:32 -08:00
Peter AbbondanzoandFacebook GitHub Bot ec72af403c Mark string props as nullable in scrollview managers (#48520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48520

Both `ReactScrollViewHelper.parseSnapToAlignment` and `ReactScrollViewHelper.parseOverScrollMode` accept a nullable string. This is a precursor to migrating these files to Kotlin (since they're already marked as nullsafe). The prop itself is a nullable string so this should be reflected in the native types as well

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D67911553

fbshipit-source-id: aabe55c2dc65a933b170d76b89f62f25493ab0ee
2025-01-07 15:13:34 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 8b0af4542e fix(iOS): enable/disable keyboard shortcuts only on iOS (#48518)
Summary:
This PR guards code that enables/disables keyboard shortcuts only on iOS (iPadOS included).

![CleanShot 2025-01-07 at 14 49 36@2x](https://github.com/user-attachments/assets/cba4e19c-5a52-4874-94cf-a3e18112c8a3)

## Changelog:

[IOS] [FIXED] - enable/disable keyboard shortcuts only on iOS

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

Test Plan: CI Green

Reviewed By: rshest

Differential Revision: D67900442

Pulled By: javache

fbshipit-source-id: 249a7c3124d02d2c30303d218e2b26e987ae1f0f
2025-01-07 13:21:19 -08:00
Tim YungandFacebook GitHub Bot 38c46fe865 Animated: Lower onAnimatedValueUpdate to AnimatedValue (#48514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48514

Currently, `AnimatedNode` implements logic to start listening to updates on the current native node if a listener is added.

However, the `startListeningToAnimatedNodeValue` native module method only supports native tags for instances of `AnimatedValue`, which is a subclass of `AnimatedNode`. In fact…

* On Android, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/bdsl4sro) throws if the node is not an instance of `ValueAnimatedNode`.
* On iOS, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/hlpk1rzk) does nothing if node is not an instance of `RCTValueAnimatedNode`.

As such, this refactors `AnimatedNode` to never manage this subscription for native nodes. Instead, the logic is moved into the `AnimatedValue` subclass, ensuring that we never accidentally try to `startListeningToAnimatedNodeValue` with non-`AnimatedValue` native tags.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D67884973

fbshipit-source-id: 5601efd8c29104a991301eabd97ddb88fd03c4a3
2025-01-07 10:05:15 -08:00
Tim YungandFacebook GitHub Bot d3c5f6d1df Animated: Add Missing super.__attach() Calls (#48513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48513

While refactoring `Animated`, I noticed that many subclasses of `AnimatedNode` override `__attach` without invoking the superclass method, even though we do this for `__detach`.

In order to minimize surprise (e.g. if someone were to add logic into `AnimatedNode.prototype.__attach`), this diff updates all method overrides to invoke `super.__attach()`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D67884975

fbshipit-source-id: f3a5456cf944d4d70ba1cfe7c44897c110e5fc7e
2025-01-07 10:05:15 -08:00
Pieter De BaetsandFacebook GitHub Bot 3f6fc32a5c Fix nullability of ViewManagerDelegate
Summary:
Some of these parameters were incorrectly marked as nullable during the Kotlin migration

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D67091825

fbshipit-source-id: c660164e41ba7d47f1d1d3dc28a01b79b7c8cb03
2025-01-07 09:52:55 -08:00
Rob HoganandFacebook GitHub Bot 7a58f1f5bf Add changelog for 0.77.0-rc.6 (#48508)
Summary:
Changelog for 0.77.0-rc.6

## Changelog:

[Internal]

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67866154

Pulled By: robhogan

fbshipit-source-id: a64f2aa83abe31bbc8d9e1a2ac47e00bba55c389
2025-01-07 08:45:34 -08:00
Pieter De BaetsandFacebook GitHub Bot afd77d52ed Rename SurfaceRegistryBinding to AppRegistryBinding (#48337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48337

`SurfaceRegistryBinding` refers to a forked `SurfaceRegistry` we had for a while in bridgeless but which was merged back into `AppRegistry`. Align the native name as well to make it explicit that all this class does is call into `AppRegistry`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67342499

fbshipit-source-id: 797d8080611cb2576a2052999c2bf46d2eea9f72
2025-01-07 07:40:40 -08:00
Pieter De BaetsandFacebook GitHub Bot dbb75e36dc Always use AppRegistry globals in SurfaceRegistryBinding (#48336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48336

`RN$AppRegistry` and `RN$stopSurface` are always set on the init path, regardless of bridgeless or not, so we can remove the fallback path and cleanup this code.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67342498

fbshipit-source-id: db47e52fee5075f11258364d82474579d2bb21f4
2025-01-07 07:40:40 -08:00
Pieter De BaetsandFacebook GitHub Bot 65bda54232 Remove getInspectorDataForInstance (#48335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48335

This API was never adopted or implemented on iOS, and is not compatible with bridgeless.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67342500

fbshipit-source-id: a6740514d0347c0f497e1aa2f850328cc4607d24
2025-01-07 07:40:40 -08:00
Alex HuntandFacebook GitHub Bot eda29f0a56 Remove legacy InspectorPackagerConnection (#48506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48506

Cleanup after the original experiment removal in D57730921, and having launched Fusebox for a full release cycle.

- This was previously opened as D58017460 and reverted in D58132473 ([see comment](https://www.internalfb.com/diff/D58017460?transaction_fbid=980942997022731)).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67858259

fbshipit-source-id: f4b29247dd4c310cc1f6b6f45688756d7b925a5e
2025-01-07 05:48:00 -08:00
Blake FriedmanandFacebook GitHub Bot a8cf53fcd1 Add messaging to phabricator (#48470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48470

This introduces:
- `validate_rn_cpp_api`: run a shell script that fails if the user changes the C++ API.  Importantly it produces an artifact with details to share with the user: `message`.
- `message` has to be extracted from `stdout`, which **get_user_message** does if the `validate_rn_cpp_api` action is not successful (**warning**).
- The then users `comment_to_signalhub` to share this as a warning to the user (until we're confident this entire stack is very stable, at which time we'll block).

The provides 2 classes of warning:
1. vanilla you've change the API,
2. you've change the API and haven't included the correct changelog.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67776215

fbshipit-source-id: 4ac7451c8ecef62ba968710ec41804ba42153976
2025-01-07 03:41:42 -08:00
Parsa NasirimehrandFacebook GitHub Bot d22dbb5c51 chore(Android): Migrate Hermes Instruments to Kotlin (#48378)
Summary:
Time to migrate some of Hermes's instruments. I see that HermesMemoryDumper(`react/hermes/instrumentation/HermesMemoryDumper.h`) implements the interface on C++, ~but not sure if i need to update the `getId` call to just `id` (same with `getInternalStorage`) or if the interop between Kotlin and Java applies to these things as well. cortinico Any thoughts on your side would be appreciated.
HermesSamplingProfiler just became an object, since it was a singleton and a static anyway.
Here is what HermesMemoryDumper.h looks like:
<img width="1840" alt="Screenshot 2024-12-24 at 10 03 00" src="https://github.com/user-attachments/assets/d18e378a-9b23-47a9-83c9-402d29aeaa5f" />~
*Updated*: I ended up making them match the function signature on Cxx, because even if it does have that implicit behavior, doesn't feel right to tap into it like this.

## Changelog:

[INTERNAL] [FIXED] - Migrate HermesMemoryDumper and HermesSamplingProfiler to Kotlin

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

Test Plan:
`/gradlew test`:
<img width="1840" alt="Screenshot 2024-12-24 at 09 54 29" src="https://github.com/user-attachments/assets/1b23fb6f-9da8-42e4-a348-7da868df77c1" />

Reviewed By: cortinico

Differential Revision: D67657481

Pulled By: philIip

fbshipit-source-id: 4fb5e003789d51d464d0cca5800704ea51324b69
2025-01-07 00:49:59 -08:00
generatedunixname89002005232357andFacebook GitHub Bot cd40e4e387 Revert D67868219 (#48512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48512

This diff reverts D67868219
Breaking OTA Compatibility Check https://fburl.com/onedetection/m0hqsvjp

[General][Changed] - Revert: Mark intersectionRect required in NativeIntersectionObserverEntry to reflect native logic.

Reviewed By: lunaleaps

Differential Revision: D67882016

fbshipit-source-id: 8cff299ee823f8ef06fe96667e832b68be45666d
2025-01-06 22:28:51 -08:00
Christoph PurrerandFacebook GitHub Bot 65c6a0a941 Add getSurfaceProps helper method to SurfaceManager (#48487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48487

[Changelog] [Internal] - Add getSurfaceProps helper method to SurfaceManager

When reload a reactHost we need to know which surface properties have been applied when starting the surface. This adds a utility function for that.

Reviewed By: rshest

Differential Revision: D67822459

fbshipit-source-id: 6d1f182514ed6e7ae8e31d3e1ca052c93bac2843
2025-01-06 21:49:49 -08:00
Christoph PurrerandFacebook GitHub Bot 44525aaf8b Add isSurfaceRunning / getRunningSurfaces util functions to SurfaceManager (#48484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48484

[Changelog] [Internal] - Add isSurfaceRunning / getRunningSurfaces util functions to SurfaceManager

This exposes convience getter methods to data already stored in SurfaceManager

Reviewed By: rshest

Differential Revision: D67814092

fbshipit-source-id: af5e9df3b380d5efc0c11627a0d9a56796526639
2025-01-06 18:51:46 -08:00
Eli WhiteandFacebook GitHub Bot 25c673e357 Fixing schema types for component command params of Arrays (#48476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48476

Command param array types were generating invalid schemas due to untyped parser code. The invalid schemas occurred for any alias type, including custom objects and basics like Int32. This was also inconsistent between Flow and TypeScript.

We already had one component utilizing this issue, so this just codifies that support into the schema so it reflects reality. This is only a partial solution. The more full solution would be to fully encode the custom types in the schemas like we do for Native Modules.

# More Information:

Tl;dr, DebuggingOverlay is abusing a FlowFixMe in codegen commands.

## The problem:

The [CodegenSchema](https://www.internalfb.com/code/fbsource/[d3ab2f79b377]/xplat/js/react-native-github/packages/react-native-codegen/src/CodegenSchema.js?lines=220) should be the source of truth for anything that can be in the schema. If something is in the schema that isn't allowed by the types, that's a bug. We have a bug. I'm adding compat-check support for components and it's blowing up on prod schemas because DebuggingOverlay causes an invalid schema.

## The details:

Support for Arrays as arguments in commands was added to the Codegen in D51866557. [Code Pointer](https://fburl.com/code/8yy1rm0p)

The intention appears to be to support arrays of primitives. There is a TODO for supporting complex types.

```
interface NativeCommands {
  +addOverlays: (
    viewRef: React.ElementRef<NativeType>,
    overlayColorsReadOnly: $ReadOnlyArray<string>,
  )
}
```

This support was added to TypeScript in D52046165 where it types the allowed Array arguments to be only

```
{
    readonly type: 'ArrayTypeAnnotation';
    readonly elementType:
    | Int32TypeAnnotation
    | DoubleTypeAnnotation
    | FloatTypeAnnotation
    | BooleanTypeAnnotation
    | StringTypeAnnotation
  };
```

However, because the Parsers are treating the input type as `any`, it isn't safe to pass through an input value into the schema as Flow won't catch mismatches.

The Flow parser just passes it through:

```
{
    type: 'ArrayTypeAnnotation',
    elementType: {
    // TODO: T172453752 support complex type annotation for array element
    type: paramValue.typeParameters.params[0].type,
}
```

Whereas the TypeScript parser has the more correct behavior of validating the inputs and returning specific outputs. Unfortunately, the return type is also typed here as $FlowFixMe, losing most of the benefits.

```
function getPrimitiveTypeAnnotation(type: string): $FlowFixMe {
  switch (type) {
    case 'Int32':
      return {
        type: 'Int32TypeAnnotation',
      };
    case 'Double':
      return {
        type: 'DoubleTypeAnnotation',
      };
    case 'Float':
      return {
        type: 'FloatTypeAnnotation',
      };
    case 'TSBooleanKeyword':
      return {
        type: 'BooleanTypeAnnotation',
      };
    case 'Stringish':
    case 'TSStringKeyword':
      return {
        type: 'StringTypeAnnotation',
      };
    default:
      throw new Error(`Unknown primitive type "${type}"`);
  }
}
```

[DebuggingOverlay](https://fburl.com/code/zfe3ipq7) is abusing this gap in the Flow parser by sticking an Array of Objects in.

```
export type ElementRectangle = {
  x: number,
  y: number,
  width: number,
  height: number,
};

...
  +highlightElements: (
    viewRef: React.ElementRef<DebuggingOverlayNativeComponentType>,
    elements: $ReadOnlyArray<ElementRectangle>,
  ) => void;
...
```

This isn't allowed in the schema, but it seems to fall through the holes of the flow parser and generators.

The resulting schema from Flow is this. Note the GenericTypeAnnotation which isn't allowed to be in the schema.

```
{
    "name": "highlightElements",
    "optional": false,
    "typeAnnotation": {
    "type": "FunctionTypeAnnotation",
    "params": [
        {
            "name": "elements",
            "optional": false,
            "typeAnnotation": {
                "type": "ArrayTypeAnnotation",
                "elementType": {
                    "type": "GenericTypeAnnotation"
                }
            }
        }
    ],
    "returnTypeAnnotation": {
        "type": "VoidTypeAnnotation"
    }
},
```

The TypeScript parser fails with `Error: Unsupported type annotation: GenericTypeAnnotation`.

The generators don't seem to check beyond the ArrayTypeAnnotation so they fall through to generating generic arrays.

```
// ios
elements:(const NSArray *)elements

// android
ReadableArray locations
```

## So how do I fix this?

I think there are a couple of different options here. The key problem is that the Schema types need to represent reality of what can be in the schema.

1. We revert DebuggingOverlay to not use features that aren't supported (I assume nobody would be happy with this, but the change shouldn't have been made in the first place)
2. **(This is the approach taken in this diff)** We add MixedTypeAnnotation to the allowed types in Command arrays and have it generate that and add official support for that to the TypeScript parser as well. That is probably the quickest and easiest approach. It leaves the same type unsafety we have today on the native side.
3. NativeModules seem to have a lot more complex type safety here. They persist the alias type in the schema so that the CompatCheck can check them on changes. And then in C++ they generate structs and RCTConvert functions although for Java and ObjC it looks like they just use the same untyped native code. The matching approach here would be to add `aliasMap` and the whole data to the schema for commands, use that for the compat check, and still generate the same unsafe native code.

```
export type ObjectAlias = {|
  x: number,
  y: number,
|};

export interface Spec extends TurboModule {
  +getAlias: (a: ObjectAlias) => string;
}
```

stores the ObjectAlias in the schema

```
{
  "aliasMap": {
    "ObjectAlias": {
      "type": "ObjectTypeAnnotation",
      "properties": [
        {
          "name": "x",
          "optional": false,
          "typeAnnotation": {
            "type": "NumberTypeAnnotation"
          }
        },
        {
          "name": "y",
          "optional": false,
          "typeAnnotation": {
            "type": "NumberTypeAnnotation"
          }
        },
      ]
    }
  },
  "spec": {
    "methods": [
      {
        "name": "getAlias",
        "optional": false,
        "typeAnnotation": {
          "type": "FunctionTypeAnnotation",
          "returnTypeAnnotation": {
            "type": "StringTypeAnnotation"
          },
          "params": [
            {
              "name": "a",
              "optional": false,
              "typeAnnotation": {
                "type": "TypeAliasTypeAnnotation",
                "name": "ObjectAlias"
              }
            }
          ]
        }
      }
    ]
  }
}
```

and then generates the appropriate structs on the native side and generates [this](https://www.internalfb.com/code/fbsource/[d3ab2f79b377]/xplat/js/react-native-github/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap?lines=818)

```

Reviewed By: hoxyq

Differential Revision: D67806838

fbshipit-source-id: 31f20455c816fdb6b1a86f8f9d0f6f7d0a452754
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot c748b44183 Add command type to CompleteTypeAnnotation (#48475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48475

This will be needed for the compat-check.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67806831

fbshipit-source-id: b660c9557cafbfa2e713e85a0fd2bdc9edabf537
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot 825492b199 Separate component array types and command array types (#48474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48474

The previous definition said that you could put prop types into commands, which definitely isn't allowed.

For example, the schema would have allowed `WithDefault` types.

```
interface NativeCommands {
  +methodInt: (viewRef: React.ElementRef<NativeType>, a: WithDefault<string, 'hi'>) => void;
}
```

This change separates out the things that are allowed in commands from what's allowed in props.

Commands should be very similar to what's allowed in native modules, but it isn't exact enough to be able to merge those.

## Changelog:
[General][Breaking] - Codegen: Separate component array types and command array types

Reviewed By: cipolleschi

Differential Revision: D67806818

fbshipit-source-id: 58e504fe2e2e5efa612e836b18af22a167e7ae2f
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot c91cfd1ec1 Simplify CompleteTypeAnnotation (#48473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48473

This is such a simpler approach lol.

I'll need this later for when I want to pass in arrays or objects of these types to the compat check

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D67806812

fbshipit-source-id: 5cc361815fea901098d2931ba78293693ecc0a35
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot 02c6790842 Make CompleteType contain module and component reserved names (#48477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48477

Over the years of copying and moving and renaming types through CodegenSchema, this type ended up in the Command params, although the Command parser doesn't allow it.

I made this change to a fixture:

{F1974104959}

and got this error

```
 FAIL  xplat/js/react-native-github/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js
  ● RN Codegen Flow Parser › can generate fixture COMMANDS_DEFINED_WITH_ALL_TYPES

    Unsupported param type for method "scrollTo", param "speed". Found UnionTypeAnnotation

      127 |       default:
      128 |         (type: empty);
    > 129 |         throw new Error(
          |               ^
      130 |           `Unsupported param type for method "${name}", param "${paramName}". Found ${type}`,
      131 |         );
      132 |     }
```

Also, a default value for enum an argument of a Command doesn't make sense anyways.

Commands should probably have support for enums and string literal unions, but that's out of scope here.

Still need to add to this vec\concat on www: https://www.internalfb.com/code/www/[ebfa58f888a6064e17879934d447f59bcc2b6951]/flib/intern/sandcastle/react_native/ota_steps/SandcastleOTACompatibilityCheckReportingStep.php?lines=62

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D67806808

fbshipit-source-id: f0f31cca30abbf61f569933ea7c49cf6bfd18a3f
2025-01-06 18:42:37 -08:00
Christoph PurrerandFacebook GitHub Bot c8552519b3 Make SurfaceManager const correct (#48485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48485

[Changelog] [Internal] - Make SurfaceManager const correct

This marks methods which don't modify member props as `const` and others as non `const`.

The current API signature is misleading as `const` methods do alter `mutable` members

Reviewed By: rshest

Differential Revision: D67820439

fbshipit-source-id: 6a991bd7ccbd464c2390e33e0c29b136892d65e0
2025-01-06 14:41:39 -08:00
Luna WeiandFacebook GitHub Bot 8681fc2ab2 Remove optionality of intersectionRect
Summary:
Changelog:
[General][Changed] - Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic.

Reviewed By: rubennorte

Differential Revision: D67868219

fbshipit-source-id: cdc15908c0cf687b13d1424a59ee1e2383811ab3
2025-01-06 13:30:10 -08:00
Christoph PurrerandFacebook GitHub Bot 3744349ed7 Add RuntimeSchedulerKey constant for RuntimeScheduler lookup (#48486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48486

[Changelog] [Internal] - Add RuntimeSchedulerKey constant for RuntimeScheduler lookup

Similar to https://github.com/facebook/react-native/pull/48127 this adds a contant to avoid typos when inserting or retrieving the RuntimeScheduler

Reviewed By: rshest

Differential Revision: D67822346

fbshipit-source-id: af982c6d4b875ffde06aae8e953c4892754a074b
2025-01-06 11:23:04 -08:00
Christoph PurrerandFacebook GitHub Bot c4edfe7323 Remove startEmptySurface from SurfaceManager (#48479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48479

[Changelog] [Internal] - Remove startEmptySurface from SurfaceManager

Most of the logic deleted here does not seem to be needed as the core functionality is in:

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp#L88-L96

And this code path can be reached both via
- `startSurface` (by passing in an empty `moduleModule` OR
- `startEmptySurface`

Reviewed By: shwanton, rubennorte

Differential Revision: D67805569

fbshipit-source-id: e3d06dcaa637996498a6cb52b5c1b98f740326ce
2025-01-06 10:32:16 -08:00
Mykhailo KravchenkoandFacebook GitHub Bot 0154372b93 feat: Manage keyboard shortcuts visibility of TextInput (#47671)
Summary:
**iOS** does offer a native property for **UITextField** called `inputAssistantItem`. According to the [documentation](https://developer.apple.com/documentation/uikit/uitextinputassistantitem), we can hide the **"shortcuts"** by setting the `leadingBarButtonGroups` and `trailingBarButtonGroups` properties to empty arrays.

I propose adding a new property for **TextInput** in **React Native**, which would set these native properties to empty arrays. This new property could be called `disableInputAssistant` or `disableKeyboardShortcuts` and would be a `boolean`.

Developers can manage this behavior (the redo & undo buttons and suggestions pop-up hiding) after applying these native props.

https://github.com/react-native-community/discussions-and-proposals/discussions/830

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.

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

[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.

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

Test Plan:
Manual
1. Open TextInput examples.
2. Scroll down and reach the "Keyboard shortcuts" section.
3. Test each case.

Note: **TextInput** behaves the same as now when the new prop is not passed or is `false`.

https://github.com/user-attachments/assets/5e814516-9e6c-4495-9d46-8175425c4456

Reviewed By: javache

Differential Revision: D67451609

Pulled By: cipolleschi

fbshipit-source-id: 59ba3a5cc1644ed176420f82dc98232d88341c6e
2025-01-06 09:54:29 -08:00
zhongwuzwandFacebook GitHub Bot a3dfc4984d Fabric: Added ScrollEndDragEvent for scrollEndDrag event (#48319)
Summary:
Fixes https://github.com/facebook/react-native/issues/42533 .

## Changelog:

[IOS] [FIXED] -  Fabric: Added ScrollEndDragEvent for scrollEndDrag event

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

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

Reviewed By: javache

Differential Revision: D67517912

Pulled By: cipolleschi

fbshipit-source-id: aa1caebfb690d09a207b3ebce382eceb520009e5
2025-01-06 08:44:23 -08:00
Rubén NorteandFacebook GitHub Bot cb308bdc5e Add benchmark for host component class variants (#48450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48450

Changelog: [internal]

This implements a basic benchmark to compare `ReactFabricHostComponent` and `ReactNativeElement` (legacy and DOM implementations for native component instances).

Reviewed By: rshest

Differential Revision: D66698546

fbshipit-source-id: dd4bde833e5c9eb32c79a52d06f3c360fb012e23
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot ff7c550a86 Run benchmarks in test mode when not specifying verification functions in CI (#48451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48451

Changelog: [internal]

Modifies the execution of benchmarks in CI to run benchmarks in test mode when they don't define a `verify` method.

If a benchmark uses `verify`, the test is meant to make sure that the benchmark doesn't regress in CI. If it doesn't, then running the benchmark on CI doesn't provide much value. In that case, we run a single iteration of each test case just to make sure things don't break over time.

Reviewed By: rshest

Differential Revision: D67637754

fbshipit-source-id: 33b78a9c809386cf2e040314b0427de6a53da3e3
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot 3795f0fb66 Add API to run benchmarks in Fantom (#48452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452

Changelog: [internal]

Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):

```
import {benchmark} from 'react-native/fantom';

benchmark
  .suite('Suite name', {
    // options
  })
  .add(
    'Test name',
    () => {
      // code to benchmark
    },
    {
      beforeAll: () => {},
      beforeEach: () => {},
      afterEach: () => {},
      afterAll: () => {},
    },
  )
  .verify(results => {
    // check results and throw an error if the expectations fail
  });
```

Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).

Reviewed By: rshest

Differential Revision: D66926183

fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot 96205dd78e Add tinybench to run benchmarks in Fantom (#48453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48453

Changelog: [internal]

Adds tinybench 3.1.0 (which has support for sync execution) and defined Flow types for the package.

Reviewed By: dmytrorykun

Differential Revision: D66698545

fbshipit-source-id: faf44add74e5711ac0d50794ce3360eedc45f0a5
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot bc3072eafc Implement native module to measure CPU time (#48454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48454

Changelog: [internal]

This implements a native module for Fantom to provide information about the CPU time used by the current process. This will be used by Fantom as the clock to run benchmarks more accurately.

It provides 2 implementations:
1. One based on `clock_gettime` with `CLOCK_THREAD_CPUTIME_ID` that's available on Linux. This provides the CPU time for the current process with decent precision (tens of nanoseconds).
2. A fallback implementation that uses a monotonic clock (not actually CPU time).

We can add a MacOS equivalent in a following diff.

Reviewed By: rshest

Differential Revision: D67596312

fbshipit-source-id: dd712c0171aa998ddbb6fed9187b3c467cd5417d
2025-01-06 07:10:28 -08:00
Alex HuntandFacebook GitHub Bot eee2866508 Fix InspectorFlags debug default, clean up legacy Buck opt in (#48504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48504

Following D67857739, fixes accidental change where the removed `ReactNativeFeatureFlags` flag read was not replaced with `true`. This temporarily disabled Fusebox on `main`, where not configured via other build flags.

{F1974195736}

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D67857739

fbshipit-source-id: 2a6fb2e6733035245e7ad959c7d3c650a9fde994
2025-01-06 07:02:22 -08:00
Mateo GuzmánandFacebook GitHub Bot b477cfa0ba Add AppStateModule Android unit tests (#48492)
Summary:
Currently the `AppStateModule` doesn't have any unit tests in the Android implementation. This should make it safer for future changes or refactors.

## Changelog:

[INTERNAL] - Add `AppStateModule` Android unit tests

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: cipolleschi

Differential Revision: D67857498

Pulled By: cortinico

fbshipit-source-id: f90ced1cf02ac12a3438495b425ce7931decf19a
2025-01-06 06:49:27 -08:00
Kræn HansenandFacebook GitHub Bot 7a85b91125 Fix ruby unit tests (#48498)
Summary:
As a prerequisite of enabling running unit tests on CI again, this PR suggests changes needed to the Ruby unit tests.

I've added comments on the code below, justifying changes where I deem a justification might be needed.

For use internally, I suggest accessing the folly_config and boost_config directly via the `Helpers` class instead of the `get_folly_config` and `get_boost_config` because these global functions are defined in `react_native_pods` which would be result in circular requires. An alternative would be to move these global functions to a separate file.

## Changelog:

[INTERNAL] [FIXED] - Fix Ruby unit tests.

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

Test Plan:
- `cd packages/react-native`
- `./scripts/run_ruby_tests.sh`

Reviewed By: rshest

Differential Revision: D67852809

Pulled By: cipolleschi

fbshipit-source-id: 54d8bd708a9e3fd9aef3569ac89ec6ddcd244437
2025-01-06 02:31:42 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 5ce07386e1 Convert FabricEventDispatcher (#48491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48491

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67825655

fbshipit-source-id: e94431ae6978332c0566ab0a500e1a85f1ad9a7d
2025-01-06 01:46:46 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot a9d86be3a4 Migrate EventDispatcher interface to Kotlin (#48445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48445

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67760373

fbshipit-source-id: 6360ed5b488ec47bdd2e4d0357d0d06e8e42f614
2025-01-06 01:46:46 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot d470f39d8a Migrate RCTEventEmitter to Kotlin (#48467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48467

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793304

fbshipit-source-id: 39bbdebf8434ad57bab3e1d309915a8132033f5b
2025-01-06 01:46:46 -08:00
Alan LeeandFacebook GitHub Bot d5f33c19cb com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager.java (#47561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47561

Convert Java to Kotlin

Changelog:

[Android][Breaking] changed visibility of FrescoBasedReactTextInlineImageViewManager to internal

Reviewed By: javache

Differential Revision: D65606954

fbshipit-source-id: bfdb5624a104029c8d667ddb9262c862ab846a61
2025-01-06 01:26:14 -08:00
woxtuandFacebook GitHub Bot 088fcb1e5d Resolve run script build phase warnings (#48495)
Summary:
This PR updates podspecs and resolve the following Xcode warnings:

```
Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```

```
Run script build phase '[CP-User] [RN]Check FBReactNativeSpec' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```

Enabling the `always_out_of_date` flag will uncheck "Based on dependency analysis" in a script phase.

## Changelog:

[INTERNAL] [FIXED] - Resolve run script build phase warnings

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

Test Plan:
1. Run `bundle exec pod install` in the RNTester folder
2. Open the Xcode workspace
3. Check "Based on dependency analysis" is unchecked in the '[CP-User] [RN]Check rncore' script phase and the '[CP-User] [RN]Check FBReactNativeSpec' script phase

Reviewed By: cipolleschi

Differential Revision: D67835376

Pulled By: rshest

fbshipit-source-id: 11eec80d8172bc0129bfdcf7c79b5edf40427fab
2025-01-06 00:46:51 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot e99b47ce48 Use proper mockito/kotlin for RootViewTest and JSPointerDispatcherTest (#48490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48490

## Changelog:
[Internal] -
This makes the `RootViewTest` and `JSPointerDispatcher` tests to use mockito-kotlin instead of the Java Mockito, which is the legacy of the conversion of the corresponding tests from Java.

Which:
* is the right thing to do, as we have more Kotlin-idiomatic tests
* helps with some Kotlin conversion with classes under test down the line, as Kotlin Mockito handles things like nullability etc properly

Reviewed By: javache

Differential Revision: D67824679

fbshipit-source-id: 055e9c7c4a33164ce6f4b9a5c47f16051d2a132f
2025-01-05 08:38:43 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot b867c01fa6 Convert RCTModernEventEmitter (#48466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48466

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793108

fbshipit-source-id: 1730f4519f740372bde392236feae23ad4a18f0a
2025-01-04 12:44:48 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 4ad6a94c60 Kotlinify EventEmitterWrapper (#48489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48489

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67823110

fbshipit-source-id: 840d15d891066b3fc8e6fa8cd2e856ee51e72ce3
2025-01-04 12:24:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 23780f8cb7 Use the app artifact in E2E tests (#48469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48469

This change downloads the generated artifact and uses it in the E2E tests

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67800932

fbshipit-source-id: 6f3c8bbc42ad95cabab85dafff00e233a936d136
2025-01-04 09:02:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9bf7aff882 Fix code to record and upload videos (#48444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48444

While debugging why the Debug variant was failing, I realised that the code to store video artifacts and the code to record the videos were not working properly.

This diff fixes that

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67760436

fbshipit-source-id: ee4b034f7c54cbf0b46c0afc16c31389b11353fe
2025-01-04 09:02:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3d2e5447be Store the RNTester artifacts to speed-up E2E (#48442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48442

This change stores the RNTester `.app` in an artifact so that E2E tests can reuse it.

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67760380

fbshipit-source-id: 8be0bbbadf4240dce1bcf5b44dadb41d49ed4c06
2025-01-04 09:02:17 -08:00
Christoph PurrerandFacebook GitHub Bot 6abcca8374 Stop all surfaces on SurfaceManager destruction (#48481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48481

[Changelog] [Internal] - Stop all surfaces on SurfaceManager destruction

Reviewed By: zeyap

Differential Revision: D67809574

fbshipit-source-id: 150ddd091e6822c3a40f8ea413aa65da50445ede
2025-01-03 19:58:06 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot a6e6f5e869 ReactEventEmitter -> Kotlin (#48464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48464

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67791375

fbshipit-source-id: eca1f999b43c405ce48aa5fa3518ec08363f5836
2025-01-03 16:24:09 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 076920647e Migrate PointerEventHelper (#48459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48459

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67762029

fbshipit-source-id: c29010d20aa7a4cbe2d92aeacc1851eec3c7701e
2025-01-03 16:24:09 -08:00
Mateo GuzmánandFacebook GitHub Bot 33aebc34bf Fix RNTester dark mode Android Text examples (#48380)
Summary:
The Android `Text` examples in dark mode are not readable. This PR addresses that by replacing the `Text` usages with `RNTesterText`.

## Changelog:

[INTERNAL] [FIXED] - Fixing dark mode Android `Text` examples

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

Test Plan:
Some screenshots after the fixes.

| Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981250](https://github.com/user-attachments/assets/d9c27ac7-5024-478b-a47c-3c057801eea1) | ![Screenshot_1734981168](https://github.com/user-attachments/assets/92c6e11a-ac30-46f5-8878-3659d9e40f9a) | ![Screenshot_1734981146](https://github.com/user-attachments/assets/8bfba649-e036-473a-a622-2289daf67951) | ![Screenshot_1734981127](https://github.com/user-attachments/assets/9b1e2a68-8b34-463b-8637-f2b5682733d2) | ![Screenshot_1734981115](https://github.com/user-attachments/assets/af0c85c5-6216-4af1-ae92-b818213f3719) |
| Image 6 | Image 7 | Image 8 | Image 9 | Image 10 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981101](https://github.com/user-attachments/assets/91a07f43-8b9e-4462-8906-5ee1f68741a5) | ![Screenshot_1734981080](https://github.com/user-attachments/assets/3b8ffe9a-53b9-4863-b332-d3055740aa18) | ![Screenshot_1734980904](https://github.com/user-attachments/assets/c5aa8bb6-f1f6-4693-bc31-74557946f009) | ![Screenshot_1734981057](https://github.com/user-attachments/assets/10c8c785-58b8-401a-ad18-7bdcd91cd28d) | ![Screenshot_1734980876](https://github.com/user-attachments/assets/d9ed3b35-01fe-4311-adf3-7a6e4e13aeab) |

Reviewed By: javache

Differential Revision: D67657571

Pulled By: philIip

fbshipit-source-id: da93d072f4bb32017961ee70c76f6add8a874ae1
2025-01-03 15:44:16 -08:00
Sam ZhouandFacebook GitHub Bot b030418649 Deploy 0.258.0 to xplat (#48482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48482

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67810693

fbshipit-source-id: 82e858d4d5ef3c9896ea3bd58a4f4364dce5bdd0
2025-01-03 15:37:43 -08:00
Blake FriedmanandFacebook GitHub Bot af000b7aaa Remove forward declarations (#48461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48461

Remove forward class or struct declarations.

Changelog: [Internal]

```
$ sl log --stat tools/api/ReactNativeCPP.api
 xplat/js/react-native-github/tools/api/ReactNativeCPP.api |  637
 1 files changed, 96 insertions(+), 541 deletions(-)
```

Reviewed By: cipolleschi

Differential Revision: D67763260

fbshipit-source-id: 396314be9cb6153f6cff1348aa596d4a5b61fbe7
2025-01-03 13:18:48 -08:00
Rubén NorteandFacebook GitHub Bot 1120f88401 Update test for DOM APIs to show current vs. desired behavior for getRootNode (#48439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48439

Changelog: [internal]

This is in preparation for implementing `getRootNode` and `ownerDocument` properly in the DOM APIs.

Reviewed By: rshest

Differential Revision: D67137215

fbshipit-source-id: bda6b1f843f219e03df533797fa9e4adbaa54c60
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 4d2649bac8 Extend tests for ReadOnlyNode.compareDocumentPosition (#48438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48438

Changelog: [internal]

Just adding tests to make sure we cover the cases where the root is unmounted.

Reviewed By: rshest

Differential Revision: D67752010

fbshipit-source-id: 3cc17cd25878013a26dc407640be00e8dc251eea
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot a1b13f6a55 Extract ensureInstance utility from tests (#48434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48434

Changelog: [internal]

We were starting to repeat this logic too much in tests, so extracting so we can reuse it.

Reviewed By: rshest

Differential Revision: D67520443

fbshipit-source-id: 64e4e5b35f83dc45e41bb0efae9685aeaf0cf2e2
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 35d0d7c97b Small refactor to lazy load RendererProxy (#48437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48437

Changelog: [internal]

Just a small refactor to slightly improve readability (and potentially performance).

Reviewed By: christophpurrer

Differential Revision: D67520444

fbshipit-source-id: 9f53a432c4f4363b42083fb52c3beedb8016ccd4
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 6c383ea7b8 Set more sensible defaults for viewport width and height (#48436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48436

Changelog: [internal]

Changing the defaults to use something that resembles a real device (in this case the iPhone 14 which is a very common device).

Reviewed By: christophpurrer

Differential Revision: D67759914

fbshipit-source-id: 87fe3be19196ece62c412e5076c601be746a4f22
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot bac56bf828 Allow configuring viewport width, height and device pixel ratio (#48433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48433

Changelog: [internal]

Allows customizing the root dimensions.

Reviewed By: christophpurrer

Differential Revision: D67693031

fbshipit-source-id: ddbe426a6492512dc2eb7554f26b63d14d5ce75d
2025-01-03 12:57:16 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 13bad5268b Migrate EventDispatcherListener/Provider interfaces to Kotlin (#48463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48463

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D67791241

fbshipit-source-id: 99d937e08a1e4ee1a5bd3f8eda71bc814ddbfffe
2025-01-03 12:38:17 -08:00
Blake FriedmanandFacebook GitHub Bot 6d85c7c476 Avoid adding stdlib (#48468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48468

Clang will add this code by default at the preprocessor phase. I'd observed a difference in output on sandcastle where it didn't include `stdlib` by default.

This stops `stdlib` being included locally.  **It isn't important wrt tracking user API changes.**

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67793848

fbshipit-source-id: 0c88aee05a78e2410b308fe10c48db2552b8a148
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 9542b1af55 Starlark needs hg instead of sl (#48460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48460

We can only specify `hg` as a dependency, so have to use it in our shell script.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67718641

fbshipit-source-id: 557d980a9b6c3dbcd2621481d39a24b47075a3f9
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 5f54386a66 Add a BUCK target (#48457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48457

Adding CI support will require executing through buck.  Sandboxing means the package has to be well-formed to work, so this cleans up some earlier mess.

- yarn workspace
- check-api.sh to configure the environment correctly when running form sandcastle
- explicity dependencies in our package.json

This is the first step

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67726588

fbshipit-source-id: 7f8605695e323ef332550820b23b85d3af5f4d69
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 4f30b94a0d Add snapshot of ObjC/PP API (#48456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48456

This is the current output of running the api snapshotting tool.  I've also shown some test examples that show how trivial changes affect the API file.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67713415

fbshipit-source-id: f68c7e15b0d1e26878e39f22f49e64cdd7340df2
2025-01-03 10:30:00 -08:00
Alex HuntandFacebook GitHub Bot 546d21c796 Remove fuseboxEnabledDebug flag (#48435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48435

Cleans up the runtime `fuseboxEnabledDebug` feature flag. The modern CDP backend has been enabled by default in open source since 0.76.

- Updates `ReactInstanceIntegrationTest` to preserve testing under both backend modes (legacy Hermes debugger vs Fusebox).
- Preserves ability to override `ReactNativeFeatureFlags` in tests via `InspectorFlagOverridesGuard` — we anticipate that future CDP features will continue to read from the `ReactNativeFeatureFlags` system (`fuseboxEnabled` was/is a special case).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D67759600

fbshipit-source-id: 5878dd879bae435e59c48823a9b9faf85561b028
2025-01-03 05:56:04 -08:00
Rubén NorteandFacebook GitHub Bot 39757da650 Add environment variable to enable C++ debugging (#48441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48441

Changelog: [internal]

Adds a new environment variable (`FANTOM_ENABLE_CPP_DEBUGGING`) to enable C++ debugging via `fdb`.

Reviewed By: RSNara

Differential Revision: D67683048

fbshipit-source-id: d074a1a063c5da6b048d5456036e83cc14245eaf
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot d28300ad9d Add environment variables to print Fantom output and buck commands (#48440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48440

Changelog: [internal]

Modifies the Fantom runner to read 2 new environment variables to help with debugging:
- `FANTOM_PRINT_OUTPUT`: prints the output of the CLI to the output of the test.
- `FANTOM_LOG_COMMANDS`: logs the buck commands executed by the runner, so they can be re-run outside the runner for debugging, etc.

Reviewed By: rshest

Differential Revision: D67682750

fbshipit-source-id: aff48c4f47078db1be53e0ee105089fbc921768f
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 42b911b5cb Implement streaming mode for console logs in tests (#48372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48372

Changelog: [internal]

Implements log streaming in Fantom tests. This allows us to see the logs emitted from tests as they're logged, so we don't need to wait until the test completes to flush all of them at the same time.

Reviewed By: rshest

Differential Revision: D67600609

fbshipit-source-id: efb3125e13fd9aec1800a5f1ddaf0d93dcb29218
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot f1ba4ef131 Add async flavors for runCommand and runBuck2 utilities (#48371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48371

Changelog: [internal]

Adds a new favor for `runCommand` and `runBuck2` that works asynchronously and support parsing their output in real time.

Reviewed By: javache

Differential Revision: D67600614

fbshipit-source-id: 99dd2ce9bff11036829f214bf19208b10c9c1b25
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 8f096ab4f8 Refactor utility to run buck2 commands as a method to run arbitrary commands (#48370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48370

Changelog: [internal]

Small refactor in preparation for async commands with streaming.

Reviewed By: javache

Differential Revision: D67600611

fbshipit-source-id: 11fe6b6ccd8849f904338ccc9454361ad5923863
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 726a72328e Use structured output for Fantom logs and test results (#48369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48369

Changelog: [internal]

This improves logs in Fantom by preserving the original log levels. It's also in preparation for adding support for log streaming in tests.

Reviewed By: javache

Differential Revision: D67600616

fbshipit-source-id: 1c4997d5e836a78327f33092527543fe025c90c6
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 5f09c36942 Remove unnecessary filter for AppRegistry logs (#48367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48367

Changelog: [internal]

We removed the calls to `AppRegistry` in Fantom, so this filter isn't necessary anymore (just a no-op).

Reviewed By: rshest

Differential Revision: D67600610

fbshipit-source-id: d985cc5f0ee1728ac72c567bc091a6c2877f2659
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot fb3b87c2b5 Remove existing logs and warnings from tests (#48391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48391

Changelog: [internal]

When we enabled log streaming in Fantom, we saw a lot of logs that we were previously not forwarding (console.error, console.warn) in existing tests.

This removes all the warnings and errors from those tests.

Reviewed By: rshest

Differential Revision: D67602299

fbshipit-source-id: 111f373eafd8707f2746ff727894f1fa4283b83f
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot d7d9e1c090 Use codegen for Fantom native module (#48432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48432

Changelog: [internal]

This moves the native module definition for Fantom to the `react-native` package so we can migrate the module to use the codegen.

Also implements the migration.

Reviewed By: christophpurrer

Differential Revision: D67759729

fbshipit-source-id: d79d078908b05fc4b6f5f26f0144ab7e3485cb83
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot c0f3e64070 Follow naming convention for NativeFantom module (#48368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48368

Changelog: [internal]

Just a minor rename to align with the existing convention.

Reviewed By: javache

Differential Revision: D67549203

fbshipit-source-id: faa9e34cdce7c59e2c6b3f7e697c90df103699d0
2025-01-03 04:57:43 -08:00
Alex HuntandFacebook GitHub Bot 3e0fc8899b Remove hermes-inspector-msggen (#48465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48465

Removes the `packages/hermes-inspector-msggen` workspace. Since https://github.com/facebook/react-native/pull/39300, this is no longer referenced in React Native, and is now part of the Hermes repo.

Changelog: [Internal]

Reviewed By: cortinico, hoxyq

Differential Revision: D67791612

fbshipit-source-id: 73da135b264d8df632fefe87cc4e3101075ae98c
2025-01-03 04:29:09 -08:00
Rubén NorteandFacebook GitHub Bot f20486cc77 Improve error messages in expect().toThrow(message) (#48430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48430

Changelog: [internal]

This expectation currently prints a very generic message that is hard to parse, so this change improves it a bit to account for more cases. E.g.:
* Before: "Expected <function> to throw"
* After: "Expected <function> to throw with message 'foo', but threw with message 'bar'"

Reviewed By: rshest

Differential Revision: D67738146

fbshipit-source-id: 690f15971cec0e8a7b038eeacc9302c9f3edc323
2025-01-03 02:16:38 -08:00
Mateo GuzmánandFacebook GitHub Bot 7e029b0dcf Modal: FLAG_SECURE not respected in modal dialog (#48317)
Summary:
Fixes https://github.com/facebook/react-native/issues/38537

Setting `WindowManager.LayoutParams.FLAG_SECURE` in the window flags is not respected in the Android Modal component, causing security issues with screenshots or screen recordings as the content in the modal is visible. The flag works correctly in the rest of the components, see the videos in the linked issue.

This PR addresses that by checking whether this flag is set in the current activity and then setting it in the dialog when creating a new one in the `ReactModalHostView`.

## Changelog:

[ANDROID][FIXED] - `FLAG_SECURE` not respected in Modal dialog

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

Test Plan:
To test this, you need a physical device as with the emulator the flags don't seem to be respected either.

The easiest way to test this in code is by setting the flags in the main activity. You can do so by adding this code snippet:

<details>
<summary>onCreate in RNTesterApplication.kt</summary>

```kt
override fun onCreate() {
    ReactFontManager.getInstance().addCustomFont(this, "Rubik", R.font.rubik)
    super.onCreate()

    ...

    registerActivityLifecycleCallbacks(
            object : ActivityLifecycleCallbacks {
              override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
                activity.window.setFlags(
                        WindowManager.LayoutParams.FLAG_SECURE,
                        WindowManager.LayoutParams.FLAG_SECURE
                )
              }

              override fun onActivityStarted(activity: Activity) {}
              override fun onActivityResumed(activity: Activity) {}
              override fun onActivityPaused(activity: Activity) {}
              override fun onActivityStopped(activity: Activity) {}
              override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
              override fun onActivityDestroyed(activity: Activity) {}
            }
    )
  }
```
</details>

Then, you can render a simple modal component:

<details>
<summary>RNTesterPlayground.js</summary>

```tsx
function Playground() {
  const [modalVisible, setModalVisible] = React.useState(false);

  return (
    <>
      <Modal
        visible={modalVisible}
        testID="playground-modal">
        <Text testID="inner-text-test-id">Hello World!</Text>
        <Button title="Close Modal" onPress={() => setModalVisible(false)} />
      </Modal>

      <Button
        title="Open Modal"
        onPress={() => {
          setModalVisible(true);
        }}
      />
    </>
  );
}
```
</details>

You can then try to record the screen or take screenshots. You will notice that before opening the modal, you won't be able to see anything in the recording, but when opening the modal, the content is visible.

I've tried my best to record the before and after the fix, but as the screen recordings will mostly show a black screen, you have to forward a bit in both videos to see the difference.

<details>
<summary>Before the fix (notice the blank screen and then content visible)</summary>

https://github.com/user-attachments/assets/fc5bbe26-d238-425b-90d3-0e43c89ccaac

</details>

<details>
<summary>After the fix (notice all the screen recording is a black screen)</summary>

https://github.com/user-attachments/assets/0d6991a0-974b-45c5-8f4a-bf4718c284e6

</details>

Reviewed By: cipolleschi

Differential Revision: D67368741

Pulled By: alanleedev

fbshipit-source-id: 9f31063a9208a6df257da424bf3096bf15a5ddcb
2025-01-02 20:40:09 -08:00
Blake FriedmanandFacebook GitHub Bot 3a7aed6ed8 Follow-ups to issues earlier in the stack (#48455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48455

This is a followup to earlier issues in the stack.

Two fixes here:
1. Make the paths more consistent esp. from the config, so everything is working out of react-native-github.
2. Just declare `__cpluscplus`, as we don't seem to care about the value in our code.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67716883

fbshipit-source-id: 359c33210d6b66bb0d75724a177587a7d5f837b2
2025-01-02 15:58:04 -08:00
Blake FriedmanandFacebook GitHub Bot 27ef13174c Add simple Objective-C/CPP api tracking (#48449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48449

This is the simplest possible way to track changes to our public CPP / Objective-C API.

This is going to be really noisy, and there's a good chance it's not complete.

The tooling is also incomplete, as it just runs the preprocessor (then does some funky work to undo noise generated by the preprocessor).  If we want more control over this, we're going to have to jump into the guts of each of our build targets (and tooling) OR more clearer layout the repo to separate public and private header files to our users.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67713408

fbshipit-source-id: 9578179bbc4d9be2f07d040b01f8a3ef105d7034
2025-01-02 15:58:04 -08:00
Joe VilchesandFacebook GitHub Bot 1b88c5b429 Fix case when dashed/dotted borders do not work with overflow: hidden (#48414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48414

Was looking into https://github.com/facebook/react-native/issues/48078 which was brought to my attention due to my recent refactorings of iOS Views, especially around how overflow: hidden works. This bug was not brought on by my changes but seems to be a lingering Fabric bug (iirc this bool was not changed when I refactored things)

Anyway, dotted/dashed borders did not work with overflow: hidden. The reason why is we use core animation borders in this case which is incorrect as CA cannot do these types of borders. So I added a check to make sure that the borders are solid as well if we want to use CA to draw them.

Changelog: [iOS] [Fixed] - Dashed & dotted borders now work with overflow: hidden

Reviewed By: mdvacca

Differential Revision: D67720492

fbshipit-source-id: 5aecc15f2d7cbd71952d78d6972f6fc6b7a93ea8
2025-01-02 14:03:26 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot febf6f4a9c Convert TouchesHelper.java (#48447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48447

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67760245

fbshipit-source-id: 5054408438de7cbdfaa7c98d9f5935f03ee93760
2025-01-02 13:59:54 -08:00
Eli WhiteandFacebook GitHub Bot 9e0a7e3263 Converge component's bespoke StringEnumTypeAnnotation into StringLiteralUnionTypeAnnotation (#48343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48343

components store unions as 'StringEnumTypeAnnotation' even though it isn't actually a union, it's a literal.

Native Modules store these as 'StringLiteralTypeAnnotation' so this converges those and reuses the same types.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67427656

fbshipit-source-id: e39028114285588584596012d07db40c117b4b94
2025-01-02 13:20:02 -08:00
Eli WhiteandFacebook GitHub Bot b691122afc Share ArrayTypeAnnotation between components and modules (#48318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48318

These structures were the same, but the component side didn't use generics and just had duplicates. Making a base one to be shared.

I need to follow up to this and constrain the types that components allow.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67371894

fbshipit-source-id: bb1a30fcd0efe6cc567b88bc6f11e7b385bd7c41
2025-01-02 13:20:02 -08:00
Alex HuntandFacebook GitHub Bot 697e9462d5 Convert assets-registry to Flow comment syntax (#48458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48458

NOTE: This change is made once and is not guaranteed.

**Motivation**: Requiring Flow parsing for `react-native` and its dependencies in user space can involve friction. For the case of `react-native/assets-registry` → `react-native-web`, I believe we should do the pragmatic thing to relax this requirement.

- This is a convenience stopgap until https://github.com/facebook/react-native/pull/39542 can be stabilised.
- This package is tiny and infrequently modified — I believe it's pragmatic/safe to do a one-time conversion, with the above notice and no changelog (i.e. "experimental" for now).

Resolves https://github.com/facebook/react-native/issues/48349.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D67764460

fbshipit-source-id: 7687fd79c6dea73c234a46e475c1cc745225830b
2025-01-02 12:23:14 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 5ef9e1fffe TouchEventCoalescingKeyHelper -> Kotlin (#48448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48448

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759862

fbshipit-source-id: 7a8e133962cdc43aed0bae38a89d37fb7e6031a6
2025-01-02 11:18:07 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot e8347b9854 Migrate EventCategoryDef to Kotlin (#48446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48446

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759756

fbshipit-source-id: bc922b3062d8790ada3f9d5ee71593a08046752b
2025-01-02 11:18:07 -08:00
Alex HuntandFacebook GitHub Bot 79c7c58656 Document monorepo build setup (#48420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48420

Adds a long overdue README for our newer monorepo build setup.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67740763

fbshipit-source-id: 0c7686d75272acf74c0af5a1c4c08336fb45e2a2
2025-01-02 10:33:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 2c338a719e Build Release version for RNTester to speed-up E2E (#48443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48443

This change makes sure we build the Release variant of RNTester so we can store the generated app as an artifact and forward it to the E2E tests.

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: cortinico

Differential Revision: D67760372

fbshipit-source-id: 02cc9ec64d5a7b4fa2ad05bca6aa91a69b2b5907
2025-01-02 09:52:22 -08:00
Alex HuntandFacebook GitHub Bot 430f7d8b72 Update debugger-frontend from 486803f...7727db8 (#48328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48328

NOTE: This update is significant, as it includes the frontend repo sync with `chromium/6613` (https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/144).

Changelog: [Internal] - Update `react-native/debugger-frontend` from 486803f...7727db8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/486803f6bf272e0629297265dee8048a2f1269dd...7727db85ac767cf41cce3e9ee54d27e97b2637f9).

Reviewed By: hoxyq

Differential Revision: D67402065

fbshipit-source-id: f32d328c5319ed25d8942e813db152921ca22ec8
2025-01-02 06:01:42 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 93117ea1b8 Move E2E scripts to js (#48419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48419

This change moves the E2E scripts for iOS to a JS script.
This should make it much easier to modify the code in case we need to change it.

## Changelog
[Internal] - Move e2e script from bash to JS

Reviewed By: cortinico

Differential Revision: D67737950

fbshipit-source-id: d0b0411c8a4d688c10e460e70b11dbfc83aaa135
2024-12-31 09:21:18 -08:00
zhongwuzwandFacebook GitHub Bot 09995fc874 Change Image load event size info from logical size to pixel (#45198)
Summary:
Fixes https://github.com/facebook/react-native/issues/45188. This fixes old arch. fabric fix may wait until https://github.com/facebook/react-native/issues/44918.

## Changelog:

[IOS] [BREAKING] - Change Image load event size info from logical size to pixel

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

Test Plan:
Android/iOS return the same size .
```
    <Image
      style={{width: '100%', height: '100%'}}
      source={{
        uri: 'https://image-placeholder.com/images/actual-size/75x75.png',
      }}
      resizeMode={'cover'}
      onLoad={e => {
        console.log(
          `RNImage:${Platform.OS} load JPEG image from url`,
          e.nativeEvent,
        );
      }}
    />
```

Reviewed By: cortinico

Differential Revision: D67735347

Pulled By: cipolleschi

fbshipit-source-id: 72422d8c15e4cc6313215bf6d9a2c1e6b5a235ad
2024-12-31 09:03:54 -08:00
Nicola CortiandFacebook GitHub Bot b10491a3c4 Fix RN-Tester JSC instacrashing (#48418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48418

RNTester JSC Debug is currently insta-crashing on the 0.77 release branch due to:

```
12-31 10:59:36.388 15165 15204 E ReactNativeJS: React Native version mismatch.
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: JavaScript version: 0.77.0-rc.5
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Native version: 1000.0.0-bb9d7ad9a
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with `watchman watch-del-all && npx react-native start --reset-cache`.
```

This is causing a `console.error` that is resulting in the crash as one of the frame in the stack doesn't have the line/column number information. Calling `.putDouble(string,double)` is forcing a conversion from `null` -> `double` which is result in the crash.

This is happening only on CI because the `set-rn-version` step on GitHub Action is executed with `--dry-run` (as this is not a release run) so the version of React Native is set back to `1000.0.0-<SHA>`. Locally this doesn't happen because the React Native version is read from the local file which is never manipulated by the `set-rn-version`.

Changelog:

[ANDROID] [FIXED] - Fix JSC Debug instacrashing

Reviewed By: cipolleschi

Differential Revision: D67735962

fbshipit-source-id: 363218385277374d33b8313cacd14159b2f17106
2024-12-31 08:24:38 -08:00
TobiasHandFacebook GitHub Bot 920867d949 Fix useWindowDimensions not updating because of delayed applicationState update on iOS devices (#46353)
Summary:
### Issue
When a real device is oriented into landscape and the user locks the screen during said orientation incase the user rotates back to previous orientation and unlocks the screen `useWindowDimensions` will not get the correctly updated values. This is due to `applicationState` being equal to UIApplicationStateInactive still when `interfaceFrameDidChange` gets called.

### Fix
`didUpdateDimensions` on iOS. Now correctly emits the dimension values after the device has been oriented and device has been locked. By adding `UIDeviceOrientationDidChangeNotification` to `NSNotificationCenter`

## Changelog:
[IOS] [FIXED] - Emit didUpdateDimensions correctly

```
  // RCTDeviceInfo.mm

  // Adds the interfaceFrameDidChange to UIDeviceOrientationDidChangeNotification
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:selector(interfaceFrameDidChange)
                                               name:UIDeviceOrientationDidChangeNotification
                                             object:nil];
```

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

Test Plan:
### ***Note***: This doesn't seem to be replicable on simulators. It only happens on real iOS devices.

### Before change:

Rotate Device > Lock Screen > Rotate back to portrait > Unlock phone
![IMG_6089](https://github.com/user-attachments/assets/5d928613-2742-45fb-97fa-d87eaf64ea97)

### After change:

Same steps as above, now emits correct values
![IMG_6091](https://github.com/user-attachments/assets/eb46ed22-c3c5-4e77-8069-4a604a21947e)

Reviewed By: cortinico

Differential Revision: D67735523

Pulled By: cipolleschi

fbshipit-source-id: 146e5d62d55eeef0f6b17f962ca84ab418a7b7f0
2024-12-31 07:49:36 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 081be01a5d feat: implement ReactNativeFactory (#46298)
Summary:
This PR implements ReactNativeFactory to encapsulate further the logic of creating an instance of React Native for iOS.

This will remove the strong coupling on the RCTAppDelegate and allow us to support Scene Delegate in the future.

The goal is to have a following API:

```objc
self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];

UIView *rootView = [self.reactNativeFactory.rootViewFactory viewWithModuleName:self.moduleName
                                                               initialProperties:self.initialProps
                                                                   launchOptions:launchOptions];

// Standard iOS stuff here
```

## Changelog:

[IOS] [ADDED] - implement ReactNativeFactory

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

Test Plan: Test out all the methods of AppDelegate

Reviewed By: huntie

Differential Revision: D67451403

Pulled By: cipolleschi

fbshipit-source-id: 9e73cd996ffc27ca1e3e058b45fc899b1637bdba
2024-12-31 07:45:25 -08:00
timbocoleandFacebook GitHub Bot 8b1f049879 fix: Prioritise local cpp (use default as fallback) (#48340)
Summary:
https://github.com/facebook/react-native/pull/47379 removed local cpp sources from the sources being built with the app. This resulted in a local `android/app/src/main/jni/OnLoad.cpp` file being ignored at build time. I have therefore added logic to the cmake file to prioritise local `cpp` files and fallback to `${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp` if none exist.

This resolves https://github.com/facebook/react-native/issues/48298

## Changelog:
[ANDROID] [FIXED] - Prioritise local OnLoad.cpp, falling back to default-app-setup

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

Test Plan:
- Followed the https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules guide (which was broken > 0.76.1)
- Applied the patch to the reproduction repository linked to https://github.com/facebook/react-native/issues/47352 to ensure no regression

Reviewed By: cipolleschi

Differential Revision: D67736012

Pulled By: cortinico

fbshipit-source-id: 87f6b8edf1613682585a94e1d1b3e6b4b792e4f5
2024-12-31 05:30:26 -08:00
Peter AbbondanzoandFacebook GitHub Bot a3c8e21370 Enable vector drawable support by default (#48347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48347

Vector drawable support was added behind a feature flag in https://github.com/facebook/react-native/pull/45354 and is ready to release more widely. This change is effectively the same as removing the feature flag but allows our holdout to continue until mid-January.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67482531

fbshipit-source-id: 1733c4748f79fd4df72f531a24efcbd8a7822611
2024-12-30 14:32:55 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 6dd4195d2d Avoid calling fmod twice in roundLayoutResultsToPixelGrid (#48404)
Summary:
X-link: https://github.com/facebook/litho/pull/1036

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

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

## Changelog:
[Internal] -

This popped up when profiling some heavy UI performance, calling `fmod` operation in Yoga's `roundLayoutResultsToPixelGrid` in `PixelGrid.cpp` can be expensive, furthermore it turns out that some of the calls were redundant.

This replaces the duplicate calls to fmod with an equivalent single round operation, which for e.g. clang compiler on Windows brings the code in question from ~50 instructions (including 4 call instructions to the fmod function) down to ~30 instructions (without any external calls), and the layout operation being **~1% more efficient** for the particular benchmark I was looking into.

Reviewed By: christophpurrer

Differential Revision: D67689065

fbshipit-source-id: 2a074a1cb81bd7f7a3c414050b9ddda2ba90180f
2024-12-30 12:38:48 -08:00
Rob HoganandFacebook GitHub Bot 7e665d4c70 Add Changelog for 0.77.0-rc.5 (#48413)
Summary:
Changelog for 0.77.0-rc.5

## Changelog:

[Internal] Changelog for 0.77.0-rc.5

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67718909

Pulled By: robhogan

fbshipit-source-id: df2407ec7911e01f91a340c14517f8af2dc63a21
2024-12-30 11:03:15 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot dd1cfb70e9 Improve typing of BackHandler (#48411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48411

## Changelog:
[Internal] -

Floow-up to https://github.com/facebook/react-native/pull/48388, based on the diff discussion (D67648077).

Adds a bit better typing to `BackHandler.js`.

Reviewed By: blakef

Differential Revision: D67713236

fbshipit-source-id: 95435898d8ea87f6ae32a6db859d6641e1264972
2024-12-30 06:17:39 -08:00
Maddie LordandFacebook GitHub Bot 85bdd75828 Add "jsEngine: hermes" to JS runtime Error prototype (#48401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48401

This change adds a flag to JS Error's prototype to specify the jsEngine.

Reviewed By: fkgozali

Differential Revision: D67665484

fbshipit-source-id: 64b7b4bd986bcbd45d58e70c1a16de6752b05ccd
2024-12-27 16:59:49 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9ceabd341d Fix iOS E2E Tests (#48400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48400

A couple of days ago, the iOS CI started failing for the E2E tests on main.
This is because We were not using the hermes artifacts we were preconfiguring.

In fact, this is the log of the `test_e2e_ios_rntester`, which is not using the prebuilt.
{F1974129000}

For comparison, this is the `test_ios_rntester`, which is using the prebuilt
{F1974129001}

While investigating why this was happening, I realized that we were not testing the old architecture anymore, because we forget to update the script after the release of the New Architecture.

This change should fix both.

## Changelog:
[Internal] - Fix E2E tests for iOS and test the Old Arch

Reviewed By: robhogan

Differential Revision: D67670976

fbshipit-source-id: 7d1383a89e06c138f437a9c5f876a2e900878fb0
2024-12-27 07:38:47 -08:00
BleemIs42andFacebook GitHub Bot 44705fe11b - Fix BackHandle callback undefined cause crash issue (#48388)
Summary:
### Error message:
we got an error
```
t[n] is not a function. (In 't[n]()', 't[n]' is undefined) \n <unknown> (index.bundle:317:168:317)
```
 it related the BackHandle execute handle function.

### Investigation result
our project has screen files`App.tsx`, `Dashboard.tsx`, and `Profile.tsx`.
When launching the app, the screen order is `App.tsx` -> `Dashboard.tsx`, then user can switch to `Profile.tsx`
For `App.tsx` and `Dashboard.tsx`, we just prevent the hardware button action use `usePreventHardwareBackPressEffect()` in the first line of screen code.
```js
export const useHardwareBackPressEffect = (goBack?: () => boolean): void => {
  useEffect(() => {
    if (goBack) {
      BackHandler.addEventListener("hardwareBackPress", goBack);
      return () => {
        BackHandler.removeEventListener("hardwareBackPress", goBack);
      };
    }
    return undefined;
  }, [ goBack ]);
};
export const usePreventHardwareBackPressEffect = (): void => useHardwareBackPressEffect(() => true);
```
currently, `_backPressSubscriptions ` has 2 callback functions.
then user switch to `Profile.tsx` screen, and has the below code for hardwareback button and the second doesn't `return true`:
```js
// first one
usePreventHardwareBackPressEffect();
...

// second one
useEffect(() => {
  const backButtonListener = BackHandler.addEventListener(
    "hardwareBackPress",
    () => navigate(Navigation.Login);
  );
  return () => backButtonListener.remove();
});
```
currently, `_backPressSubscriptions ` has 4 callback functions, include previous 2 and new 2 of `Profile.tsx`.
When the user press hardwareback button, it will navigate to the login screen, so the issue occurs:
the latest callback will be executed first, then the navigation will let the screen unmount, which will destroy the effect, so the code removing 2 hardwareBackPress callback of `Profile.tsx` by executed
```js
return () => {
        BackHandler.removeEventListener("hardwareBackPress", goBack);
      };
```
After the navigation ends and the loop is restored, the init `i` is 3, then `i--`, `i` is 2, then `_backPressSubscriptions[2]` is `undefined` now and executes as a function, so the app crashes.
```js
for (let i = _backPressSubscriptions.length - 1; i >= 0; i--) {
    if (_backPressSubscriptions[i]()) {
      return;
    }
  }
```
that's the issue I met.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix BackHandle callback undefined cause crash issue

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

Reviewed By: blakef

Differential Revision: D67648077

Pulled By: rshest

fbshipit-source-id: 5ca685b0c0c474ef11772fd803743968ec2d912e
2024-12-27 04:37:57 -08:00
zhongwuzwandFacebook GitHub Bot 8dfed7df4b RNTester: Fixes crash when app back to background (#48385)
Summary:
https://github.com/facebook/react-native/issues/48376 removed `applicationDidEnterBackground` from `RCTAppDelegate` but RNTester called it, leads to crash. cc cipolleschi can you please help to review?

## Changelog:

[INTERNAL] [FIXED] - RNTester: Fixes crash when app back to background

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

Test Plan: RNTester iOS back to background not crash.

Reviewed By: cipolleschi

Differential Revision: D67657449

Pulled By: philIip

fbshipit-source-id: e6d806b2677050fa2faa273a7468055d9d21c2a3
2024-12-27 04:16:25 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot fcf3c8cab7 Rename SystraceSection to TraceSection (#48383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48383

## Changelog:
[Internal] -

This changes the name of `SystraceSection` class to `TraceSection`, the purpose being to make it Systrace/FBSystrace agnostic (and that it can be mapped to e.g. Perfetto instead).

It changes all the internal callsites to the RN code code, and also adds a shim include, `<cxxreact/SystraceSection.h`, for backward compatibility with the external callers for now (which will be addressed separately).

Reviewed By: javache

Differential Revision: D67621914

fbshipit-source-id: 337c63c45a7b075c6e00cfca67ecc06c298c94c0
2024-12-24 16:31:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4a667e1a50 Set timeout for E2E tests. (#48381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48381

Right now, the E2E tests for RNTester does not have a timeout.
It can happen that the emulator get stuck and the action times out.

The default timeout is 6 hours, which is definitely too much and wasteful, so let's reduce it to 1 hour.

{F1974112110}

## Changelog:
[Internal] - Set timeout for E2E tests to 1 hour

Reviewed By: robhogan, blakef

Differential Revision: D67620423

fbshipit-source-id: c507d1222fca49287fafe6da4bffe559d8687b99
2024-12-24 08:15:22 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 17a644a230 Map SystraceSection to Perfetto instrumentation if the latter is enabled (#48379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48379

## Changelog:
[Internal] -

We have a good portion of RN core code already instrumented with `SystraceSection` blocks, and those do the timing via fbsystrace, which may or may not be enabled in the system and generally is obsolete.

This maps the blocks to the corresponding Perfetto instrumentation, in case the latter is enabled, which will allow to get this information in Perfetto sessions without need to have fbsystrace present.

Reviewed By: javache

Differential Revision: D67619443

fbshipit-source-id: 52e5666472ad118fbec176a0e82d72a5200a358a
2024-12-24 07:47:50 -08:00
Gaspard ViotandFacebook GitHub Bot 74bdab8bd8 Reduce memory allocations when computing accessibilityLabel (#44605)
Summary:
While investigating the root cause of app hanging on older devices in Instruments, I noticed that the heaviest stack trace was pointing to `RCTRecursiveAccessibilityLabel` in RCTView.m.

<details>
  <summary>Heaviest stack trace in Instruments</summary>
<img width="473" alt="Screenshot 2024-05-17 at 4 22 48 PM" src="https://github.com/facebook/react-native/assets/849905/fab8ed01-7a2f-4113-b2ca-04e76f25cd9d">
</details>

The profiling was done on an iPad (5th generation) running iOS 16.7.4. The app is text heavy which makes the issue more visible than in RNTester for instance.

### Before
<img width="854" alt="Screenshot 2024-05-17 at 4 19 46 PM" src="https://github.com/facebook/react-native/assets/849905/5e3cc7ad-299c-4814-ab4a-031c0e677b12">

It turns out that `[NSMutableString stringWithString:@""]` is initialized in every call of the recursion even though most of the time it's only used to check the length at the end and return `nil`.

My change only initialize the mutable string if it's going to be used. I applied the same logic to the equivalent Fabric component. It's a small change that improved the accessibility label generation by 60ms in my case.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[IOS] [CHANGED] - Reduce memory allocations when computing accessibilityLabel

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

Test Plan:
Running the same measurements after the change, computing the accessibility label is not the heaviest stack trace anymore. And the line by line tracing shows that `[NSMutableString stringWithString:@""]` impact has been significantly reduced.

### After
<img width="769" alt="Screenshot 2024-05-17 at 4 53 04 PM" src="https://github.com/facebook/react-native/assets/849905/1ad638ac-ba7e-4dca-ac77-10df5d2dad49">

I have been using this change in production thanks to a patch-package and it effectively improved the performances when navigating between screens.

I also tested in RNTester with and without Fabric. For both architectures, I made sure the return value of `RCTRecursiveAccessibilityLabel`.

Interestingly, when there is no label, the Fabric implementation returns an empty string while the `RCTView.m` returns `nil`.

I'm open to align both implementations to return `nil` if you believe there is no underlying reason requiring the Fabric implementation to return an empty string.

Reviewed By: cipolleschi

Differential Revision: D67620818

Pulled By: javache

fbshipit-source-id: 1a6937075a5ff5a9ad03fbbf910d64b3884c0fe0
2024-12-24 07:42:33 -08:00
zhongwuzwandFacebook GitHub Bot 6d2b61691a Fabric: Fixes assert failure when surface stop before we start surface (#48213)
Summary:
Fixes https://github.com/facebook/react-native/issues/48149. Actually this issue is not caused by React 19. The underlying problem arises because we retain the surface in RCTHost at the time of its creation. Even though we call stop, there is a return check that prevents execution if the status is not running. For reference, you can view the relevant code here: [RCTFabricSurface.mm](https://github.com/facebook/react-native/blob/7d771de8a79b05e8dfed91e07de30d9f72d3c1c3/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm#L118).

To resolve this issue, we can implement a weak reference to the surface.

bt:
```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/13, queue = 'com.apple.root.user-interactive-qos', stop reason = signal SIGABRT
    frame #0: 0x0000000105699008 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x00000001045df408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
    frame https://github.com/facebook/react-native/issues/4: 0x000000010651f4b4 React_Fabric`facebook::react::SurfaceHandler::setUIManager(this=0x0000000108108620, uiManager=0x0000000000000000) const at SurfaceHandler.cpp:317:3
    frame https://github.com/facebook/react-native/issues/5: 0x00000001064c98f4 React_Fabric`facebook::react::Scheduler::unregisterSurface(this=0x0000600003500370, surfaceHandler=0x0000000108108620) const at Scheduler.cpp:252:18
    frame https://github.com/facebook/react-native/issues/6: 0x0000000104c3e8a8 RCTFabric`-[RCTScheduler unregisterSurface:](self=0x000060000212a940, _cmd="unregisterSurface:", surfaceHandler=0x0000000108108620) at RCTScheduler.mm:163:15
    frame https://github.com/facebook/react-native/issues/7: 0x0000000104c61fc4 RCTFabric`-[RCTSurfacePresenter unregisterSurface:](self=0x00000001081080d0, _cmd="unregisterSurface:", surface=0x0000000108108610) at RCTSurfacePresenter.mm:126:5
  * frame https://github.com/facebook/react-native/issues/8: 0x0000000104bc30a0 RCTFabric`-[RCTFabricSurface dealloc](self=0x0000000108108610, _cmd="dealloc") at RCTFabricSurface.mm:87:3
    frame https://github.com/facebook/react-native/issues/9: 0x0000000104b9ae44 RCTFabric`__destroy_helper_block_ea8_32s((null)=0x0000600000cb5a70) at RCTBoxShadow.mm:0
    frame https://github.com/facebook/react-native/issues/10: 0x00000001800f6edc libsystem_blocks.dylib`_call_dispose_helpers_excp + 44
    frame https://github.com/facebook/react-native/issues/11: 0x00000001800f7d24 libsystem_blocks.dylib`_Block_release + 300
    frame https://github.com/facebook/react-native/issues/12: 0x000000010760a7b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame https://github.com/facebook/react-native/issues/13: 0x000000010761e608 libdispatch.dylib`_dispatch_root_queue_drain + 936
    frame https://github.com/facebook/react-native/issues/14: 0x000000010761ef7c libdispatch.dylib`_dispatch_worker_thread2 + 256
    frame https://github.com/facebook/react-native/issues/15: 0x00000001045dbb38 libsystem_pthread.dylib`_pthread_wqthread + 224
```

## Changelog:

[IOS] [FIXED] - Fabric: Fixes assert failure when surface stop before we start surface

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

Test Plan:
Please see demo in https://github.com/facebook/react-native/issues/48149. Or open RNTester and apply the patch like below:
```
 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm
index 64c5d4122e7..cf015458619 100644
 --- a/packages/rn-tester/RNTester/AppDelegate.mm
+++ b/packages/rn-tester/RNTester/AppDelegate.mm
@@ -50,7 +50,10 @@ static NSString *kBundlePath = @"js/RNTesterApp.ios";

   [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

-  return [super application:application didFinishLaunchingWithOptions:launchOptions];
+  [super application:application didFinishLaunchingWithOptions:launchOptions];
+  self.window.rootViewController = [UIViewController new];
+  [self.window makeKeyAndVisible];
+  return YES;
 }

 - (void)applicationDidEnterBackground:(UIApplication *)application

```

Reviewed By: javache

Differential Revision: D67335792

Pulled By: cipolleschi

fbshipit-source-id: e93aaaa60b3d204d7ed2cda6758b3b1d9dfcbc88
2024-12-24 07:41:51 -08:00
Alex ToudicandFacebook GitHub Bot adaceba546 Fix applicationDidEnterBackground not being called (#48376)
Summary:
I noticed that `AppDelegate` subscribers listening for `applicationDidEnterBackground` events in Expo projects (as documented [here](https://github.com/expo/expo/blob/238b6f57e459dd2c0b13ee158f0af709fe922460/docs/pages/modules/appdelegate-subscribers.mdx?plain=1#L56) aren't working as expected anymore.
While investigating, I discovered that the events aren't reaching the `ExpoAppDelegate` implementation ([source](https://github.com/expo/expo/blob/71f2c55ff3f11e43ab43761bb5cece2e48eae0bf/packages/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift#L61)) because the `RCTAppDelegate` implementation of `applicationDidEnterBackground` interrupts the event chain. This appears to be affecting some legitimate use cases.
I believe we could improve this by removing the current implementation, but I'd love to hear your thoughts on this approach. I might be missing some context about why this implementation was originally needed, so any insights would be greatly appreciated!

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix applicationDidEnterBackground not being called

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fix applicationDidEnterBackground not being called

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

Test Plan: Ran a local test after change

Reviewed By: javache

Differential Revision: D67621557

Pulled By: cipolleschi

fbshipit-source-id: 2d73711372deba867bd616c79ef4d00c79aa86d5
2024-12-24 06:56:55 -08:00
Mateo GuzmánandFacebook GitHub Bot 974fdf9a37 Migrating FpsListener to Kotlin (#48360)
Summary:
Migrating `FpsListener` to Kotlin

## Changelog:

[INTERNAL] - Migrating `FpsListener` to Kotlin

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: bnalls33

Differential Revision: D67599802

Pulled By: Abbondanzo

fbshipit-source-id: 769dbe26688309ffcf15565c5d51003e23c56412
2024-12-23 15:51:14 -08:00
Ramanpreet NaraandFacebook GitHub Bot a5a3d372be Rename ParsedError to ProcessedError
Summary:
I think parsed isn't a good enough name.

React native also does a lot of processing of the error.

This also opens the door for eventually forwarding the original error in the future.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D67526700

fbshipit-source-id: 895d64fa1ee4061ecbf0c1a6033c25b6fca95fd6
2024-12-23 12:42:14 -08:00
Rob HoganandFacebook GitHub Bot 29e5de579c Add Changelog for 0.77.0-rc.4 (#48374)
Summary:
Add changelog for 0.77.0-rc.4

## Changelog:
[Internal]

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67602257

Pulled By: robhogan

fbshipit-source-id: 79becf41cfad105e682d648f2f957f18bdbad5f6
2024-12-23 09:50:15 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e87296f356 Do not install jq as it is already installed (#48363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48363

jq is already installed on M1 machines on GithubActions. There is no need to install it again and this is outputting a warning in CI:

{F1974100065}

## Changelog:
[Internal] - Do not install jq as it is already installed

Reviewed By: blakef

Differential Revision: D67599961

fbshipit-source-id: 1f621f796b0c67ec877fc35269137537618f47ae
2024-12-23 07:46:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5b6534e727 Fix typo in configuration (#48364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48364

The configuration to run E2E tests on maestro has a typo that was outputting a warning in CI:

{F1974100056}

## Changelog
[Internal] - Fix typo on E2E test configuration

Reviewed By: robhogan

Differential Revision: D67599849

fbshipit-source-id: 9504f821172782e188ff524176bc4c2ec48dea97
2024-12-23 07:46:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 27aa28b1f5 USe the debug APK instead of the release one (#48365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48365

For a mistake, the local E2E test we use to test a release is still pointing to the release APK instead of using the debug apk.

This change fix that. The change has been manually applied to the release branches, for example [here](https://github.com/facebook/react-native/commit/385318bf6a83b124d9e8eb925932edff02115c85)

## Changelog
[Internal] - use Debug apk instead of release one to test the release

Reviewed By: robhogan

Differential Revision: D67599760

fbshipit-source-id: 224b5b8d8f664bb579b09ee68f1b92c0774a9b5e
2024-12-23 07:46:02 -08:00
Intl SchedulerandFacebook GitHub Bot 5b6e35afda translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907954543643
Sandcastle Job Instance ID: 18014400108783919
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D67558410

fbshipit-source-id: 98a48c02e85aa4f3481ac4800362728bfdb152db
2024-12-21 04:24:28 -08:00
Sam ZhouandFacebook GitHub Bot 66342d3ccd Deploy 0.257.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67548045

fbshipit-source-id: 0c983b327b54580dddf483b6250ff1261df8ce75
2024-12-20 15:58:17 -08:00
Sam ZhouandFacebook GitHub Bot 4c1dd906b0 Replace React$Node with React.Node
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67529040

fbshipit-source-id: 09221c6f866628bbf9174293124e650b7fffa967
2024-12-20 13:00:12 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 953889da51 Stabilize Android tests adding retries for failed tests (#48324)
Summary:
Sometimes, specific E2E tests can fail. This change tries to run specific E2E tests with retries, to compensate for their flakyness.

## Changelog:
[Internal] - Add single test retry for Android E2E tests

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

Test Plan: GHA

Reviewed By: huntie

Differential Revision: D67396758

Pulled By: cipolleschi

fbshipit-source-id: 7d806fe7354bd9e826c591ea9628c73c3b258fce
2024-12-20 06:19:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5443359c88 Revert "Include autolinkin.h in OnLoad.cpp only if it exists (#47875)" (#48341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48341

We reverted [this commit](https://github.com/facebook/react-native/commit/5b2bbb84b14208905fc0dd7eade9ee6ce6e079b7) in 0.76 and 0.77 as it was not the right fix.

## Changelog
[Internal] - Revert excluding `autolinking.h` only if it exists

Reviewed By: alanleedev

Differential Revision: D67456530

fbshipit-source-id: 0f7bfc11d23f7a8fef5100784754add5b4ecda58
2024-12-20 03:15:55 -08:00
David VaccaandFacebook GitHub Bot 7b8412d66d Migrate ReactDrawableHelper to Kotlin (#48346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48346

Migrate ReactDrawableHelper to Kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420410

fbshipit-source-id: 524062d0c0a0d3440bf5ac4c61e8cae53b32a0d2
2024-12-20 00:18:50 -08:00
David VaccaandFacebook GitHub Bot e9faea2f3e Migrate ReactPackageLogger to kotlin (#48345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48345

Migrate ReactPackageLogger to kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420585

fbshipit-source-id: a82fc7f17828ef6ad36a666113673526eb723600
2024-12-20 00:15:54 -08:00
Krzysztof PiaskowyandFacebook GitHub Bot 23eb06f662 Static Hermes for React Native (#48327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48327

This PR introduces necessary changes to let React Native uses latest version of static Hermes.

## Explanation

### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```

### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()
```

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```

These updates are necessary to successfully build the Hermes Framework for iOS.

### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

X-link: https://github.com/facebook/hermes/pull/1566

Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar

fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
2024-12-19 16:23:41 -08:00
Thomas NardoneandFacebook GitHub Bot 0683206927 Restore subclipping view removal (#48329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48329

With the call to `removeView()` removed from `ReactViewClippingManager` in https://github.com/facebook/react-native/pull/47634, we're seeing views erroneously sticking around in the layout.

While `removeViewWithSubviewClippingEnabled()` calls `removeViewsInLayout()`, it does not trigger the corresponding side effects of [removeView()](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5501):
```
public void removeView(View view) {
  if (removeViewInternal(view)) {
--> requestLayout();
--> invalidate(true);
  }
}
```
To compensate, flip `removeViewsInLayout()` to [`removeViews()`](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5562), which will ensure layout.

Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt()

Reviewed By: javache

Differential Revision: D67398971

fbshipit-source-id: b100db468cc3be6ddc6edd6c6d078a8a0b59a2c1
2024-12-19 15:27:13 -08:00
Pieter De BaetsandFacebook GitHub Bot a9f60bea72 Remove unused perftests JNI code (#48344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48344

Matching Java code was removed in D60581611

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67460124

fbshipit-source-id: 1c7e986fbb0c02af51e0c4035b2f131fcc2c64ec
2024-12-19 14:51:26 -08:00
Mateo GuzmánandFacebook GitHub Bot 52b6592559 Modal: Setting resource-id from testID prop (#48313)
Summary:
Follow up from https://github.com/facebook/react-native/issues/48271 and https://github.com/facebook/react-native/issues/48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that.

## Changelog:

[ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop

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

Test Plan:
Alternatively do:
```
$ adb shell uiautomator dump
UI hierchary dumped to: /sdcard/window_dump.xml
$ adb pull /sdcard/window_dump.xml
/sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s)
```
and check in XML: ` resource-id="playground-modal"  class="android.view.ViewGroup" `
-------
Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal.

<details>
<summary>Example of the code implementation in the RNTester Playground:</summary>

```tsx
function Playground() {
  const [modalVisible, setModalVisible] = React.useState(false);

  return (
    <>
      <Modal
        visible={modalVisible}
        testID="playground-modal">
        <Text testID="inner-text-test-id">Hello World!</Text>
      </Modal>

      <Button
        title="Open Modal"
        onPress={() => {
          setModalVisible(true);
        }}
      />
    </>
  );
}
```
</details>

<details>
<summary>Output in Appium Inspector:</summary>

<img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" />

</details>

Reviewed By: javache

Differential Revision: D67369350

Pulled By: alanleedev

fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
2024-12-19 11:49:45 -08:00
zhongwuzwandFacebook GitHub Bot dd303b2dde Fabric: Fixes AccessoryView not disappeared when pop up the page (#47311)
Summary:
Fixes AccessoryView not disappeared when page poped up. After page pop up, we can see a white view it the bottom of scrren.

Fixed:
https://github.com/user-attachments/assets/90305720-656b-4546-8730-53b89fee7a66

Before:
https://github.com/user-attachments/assets/8e4fbea3-1882-48f8-aa5f-0c4e9ddc4efd

## Changelog:

[IOS] [FIXED] - Fabric: Fixes AccessoryView not disappeared when pop up the page

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

Test Plan: RNTester InputAccessoryView example, repro steps please see the video above.

Reviewed By: christophpurrer

Differential Revision: D67455393

Pulled By: javache

fbshipit-source-id: b5d3a88bce41da77079eeb49fea8163f56d722dd
2024-12-19 10:55:21 -08:00
kirillzyuskoandFacebook GitHub Bot 5fc582783d fix: do not overwrite external inputAccessoryView on Fabric (#48339)
Summary:
If 3rd party libs are using `inputAccessoryView` - the current code can easily break it. Whenever props gets changed we call `setDefaultInputAccessoryView` which will simply overwrite the current `inputAccessoryView` (which is highly undesirable).

The same fix on paper was made ~7 years ago: https://github.com/facebook/react-native/commit/bf3698323d81508fc77174df2b1ffe5fb03224e7

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - Fixed problem with accessory view & 3rd party libs

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

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

Test Plan: Make sure `inputAccessoryView` functionality works as before

Reviewed By: javache

Differential Revision: D67451188

Pulled By: cipolleschi

fbshipit-source-id: bc3fa82ae15f8acedfd0b4e17bdea69cbd8c8a8d
2024-12-19 10:12:36 -08:00
Matin Zadeh DolatabadandFacebook GitHub Bot ea56c432b7 Disable react-in-jsx-scope rule in eslint config (#46587)
Summary:
All newly generated react native apps are still showing warnings to use react in the jsx scope. That is not needed anymore as of react 18 with built-in jsx transform plugin.

Reproduction: https://github.com/matinzd/react-in-jsx-warning-repro

Run `npm run lint` in this repo.

## Changelog:

[GENERAL] [FIXED] - Disable `react-in-jsx-scope` rule in eslint config

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

Test Plan: Initiate a new template with community CLI and you should not see this warning anymore.

Reviewed By: christophpurrer

Differential Revision: D67394923

Pulled By: cipolleschi

fbshipit-source-id: cfe8e44e33e1b3ae9fe17ca56dd3c7258b7bff69
2024-12-19 06:02:32 -08:00
Pieter De BaetsandFacebook GitHub Bot 44ef2c484a Revert D66839601: Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3
Differential Revision:
D66839601

Original commit changeset: dfba4aab6d73

Original Phabricator Diff: D66839601

fbshipit-source-id: 4d59b3616193dc184f0de7df8556f2b9b192df67
2024-12-19 03:37:20 -08:00
Sam ZhouandFacebook GitHub Bot b8f3f919cc Deploy 0.257.0 to xplat (#48331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48331

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D67423622

fbshipit-source-id: 09ca17bedf15174e210e943b989537c67f197659
2024-12-18 17:39:30 -08:00
Richard BarnesandFacebook GitHub Bot 72007a14af Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 (#48250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48250

LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D66839601

fbshipit-source-id: dfba4aab6d73a2fd805ad2761a49c23612c28ccd
2024-12-18 15:24:52 -08:00
Thomas NardoneandFacebook GitHub Bot 783cc5777a Remove GuardedAsyncTask wrapper for call.cancel() (#48251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48251

The original comment mentioning https://github.com/square/okhttp/issues/869 predates the [upgrade to okhttp3](https://github.com/facebook/react-native/commit/6bbaff2944dafd6fa7e5b77ef46dece0ec2c9983), which resolved the issue via https://github.com/square/okhttp/issues/1592.

Cancel calls should now be async and don't need to be guarded.  Removing this also fixes a discrepancy in NetworkingModule unit test verification.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67157018

fbshipit-source-id: 72ce4deaaff306ef1dde6eda7be88707c37f0be7
2024-12-18 14:36:38 -08:00
Zeya PengandFacebook GitHub Bot 2ea9a7b51f Allow debugID key in InterpolationNode config & Support debugID in NVE (#48323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48323

Allow `debugID` key in InterpolationNode config
Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67185006

fbshipit-source-id: ec0081617103bd4b7bb78210702872a42db26361
2024-12-18 09:10:13 -08:00
Saad NajmiandFacebook GitHub Bot b04d17afca Fix Direct Debugging with JSC (#39549)
Summary:
Originally with https://github.com/facebook/react-native/commit/5cf8f43ab182781ea82e88077df425c3efbfc21f , we added a call to a new Apple API `JSGlobalContextSetInspectable` to ensure that our Javascript running with JSC is debuggable. That change was guarded with a `__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)` check to make sure it only ran on OS'es where to function existed. Later, in https://github.com/facebook/react-native/commit/3eeee11d7ac4075d0917233d3be4a9469f802d35  we did an extra guard in the way of a macro to check we were compiling against a new enough version of Xcode (so that Xcode knows about the symbol).

Between the runtime check and the compile time check, we should be good right? Wrong! As it turns out, this bit of code still caused crashes on iOS 15 devices (See this [Apple Forum Thread](https://forums.developer.apple.com/forums/thread/749534)). To address this, https://github.com/facebook/react-native/pull/44185 was added which added a new compiler guard (`__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4)` was added. Unfortunately, this guard is incorrect: It is basically checking if our minimum iOS deployment target is 16.4 (It's not, as of writing it is iOS 13.4), which effectively means this code is never compiled and one can never direct debug with JSC on iOS 16.4+ 😨!

So what went wrong, and why were the first two guards not good enough? Three main reasons..

Firstly, this is a device only crash, and not reproducible on simulator. This is probably why the crash was not caught earlier. Secondly, It's because system frameworks (like JavascriptCore) are _dynamically_ linked: the linker doesn't look for the symbol till runtime (and crashes when doing so). Thirdly, It's because we are _strongly_ linking the framework, so every symbol must be present and the macros / guard Apple provides with `AvailabilityMacros.h` don't work.

What we want to do is link JavascriptCore as a `weak_framework`, more info here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

From that link:
> One challenge faced by developers is that of taking advantage of new features introduced in new versions of OS X while still supporting older versions of the system. Normally, if an application uses a new feature in a framework, it is unable to run on earlier versions of the framework that do not support that feature. Such applications would either fail to launch or crash when an attempt to use the feature was made. Apple has solved this problem by adding support for weakly-linked symbols.

>When a symbol in a framework is defined as weakly linked, the symbol does not have to be present at runtime for a process to continue running. The static linker identifies a weakly linked symbol as such in any code module that references the symbol. The dynamic linker uses this same information at runtime to determine whether a process can continue running. If a weakly linked symbol is not present in the framework, the code module can continue to run as long as it does not reference the symbol. However, if the symbol is present, the code can use it normally.

This seems to be exactly what we want, and the Apple provided method for using new APIs in system frameworks!

Let's update our podspecs so we link JavascriptCore weakly. As a bonus (and admittedly, the original purpose of this PR) let's add macOS support to the `JSC_HAS_INSPECTABLE` macro (This file `JSCRuntime.cpp` used to have more explicit macOS support in it's macros, but I had removed it with https://github.com/facebook/react-native/commit/fb30fcaa2f526cc1f7c2d4189ec9c57f9cf9b3c5).

## Changelog:

[IOS] [FIXED] - Fix Direct Debugging with JSC

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

Test Plan:
Tested that RNTester doesn't crash on boot running on an iPad Air 2 running iOS 15.8., and that an iOS 17.2 simulator is debuggable.

Built RN-Tester and RN-Tester-macOS and verified both show up in Safari Web Inspectors' debug menu:

<img width="1316" alt="Screenshot 2023-09-19 at 10 48 43 PM" src="https://github.com/facebook/react-native/assets/6722175/c642e6e0-36af-4c9f-845a-7e491489f419">

macOS screenshot small bc I got some internal stuff I gotta crop 😅

<img width="347" alt="Screenshot 2023-09-19 at 10 53 46 PM" src="https://github.com/facebook/react-native/assets/6722175/1e802c88-02b8-49e1-8fd2-d91726ca1e93">

Reviewed By: huntie

Differential Revision: D67338150

Pulled By: cipolleschi

fbshipit-source-id: 620c3b3cc1e37e54de7fa4dc9956a02c8f3c09f8
2024-12-18 08:00:19 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 9f12fce53b fix(iOS): remove unused RCTTurboModuleManagerDelegate method (#48290)
Summary:
Hey, this PR removes unused method from RCTAppDelegate.

The only called method from RCTTurboModuleManagerDelegate is `getTurboModule:jsInvoker`, the `getTurboModule:initParams:` is never called.

https://github.com/facebook/react-native/blob/5a81ceed2a6c974211e6a238efee3eea68b9568a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm#L207

## Changelog:

[INTERNAL] [REMOVED] - remove unused RCTTurboModuleManagerDelegate method

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

Test Plan: CI Green, ensure everything works as before

Reviewed By: javache

Differential Revision: D67392056

Pulled By: cipolleschi

fbshipit-source-id: e7f35f81c48cdc163cfff45987e0b7eb022cbf7d
2024-12-18 07:14:04 -08:00
Eli WhiteandFacebook GitHub Bot 4dac99cf6d Fix FlowFixMes in CodegenVersionDiffing (#48312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48312

I figured out how to fix these FlowFixMes

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D67313962

fbshipit-source-id: 21b109824411c1537f397aca45b7cdc2495f5e11
2024-12-17 20:23:24 -08:00
Sam ZhouandFacebook GitHub Bot f8119fc52b Pre-suppress errors in xplat ahead of 0.257.0 release
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67368232

fbshipit-source-id: 23111f62c5731b5a58e15ac8ef2dcd9ea8006573
2024-12-17 18:28:25 -08:00
generatedunixname499836121andFacebook GitHub Bot 7948044179 Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
bypass-react-native-oss-changelog

Generated by: https://www.internalfb.com/intern/sandcastle/job/36028798618339642/

GitHub Repo: facebook/react

Reviewed By: kassens

Differential Revision: D67286468

fbshipit-source-id: 66632a2524e80bca065d0a0f94342c4ec2d2a7b9
2024-12-17 13:33:11 -08:00
Thomas NardoneandFacebook GitHub Bot e577e48ad7 Remove reflection in OkHttpCallUtil (#48308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48308

Reflection is overkill here, we can simply suppress the deprecation "error".

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67337980

fbshipit-source-id: 12076258ed4cb5c8737c84378621dda3072ec5a0
2024-12-17 11:22:46 -08:00
Alex HuntandFacebook GitHub Bot dfdacb84ce Refactor PerformanceTracer buffer type to use output event format (#48310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48310

Refactors the internal storage format of trace events buffered by `PerformanceTracer`.

Aligning with the emitted [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?pli=1&tab=t.0#heading=h.yr4qxyxotyw) enables us to simplify away the issue of defining and converting from any intermediate formats. This becomes desirable as we generalise to more event types and forthcoming browser-emulating `__metadata` events.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67337442

fbshipit-source-id: 580928dfb4fcf4ac5efc82f93ab85a0d1d6dfb5c
2024-12-17 10:57:39 -08:00
Mitya KononchukandFacebook GitHub Bot 8696b79f73 Fix running fantom tests with high parallelism (#48307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48307

Changelog:
[General][Fixed] - Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test.

Reviewed By: rubennorte, danalex97

Differential Revision: D67334828

fbshipit-source-id: 3db18f6a100925480dbf8385f9ea414187406f4a
2024-12-17 10:07:26 -08:00
Thomas NardoneandFacebook GitHub Bot 5a01291598 Categorize SoftAssertions (#48306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48306

Extract a constant for SoftAssertions so they can be logged appropriately

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D67296589

fbshipit-source-id: c8823fd5dfa09a771bb8fbf498edb8d9264f053f
2024-12-17 09:18:55 -08:00
Dmitry RykunandFacebook GitHub Bot 0ceb0b3942 Calculate Android mounting instructions based on updates accumulated in rawProps (#48303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48303

## Context

If a component is re-rendered/committed multiple times before mount, Android mounting layer creates and executes mounting instructions for every commit. Component's native representation is updated multiple times, potentially triggering expensive computations (e.g. recreating boxShadows) for a single draw.

A more efficient way would be to create mounting instructions to update the component from the initial state (before the first render) to the final state (after the last render) in one go.

iOS does that.

This diff is an attempt to experiment on achieving such behaviour for Android.

## Implementation Details

1. When cloning a ShadowNode, accumulate all the updates in `Props.rawProps`.
2. For calculating prop update payloads to be sent to the Android mounting layer, diff old and new `rawProps` by calling `newProps->getDiffProps(oldProps)`.
3. Most importantly, move computing of the mounting instructions from `schedulerDidFinishTransaction`, which is called after every commit, to `schedulerShouldRenderTransactions` which happens only once, after the final commit.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63457028

fbshipit-source-id: 991727838a4e11628cb696d66d41e1d441a5ef4f
2024-12-17 09:03:08 -08:00
zhongwuzwandFacebook GitHub Bot 5c789c3d3a Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan (#48296)
Summary:
Fixes https://github.com/facebook/react-native/issues/48288

## Changelog:

[IOS] [FIXED] - Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan

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

Test Plan: Repro demo in https://github.com/facebook/react-native/issues/48288

Reviewed By: cipolleschi

Differential Revision: D67334179

Pulled By: NickGerleman

fbshipit-source-id: a9456a152d31bef1666669cbded28d99ec8a2028
2024-12-17 06:53:47 -08:00
Mateo GuzmánandFacebook GitHub Bot 5370347f54 Upgrading typescript-config module version to esnext (#48230)
Summary:
Fixes https://github.com/facebook/react-native/issues/45810

Upgrading `typescript-config` module version from `es2015` to `esnext`, in order to support dynamic imports.

## Changelog:

[GENERAL] [CHANGED] - Upgrading `typescript-config` module version to `esnext`

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

Test Plan:
Create a new React Native project:

```bash
npx react-native-community/cli@latest init AwesomeProject
```

Copy the changes in the reproducer from the linked issue and add a lazy import:

```tsx
const LazyAssetExample = React.lazy(() => import('./components/AssetExample'));
```

See the error when running `yarn tsc`:

<img width="739" alt="image" src="https://github.com/user-attachments/assets/99989cd1-e11a-4b23-b178-f221d8cdd8ca" />

 ---

To fix the error, apply the following patch:

```patch
 diff --git a/node_modules/react-native/typescript-config/tsconfig.json b/node_modules/react-native/typescript-config/tsconfig.json
index d5e1bce..51f54c1 100644
 --- a/node_modules/react-native/typescript-config/tsconfig.json
+++ b/node_modules/react-native/typescript-config/tsconfig.json
@@ -3,7 +3,7 @@
     "display": "React Native",
     "compilerOptions": {
       "target": "esnext",
-      "module": "es2015",
+      "module": "esnext",
       "types": ["react-native", "jest"],
       "lib": [
         "es2019",

```

Verify it is fix by running `yarn tsc` again

Reviewed By: cipolleschi

Differential Revision: D67334277

Pulled By: NickGerleman

fbshipit-source-id: d26525023ff6fcfff651d1e4cee48ab2854b8d83
2024-12-17 06:08:43 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0a0a1d90a7 Add Changelog for 0.77.0-rc.3 (#48302)
Summary:
Add Changelog for 0.77.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.77.0-rc.3

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D67332176

Pulled By: cipolleschi

fbshipit-source-id: 335e0b6da5d51934d383a08c5749b6d1f57d6a3d
2024-12-17 04:53:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 03b9f041db Improve E2E Stability for Android (#48286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48286

This change bumps the specs for the Android E2E tests. This has been reported to improve the stability of the tests.

We need to keep part of the `flatlist.yml` commented as it creates an issue with Maestro as it takes too much memory.

I'll reach out to the people working on Maestro to try and understand what's going on there.

## Changelog:
[Internal] - Improve android Stability and reenable E2E tests on main

Reviewed By: fabriziocucci

Differential Revision: D67276601

fbshipit-source-id: 7cca253547063a0ec39da7de58806286c6632b07
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b511a95652 Fix Text tests (#48279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48279

The text tests has 2 issues:
* on iOS, the Text cell was sometimes rendered below the tabbar, with a small percentage visible. When this happens, the test was actually moving to a different tab rather then navigating to the Text screen
* on Android, sometimes navigation took too long and a scroll command was issued. This moved the screen away from the right screen we wanted to test.

This change fixes both issues by ensuring that the Text cell is 100% visible (not behind the tabbar) and by ensuring that the title "Text" is visible in Android, so the navigatin has actually happened

## Changelog:
[Internal] - Fix Text tests

Reviewed By: fabriziocucci

Differential Revision: D67274009

fbshipit-source-id: ed12f096788e7e6e74ee8d336dba350b35b85e81
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3f3ff554bc Bump Android executor and add timeout (#48280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48280

In an attempt to improve times and stability, I bumped the android machine to an ubuntu with 4 cores.

Sometimes the emulator can hang, so i set a timeout for the E2E tests executions of 1 hours to avoid wasting money in CI

## Changelog
[Internal] - Bump Android machine and add timeout

Reviewed By: fabriziocucci

Differential Revision: D67273842

fbshipit-source-id: b7212f52016f8ead1dbb2b4da03cb6f564222893
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4c4c87beaf Improve metro waiting times in E2E (#48281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48281

While working on Maestro E2E I realized that we were waiting for Metro to start even when metro was not running.

This moves the waiting only when metro is actually started.

I also added another waiting point as it takes several seconds for the app to load the bundle from metro the first time. Subsequent attempts are faster as the metro cache is warm.

## Changelog:
[Internal] - Improve metro waiting times in E2E

Reviewed By: fabriziocucci

Differential Revision: D67273648

fbshipit-source-id: 912be4d14869c8ce87d7c4e4f7ee37b643f5845c
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6c8473e52c Bump maestro to 1.39.5 (#48282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48282

This change bump maestro to the latest version as it present better reporting.

## Changelog:
[Internal] - Bump maestro to 1.39.5

Reviewed By: fabriziocucci

Differential Revision: D67273486

fbshipit-source-id: da41a002528a3b3c0934f86888da2bb53ae131b7
2024-12-17 03:45:18 -08:00
Thomas NardoneandFacebook GitHub Bot c832f94cf7 Extract SoftException categories (#48289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48289

Provide a mechanism to register specific category constants, which can be used by individual  `ReactSoftExceptionListener`s to differentiate behavior, if desired.

Changelog: [Android][Added] SoftException categories

Reviewed By: makovkastar

Differential Revision: D66785403

fbshipit-source-id: cb2c8861bb1dce29a6787d328b814cee09f36464
2024-12-16 20:33:18 -08:00
David VaccaandFacebook GitHub Bot 2516414f02 Migrate UIBlock to Kotlin (#48294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48294

Migrate UIBlock to Kotlin

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D67187378

fbshipit-source-id: ae38998d5adebbaddd1976397e229435229a7471
2024-12-16 20:24:22 -08:00
David VaccaandFacebook GitHub Bot b88346f9ea Update deprecation message (#48293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48293

Update deprecation message

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D67292511

fbshipit-source-id: 4d3315ce05f5c5ae1060659e98832305fee93377
2024-12-16 19:21:26 -08:00
David VaccaandFacebook GitHub Bot 45e4a3afce Migrate ReactPointerEventsView to kotlin (#47749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47749

Migrate ReactPointerEventsView to kotlin

changelog: [Android][Breaking] Mikgrating pointerEvents API breaks compatibility for kotlin usages of this api as a val

Reviewed By: cortinico

Differential Revision: D66217250

fbshipit-source-id: ff192c9f92d1df93c082b563937eb3f37176f144
2024-12-16 18:39:54 -08:00
David VaccaandFacebook GitHub Bot 25ee3e805d Migrate ReactOverflowView to kotlin (#47750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47750

Migrate ReactOverflowView to kotlin

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D66217252

fbshipit-source-id: 8cd642dee2077006eab10d718a1887a77fd029a7
2024-12-16 18:39:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 03a1246c35 Refactor TraceEvent format (#48269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48269

# Changelog: [Internal]

I've noticed that our definition of Trace Event is different from the one that is defined in Google's doc / V8 / Chrome. This has some flaws:
* It creates fragmentation, like with custom track ids or with mocked process ids.
* Current implementation is strict the relationship between `performance.mark()`, `performance.measure` APIs and Instant, Complete Trace Events. Basically only something recorded with `performance.mark` can be an instant trace event.

This should unblock recording custom trace events inside `PerformanceTracer`, such as when tracing started and others. Same could be said about events related to CPU profiling from Hermes, which will be based on these APIs.

This is the pre-requisite for next diff that will add emitting `TracingStartedInPage` event. With this event, the trace should look similar to the one recorded in the browser, and Timings / Main tracks no longer should be registered manually.

Reviewed By: huntie

Differential Revision: D67207107

fbshipit-source-id: fd7f55dd82167c14a63c2d93aaa649072c5a2a2c
2024-12-16 15:19:16 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4368368ef5 Fix some peer dependencies on React types (#48292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48292

These dependencies are making the CI on main to fail.

## Changelog:
[General][Fixed] - Fix peer dependencies on React types

Reviewed By: javache, hoxyq

Differential Revision: D67283609

fbshipit-source-id: b325246f5de654a9ccbf7f96eec24434047a38ee
2024-12-16 14:08:19 -08:00
Thomas NardoneandFacebook GitHub Bot b662b1f4e4 Update ReactOkHttpNetworkFetcherTest (#48205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48205

Flip mockito usages to mockito-kotlin

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66985841

fbshipit-source-id: 23c501c96567e6f4f884bc4db8930f1d68b0351c
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot 3960a2dd8c Fix up network module tests (#48160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48160

Shift to mockito-kotlin and fix ReactCookieJarContainerTest so it's not just testing a mock.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66898956

fbshipit-source-id: 5ccc652b86e5a80b81d257d3ec645d7bc813301b
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot 1cbda5f64e Fix NetworkingModuleTest (#48159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48159

Fix the setup for ignored tests and re-enable them.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66897564

fbshipit-source-id: bac777c981976e08140bc0832f5402995ffceb8e
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot e393711ef8 Add mockito-kotlin (#48158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48158

Changelog: [Android][Added] Add mockito-kotlin for Kotlin unit testing

Reviewed By: cortinico

Differential Revision: D66897263

fbshipit-source-id: c608622e2431578f4eaa3fecff4f6c82a56b5090
2024-12-16 13:00:50 -08:00
Stefano FormicolaandFacebook GitHub Bot d31ac832c5 Add CCACHE_BINARY path to Xcode build settings and use it in ccache scripts (#48257)
Summary:
When building a react native app from Xcode and ccache has been set to be used, the `ccache-clang.sh` and `ccache-clang++.sh` scripts cannot find `ccache`, because Xcode PATH does not include ccache binary.
What I've done is setting a `CCACHE_BINARY` user-defined Xcode setting containing the result of executing `command -v ccache` during pod install execution and directly calling it in ccache scripts, set by ReactNativePodsUtils when ccache is enabled.

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

## Changelog:

[IOS] [FIXED] - fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts

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

Test Plan: Correctly builds helloworld and RNTester apps using ccache by enabling it at pod install time: `USE_CCACHE=1 pod install`.

Reviewed By: christophpurrer

Differential Revision: D67280700

Pulled By: cipolleschi

fbshipit-source-id: 5478a191f9bd77606a56ccd340fea225ab62d4bc
2024-12-16 10:58:28 -08:00
Rubén NorteandFacebook GitHub Bot 06584241ba Fix ESLint warnings and remove from ignore list (#48291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48291

Changelog: [internal]

`react-native-fantom` was added to `.eslintignore` when we upgraded to React 19 because we wanted to reduce the amount of warnings to ease the migration.

This re-enables ESLint for that directory and removes the warnings.

Reviewed By: cipolleschi

Differential Revision: D67283104

fbshipit-source-id: 4ec2363ceaff3cd7bd6e5d70e9588c3dd22d7d85
2024-12-16 09:19:55 -08:00
Mateo GuzmánandFacebook GitHub Bot 92bffe6571 Fix PR warnings generated by unsorted imports from RCTNetworking.js.flow (#48272)
Summary:
There are a some warnings in the PRs generated by the unsorted imports in the `RCTNetworking.js.flow` file.

This PR addresses that. As an example: https://github.com/facebook/react-native/pull/48271/files

<img width="721" alt="image" src="https://github.com/user-attachments/assets/7e5347a5-c802-4c21-870d-f4983b515a7b" />

## Changelog:

[INTERNAL] [FIXED] - Sorting `RCTNetworking.js.flow` imports that generate a warning in the PRs

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

Test Plan: Verify that this PR doesn't show these warnings anymore

Reviewed By: NickGerleman

Differential Revision: D67274752

Pulled By: javache

fbshipit-source-id: 84ac36e0aaaeaf0156e40de9f6c61bd70fa1db85
2024-12-16 08:44:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5a81ceed2a React Native sync for revisions de68d2f...372ec00 (#48196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48196

X-link: https://github.com/facebook/metro/pull/1400

- **[372ec00c03](https://github.com/facebook/react/commit/372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](https://github.com/facebook/react/pull/31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](https://github.com/facebook/react/commit/3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](https://github.com/facebook/react/pull/31713)) //<Sebastian Markbåge>//
- **[1c9b138714](https://github.com/facebook/react/commit/1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](https://github.com/facebook/react/pull/31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](https://github.com/facebook/react/commit/de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](https://github.com/facebook/react/pull/31667)) //<Josh Story>//
- **[16d2bbbd1f](https://github.com/facebook/react/commit/16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](https://github.com/facebook/react/pull/31620)) //<Josh Story>//
- **[5b0ef217ef](https://github.com/facebook/react/commit/5b0ef217ef )**: s/server action/server function ([#31005](https://github.com/facebook/react/pull/31005)) //<Ricky>//
- **[e3b7ef32be](https://github.com/facebook/react/commit/e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](https://github.com/facebook/react/pull/31617)) //<lauren>//
- **[aba370f1e4](https://github.com/facebook/react/commit/aba370f1e4 )**: Add moveBefore Experiment ([#31596](https://github.com/facebook/react/pull/31596)) //<Sebastian Markbåge>//
- **[1345c37941](https://github.com/facebook/react/commit/1345c37941 )**: Mark all lanes in order on every new render ([#31615](https://github.com/facebook/react/pull/31615)) //<Sebastian Markbåge>//
- **[91061073d5](https://github.com/facebook/react/commit/91061073d5 )**: Mark ping time as update ([#31611](https://github.com/facebook/react/pull/31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](https://github.com/facebook/react/commit/a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](https://github.com/facebook/react/pull/31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](https://github.com/facebook/react/commit/c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](https://github.com/facebook/react/pull/31599)) //<lauren>//
- **[64f89510af](https://github.com/facebook/react/commit/64f89510af )**: [crud] Enable on RTR FB builds ([#31590](https://github.com/facebook/react/pull/31590)) //<lauren>//
- **[7558ffe84d](https://github.com/facebook/react/commit/7558ffe84d )**: [crud] Fix copy paste typo ([#31588](https://github.com/facebook/react/pull/31588)) //<lauren>//
- **[7c254b6576](https://github.com/facebook/react/commit/7c254b6576 )**: Log yielded time in the Component Track ([#31563](https://github.com/facebook/react/pull/31563)) //<Sebastian Markbåge>//
- **[6177b18c66](https://github.com/facebook/react/commit/6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](https://github.com/facebook/react/pull/31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](https://github.com/facebook/react/commit/eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](https://github.com/facebook/react/pull/31119)) //<Mark Skelton>//
- **[047d95e85f](https://github.com/facebook/react/commit/047d95e85f )**: [crud] Basic implementation ([#31523](https://github.com/facebook/react/pull/31523)) //<lauren>//
- **[92c0f5f85f](https://github.com/facebook/react/commit/92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](https://github.com/facebook/react/pull/31554)) //<Sebastian Markbåge>//
- **[053b3cb050](https://github.com/facebook/react/commit/053b3cb050 )**: [crud] Rename Effect type ([#31557](https://github.com/facebook/react/pull/31557)) //<lauren>//
- **[7dd6b9e68a](https://github.com/facebook/react/commit/7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](https://github.com/facebook/react/pull/31556)) //<lauren>//
- **[d8afd1c82e](https://github.com/facebook/react/commit/d8afd1c82e )**: [crud] Scaffold initial types ([#31555](https://github.com/facebook/react/pull/31555)) //<lauren>//
- **[3720870a97](https://github.com/facebook/react/commit/3720870a97 )**: Log Render Phases that Never Committed ([#31548](https://github.com/facebook/react/pull/31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](https://github.com/facebook/react/commit/8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path  ([#31547](https://github.com/facebook/react/pull/31547)) //<Sebastian Markbåge>//
- **[63cde684f5](https://github.com/facebook/react/commit/63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](https://github.com/facebook/react/pull/31524)) //<Zack Tanner>//
- **[b01722d585](https://github.com/facebook/react/commit/b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](https://github.com/facebook/react/pull/31536)) //<Sebastian Markbåge>//
- **[c13986da78](https://github.com/facebook/react/commit/c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](https://github.com/facebook/react/pull/31528)) //<Sebastian Markbåge>//
- **[4686872159](https://github.com/facebook/react/commit/4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](https://github.com/facebook/react/pull/31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](https://github.com/facebook/react/commit/5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](https://github.com/facebook/react/pull/31540)) //<lauren>//
- **[3644f0bd21](https://github.com/facebook/react/commit/3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](https://github.com/facebook/react/pull/31527)) //<Sebastian Markbåge>//
- **[8657869999](https://github.com/facebook/react/commit/8657869999 )**: Separate Tracks for Components and Phases ([#31525](https://github.com/facebook/react/pull/31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](https://github.com/facebook/react/commit/b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](https://github.com/facebook/react/pull/31539)) //<lauren>//

Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0

bypass-github-export-checks
jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D67018480

fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
2024-12-16 06:58:21 -08:00
Rubén NorteandFacebook GitHub Bot 18243d07e4 Customize log level in Fantom output (#48263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48263

Changelog: [internal]

Customize log level in Fantom based on flag in runner.js.

Reviewed By: javache

Differential Revision: D67199970

fbshipit-source-id: 31cdd2eaeee8e7ab4c8985661b35822d78d0457b
2024-12-16 06:03:03 -08:00
Rubén NorteandFacebook GitHub Bot d1293f6d44 Allow creating empty surfaces without using AppRegistry initialization paths (#48262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48262

Changelog: [internal]

At the moment, we can't start surfaces in Fabric without calling `AppRegistry.runApplication`.

This is completely unnecessary in cases like Fantom, where the creation of the surface is done manually from JS and we render to it immediately after (so we don't need to call into JS again to run AppRegistry).

Reviewed By: javache

Differential Revision: D67199971

fbshipit-source-id: e6402686b6f544a4a7651f6a21a57891ca6be3d1
2024-12-16 06:03:03 -08:00
Pieter De BaetsandFacebook GitHub Bot 173b65803d Store backfaceVisibility as boolean (#48268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48268

No need to store and compare strings here when a simple boolean will do.

Changelog: [Internal]

Reviewed By: NickGerleman, mdvacca

Differential Revision: D67204387

fbshipit-source-id: c78cc758797980c2bce11875e0f6ea1961058f05
2024-12-16 05:54:38 -08:00
Dmitry RykunandFacebook GitHub Bot eac4b32573 Rename the last remaining usage of parentShadowView.tag to parentTag (#48267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48267

`parentShadowView.tag` was renamed to `parentTag` in D66656411. This one callsite is hidden behind an `#ifdef`, so it didn't produce a compile error.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67203413

fbshipit-source-id: 8c1b1af616165b9a80bd38ab4d7376cb2f27cce5
2024-12-16 05:37:13 -08:00
Rubén NorteandFacebook GitHub Bot 358fd38825 Add scheduleTask and runWorkLoop to public API (#48284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48284

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / https://github.com/facebook/react-native/pull/48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Reviewed By: javache

Differential Revision: D67275518

fbshipit-source-id: acde0093802fbcb7083334f2c0247b37b759a6b1
2024-12-16 04:50:15 -08:00
zhongwuzwandFacebook GitHub Bot 5d67490574 Fabric: Fixes Numeric TextInput not triggering onSubmitEditing (#48276)
Summary:
Fixes https://github.com/facebook/react-native/issues/48259 . The paper code like :
https://github.com/facebook/react-native/blob/2fee13094b3d384c071978776fd8b7cff0b6530f/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L777-L784

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Numeric TextInput not triggering onSubmitEditing

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

Test Plan: Repro in https://github.com/facebook/react-native/issues/48259

Reviewed By: cipolleschi

Differential Revision: D67274739

Pulled By: javache

fbshipit-source-id: 57396c6e1a8ef96a1b29cae4a9aa9b5f48f6080b
2024-12-16 04:46:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 87b1bad45e ActivityIndicator: setting resource-id from the testID prop (#48271)
Summary:
Fixes https://github.com/facebook/react-native/issues/39092

Right now, the `testID` prop that is passed to the ActivityIndicator component is not being applied as a `resource-id`. In this PR, we overwrite the `onInitializeAccessibilityNodeInfo` in the `ProgressBarContainerView` to set this `resource-id`.

## Changelog:

[ANDROID][ADDED] - ActivityIndicator: setting `resource-id` from the `testID` prop

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

Test Plan:
Render a simple activity indicator and pass a `testID` as follows:

```tsx
import {ActivityIndicator} from 'react-native';

function Playground() {
  return (
    <ActivityIndicator
      color="white"
      testID="default_activity_indicator"
      accessibilityLabel="Wait for content to load!"
    />
  );
}
```

<details>
<summary>Inspect the element using an e2e tool such as Maestro or Appium, the `resource-id` is not present: (see screenshot)</summary>

<img width="736" alt="image" src="https://github.com/user-attachments/assets/3aecce5f-3850-4c62-b1ab-aed4133e12bc" />

</details>

 ---

Apply the changes and then:

<details>
<summary>Inspect again, the `resource-id` is present now: (see screenshot)</summary>

<img width="731" alt="image" src="https://github.com/user-attachments/assets/5a0e3bfa-924a-4a50-8eef-2f7fff7e1290" />

</details>

Reviewed By: rshest

Differential Revision: D67274852

Pulled By: javache

fbshipit-source-id: 2ac8d2bbebed5d1723eb33e735bbf3b477a42572
2024-12-16 04:42:38 -08:00
zhongwuzwandFacebook GitHub Bot 6076a41560 Fabric: Fixes LayoutConformanceView not work (#48253)
Summary:
Fixes iOS LayoutConformanceView not work, seems caused by https://github.com/facebook/react-native/issues/48188. NickGerleman can you help to review please?

## Changelog:

[IOS] [FIXED] - Fabric: Fixes LayoutConformanceView not work

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

Test Plan:
Before:
![image](https://github.com/user-attachments/assets/ca1f12c1-825b-4167-849d-b88f8ec54e21)

After:
![image](https://github.com/user-attachments/assets/c81b3192-8552-4147-b3af-3a8920a91d6c)

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D67195461

Pulled By: javache

fbshipit-source-id: 2f45d9a9aa2389ba7cb89e601e7225dbef4f7abf
2024-12-16 04:18:28 -08:00
Pieter De BaetsandFacebook GitHub Bot 5edd32bf3f Fix MacOS build (#48285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48285

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D67275514

fbshipit-source-id: 6512cbb090e90f827f643353a0a73c4f9516f651
2024-12-16 04:06:27 -08:00
Pieter De BaetsandFacebook GitHub Bot ba8136e41d Create TurboModule for test helpers (#48283)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48283

Migrate from custom JSI integration to use TurboModule base-class.

This doesn't use codegen right now for ease of migration, and to avoid needing to setup a js_library buck definition for react-native-fantom. We should also figure out what the right abstraction/division of responsibilities is going forward for TesterAppDelegate and FantomModule.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D67111850

fbshipit-source-id: e1623d80f1f25ec123315b3620930dd17dd8a8a7
2024-12-16 04:06:27 -08:00
Kræn HansenandFacebook GitHub Bot 2fee13094b App fails to build when Node binary path contains a space (#48275)
Summary:
Building RNTester fails locally because my node path contains a space " ".
(I'm using [fnm](https://github.com/Schniz/fnm) which installs into `/Users/{username}/Library/Application Support/fnm`).

I haven't verified this, but I suspect this is broken for other apps as well, as the script is called when bundling for any app.

<details>

<summary>Expand to see output from the failed build</summary>

```
Node found at: /Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node
+ DEST=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/RNTester.app
+ [[ ! -n '' ]]
+ [[ Release = *Debug* ]]
+ [[ -n '' ]]
+ case "$CONFIGURATION" in
+ DEV=false
+++ dirname ../react-native/scripts/react-native-xcode.sh
++ cd ../react-native/scripts/..
++ pwd
+ REACT_NATIVE_DIR=/Users/kraen.hansen/Repositories/react-native/packages/react-native
+ PROJECT_ROOT=/Users/kraen.hansen/Repositories/react-native/packages/rn-tester
+ cd /Users/kraen.hansen/Repositories/react-native/packages/rn-tester
+ [[ -n /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/js/RNTesterApp.ios.js ]]
+ :
+ source /Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/node-binary.sh
++ '[' -z '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node' ']'
++ type '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node'
+ HERMES_ENGINE_PATH=/Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine
+ '[' -z /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc/bin/hermesc ']'
+ [[ true != false ]]
+ [[ -f /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine ]]
+ '[' -z '' ']'
+ export NODE_ARGS=
+ NODE_ARGS=
+ '[' -z '' ']'
+ CLI_PATH=/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js
+ '[' -z '' ']'
+ BUNDLE_COMMAND=bundle
+ '[' -z '' ']'
+ COMPOSE_SOURCEMAP_PATH=/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/compose-source-maps.js
+ [[ -z '' ]]
+ CONFIG_ARG=
+ [[ -z '' ]]
+ BUNDLE_NAME=main
+ BUNDLE_FILE=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/main.jsbundle
+ EXTRA_ARGS=()
+ case "$PLATFORM_NAME" in
+ BUNDLE_PLATFORM=ios
+ '[' '' = YES ']'
+ EMIT_SOURCEMAP=
+ [[ ! -z ../sourcemap.ios.map ]]
+ EMIT_SOURCEMAP=true
+ PACKAGER_SOURCEMAP_FILE=
+ [[ true == true ]]
+ [[ true != false ]]
++ basename ../sourcemap.ios.map
+ PACKAGER_SOURCEMAP_FILE=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/sourcemap.ios.map
+ EXTRA_ARGS+=("--sourcemap-output" "$PACKAGER_SOURCEMAP_FILE")
+ [[ true != false ]]
+ [[ false == false ]]
+ EXTRA_ARGS+=("--minify" "false")
+ [[ -n '' ]]
+ [[ -n '' ]]
+ EXTRA_ARGS+=("--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config")
+ '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node' /Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js bundle --entry-file /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/js/RNTesterApp.ios.js --platform ios --dev false --reset-cache --bundle-output /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/main.jsbundle --assets-dest /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/RNTester.app --sourcemap-output /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/sourcemap.ios.map --minify false --config-cmd '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node  /Users/kraen.hansen/Repositories/react-native/packages/react-native/cli.js config'
/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: /Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node  /Users/kraen.hansen/Repositories/react-native/packages/react-native/cli.js config
/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory

    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:888:11)
    at execSync (node:child_process:960:15)
    at Command.handleAction (/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js:48:9)
    at Command.listener [as _actionHandler] (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:542:17)
    at /Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1502:14
    at Command._chainOrCall (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1386:12)
    at Command._parseCommand (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1501:27)
    at Command.parse (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1064:10)
    at Object.<anonymous> (/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js:71:11)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object.<anonymous> (node:internal/modules/cjs/loader:1689:10)
    at Module.load (node:internal/modules/cjs/loader:1318:32)
    at Function._load (node:internal/modules/cjs/loader:1128:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
    at node:internal/main/run_main_module:36:49 {
  status: 127,
  signal: null,
  output: [
    null,
    '',
    '/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory\n'
  ],
  pid: 64660,
  stdout: '',
  stderr: '/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory\n'
}

Node.js v22.11.0
Command PhaseScriptExecution failed with a nonzero exit code

warning: Run script build phase '[CP-User] [RN]Check FBReactNativeSpec' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-RCTFBReactNativeSpec' from project 'Pods')
warning: Run script build phase 'Build JS Bundle' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RNTester' from project 'RNTesterPods')
warning: Run script build phase '[RN] Copy Hermes Framework' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RNTester' from project 'RNTesterPods')
** BUILD FAILED **
```
</details>

This PR add single quotes around the `$NODE_BINARY` and `$REACT_NATIVE_DIR` to avoid `--config-cmd` escaping similarly to the way they're escaped when invoked just below: https://github.com/facebook/react-native/blob/00c7174c24fd15db7723633e3e67aa59a7e73a6c/packages/react-native/scripts/react-native-xcode.sh#L155

## Changelog:

[IOS] [FIXED] - Properly escape paths in Xcode build script used when bundling an app.

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

Test Plan:
- Change your node path to contain a space (possibly through a symlink and manually updating the `.xcode.env.local` file in `packages/rn-tester`.
- Build the RNTester app for e2e tests: `yarn e2e-build-ios`
- See the failure mentioned above 💥
- Apply this patch and re-run the build command to success 

Reviewed By: NickGerleman

Differential Revision: D67256815

Pulled By: robhogan

fbshipit-source-id: e27a8cd079347fdf982c28b5af347be621c8feba
2024-12-15 18:15:49 -08:00
Eric RozellandFacebook GitHub Bot 00c7174c24 Add override to RCTHermesInstance destructor (#48265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48265

For some clang warnings configurations, you may hit `-Winconsistent-missing-destructor-override` without this override modifier.

## Changelog

[Internal]

Reviewed By: cipolleschi

Differential Revision: D67203040

fbshipit-source-id: 51f8f9bc4e45ebdb008dc440b779302b1103668a
2024-12-13 16:44:01 -08:00
Eric RozellandFacebook GitHub Bot 9a2b807dcb Remove unnecessary semi-colon before method body (#48266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48266

For some clang build configurations the semi-colon triggers `-Wsemicolon-before-method-body`. This fixes that warning in iOS sources.

## Changelog

[Internal]

Reviewed By: cipolleschi

Differential Revision: D67203041

fbshipit-source-id: f2f2f3799691c3fc59e102a852ca2cf61154e55e
2024-12-13 16:44:01 -08:00
Christoph PurrerandFacebook GitHub Bot ae90dd3aaa Share TextLayoutManager.h across all platforms (#48210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48210

[Changelog] [Internal] - Share TextLayoutManager.h across all platforms

The goal of this change is to enable to share `TextLayoutManager.h` across all platforms, the same we do for:

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/imagemanager/ImageManager.h

Reviewed By: philIip

Differential Revision: D67064488

fbshipit-source-id: 15ee02f3c2351ad65590b5f0dee2f3dbbde4df32
2024-12-13 16:12:40 -08:00
Maddie LordandFacebook GitHub Bot c2fd35a442 Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null (#48226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48226

Adding logging to onHostPause to help diagnose cases when the activity is incorrectly null.

Reviewed By: fkgozali

Differential Revision: D67123351

fbshipit-source-id: f694a3a89e4584776050f6bca2f33f2805528d4b
2024-12-13 13:35:08 -08:00
Mateo GuzmánandFacebook GitHub Bot 81c74cd35f ScrollView: handling testID correctly for horizontal scroll view (#48254)
Summary:
Fixes https://github.com/facebook/react-native/issues/46180

This PR fixes the `testID` not being set as a `resource-id` in the `HorizontalScrollView`.

Currently the `resource-id` is being set correctly when we use a vertical scroll view (this is done [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java#L156) for reference) but we still miss setting this when we use a horizontal one as the managers for both components are different.

## Changelog:

[ANDROID][FIXED] - Handling `testID` correctly for horizontal scroll view

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

Test Plan:
Render a simple `ScrollView` component with `horizontal` set as `true` and pass a `testID` property as shown:

```tsx
function Playground() {
  return (
    <ScrollView testID="customScrollViewTestId" horizontal>
      <View
        style={{
          marginVertical: 400,
          backgroundColor: 'white',
          padding: 14,
          margin: 50,
          width: 200,
          height: 200,
        }}
      />
    </ScrollView>
  );
}
```

Open Maestro Studio and search for **customScrollViewTestId** in the search bar.

<details>
<summary>Before the fix: The `testID` is not found. (See screenshot)</summary>

![image](https://github.com/user-attachments/assets/9f1c6438-e105-468e-8bf4-4e2238824f9f)
</details>

<details>
<summary>See the same in Appium. (See screenshot)</summary>

<img width="900" alt="image" src="https://github.com/user-attachments/assets/4f1a7858-4549-45b2-bb5f-d0b3485e5d69" />

</details>

 ---

Apply this fix, and search again in Maestro Studio.

<details>
<summary>After the fix: The `testID` is now recognised and can be found in the search bar. (See screenshot)</summary>

![image](https://github.com/user-attachments/assets/371f6d1f-5a41-461b-b276-7c0e702ee1e2)
</details>

<details>
<summary>See the same in Appium. (See screenshot)</summary>

<img width="891" alt="image" src="https://github.com/user-attachments/assets/ef03310c-c1ab-4ef7-b2c5-60c3b8d84c10" />

</details>

Reviewed By: tdn120, mdvacca

Differential Revision: D67201619

Pulled By: javache

fbshipit-source-id: 016faf724a482e0eca6dedfbf94dd9ea56255757
2024-12-13 12:39:31 -08:00
Hanno J. GödeckeandFacebook GitHub Bot ed36e896ac feat: add getState for StateWrapperImpl (#48255)
Summary:
We're trying to pass `jsi::Value`s directly to our view components (and convert them to java/swift types manually). That way we can pass "complex" objects to our views (such as `jsi::Object`s with `NativeState` attached, without the need to convert them to e.g. `folly::dynamic`).

On android we store our complex prop values on the `StateWrapperImpl` to pass the complex types between c++ and java/kotlin. See an example here:

https://github.com/hannojg/nitro/blob/2378fe7754294c496b2cbcd62f7109529e276427/packages/react-native-nitro-image/nitrogen/generated/android/c%2B%2B/JValueFromStateWrapper.cpp#L21-L23

```
  const auto& customStateData = dynamic_cast<const ConcreteState<CustomStateData>&>(state);
  CustomStateData data = customStateData.getData();
  std::shared_ptr<HybridTestObjectSwiftKotlinSpec> nativeProp = data.nativeProp;
```

> (And then it might be used in java like this:)
https://github.com/hannojg/nitro/blob/2378fe7754294c496b2cbcd62f7109529e276427/packages/react-native-nitro-image/android/src/main/java/com/margelo/nitro/image/NitroExampleViewManager.java#L31-L38

```kotlin
public Object updateState(NonNull View view, ReactStylesDiffMap props, StateWrapper stateWrapper) {
   StateWrapperImpl stateWrapperImpl = (StateWrapperImpl) stateWrapper;

    HybridTestObjectSwiftKotlinSpec nativeProp = ValueFromStateWrapper.valueFromStateWrapper(stateWrapperImpl);
    long value = nativeProp.getBigintValue();
    Log.d("NitroExampleViewManager", "Value from state: " + value);
```

For that we need to be able to access the underlying state, which is what we added in this PR.

## 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 `getState` method for `StateWrapperImpl`

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

Test Plan: Internal change, just make sure all tests are passing

Reviewed By: cipolleschi

Differential Revision: D67196130

Pulled By: javache

fbshipit-source-id: 7da74bcddef79abd3122baaad1bfce30330ecc80
2024-12-13 10:02:32 -08:00
Hanno J. GödeckeandFacebook GitHub Bot ecf17666ad fix(android): fix mapbuffer jni headers not found consuming react-native from prefab (#48243)
Summary:
I was getting build errors when I tried to include `StateWrapperImpl.h` in my library's code on android. The error was:
![CleanShot 2024-12-12 at 15 02 44@2x](https://github.com/user-attachments/assets/bffb69f4-f80c-4610-9ad7-bd8098ac5340)

```
node_modules/react-native/ReactAndroid/build/prefab-headers/reactnative/react/fabric/StateWrapperImpl.h:11:10: fatal error: 'react/common/mapbuffer/JReadableMapBuffer.h' file not found
#include <react/common/mapbuffer/JReadableMapBuffer.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 1 error generated.
```

The problem is that the map buffer files inside the mapbuffer folder are nested, so the prefab outcome looks like this:

![CleanShot 2024-12-12 at 14 53 26@2x](https://github.com/user-attachments/assets/ccd8c738-e887-40ba-a83b-38a7d2103d36)

Hence it can't resolve the header path.

This change removes the header prefix part as its not needed, since the nested folder structure in mapbuffer already matches what we need, see:

https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/main/jni/react/mapbuffer

## 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 build issue when including mapbuffer jni headers in library code

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

Test Plan:
make sure the header path looks correct in the prefab build dir:

![CleanShot 2024-12-12 at 14 41 43@2x](https://github.com/user-attachments/assets/72598263-8775-4551-ab4a-91e9c9496b61)

Reviewed By: cipolleschi

Differential Revision: D67200010

Pulled By: cortinico

fbshipit-source-id: 127a17392fcca0a3a07643497729979849f0a17a
2024-12-13 09:32:15 -08:00
Rubén NorteandFacebook GitHub Bot edb3850adb Log status code when commands fail (#48222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48222

Changelog: [internal]

Tiny improvement over the current setup so it might help detect some current issues.

Reviewed By: yungsters

Differential Revision: D67021976

fbshipit-source-id: 7829f2ea0d839178f1a50d176b42dc0906c2e585
2024-12-13 08:10:59 -08:00
Nick GerlemanandFacebook GitHub Bot 06751aa0d1 "experimental_layoutConformance" ViewProp -> "experimental_LayoutConformance" component (#48188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48188

Yoga is full of bugs! Some of these bugs cannot be fixed without breaking large swaths of product code. To get around this, we introduced "errata" to Yoga as a mechanism to preserve bug compatibility, and an `experimental_layoutConformance` prop in React Native to create layout conformance contexts. This has allowed us to create more compliant layout behavior for XPR.

This prop was originally designed as a context-like component, so you could set a conformance level at the root of your app, and individual components could change it for compatibility. This was difficult to achieve at the time, without introducing a primitive like `LayoutConformanceView`, which itself participated in the view tree. This prop has not been the desired end-goal, since it does not make clear that it is setting a whole new context, effecting children as well!

Now that we've landed support for `display: contents`, we can achieve this desired API pretty easily.

**Before**

```
import {View} from 'react-native';

// Root of the app
<View {...props} experimental_layoutConformance="strict">
  {content}
</View>

```

**After**

```
import {View, experimental_LayoutConformance as LayoutConformance} from 'react-native';

// Root of the app
<LayoutConformance mode="strict">
  <View {...props}>
    {content}
  </View>
</LayoutConformance>

```

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66910054

fbshipit-source-id: e6a304b5c30ad3c5845a7ce2d1021996a74c2f34
2024-12-12 14:57:04 -08:00
zhongwuzwandFacebook GitHub Bot 4adaacb4f7 Exclude Android HorizontalScrollContentView cxx component code (#48138)
Summary:
Exclude Android HorizontalScrollContentView cxx component code, iOS don't need it. cc NickGerleman can you help to review? :)

## Changelog:

[IOS] [FIXED] - Exclude Android HorizontalScrollContentView cxx component code

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

Test Plan: iOS don't include any Android HorizontalScrollContentView code.

Reviewed By: christophpurrer

Differential Revision: D67127853

Pulled By: NickGerleman

fbshipit-source-id: 7901aa7bf62eada58d973e07e8a95e4d595c1ea5
2024-12-12 14:50:59 -08:00
Pieter De BaetsandFacebook GitHub Bot 49a594a513 Remove references to legacy JSC SamplingProfiler
Summary:
This module is no longer functional, the global method `pokeSamplingProfiler` does not exist. There are no implementations in the core of `JSCSamplingProfiler` (removed back in 2019! - https://www.internalfb.com/diff/D10473627)

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D67140119

fbshipit-source-id: 9dfe80d63e935004ef4a1956e8a7a544a2f9a8c1
2024-12-12 14:43:18 -08:00
Pieter De BaetsandFacebook GitHub Bot e06fa5d102 Remove legacy JSC HeapCapture (#48239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48239

The native method this module references (`nativeCaptureHeap`) no longer exists, and Metro no longer emits this command.

Changelog: [Android][Removed] Removed JSCHeapCapture module, deprecated PackagerCommandListener#onCaptureHeapCommand

Reviewed By: fabriziocucci

Differential Revision: D67140120

fbshipit-source-id: 7c318366c38868c8a0c589473b6abadd0a09bdde
2024-12-12 14:43:18 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot a2db0ba9c4 Add expectedReleaseValue to RN Feature Flags (#48073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48073

Small change so we can know what the final value of the feature flag will be

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D64077789

fbshipit-source-id: 2a9e2c7ceeb18813b4556f92db547697bba966a5
2024-12-12 13:55:35 -08:00
Hanno J. GödeckeandFacebook GitHub Bot d6919526a6 feat: RawPropsParser add useRawPropsJsiValue parameter (#48231)
Summary:
In this PR we added a change that allows the RawPropsParser to construct its RawValues directly from the `jsi::Value` instead of converting it to `folly::dynamic` first.
We added a global feature flag to turn this on, however, for migrations it might be better to use this functionality as an opt-in on a component basis. With this change `ComponentDescriptors` can now create their RawPropsParser instance with the `useRawPropsJsiValue` flag to opt into it.

(Note: a few more changes are needed to make this accessible to the `ComponentDescriptor`, for which I opened [this follow up PR here](https://github.com/facebook/react-native/pull/48232))

## 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 `useRawPropsJsiValue` parameter to `RawPropsParser` to opt into skipping folly::dynamic conversions during prop parsing.

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

Test Plan: Internal change / just make sure all tests are passing.

Reviewed By: NickGerleman

Differential Revision: D67139641

Pulled By: javache

fbshipit-source-id: 5b243edb8149870aad0a5a1b3998ee67997783d7
2024-12-12 12:52:16 -08:00
Pieter De BaetsandFacebook GitHub Bot fd5bd3e5de Pass JSI Dynamic filter callback by ref (#48242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48242

This std::function is immediately invoked, no need to copy it around.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D67093042

fbshipit-source-id: 2b863fb1857da73568afaf6f3d3c8c7bbef0d61b
2024-12-12 11:38:36 -08:00
Hanno J. GödeckeandFacebook GitHub Bot feff4a7556 feat(android): allow passing filter function for prop folly::dynamic conversion (#48202)
Summary:
### Motivation

- We need to exclude certain prop keys from conversion to `folly::dynamic` on android for our custom use case where we pass down `jsi::object`s with NativeState attached down the props

Otherwise we run into crashes such as:

![CleanShot 2024-12-11 at 09 18 26@2x](https://github.com/user-attachments/assets/b460187e-5442-4547-ae36-ffd188f444f2)

### Changes

- `dynamicFromValue` was marked as `noexcept` although it can throw, I removed the `noexcept` for correctness
- Made it so you can pass down a filter function to exclude certain props from conversion (using the existing mechanism for that)
	- I think there is no way to pass a filter function and retain it in `RawProps` as that is constructed very early on in `UIManagerBinding`

## 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] - Allow passing a filter function to `BaseViewProps` to exclude certain props on android from being dynamically casted

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

Test Plan:
You can try modifying for example `ScrollViewProps.cpp` and pass a fourth argument to `ViewProps` to confirm that the filtering is working:

```cpp
ScrollViewProps::ScrollViewProps(
    const PropsParserContext& context,
    const ScrollViewProps& sourceProps,
    const RawProps& rawProps)
    : ViewProps(context, sourceProps, rawProps, [&](const std::string& keyName){
        return true;
    }),
```

Reviewed By: NickGerleman

Differential Revision: D67088540

Pulled By: javache

fbshipit-source-id: ed8cf5d773d357dfc54553f5ccf7adf27c781d56
2024-12-12 11:38:36 -08:00
CHEN Xian-anandFacebook GitHub Bot 1763321c89 Support system font families on iOS (#47544)
Summary:
Apple introduced system font families

```
font-family: system-ui;
font-family: ui-sans-serif;
font-family: ui-serif;
font-family: ui-monospace;
font-family: ui-rounded;
```

for Safari at 2020 (see https://developer.apple.com/videos/play/wwdc2020/10663/?time=872).

This PR implementation supports above font families on iOS.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS

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

Test Plan: Run `RNTester` and view the `Text` component where shows the usage for those font families.

Reviewed By: NickGerleman

Differential Revision: D65761307

Pulled By: cipolleschi

fbshipit-source-id: 18628160b7753b314389e887cddfe9d0ec96ee1d
2024-12-12 10:50:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 61e876ef89 Convert HelloWorld to Swift (#48246)
Summary:
This PR converts the HelloWorld app to Swift. The HelloWorld app is our internal copy of the Template and the template is now using Swift. It's important that this macroscopic changes are synched between the template and HelloWorld, otherwise we risk to ship changes that works in the helloworld app but that break the template, and therefore the next release. That already happened once this month.

## Changelog:
[Internal] - Migrate HelloWorld app to swift

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D67143408

Pulled By: cipolleschi

fbshipit-source-id: f74412116570e44c2a394173f7d4d3b6dd85e2e5
2024-12-12 10:44:27 -08:00
Christoph PurrerandFacebook GitHub Bot 59c72e9d29 (Almost) align Android TextLayoutManager interface with iOS one (#48209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48209

[Changelog] [Internal] - (Almost) align Android TextLayoutManager interface with iOS one

This change aligns the public API surface of `TextLayoutManager` from RN Android closer to the RN iOS one.

Reviewed By: javache

Differential Revision: D67061225

fbshipit-source-id: b06f47c7e322bdac429cefb85bf2f2a80210a64f
2024-12-12 10:22:25 -08:00
Christoph PurrerandFacebook GitHub Bot 26f4c78aa2 Use ShadowNode::Traits instead of directly enable Yoga measurement (#48223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48223

[Changelog] [Internal] - Use ShadowNode::Traits instead of directly enable Yoga measurement

The goal of this change is to simple use ShadowNodeTraits to enable measurement of ShadowNode props

Reviewed By: NickGerleman

Differential Revision: D67114097

fbshipit-source-id: dccb0f9b83f339c07ca41678533d97191277b520
2024-12-12 10:15:39 -08:00
Nick GerlemanandFacebook GitHub Bot a28867f952 Remove home-rolled yarn caching (#48237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48237

Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944.

D59917944 added logic to only do yarn caching on main, but it has some correctness issues:
1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways.
2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution).

We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367`

Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67140004

fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
2024-12-12 09:13:52 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9f4b4aba93 Test Old Arch with Maestro (#48244)
Summary:
This pr tests the Old Arch on the Template app using Maestro

## Changelog:
[Internal] - Test old arch in CI with Maestro for template app

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D67141524

Pulled By: cipolleschi

fbshipit-source-id: bef3a9b6fec9d7c91d858d534a2d00e91f1842b5
2024-12-12 09:01:31 -08:00
Pieter De BaetsandFacebook GitHub Bot 8fc4e8b35b Use registerCallableModule consistently (#48238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48238

Use the helper module we have, which has better type-safety and less code duplication.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D67139572

fbshipit-source-id: 39ae9119d97f937b30ad6e7451468cbb3cc37a84
2024-12-12 08:30:58 -08:00
Pieter De BaetsandFacebook GitHub Bot c06f13e7fb Error when using runTask in a re-entrant way (#48235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48235

Recursively calling runTask is not supported, as the inner call will no-op since we're already executing the eventloop.

Currently errors are not correctly propagated, but this at least makes it so that we don't attempt to schedule the task either, which could lead to incorrect assumptions being made.

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D67107664

fbshipit-source-id: e665a96671f4812308d87aec3b880ce2009328e2
2024-12-12 08:09:02 -08:00
Hanno J. GödeckeandFacebook GitHub Bot 9dce26215b feat: add RawPropsParser as optional parameter to Concrete-/ComponentDescriptor (#48232)
Summary:
In this PR we introduced a new mechanism for `RawPropsParser` to construct its RawValues directly from `jsi::Value` instead of converting it to `folly::dynamic` first:

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

In this PR we added a parameter to `RawPropsParser` to opt-into using the above described mechanism:

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

Whats missing is that `RawPropsParser` was default constructed in `ComponentProvider` and there is no way to pass a custom instance (where you'd for example set the above described parameter). This PR adds support for that.

## 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 `RawPropsParser` as optional parameter to Concrete-/ComponentDescriptor

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

Test Plan: Internal change, just make sure all CI tests are passing.

Reviewed By: cipolleschi

Differential Revision: D67135357

Pulled By: javache

fbshipit-source-id: 45f384d42314976c16cae10d5ea0419d13fd0889
2024-12-12 07:26:21 -08:00
Nick GerlemanandFacebook GitHub Bot f4a17fbb93 Add missing glog dep to React-idlecallbacksnativemodule.podspec (#48241)
Summary:
`react_native_assert` on iOS uses glog under the hood, and https://github.com/facebook/react-native/pull/47911 added usage to a new podspec, which means new entire binary under some build modes. Need to add missing dependency I think?

Changelog: [Internal]

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

Test Plan: tes_ios_helloworld passes with DynamicLibraries

Reviewed By: cipolleschi

Differential Revision: D67141052

Pulled By: NickGerleman

fbshipit-source-id: 299a499f40e9b54c4aca5d6e1c95c43ce933fb2b
2024-12-12 06:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 6059660c60 Ship feature flag shouldSkipStateUpdatesForLoopingAnimations by default (#48224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48224

Changelog: [General][Fixed] Removed unnecessary state updates in React to reflect the current state of looping animations.

This enables that feature flag by default and prepares for an incoming cleanup.

Reviewed By: yungsters, dmytrorykun

Differential Revision: D67109980

fbshipit-source-id: 3c98731221b0fb01a8d49d537df859fe23c0ae45
2024-12-12 05:41:01 -08:00
Rubén NorteandFacebook GitHub Bot 11c49d60cc Make feature flags module and overrides read-only (#48229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48229

Changelog: [internal]

The type definitions for these objects (the exported value by the `ReactNativeFeatureFlags` module, and the input value for `ReactNativeFeatureFlags.override()` method) were writable objects, which is incorrect and causes other problems down the line.

This just makes them read-only.

Reviewed By: yungsters

Differential Revision: D67109719

fbshipit-source-id: 8d56e05042587a53cdd05e51b4207ef27ace2d91
2024-12-12 05:41:01 -08:00
Eric RozellandFacebook GitHub Bot e04738b7ec Disable weak event emitter in AttributedString for Mac Catalyst (#48225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48225

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

The weak event emitter in AttributedString attributes is causing a serialization error when typing into a TextInput in a Mac Catalyst build. We can resolve this by not putting the event emitters in the attributed string, but this is likely to cause other issues with event handling for nested <Text> components.

## Changelog

[iOS][Fixed] - Workaround for Mac Catalyst TextInput crash due to serialization attempt of WeakEventEmitter

Reviewed By: NickGerleman

Differential Revision: D66664583

fbshipit-source-id: efdfbcb0db4d5e6b9bf7c14f9bbb221faae2d724
2024-12-12 05:39:51 -08:00
Alex HuntandFacebook GitHub Bot 9888b499f5 Add support for Performance.mark events in PerformanceTracer (#48200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48200

Wires up `Performance.mark()` events, completing support for User Timings in Fusebox.

Other changes:

- Refactors `reportMeasure` to receive a `duration`.
- Fixes conversion for time values (ms -> µs) in emitted trace events.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D66704283

fbshipit-source-id: 352abbade26eb976e793481dde04463431bf2eb7
2024-12-12 04:40:43 -08:00
Alex HuntandFacebook GitHub Bot fd9cdf3214 Add new Fusebox Tracing API, integrate into PerformanceEntryReporter (2/2) (#48043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48043

Adds a new `PerformanceTracing` API to replace `ReactPerfLogger` and `FuseboxTracer`.

- Mostly a clone of `FuseboxTracer`, with small refactorings.
- Exposes a new `CdpTracing.h` header, intended for shared CDP/Chrome types (that will later propagate through to the runtime impl of `performance.mark,measure()`).
- These live in a new `jsinspector_tracing` library, to avoid a dependency cycle.

**Key change**: With both diffs, `PerformanceTracer` is added to `PerformanceEntryReporter` to initially wire up the `performance.measure` event — replacing the previous routing.

- `FuseboxTracer` remains load-bearing for the out-of-tree call to `stopTracingAndWriteToFile()`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66650181

fbshipit-source-id: 9092257f23cdb8746e69f5ff3eb7dbf4c8142938
2024-12-12 04:40:43 -08:00
Alex HuntandFacebook GitHub Bot 59969b6135 Remove Fusebox calls from ReactPerfLogger, rename (1/2) (#48044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48044

Updates `ReactPerfLogger` (now renamed `ReactPerfettoLogger`) to log to Perfetto only.

This precedes integrating `FuseboxTracer` calls into `PerformanceEntryReporter` for User Timing events and Interaction events.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66600278

fbshipit-source-id: f250f6b018d091d740bb13d5fcce9b716c4a6f72
2024-12-12 04:40:43 -08:00
Mateo GuzmánandFacebook GitHub Bot 79ed11f8f4 fix(rn-tester): text input and xml http request dark mode adjustments (#48207)
Summary:
Was troubleshooting in these modules recently and noticed a few texts off in dark mode. Replacing a few instances of the Text component in all I could see in the two screens.

## Changelog:

[INTERNAL] - RN Tester `TextInput` & `XMLHttpRequest` dark mode adjustments

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

Test Plan:
<details>
<summary>View Screenshots (before fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 36](https://github.com/user-attachments/assets/c396bc5d-4b3c-4f63-8ac0-68bc808aa9d4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 21](https://github.com/user-attachments/assets/cd8e5a2f-9066-4bc7-b56b-65dbd6df7dc4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 30](https://github.com/user-attachments/assets/da451c18-40cd-4421-b8f5-a2462f82fee9) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 23](https://github.com/user-attachments/assets/32925fdb-f983-439f-b898-6986b739895a) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 19](https://github.com/user-attachments/assets/f0db7b49-dfef-4abc-aef0-2d55b016c0f8) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 16](https://github.com/user-attachments/assets/bad6dc45-3679-4bb6-aadd-6743053cd90f) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 10](https://github.com/user-attachments/assets/43028f51-c6e2-4b26-b20d-a3639606d6d5) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 07](https://github.com/user-attachments/assets/f8e2196e-bc64-4507-b330-d1d85730ddff) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 59](https://github.com/user-attachments/assets/a7100770-4b38-421f-9b73-09e4fff9e012) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 53](https://github.com/user-attachments/assets/27759c8c-0e56-4b92-8173-ba031b994e5c) | | | |

</details>

<details>
<summary>View Screenshots (after fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 30](https://github.com/user-attachments/assets/71c0287d-d98a-4bfe-85dc-1e08da12ce43) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 26](https://github.com/user-attachments/assets/45eac165-f42a-4193-98cc-3ee85d963382) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 23](https://github.com/user-attachments/assets/c0e4432d-2d1d-487f-8965-3829c3257364) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 19](https://github.com/user-attachments/assets/ab81500c-66c1-4b90-b2b1-f7c490e0029b) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 16](https://github.com/user-attachments/assets/aafcad74-e851-49a8-9db0-df06f81f0b30) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 11](https://github.com/user-attachments/assets/29a2a6c8-e448-4c90-844d-29a248f9ab69) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 07](https://github.com/user-attachments/assets/54e505c4-c554-4000-aac1-61b97e034f55) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 39](https://github.com/user-attachments/assets/0e91dc29-199d-424e-b36a-6b0f7a317cd2) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 22](https://github.com/user-attachments/assets/e965b01d-0b03-4d01-a971-57c3bd550146) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 15](https://github.com/user-attachments/assets/50ef03a6-bf1a-4db3-845b-e98373369574) |  |  |

</details>

Reviewed By: cipolleschi

Differential Revision: D67087492

Pulled By: javache

fbshipit-source-id: c9c64377d8c10d965bc5db7783aa80f099ce858a
2024-12-12 04:07:10 -08:00
Mateo GuzmánandFacebook GitHub Bot dffa57fa25 Exclude packages/react-native/ReactAndroid/build from lint checks (#48217)
Summary:
When running the linter locally, noise is generated from the `packages/react-native/ReactAndroid/build` folder. This folder does not need to be checked, as it is already excluded in the [.gitignore](https://github.com/facebook/react-native/blob/main/.gitignore#L33).

## Changelog:

[INTERNAL] - Exclude `packages/react-native/ReactAndroid/build` from lint checks

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

Test Plan:
```bash
yarn lint
```

Reviewed By: huntie

Differential Revision: D67134035

Pulled By: cortinico

fbshipit-source-id: f314c8601d6a3bf8ac6ebed67bdc392c6a6aeba8
2024-12-12 03:12:32 -08:00
Panos VekrisandFacebook GitHub Bot e5a526ff44 remove as_const option (on by default) in fbsource (#48227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48227

This option is on by default in Flow v0.256

Reviewed By: gkz

Differential Revision: D67117062

fbshipit-source-id: 1595afe48178529ad43b33a215d84ff225cf9fa9
2024-12-12 02:01:35 -08:00
Andrew CoatesandFacebook GitHub Bot 849407ae6f Fix no return static analysis error in SchedulerPriorityUtils.h (#47911)
Summary:
In react-native-windows our static analysis tools report an error for `timeoutForSchedulerPriority` due to cases where it may not always return a value.  This is an upstreaming of the patch we have to fix that error.

## Changelog:

[INTERNAL] [FIXED] - Fix no return static analysis error in SchedulerPriorityUtils.h

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

Test Plan: Building should be sufficient.

Reviewed By: christophpurrer

Differential Revision: D66992063

Pulled By: NickGerleman

fbshipit-source-id: 999fea328d0c66ad92314f537e41beff5856c285
2024-12-12 01:31:18 -08:00
Chi TsaiandFacebook GitHub Bot e34c1e9bd2 Add default implementation for Object.create(prototype) (#47946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47946

Object creation with custom prototype can currently be done, but it is
unnecessarily convoluted. Users have to call into the global object to
get the `Object.create` function, then call it with the custom
prototype.

This diff adds a JSI API for Object.create(prototype) to make it easy
for users.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D66485209

fbshipit-source-id: 32018f847190ac16f695f011a78be0c45c4c4659
2024-12-12 01:14:00 -08:00
Chi TsaiandFacebook GitHub Bot 04f33ecd58 Add default implementation for Object.getPrototypeOf and Object.setPrototypeOf (#47996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47996

Getting and setting an Object's prototype is convoluted. Users have to
call into the global object to get the method, then call it.

This diff adds a JSI API for Object.getPrototype and Object.setPrototype
to make it easy for users.

Changelog: [Internal]

Reviewed By: fbmal7

Differential Revision: D66562549

fbshipit-source-id: 85a2e49deb9d00500544de4cc5ab123c4717398e
2024-12-12 01:14:00 -08:00
Christoph PurrerandFacebook GitHub Bot 07d723cb72 Remove unused (Android) TextLayoutManager getter (#48208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48208

[Changelog] [Internal] - Remove unused (Android) TextLayoutManager getter

This getter
```
void* getNativeTextLayoutManager() const;
```
is not used on Android and different in signature to the iOS one:
```
std::shared_ptr<void> getNativeTextLayoutManager() const;
```
Deleting it for now to make future code sharing between various platforms easier.

This change removes further the by now discouraged pattern of:
```
using SharedTextLayoutManager = std::shared_ptr<const TextLayoutManager>;
```
and changes callers to use
```
std::shared_ptr<const TextLayoutManager>;
```
directly.

Reviewed By: javache

Differential Revision: D67059514

fbshipit-source-id: b94dc7f664083c5c62c4ba7defca480549ca9dc1
2024-12-11 23:45:21 -08:00
hoxyq (Meta Employee)andFacebook GitHub Bot a80baac58e Remove comment syntax from ReactNativeTypes (#31457)
Summary:
# Summary

I'm working to get the main `react-native` package parsable by modern
Flow tooling (both `flow-bundler`, `flow-api-translator`).

This diff trivially removes some redundant Flow comment syntax in
`ReactNativeTypes.js`, which fixes parsing under these newer tools.

## How did you test this change?

Files were pasted into `react-native-github` under fbsource, where Flow
validates .

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

Reviewed By: huntie

Differential Revision: D67100354

Pulled By: hoxyq

fbshipit-source-id: 575e4bd8ceefad15576273920a263ae89d027cad
2024-12-11 22:47:38 -08:00
Sam ZhouandFacebook GitHub Bot 7000b9b76c Add annotations and casts to fix future flow error (#48219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48219

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D67099060

fbshipit-source-id: fbb975d6194b071aa8f30dcd2b8f7f40130d31fb
2024-12-11 14:16:58 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3ff9212ce4 Fix React-graphics podspec source_files (#48216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48216

The `React-graphics` podspec is manually excluding some paths from the source_files but this approach is error prone. For esample changes that added new paths that must be excluded can create failures.

This change the podspec file to explicitly add only the files that iOS requires.

## Changelog:
[iOS][Changed] - Explicitly define the source files for React-graphics

## Facebook:
This change is necessary because we added the macos platform that was not included before and now we can't build RNTester from fbsource using the internal pipeline.

Reviewed By: hoxyq

Differential Revision: D67095677

fbshipit-source-id: 701d5938f6e141a313be62c8f930a089e1d6ee96
2024-12-11 08:48:31 -08:00
Hanno J. GödeckeandFacebook GitHub Bot 03d2186ace Construct RawValue directly from jsi::Value (#48047)
Summary:
### Motivation:

We are looking for a way to access the "raw" jsi value in our fabric view components, so that we can pass complex types like `HostObjects` or `jsi::Object` with `NativeState` attached to our components directly.
Currently the props are converted from `jsi::Object` to `folly::dynamic`, which prevents us from accessing these values directly.

### Changes

This PR is a implementation of the proposal discussed here:

- https://github.com/facebook/react-native/pull/44966#issuecomment-2503915245

These changes extend `RawValue` so that it can be directly constructed from `RawValue(Runtime*, jsi::Value&)` (not just from `folly::dynamic`).

`RawValue`s are created by the `RawPropParser.cpp`. By default it will use the `RawValue(folly::dynamic)` constructor, but we added a feature flag called `useRawPropsJsiValue`, which will sue the JSI constructor.
This enables to test this feature at runtime incrementally.

This change might also be tested on a component basis, by setting a flag in the component descriptor to enable JSI prop parsing for the RawPropParser, as outlined in this PR:

- https://github.com/hannojg/react-native/pull/2

## 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 `useRawPropsJsiValue` feature flag to represent props internally as `jsi::Value`s instead of converting them to `folly::dynamic`

[General] [Added] - Added `RawValue(Runtime*, jsi::Value&)` constructor to make a `RawValue` from a `jsi::Value`.

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

Test Plan: Enable the `useRawPropsJsiValue` feature flag and test the rn-tester app on android and iOS. Make sure you get no new errors / warnings in the native console.

Reviewed By: NickGerleman

Differential Revision: D66877093

Pulled By: javache

fbshipit-source-id: 7342e5f86d2492ad63a9ccf5508f04e7eb252def
2024-12-11 08:38:12 -08:00
Juliusz WajgeltandFacebook GitHub Bot 7d0338cb0b fix incorrect mmap file offset in JSBigFileString (#48198)
Summary:
`JSBigFileString` incorrectly passes the file offset to `mmap`, causing errors when `offset` is non-zero.

## Changelog:
[GENERAL] [FIXED] - `JSBigFileString` fails for non-zero offset arguments

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

Test Plan: - verify the new unit test passes

Reviewed By: cipolleschi

Differential Revision: D67086826

Pulled By: javache

fbshipit-source-id: 0991bb34a710b85ff0263dc553efb85ba62b4cd8
2024-12-11 08:24:50 -08:00
Mitya KononchukandFacebook GitHub Bot 477489ce84 Fix running fantom tests via buck-test (#48215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48215

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D66976980

fbshipit-source-id: d553c2f702d6928fb0ad88fcc2c6f04160a65d02
2024-12-11 07:07:10 -08:00
Ben HandanyanandFacebook GitHub Bot 462fae4a29 Use configuration type when adding ndebug flag to pods in release (#48193)
Summary:
While I was [working on fixing the iOS debugger logic](https://github.com/facebook/react-native/pull/48174) based on configuration name regex match, I wanted to know if other logic was also based on configuration names. I think I found and fixed the only other configuration name-based logic in the repo in this PR.

## 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] - Use configuration type when adding ndebug flag to pods in release

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

Test Plan:
In a fresh react-native project, I added to the Podfile:
```ruby
    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.xcconfigs.each do |config_name, config_file|
          is_release = aggregate_target.user_build_configurations[config_name] == :release
          puts "aggregate_targets #{config_name} is_release: #{is_release}"
        end
    end

    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
          is_release = config.type == :release
          puts "target_installation_results #{config.name} is_release: #{is_release}"
      end
    end
```

to confirm my logic. It output the following:
```
aggregate_targets Release is_release: true
aggregate_targets Local is_release: false
...
target_installation_results Local is_release: false
target_installation_results Release is_release: true
...
```

I also updated the applicable tests I could find for this logic.

Reviewed By: cortinico

Differential Revision: D67025325

Pulled By: cipolleschi

fbshipit-source-id: 45d68ee86e3255d843275a72916883c8c4bbc13d
2024-12-11 04:37:48 -08:00
Christoph PurrerandFacebook GitHub Bot 7d771de8a7 Share common ShadowNode functionality in BaseTextInputShadowNode for iOS (#48164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48164

[Changelog] [Internal] - Share common ShadowNode functionality in BaseTextInputShadowNode for iOS

The current Android and iOS implementations have quite some overlapping functionality. Not sharing common logic makes it also harder to reuse this [functionality] for out of tree platforms.

This change moves the current iOS implementation into a shared location.
The next change allows to reuse it for Android.

Reviewed By: NickGerleman

Differential Revision: D66901676

fbshipit-source-id: a870155633875377d881fbd9f41fafb305672949
2024-12-10 18:05:42 -08:00
Pieter De BaetsandFacebook GitHub Bot 93c6be496e Configure __RCTProfileIsProfiling for perfetto builds (#48201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48201

For any build for which we enable the perfetto build flag, we should probably enable the `__RCTProfileIsProfiling` so we get systrace markers.

Changelog: [Internal]

Reviewed By: bgirard

Differential Revision: D67031171

fbshipit-source-id: 5e7f56f911acacd3156778bd9151202fc809e291
2024-12-10 16:53:05 -08:00
Mateo GuzmánandFacebook GitHub Bot 9ecf290d27 Paper: TextInput maxLength is not working in old arch (#48126)
Summary:
Fixes https://github.com/facebook/react-native/issues/47563

It seems like a regression from https://github.com/facebook/react-native/issues/45401, where it was aimed to fix `onChangeText` being called multiple times when changing the text programmatically in an input with the `multiline` prop set as true.

This PR reverts that partially, as the `maxLength` check is not being evaluated correctly before setting the text. Not reverting it completely as when removing the second part of the fix, the `onChangeText` gets called multiple times again.

## Changelog:

[IOS] [FIXED] - Fixing TextInput `maxLength` not working in old arch

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

Test Plan:
The issue could be reproduced in the rn-tester. See my videos with the before and after the fix.

<details>
<summary>Before:</summary>

https://github.com/user-attachments/assets/86fd67eb-fc14-469a-a5f8-8e83b49f857c

</details>

<details>
<summary>After:</summary>

https://github.com/user-attachments/assets/368383b1-c1bd-4e0b-ac44-c78022462fa0

</details>

Reviewed By: cortinico

Differential Revision: D67025182

Pulled By: cipolleschi

fbshipit-source-id: 720c400eef362618106ae434aef421c7529214fe
2024-12-10 11:57:48 -08:00
zhongwuzwandFacebook GitHub Bot d20897f6d4 Fabric: Fixes transform when there are multiple values that contain a matrix (#47477)
Summary:
Fixes https://github.com/facebook/react-native/issues/47467 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes transform when there are multiple values that contain a matrix

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

Test Plan: Repro in Fixes https://github.com/facebook/react-native/issues/47467

Reviewed By: javache

Differential Revision: D65594337

Pulled By: cipolleschi

fbshipit-source-id: 50f255e753e2f233415099c3fbdd0e43b0afefc0
2024-12-10 10:29:29 -08:00
Mateo GuzmánandFacebook GitHub Bot 9a21b99918 Making RCTNetworking js exports consistent (#48166)
Summary:
Fixes https://github.com/facebook/react-native/issues/39260

Right now, there is a small issue when you try debugging the Networking library methods as it seems like they are empty in Android. This is not an actual functional issue as everything in code works fine, but rather an inconsistency in how the iOS and Android methods are being exported. In iOS it was exported as an object, in Android it was a class.

## Changelog:

[INTERNAL] - Making `RCTNetworking` js exports consistent

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

Test Plan:
I've checked that `XMLHttpRequest` is still working as expected, as this is used mostly there.

And below there are screenshots of how the module methods are logged after the refactor. Which addresses what was reported in the linked issue.

```js
import {Networking} from 'react-native';
import AndroidNetworking from 'react-native/Libraries/Network/RCTNetworking.android.js';
import IOSNetworking from 'react-native/Libraries/Network/RCTNetworking.ios.js';

console.log({Networking, AndroidNetworking, IOSNetworking});
```

Before | After
-- | --
<img width="1196" alt="image" src="https://github.com/user-attachments/assets/b7ab1dcd-9dd1-4ed9-ade5-d90251a77d5e"> | <img width="1196" alt="image" src="https://github.com/user-attachments/assets/5ae17c6a-b068-462a-b228-576dcf08ef12">

Reviewed By: fabriziocucci

Differential Revision: D67022711

Pulled By: javache

fbshipit-source-id: 81f9988295fb3f559a795077f09ee0f14827dc86
2024-12-10 10:17:42 -08:00
Rubén NorteandFacebook GitHub Bot 6ba8b65e9f Remove legacy ReactNativeConfig abstraction (#47247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47247

Changelog: [internal]

Bye bye `ReactNativeConfig` 👋.

All existing usages of the API have been cleaned up or migrated to `ReactNativeFeatureFlags`, so this is no longer needed.

Reviewed By: GijsWeterings

Differential Revision: D65062306

fbshipit-source-id: 76afcd48ad72023b6dc2a90955ae2f03a1164cca
2024-12-10 09:34:27 -08:00
Rubén NorteandFacebook GitHub Bot c24f963330 Make ReactNativeConfig an empty interface (#47246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47246

Changelog: [internal]

Just to use CI to verify there are no more existing usages of the API before cleaning it up.

Reviewed By: GijsWeterings

Differential Revision: D65062302

fbshipit-source-id: e1b71d39ef1fba23cc68e36fe0a0b57cfc2a614e
2024-12-10 09:34:27 -08:00
Pieter De BaetsandFacebook GitHub Bot 746d584a23 Fix animation.stop not being flushed (#48199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48199

`animatedShouldUseSingleOp` relies on a queue always being active, or for a call to `flushQueue` later down the line. If these are missing, a call will be queued up but only executed whenever the next animation flush happens.

Changelog: [General][Fixed] Animation.stop() executes when `animatedShouldUseSingleOp` is enabled.

Reviewed By: yungsters

Differential Revision: D67025831

fbshipit-source-id: 66a7f50d833b7bbaf9f16dd04d24b90c7a699fa0
2024-12-10 09:24:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8ab524312a Skip hidden folders when looking for third party components (#48182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48182

Maintainers from SVG reached out because of an edge case they inencountered when generating the ComponentProvider. In their setup, they had a `.git` folder in the repo and the algorithm was spending a lot of time crawling the git folder.

In general, we should avoid crawling hidden folders.

This change fix that.

## Changelog:
[General][Fixed] - Skip hidden folders when looking for third party components.

Reviewed By: javache

Differential Revision: D66959345

fbshipit-source-id: 992a79f3cff22cd6a459e0272c8140bc329888da
2024-12-10 02:32:10 -08:00
Blake FriedmanandFacebook GitHub Bot 538fa01fb3 Add Changelog for 0.77.0-rc.2 (#48192)
Summary:
Add Changelog for 0.77.0-rc.2

Changelog: [Internal] - Add Changelog for 0.77.0-rc.2

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

Reviewed By: christophpurrer

Differential Revision: D66998575

Pulled By: blakef

fbshipit-source-id: 4dbfa3cae00b69ed8dd199a2b36cbd095ef4cbc2
2024-12-10 01:57:59 -08:00
Alex Taylor (alta)andFacebook GitHub Bot 8aeba2a3b8 Deploy 0.256.0 to xplat (#48190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48190

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66979174

fbshipit-source-id: d94e8c42edd225fe367aac75e55d2c1d054acc07
2024-12-10 01:47:05 -08:00
Blake FriedmanandFacebook GitHub Bot 3b079f38f4 Add Changelog for 0.76.5 (#48191)
Summary:
Add Changelog for 0.76.5

Changelog: [Internal] - Add Changelog for 0.76.5

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

Reviewed By: christophpurrer

Differential Revision: D66993996

Pulled By: blakef

fbshipit-source-id: 4d69bcea64822aa108c2bac24a3ab399aacd5419
2024-12-09 23:31:40 -08:00
Andrew DatsenkoandFacebook GitHub Bot a298ccabe2 Add snapshot update / delete capability (#48096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48096

Changelog: [Internal]

Managing snapshot state internally by adding / updating snapshot data.

Reviewed By: christophpurrer

Differential Revision: D66707175

fbshipit-source-id: 0366d834eafa0ca702f03de0210392181fd90a58
2024-12-09 19:09:57 -08:00
Andrew DatsenkoandFacebook GitHub Bot a8a136f3ef Add .toMatchSnapshot() (#48029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029

Changelog: [Internal]

Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.

# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed

Reviewed By: christophpurrer

Differential Revision: D66601387

fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
2024-12-09 19:09:57 -08:00
Andrew DatsenkoandFacebook GitHub Bot a4a2c2867a Add jest-snapshot (#48095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48095

Changelog: [Internal]
Add `jest-snapshot` `v29.7.0`

Reviewed By: christophpurrer

Differential Revision: D66714069

fbshipit-source-id: 783584519e95b337d36c4a00610bcd970a041d4d
2024-12-09 19:09:57 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 6d235853fb Fix background getting clipped when border-radius is set (#47939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47939

Before we were clipping Android background drawable to the padding box. This is not how its done on web.

The background should remain under the border so that if the border is traslucent you can see the background underneath

Reviewed By: NickGerleman

Differential Revision: D66463305

fbshipit-source-id: 427acea760b2748a07cc28bbd362aaaae0811093
2024-12-09 18:35:45 -08:00
Christoph PurrerandFacebook GitHub Bot 0b866aa40d Share common (Base)TextInputState properties (#48133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48133

[Changelog] [Internal] -  Share common (Base)TextInputState properties

This change allows to share common TextInput State properties between various platforms.

Reviewed By: rshest

Differential Revision: D66855831

fbshipit-source-id: d0f85c419b82445ac84bfcc606f1bf752f5dba73
2024-12-09 15:02:58 -08:00
heoblitzandFacebook GitHub Bot 331d99a941 Update YGNodeStyleGetGap to return YGValue (#47973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47973

Gap can be styled using both `points` and `percentages`, but YGNodeStyleGetGap currently returns a float value.

To maintain alignment with the `padding` and `margin` functionalities and allow it to be handled in bridging code, this function has been updated to return YGValue.

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

Reviewed By: joevilches

Differential Revision: D66513236

Pulled By: NickGerleman

fbshipit-source-id: b7110855c037f20780f031f22a945bde4446687d
2024-12-09 13:38:05 -08:00
Pieter De BaetsandFacebook GitHub Bot 4ec4a85b1b Unbreak OSS Android CI (#48186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48186

Broken by https://github.com/facebook/react-native/commit/37c532a063c6054ea974612a40551f7c1399c147 since we use different OkHttp versions internally and in open-source.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66968229

fbshipit-source-id: a110cec0f9bd55e6ae5c90b766e8e6220703e6c3
2024-12-09 13:11:18 -08:00
Christoph PurrerandFacebook GitHub Bot 7ea5deb802 Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState (#48161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48161

[Changelog] [Internal] -  Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState

This data is set, but never read

Reviewed By: javache

Differential Revision: D66904641

fbshipit-source-id: 4db1cd49e9ec63b62f75070b478d2006ea101f8c
2024-12-09 11:22:57 -08:00
Nick LefeverandFacebook GitHub Bot aef13d1f43 Enable shadow node reference updates by default (#48180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48180

Changelog: [Internal]

Releasing runtime shadow node reference updates, enabling it by default now that the fix for RN Windows landed.

Reviewed By: javache

Differential Revision: D66959896

fbshipit-source-id: dcf1c4a7257fe60ae0faffe1952fc2c80effe406
2024-12-09 10:52:21 -08:00
Pieter De BaetsandFacebook GitHub Bot c31b42aaa2 Fix flow-type of selectionColor (#48184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48184

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66962089

fbshipit-source-id: cd45784d830a12a620800290235a5a1cad3097f3
2024-12-09 10:20:12 -08:00
Jakub PiaseckiandFacebook GitHub Bot 47822e9048 Fix adjustsFontSizeToFit for strings with a single character (#47082)
Summary:
Fixes https://github.com/facebook/react-native/issues/47045

On Android `adjustsFontSizeToFit` relies on two metrics:
- Text with line breaks results in more lines than `maximumNumberOfLines`
- The overall height of the text is larger than the available height

None of these two was fulfilled when a single-character string had a higher width than the available one (a single character will not be broken into multiple lines). This PR adds exactly that as a third option to trigger the scaling algorithm - a single-character string that has a higher width than the available one.

On iOS `adjustsFontSizeToFit` relies on `truncatedGlyphRangeInLineFragmentForGlyphAtIndex` which seems to be returning `NSNotFound` when a single-character sting gets truncated. Similarly to Android, this PR adds an additional check to make sure that single-character strings actually fit inside the container.

## Changelog:

[GENERAL] [FIXED] - Fixed `adjustsFontSizeToFit` not working for text with a single character

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

Test Plan:
Tested on the code from the issue:

|Android (old arch)|Android (new arch)|iOS (old arch)|iOS (new arch)|
|-|-|-|-|
|<img width="406" alt="android_old" src="https://github.com/user-attachments/assets/91b1af41-4ef7-46cc-bb04-374f860d93ac">|<img width="406" alt="android_new" src="https://github.com/user-attachments/assets/90e3cde1-e6c0-4b25-8325-c62a37773002">|<img width="546" alt="ios_old" src="https://github.com/user-attachments/assets/902b9c10-84e0-4372-bcc8-07cd1ef006f6">|<img width="546" alt="ios_new" src="https://github.com/user-attachments/assets/f4df4f0e-7649-47f3-9c81-e38f8665d9a2">|

Reviewed By: javache

Differential Revision: D64664351

Pulled By: NickGerleman

fbshipit-source-id: b68f318a0fbd5ebed947a70d1e3fb0515b5fb409
2024-12-09 10:12:10 -08:00
Ben HandanyanandFacebook GitHub Bot eda4f185b3 Enable hermes debugger by configuration type instead of configuration name (#48174)
Summary:
Fixes an [issue](https://github.com/facebook/react-native/issues/48168) where only iOS configurations with "Debug" in the name are configured to use the hermes debugger.

## 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] [FIXED] - Enable hermes debugger by configuration type instead of configuration name

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

Test Plan:
Added new test scenarios that all pass:
```
ruby -Itest packages/react-native/scripts/cocoapods/__tests__/utils-test.rb
Loaded suite packages/react-native/scripts/cocoapods/__tests__/utils-test
Started
Finished in 0.336047 seconds.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
56 tests, 149 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
166.64 tests/s, 443.39 assertions/s
```

In a personal project with the following configurations:
```
project 'ReactNativeProject', {
    'Local' => :debug,
    'Development' => :release,
    'Staging' => :release,
    'Production' => :release,
  }
```
I added the following to my Podfile:
```
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        puts "#{config.name} is debug? #{config.type == :debug}"
    end
end
```
To confirm that my logic is correct:
```
Local is debug? true
Development is debug? false
Staging is debug? false
Production is debug? false
```

Reviewed By: robhogan

Differential Revision: D66962860

Pulled By: cipolleschi

fbshipit-source-id: 7bd920e123c9064c8a1b5d45df546ff5d2a7d8be
2024-12-09 08:51:00 -08:00
Pieter De BaetsandFacebook GitHub Bot 0916d530f0 Allow CookieJar to be disabled in NetworkingModule (#48113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48113

Processing cookies can have a non-trivial impact on startup-time. It requires reading OkHttp's `PublicSuffixDatabase` but also allocating various WebKit components. Instead handle the cookiejar being set to non-CookieJarContainer instances gracefully, which allows a custom client builder to set `CookieJar.NO_COOKIES`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66787514

fbshipit-source-id: bf790691496f674ec743ba4791552b12e06eda29
2024-12-09 08:37:32 -08:00
Mateo GuzmánandFacebook GitHub Bot 37c532a063 test(image): [android] react okhttp network fetcher cache control tests (#47953)
Summary:
This is a follow up for the new cache control options for the Android Image component introduced in https://github.com/facebook/react-native/issues/47182, https://github.com/facebook/react-native/issues/47348 & https://github.com/facebook/react-native/issues/47426. And to make sure the cache control header works as expected and avoid missing the issue fixed in https://github.com/facebook/react-native/issues/47922, this PR introduces test cases to make sure this is getting applied as expected in the `ReactOkHttpNetworkFetcher`.

## Changelog:

[INTERNAL] [ADDED] - `ReactOkHttpNetworkFetcher` cache control tests

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: rshest

Differential Revision: D66498305

Pulled By: javache

fbshipit-source-id: 7a9a0cc596e49964943e59189614743ca8a472a1
2024-12-09 07:36:46 -08:00
Rubén NorteandFacebook GitHub Bot 3cc67fed36 Add Fantom mode for development with Hermes bytecode (#48178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178

Changelog: [internal]

Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).

Reviewed By: rshest

Differential Revision: D66888986

fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 4d07fb7662 Use enum for Fantom modes (#48179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179

Changelog: [internal]

Migrating this type to an enum, which is safer, because it prevents errors like:

```
// when it's actually 'dev'
if (mode === 'development') {

}
```

Reviewed By: rshest

Differential Revision: D66888985

fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 07a7b63fdd Only prewarm in CI (#48151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48151

Changelog: [internal]

We have global setup step in Fantom to prewarm caches to properly attribute test running time, but this isn't necessary when running tests locally. Attribution isn't as important there. This disables the prewarming step so we can run individual tests as fast as we can.

Reviewed By: sammy-SC

Differential Revision: D66877990

fbshipit-source-id: 1f33c19a3c537c1c0e499fd7a6c405450cb9f86d
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 82abba9936 Implement warmup for optimized mode (#48150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48150

Changelog: [internal]

We're starting to have some Fantom tests that run in optimized mode, but we're not currently prewarming for that case. This adds that capability to do proper attribution of run time for tests.

Reviewed By: javache

Differential Revision: D66877991

fbshipit-source-id: dccb80cd6a4f664de7df0661456bad78d960826d
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 47589f53b1 Add tests for Fantom modes (#48123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48123

Changelog: [internal]

This verifies that the modes specified in the pragmas are applied correctly.

Reviewed By: andrewdacenko

Differential Revision: D66822377

fbshipit-source-id: 420f21f171c5d356ab91b49f7a33345386f6f0c0
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot d05214665c Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc. (2nd attempt) (#48117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48117

Changelog: [internal]

Re-land https://github.com/facebook/react-native/pull/48087 with some CI fixes.

Reviewed By: rshest

Differential Revision: D66820310

fbshipit-source-id: 1df4559c1daf5ec0085b299d702ce36deaa681b5
2024-12-09 05:05:07 -08:00
Pieter De BaetsandFacebook GitHub Bot 351b1bae95 Use OkHttp3 for NetworkingModuleTest (#48012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48012

Match the OkHttp version we use for NetworkingModule and FrescoModule, to unblock pulling in D66498305

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66595222

fbshipit-source-id: 1c29b061866be5d8bcc87aaa0c8a1de846198e4e
2024-12-09 05:00:41 -08:00
Nicola CortiandFacebook GitHub Bot 8babc21b79 Convert com.facebook.react.jstasks to Kotlin (#48147)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48147

This converts all the classes inside `com.facebook.react.jstasks` to Kotlin

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D66875442

fbshipit-source-id: 0a9d485e3902626a04db5e7a1a0ccad32b2bc44c
2024-12-09 04:17:14 -08:00
Blake FriedmanandFacebook GitHub Bot 4165884b70 Add Changelog for 0.76.4 (#48163)
Summary:
Add Changelog for 0.76.4

Changelog: [Internal] - Add Changelog for 0.76.4

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

Reviewed By: cipolleschi

Differential Revision: D66908649

Pulled By: blakef

fbshipit-source-id: cb64fcc5dbc6a1f758d99f99c451f24374fd4768
2024-12-07 09:46:51 -08:00
Christoph PurrerandFacebook GitHub Bot e9f92fad0a Remove unused code in AndroidTextInputShadowNode.h|cpp (#48136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48136

[Changelog] [Internal] -  Remove unused code in AndroidTextInputShadowNode.h|cpp

A bit of code clean-up to simplify a planned refactoring of this class

Reviewed By: rshest

Differential Revision: D66862820

fbshipit-source-id: 88114d8711b572f105d804cdddc6c087c94e3f49
2024-12-06 20:38:43 -08:00
Dmitry RykunandFacebook GitHub Bot 6200a4d330 Annotate the experimental image prefetching API as @UnstableReactNativeAPI (#48120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48120

This diff annotates the experimental image prefetching API as `UnstableReactNativeAPI` instead of `Deprecated`.

Changelog: [Internal]

Reviewed By: cortinico, philIip

Differential Revision: D66822045

fbshipit-source-id: a95ef3112a621a0735d4dcda0aed6078be7d7a38
2024-12-06 17:49:40 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 4102aa4a6b Revise iOS's implementation of ensureNoOverlap for borders (#48094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48094

There were a few math inaccuracies in the algorithm for overlapping radii. After fixing there were also minor pixel differences on the unit tests but this is the most correct implementation.

Also, improved the algorithm's verbiage since stuff like "EdgeInset" is not really related and is misleading to what the algorithm is actually doing. (Edge Insets play no part in this)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66728227

fbshipit-source-id: 56a6d59504e784fc245ed6fe306402a15cfd9611
2024-12-06 16:05:44 -08:00
Joe VilchesandFacebook GitHub Bot 0b40cb8b7f Use crossAxisOwnerSize instead of ownerHeight in cross axis bound call (#48080)
Summary:
X-link: https://github.com/facebook/yoga/pull/1763

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

Small bug that I noticed while doing intrinsic sizing. We have the ownerHeight as the axis size despite bounding the length of the cross axis. This should therefore be the crossAxisOwnerSize, which might be the width in some cases

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66736539

fbshipit-source-id: 528fc438b3327cd6f7890ea0ba408e4ce7b0f02c
2024-12-06 15:34:06 -08:00
Pieter De BaetsandFacebook GitHub Bot 3c5019a376 Remove enableFabricRendererExclusively feature-flag (#48157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48157

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D66787414

fbshipit-source-id: f27cc551fd7ceabf9fc656db2810476815fce1bf
2024-12-06 14:49:10 -08:00
Zeya PengandFacebook GitHub Bot 4238299bf3 Allow setting debugID on all types of AnimatedNode and Animation (#48129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48129

Continuation of https://github.com/facebook/react-native/pull/48106

* Every AnimatedNode subclasses now have an optional `config` arg as last arg in constructor. `Animation` base constructor already takes in config with debugID, since last PR.
* thread down debugID value to all the native configs

Changelog: [Internal] Allow setting debugID on all types of AnimatedNode and Animation

Reviewed By: yungsters

Differential Revision: D66834935

fbshipit-source-id: 18e5cbc3f701114ef945a237cb5944ef5eb6408e
2024-12-06 14:47:30 -08:00
Christoph PurrerandFacebook GitHub Bot d47ff26f37 Allow to provide a custom TextLayoutManager for cxx platform (#48127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48127

[Changelog] [Internal] -  Allow to provide a custom TextLayoutManager for cxx platform

This change allows target platforms to pass a platform specific or app specific TextLayoutManager implementation

Reviewed By: zeyap

Differential Revision: D66802434

fbshipit-source-id: a64e28d357bf601c7234b43f86538f49e62c8435
2024-12-06 13:38:58 -08:00
Blake FriedmanandFacebook GitHub Bot 05b4146270 ci: verify JS build artifacts aren't committed (#48091)
Summary:
Building our JS packages dirties the repo. This makes sure we don't
accidentally commit these to the repo, as it'll break Flow tests with an
obscure error message.

Changelog: [Internal]

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

Test Plan:
Ran this locally, the GH lint action should run on this PR.
I'll intentionally add a build artifact to validate.
| A | B | C |
| - | - | - |
| ![CleanShot 2024-12-04 at 14 11 16@2x](https://github.com/user-attachments/assets/11c05c32-12c8-4d85-9a28-b3bdffb42ea0) | ![CleanShot 2024-12-04 at 14 11 22@2x](https://github.com/user-attachments/assets/b4c4f1dc-2cb9-4138-8931-13e71c015a6d) | ![CleanShot 2024-12-04 at 14 19 31@2x](https://github.com/user-attachments/assets/953bf783-57ba-4832-bbd8-b36e23a2ccb4) |

Reviewed By: cipolleschi

Differential Revision: D66760144

Pulled By: blakef

fbshipit-source-id: 81f20fa0a83d5f17b5773d1608664b683ba74409
2024-12-06 13:21:23 -08:00
Kudo ChienandFacebook GitHub Bot e42a3a6b84 Migrate jsc-android to mavenCentral (#47972)
Summary:
Since people mostly use Hermes, it doesn't make sense to download jsc-android from npm even when jsc is not used. This PR migrates the jsc-android to [mavenCentral](https://repo1.maven.org/maven2/io/github/react-native-community/jsc-android/2026004.0.0/). The new jsc-android supports Android 16KB memory page sizes and packaged by prefab.
Relevant PRs:
  - https://github.com/react-native-community/jsc-android-buildscripts/pull/184
  - https://github.com/react-native-community/jsc-android-buildscripts/pull/185

## Changelog:

[ANDROID] [CHANGED] - Migrate jsc-android to mavenCentral

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

Test Plan: CI passed

Reviewed By: cipolleschi

Differential Revision: D66772407

Pulled By: cortinico

fbshipit-source-id: e34d2d138996e394763ef67d7aad65bb3e7b13dc
2024-12-06 12:50:34 -08:00
Dmitry RykunandFacebook GitHub Bot c9ac94a000 Rename shouldNotify to shouldNotifyLoadEvents (#48100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48100

This diff renames `shouldNotify` to `shouldNotifyLoadEvents` as it is named in the spec.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66769660

fbshipit-source-id: 64282c08ab82101d51dedb583e0c34476ed90eeb
2024-12-06 12:06:33 -08:00
Mateo GuzmánandFacebook GitHub Bot f5506dc1d0 Migrate HeadlessJsTaskEventListener to Kotlin (#48103)
Summary:
Migrate `HeadlessJsTaskEventListener` to Kotlin

## Changelog:

[INTERNAL] - Migrate `HeadlessJsTaskEventListener` to Kotlin

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: javache

Differential Revision: D66814483

Pulled By: cortinico

fbshipit-source-id: 5aef4ce020f97164845e3e0d53a107c7e407a6aa
2024-12-06 12:06:20 -08:00
Nicola CortiandFacebook GitHub Bot 4560fc0497 Fix crash on HeadlessJsTaskService on old architecture (#48124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48124

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

The logic in HeadlessJsTaskService is broken. We should not check whether `getReactContext` is null or not.
Instead we should use the `enableBridgelessArchitecture` feature flag to understand if New Architecture was enabled or not.

The problem we were having is that `HeadlessJsTaskService` was attempting to load the New Architecture even if the user would have it turned off. The Service would then die attempting to load `libappmodules.so` which was correctly missing.

Changelog:
[Android] [Fixed] - Fix crash on HeadlessJsTaskService on old architecture

Reviewed By: javache

Differential Revision: D66826271

fbshipit-source-id: 2b8418e0b01b65014cdbfd0ec2f843420a15f9db
2024-12-06 12:05:58 -08:00
Nicola CortiandFacebook GitHub Bot ddfa2120ba Cleanup NoRetryPolicy unnecessary visibility. (#48146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48146

The NoRetryPolicy class is `internal`. Having those `public` modifiers on methods has no effect
and can be safely removed.

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D66875443

fbshipit-source-id: 64c63c7000617cf94c36ce3d25927d3a270ac370
2024-12-06 12:05:53 -08:00
Tim YungandFacebook GitHub Bot 8793b7d89b RN: Backout "Scheduling Animated End Callbacks in Microtask" (#48132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48132

Backs out D63573322 and D65645981, reverting the change that makes callbacks passed to `animation.start(<callback>)` scheduled for execution in a microtask.

This is being reverted becuase the latency introduced by the current macro and pending micro tasks can introduce visible latency artifacts that diminish the fidelity of animations.

Changelog:
[General][Changed] - Reverts #47503. (~~Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.~~)

Reviewed By: javache

Differential Revision: D66852804

fbshipit-source-id: 08434b9876813fe9e8b189b6b467198933843bf0
2024-12-06 12:05:46 -08:00
Thomas NardoneandFacebook GitHub Bot f15fe4b8a1 Convert WebSocketModule to Kotlin (#47491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47491

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65502519

fbshipit-source-id: fa75416a27f809701837e8e1b96d7fe3a1ea040a
2024-12-06 09:22:30 -08:00
Kræn HansenandFacebook GitHub Bot acecf99c38 Update build-hermes-xcode.sh to fail faster (#47894)
Summary:
While debugging an error building hermes from source in a React Native app, I kept getting this weird error:

> Building for 'iOS-simulator', but linking in dylib ({redacted}/ios/Pods/hermes-engine/destroot/Library/Frameworks/ios/hermes.framework/hermes) built for 'macOS'

The root cause was a call to `cmake` failing, but `/sdks/hermes-engine/utils/build-hermes-xcode.sh` didn't exit on the error and instead continued building the hermes.framework from the dummy frameworks created by `./sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh`.

I suggest fixing this by introducing a `set -e` call similar to that used in `build-hermesc-xcode.sh`:
https://github.com/facebook/react-native/blob/2f523f0acf3b589bf962d5d20d2c04e453baf1da/packages/react-native/sdks/hermes-engine/utils/build-hermesc-xcode.sh#L7

## Changelog:

[Internal] - Ensure building hermes from source exits early on failures

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

Test Plan:
I followed https://github.com/facebook/hermes/blob/main/doc/ReactNativeIntegration.md getting to a state of building a React Native app with Hermes built from source. I then introduced an error in `hermes/API/hermes/hermes.cpp` (I simply typed `asd` in the top of the file) and built the app from Xcode:

![Screenshot 2024-11-22 at 15 13 04](https://github.com/user-attachments/assets/c8c4a1e2-3bf1-4d08-b9f9-583dba3df159)

If you scroll up, you can see the failed cmake build, but it just continues trying to build the framework, effectively hiding the error:

![Screenshot 2024-11-22 at 15 14 19](https://github.com/user-attachments/assets/3accf7b1-1667-42fc-b9c0-01fd9b1c2d8f)

When applying this patch and cleaning the build folder, the error is more prominent and actionable:

![Screenshot 2024-11-22 at 15 18 27](https://github.com/user-attachments/assets/f01afd6c-c1bb-4e87-9d28-dcdea41feb3e)

Reviewed By: andrewdacenko

Differential Revision: D66494603

Pulled By: dmytrorykun

fbshipit-source-id: dbeeba17b4cc1101001c9628914135bea6006d4a
2024-12-06 09:08:58 -08:00
Blake FriedmanandFacebook GitHub Bot ae775aff5d Danger shouldn't warn for package.json changes (#48148)
Summary:
Someone always has to merge in from Meta, so this is just noise.
Refactored some of this older code.

Changelog: [Internal]

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

Test Plan:
This PR, but this doesn't build a lot of confidence:

 {F1973526183}

Reviewed By: rubennorte

Differential Revision: D66876722

Pulled By: blakef

fbshipit-source-id: 52e1f15577f8f057ceee9427af65df43f152bffa
2024-12-06 08:48:55 -08:00
Rubén NorteandFacebook GitHub Bot c54ba09d2e Add package.json script to run Fantom tests (#48144)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48144

Changelog: [internal]

Adds package.json script to run Fantom tests:

```
yarn fantom
```

NOTE: At the moment, this only works on Meta's infra. We're working on making this available in OSS/Github CI.

Reviewed By: javache

Differential Revision: D66874962

fbshipit-source-id: d9746428b618a31ce0bf96c3233828cdba501dd6
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 81fbd18410 Move remaining Fantom files to react-native-fantom (#48143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143

Changelog: [internal]

Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.

Reviewed By: javache

Differential Revision: D66874763

fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 923b194e47 Rename ReactNativeTester as just Fantom (#48142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48142

Changelog: [internal]

This is the default export from the `react-native/fantom` package and it makes sense to be called that way. Also, this is similar to the `jest` global.

Reviewed By: javache

Differential Revision: D66874225

fbshipit-source-id: 8b43a637ebb42b5b1acb9ea5a6dbedd4c1a4f9e0
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 3fafc9f9cf Rename FantomRenderedOutput as getFantomRenderedOutput to follow convention (#48141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48141

Changelog: [internal]

This just aligns the file name with the common convention to name modules with the same name as their default export (if any).

Reviewed By: javache

Differential Revision: D66874227

fbshipit-source-id: 2a619b434c26a29f1774cba1c32ba711b1a7af46
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot ba8d184b77 Move render output tests to ReactNativeTester (#48140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48140

Changelog: [internal]

These tests test an API that's part of `ReactNativeTester` (will be renamed as `Fantom`) so it makes sense that they're in the same test file as the tests for the rest of the API.

Reviewed By: javache

Differential Revision: D66874226

fbshipit-source-id: f17e14c83cb5ca95ac619c5398c49ad84a27cfa5
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot b253b0fe94 Create @react-native/fantom package (#48125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48125

Changelog: [internal]

This just moves the runtime modules for Fantom to its own package.

Reviewed By: javache

Differential Revision: D66825478

fbshipit-source-id: ac4dbc23b86895f09abc46345d497c1c53737ae2
2024-12-06 05:24:31 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8d3c9ec3a1 Exclude mapping generation of core component (#48145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48145

While writing the docs for 0.77, I found an edge case in the generation of the RCTThirdPartyComponentProvider:
* If the app has the `codegenConfig` field set in the `package.json`
* And it does not have the `ios.componentProvider` field is not provided

Codegen was generating the mapping for the react-native core components. That's not expected as, in that case, it should only generate components that are declared in the app or in libraries.

This change fixes this edge case.

## Changelog:
[Internal] - Exclude mapping generation of core component

Reviewed By: blakef

Differential Revision: D66875080

fbshipit-source-id: 65fe10381729ec7808efec70feacf2a55f0056e9
2024-12-06 05:05:48 -08:00
hyochanandFacebook GitHub Bot 3efbe33ce0 Add pointerEvents support to Text component (#48081)
Summary:
This PR adds `pointerEvents` to the `TextProps` type.

### Motivation:
The `pointerEvents` property is already supported in `Text` components internally, but it was missing from the TypeScript definitions. By adding it to `TextProps`, developers can now use this property with full type safety and without TypeScript errors.

This is a type-only change and does not introduce any functional modifications.

## Changelog:

[GENERAL] [ADDED] - Added `pointerEvents` to `TextProps` type.

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

Test Plan:
As this is a type-only update:
- Verified that the `pointerEvents` property is now recognized when used with `Text` components in TypeScript projects.
- Ensured there are no runtime changes or regressions by testing existing `Text` components for expected behavior.

Reviewed By: cipolleschi

Differential Revision: D66753454

Pulled By: javache

fbshipit-source-id: c8f21b11daa6001a309b1d29fd6259101d11f5d2
2024-12-06 03:56:14 -08:00
Pieter De BaetsandFacebook GitHub Bot 4134b1c60d Pass around parentTag instead of parentShadowView (#48062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48062

We never need the full ShadowView representation of `parent` and this is significantly cheaper to construct and pass around.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66656411

fbshipit-source-id: 0b20e04c6beb95c498350085ec06fd57d1c11237
2024-12-06 03:31:04 -08:00
Zeya PengandFacebook GitHub Bot 87ec0965a2 Allow setting debugID on AnimatedValue and TimingAnimation (#48106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48106

This could make it easier to locate and debug AnimatedValue and driver from native - so far on the native side of animated, the only way to identify an Animation driver or AnimatedNode is integer IDs and the type, which made it difficult to debug when surface gets complicated

Here I only enabled it for AnimatedValue and TimingAnimation, because
* TimingAnimation is most commonly used
* all the animation drivers (frames, spring, decay) can only drive Value type of AnimatedNode on the native side, so it's the primitive component of AnimatedNode

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D66790298

fbshipit-source-id: ddd64a5728120f061aa902f25c93b1701617031b
2024-12-06 02:40:30 -08:00
Chi TsaiandFacebook GitHub Bot c6f12254d1 Add default getStringData/getPropNameIdData implementation (#47530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47530

Adds the default implementation for `getStringData`/`getPropNameIdData`
for VMs that do not provide their own implementation

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D65638889

fbshipit-source-id: 0a97569433c09ffafbd08fec5d9c9fbf5639b778
2024-12-06 01:35:18 -08:00
Christoph PurrerandFacebook GitHub Bot e9f279117e Allow to provide a custom ImageManager for cxx platform (#48109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48109

[Changelog] [Internal] -  Allow to provide a custom ImageManager for cxx platform

This change allows target platforms to pass a platform specific or app specific ImageManager implementation

Reviewed By: javache

Differential Revision: D66788794

fbshipit-source-id: d7e99cae5de0a4c60047763dce368271dd191b9c
2024-12-05 19:00:39 -08:00
Rubén NorteandFacebook GitHub Bot 7a81fd7a8a Migrate all feature flags to pragmas (#48098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48098

Changelog: [internal]

TSIA. No more manual feature flag overrides in Fantom tests :D

Reviewed By: sammy-SC

Differential Revision: D66760120

fbshipit-source-id: a0493d6ca57f4fdad33a0667e3af99ed0f0b66ca
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot be9b076087 Add support for specifying feature flags in pragmas (#48097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48097

Changelog: [internal]

As per title, this allows us to specify both common and JS-only feature flags for tests in the docblock as pragmas (in the same pragma separated by spaces, or in different pragmas). E.g.:

```
/**
 * fantom_flags commonTestFlag:true
 * fantom_flags jsOnlyTestFlag:true
 */
```

The feature flags are overridden automatically for us before the tests start.

Reviewed By: javache

Differential Revision: D66760121

fbshipit-source-id: 7e227e0035a170dab81b1e6ce39600a01a748867
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot db70b791ba Add ReactNativeFeatureFlagsDynamicProvider to allow configuration in C++ using dynamic values (#48093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48093

Changelog: [internal]

We're going to add support for specifying feature flags in Fantom tests in pragmas. E.g.:

```
/**
 * fantom_flags commonTestFlag:true
 */
```

Users will be able to specify any feature flags in their tests, so we need a way to pass that information from the test file to the runner, and the runner has to be able to apply this dynamic configuration.

Because the API is statically typed in C++, we need to define a method for every possible feature flag configurable through this API. We could do it in userland, but we'd have to manually add a method every time there was a new feature flag we wanted to support.

Instead of doing that, this introduces a new abstraction in the feature flag system that codegens it for you.

The API is basically:

```
  folly::dynamic values = folly::dynamic::object();

  values["commonTestFlag"] = true;

  ReactNativeFeatureFlags::override(
      std::make_unique<ReactNativeFeatureFlagsDynamicProvider>(values));

  EXPECT_EQ(ReactNativeFeatureFlags::commonTestFlag(), true);
```

Then we can use this abstraction in Fantom to pass all the configured flags as `folly::dynamic` through this API.

Reviewed By: javache

Differential Revision: D66760118

fbshipit-source-id: c32329e5ca76923c3e0b9c0eb1fe8c3268e1f57b
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot da6d089305 Extract logic to get Fantom test config to a standalone module (2nd attempt) (#48119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48119

Changelog: [internal]

This is a re-land of https://github.com/facebook/react-native/pull/48092

Reviewed By: rshest

Differential Revision: D66820309

fbshipit-source-id: 6b07edcca6988eeb014f6b51ec82296d451bee14
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot 1243679fe2 Export existing Fantom tests (2nd attempt) (#48118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48118

Changelog: [internal]

This is a re-land of https://github.com/facebook/react-native/pull/48085

Reviewed By: rshest

Differential Revision: D66820308

fbshipit-source-id: b0ccd4b52965988015422ebdb8cd1172d1f5e9db
2024-12-05 17:06:11 -08:00
Pieter De BaetsandFacebook GitHub Bot 18ebea533d Convert com.facebook.react.modules.network.ReactCookieJarContainer to Kotlin (#48089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48089

Planning to make some changes here for perf, but converting to Kotlin first

Changelog: [Android][Removed] Made ReactCookieJarContainer internal.

Reviewed By: tdn120

Differential Revision: D66724567

fbshipit-source-id: bf96f8df8a5c901b47c371c7ed16b7a81de22ee7
2024-12-05 16:29:37 -08:00
Pieter De BaetsandFacebook GitHub Bot e750059d98 Convert com.facebook.react.modules.network.ForwardingCookieHandler to Kotlin (#48088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48088

Planning to make some changes here for perf, but converting to Kotlin first

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66724321

fbshipit-source-id: dec7f7123abdcd5792b3d589269b40ad42b3d307
2024-12-05 16:29:37 -08:00
Richard BarnesandFacebook GitHub Bot e7b9d70e0a Remove unused-variable in ../xplat/js/react-native-github/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +2 (#48105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48105

LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Changelog: [Internal]

Reviewed By: palmje

Differential Revision: D66777665

fbshipit-source-id: fadf71fd37c2b95f87419acf9d5a7765fe031905
2024-12-05 14:14:21 -08:00
Nicola CortiandFacebook GitHub Bot 13900d75b8 Remove replaceAll from RNTester sample code (#48099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48099

This is currently breaking the Sample Module screen on RN-Tester. Let's remove it.

Changelog:
[Internal] [Changed] - Remove replaceAll from RNTester sample code

Reviewed By: cipolleschi

Differential Revision: D66764656

fbshipit-source-id: acd123374d23b37977d5506f70f29da7f5d6311f
2024-12-05 09:54:47 -08:00
Ramanpreet NaraandFacebook GitHub Bot 2f0977d8e4 Also report non-fatal non-warning errors (#48104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48104

Just porting over the logic after D28815228.

Changelog: [Internal]

Reviewed By: mlord93

Differential Revision: D66563226

fbshipit-source-id: 41e21812dd0b2104fa66b970212f51bbb77d910b
2024-12-05 09:42:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 00d5caee99 Do not install CMake on Windows machine (#48122)
Summary:
GHA to build HermesC for windows are failing because the machines comes with a different CMake version already.
Let's try not to install Cmake and use the one provided by the machine.

## Changelog:
[Internal] -

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

Test Plan: GHA {F1973187648}

Reviewed By: alanleedev

Differential Revision: D66825216

Pulled By: cipolleschi

fbshipit-source-id: 9a9376a5409e192195a6b6cc25b4d58cb47f15da
2024-12-05 09:19:58 -08:00
Nikita RubilovandFacebook GitHub Bot ea84bc666c Revert D66599197: Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc.
Differential Revision:
D66599197

Original commit changeset: 33822588c217

Original Phabricator Diff: D66599197

fbshipit-source-id: 00891602920f84a04ea9eac32758d2af08f3d4c7
2024-12-05 06:46:15 -08:00
Nikita RubilovandFacebook GitHub Bot ca908c0681 Revert D66702625: Export existing Fantom tests
Differential Revision:
D66702625

Original commit changeset: e136ea5ea42c

Original Phabricator Diff: D66702625

fbshipit-source-id: 43600daaf46e5c1522758d721b0d2f2c9abc7e25
2024-12-05 06:46:15 -08:00
Nikita RubilovandFacebook GitHub Bot eee5d2ec3c Revert D66760119: Extract logic to get Fantom test config to a standalone module
Differential Revision:
D66760119

Original commit changeset: e955e8f59669

Original Phabricator Diff: D66760119

fbshipit-source-id: ef77a5cdc87efd81bbe503a2a943b1deef4a7e15
2024-12-05 06:46:15 -08:00
zhongwuzwandFacebook GitHub Bot efd57d681c Fabric: Post RCTInstanceDidLoadBundle notification after bundle loaded (#48082)
Summary:
Fixes https://github.com/facebook/react-native/issues/47949

## Changelog:

[IOS] [FIXED] - Fabric: Post RCTInstanceDidLoadBundle notification after bundle loaded

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

Test Plan: Post RCTInstanceDidLoadBundle notification after bundle loaded

Reviewed By: philIip

Differential Revision: D66754060

Pulled By: cipolleschi

fbshipit-source-id: d30f0ed73e127936082e6f91e137b9b4013c6651
2024-12-05 06:00:34 -08:00
Rubén NorteandFacebook GitHub Bot bc0b5ca5df Extract logic to get Fantom test config to a standalone module (#48092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48092

Changelog: [internal]

This is just in preparation to expand the scope of that function to include configuration for feature flags.

Reviewed By: javache

Differential Revision: D66760119

fbshipit-source-id: e955e8f596697ac6a0a87013bec3fc3e09caf19d
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot f6aae38e52 Export existing Fantom tests (#48085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48085

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D66702625

fbshipit-source-id: e136ea5ea42c1e1942e4c22e65855e91ad96e3f8
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot 2e7e065d09 Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc. (#48087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48087

Changelog: [internal]

Now that we have Fantom tests for these unit tests that use mocks, we can remove the JS tests and the mocks :)

Reviewed By: sammy-SC

Differential Revision: D66599197

fbshipit-source-id: 33822588c2176ffe2f2631da56c671b299f8058d
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot b487e65869 Add support for expect() .toBeLessThan and .toBeGreaterThan (#48086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48086

Changelog: [internal]

Just adding a bit of coverage for the `expect` API adding `toBeLessThan` and `toBeGreaterThan`.

Reviewed By: sammy-SC

Differential Revision: D66753268

fbshipit-source-id: 6a26f558f985ccbb5eb0daacecd93759841149e9
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot ff934cd249 Extract definitions for expect and mocks from generic test setup to standalone modules (#48083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48083

Changelog: [internal]

Just a small refactor to have a better code organization for the testing runtime infra.

Reviewed By: sammy-SC

Differential Revision: D66753269

fbshipit-source-id: e68727fe45fabe0be3528e21d5a60cef3045c252
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot 118c18f3bb Allow async functions in ReactNativeTester and add tests (#48063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48063

Changelog: [internal]

This allows async functions to be passed to `runTask` (just a type change really) and adds tests for ReactNativeTester. Error handling isn't currently set up correctly, so those tests are disabled for now.

Reviewed By: sammy-SC

Differential Revision: D66698547

fbshipit-source-id: 41d1fccc80f90cdf764f6fa3d3d34365eeef8ec6
2024-12-05 05:18:08 -08:00
Wojciech LewickiandFacebook GitHub Bot e7f943de2f fix: long not implemented on native side (#48017)
Summary:
Handling `long` values is not implemented in Writables. I added it on the native side.

## 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] - Support Long values in WritableMap and WritableArray

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

Test Plan: Run https://github.com/WoLewicki/reproducer-react-native/tree/%40wolewicki/long-in-writeable-map and see it doesn't work without those changes.

Reviewed By: javache

Differential Revision: D66754194

Pulled By: cortinico

fbshipit-source-id: 7f8d4eb3c4069f890460525ddffdf9f4324550b0
2024-12-05 04:46:28 -08:00
jodeppoandFacebook GitHub Bot 8aac234ce2 Remove Trigger E2E Tests on Comment (#47923)
Summary:
This action is no longer necessary and we can remove it

## Changelog:

[Internal] [Fixed] - Use `refs/pulls` namespace in trigger action

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

Reviewed By: NickGerleman

Differential Revision: D66578573

Pulled By: cortinico

fbshipit-source-id: 87cdbc1544873a2669e82c7763c78d18ff7881fd
2024-12-05 03:23:52 -08:00
Kacper KafaraandFacebook GitHub Bot f402ed17fa Fix handling removal of transitioning views (#47634)
Summary:
Related PR in `react-native-screens`:

* https://github.com/software-mansion/react-native-screens/pull/2495

Additional context:
   * [my detailed explanation of **one of the issues**](https://github.com/software-mansion/react-native-screens/pull/2495#issuecomment-2478915818)
   * [Android Developer: ViewGroup.startViewTransition docs](https://developer.android.com/reference/android/view/ViewGroup#startViewTransition(android.view.View))

### Background

On Android view groups can be marked as "transitioning" with a `ViewGroup.startViewTransition` call. This effectively ensures, that in case a view group is marked with this call and its children are removed, they will be still drawn until `endViewTransition` is not called.

This mechanism is implemented in Android by [keeping track of "transitioning" children in auxiliary `mTransitioningViews` array](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#7178). Then when such "transitioning" child is removed, [it is removed from children array](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#5595) but it's [parent-child relationship is not cleared](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#5397) and it is still retained in the auxiliary array.

Having that established we can proceed with problem description.

### Problem

https://github.com/user-attachments/assets/d0356bf5-2f17-4b06-ba53-bfca659a1071

<details>
<summary>Full code</summary>

```javascript
import { NavigationContainer } from 'react-navigation/native';
import React from 'react';
import { createNativeStackNavigator } from 'react-navigation/native-stack';
import { enableScreens } from 'react-native-screens';
import {
  StyleSheet,
  Text,
  View,
  FlatList,
  Button,
  ViewProps,
  Image,
  FlatListProps,
  findNodeHandle,
} from 'react-native';

enableScreens(true);

function Item({ children, ...props }: ViewProps) {
  return (
    <View style={styles.item} {...props}>
      <Image source={require('../assets/trees.jpg')} style={styles.image} />
      <Text style={styles.text}>{children}</Text>
    </View>
  );
}

function Home({ navigation }: any) {
  return (
    <View style={styles.container}>
      <Button title="Go to List" onPress={() => navigation.navigate('List')} />
    </View>
  );
}

function ListScreenSimplified({secondVisible}: {secondVisible?: (visible: boolean) => void}) {
  const containerRef = React.useRef<View>(null);
  const innerViewRef = React.useRef<View>(null);
  const childViewRef = React.useRef<View>(null);

  React.useEffect(() => {
    if (containerRef.current != null) {
      const tag = findNodeHandle(containerRef.current);
      console.log(`Container has tag [${tag}]`);
    }
    if (innerViewRef.current != null) {
      const tag = findNodeHandle(innerViewRef.current);
      console.log(`InnerView has tag [${tag}]`);
    }
    if (childViewRef.current != null) {
      const tag = findNodeHandle(childViewRef.current);
      console.log(`ChildView has tag [${tag}]`);
    }
  }, [containerRef.current, innerViewRef.current, childViewRef.current]);

  return (
    <View
      ref={containerRef}
      style={{ flex: 1, backgroundColor: 'slateblue', overflow: 'hidden' }}
      removeClippedSubviews={false}>
      <View ref={innerViewRef} removeClippedSubviews style={{ height: '100%' }}>
        <View ref={childViewRef} style={{ backgroundColor: 'pink', width: '100%', height: 50 }} removeClippedSubviews={false}>
          {secondVisible && (<Button title='Hide second' onPress={() => secondVisible(false)} />)}
        </View>
      </View>
    </View>
  );
}

function ParentFlatlist(props: Partial<FlatListProps<number>>) {
  return (
    <FlatList
      data={Array.from({ length: 30 }).fill(0) as number[]}
      renderItem={({ index }) => {
        if (index === 10) {
          return <NestedFlatlist key={index} />;
        } else if (index === 15) {
          return <ExtraNestedFlatlist key={index} />;
        } else if (index === 20) {
          return <NestedFlatlist key={index} horizontal />;
        } else if (index === 25) {
          return <ExtraNestedFlatlist key={index} horizontal />;
        } else {
          return <Item key={index}>List item {index + 1}</Item>;
        }
      }}
      {...props}
    />
  );
}

function NestedFlatlist(props: Partial<FlatListProps<number>>) {
  return (
    <FlatList
      style={[styles.nestedList, props.style]}
      data={Array.from({ length: 10 }).fill(0) as number[]}
      renderItem={({ index }) => (
        <Item key={'nested' + index}>Nested list item {index + 1}</Item>
      )}
      {...props}
    />
  );
}

function ExtraNestedFlatlist(props: Partial<FlatListProps<number>>) {
  return (
    <FlatList
      style={styles.nestedList}
      data={Array.from({ length: 10 }).fill(0) as number[]}
      renderItem={({ index }) =>
        index === 4 ? (
          <NestedFlatlist key={index} style={{ backgroundColor: '#d24729' }} />
        ) : (
          <Item key={'nested' + index}>Nested list item {index + 1}</Item>
        )
      }
      {...props}
    />
  );
}

const Stack = createNativeStackNavigator();

export default function App(): React.JSX.Element {
  return (
    <NavigationContainer>
      <Stack.Navigator screenOptions={{ animation: 'slide_from_right' }}>
        <Stack.Screen name="Home" component={Home} />
        <Stack.Screen name="List" component={ListScreenSimplified}/>
      </Stack.Navigator>
    </NavigationContainer>
  );
}

export function AppSimple(): React.JSX.Element {
  const [secondVisible, setSecondVisible] = React.useState(false);

  return (
    <View style={{ flex: 1, backgroundColor: 'lightsalmon' }}>
      {!secondVisible && (
        <View style={{ flex: 1, backgroundColor: 'lightblue' }} >
          <Button title='Show second' onPress={() => setSecondVisible(true)} />
        </View>
      )}
      {secondVisible && (
        <ListScreenSimplified secondVisible={setSecondVisible} />
      )}
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  nestedList: {
    backgroundColor: '#FFA07A',
  },
  item: {
    flexDirection: 'row',
    alignItems: 'center',
    padding: 10,
    gap: 10,
  },
  text: {
    fontSize: 24,
    fontWeight: 'bold',
    color: 'black',
  },
  image: {
    width: 50,
    height: 50,
  },
});

```

</details>

Explanation (copied from [here](https://github.com/software-mansion/react-native-screens/pull/2495#issuecomment-2478915818)):

I've debugged this for a while now & I have good understanding of what's going on. This bug is caused by our usage of `startViewTransition` and its implications. We use it well, however React does not account for case that some view might be in transition. Error mechanism is as follows:

1. Let's have initially simple stack with two screens: "A, B". This is component rendered under "B":

```javascript
    <View //<-- ContainerView (CV)
      removeClippedSubviews={false}
      style={{ flex: 1, backgroundColor: 'slateblue', overflow: 'hidden' }}>
      <View removeClippedSubviews style={{ height: '100%' }}> // <--- IntermediateView (IV)
        <View removeClippedSubviews={false} style={{ backgroundColor: 'pink', width: '100%', height: 50 }} /> // <--- ChildView (ChV)
      </View>
    </View>
```

2. We press the back button.
3. We're on Fabric, therefore subtree of B gets destroyed before B itself is unmounted -> in our commit hook we detect that the screen B will be unmounted & we mark every node under B as transitioning by calling `startViewTransition`.
4. React Mounting stage starts, view hierarchy is disassembled in bottom-up fashion (leafs first).
5. ReactViewGroupManager receives MountItem to detach ChV from IV.
6. A call to [`IV.removeView(ChV)` is made](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.kt#L58-L73), which effectively removes ChV from `IV.children`, ***HOWEVER*** it does not clear `ChV.parent`, meaning that after the call, `ChV.parent == IV`. This happens, due to view being marked as in-transition by our call to `startViewTransition`. If the view is not marked as in-transition this parent-child relationship is removed.
7. IV has `removeClippedSubviews` enabled, therefore a [call to `IV.removeViewWithSubviewsClippingEnabled(ChV)` is made](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.kt#L68). [This function](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java#L726-L744) does effectively two things:
    1. if the ChV has parent (interpretation: it has not yet been detached from parent), we compute it's index in `IV.children` (Android.ViewGroup's state) and remove it from the array,
    2. remove the ChV from `mAllChildren` array (this is state maintained by ReactViewGroup for purposes of implementing the "subview clipping" mechanism".

The crash happens in 7.1, because ChV has been removed from `IV.children` in step 6, but the parent-child relationship has not been broken up there. Under usual circumstances (this is my hypothesis now, yet unconfirmed) 7.1 does not execute, because `ChV.parent` is nulled in step no. 6.

### Rationale for `startViewTransition` usage

Transitions. On Fabric, when some subtree is unmounted, views in the subtree are unmounted in bottom-up order. This leads to uncomfortable situation, where our components (react-native-screens), who want to drive & manage transitions are notified that their children will be removed after the subtrees mounted in screen subviews are already disassembled. **If we start animation in this very moment we will have staggering effect of white flash** [(issue)](https://github.com/software-mansion/react-native-screens/issues/1685) (we animate just the screen with white background without it's children). This was not a problem on Paper, because the order of subtree disassembling was opposite - top-down. While we've managed to workaround this issue on Fabric using `MountingTransactionObserving` protocol on iOS and a commit hook on Android (we can inspect mutations in incoming transaction before it starts being applied) we still need to prevent view hierarchy from being disassembled in the middle of transition (on Paper this has also been less of an issue) - and this is where `startViewTransition` comes in. It allows us to draw views throughout transition after React Native removes them from HostTree model. On iOS we exchange subtree for its snapshot for transition time, however this approach isn't feasible on Android, because [snapshots do not capture shadows](https://stackoverflow.com/questions/42212600/android-screenshot-of-view-with-shadow).

### Possible solutions

[Android does not expose a method to verify whether a view is in transition](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#7162) (it has `package` visibility), therefore we need to retrieve this information with some workaround. I see two posibilities:

* first approach would be to override `startViewTransition` & `endViewTransition` in ReactViewGroup and keep the state on whether the view is transitioning there,
* second possible approach would be as follows: we can check for "transitioning" view by checking whether a view has parent but is not it's parent child (this **should** be reliable),

Having information on whether the view is in transition or not, we can prevent multiple removals of the same view in every call site (currently only in `removeViewAt` if `parent.removeClippingSubviews == true`).

Another option would be to do just as this PR does: having in mind this "transitioning" state we can pass a flag to `removeViewWithSubviewClippingEnabled` and prevent duplicated removal from parent if we already know that this has been requested.

I can also add override of this method:

```java
  /*package*/ void removeViewWithSubviewClippingEnabled(View view) {
    this.removeViewWithSubviewClippingEnabled(view, false);
  }
```

to make this parameter optional.

## Changelog:

[ANDROID] [FIXED] - Handle removal of in-transition views.

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

Test Plan: WIP WIP

Reviewed By: javache

Differential Revision: D66539065

Pulled By: tdn120

fbshipit-source-id: cf1add67000ebd1b5dfdb2048461a55deac10b16
2024-12-04 15:24:35 -08:00
Nicola CortiandFacebook GitHub Bot 734730df75 Re-introduce the deprecated constructor on ReactModuleInfo (#48090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48090

This alleviates a breaking change on `ReactModuleInfo` constructor.
While the ctor was deprecated, we realized that there are more than 250 usages in OSS.
We'll need to properly communicate this removal before we do it.

Changelog:
[Android] [Fixed] - Re-introduce the deprecated constructor on ReactModuleInfo

Reviewed By: cipolleschi

Differential Revision: D66755541

fbshipit-source-id: 3673d8f2af278d55491cea89f1594d368513e3d8
2024-12-04 11:03:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 50d0157f0c test(network): [android] ResponseUtil unit tests (#48075)
Summary:
Currently the class `ResponseUtil` is still in Java, I'm adding some unit tests so it is safer to migrate it to Kotlin.

## Changelog:

[INTERNAL] - `ResponseUtil` unit tests

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D66727736

Pulled By: lunaleaps

fbshipit-source-id: 9c89c75905b4e0c9c4820a556245a07e135e0f17
2024-12-04 10:26:04 -08:00
Andrew DatsenkoandFacebook GitHub Bot 2e444d2b40 Add ReactNativetester#getRenderedOutput() API (#47970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47970

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D65617491

fbshipit-source-id: 49369b694a81b7dfb541c75d9e24b62fc141d980
2024-12-04 09:55:56 -08:00
Nick GerlemanandFacebook GitHub Bot 366270e742 Update requirements in README (#48079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48079

We updated these in 0.76, and should update them in the README as well. https://reactnative.dev/blog/2024/10/23/release-0.76-new-architecture#updates-to-minimum-ios-and-android-sdk-requirements

Changelog: [Internal]

Reviewed By: lunaleaps, philIip

Differential Revision: D66735446

fbshipit-source-id: c9145bab14e4956ed070fb906dd1c1676905bfb6
2024-12-04 09:45:46 -08:00
Soe LynnandFacebook GitHub Bot 469978f170 Fix Interop code for having unsync ViewManager between ModuleRegistry and BridgeProxy (#48069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48069

Changelog [Internal]:
Fix Interop code for having unsync ViewManager between ModuleRegistry and BridgeProxy

Reviewed By: RSNara

Differential Revision: D66137400

fbshipit-source-id: ace3f60b6b972f17c7124ec33f0d3e8d035e966c
2024-12-04 09:40:16 -08:00
Rob HoganandFacebook GitHub Bot 7ee7e69cdf Update changelog for v0.77.0-rc.1 (#48084)
Summary:
Changelog for v0.77.0-rc.1

https://github.com/facebook/react-native/compare/v0.77.0-rc.0...v0.77.0-rc.1

## Changelog:
[Internal]

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

Reviewed By: cipolleschi

Differential Revision: D66753599

Pulled By: robhogan

fbshipit-source-id: 9a02df5cb7174270b4d293c48c6b0468a4042c87
2024-12-04 09:40:07 -08:00
zhongwuzwandFacebook GitHub Bot efcfe5dcd6 Fabric: Fixes insets not adjust when keyboard disappear (#47924)
Summary:
Fixes https://github.com/facebook/react-native/issues/47731 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes insets not adjust when keyboard disappear

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

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

Reviewed By: blakef

Differential Revision: D66651865

Pulled By: cipolleschi

fbshipit-source-id: a75afbd1a7651f0c77022d913f910821c482fcf7
2024-12-04 07:49:12 -08:00
Rob HoganandFacebook GitHub Bot b5b9e032c2 Fix Android JSC compatibility - replaceAll -> replace (#48076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48076

JSC for Android does not implement `String.prototype.replaceAll`:

 {F1971791988}

https://github.com/facebook/react-native/pull/47466 introduced a use of it into runtime code, breaking JSC compatibility.

This.. replaces it.. with `replace`. Since the argument is already a regex with a `g` modifier, `replaceAll` wasn't necessary anyway.

Changelog:
[ANDROID][FIXED] Fix JSC by avoiding use of unavailable `str.replaceAll()`

Reviewed By: javache

Differential Revision: D66712312

fbshipit-source-id: 534b6db6834a2fda46ae8457437de3caa24f4eb0
2024-12-04 06:07:21 -08:00
Rubén NorteandFacebook GitHub Bot 4c62d46525 Remove legacy versions of the native methods for performance.mark and performance.measure (#48067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48067

Changelog: [internal]

We don't need to keep these versions for backwards compatibility anymore.

Reviewed By: rshest

Differential Revision: D65423761

fbshipit-source-id: 59046a577c1de4aedb2593a12a45d9deb3bb4260
2024-12-04 04:38:54 -08:00
Phillip PanandFacebook GitHub Bot 0217d7e19c have RCTInstance decorate non-app provided turbomodules with bridgeless APIs (#48053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48053

Changelog: [Internal]

`getModuleInstanceFromClass:` is a delegate method intended to be implemented by the product layer to provide modules. if it is not implemented to return a module for a given key, `RCTTurboModuleManager` will simply call `new` on the TM class.

however, these two paths differentiate - for `getModuleInstanceFromClass:`, we will call `_attachBridgelessAPIsToModule:` which provides objects like surfacePresenter to the native module.

if we fallback to calling `new`, then this attachment does not happen, even if the app has already been migrated to bridgeless modules.

thus, the fix in the case is to lift the fallback into RCTInstance as well, and decorate the APIs onto the new fallback.

Reviewed By: cipolleschi

Differential Revision: D66675034

fbshipit-source-id: 1ab89a4006d05f744f5d42b5de786ccea4d4a55d
2024-12-03 22:23:04 -08:00
Joe VilchesandFacebook GitHub Bot 74f3ab7d40 Properly camelcase mainAxisownerSize in FlexLine (#48077)
Summary:
X-link: https://github.com/facebook/yoga/pull/1762

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

OCD strikes again. Grepped this time to make sure we didn't miss any cases for this specific param name

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66715777

fbshipit-source-id: 3e881a15b3b2836a4a55b11d7ec621541b92a05d
2024-12-03 19:16:56 -08:00
Eli WhiteandFacebook GitHub Bot 949d229b5f Apply enum changes to new codegen version (#48000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48000

Adding this type to CompleteTypes

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D65305755

fbshipit-source-id: 962297ba21b3b88f0117631fb4192c111e903fc6
2024-12-03 16:41:36 -08:00
Vojtech NovakandFacebook GitHub Bot 52f09276cc fix hermes param handling in test-e2e-local.js (#48068)
Summary:
why: running `yarn test-e2e-local -t "RNTestProject" -p "Android" -h false -c $GITHUB_TOKEN` would actually build the app with Hermes even though it's specified as disabled.

This is because of the `if (argv.hermes == null)` condition whose body would not execute.
The condition was changed [recently](https://github.com/facebook/react-native/commit/f322dc7a84eb72370910f6933d0a4fa7780f49bc#diff-56f57bf0eac99b0fda1b2938aceb8d9b663db82c07cb405bd53a01c8689710ffR258).

Reason for `await` being used:

```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ scripts/release-testing/test-e2e-local.js:303:32

Cannot get argv.hermes because property hermes is missing in Promise [1]. [prop-missing]

     scripts/release-testing/test-e2e-local.js
     300│     'reactNativeArchitectures=arm64-v8a',
     301│     'android/gradle.properties',
     302│   );
     303│   const hermesEnabled = (argv).hermes === true;
     304│
     305│   // Update gradle properties to set Hermes as false
     306│   if (!hermesEnabled) {

     flow-typed/npm/yargs_v17.x.x.js
 [1]  80│     argv: Argv | Promise<Argv>;
 ```

## Changelog:

[INTERNAL] [FIXED] - fix `hermes` param handling in `test-e2e-local.js`

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

Test Plan: tested locally

Reviewed By: cipolleschi

Differential Revision: D66704263

Pulled By: robhogan

fbshipit-source-id: f05f23b95e67bd20025e0b3448df0d284fcb62da
2024-12-03 16:14:32 -08:00
Richard BarnesandFacebook GitHub Bot 5e7eb9f3a6 Revert D66143498
Summary:
This diff reverts D66143498
T209377282 Breaking tests on Twilight

Differential Revision: D66717950

fbshipit-source-id: 640592761fec29ed6e11a8b6faf441dd44685c42
2024-12-03 14:31:53 -08:00
Dmitry RykunandFacebook GitHub Bot 725527885a Android: Initiate image prefetching on ImageShadowNode layout (#47932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47932

This diff introduces a code path to trigger image prefetching from `ImageShadowNode::layout`.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66454087

fbshipit-source-id: 17f5fed7d29c7d69cf76c28562898a81fac24044
2024-12-03 13:31:24 -08:00
Luna WeiandFacebook GitHub Bot d19f5f97b8 Fix naming convention for new rootThreshold related APIs and add Fantom tests (#48071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48071

Changelog: [Internal]

- Write fantom test for rn_rootThreshold given current implementation of IntersectionObserver
- Rename `rn_rootThreshold` to `rnRootThreshold`
- Rename `rn_intersectionRootRatio` to `rnRootIntersectionRatio`
- Rename `rootThresholds` on observer to `rnRootThresholds`

Reviewed By: rubennorte

Differential Revision: D66464509

fbshipit-source-id: 8ed66afa54bab99a28625ebe6f227d59d0bd7389
2024-12-03 13:29:51 -08:00
Luna WeiandFacebook GitHub Bot 9aa21b5e87 Return intersection rect (#48070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48070

Changelog: [General][Changed]

Return the clipped `intersectionRect` in IntersectionObserverEntry regardless of whether the observer `isIntersecting` or not. This addresses a deviance from the [web spec](https://www.w3.org/TR/intersection-observer/?fbclid=IwZXh0bgNhZW0CMTEAAR1XaWZim1ij0N1p07aCM__SYerXhu88UTDZRFCZEvRhQW2crRMwEvfwAdQ_aem_zH8WjTh0VFjEeORG76rcew#intersection-observer-entry)

Reviewed By: rubennorte

Differential Revision: D66516179

fbshipit-source-id: fdc766f0e6fc0a899b1b11547a2aa06010b8d010
2024-12-03 13:29:51 -08:00
Pieter De BaetsandFacebook GitHub Bot 9800c8e47e Improve differentiator logging (#48061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48061

Improve consistency of debug logs in differentiator.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66654292

fbshipit-source-id: f4accdea184b932f94359c893e6de59f8139ca22
2024-12-03 10:17:02 -08:00
Pieter De BaetsandFacebook GitHub Bot 34901d4861 Fix differentiator emitting updates with incorrect parentTag (#48055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48055

Address the test-case identified in D66557919, where Differentiator could emit updates for views referencing an incorrect parentTag.

The longer-term fix here is to avoid emitting any updates for nodes which are being reparented, but that requires bigger changes, including to the LayoutAnimation system. As a short-term patch, we're passing through an explicit `parentShadowViewForUpdate` which will be used as the current parent for update purposes.

 {F1971278019}

Changelog: [Android][Fixed] Fix Fabric mutations sometimes triggering a `getViewState` crash when referencing an invalid parentTag.

Reviewed By: rubennorte

Differential Revision: D66654293

fbshipit-source-id: cd5b3e577ad1eede1b6dea834582ac6d750cbb81
2024-12-03 10:17:02 -08:00
Fabrizio CucciandFacebook GitHub Bot 21c9491926 Migrate package com.facebook.react.uimanager.RootView to Kotlin (#47701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47701

As per title.

Changelog:
[Android][Breaking] Convert RootView to Kotlin

Reviewed By: cortinico

Differential Revision: D66159881

fbshipit-source-id: 082881a03946088293dde3c085e1d1882bac96be
2024-12-03 09:59:48 -08:00
Blake FriedmanandFacebook GitHub Bot 9df20d414e Log out which workflow artifact we're using (#48046)
Summary:
Make it clearer to the release crew to avoid using an outdated artifact
for testing a release.

{F1971030533}

Changelog: [Internal]

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

Test Plan:
```
yarn test-e2e-local -t "RNTester" -p "Android" -h true -c $GITHUB_TOKEN
```

Reviewed By: robhogan

Differential Revision: D66657082

Pulled By: blakef

fbshipit-source-id: 225128690c180bee7a3d28fdcc7f8c9885a37f0d
2024-12-03 09:34:48 -08:00
Alex HuntandFacebook GitHub Bot d6f286a4a0 Add description to React-jsinspector.podspec, refactoring (#48066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48066

Minor edits to this build spec to align with other packages in `ReactCommon/`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66700351

fbshipit-source-id: 47942c27d6154b78c165508447a3056f1354f5c3
2024-12-03 08:44:48 -08:00
Dmitry RykunandFacebook GitHub Bot 318db8eedf Add Android-specific ImageRequestParams (#47930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47930

This diff adds a list of props that will be used by the Android `ImagePrefetcher` to create an `ImageRequest`. This list is derived from all the props that `ReactImageView` uses to create its `ImageOptions` and `ImageRequest` objects.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66453306

fbshipit-source-id: ca4f59784c81f2b94ed4b052f6fbe5e8c6b97a2a
2024-12-03 04:09:42 -08:00
Richard BarnesandFacebook GitHub Bot 071d223ee0 Remove unused-variable in ../xplat/compphoto/gpuEngine/tools/ToolHelpers.cpp +3 (#48052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48052

LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.

#buildsonlynotests - Builds are sufficient

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: javache, wuyuoss

Differential Revision: D66143498

fbshipit-source-id: a461f115610258777bd1173f91cf4d4472e2fc5e
2024-12-03 04:07:49 -08:00
David VaccaandFacebook GitHub Bot 67bff8734f Delete GuardedResultAsyncTask (#48058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48058

Delete unused abstract class GuardedResultAsyncTask

I'm deleting without depreacting becuase I didn't find usages internally or externally

changelog: [Android][Breaking] Delete unused abstract class GuardedResultAsyncTask

Reviewed By: javache

Differential Revision: D66416570

fbshipit-source-id: 8b369dfcd3e99b24f97c62cec9229f82ba5eed77
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot b25b65ba19 Delete deprecated class FabricViewStateManager (#48057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48057

FabricViewStateManager has been deprecated for a long time and it's unused, let's delete it

changelog: [Android][Breaking] Delete deprecated class FabricViewStateManager

Reviewed By: javache, cortinico

Differential Revision: D66403219

fbshipit-source-id: e8f893b6a240ca09c0e86821c0a15fa345ffd221
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot a4849cb3d6 Reduce visibility of ComponentNameResolver to internal (#48056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48056

ComponentNameResolver is meant to be used only internaly, we reduce its visbility to internal

changelog: [Android][Breaking] Removed ComponentNameResolver from public API

Reviewed By: javache

Differential Revision: D66403218

fbshipit-source-id: bf08284400a6dc6446b771c894488ed3fb371e25
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot 385b9f4265 Migrate ComponentNameResolver to kotlin (#47919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47919

Migrate ComponentNameResolver to kotlin

changelog: [Android][Changed] Migrate ComponentNameResolver to kotlin

Reviewed By: javache

Differential Revision: D66403041

fbshipit-source-id: 7af1a89988373014c5aeb1f6145324cf889a1a36
2024-12-02 18:45:27 -08:00
Mateo GuzmánandFacebook GitHub Bot bfc8b3391e Migrate BatchEventDispatchedListener to kotlin (#48038)
Summary:
Migrating `BatchEventDispatchedListener` from Java to Kotlin

## Changelog:

[INTERNAL] - Migrating `BatchEventDispatchedListener` from Java to Kotlin

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: tdn120, cortinico

Differential Revision: D66653052

Pulled By: javache

fbshipit-source-id: 494866c54d349587e313c18717c6c587a2228aa8
2024-12-02 17:53:59 -08:00
Joe VilchesandFacebook GitHub Bot 2df7552fa2 Back out "Back out "[yoga][intrinsic sizing] Update public API for intrinsic sizing setters""
Summary:
Original commit changeset: 793f77dad021

Original Phabricator Diff: D66332309

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66662661

fbshipit-source-id: 22ed3ac9492f0a563c041ce4cb5fba4b65b53211
2024-12-02 17:29:49 -08:00
Joe VilchesandFacebook GitHub Bot e1623b7525 Back out "Back out "[yoga][intrinsic sizing] Modify private apis to set, store, and get intrinsic sizing keywords"" (#48049)
Summary:
X-link: https://github.com/facebook/yoga/pull/1756

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

Changelog: [Internal]

Original commit changeset: 1d596964e0c8

Original Phabricator Diff: D66332307

Reviewed By: NickGerleman

Differential Revision: D66662662

fbshipit-source-id: 4f9ac2b1557b848f519dcd728d7097b52f1190b3
2024-12-02 17:29:49 -08:00
Eli WhiteandFacebook GitHub Bot fa8a25eb6b Make enum types annotation objects instead of literal strings and numbers (#47349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47349

This is needed to be able to recurse into the literals and compare them.

I'm primarily unsure if there is a problem representing doubles/floats as numbers instead of strings though.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D65284058

fbshipit-source-id: b2de9ed5fb7f079a432c94aaea69027863879909
2024-12-02 14:32:35 -08:00
Eli WhiteandFacebook GitHub Bot 96c2be8567 Don't store pretty printed json in schema
Summary: Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66603960

fbshipit-source-id: 2d7844df76f168b99eb76bb19359ee71e953d0b2
2024-12-02 14:32:35 -08:00
Thomas NardoneandFacebook GitHub Bot 53bc661138 ReactViewGroup - track clipped views (#47987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47987

Store a tag value for whether the view is added or removed, to better track the state instead of checking view.getParent().

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66383241

fbshipit-source-id: 16521eb4052e9473be058a00cfe29d7f198b7861
2024-12-02 14:28:35 -08:00
Ramanpreet NaraandFacebook GitHub Bot 69ecaef068 Remove native -> js call noop-ing after early js error (#47915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47915

## Purpose of this noop-ing
If an fatal js error happens during js runtime init, the js thread continues executing and raises **yet another** fatal error.

This noop-ing was an **attempt** to prevent that second inactionable fatal from happening: That fatal is usually inactionable.

## Problems with this noop-ing
I don't think this is the right approach: There could be legitimate reasons to continue executing native -> js calls post first js fatal.

I don't think it does *much*: it doesn't noop native -> js calls executed on the runtime scheduler, which should be most of them.

## Changes

Instead of trying to prevent that fatal, just let it happen. Then, don't report the second fatal: D66193194 and D66392706.

## Safetly
The production impact is negligible: This codepath is executed only after early js errors. There shouldn't be any in production right now.

We've spent a lot of time making our javascript error handling pipeline's coverage compresive. So, after an early js fatal error happens, subsequent js fatals should get handled properly.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66394278

fbshipit-source-id: ef342fc2eba9ae9f27b15a0f412fb69bd92aed43
2024-12-02 14:18:55 -08:00
Alex HuntandFacebook GitHub Bot 215b0a50cf Update debugger-frontend from 6b80704...486803f (#48051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48051

Changelog: [Internal] - Update `react-native/debugger-frontend` from 6b80704...486803f

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

Reviewed By: hoxyq

Differential Revision: D66664563

fbshipit-source-id: 8c04c0f99e203f594d4e86a52aca99803c4b005f
2024-12-02 12:02:07 -08:00
Alex HuntandFacebook GitHub Bot 11c214d0c9 Update FuseboxTracer to closer align with Chrome trace events (#48020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48020

Progress towards Performance panel display parity for User Timing events in Chrome DevTools.

- Support nullable `track` name in `ReactPerfLogger`, passing track name directly to `FuseboxTracer`.
- Update `FuseboxTracer` to register "Main" process and send V8-aligned `blink.user_timing`-categorised tracing events.

The previous track naming strategy continues to be used under Perfetto.

Changelog: [Internal]

**Better, but not perfect yet**

For now, this is probably the upper limit of how aligned we can be with Chrome on web, since our forked DevTools frontend is 6mo+ behind `main`. Notably, it does not include equivalent custom track handling today: https://github.com/ChromeDevTools/devtools-frontend/commit/4b4435feef14c5c0ac71d932940c6ea7613f8afe

{F1969750671}

> Importing an exact trace from Chrome into RNDT is unable to sub-group the "Timings" track.

Reviewed By: rubennorte

Differential Revision: D66579308

fbshipit-source-id: fa57151d2be477eaa15f62e5c19ee09b1a0ef43a
2024-12-02 11:24:34 -08:00
Andrew DatsenkoandFacebook GitHub Bot dc88683798 Corrently symbolicate message (#48048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48048

Changelog: [Internal]
Some messages may contains multi line content, ie snapshot comparison, multiline strings comparison.

Fixing this by checking first code pointer in the stack and slicing from there.

Reviewed By: christophpurrer, rubennorte

Differential Revision: D66660107

fbshipit-source-id: 57cea02cf6aae3c24f351504c2e077b5a2de0761
2024-12-02 11:16:03 -08:00
Alex HuntandFacebook GitHub Bot 1a9780f0e3 Remove FuseboxClient CDP domain (#48004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48004

Follows https://github.com/facebook/react-native/pull/47962 and depends on https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/139.

Updates the modern debugger server to no longer respond to `FuseboxClient` messages — namely `FuseboxClient.setClientMetadata`. This method is replaced by `ReactNativeApplication.enable` for identifying the React Native DevTools frontend.

Changelog:
[General][Breaking] - The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`.

Reviewed By: rubennorte

Differential Revision: D66575324

fbshipit-source-id: f2b4cbacd857931832d89305510f5aaf51df483a
2024-12-02 08:27:52 -08:00
Peter AbbondanzoandFacebook GitHub Bot 72bb2f4089 Bump Fresco to 3.5.0
Summary:
Updates Fresco from 3.4.0 to 3.5.0. Picks up a few new features, including experimental support for XML-based drawable resource types

Changelog:
[Android][Changed] - Update Fresco to 3.5.0

Reviewed By: cortinico

Differential Revision: D66553841

fbshipit-source-id: d0e630c73ba73ea9bbf96f7d630471c5383145f0
2024-12-02 07:33:37 -08:00
Pieter De BaetsandFacebook GitHub Bot 70a957452c Restore deprecated TurboReactPackage (#48039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48039

This class was removed in D66127067 but was marked as DeprecatedInNewArchitecture and not Deprecated, which limited the signal we gave to developers to move away from this.

Restore for now to e

Changelog: [Android][Fixed] Reverted removal of TurboReactPackage

Reviewed By: rshest

Differential Revision: D66648209

fbshipit-source-id: 165f9390b4874e69353612b929d87b0c495588af
2024-12-02 07:30:52 -08:00
Alex HuntandFacebook GitHub Bot a4310ede9c Update debugger-frontend from b61aae3...6b80704 (#48042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48042

Changelog: [Internal] - Update `react-native/debugger-frontend` from b61aae3...6b80704

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

Reviewed By: blakef

Differential Revision: D66651149

fbshipit-source-id: 6848eebb4b7c04c7c04ae1f784fc39785945bf7b
2024-12-02 06:25:54 -08:00
Rubén NorteandFacebook GitHub Bot 0580e88aa5 Allow tests to specify opt/dev mode (#48022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48022

Changelog: [internal]

This adds support for Fantom options in tests to configure different aspects of the test execution.

For now, it only supports specifying the mode (dev or opt) so we can try things without having to change the runner (watch mode still works if you change mode :D).

Fantom options are specified as pragmas in the docblock of the test. E.g.:

```
/**
 * flow strict-local
 * format
 * fantom_mode opt
 */
```

We expect this is mostly going to be used for one-time tests and that regular tests won't specify the mode (they'll just run in dev mode).

Maybe we can evolve this in the future to specify that you want a test to be executed in both modes, to ensure the behavior is consistent in dev/prod.

Reviewed By: rshest

Differential Revision: D66597626

fbshipit-source-id: b12325fc2235740cc2a3e0283d6a556091c1794c
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 762389f775 Extract logic to debug command errors to shared function (#48019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48019

Changelog: [internal]

Just a minor refactor to reduce code duplication.

Reviewed By: rshest

Differential Revision: D66596730

fbshipit-source-id: 2afa501cd5664402adf4aceba059a4d987c3ed62
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 4bced9099a Implement warm up step to remove costly builds from individual test running time (#48015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48015

Changelog: [internal]

Right now, when we run individual Fantom tests, we compile Hermes and the RN Tester CLI as part of the test, which causes the first test to run to be very slow and the remaining tests in the same run to be very fast.

This is misleading because it makes it look like the test itself is slow, when it's actually paying a price for everyone.

Fortunately, Jest has an option to do a global setup before any tests in the project run (and it doesn't run if none of the tests in the project run, in multi-project setups), so we can use it to do the necessary warmup so it doesn't end up being attributed to individual tests.

Reviewed By: javache

Differential Revision: D66595406

fbshipit-source-id: 496aa2b248da661f7504c8445fed1edad0301803
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 21cc745d51 Extract some logic from runner to utils module (#48014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48014

Changelog: [internal]

Just a small refactor in preparation for a following change that will add more usages for these utilities. It also cleans up the runner file which is good too.

Reviewed By: javache

Differential Revision: D66595405

fbshipit-source-id: e734d76006ce937fadd1cb673035db85a3e838dd
2024-12-02 06:06:26 -08:00
Vojtech NovakandFacebook GitHub Bot 9147b0753a fix IOException in BuildCodegenCLITask (#48008)
Summary:
building RN tester with 0.77 rc-0 doesn't work now because of `java.io.IOException:  No such file or directory` on line 48.

`buildDirectory` is a Gradle property representing a file

https://github.com/facebook/react-native/pull/47552 removes this file altogether so feel free to close if that one is the "right one"

## Changelog:

[ANDROID] [FIXED] - fix IOException in `BuildCodegenCLITask`

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

Test Plan: After this change, building RN tester works.

Reviewed By: cortinico

Differential Revision: D66650038

Pulled By: robhogan

fbshipit-source-id: 11cd83493fa118c6b79d11c9113228dd3971a803
2024-12-02 05:09:54 -08:00
Rubén NorteandFacebook GitHub Bot 2480de6ffb Add Fantom test for LongTask API (#48041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48041

Changelog: [internal]

This adds a Fantom test for the LongTask API, testing it using public APIs :D

Reviewed By: javache

Differential Revision: D66601861

fbshipit-source-id: f3531e8b58ffa044dcb5cec2f462ae6a31c27790
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot b6f2b148f4 Add suppor for toBeLessThanOrEqual and toBeGreaterThanOrEqual (#48040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48040

Changelog: [internal]

We need more expectations for a new test we're writing. This just adds:
* `expect(received).toBeLessThanOrEqual(expected)`
* `expect(received).toBeGreaterThanOrEqual(expected)`

Reviewed By: sammy-SC

Differential Revision: D66601921

fbshipit-source-id: 0a73f7757117ed790b95796b259244c8259136b7
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot 60a4d22307 Migrate ReactFabricPublicInstance tests to Fantom (#48025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48025

Changelog: [internal]

This migrates the existing tests we have for the current public API for host component refs to Fantom.

After this, the only remaining test to migrate before we can clean up the legacy mocks for Fabric, etc. is the one for IntersectionObserer.

Reviewed By: sammy-SC

Differential Revision: D66599070

fbshipit-source-id: 67da1cd3b360ac79aed6fe6ad2a8bd5273754174
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot 09f6d165ec Export ReactNativeTester (#48024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48024

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D66599071

fbshipit-source-id: 52585e030642e5b6bd8921d2c9f9d14ee5d6ce71
2024-12-02 04:47:17 -08:00
Nicola CortiandFacebook GitHub Bot 88c9a42fca Fix eslint warnings in react-native (#48016)
Summary:
There are currently 2 warnings firing for every PR (e.g. look here https://github.com/facebook/react-native/pull/48013/files).

Those are annoying so I'm fixing them here.

## Changelog:

[INTERNAL] - Fix eslint warnings in react-native

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D66595842

Pulled By: cortinico

fbshipit-source-id: 0fd39629a97dbbe5d75a78c8eaa50241faf6bf1e
2024-12-02 04:11:22 -08:00
zhongwuzwandFacebook GitHub Bot 28ced2e558 Fabric: Fixes Modal onRequestClose not called (#48037)
Summary:
Fixes https://github.com/facebook/react-native/issues/48030 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Modal onRequestClose not called

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

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

Reviewed By: cortinico

Differential Revision: D66647232

Pulled By: cipolleschi

fbshipit-source-id: 773517dfe45f6f2e6348cda225e972fbac05edc2
2024-12-02 04:06:40 -08:00
CHOIMINSEOKandFacebook GitHub Bot b8095f4692 Avoid NPE when touch event is triggered before SurfaceManager is initiated (#48007)
Summary:
A NPE can occur when a user touches the screen before the `SurfaceMountingManager` is initialized. Below is an example of the error log from our production service. This issue can also be reproduced using RNTester. To prevent invalid touch events during init time of rn app from causing an NPE, add a null check for SurfaceMountingManager before calling mark/sweepActiveTouchForTag.

```
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.fabric.mounting.SurfaceMountingManager.markActiveTouchForTag(int)' on a null object reference
       at com.facebook.react.fabric.FabricUIManager.markActiveTouchForTag(FabricUIManager.java)
       at com.facebook.react.uimanager.JSTouchDispatcher.markActiveTouchForTag(JSTouchDispatcher.java)
       at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java)
       at com.facebook.react.runtime.ReactSurfaceView.dispatchJSTouchEvent(ReactSurfaceView.java)
       at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2870)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:794)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1967)
       at android.app.Activity.dispatchTouchEvent(Activity.java:4571)
       at com.rainist.banksalad2.feature.common.BaseActivity.dispatchTouchEvent(BaseActivity.java)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:752)
       at android.view.View.dispatchPointerEvent(View.java:16498)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:8676)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:8423)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7752)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7809)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7775)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7978)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7783)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:8035)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7756)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7809)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7775)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7783)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7756)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:11343)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:11212)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:11168)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:11477)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:337)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:187)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:9063)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
```
https://github.com/user-attachments/assets/e9c6ff84-c94d-4392-9042-8e635197202e

## Changelog:

[Android] [Fixed] - Avoid NPE when touch event is triggered before SurfaceManager is initiated

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

Test Plan:
I checked the crashed being fixed on RNTester.

https://github.com/user-attachments/assets/71f7e359-707a-494c-ae34-fef8d432e612

Reviewed By: cortinico

Differential Revision: D66594576

Pulled By: javache

fbshipit-source-id: b1559d94866bdb021e0374f1953684849603033c
2024-12-02 03:54:34 -08:00
Wojciech LewickiandFacebook GitHub Bot 44b04b6d42 fix: add mising subpsec to React-Fabric podspec (#48023)
Summary:
Running app with static linking fails to compile. Probably during https://github.com/facebook/react-native/pull/43581 adding that code was overlooked since the analogous thing seems to be added: https://github.com/facebook/react-native/pull/43581/files#diff-6680f6849631e3dcc5897ee3961a9d6d2bc57aff3eccb79a9d9c634183276202R566.

cc rubennorte since you made the linked PR.

## 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] [FIXED] - Add missing subpsec to React-Fabric podspec.

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

Test Plan: Run https://github.com/WoLewicki/reproducer-react-native/tree/%40wolewicki/static-linking-with-live-markdown and see that it won't compile without this change.

Reviewed By: cipolleschi

Differential Revision: D66600486

Pulled By: cortinico

fbshipit-source-id: 9de64541e49d27cdf00f37942adab6620476f15a
2024-12-02 03:23:45 -08:00
Wojciech LewickiandFacebook GitHub Bot fa03840e68 fix: typo in inherited (#48013)
Summary:
fix typo in `inherithed`

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [CHANGED] - fix typo in utils.rb

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

[IOS] [CHANGED] - fix typo in utils.rb

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

Test Plan: I did not spot any changes when switching it but in some specific build settings it could destroy some behaviors probably.

Reviewed By: cipolleschi

Differential Revision: D66595786

Pulled By: cortinico

fbshipit-source-id: d1607fd1127352533fb2977bdfcafec1edd1aef7
2024-12-02 03:23:01 -08:00
Nicola CortiandFacebook GitHub Bot 490db92562 Gradle to 8.11.1 (#48026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48026

This should mitigate this particular issue we're seeing on Windows:
- https://github.com/facebook/react-native/issues/46210

Changelog:
[Android] [Changed] - Gradle to 8.11.1

Reviewed By: javache

Differential Revision: D66600321

fbshipit-source-id: d58437485222e189d90bcf4d6b41ca956449ed22
2024-12-02 03:22:32 -08:00
Rob HoganandFacebook GitHub Bot e996b3f346 Fix Animated on JSC: Object.hasOwn -> obj.hasOwnProperty (#48035)
Summary:
https://github.com/facebook/react-native/pull/46385 introduced use of `Object.hasOwn` as an incidental detail of some `Animated` performance improvements.

Unfortunately, `Object.hasOwn` is not present in the version of JSC shipped with Android, nor the built in iOS JSC until iOS 15.4, which is greater than React Native's minimum version (13.4).

Instead:
 - Use `obj.hasOwnProperty(prop)` for known objects that have the `Object` prototype.
 - Otherwise, use `Object.hasOwn` where it is defined.
 - Lastly, fall back to `Object.prototype.hasOwnProperty.call(obj, prop)`, which is compatible with passed `null`-prototype objects.

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

Intend to pick for RN 0.77.

## Changelog:

[GENERAL][FIXED] Replace Object.hasOwn usages to fix Animated on JSC

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

Test Plan:
- Run `rn-tester` on Android with Hermes disabled.
 - Verify the FlatList->Basic example redboxes before this change, and works after it.

Reviewed By: yungsters

Differential Revision: D66638379

Pulled By: robhogan

fbshipit-source-id: 51ac525851b41adea3bf3cc41349225138e1f2fe
2024-12-02 03:16:28 -08:00
Hugo FOYARTandFacebook GitHub Bot f791fb9e66 fix: FormData filename in content-disposition (#46543)
Summary:
This Pull Request fixes a regression introduced in https://github.com/facebook/react-native/commit/7c7e9e6571c1f702213e9ffbb40921cd5a1a786b, which adds a `filename*` attribute to the `content-disposition` of a FormData part. However, as the [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives) states, there is no `filename*` attribute for the `content-disposition` header in case of a form data.

The `filename*` attribute would break the parsing of form data in the request, such as in frameworks like `Next.js` which uses the web implementation of [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request).

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

## 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] - Remove non compliant `filename*` attribute in a FormData `content-disposition` header

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

Test Plan:
- Clone the `react-native` repo
- Create a simple JS file that will act as a node server and execute it

```javascript
const http = require('http');

const server = http.createServer(async function (r, res) {
    const req = new Request(new URL(r.url, 'http://localhost:3000'), {
      headers: r.headers,
      method: r.method,
      body: r,
      duplex: 'half',
    });

    const fileData = await req.formData();

    console.log(fileData);
    res.writeHead(200);
    res.end();
});
server.listen(3000);
```

- Go to `packages/rn-tester`
- Add a `useEffect` in `js/RNTesterAppShared.js`

```javascript
React.useEffect(() => {
    const formData = new FormData();
    formData.append('file', {
      uri: 'https://www.gravatar.com/avatar',
      name: '测试photo/1.jpg',
      type: 'image/jpeg',
    });

    fetch('http://localhost:3000', {
      method: 'POST',
      body: formData,
    }).then(res => console.log(res.ok));
  });
```

- Run the app on iOS or Android
- The node server should output the file added to the FormData with an encoded name

Reviewed By: robhogan

Differential Revision: D66643317

Pulled By: yungsters

fbshipit-source-id: 0d531528005025bff303505363671e854c0a2b63
2024-12-02 03:14:28 -08:00
Kacper RozniataandFacebook GitHub Bot b886bc4db9 feat(android): migrate ReactSwitchManager to Kotlin (#48003)
Summary:
This PR migrates `ReactSwitchManager` to Kotlin

Also it moves it's shadow node to a separate file (`ReactSwitchShadowNode.kt`)

## Changelog:

[ANDROID] [CHANGED] - Migrate `ReactSwitchManager` to Kotlin

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

Test Plan: Make sure that `Switch` example in `RNTester` works correctly

Reviewed By: cortinico

Differential Revision: D66594606

Pulled By: javache

fbshipit-source-id: 774641c4cf57d6d5f770df1fed4fcafef2af7ceb
2024-12-02 02:41:31 -08:00
zhongwuzwandFacebook GitHub Bot 91e217ff54 Add completion block when call js module function (#47998)
Summary:
Fabric bridgeless don't call completion block when call js module method, so let's support it :).

## Changelog:

[IOS] [FIXED] - [Fabric] Add completion block when call js module function

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

Test Plan: Module call js module method when passed `onComplete` block can be called successfully in bridgeless mode.

Reviewed By: fabriziocucci

Differential Revision: D66594514

Pulled By: javache

fbshipit-source-id: 74644b1f359a24cfa93389451e172fbc6a8ee1a1
2024-11-29 04:08:52 -08:00
Andrew DatsenkoandFacebook GitHub Bot 5ff59b448b Add defaults to ParagraphAttributes::getDebugProps (#47986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47986

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66542033

fbshipit-source-id: d1f3d1776138d076636765262e27ae8e5e7342c5
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot de30f408e5 Add defaults to TextAttributes::getDebugProps (#47985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47985

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66542032

fbshipit-source-id: ccecd660f00d3d32909a57534897ba110d53d7b3
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot 212a743fdf Add float comparison to debugStringConvertilbeUtils (#47984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47984

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66541322

fbshipit-source-id: 1adb52de5c9b0321e328532c4394d8067ffce3d8
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot b27bd00a38 add jest-diff to dependencies (#47990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47990

Changelog:
[General][Added] - add `jest-diff v29.7.0` to devDependencies

Reviewed By: NickGerleman

Differential Revision: D66541001

fbshipit-source-id: 01c59a936b66f85ce034b59c7928df3c3f8c2a01
2024-11-28 10:04:46 -08:00
lihaitaoandFacebook GitHub Bot 2aa79979d3 fix:setColorScheme exception when activity recreate (#47955)
Summary:
solve the exception  on android when `Appearance.setColorScheme` and activity recreate()
Fixes https://github.com/facebook/react-native/issues/47954

## Changelog:

[Android][Fixed] setColorScheme should be called on the UI thread

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

Reviewed By: cortinico

Differential Revision: D66573373

Pulled By: javache

fbshipit-source-id: 97808e163e1c53bb94f4be7269d9cb9e212f2e95
2024-11-28 09:37:07 -08:00
Alex HuntandFacebook GitHub Bot 2fcf7b1f49 Allow fuseboxClientType_ detection from ReactNativeApplication.enable method (#47962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47962

Updates `HostAgent` to respond equivalently if either `FuseboxClient.setClientMetadata` (outgoing) or `ReactNativeApplication.enable` (incoming) are sent by the CDP frontend.

This is a partial migration, to be followed by removing the `FuseboxClient.setClientMetadata` method later.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D66501027

fbshipit-source-id: 1ff669c24667f51d240311e75f95747efe577e2d
2024-11-28 09:26:03 -08:00
Rubén NorteandFacebook GitHub Bot 7ccc5934d0 Implement symbolication of error stack traces (#48006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48006

Changelog: [internal]

This implements symbolication of error stack traces in Fantom tests. We just needed to ask Metro to generate source maps and use the `source-map` package to process the stack traces that we get back from the runtime.

Reviewed By: sammy-SC

Differential Revision: D66577818

fbshipit-source-id: 672c66c246ad8646646d5ed31cabca39eb4f7aca
2024-11-28 07:59:26 -08:00
Pieter De BaetsandFacebook GitHub Bot bc9e4db9e9 Demonstrate bug in differentiator where reparented nodes reference non-existent nodes (#48002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48002

Demonstrates the issue identified in https://github.com/facebook/react-native/issues/47960 and a crash we've been seeing internally around `getViewState` referencing a view that does not exist.

When reparenting unflattened nodes, Differentiator may emit an `update` with a `parentShadowView` that does not exist on the native side yet, thereby crashing Android.

Landing the test-case first (with some test cleanup), so the diff for the actual fix is clearer.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D66557919

fbshipit-source-id: 5428c32e5f0200a8e98568cabeedb0c61aafbe23
2024-11-28 06:06:59 -08:00
Kudo ChienandFacebook GitHub Bot 24fee29f7a Add useColorScheme mock test (#47988)
Summary:
add a jest test to test when `useColorScheme` is not mocked. following up https://github.com/facebook/react-native/pull/47629#issuecomment-2491534678

## Changelog:

[GENERAL] [ADDED] - Add useColorScheme mock test

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

Test Plan: ci passed

Reviewed By: javache

Differential Revision: D66573172

Pulled By: blakef

fbshipit-source-id: 820227f6fc4e18a968b3181fad8f534a716f1e9e
2024-11-28 05:05:31 -08:00
Rubén NorteandFacebook GitHub Bot 6ae49ee9e3 Improve error messages in tests (#47994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47994

Changelog: [internal]

This adds a few hacks to improve errors messages in Fantom tests. Before, we were only logging the error message. After this, we log the message and the full (unsymbolicated for now) stack, including a pretty print of the exact location of the error.

For errors thrown from `expect` functions, the stack trace is modified to remove the "infra" lines from the stack.

The next step is symbolicating the errors using source maps generated by metro.

Reviewed By: javache

Differential Revision: D66555063

fbshipit-source-id: 17bd23cb30429a17e99f13f934c45e001120bbb3
2024-11-28 04:31:20 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot ce9f5345e3 Fix Android ensureNoOverlap function and revise implementation (#47989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47989

- Fixing Android's ensureNoOverlap algorithm. (For real this time)
- Improve verbiage for `ensureNoOverlap` function.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66514729

fbshipit-source-id: 99908deee2232cc125bb0998ae7acd636a1f7e10
2024-11-27 19:57:55 -08:00
Arushi KesarwaniandFacebook GitHub Bot 5da7089e35 NIT: Updating docstring for DefaultReactHost for missing arguments (#47992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47992

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66552119

fbshipit-source-id: 6dcd461fcea1444a58db4f98316bf8878ae98781
2024-11-27 17:26:19 -08:00
Arushi KesarwaniandFacebook GitHub Bot 762bcc6073 NIT: Updating docstring for DefaultReactHost to match the arguments. (#47991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47991

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66550256

fbshipit-source-id: b3c18032a421fd9f0bd69c142e72d884f96340f8
2024-11-27 17:26:19 -08:00
Alex HuntandFacebook GitHub Bot 7f57018e25 Add profiling_target_registered event, log to terminal (#47968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47968

Updates the Inspector Proxy to report + log when a profiling build target (experimental) is registered. This notifies the developer that debugging is available for these app(s), which will not otherwise fetch development bundles from Metro.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501771

fbshipit-source-id: e06dee279158094ad5c70bf8e6a90e7c983de48a
2024-11-27 11:42:31 -08:00
Alex HuntandFacebook GitHub Bot b95631ed7f Enable identifying profiling builds on proxy registration (#47967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47967

(Android only) Updates `jsinspector-modern` to enable identifying profiling builds (experimental) when registering the debug target with the Inspector Proxy.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501768

fbshipit-source-id: bbe2b9a2c7c014c952ef5ee49284a161dbeefb09
2024-11-27 11:42:31 -08:00
Alex HuntandFacebook GitHub Bot b9762d568a Enable identifying profiling builds over CDP (#47966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47966

Updates `jsinspector-modern` to enable identifying profiling builds (experimental) to the frontend over CDP.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501770

fbshipit-source-id: 9d079da862a59d5e2dc6f970e7418339620e1451
2024-11-27 11:42:31 -08:00
Rubén NorteandFacebook GitHub Bot a36dbae486 Optimize performance of ReactNativeElement constructor (#47983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47983

Changelog: [internal]

This mitigates some performance regressions caused by the migration from `ReactFabricHostComponent` to `ReactNativeElement` (enabling the DOM APIs).

Those regressions were caused by 2 main things:
1. By the use of a class hierarchy and having to call `super()`, which we transpile to a very complex code to ensure it's spec compliant.
2. By the use of private fields (`#viewConfig`) which are significantly slower than a regular field with the `_` naming convention (`_viewConfig`) processed by our custom transform.

This mitigates those problems by using the `_` convention and refactoring the class hierarchy to avoid the use of `super()` while preserving the Flow typing and most of the existing implementation.

Reviewed By: javache, andrewdacenko

Differential Revision: D66540756

fbshipit-source-id: db6aa18c12194b18e3a69e9979621d0feae6186a
2024-11-27 11:24:31 -08:00
Jakub RomanczykandFacebook GitHub Bot 881d8a720f refactor(community-cli-plugin): use node builtin fetch (#47397)
Summary:
Removed `node-fetch` in favour of node builtin fetch to get rid of the deprecated `punycode` warning when using Node 22.

`react-native/community-cli-plugin` already requires Node >= 18 where it was made available by default (without `--experimental-fetch` flag).

This change is similar to the one made in https://github.com/facebook/react-native/pull/45227

## Changelog:

[GENERAL] [CHANGED] - Drop node-fetch in favor of Node's built-in fetch from undici in `react-native/community-cli-plugin`

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

Test Plan: tests pass

Reviewed By: blakef

Differential Revision: D66512595

Pulled By: NickGerleman

fbshipit-source-id: c4e01baf388f9fae8cea7b4bfe25034bff28b461
2024-11-27 10:39:39 -08:00
Joe VilchesandFacebook GitHub Bot 1d909efa23 Align order of params between calculateLayoutInternal and calculateLayoutImpl (#47975)
Summary:
X-link: https://github.com/facebook/yoga/pull/1755

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

I've been working with callsites here and its annoying if you switch these that you need to move these params around too. Let's just make them the same order

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66519836

fbshipit-source-id: 2e98e671270a053c6e62372e2003f1ca67774ec9
2024-11-26 22:48:24 -08:00
Phillip PanandFacebook GitHub Bot 3c09d6bfce allow bindings installer to be passed down to DefaultReactHost (#47944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47944

Changelog: [Internal]

adding an option to pass down bindings installer from product layer

Reviewed By: mlord93

Differential Revision: D66477349

fbshipit-source-id: 9462cbe0b1fcee875c18de0426c0c1b02f086ff1
2024-11-26 19:20:56 -08:00
Joe VilchesandFacebook GitHub Bot 40c194cf47 Camel case LengthValue in Node.cpp (#47971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47971

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

This was annoying me

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66510734

fbshipit-source-id: d1b952f2e82e7018b16dc0c572d9b98aec18c0e5
2024-11-26 15:23:08 -08:00
Alex HuntandFacebook GitHub Bot 24f010d5b5 Update unstable-react-profiling to use PerftestDevSupportManager (#47715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47715

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66167302

fbshipit-source-id: 23e6154eedd36c2011062de3195887cba7af8a72
2024-11-26 12:48:37 -08:00
Andrei MarchenkoandFacebook GitHub Bot df7b6ae092 fix item disappearing with scroll in VirtualizedList (#47965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47965

Changelog: [General] [Changed] - fix item disappearing with scroll in VirtualizedList

It was caused because the function `computeWindowedRenderLimits` collapsed the current window size to just 1 element. So, users start scroll current window increase from {left:0, right:5 } -> {left:0, right:6 } and after some edge cases the window collapsed to `{left:6, right:6 }` which cause to remove all elements and recreate them later. As a result users have a lot of lags and blank pages.

The diff fixes the collapsing window size to 1 element. Also fix other decreasing `left` position even if windowSize more than current amount of elements.

Reviewed By: NickGerleman

Differential Revision: D66334188

fbshipit-source-id: 2162d00d03d64ab6325c0492d87449051e68a4e9
2024-11-26 10:44:30 -08:00
Rob HoganandFacebook GitHub Bot 016f44518e Changelog for 0.77.0-rc.0 (#47958)
Summary:
Changelog as generated by rnx-kit + manual fixes.

Changelog: [Internal]

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

Reviewed By: rshest, blakef

Differential Revision: D66498590

Pulled By: robhogan

fbshipit-source-id: 81efda2615f8e61be5f5922511362946f3ba3c6b
2024-11-26 08:06:18 -08:00
Dmitry RykunandFacebook GitHub Bot 69356b7f21 Introduce ImageRequestParams (#47723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47723

Identity of `ImageRequest` is based on `ImageSource` and a subset of `ImageProps`. If any of those change, the request must be recreated and resubmitted.

Currently, the relevant subset of ImageProps is represented by a single `blurRadius` prop. This list will grow in the future. In order to simplify adding new props to the image request, we introduce the `ImageRequestParams` type that will wrap all the relevant props.

The alternative approach to pass `ImageProps` directly to `ImageManager` is worse because it would introduce dependency cycle between `ImageManager` and the `Image` component, and also it would require to store the props in State, which is bad.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66172570

fbshipit-source-id: d6853bf8dcecd6e76ac90ccb2079d102a3015988
2024-11-26 07:27:02 -08:00
Dmitry RykunandFacebook GitHub Bot a6b2355b8d Introduce Android ImageManger (#47721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47721

This diff splits Cxx ImageManger into Cxx and Android variants. They both are currently no-op, but the Android one will be used for image prefetching, just as `RCTImageManager.mm` for iOS.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65753319

fbshipit-source-id: 774ff09b6b397facee7f645706dd97ba6d1177d7
2024-11-26 04:22:09 -08:00
Pieter De BaetsandFacebook GitHub Bot 8869fa4c2c Fix stale reference to ReactViewGroup#mAllChildren (#47950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47950

`addInArray` may reallocate `mAllChildren` so it's not correct to store this reference.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66474532

fbshipit-source-id: 90ce2fcbf8ff236501ed47b2acc413e54ef8b82a
2024-11-26 04:00:14 -08:00
Pieter De BaetsandFacebook GitHub Bot 84adf268e1 Add more diagnostics for subview clipping crash (#47937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47937

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66469161

fbshipit-source-id: d32f0592787ecae850854b2ff04d7c703ee8ec2e
2024-11-26 04:00:14 -08:00
Sam ZhouandFacebook GitHub Bot d86412dcc6 prepare for primitive literal changes (#47943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47943

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D66461724

fbshipit-source-id: b526ed1617667b70337472f4dad4e19f152a266b
2024-11-26 00:07:32 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f70c3cae5b Fix border disappearing when only one edge is transparent (#47940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47940

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

Border was disappearing when only one edge had an alpha of 0. This was due to clipping conditional

Changelog: [Internal]

Reviewed By: shwanton, NickGerleman

Differential Revision: D66397736

fbshipit-source-id: 8937323ad16e0c6e98a55051f244c08ef54c96eb
2024-11-25 18:15:25 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 96e66e7b48 Add unit tests for CompositeBackgroundDrawable layer ordering optimization (#47913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47913

CompositeBackgroundDrawable has some logic for inserting the layers that are not set through the constructor. This unit test makes sure they are being properly ordered.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66381515

fbshipit-source-id: 514979a4a97fa159c1d1c3c923afe969eafc21c3
2024-11-25 16:48:39 -08:00
Sam ZhouandFacebook GitHub Bot cb7cd89a10 Deploy 0.255.0 to xplat (#47941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47941

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D66477998

fbshipit-source-id: f4d1dbe506d6c42751fade897637031f0a43aa29
2024-11-25 16:06:09 -08:00
Brett LavallaandFacebook GitHub Bot f363b43856 Make color value of ShadowStyleSpan public (#47934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47934

This property needs to be made public for later diffs in this stack.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66338915

fbshipit-source-id: f4896f8404e3d7eed7255e0f923ab5eec9a1291e
2024-11-25 15:45:57 -08:00
danandFacebook GitHub Bot fe7e97a2fd Fix ScrollView centerContent losing taps and causing jitter on iOS (#47591)
Summary:
The React Native `<ScrollView>` has a peculiar `centerContent` prop. It solves a common need — keeping the image "centered" while it's not fully zoomed in (but then allowing full panning after it's sufficiently zoomed in).

This prop sort of works but it has a few wonky behaviors:

- If you start tapping immediately after pinch (and don't stop), the taps will not be recognized until a second after you stop tapping. I suspect this is because the existing `centerContent` implementation hijacks the `contentOffset` setter, but the calling UIKit code _does not know_ it's being hijacked, and so the calling UIKit code _thinks_ it needs to do a momentum animation. This (invisible) momentum animation causes the scroll view to keep eating the tap touches.
- While you're zooming in, once you cross the threshold where `contentOffset` hijacking stops adjusting values, there will be a sudden visual jump during the pinch. This is because the "real" `contentOffset` tracks the accumulated translation from the pinch gesture, and once it gets taken into account with no "correction", the new offset snaps into place.
- While not sufficiently pinched in, the vertical axis is completely rigid. It does not have the natural rubber banding.

The solution to all of these issues is described [here](https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/). Instead of hijacking `contentOffset`, it is more reliable to track zooming, child view, and frame changes, and adjust `contentInsets` instead. This solves all three issues:

- UIKit isn't confused by the content offset changing from under it so it doesn't mistrigger a faux momentum animation.
- There is no sudden jump because it's the insets that are being adjusted.
- Rubber banding just works.

## 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] - Fixed centerContent losing taps and causing jitter

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

Test Plan:
I'm extracting this from [a patch we're applying to Bluesky](https://github.com/bluesky-social/social-app/blob/2ef697fe3d7dec198544ed6834553f33b95790b3/patches/react-native%2B0.74.1.patch). I'll be honest — I have not tested this in isolation, and it likely requires some testing to get merged in. I do not, unfortuntately, have the capacity to do it myself so this is more of a "throw over the wall" kind of patch. Maybe it will be helpful to somebody else.

I've tested these in our real open source app (https://github.com/bluesky-social/social-app/pull/6298). You can reproduce it in any of the lightboxes in the feed or the profile.

### Before the fix

Observe the failing tap gestures, sudden jump while pinching, lack of rubber banding.

https://github.com/user-attachments/assets/c9883201-c9f0-4782-9b80-8e0a9f77c47c

### After the fix

Observe the natural iOS behavior.

https://github.com/user-attachments/assets/c025e1df-6963-40ba-9e28-d48bfa5e631d

Unfortunately I do not have the capacity to verify this fix in other scenarios outside of our app.

Reviewed By: sammy-SC

Differential Revision: D66093472

Pulled By: javache

fbshipit-source-id: 064f0415b8093ff55cb51bdebab2a46ee97f8fa9
2024-11-25 14:56:02 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 2a2f58ad9d Add mixBlendMode to iterator style parser (#47292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47292

If we don't add the prop to the iterator style parser then since fabric is not parsing the prop we are not properly creating the stacking context for when a prop has a mix-blend-mode set

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65166886

fbshipit-source-id: 7b5bce82e81bf0c566ccd4620852ae877ccbf376
2024-11-25 13:12:12 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot b41fb6c88e Add fabric check to drawChild function (#47293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47293

We missed fabric check for the mix-blend-mode conditional on `drawChildren` adding it now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D65167244

fbshipit-source-id: 1af5dc1979fb79c453ba0f27c0385a94dc539a55
2024-11-25 13:12:12 -08:00
Dmitry RykunandFacebook GitHub Bot 8d83da6460 Introduce experimental image prefetching API (#47755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47755

TIA.
Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65596686

fbshipit-source-id: 9fbd57caa2fdeab0bdf68e7919b1f65179634a9d
2024-11-25 12:40:09 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 81a94f4f14 Forward fix incorrect elliptical border radius (#47931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47931

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66388179

fbshipit-source-id: 5c614cf52e834f664bb9f59767b2e172c51af620
2024-11-25 11:10:02 -08:00
Mateo GuzmánandFacebook GitHub Bot 81cb166d10 fix(image): [android] cache control headers are being overwritten (#47922)
Summary:
While trying to write some test cases for `ReactOkHttpNetworkFetcher`, I found that the cache control headers are not being sent over the network request correctly. These cache control headers are always being overwritten by the rest of the headers hence all the logic to set this custom cache control doesn't seem to be working as expected.

As per the [Request headers](https://github.com/square/okhttp/blob/2832a9e532ecbc6f1f84b3a07e8e64b75372789c/okhttp/src/main/kotlin/okhttp3/Request.kt#L256) docs, this seems to be the explanation:

> /** Removes all headers on this builder and adds [headers]. */
    open fun headers(headers: Headers) = commonHeaders(headers)

With the new approach by setting the headers first, we ensure that the cache control headers don't get overwritten but they would get added on top of the passed headers.

Notice that currently it seems to be overwriting these headers even if there are not headers passed from the Image component (AKA null/empty).

See my reproduction example in the test plan.

## Changelog:

[ANDROID] [FIXED] - ReactOkHttpNetworkFetcher – cache control headers getting overwritten by the rest of the headers

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

Test Plan:
By creating the following component, we log the request headers using `FLog` with the previous and the new approach. See the difference on the outputs below:

Component:
```tsx
<Image
  source={{
    uri: 'https://www.facebook.com/assets/fb_lite_messaging/E2EE-settings@3x.png?cacheBust=reload',
    cache: 'reload',
    headers: {
      'some-header': 'some-header-value',
    },
  }}
/>
```

Setting the `headers` last (current approach):

```kt
val request =
        Request.Builder()
            .cacheControl(cacheControlBuilder.build())
            .url(uri.toString())
            .headers(headers)
            .get()
            .build()
FLog.w("RequestHeaders", request.headers.toString())
```

Output (notice that the Cache-Control header is not present):
```bash
RequestHeaders  com.facebook.react.uiapp  W  some-header: some-header-value
```

<img width="561" alt="image" src="https://github.com/user-attachments/assets/797cd90a-2064-4772-99cc-5f9d39d73361">

 ---

New approach by setting the `headers` first:

```kt
val request =
        Request.Builder()
            .headers(headers)
            .cacheControl(cacheControlBuilder.build())
            .url(uri.toString())
            .get()
            .build()
FLog.w("RequestHeaders", request.headers.toString())
```

Output (Cache-Control is present now along with the passed headers):
```bash
RequestHeaders  com.facebook.react.uiapp   W  some-header: some-header-value
Cache-Control: no-cache, no-store
```

<img width="556" alt="image" src="https://github.com/user-attachments/assets/1b9f7865-926e-496b-ad3a-36e19ae92188">

Reviewed By: rshest

Differential Revision: D66446820

Pulled By: javache

fbshipit-source-id: 2640ea4b0e678a7aa919b919b0b44bedc0da0af4
2024-11-25 07:34:51 -08:00
Joe VilchesandFacebook GitHub Bot 2781888d22 Back out "Modify private apis to set, store, and get intrinsic sizing keywords" (#47895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47895

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

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332307

fbshipit-source-id: 1d596964e0c893091c541988506e8b80fa6d1957
2024-11-25 00:40:03 -08:00
Joe VilchesandFacebook GitHub Bot 04e44f30f7 Back out "Update public API for intrinsic sizing setters" (#47896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47896

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

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332309

fbshipit-source-id: 793f77dad021fa5e57b52c36ae954307636bcbf0
2024-11-25 00:40:03 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 24b0ded3cf Enable mix-blend-mode on ReactRootView so blending works with app background (#47336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47336

Before mix-blend-mode would not blend with the background color due to it not being a ViewGroup. This adds the mix-blend-mode logic to ReactRootView so blending works

Changelog:
[Android][Fixed] - Enable mix-blend-mode on ReactRootView so blending works with app background

Reviewed By: NickGerleman

Differential Revision: D65156543

fbshipit-source-id: b3628b667573d0b56c74214e40d21c656fda495a
2024-11-24 15:33:35 -08:00
Aryan Dev ShourieandFacebook GitHub Bot 30e75a51f3 Fixed a typo in README for better clarity and understanding (#47918)
Summary:
I was just going through the README file, and I felt that the word "repo" seems a bit informal. Thus I made the correction and made it "repository".

## Changelog:

[General] [Changed] - Fixed a typo in the README file.

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

Test Plan: No specific Test Plan for these changes, as it is just a typo fix in README.md

Reviewed By: fkgozali

Differential Revision: D66414686

Pulled By: arushikesarwani94

fbshipit-source-id: 578530d2dcdf046a90bf5a5bc32ba68e8f496c81
2024-11-23 20:44:34 -08:00
Panos VekrisandFacebook GitHub Bot d4d1eb9bb1 Deploy 0.254.2 to xplat (#47912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47912

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66379853

fbshipit-source-id: 3a7677c5a71ef74e509ed43be87e455aed0cbaa7
2024-11-22 21:48:38 -08:00
Ramanpreet NaraandFacebook GitHub Bot 1fed2cfdef bugfix: Only handle first javascript fatal error (#47914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47914

This was a bug in the original diff: D66193194.

If a fatal js error happens, we should only drop subsequent **fatal** js errors. It's fine to report soft errors.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66392706

fbshipit-source-id: c51bae186184c54faa9bce065b81b442607e751b
2024-11-22 18:10:23 -08:00
David VaccaandFacebook GitHub Bot 5dd712fc08 Deprecate NotThreadSafeViewHierarchyUpdateDebugListener (#47747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47747

Deprecate NotThreadSafeViewHierarchyUpdateDebugListener as won't be available in new arch and will be deleted

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216730

fbshipit-source-id: 88f3346ad38b80a710d9df4ba08b63887048c8cd
2024-11-22 17:56:31 -08:00
David VaccaandFacebook GitHub Bot 0c47e1351f Remove @DeprecatedInNewArchitecture annotation from ReactPropGroup (#47746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47746

Remove DeprecatedInNewArchitecture annotation from ReactPropGroup since this annotation is not deprecated in new arch

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216727

fbshipit-source-id: 252bae58557b51c9fbfb1deab4edc7c50511a005
2024-11-22 17:56:31 -08:00
David VaccaandFacebook GitHub Bot f03e75d9be Remove DeprecatedInNewArchitecture for ReactPropHolder annotation (#47745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47745

Remove DeprecatedInNewArchitecture for ReactPropHolder annotation

ReactProp is still used in new arch, we might remove this annotation in the future but it will be independent of new arch

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216729

fbshipit-source-id: 3f64858ab4fa60b09978b18b17200ae488e229ce
2024-11-22 17:56:31 -08:00
Thomas NardoneandFacebook GitHub Bot 6a472c5cf2 Remove ReactViewGroup.getBackgroundColor() (#47906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47906

There are no usages in the repo.  External usages should be using [BackgroundStyleApplicator](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt#L82).

Changelog: [Android][Breaking] Removed ReactViewGroup.getBackgroundColor()

Reviewed By: NickGerleman

Differential Revision: D66368623

fbshipit-source-id: bf173efc7e40d3d8a5d55ba0f82eed49b4cb2746
2024-11-22 17:52:32 -08:00
Eric RozellandFacebook GitHub Bot a05d573f9e Guard against surface manager exceptions (#47910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47910

It seems there could be a race where a commit is being processed on the JS thread after the surface has been removed from the mounting manager. Since we don't actually need to retrieve the default paddings in these cases, there's no reason we need an enforced read of the SurfaceMountingManager.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D66369969

fbshipit-source-id: 44ccdc9beafdbd0ac47457fb01c4114348c1a316
2024-11-22 15:22:54 -08:00
Eric RozellandFacebook GitHub Bot e344b4914c Unconditionally clear static LongLivedObjectCollection (#47891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47891

Various C++ utilities for handling callbacks and promises rely on the static LongLivedObjectCollection. Even if a host platform injects it's TurboModuleBinding with a custom LongLivedObjectCollection, there's no guarantee that the platform is not also using C++ TurboModules that use the static LongLivedObjectCollection. Clearing both collections solves issues for TurboModuleBindings with custom LongLivedObjectCollections that also have cross platform C++ TurboModules that use the static collection.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D66324044

fbshipit-source-id: a5a973087c35fc00240e40ba757d49125473daf4
2024-11-22 15:20:10 -08:00
Maddie LordandFacebook GitHub Bot 450d982844 onHostDestroy, only set EnableDevSupport to false if the current activity is the one being destroyed (#47907)
Summary:
Changelog: [Internal]

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

EnableDevSupport is set to false on lifecyle events like onPause and onHostDestroy, and set to true on events like onResume and onCreate.

In apps like AMA and Twilight, there is first a loginActivity, which then calls the mainActivity. After mainActivity is created, loginActivity is destroyed. This causes enableDevSupport to always be false because onDestroy for loginActivity is triggered after onCreate for mainActivity.

Reviewed By: RSNara, alanleedev

Differential Revision: D66124018

fbshipit-source-id: e40a5b24cf73000b0bfeaa1d8e3902718b281410
2024-11-22 12:48:33 -08:00
Tom ScallonandFacebook GitHub Bot 162208d264 Support defining multiple CxxReactPackages from a single lambda (#47897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47897

Changelog: [Internal]

In some situations, we want to provide multiple `CxxReactModules` from a single lambda. Currently, this is painful -- this change makes it less so.

Reviewed By: tdn120

Differential Revision: D66337573

fbshipit-source-id: ed57ad6ca2b98d4787aca7da3714c05c3d03b649
2024-11-22 12:09:12 -08:00
Luna WeiandFacebook GitHub Bot a77d8d9d50 Support rn_rootThreshold on IntersectionObserver (viewAreaCoveragePercentThreshold) (#47908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47908

Changelog: [General][Added] - Add support for `rn_rootThreshold` in Intersection Observer

`rn_rootThreshold` is a custom IntersectionObserver option and not part of the IntersectionObserver spec. We are adding it because it covers a specific use-case for measuring viewability that is robust for `target`s that are larger than the viewport or specified `root`.

The threshold ratio is of the intersection area (of `root` and `target`) to the total area of the `root`.

 {F1960832959}
Source - EX314979

`rn_rootThreshold` is an optional threshold and can be combined with the `thresholds` option. An intersection will fire if any specified thresholds is met.

Note: If you use specify a `rn_rootThreshold`, the default `threshold` is no longer applied

The main use case of `rn_rootThreshold` is being able to specify a level of viewability independent of `target` size. For example, a `target` that is larger than the `root` (commonly the viewport) will not trigger the IntersectionObserver for a `threshold` of `1`. Setting `rn_rootThreshold` of `1`, will trigger once the item takes full size of the `root`.';

Reviewed By: yungsters

Differential Revision: D66031119

fbshipit-source-id: 7bdc871dc5b4e6c0edc7d6e17a0a0cfd51c4fe81
2024-11-22 11:50:36 -08:00
Thomas NardoneandFacebook GitHub Bot 0b22b955f1 ReactViewGroup - utilize onViewAdded/Removed (#47890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47890

The fix in [#40859](https://github.com/facebook/react-native/pull/40859) overrode every possible add or remove to ensure completeness, but all paths should also call onViewAdded/onViewRemoved via:
- `addView`/`addViewInLayout` -> [addViewInner](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r5/core/java/android/view/ViewGroup.java#5310)
- `removeView`/`removeViewInLayout` -> [removeViewInternal](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r5/core/java/android/view/ViewGroup.java#5606)
- `removeViews`/`removeViewsInLayout` -> [removeViewsInternal](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r5/core/java/android/view/ViewGroup.java#5714)

Changelog: [Android][Changed] Consolidated ReactViewGroup add/remove overrides

Reviewed By: javache

Differential Revision: D66320586

fbshipit-source-id: aaf16af5ad87789f575fcb79dcf31f5686002b2d
2024-11-22 10:27:09 -08:00
Thomas NardoneandFacebook GitHub Bot 3d1a505da5 ReactViewGroup - extract method for parent check (#47878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47878

Make it clearer what we're checking, and provide a single point of code where we could potentially improve the logic.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D66302526

fbshipit-source-id: a0e6d1004aef25897e9633fe930915ba585c1cb5
2024-11-22 10:27:09 -08:00
Thomas NardoneandFacebook GitHub Bot f1d7016be9 ReactViewGroup cleanup (#47674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47674

Small changes that can be done in Java and make a Kotlin conversion more seamless.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66033963

fbshipit-source-id: 666302f132b98019f1013a335a2c59c7a4f31836
2024-11-22 10:27:09 -08:00
Rob HoganandFacebook GitHub Bot 74995bc90a dev-middleware: Generalise URL rewriting, don't only rewrite for Android emulators (#47880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47880

The previous diffs in this stack have aimed to make URL rewriting by inspector-proxy robust to any configuration of device->server, debugger->server and server->server connections.

Though rewriting was originally introduced to support Android emulator networking, we can now expand it to cover other use cases, like the device reaching the server over an internet address not reachable from the dev machine, or the debugger routing to the server through a tunnel on a different port, without needing CORS workarounds.

Changelog
[General][Fixed] dev-middleware: Rewrite URLs in the inspector proxy to cover all configurations, not just Android emulators.

Reviewed By: huntie

Differential Revision: D66247355

fbshipit-source-id: e9201ebc1f7f5fe2119c71cd4d7b4ca895645404
2024-11-22 10:26:43 -08:00
Pieter De BaetsandFacebook GitHub Bot aec7a66ae8 Remove deprecated ReactModuleInfo constructor (#47681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47681

These were deprecated back in D49262824, so should be safe to remove now.

Changelog: [Android][Removed] Removed hasConstants constructor from ReactModuleInfo

Reviewed By: mdvacca

Differential Revision: D66127070

fbshipit-source-id: 3bd441c96597598470f16c7770c4dfa4ada563a0
2024-11-22 08:05:41 -08:00
Pieter De BaetsandFacebook GitHub Bot bf5c98cf5e Remove deprecated TurboReactPackage (#47680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47680

This was deprecated in D50128456 so should be safe to remove now.

Changelog: [Android][Removed] Removed TurboReactPackage, which was replaced by BaseReactPackage

Reviewed By: mdvacca

Differential Revision: D66127067

fbshipit-source-id: a4090ab439cf99dc693622b8da2c0cffa247ad24
2024-11-22 08:05:41 -08:00
zhongwuzwandFacebook GitHub Bot 89f93dc921 Fabric: Fixes high contrast color when not specified (#47418)
Summary:
Fixes the high contrast color when not specified. Previously, if we didn't specify highContrastLight or highContrastDark, it would create a UIColor with an alpha of 0, which is not what we expected. We should fall back to the dark or light color instead.

## Changelog:

[IOS] [FIXED] - Fabric: Fixes high contrast color when not specified

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

Test Plan:
1. Enable color contrast in iPhone's settings.
2. Open PlatformColor example in RNTester. See dynamic colors
3. color shows correctly
![image](https://github.com/user-attachments/assets/a71b8743-b397-4a11-b287-ec117b1ba243)

Before:
![image](https://github.com/user-attachments/assets/6a12824b-f77c-4979-a232-c1c97554e53c)

Reviewed By: javache

Differential Revision: D66303078

Pulled By: cipolleschi

fbshipit-source-id: 63a0d2bc94eea438d4f69643d09825b74575188b
2024-11-22 07:16:24 -08:00
Andrew CoatesandFacebook GitHub Bot e6848ba5ba Fixes to bridging/base.h for MSVC compatibility (#47882)
Summary:
Attempting to use the various bridging template and generated C++ Specs for native modules in a project compiling with MSVC does not build.

For the fromJs I had to add `std::move` - otherwise it could not cast.

The supportsFromJs and supportsToJs are changed to address an IntelliSense issue where the template specialization cannot have default members.

## Changelog:
[GENERAL] [FIXED] - Fix C++ bridging template compatibility with MSVC

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

Test Plan: It continues to build on Android/iOS builds.  And it also builds with MSVC for react-native-windows and other out of tree platforms that use MSVC.

Reviewed By: cipolleschi

Differential Revision: D66360833

Pulled By: javache

fbshipit-source-id: bf97db1cd247a383eb86cac31c601e8ab3400fd2
2024-11-22 06:55:58 -08:00
Blake FriedmanandFacebook GitHub Bot e4fc27ec4d Add changelog for 0.76.3 (#47893)
Summary:
Add changelog for 0.76.3

Changelog: [Internal] - Add changelog for 0.76.3

bypass-github-export-checks

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D66329466

Pulled By: blakef

fbshipit-source-id: e399175e198d11e2a5c0492fa1869797b50ef26f
2024-11-22 05:55:25 -08:00
Samuel SuslaandFacebook GitHub Bot bb78142011 fix code comment for collapsable prop (#47881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47881

changelog: [internal]

collapsable prop is not only for android.

Reviewed By: NickGerleman

Differential Revision: D66299356

fbshipit-source-id: 1c7435c77ef029fea55346f4ca16b5c81022b85a
2024-11-22 05:45:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 677d82d818 Disable E2E Tests on RNTester (#47903)
Summary:
E2E tests for Android RNTester in GHA are flaky and they prevent CI to be green on main.
Given that the Branch cut is happening on Monday and that I'll be away for a week, it's better to disable them.

I'm planning to work a bit on those today and more once I'm back

## Changelog:
[Internal] - Temporarily disable E2E tests for Android

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

Test Plan: GHA

Reviewed By: javache

Differential Revision: D66359177

Pulled By: cipolleschi

fbshipit-source-id: a0064418af607953cf46445613796c18fb6e1389
2024-11-22 05:14:22 -08:00
oddlyspacedandFacebook GitHub Bot 8dc2c90ce5 chore(Android): convert systeminfo module classes to kotlin (#47616)
Summary:
Saw a lot of PRs and push to convert existing Java code to Kotlin, and wanted to contribute to the cause. This is a starting point for me so I can understand more about the Java to Kotlin conversion process for ReactAndroid package.

## Changelog:
- Converted AndroidInfoHelpers to Kotlin class
- Converted AndroidInfoModule to Kotlin object and updated usage of it across the package

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Migrated systeminfo module code from Java to Kotlin

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

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

Test Plan: Verified build on local dev environment.

Reviewed By: NickGerleman

Differential Revision: D66258996

Pulled By: javache

fbshipit-source-id: e0958c0be735f54cb20c7daeee1526059edaabcc
2024-11-22 03:35:36 -08:00
Pieter De BaetsandFacebook GitHub Bot d424bb9d7c Convert com.facebook.testutils.shadows to Kotlin (#47487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47487

Changelog: [Android][Deprecated] Deprecated shadows for ReadableNative[Map|Array].[Readable|Writable]

Reviewed By: rshest

Differential Revision: D65597417

fbshipit-source-id: 61f649c32fb91a13af075aa65869093f31d218e3
2024-11-22 01:53:48 -08:00
Pieter De BaetsandFacebook GitHub Bot eb5fbdf134 Convert com.facebook.react.bridge.WritableNativeArray to Kotlin (#47486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47486

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D65596952

fbshipit-source-id: 462432af819ed9a7fba515cee54055d737d2584e
2024-11-22 01:53:48 -08:00
Pieter De BaetsandFacebook GitHub Bot 145c72f816 Convert com.facebook.react.bridge.ReadableNativeArray to Kotlin (#47484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47484

Small change to types in the base class: all non-primitives return optional from ReadableArray, which matches the semantics in ReadableMap. We already rely on this in some cases, but the current nullability annotations were incorrect, and null values from the array would be passed through from `getMap` and `getArray`.

Changelog: [Android][Breaking] ReadableArray non-primitive getters are now correctly typed as optional

Reviewed By: Abbondanzo

Differential Revision: D65596278

fbshipit-source-id: 5574e9000b07de292bd0da5f1b071aac0eb331d6
2024-11-22 01:53:48 -08:00
Phillip PanandFacebook GitHub Bot 3575e21f73 fix extraModulesForBridge: in interop
Summary:
Changelog: [Internal]

the delegate of TMM is RCTInstance, but RCTInstance doesn't forward all of the APIs and we aren't protected by the compiler because of the optional in TMMDelegate

i found that this backwards compat API did not actually get set up correctly and was never working in the first place... this is why we should avoid optional

long term, TMMDelegate needs to be pushed down to the infra layer and not exist in product, cc blakef

Reviewed By: javache

Differential Revision: D66148789

fbshipit-source-id: 925a6d4ebb6ba6bfb0b1aec6710695e7551ba475
2024-11-21 23:02:15 -08:00
Thomas NardoneandFacebook GitHub Bot e2c621c5fc ReactViewGroup - fix setBorderRadius javadoc (#47892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47892

Update to match the method so it doesn't show as an error in the IDE.

Changelog:[Internal]

Reviewed By: jorge-cab

Differential Revision: D66326667

fbshipit-source-id: f81bdc7763862fc06440b27e417e0b53ad7774da
2024-11-21 19:00:06 -08:00
Ramanpreet NaraandFacebook GitHub Bot e4d8c96786 Correct message annotation on early js errors (#47889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47889

## Context
When is the runtime ready?
- After the main bundle finishes executing **without** raising a fatal javascript error

## Changes
Let's decorate all errors reported while the runtime is not ready as "[runtime not ready]".

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66316907

fbshipit-source-id: e48542af4f84d4cc3a6ce8f667dbaa10c30c19a8
2024-11-21 16:00:44 -08:00
David VaccaandFacebook GitHub Bot fd1d6b8c65 Remove DeprecatedInNewArchitecture for ReactProp annotation (#47744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47744

Remove DeprecatedInNewArchitecture for ReactProp annotation

ReactProp is still used in new arch, we might remove this annotation in the future but it will be independent of new arch

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216728

fbshipit-source-id: 86d9aeb2932cbf34c57a7a850da0ced5268447bf
2024-11-21 15:45:21 -08:00
David VaccaandFacebook GitHub Bot fb737ca7d3 Deprecate ReactContext.getFabricUIManager() method (#47743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47743

Deprecate ReactContext.getFabricUIManager() method

changelog: [Android][Deprecated] ReactContext.getFabricUIManager() method

Reviewed By: shwanton

Differential Revision: D66216427

fbshipit-source-id: 0e716921a6fc65ad1ccfcab71640174515ae4f67
2024-11-21 15:45:21 -08:00
David VaccaandFacebook GitHub Bot 3baf562df0 Migrate SurfaceDelegate to Kotlin (#47687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47687

Migrate SurfaceDelegate to Kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66134455

fbshipit-source-id: 35e6a5c590c1f8eb0060f8f44680b9134ea127c1
2024-11-21 15:45:21 -08:00
Ramanpreet NaraandFacebook GitHub Bot c02e3b1c60 Only handle the first javascript fatal error (#47783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47783

After the first javascript fatal, the runtime starts tearing down. And it becomes invalid. So, subsequent js fatals will most likely be just noise. Let's filter them out.

This impacts bridgeless mode: both the javascript and c++ pipeline.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66193194

fbshipit-source-id: 61a731850f7ac4f00bfac24e3260673bf94ba8ed
2024-11-21 14:09:08 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 451ff70da4 implement correct border-radius scaling on overlapping radii (#47886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47886

We were not scaling border radii properly when they overlap.

We were relying on Android's handling of the issue which is not compliant with the web algorithm leading to **visible gaps between layers when the radii overlapped**

We are now following web spec https://www.w3.org/TR/css-backgrounds-3/#corner-overlap

Changelog: [Android] [Added] Add overlapping radii resolution logic preventing incorrect rendering

Reviewed By: NickGerleman

Differential Revision: D66269809

fbshipit-source-id: 4ab7025dc1e41be6205ff6b828617e1e222536a9
2024-11-21 14:01:02 -08:00
Sam ZhouandFacebook GitHub Bot 12550f05c5 Deploy 0.254.1 to xplat (#47887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47887

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D66315470

fbshipit-source-id: 16b8fca3412fc2fcea3be8dfd0c760d97c56d734
2024-11-21 13:13:10 -08:00
Matthew HoranandFacebook GitHub Bot 68db74205a Fix asynchronous access to KeyboardAvoidingEvent event in onLayout handler (#47798)
Summary:
The `onLayout` handler of the `KeyboardAvoidingView` view is async due to the `await AccessibilityInfo.prefersCrossFadeTransitions` in `_relativeKeyboardHeight`.

A connected `onLayout` handler will be unable to access the event. Call `persist()` on the event so that it can be accessed asynchronously.

## Changelog:

[GENERAL] [FIXED] - Accessing KeyboardAvoidingEvent event in onLayout handler

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

Test Plan:
The following should not produce an error:
```
import * as React from 'react';
import {
  KeyboardAvoidingView,
  SafeAreaView,
  TextInput
} from 'react-native';

export default function() {
  return (
    <SafeAreaView>
      <KeyboardAvoidingView onLayout={(event) => console.log(event)} behavior="padding">
        <TextInput />
      </KeyboardAvoidingView>
    </SafeAreaView>
  );
}
```

Reviewed By: cipolleschi

Differential Revision: D66306085

Pulled By: dmytrorykun

fbshipit-source-id: 9ccf00db79947670ddc7de74a47cc6dc27455fc0
2024-11-21 12:10:17 -08:00
Rob HoganandFacebook GitHub Bot 5da7ebf99a dev-middleware: Don't assume device-relative and debugger-relative URLs have the same port (#47876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47876

Currently, if a device is connected to the bundler via, say, `http://10.0.2.2:8081` (Android default), and a debugger is opened on `http://localhost:8081`, we rewrite hostnames `10.0.2.2.`<->`localhost` so that URLs are correct relative to each.

However, if the debugger is on a different port or protocol, this breaks down - because we only rewrite hostnames.

This fixes that by using the debugger's connecting `Host` header and `encrypted` state to derive the base URL of the server relative to the frontend. We then update the rewriting logic to use this actual full origin (protocol + host) in place of the device-relative origin.

Changelog:
[General][Fixed] dev-middleware: Fix URL rewriting where device and debugger reach the server on different ports/protocols.

Reviewed By: huntie

Differential Revision: D66077627

fbshipit-source-id: 01f6565149caa34b1e9e50dd58deb0122485657c
2024-11-21 11:39:20 -08:00
Rob HoganandFacebook GitHub Bot aae3e03e57 dev-middleware: Refactor urlRegex rewriting, regex-escape IP4 addresses (#47872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47872

Largely a refactoring to the way we currently rewrite `url`/`urlRegex` in `Debugger.setBreakpointByURL` CDP requests (debugger->target).

Rewriting regexes is fragile, it only really works if we can assume `'localhost'` appears literally and that ports and protocols don't need changing. The intention here is to freeze the current behaviour so as not to break anyone relying on it (if anyone is), and decouple it from more robust rewriting we want to generalise.

Also adds simple regex escaping to host names (always IPv4 addresses) we inject into regex patterns, since the previous approach could've led to false matches in unlikely edge cases.

Changelog:
[General][Fixed] dev-middleware: Regex-escape IP addresses in urlRegex replacements

Reviewed By: huntie

Differential Revision: D66238782

fbshipit-source-id: 4cd0029081d68c193e36d3713057ffdc7ef0656f
2024-11-21 10:09:41 -08:00
Rubén NorteandFacebook GitHub Bot 6c581c9b9b Allow JS_DIR path to be relative to cwd (#47877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47877

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D66302814

fbshipit-source-id: 55d6f86d098673e28fad71a43863f2041810d04b
2024-11-21 09:14:45 -08:00
Pieter VanderwerffandFacebook GitHub Bot ae09827b15 Deploy 0.254.0 to xplat (#47810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47810

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66278779

fbshipit-source-id: 01dec1dc844607afa8f650c5acdebc6d5d5739d2
2024-11-21 08:26:07 -08:00
Kudo ChienandFacebook GitHub Bot ce838a4bcf Fix lazy import error from jest and Appearance.js (#47629)
Summary:
currently running jest test, it shows an error:

```
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From __tests__/App.test.tsx.

      at getState (node_modules/react-native/Libraries/Utilities/Appearance.js:18:26)
      at addChangeListener (node_modules/react-native/Libraries/Utilities/Appearance.js:71:19)
      at subscribe (node_modules/react-native/Libraries/Utilities/useColorScheme.js:10:66)
      at subscribeToStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6232:10)
      at commitHookEffectListMount (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
      at commitPassiveMountOnFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
      at commitPassiveMountEffects_complete (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
      at commitPassiveMountEffects_begin (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
      at commitPassiveMountEffects (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
      at flushPassiveEffectsImpl (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
      at flushPassiveEffects (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at Immediate.performWorkUntilDeadline [as _onImmediate] (node_modules/scheduler/cjs/scheduler.development.js:533:21)
```

it is a regression from https://github.com/facebook/react-native/issues/46123 that to have a lazy require.

this pr tries to mock `useColorScheme` to return `light`. i think we don't necessarily test the color scheme changes in jest runtime. originally `useColorScheme` also returns `light` because of [this statement](https://github.com/facebook/react-native/blob/9a60038a40e16925ea1adeb3e3c937c22a615485/packages/react-native/Libraries/Utilities/Appearance.js#L77-L83)

## Changelog:

[GENERAL] [FIXED] - Fixed jest error from Appearance.js

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

Test Plan:
```sh
$ npx react-native-community/cli init RN0762 --pm bun --version 0.76.2
$ cd RN0762
$ bun test run
```

Reviewed By: cipolleschi

Differential Revision: D66297456

Pulled By: huntie

fbshipit-source-id: 80d1460532e76bd1815c66964547b50d7f7b3558
2024-11-21 07:46:14 -08:00
Blake FriedmanandFacebook GitHub Bot 6460d2b3e7 Support Windows sdkmanager.bat (#47874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47874

We should be searching for the .bat file on Windows to remain compatible with some user setups.

Changelog: [Android][Fixed] look for sdkmanager.bat

Reviewed By: cipolleschi

Differential Revision: D66295240

fbshipit-source-id: 6b79a9aa40f77ed9c5b3d6ad92b1a62e78159223
2024-11-21 07:19:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b8419b2eed Include autolinkin.h in OnLoad.cpp only if it exists (#47875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47875

The old architecture looks broken because in the OnLoad.cpp file we try to include the autolinking.h header which is only generated when the New Architecture is enabled.

This fix guards the include and the usage of the function provided by the autolinking so that the old architecture should work as well.

## Changelog
[Internal] - Include autolinkin.h in OnLoad.cpp only if it exists

Reviewed By: blakef

Differential Revision: D66295318

fbshipit-source-id: 18461e6b70ac92af57b805bef51c0df49db02283
2024-11-21 05:55:58 -08:00
Alex HuntandFacebook GitHub Bot 3de9892353 Skip hermes-parser under Babel for non-Flow JS code (#47568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47568

Resolves https://github.com/facebook/hermes/issues/1549.

Changelog:
[General][Fixed] - When using Babel with plain JavaScript files, support for additional user syntax plugins should be fixed (now uses Babel's parser instead of hermes-parser). There is no change for JS files annotated with `flow`, where extended JS syntax remains unsupported.

Reviewed By: blakef

Differential Revision: D65816797

fbshipit-source-id: 9f05e86019548ac8727ee65c2e2c417d78a406d8
2024-11-21 05:41:39 -08:00
Alex HuntandFacebook GitHub Bot 113337f269 Update hermes-parser and related packages in fbsource to 0.25.1 (#47573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47573

Bump hermes-parser and related packages to [0.25.1](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D65816542

fbshipit-source-id: cb445eb77790fb2632d3bc318c6eb59f097b1518
2024-11-21 05:41:39 -08:00
SantiagoandFacebook GitHub Bot 7d63235086 Fix Appearance.setColorScheme(null) not resetting color scheme value (#47739)
Summary:
Fixes https://github.com/facebook/react-native/issues/47725

Calling Appearance.setColorScheme(null) or Appearance.setColorScheme(undefined) no longer resets the color scheme useColorScheme returns like on previous rn versions.

## 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] - Fix `Appearance.setColorScheme(null)` not resetting color scheme value

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

Test Plan: Repo with a patch ready to test: https://github.com/sangonz193/react-native-color-scheme-patch

Reviewed By: yungsters

Differential Revision: D66230236

Pulled By: cipolleschi

fbshipit-source-id: cc668acb1fde6d30f2706fc0ab7dee5cea1c3b14
2024-11-21 04:43:46 -08:00
Rubén NorteandFacebook GitHub Bot 9f604dbd43 Watch changes in C++ files (#47871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47871

Changelog: [internal]

No need to keep going back to save test files when we change C++ files and need to re-run tests :)

Reviewed By: javache

Differential Revision: D66293212

fbshipit-source-id: dc232e1d3f7f8ae1578e894ce14bd21ccf3c8ade
2024-11-21 03:58:36 -08:00
Rubén NorteandFacebook GitHub Bot 92a476661c Add flag to force running tests in optimized mode (#47870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47870

Changelog: [internal]

This flag allows us to run optimized mode by using the right buck modes for the Fantom CLI, using minified + dev in Metro and building bytecode using Buck as well.

It's disabled by default but in the future we can enable it based on the configuration in the test file (e.g.: if it's a benchmark) or we can run tests in both modes by default to catch problems caused by the differences between environments.

Reviewed By: rshest

Differential Revision: D66292709

fbshipit-source-id: d25294b739ff6a67507990241784b838d5b30dcd
2024-11-21 03:58:36 -08:00
Abdelhafidh BelaliaandFacebook GitHub Bot 550b0c0ed1 TextLayout: take full width if text wrapped (#47435)
Summary:
### Problem
The calculated width for a multiline text is based on the longest line. However it does not account for text that wraps.

**Example** if numberOfLines=1 and the text wraps

```
+---------------------------+
This is a long text that
will wrap
+---------------------------+
```

The TextView will render
```
+---------------------------+
This is a long text t...
+---------------------------+
```

because the `calculatedWidth` took the width of the first line.

Also see https://github.com/facebook/react-native/pull/41770#issuecomment-2453611554 for additional context.

### Solution

If the text wraps, take the whole width.

```
+---------------------------+
This is a long text that w...
+---------------------------+
```

Fixes https://github.com/facebook/react-native/issues/39722
Fixes https://github.com/facebook/yoga/issues/1730

## Changelog:

[GENERAL] [FIXED] - Fix text not taking full width

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

Test Plan:
```tsx
        <Text
          numberOfLines={1}
          style={{
            backgroundColor: 'red',
            alignSelf: 'flex-start',
            color: 'white',
            fontSize: 34,
          }}>
          {'This is a long text that will wrap.'}
        </Text>
        <Text
          numberOfLines={3}
          style={{
            backgroundColor: 'red',
            alignSelf: 'flex-start',
            color: 'white',
            fontSize: 34,
          }}>
          {
            '1\n\ntest\nThis is a long text that will wrap.This is a long text that will wrap.This is a long text that will wrap.\n'
          }
        </Text>
        <Text
          numberOfLines={3}
          style={{
            backgroundColor: 'red',
            alignSelf: 'flex-start',
            color: 'white',
            fontSize: 34,
          }}>
          {
            '1\n\nThis is a long text that will wrap.This is a long text that will wrap.This is a long text that will wrap.\n'
          }
        </Text>
```
1. Verify that the first and third text take full width
2. Verify that the second text does not take full width

| Before | After |
|:------:|:-----:|
|   <img width="480" alt="Screenshot 2024-11-05 at 9 00 24 PM" src="https://github.com/user-attachments/assets/b8d765c0-f4b1-42c6-afc7-75862c52612a">     |    <img width="480" alt="Screenshot 2024-11-05 at 9 01 49 PM" src="https://github.com/user-attachments/assets/f1534c14-a56a-4d44-8edc-4d9f75166cb2">   |

Reviewed By: NickGerleman

Differential Revision: D65521732

Pulled By: realsoelynn

fbshipit-source-id: 0bb0bb306445e73e8b24ff4c02921739d15ee07e
2024-11-21 03:16:30 -08:00
Dmitry RykunandFacebook GitHub Bot 105ad855d9 Fix ViewConfig validation error after merging defaultSrc into defaultSource for RCTImageView (#47754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47754

The `./resolveAssetSource` processor was added to the `defaultSource` prop in the `RCTImageView` static view config in D65819218.
To match this in native view config, we're adding the `customType = "ImageSource"` hint to the view config infra, so it knows to assign correct processor to the native view config in runtime.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66228921

fbshipit-source-id: d0e0cd9e2f5cc0ba5b3a7002f7ade3f45305a2ac
2024-11-21 03:12:21 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 880dea858e Bump Podfile.lock for Folly (#47868)
Summary:
RNTester jobs are failing because we bumped folly to the recent version but we didn't update the podfile.lock

## Changelog:
[Internal] - Bump Podfile.lock to new Folly version

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

Test Plan: GHA

Reviewed By: robhogan

Differential Revision: D66292931

Pulled By: cipolleschi

fbshipit-source-id: 19cbe1321d2891135aa9777823e9dff2916b16dc
2024-11-21 02:33:29 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0eb9472c69 Allow downgrading CMake to build hermesc on Windows (#47867)
Summary:
CI is failing to build HermesC on windows due to a version mismatch of the CMake already installed

## Changelog:
[Internal] - Fix Windows CI for HermesC

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

Test Plan: GHA

Reviewed By: robhogan

Differential Revision: D66292617

Pulled By: cipolleschi

fbshipit-source-id: 5e8f4f45e33fbdd9ff163b4e8a09cb98d4366dc7
2024-11-21 02:20:30 -08:00
David VaccaandFacebook GitHub Bot ac0dbe1ea2 Migrate ReactClippingProhibitedView to Kotlin (#47752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47752

Migrate ReactClippingProhibitedView to Kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66217071

fbshipit-source-id: e7559db5c3f2795b78f51c3bd5a3f521eb54b70d
2024-11-20 23:08:03 -08:00
David VaccaandFacebook GitHub Bot a2523a24c7 Migrate ReactCompoundView to kotlin (#47748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47748

Migrate ReactCompoundView to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66217094

fbshipit-source-id: 238c20c907880f4251c9b5926ad486cfff55a3b0
2024-11-20 23:08:03 -08:00
Jakub PiaseckiandFacebook GitHub Bot aa53bde21b Fix the nodes' owners not being updated when display: contents is used (#47733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47733

In https://github.com/facebook/yoga/pull/1729 I moved the cleanup of `display: contents` nodes to happen before all the early returns, but that change also made it be called **before** `cloneChildrenIfNeeded`. It actually needs to be called after `cloneChildrenIfNeeded` to make sure that children of `display: contents` nodes are properly owned.

It also needs to be called in every short-path, so it's being called in four places in this PR. Please let me know whether it's ok or not.

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

Reviewed By: NickGerleman

Differential Revision: D65953902

Pulled By: zeyap

fbshipit-source-id: 0b18a5651f19c23564f5b3aa2a50833426e9ca5f
2024-11-20 20:01:50 -08:00
phuccvx12andFacebook GitHub Bot 73a2be1243 Fix: Correct Layout Behavior for Combined align-content and align-items (#47732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47732

This pull request addresses the issue where combining align-content and align-items properties resulted in incorrect layout behavior in Yoga version 3.1.0, as reported in [Issue https://github.com/facebook/yoga/issues/1739](https://github.com/facebook/yoga/issues/1739).

# Changes Made:

Alignment Logic Update: Modified the alignment calculations to ensure that the combination of align-content and align-items properties produces the expected layout, consistent with CSS Flexbox standards and previous Yoga versions.

Test Cases Added: Introduced new test cases to cover scenarios involving various combinations of align-content and align-items properties to prevent future regressions.

# Testing:

All existing tests pass successfully.

New test cases confirm that the layout behaves as expected when align-content and align-items are used together.

# Impact:

This fix ensures that layouts using both align-content and align-items properties render correctly, aligning with the behavior observed in Yoga version 1.19.0 and standard web browsers.

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

Reviewed By: joevilches

Differential Revision: D65953882

Pulled By: zeyap

fbshipit-source-id: 7e12a21b1d442b35c3f3536cad32dc4b82130d15
2024-11-20 19:59:42 -08:00
David VaccaandFacebook GitHub Bot 17502dd743 Migrate ReactCompoundViewGroup to kotlin (#47751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47751

Migrate ReactCompoundViewGroup to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66217251

fbshipit-source-id: b24b4ed984670e18256dda758bfa1d783badd536
2024-11-20 18:51:34 -08:00
NishanandFacebook GitHub Bot 221d1eceda fix: start and end points linear gradient algorithm (#47003)
Summary:
- Current implementation does not follow CSS spec for rectangle boxes with corner angles. It is using non spec compliant algorithm to calculate start and end points. This PR follows the spec compliant algorithm to implement and makes sure Web, iOS and Android gradients are identical with corner angles.
- Also, currently it is using `CAGradientLayer` which does not support spec compliant start and end points i.e. start and end point can be outside of rectangle bounds. This leads to inconsistent gradients on iOS for corner angles compared to web and android. So this PR replaces it with `CGGradient`.
- I have also moved some files to make it easier to add more background image types in future.

## Changelog:

[GENERAL] [FIXED] - Linear gradient start and end point algorithm.

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

Test Plan:
- Added multiple gradient example which should be identical in all platforms (Web, iOS and Android) and tested thoroughly on all platforms. I think some visual test cases can help here.
- I have referred to [blink's](https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/core/css/css_gradient_value.cc) implementation.

## Aside

Took a while to understand the [spec](https://www.w3.org/TR/css-images-3/#corner-gradient-example), but felt great after getting it. Gradients should be 100% identical on all platforms now. Sorry i missed testing cornered angles + rectangles earlier and I found out it is inconsistent on platforms just this weekend  😅

<img width="1389" alt="Screenshot 2024-10-14 at 12 24 45 AM" src="https://github.com/user-attachments/assets/2f61eb87-502b-4b8c-88f3-d8a3cca9a7a3">

Reviewed By: joevilches

Differential Revision: D64497127

Pulled By: jorge-cab

fbshipit-source-id: 2647176ae2ee74b6c71f9061465b07dccdabcfc1
2024-11-20 17:17:52 -08:00
Joe VilchesandFacebook GitHub Bot 6d8fd49832 Remove trivial private api calls in YogaLayoutableShadowNode.cpp (#47735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47735

We are trying to remove or minimize private header usage in YogaLayoutableShadowNode.cpp and YogaLayoutableShadowNode.h. There are a few "trivial" ones, meaning some private call maps 1:1 to an existing public API, so I just opt to use that instead

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66131948

fbshipit-source-id: 7068021513703d1c142d3c298f4804e4e8b81ee2
2024-11-20 17:06:01 -08:00
Tom Van LaerhovenandFacebook GitHub Bot 13780126d3 Fix generated EventEmitter code for nested objects in arrays. (#47514)
Summary:
This PR fixes the code for generating EventEmitter C++ code in case nested objects in arrays are used.

```typescript
export interface NativeProps extends ViewProps {
  onEvent: DirectEventHandler<
    Readonly<{
      payloadArray: Readonly<
        {
          obj: Readonly<{ str: string }>
        }[]
      >
    }>
  >;
}

export default codegenNativeComponent<NativeProps>('SomeComponent');
```

In this case the generated `EventEmitters.cpp` code would contain:

```c
obj.setProperty(runtime, "str", payloadArrayValue,obj.str);
```

while

```c
obj.setProperty(runtime, "str", payloadArrayValue.obj.str);
```

is expected.

## 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] - Codegen: Support nested objects in arrays

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

Test Plan: Tested with the reproduction case above to verify correct output.

Reviewed By: javache

Differential Revision: D65848670

Pulled By: elicwhite

fbshipit-source-id: 0021e87bc7213fff615465cab8554cc1a2159522
2024-11-20 16:25:34 -08:00
Andrei MarchenkoandFacebook GitHub Bot aafe696453 turn on by default optimization for memoization of virtualized list cells (#47724)
Summary:
Changelog: [General] [Changed] - Fix unnececary rerenders of VirtualizedListCells with strictMode={true}

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

Reviewed By: sammy-SC

Differential Revision: D66123469

fbshipit-source-id: 295e10add51bc1c319b8b8e3a9f4874c5e5a386d
2024-11-20 16:00:03 -08:00
Nick GerlemanandFacebook GitHub Bot 6e06a810f0 Fix possible NSRangeException when updating typing attributes in response to new text content (#47737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47737

We may see an NSRangeException when setting new AttributedString content, where setting the AttributedString itself changes selection (before we mutate it later).

It seems like the selection here is not in a good state yet in regards to the AttributedString backing exposed (since we are reading it while modifying it). So let's fold the logic for updating typing attributes into the collection of ignored work from non-user-selection updates, since programatically setting an AttributedString will already trigger updating typing attributes.

I also added a nil check here, which is unrelated to the crash, but it seems like we should have it for safety...

Changelog:
[iOS][Fixed] - Fix possible NSRangeException when updating typing attributes in response to new text content

Reviewed By: cipolleschi

Differential Revision: D66202986

fbshipit-source-id: fded492b5022c5fef5b9563f93a57549d06a7020
2024-11-20 14:05:33 -08:00
Alan LeeandFacebook GitHub Bot 48ea6867a9 update targetSdk to 35 (#47738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47738

- updating targetSdk to 35 for RN Android and helloworld
- **Note:** `tagetSdk` of RN Android does not have effect on the app's targetSdk. App can set `targetSdk` regardless of what RN targetSdk is. Updating the targetSdk just signals that RN Android has been tested with targetSdk 35 and apps can choose to support lower targetSdk as needed.

Changelog:
[Android][Changed] updating targetSdk to 35 (apps can still choose their own targetSdk regardless of RN version)

Reviewed By: NickGerleman

Differential Revision: D66209381

fbshipit-source-id: 2f26e8f605a383ff662e4b1d65611f186a7d7979
2024-11-20 11:06:31 -08:00
Alan LeeandFacebook GitHub Bot 7733c335eb Align HermesBadge to bottom to avoid overlap with status bar (#47734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47734

- With forced edge-to-edge on Android 15 targetSdk 35, `HermesBadge` overlaps with the top status bar.
- Move the location of the HermesBadge to align with bottom of the header so we can avoid UI overlap with minimal changes to the template.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D66183918

fbshipit-source-id: 6e9eff337660a133349a2813e9ee033a8d2b749e
2024-11-20 11:06:31 -08:00
Alan LeeandFacebook GitHub Bot de82b15b0d Remove NewAppScreen from public API test (#47707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47707

NewAppScreen should be removed from public API test

Changelog: [Internal]

Reviewed By: cipolleschi, blakef

Differential Revision: D66165484

fbshipit-source-id: 2b72a874e443447a2b444921f25cec729bcb89c5
2024-11-20 11:06:31 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 102062fbc7 Extract RCTAppDependencyProvider in a separate pod (#47761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47761

When breaking the last dependency, we created the `RCTApDependencyProvider` in the Codegen pod.

This is not an issue per sè. The problem comes in with the new template in Swift: ReactCodegen contains some headers with some C++ code that Swift can't really process.

That's why most libraries started failing in jobs like [this one](https://github.com/facebook/react-native/actions/runs/11906196751/job/33177904733): the template app was not able to load the `ReactCodegen` pod in the Swift app delegate.

Given that the app delegate only have to actually load the RCTAppDependencyProvider, I extracted that class in its own pod: ReactAppDependencyProvider.

The name of the pod does not follow the React-RCTXXX structure because that will create issues with the import statements and the `use_frameworks!`  use case.

> [!NOTE]
> We need to update the template and change the `import ReactCodegen` to `import ReactAppDependencyProvider`

## Changelog:
[iOS][Added] - Extract RCTAppDependencyProvider in the ReactAppDependencyProvider pod

Reviewed By: blakef

Differential Revision: D66241941

fbshipit-source-id: 6b888109c65d9560fff322ec84a16da78fbcd64b
2024-11-20 10:51:56 -08:00
Rubén NorteandFacebook GitHub Bot 105beed569 Fix bugs in MutationObserver (#47760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47760

Changelog: [internal]

(this is internal because this API isn't enabled in OSS yet)

This fixes 2 bugs in `MutationObserver`:
1. Incorrectly reporting updates for the same node multiple times, if changes are observable by different targets in the same observer.
2. Incorrectly ignoring observations of subsequent targets in a given observer.

These were caught when migrating the unit tests for `MutationObserver` that were mocking Fabric to a Fantom integration test that uses the whole C++ infra.

Reviewed By: sammy-SC

Differential Revision: D66232571

fbshipit-source-id: b6e967ca4deaa1a69d35f14d4f921103fec2bbaf
2024-11-20 10:00:48 -08:00
Rubén NorteandFacebook GitHub Bot 43554b5a0f Expose NodeList and MutationRecord in global scope (#47759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47759

Changelog: [internal]

These interfaces should be available in the global scope, so this exposes them in their setup modules.

Reviewed By: javache

Differential Revision: D66232574

fbshipit-source-id: 191c579ffce3fb8b4b454b5c5725661ff160a46f
2024-11-20 10:00:48 -08:00
Rubén NorteandFacebook GitHub Bot b2f624d054 Add flag to print Fantom logs in Jest output (#47758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47758

Changelog: [internal]

This helps with debugging when adding logs in native code. By default they're logged to stderr and not shown in the Jest output, but we can opt into getting them with this new flag.

Reviewed By: sammy-SC

Differential Revision: D66232572

fbshipit-source-id: d507fa4438ae46988fafc92123d0954ab3d27631
2024-11-20 10:00:48 -08:00
zhongwuzwandFacebook GitHub Bot e573929d6c Fabric: Adjusts the weight according to the font name (#47742)
Summary:
Fixes another font weight issue mentioned in https://github.com/facebook/react-native/issues/47656#issuecomment-2486282496. We can get the weight from font name if user not specify weight.

esbenvb Is this work for you ?

## Changelog:

[IOS] [FIXED] - Fabric: Adjusts the weight according to the font name

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/47656#issuecomment-2486282496.

Reviewed By: cipolleschi

Differential Revision: D66236128

Pulled By: javache

fbshipit-source-id: d325a7fee28681a1e95fa0341cb7a16fcd9918c0
2024-11-20 09:25:48 -08:00
Alex HuntandFacebook GitHub Bot 01b40789ee Update build script to minimally support subpath patterns (#47673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47673

Update shared monorepo build script:
- Refactor entry point discovery and file iteration
- Add support for "exports" subpath patterns (skip considering as entry point with warning)

This is required for the incoming migration of `react-native-codegen` to this build setup (D51465053).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D66121262

fbshipit-source-id: 0deb2c2b26de442ee348ef9de54a1fa144368b6f
2024-11-20 09:21:13 -08:00
Samuel SuslaandFacebook GitHub Bot d2723b8ed7 delete feature flag useSetNativePropsInNativeAnimationsInFabric
Summary: changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D66230767

fbshipit-source-id: 8f133a313e42a5dc7136e88a3ce68835d420ced9
2024-11-20 07:25:56 -08:00
Rob HoganandFacebook GitHub Bot 69400be4fc dev-middleware: Only rewrite hostnames if they match device connection hosts (#47685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47685

Currently, we assume any URL with a hostname of `10.0.2.2` or `10.0.3.2` (device-relative) is eligible for rewriting to `localhost` (frontend-relative), because we assume the device is an Android emulator. We rewrite these URLs between device and dev machine so that the rewritten URLs are reachable from the dev machine.

This diff narrows this logic so that we'll only rewrite URLs where the hostname matches the pre-existing list *and* this matches the host the device is actually connected on, according to its headers from the original connection.

The main motivation for this change is to unblock removing assumptions about device-reachable vs server-reachable hosts. Later in the stack we'll drop the hardcoded listing of `10.0.2.2` etc in favour of identifying URLs that target the dev server, from whatever network.

There's also an edge case fix here that `10.0.2.2` etc might actually refer to a remote LAN server, and not be an Android emulator's alias for for an emulator host.

Changelog:
[General][Fixed] RN DevTools: Don't assume 10.0.2.2 is an alias for localhost unless it's used to establish a connection to the server

Reviewed By: huntie

Differential Revision: D66058704

fbshipit-source-id: bad28717b0c9b1ca43e2ea3391cef13f87892e6c
2024-11-20 06:56:21 -08:00
Dmitry RykunandFacebook GitHub Bot d658ff521d Add missing Android-only props to ImageProps (#47719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47719

There is a subset of `ImageProps` that are used by Android but not used by iOS. They were missing in the `ImageProps.h`. It was fine when they were only consumed by the Android mounting layer. But it becomes a problem if we want to write some shared C++ code based on those props.
This diff adds those props to the corresponding C++ type.
This should have no practical effect for both platforms.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65426569

fbshipit-source-id: dc1c9fe4a6e0e62e62f84b9b249e1c7d253290f5
2024-11-20 06:34:35 -08:00
Simon KruegerandFacebook GitHub Bot 4dd8d3db57 Use folly::fileops qualified name lookup (#47608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47608

This is a codemod. It was automatically generated and will be landed once it is approved and tests are passing in sandcastle.
You have been added as a reviewer by Sentinel or Butterfly.

Autodiff project: fileops2
Autodiff partition: xplat.js.react-native-github.packages.react-native.ReactCommon.cxxreact
Autodiff bookmark: ad.fileops2.xplat.js.react-native-github.packages.react-native.ReactCommon.cxxreact

This updates `open`, `close`, `read`, `write`, and `pipe` call sites to use
`folly::fileops` qualified name lookup.

This is the 2nd phase in a 3-phase change to remove folly's global definitions
of the posix functions that conflict with windows CRT.
The 1st phase created namespaces for folly's posix functions. The 2nd phase
updates callsites to use the qualified name of folly's  `open`, `close`,
`read`, `write`, and `pipe`  functions. The 3rd and final phase will remove
folly's globally defined posix functions and have windows CRT define them
again.

**What is the reason for this change?**
Folly's global definitions of posix functions on Windows causes `#include`
order issues if folly is not included first.

For example, when `gtest/gtest.h` is included before folly, gtest includes
`windows.h` and that declares `open`, `read`, and `chdir`, which creates
ambiguous references to folly's `open`, `read`, and `chdir`.

Another example is where posix functions go undeclared when
`folly/portability/windows.h` is included without other portability headers
(e.g., `folly/portability/unistd.h`). `folly/portability/windows.h` includes
`windows.h` in a way that only underscore versions of the posix functions are
available (e.g., `_open`, `_close`).

These issues create friction for windows development.

**Background: What is the purpose of `folly::portability::{fcntl,stdlib,sysstat,unistd}`?**
It is a portability layer to make posix functions available and behave
consistently across platforms. Some posix functions don't exist on windows
(e.g., `sysconf`). Some other posix functions, folly changes to adapt behavior
across platforms. For example, on windows folly defines `open`, `read`,
`write`, and `close` functions to work with sockets. Folly makes these
functions available in the global scope for convenience.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65855147

fbshipit-source-id: b06863330ca213b9d1bffe0ee85e0fbf1bc8a845
2024-11-20 06:27:34 -08:00
Rubén NorteandFacebook GitHub Bot 737045217b Implement expect().toEqual() (#47697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47697

Changelog: [internal]

Implements `expect(received).toEqual(expected)` in Fantom tests.

Reviewed By: sammy-SC

Differential Revision: D66108539

fbshipit-source-id: 4e1d2405064900ec9859220fb6a28ec25a5176f3
2024-11-20 04:27:10 -08:00
Pieter De BaetsandFacebook GitHub Bot e80bdb88be Convert com.facebook.react.ReactPackageHelper to Kotlin (#47683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47683

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66131407

fbshipit-source-id: 73d637afea71a77140051efd8001d6ceebc32a43
2024-11-20 04:05:26 -08:00
Pieter De BaetsandFacebook GitHub Bot e0a5bbe309 Convert com.facebook.react.ViewManagerOnDemandReactPackage to Kotlin (#47682)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47682

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66131124

fbshipit-source-id: aef75eba5fffb1e54c800a4351f8fcb5e1c8a6d4
2024-11-20 04:05:26 -08:00
Pieter De BaetsandFacebook GitHub Bot 09b08aa4e0 Convert com.facebook.react.BaseReactPackage to Kotlin (#47679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47679

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66119659

fbshipit-source-id: d7917aa09edac6d5a8c07635d294de229723f0c9
2024-11-20 04:05:26 -08:00
Pieter De BaetsandFacebook GitHub Bot ba1bc639b8 Convert com.facebook.react.ReactPackage to Kotlin (#47677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47677

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D66123384

fbshipit-source-id: afac59b4b8f6a0fed9c2acd45176422aa1ffa85e
2024-11-20 04:05:26 -08:00
Dmitry RykunandFacebook GitHub Bot c2aa201b1e Fix C++ prop type for the Image.defaultSource (#47713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47713

`defaultSource` is defined as a single `ImageSource` in docs (https://reactnative.dev/docs/next/image#defaultsource) but its type is a vector of `ImageSource`s in `ImageProps.h`.

This diff changes its C++ type to just `ImageSource`.

Technically, this is a breaking change, however I don't think folks should directly access `ImageProps` outside of `RCTImageComponentView.mm`
Moreover, this prop is actually not implemented in Fabric, so this change should have no practical effect.

Changelog: [Internal]

Facebook
T208171435 - [RN][Fabric][iOS] Implement defaultSource support for Image

Reviewed By: javache

Differential Revision: D65821570

fbshipit-source-id: 38139b0f8d6da495e82c4ef72c19af3db254ba6c
2024-11-20 03:58:20 -08:00
Nick LefeverandFacebook GitHub Bot 2944752a5d Enable RSNRS only on JS thread (#47637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47637

Changelog: [Internal]

RSNRS does not support off JS thread layout due to current fiber tree corruption when syncing happens on more than one shadow tree at the same time. This diff guarantees that RSNRS will only be enabled on the JS thread, avoiding any state corruption.

Reviewed By: sammy-SC

Differential Revision: D64500893

fbshipit-source-id: aa20f54a0fcfa47534ae099e95307a692bd9fd0f
2024-11-20 00:37:21 -08:00
David VaccaandFacebook GitHub Bot 0eff2c5a22 Update javadoc for ReactHost.destroy() method (#47741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47741

Update javadoc for ReactHost.destroy() method

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D66215193

fbshipit-source-id: 836c8383f5bb2ffd14b46e498be74b6ed79b4402
2024-11-19 22:28:00 -08:00
Nick GerlemanandFacebook GitHub Bot e88974f199 Cleanup "setAndroidLayoutDirection" (#47736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47736

This has been 100% enabled in production across all the apps for more than a month, after an experiment a long time ago, and we kinda depend on it now for correct border drawing in some cases. Let's clean it up!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D66208418

fbshipit-source-id: 582a38bd84a2d085ba5c4aac4cd478680dd206cc
2024-11-19 21:42:01 -08:00
Joe VilchesandFacebook GitHub Bot a865975ce3 Update some Justify tests following Chrome changes
Summary:
X-link: https://github.com/facebook/yoga/pull/1746

Chrome made some changes for how overflowed row-reverse containers are laid out which was causing some issues on CI. I updated them here and skipped the new failing tests which we would want to followup on.

For LTR, the differences are seen below
|Before|After|
|--|
|{F1962694149} | {F1962694151}|

The extra space is now extending past the flex start edge vs flex end. RTL is the opposite. NickGerleman had deviated from the spec back in the day to match Chrome and it seems they made the adjustment recently. T208209388 is tracking the followup to align with the spec again. Basically, there is a notion of fallback alignment when certain justification/alignment values cannot actually apply. Right now we are falling back to flex start in all cases but we should fallback to start sometimes.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66138361

fbshipit-source-id: c46d2e9b0cd297069b9cc544e3bded995e4867a6
2024-11-19 15:43:04 -08:00
zhongwuzwandFacebook GitHub Bot 933356e2a6 Fabric: Fixes custom font of weight is not honored (#47691)
Summary:
Fixes https://github.com/facebook/react-native/issues/47656 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes custom font of weight is not honored

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

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

Reviewed By: cipolleschi

Differential Revision: D66174732

Pulled By: javache

fbshipit-source-id: 5e6a8c870d3a13283548c736aed73193f7976bfc
2024-11-19 14:06:20 -08:00
Joe VilchesandFacebook GitHub Bot 156454ef39 Potentially fix seg fault when replace YogaLayoutableShadowNodes (#47689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47689

We were seeing some segfaults from trying to access `display_` in Yoga's `replaceChild` function. Some memory debugging helped identify this was a use-after-free error and NickGerleman suggested we try swapping these lines. Logic being the shared_ptr of YogaLayoutableShadowNode is replaced right before we go and replace its yoga node in the yoga tree. If this is the last shared_ptr holding this node we will delete this object and thus the yoga node with it. We do not need to do this first, so let's swap the lines.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66142356

fbshipit-source-id: 8fd835346edc91e045ed2ee8945a95af21c47556
2024-11-19 13:17:35 -08:00
David VaccaandFacebook GitHub Bot fa65b937f5 MigrateSurfaceDelegateFactory to Kotlin (#47688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47688

MigrateSurfaceDelegateFactory to Kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66133186

fbshipit-source-id: 3b53ab557dce6d099bb412f7be6c00ee81be40fc
2024-11-19 12:41:32 -08:00
David VaccaandFacebook GitHub Bot c0eaa7f1be Make SurfaceDelegate and SurfaceDelegateFactory NullSafe (#47686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47686

Make SurfaceDelegate and SurfaceDelegateFactory NullSafe

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66134454

fbshipit-source-id: 4364f29699ffee64304bd2ac2eeaec6fb6de9942
2024-11-19 12:41:32 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 61f01ade42 Optimize CompositeBackgroundDrawable (#47618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47618

Its not optimal to reconstruct CompositeBackgroundDrawable everytime we add a layer to it.

With this change I'm adding an optimization to modify the underlying `LayerDrawable` in place instead of reconstructing everything. `LayerDrawable` has a pretty constrained API and some weirdish behaviors.

- `addLayer` - This API doesnt set the callback for the recently added layer so after adding the layer we also need to manually set the callback
- Mutating `LayerDrawable` in-place is not straightforward, I had to add a function that will figure out where each layer should be inserted
- `LayerDrawable` doesn't allow deleting an element which means that for this case in particular we do need to re-create `CompositeBackgroundDrawable`
- Newer Android versions allow `null` on `LayerDrawable` layers, but older versions do not, this implementation is mostly done this way to accommodate older versions. But also, even though newer versions can have `null` set on a layer `LayerDrawable` still doesn't handle it well and we get some bugs when removing and inserting a layer which the current implementation handles by not relying on null

This is all feature flagged. since it will only be enabled with the new drawables

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D65907786

fbshipit-source-id: c18b898ddfe58faa5b90714945ffcc82d471051d
2024-11-19 12:13:42 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot fd2ce35172 Change type of shadows from array to LayerDrawable (#46818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46818

Before we were using lists which meant `CompositeBackgroundDrawable` had a `LayerDrawable` of variable length.

This meant that our layers were not consistent and made it hard to optimize `CompositeBackgroundDrawable` to not create a new instance every time we set a new Layer.

With this change `CompositeBackgroundDrawable` has a consistent amount of layers which will allow us to more easily mutate it and land the optimization present on D63287222

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63798842

fbshipit-source-id: bf0b9ee91ff2083b89ca90ace4de00c71bf3153c
2024-11-19 12:13:42 -08:00
Dmitry RykunandFacebook GitHub Bot abeee154d5 Unify defaultSource and defaultSrc ImageProp (#47710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47710

There is Android code that supports remapping `defaultSrc` -> `defaultSource` for `ImageNativeComponent`.
The docs reference this prop as `defaultSource`: https://reactnative.dev/docs/next/image#defaultsource
It is not referenced as `defaultSrc` anywhere. Let's unify it as `defaultSource` across both platforms.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65819218

fbshipit-source-id: 0f468e2327ad07285a45e4c9f5e33d74da411c74
2024-11-19 11:21:22 -08:00
Samuel SuslaandFacebook GitHub Bot 6f1cf004fa add expect().toBeNull() (#47716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47716

changelog: [internal]

Add toBeNull check to Fantom.

Jest docs: https://jestjs.io/docs/expect#tobenull

Reviewed By: javache

Differential Revision: D66167811

fbshipit-source-id: 33b6cf362bcf1636f41b78dc6c84905b80be994e
2024-11-19 10:52:08 -08:00
Pieter De BaetsandFacebook GitHub Bot 8fba7ebb5e Mark ReactPackage#getModule as stable (#47676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47676

`getModule` is used by all modern ReactPackage base-classes to allow lazy loading of specific module and should be considered stable at this point.

Changelog: [Android][Added] Marked ReactPackage#getModule as stable.

Reviewed By: mdvacca

Differential Revision: D66127068

fbshipit-source-id: de447794435d267619430e3c0cbc65c6e1c614ba
2024-11-19 10:19:14 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4c3112c8d8 Do not discard props when setNativeProps is used (#47669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47669

When investigating [#47476](https://github.com/facebook/react-native/issues/47476), I found that the `secureTextInput` prop was not changing in the Mounting layer when changing it in JS.

I track down the problem to the `UIManager::cloneNode` method.
When we clone the node, we first merge the patch that arrives from React into the props controlled by setNativeProps, ignoring the patch's props that are controlled by React.

But then, we forgot to merge back the React's controlled property into the final props, effectively losing them.

This change adds an extra merging step, merging the props controlled with setNativeProps back into the patch of props controlled by React, and then using this new set of props as source of truth.

## Changelog:
[General][Fixed] - do not discard props in the patch when they are not null while using `useNativeProps`

Reviewed By: sammy-SC

Differential Revision: D65948574

fbshipit-source-id: db4f2b793f4a6348456933c95a151012252b8ebc
2024-11-19 09:54:27 -08:00
Alex HuntandFacebook GitHub Bot 35ab62cca3 Substitute @pkgjs/parseargs for Node builtin (#47704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47704

Now that we have a min requirement of Node 18.18 on `main`, drop dependency on this polyfill.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D66162328

fbshipit-source-id: e8ab6669fe14ed177eccf4b861c01df4fb0d405a
2024-11-19 09:47:40 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0b7a0092db Disable flaky flatList test (#47718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47718

We have a test in the OSS E2E CI pipeline that is a bit flaky and fails often on Android.

I don't have time to investigate that properly right now, so I'm disabling it to improve the situation on the main branch for the time being.

We are planning to invest more resources in H1 2025 to improve the E2E testing in OSS, so I'll get back to it soon.

## Changelog
[Internal] - Disabling part of the FlatList E2E test in Maestro

Reviewed By: javache

Differential Revision: D66169183

fbshipit-source-id: 5b2b0c45e124a642b626b014b91fa61d17226f9b
2024-11-19 09:23:20 -08:00
Rubén NorteandFacebook GitHub Bot 05874c831b Implement toThrow(message) with a specific error message string (#47700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47700

Changelog: [internal]

Add support for the string parameter for `toThrow` to assert for specific error messages.

Reviewed By: sammy-SC

Differential Revision: D66118001

fbshipit-source-id: 8c04cd20d4ad17163ec0c7bf943c429507a97985
2024-11-19 07:56:49 -08:00
Rubén NorteandFacebook GitHub Bot 47882f0000 Implement jest.fn(), expect().toHaveBeenCalled() and expect().toHaveBeenCalledTimes() (#47699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47699

Changelog: [internal]

Implements a `jest.fn()` and a subset of methods in `expect` using them (`.toHaveBeenCalled()` and `.toHaveBeenCalledTimes()`).

Reviewed By: sammy-SC

Differential Revision: D66118002

fbshipit-source-id: 5422307d68967d7d8b4c4d5155a45926f8fc8cae
2024-11-19 07:56:49 -08:00
Samuel SuslaandFacebook GitHub Bot 4cb82501a3 add test for Suspense and Suspense with startTransition (#47714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47714

changelog: [internal]

Reviewed By: rshest

Differential Revision: D66093340

fbshipit-source-id: 1db205d42d0570ab9c77ba0363ffac0d2dd81071
2024-11-19 07:41:17 -08:00
Samuel SuslaandFacebook GitHub Bot 0d5c026569 enable fix for view command race on iOS in OSS (#47706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47706

changelog: [internal]

The changelog in D65909191 already has the details. The fix is behind a feature flag. Let's enable it in OSS to stop the bleeding.

Reviewed By: cipolleschi

Differential Revision: D66163663

fbshipit-source-id: 84a3dfb823fdd286e919ebf22b07054b4399662a
2024-11-19 06:47:57 -08:00
Pieter De BaetsandFacebook GitHub Bot a18aa481f0 Remove unreferenced EagerModuleProvider (#47678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47678

No longer referenced and removed from public exports in D49752133

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66127071

fbshipit-source-id: 90284b26051902243b530658e5795dad31331695
2024-11-19 06:26:03 -08:00
Fabrizio CucciandFacebook GitHub Bot bdf01be654 Migrate com.facebook.proguard.annotations.KeepGettersAndSetters to Kotlin (#47703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47703

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66094514

fbshipit-source-id: 85d6cceaba7445f624461a880c2bc9c05b440f53
2024-11-19 06:06:00 -08:00
Rubén NorteandFacebook GitHub Bot 4da6ed5caf Use Meta-specific renderers when running tests in Meta infra (#47705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47705

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D66094272

fbshipit-source-id: 25c0bc2d9e68ed1f4ede9dc5f0470a530b5db7d0
2024-11-19 05:53:26 -08:00
Blake FriedmanandFacebook GitHub Bot 13bc4a2a43 CMake Windows path normalization (#47702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47702

Use `file(TO_CMAKE_PATH` to normalize paths, and normalizing `input_SRC` as it's already a CMake path.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D66101321

fbshipit-source-id: e81af40551d2777901f9c7cf9a4175f2bce76ec8
2024-11-19 05:33:45 -08:00
Kræn HansenandFacebook GitHub Bot c3091ccfed Fix podspec_source_build_from_local_source_dir to ensure the artifacts_dir exists before downloading into it (#47698)
Summary:
In its current for the `podspec_source_build_from_local_source_dir` makes an assumption in the existence of the `artifacts_dir` ("Pods/hermes-engine-artifacts"). This is okay in the case where the `pod install` command is first ran without sitting the `REACT_NATIVE_OVERRIDE_HERMES_DIR` because of

https://github.com/kraenhansen/react-native/blob/1948076b81bbf08794aae8c8d936cf00ec7fe7b3/packages/react-native/sdks/hermes-engine/hermes-utils.rb#L227

In a clean checkout however, this results in an error when archiving the Hermes directory due to the missing parent directory of the archive's destination.
This PR suggests adding a check for and optional creation of the existence of the archive directory before usage.

An alternative that I considered was ensuring the existence inside of the `artifacts_dir` function:

https://github.com/kraenhansen/react-native/blob/1948076b81bbf08794aae8c8d936cf00ec7fe7b3/packages/react-native/sdks/hermes-engine/hermes-utils.rb#L198-L200

But there's only one other call site, which already does the `mkdir -p`.

## 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] - Ensure artifacts directory exists when building Hermes from local source

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

Test Plan:
I verified the fix by:

- Doing a local git clone of the `hermes` repository.
- Ensure no `Pods` directory exists.
- `export REACT_NATIVE_OVERRIDE_HERMES_DIR=/your/local/path/to/hermes` pointing to the local `hermes` repository.
- Run `pod install`

Reviewed By: cipolleschi

Differential Revision: D66162175

Pulled By: dmytrorykun

fbshipit-source-id: 322633e217063e7ca199b9a9602e279df5fbdb70
2024-11-19 03:44:42 -08:00
Rob HoganandFacebook GitHub Bot 398b3b3be4 metro-config: Revert setting hermesParser: true in default Metro config (#47670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47670

Now that we have `babel-plugin-syntax-hermes-parser` in `react-native/babel-preset` (since D63535216), it's no longer necessary to use `hermes-parser` directly in Metro in order to use newer Flow syntax.

Babel with `babel-plugin-syntax-hermes-parser` is generally preferable, because it intelligently falls back to parsing with Babel for any non-`flow` files.

See https://github.com/facebook/hermes/issues/1549 for context.

Changelog:
[General][Fixed] metro-config: Don't use `hermes-parser` by default, prefer `babel-plugin-syntax-hermes-parser`, which supports other syntax plugins.

Reviewed By: huntie

Differential Revision: D66002056

fbshipit-source-id: cf48acec347e2c0791872f8ca4b53f5f8af1c783
2024-11-19 02:43:03 -08:00
Rob HoganandFacebook GitHub Bot 99767d43b0 Remove URL.canParse, fix older Node compatibility
Summary:
`URL.canParse` was added to Node.js [in v18.17.0](https://github.com/nodejs/node/commit/9586cd0cfd50bb83722af4edeb54cd113b68e20a).

Internally, we have call sites using earlier versions of Node.js.

Changelog:
[General][Fixed]: dev-middleware: Remove URL.canParse, restore compat with Node < 18.17

Reviewed By: rshest

Differential Revision: D66158204

fbshipit-source-id: e7a846b536e76672cea9afd5bdc5041d50a8b587
2024-11-19 01:50:49 -08:00
Tim YungandFacebook GitHub Bot 29a0d7c3b2 RN: Feature Flag to Disable InteractionManager in Batchinator (#47690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47690

Creates a feature flag to evalute the impact of disabling `InteractionManager` in `Batchinator` and synchronously invoking callbacks after the timeout.

This also deletes the `dispose` arguments in `Batchinator` that were unused.

Changelog:
[Internal]

Reviewed By: bvanderhoof

Differential Revision: D66139643

fbshipit-source-id: d17bab0cd25c0c69779686cb435c063f707255e4
2024-11-18 23:12:15 -08:00
David VaccaandFacebook GitHub Bot fbe4c0ed34 Remove jsBundleLoader from DefaultReactHost.getDefaultReactHost (#47684)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47684

jsBundleLoader parameter was added into DefaultReactHost.getDefaultReactHost but we decided to revert this change.
We want to keep DefaultReactHost.getDefaultReactHost as simple as possible and we don't want to include this change in 0.77

changelog: [Android][Breaking] Remove jsBundleLoader from DefaultReactHost.getDefaultReactHost()

Reviewed By: shwanton

Differential Revision: D66131197

fbshipit-source-id: 7451bb55d7953d3282b23d23ad15e91bae71ff24
2024-11-18 17:34:59 -08:00
Ramanpreet NaraandFacebook GitHub Bot cc5f17d5a2 Make NativeModules.foo also load turbo modules (#47598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47598

## Changes
Now:
- in bridgeless, NativeModules.foo will also return turbo modules. And, global.__turboModuleProxy no longer exists.
- in bridge, nothing changes.

| **JS API**                               | **Bridge**             | ***[Before]* Bridgeless**   | ***[Before]* Bridgeless w/ Interop**| ***[After]* Bridgeless**
| global.__turboModuleProxy |  turbo modules      | turbo modules                     | turbo modules                                     |**deleted**
| global.nativeModuleProxy    |  legacy  modules   | error                                      | legacy modules                                  | turbo + legacy modules

## Justification
This reduces the cost for adopting the new architecture:
- Prior, you had to migrate the module itself, **and** all its callsites: NativeModules.foo -> NativeFoo
- Now, you have to migrate the module itself **only**.

This simplifies the interop layer logic in bridgeless: all modules come from the same thing.

Changelog: [General][Breaking] Bridgeless: Make NativeModules.foo load turbomodules (unset turboModuleProxy in bridgeless).

Reviewed By: javache

Differential Revision: D65896934

fbshipit-source-id: 10883c292b78759fceac5bd984e0cdf8a679fc67
2024-11-18 17:22:51 -08:00
Rob HoganandFacebook GitHub Bot d1b0e9a30b dev-middleware: Use serverBaseUrl for local->server fetches (#47653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47653

## Context

Currently, when `nativeSourceCodeFetching == false`, `inspector-proxy` attempts to pre-fetch source maps, given the URL from a `Debugger.scriptParsed` event, and embeds them into `Debugger.scriptParsed`'s `sourceMapURL` using a data URI.

This was originally to support frontends that did not perform HTTP requests or were blocked (eg by CORS), but we're retaining it for the moment because it's more performant than lazy loading the source map.

Similarly, we perform middleware->server fetches to respond to `Debugger.getScriptSource` events.

To make these fetches for URLs that target `10.0.2.2` (ie, addressable from within an Android emulator) (etc), we rewrite `10.0.2.2`->`localhost` and perform a `fetch` from the Node process running dev-middleware.

## The problem

Consider a setup where:
 - Metro is running on a remote server, listening on `8081`.
 - Dev machine tunnels `localhost:8082` -> remote `8081`.
 - An app is running on an Android emulator on the dev machine, with bundle URL configured to `10.0.2.2:8082`.

In this case, we'll rewrite `10.0.2.2:8082` to `localhost:8082`, which *is* reachable and correct from the dev machine, but *not* from the machine where Metro is running, so the `fetch` of a source map from the inspector proxy will fail.

## Motivation

This might seem like a niche case, but it's part of fixing a series of unsafe assumptions that currently prevent us from running DevTools on an arbitrary port.

## This fix

Preserve the current behaviour (simple `10.0.2.2`<=>`localhost`) for URLs sent to the frontend, but construct a separate, server-relative URL, using the configured `serverBaseUrl`, for `fetch` calls within dev-middleware.

Changelog:
[General][Fixed] RN DevTools: Fix fetching sources and source maps when the dev-server is remote and not tunnelled via the same port+protocol.

Reviewed By: huntie

Differential Revision: D65993910

fbshipit-source-id: a0cdcf1644e97a2af3d8583f2da2aaa51276f68c
2024-11-18 16:23:53 -08:00
Rob HoganandFacebook GitHub Bot da62721061 dev-middleware: refactor tests to use undici.request (#47675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47675

Use `request` over `fetch` in `dev-middleware`'s tests.

This is required by the next diff in the stack to spoof the `Host` header for testing purposes, which isn't permitted by the `fetch` spec.

The return type is a bit different (eg `statusCode` vs `status`, no `ok` prop), but the modifications needed are pretty straightforward.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D66005427

fbshipit-source-id: f311b0188d6d0ec220a037774fca78df5373163a
2024-11-18 15:14:02 -08:00
Rob HoganandFacebook GitHub Bot acf384a72e dev-middleware: Redefine "serverBaseUrl" as server-relative, '/json/list' by requestor (#47628)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47628

`serverBaseUrl` is currently documented as:

> The base URL to the dev server, as addressible from the local developer machine

This is problematic in general because `dev-middleware` on a server doesn't necessarily know about where clients might be reaching it from, how tunnels or port-forwards are set up, etc., and this can change over the lifetime of the server and vary between clients.

Indeed, our own use of `serverBaseUrl` from both `community-cli-plugin` and internally simply sets it to the host and port the dev server is listening on - ie it's the address of the dev server accessible *from the server*.

This PR changes the docs, redefining `serverBaseUrl`, to match the way we currently specify it.

One usage where we *do* want the previously documented behaviour is in responses to `/json/list` (`getPageDescriptions`) where the URLs in the response should be reachable by a browser requesting `/json/list`.

Here, we use the request (host header, etc.) to attempt to get working base URL.

History:
It should be mentioned that this is the latest in a series of changes like this:
 - https://github.com/facebook/react-native/pull/39394
 - https://github.com/facebook/react-native/pull/39456

Learning from those:
 - This change does *not* break Android emulators, which routes `10.0.2.2` to localhost, or other routed devices, because `/open-debugger` still uses server-relative URLs, and now formally delegates to `BrowserLauncher` to decide what to do with those URLs (internally, VSCode / `xdg-open` handles port forwarding)
 - Middleware configuration is no longer required to specify how it is reachable from clients.

This sets up some subsequent changes for more robust handling of tunnelled connections.

Changelog:
[General][Breaking] dev-middleware: Frameworks should specify `serverBaseUrl` relative to the middleware host.

Reviewed By: huntie

Differential Revision: D65974487

fbshipit-source-id: 1face8fc7715df387f75b329e80932d8543ee419
2024-11-18 13:46:50 -08:00
Rob HoganandFacebook GitHub Bot ca9c56329f dev-middleware: Fix reliance on adb reverse when loading sources on Android (#47652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47652

## Background
When the `nativeSourceCodeFetching` capability is disabled, `inspector-proxy` rewrites URLs exchanged over CDP between device and frontend so that URLs are addressable from CDT - in particular, when using an Android emulator `10.0.2.2` (host's address from within the emulator) is rewritten to and from `localhost` (the equivalent address reachable from the host).

Previously - before we implemented `Network.loadNetworkResource`, or on old frontends that don't attempt to use that method -  this worked reasonably well. A `fetch` from CDT to Metro would succeed on the rewritten URL.

## Problem
Since we implemented `Network.loadNetworkResource`, but disabled the `nativeSourceCodeFetching` capability, source fetching is broken under Android emulators. We're rewriting URLs to be frontend-relative, but then attempting to fetch them through the device, because as far as CDT is aware, `Network.loadNetworkResource` should still be tried first.

When `Network.loadNetworkResource` responds with a CDP *error*, CDT falls back to a local fetch (which would work), but when it responds with a CDP *result* of `success: false`, there is no fallback.

## Fix
This diff adds an interception guarded behind `nativeSourceCodeFetching == false`, which rejects any calls to `Network.loadNetworkResource` with a CDP error. This restores the previous behaviour from before `Network.loadNetworkResource` was implemented at all.

NOTE: An alternative approach would be to rewrite URLs back to device-relative for `Network.loadNetworkResource`, but IMO it's more correct for the frontend to respect that the device is asserting that it doesn't have that capability, and not to try to use it.

Changelog:
[Android][Fixed] RN DevTools: Fix source loading when using an Android emulator connecting to a dev server on the host.

Reviewed By: huntie

Differential Revision: D66074731

fbshipit-source-id: f2050c014cd5cfa546bff5e9d0412413a5daff35
2024-11-18 12:19:19 -08:00
Edmond ChuiandFacebook GitHub Bot 8507204b53 fix /open-debugger failing after relaunching Metro/target app (#47623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47623

Changelog:
[iOS][Fixed] - "Reconnect DevTools" button not working sometimes

Hotfix for "Reconnect DevTools" button not working:

* T206141946 / [WP: Reconnecting dev tools does not work after restarting the app](https://fb.workplace.com/groups/rn.debugger.feedback/posts/1107620434125533)
* T206754760 / [WP: Can't launch DevTools from Metro sometimes](https://fb.workplace.com/groups/rn.debugger.feedback/posts/1112235073664069/)

Basically, this dialog will keep reappearing like a bad dream:

 {F1960030622}

# Repro

Part 1 (Fixed in base stack D65973309)
1. Do NOT have Metro ready.
1. Build and run RNTester/FB Wilde
1. They should be using the local bundled version. App may prompt you to start Metro.
1. Start Metro
1. Go to the device Dev Menu (rage shake) and select Reload
1. Press `r` or `d` in Metro

Expected: Reload and Dev Menu work accordingly
Actual: Metro fails with `No apps connected`:

 {F1960039703}

Part 2 (Fixed in this diff)
1. Open React Native DevTools via Metro `j` key or Dev Menu (rage shake)
1. Kill Metro
1. The RN DevTools should show the "disconnected" dialog
1. Start Metro
1. Click "Reconnect DevTools" in RN DevTools

Expected: reconnects
Actual: dialog reappears with an error in Metro:
{F1960043097}

Interestingly, the `r` and `d` keys from Metro works.

# Root cause(s)
Part 1: See D65973309
Part 2:
The error indicates the target/device failed to call `/inspector/device` to register itself. The subsequent calls to `/json/list` returns empty and `/open-debugger` throws.

1. But because `r` & `d` (heh) works, we can observe that there is some kind of auto-reconnect mechanism:

https://www.internalfb.com/code/fbsource/[cfe1706a60b2]/xplat/js/react-native-github/packages/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m?lines=77-82

1. We do have auto-reconnect for `j` too:

https://www.internalfb.com/code/fbsource/[cfe1706a60b2]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp?lines=246-254

But unfortunately it only tries once. A long-term fix would be calling reconnect recursively like the Objective-C impl above, e.g.

Edit: the long-term fix ! See V3

```
  delegate_->scheduleCallback(
      [weakSelf = weak_from_this()] {
        auto strongSelf = weakSelf.lock();
        if (strongSelf && !strongSelf->closed_) {
          strongSelf->reconnectPending_ = false;
          strongSelf->connect();

          // Keep trying. Never. Give. Up.
          if (!strongSelf->isConnected()) {
            strongSelf->reconnect();
          }
        }
      },
      RECONNECT_DELAY);
```

Edit: I snuck in some time during React Native London Conf and got the long-term fix going! ✌️

{gif:7iyrns4l}

~~It appears that the current impl of `isConnected()` is not a true reflection of the web socket state. My time box for this task ran out, so we'll do a hot fix for the short-term: since we know `r` & `d` reliably reconnects, we'll piggy-back on its lifecycle to attempt reconnection. This works. I'm going on PTO for the year, so the follow-up task is up for grabs here: T207775935.~~

# PS

1. If you start the app with Metro running in step 1, this bug is not present. This is the reason why FB Wilde/Marketplace/Quantum engineers run into this more often (because its custom menu changes the JS URL after start up)
2. This auto-reconnect does not mean the RN DevTools frontend will dismiss the dialog automatically. This is only about the `Metro <> Device` in `Frontend <> Metro <> Device`.
    1. Current impl in Metro/Inspector Proxy means that whenever the `Metro <> Device` connection is terminated, the `Frontend <> Metro` connection is killed.
    1. This diff helps restore the `Metro <> Device` connection.
    1. The `Frontend <> Metro` connection does not currently get reconnected. We can make the Frontend do so, with consideration of preserving logs/states, etc.

Reviewed By: robhogan

Differential Revision: D65952134

fbshipit-source-id: 3abd16f6a7b7ed50e8acdb7c753cc4fbd3317236
2024-11-18 11:30:23 -08:00
Rubén NorteandFacebook GitHub Bot 3986eefed1 Clean up feature flag allowRecursiveCommitsWithSynchronousMountOnAndroid (#47665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47665

Changelog: [Android][Fixed] Fixes some deadlocks when doing commits and state updates synchronously from the UI thread (e.g.: from reanimated).

This removes the gating for the fix to allow recursive commits with synchronous mount on Android.

See https://github.com/facebook/react-native/pull/44725#issuecomment-2427579065 and https://github.com/software-mansion/react-native-reanimated/issues/6418#issuecomment-2296107100.

Reviewed By: sammy-SC

Differential Revision: D66095539

fbshipit-source-id: 63b8c4d9161a40159601b8e3b45f7e5c7cdd83e4
2024-11-18 08:13:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 95fc906930 Pass the RCTAppDependencyProvider to the RCTAppDelegate (#47651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47651

## This Change:

This change uses in the App's AppDelegate the newly generated `RCTAppDependencyProvider`, passing it to the `RCTAppDelegate`.

This change needs to be applied also to the template, when this stack lands.

## Context

React Native has a last temporal dependency on Codegen in the React-RCTAppDelegate pod.

The RCTAppDelegate has the responsibility to provide various dependencies to react native, like third party components and various modules. ReactCodegen is generated when the user create the project, while React-RCTAppDelegate eists in React Native itself.

This dependency means that we cannot prepare prebuilt for iOS for React Native because when we would have to create prebuilds, we would need the React Codegen, but we can't create a React codegen package that will fit all the apps, because React Codegen can contains App Specific modules and components and apps might have different dependencies.

## Changelog:
[iOS][Added] - Pass the `RCTAppDependencyProvider` to the `RCTAppDelegate`

Reviewed By: dmytrorykun

Differential Revision: D66074475

fbshipit-source-id: 93bf500fe37f115352ebd49d3d56955cbaeeea72
2024-11-18 08:06:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 41c2502b36 Generate RCTAppDependencyProvider for apps (#47650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47650

## This Change:

This change generates the `RCTAppDependencyProvider` for the apps, so that the amount of changes required by the users is minimal.

## Context

React Native has a last temporal dependency on Codegen in the React-RCTAppDelegate pod.

The RCTAppDelegate has the responsibility to provide various dependencies to react native, like third party components and various modules. ReactCodegen is generated when the user create the project, while React-RCTAppDelegate eists in React Native itself.

This dependency means that we cannot prepare prebuilt for iOS for React Native because when we would have to create prebuilds, we would need the React Codegen, but we can't create a React codegen package that will fit all the apps, because React Codegen can contains App Specific modules and components and apps might have different dependencies.

## Changelog:
[iOS][Added] - Introduce the RCTAppDependencyProvider to minimize the changes required y the users

Reviewed By: dmytrorykun

Differential Revision: D66074456

fbshipit-source-id: 073022e66da53eca6bf948aeda01f17ad85793ff
2024-11-18 08:06:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b91626af26 Use RCTDependencyProvider in RCTAppDelegate (#47649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47649

## This Change:

This change uses the `RCTDependencyProvider` protocol created before, breaking the dependency between the RCTAppDelegate and codegen.

## Context

React Native has a last temporal dependency on Codegen in the React-RCTAppDelegate pod.

The RCTAppDelegate has the responsibility to provide various dependencies to react native, like third party components and various modules. ReactCodegen is generated when the user create the project, while React-RCTAppDelegate eists in React Native itself.

This dependency means that we cannot prepare prebuilt for iOS for React Native because when we would have to create prebuilds, we would need the React Codegen, but we can't create a React codegen package that will fit all the apps, because React Codegen can contains App Specific modules and components and apps might have different dependencies.

## Changelog:
[iOS][Breaking] - Use the RCTDependencyProvider in the RCTAppDelegate, breaking the dependency with Codegen

Reviewed By: dmytrorykun

Differential Revision: D66074438

fbshipit-source-id: 33234411a3840598b9bd16b0b71a15f75fd3c6a7
2024-11-18 08:06:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f2b3716426 Add RCTDependencyProvider protocol (#47648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47648

React Native has a last temporal dependency on Codegen in the React-RCTAppDelegate pod.

The RCTAppDelegate has the responsibility to provide various dependencies to react native, like third party components and various modules. ReactCodegen is generated when the user create the project, while React-RCTAppDelegate eists in React Native itself.

This dependency means that we cannot prepare prebuilt for iOS for React Native because when we would have to create prebuilds, we would need the React Codegen, but we can't create a React codegen package that will fit all the apps, because React Codegen can contains App Specific modules and components and apps might have different dependencies.

This change introduces the RCTDependencyProvider protocol to invert this dependency.

## Changelog:
[iOS][Added] - Add RCTDependencyProvider protocol

Reviewed By: dmytrorykun

Differential Revision: D66074409

fbshipit-source-id: 0d3d3f707bcb44c1f34ebeb3ae019f7ea074f60f
2024-11-18 08:06:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 7e0bdcb780 Back out "fix(iOS): unify prefetchImageWithMetadata's signature in JS and ObjC land" (#47664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47664

We landed the previous change in [4dd60acb7d](https://github.com/facebook/react-native/commit/4dd60acb7ddc2811453e84e3567c1a114fa5e6f9), but this is breaking the OSS CI because now the two signatures do not match

## Changelog:
[Internal] - Revert make the prefetchImageWithMetadata's queryRoot nullable

Reviewed By: GijsWeterings

Differential Revision: D66096759

fbshipit-source-id: b0ce87d82edd63576df7a04c58d5aec3173ad8d6
2024-11-18 07:34:43 -08:00
Pieter De BaetsandFacebook GitHub Bot fe8cc62824 Expose getCurrentReactContext on ReactDelegate (#47659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47659

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

There's no convenient way to access the current react context when using the new architecture. Exposing `getCurrentReactContext` allows for users to migrate without forcing the check downstream.

Changelog: [Android][Added] ReactDelegate and ReactActivityDelegate#getCurrentReactContext can be used to access the current context

Reviewed By: rshest

Differential Revision: D66094540

fbshipit-source-id: 2e504f0db3eb04e0fff5a667afed875214ba54a2
2024-11-18 07:03:02 -08:00
zhongwuzwandFacebook GitHub Bot e0df58d5c9 Fabric: Fixes image coordinator status assert crash in debug mode (#47655)
Summary:
Because we cancel the request and the callback for the request loading state occurs in a multi-threaded environment, we may still receive the callback even after canceling the request.

 The assert failed like below:
```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/48, queue = 'com.apple.root.default-qos', stop reason = signal SIGABRT
    frame #0: 0x0000000106d15008 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x000000010581f408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
  * frame https://github.com/facebook/react-native/issues/4: 0x00000001073fcd64 React_Fabric`facebook::react::ImageResponseObserverCoordinator::nativeImageResponseComplete(this=0x00006000039bc838, imageResponse=0x000000016ce86970) const at ImageResponseObserverCoordinator.cpp:93:3
    frame https://github.com/facebook/react-native/issues/5: 0x00000001057c9a6c React_ImageManager`__42-[RCTImageManager requestImage:surfaceId:]_block_invoke_2(.block_descriptor=0x0000600000da21c0, error=0x0000000000000000, image=0x0000600003034ea0, metadata=0x0000000000000000) at RCTImageManager.mm:76:30
    frame https://github.com/facebook/react-native/issues/6: 0x0000000105657188 RCTImage`__140-[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_3(.block_descriptor=0x0000600002c90200, error_=0x0000000000000000, image=0x0000600003034ea0) at RCTImageLoader.mm:831:11
    frame https://github.com/facebook/react-native/issues/7: 0x00000001056582e8 RCTImage`__80-[RCTImageLoader decodeImageData:size:scale:clipped:resizeMode:completionBlock:]_block_invoke_2(.block_descriptor=0x000060000267b780, error=0x0000000000000000, image=0x0000600003034ea0) at RCTImageLoader.mm:933:7
    frame https://github.com/facebook/react-native/issues/8: 0x0000000105658d60 RCTImage`__80-[RCTImageLoader decodeImageData:size:scale:clipped:resizeMode:completionBlock:]_block_invoke_3.207(.block_descriptor=0x0000600002957e90) at RCTImageLoader.mm:973:13
    frame https://github.com/facebook/react-native/issues/9: 0x0000000108560ec0 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame https://github.com/facebook/react-native/issues/10: 0x00000001085627b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame https://github.com/facebook/react-native/issues/11: 0x00000001085655f4 libdispatch.dylib`_dispatch_queue_override_invoke + 1312
    frame https://github.com/facebook/react-native/issues/12: 0x00000001085763d4 libdispatch.dylib`_dispatch_root_queue_drain + 372
    frame https://github.com/facebook/react-native/issues/13: 0x0000000108576f7c libdispatch.dylib`_dispatch_worker_thread2 + 256
    frame https://github.com/facebook/react-native/issues/14: 0x000000010581bb38 libsystem_pthread.dylib`_pthread_wqthread + 224
```

![image](https://github.com/user-attachments/assets/7ed1997d-9d48-4631-9a02-0eef28a03cf3)

```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/18, queue = 'com.meta.react.turbomodulemanager.queue', stop reason = signal SIGABRT
    frame #0: 0x0000000107ea9008 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x000000010569b408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
  * frame https://github.com/facebook/react-native/issues/4: 0x00000001072bcae8 React_Fabric`facebook::react::ImageResponseObserverCoordinator::nativeImageResponseProgress(this=0x00006000039bd7a8, progress=-1006, loaded=1006, total=-1) const at ImageResponseObserverCoordinator.cpp:76:3
    frame https://github.com/facebook/react-native/issues/5: 0x0000000105615fb8 React_ImageManager`__42-[RCTImageManager requestImage:surfaceId:]_block_invoke.3(.block_descriptor=0x0000600000d26a30, progress=1006, total=-1) at RCTImageManager.mm:89:28
    frame https://github.com/facebook/react-native/issues/6: 0x00000001055160fc RCTImage`__64-[RCTImageLoader _loadURLRequest:progressBlock:completionBlock:]_block_invoke.192(.block_descriptor=0x0000600000cd4900, progress=1006, total=-1) at RCTImageLoader.mm:747:7
    frame https://github.com/facebook/react-native/issues/7: 0x000000010504bc4c RCTNetwork`__44-[RCTNetworkTask URLRequest:didReceiveData:]_block_invoke.22(.block_descriptor=0x00006000017e0c80) at RCTNetworkTask.mm:201:7
    frame https://github.com/facebook/react-native/issues/8: 0x0000000108a24ec0 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame https://github.com/facebook/react-native/issues/9: 0x0000000108a267b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame https://github.com/facebook/react-native/issues/10: 0x0000000108a2eaac libdispatch.dylib`_dispatch_lane_serial_drain + 912
    frame https://github.com/facebook/react-native/issues/11: 0x0000000108a2f7b0 libdispatch.dylib`_dispatch_lane_invoke + 420
    frame https://github.com/facebook/react-native/issues/12: 0x0000000108a3c1f0 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324
    frame https://github.com/facebook/react-native/issues/13: 0x0000000108a3b75c libdispatch.dylib`_dispatch_workloop_worker_thread + 732
    frame https://github.com/facebook/react-native/issues/14: 0x0000000105697b74 libsystem_pthread.dylib`_pthread_wqthread + 284
```

![image](https://github.com/user-attachments/assets/524a3ba2-857e-4f3a-8757-115d3ebadb42)

## Changelog:

[IOS] [FIXED] - Fabric: Fixes image coordinator status assert crash in debug mode

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

Test Plan: Very easy to repro, just open RNTester's Image example, and then pop the page. Do this back and forth a few times.

Reviewed By: sammy-SC, rshest

Differential Revision: D66093834

Pulled By: javache

fbshipit-source-id: a2ca36147498725d38a95cc3fcc12a2c18802303
2024-11-18 05:46:49 -08:00
Henning HallandFacebook GitHub Bot 089c87e22e feat: add disabledButtonTintColor prop in ActionSheetIOS (#46883)
Summary:
### Problem
Setting the `tintColor` prop in ActionSheetIOS also changes the tint of disabled entries. This could make them visually indistinguishable from enabled items. The degree to which they are indistinguishable depends on the tint color.

### Solution
This new prop `disabledButtonTintColor` allows customization of disabled items' tint color.

Related PR: https://github.com/facebook/react-native/pull/31972

## Changelog:

[IOS] [ADDED] - added `disabledButtonTintColor` prop to ActionSheetIOS

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

Test Plan:
Tested in RNTester project.

<table>
  <tr>
    <td align="center">
      <strong>Before</strong>
    </td>
    <td align="center">
      <strong>After</strong>
    </td>
  </tr>
  <tr>
    <td>
      <img src="https://github.com/user-attachments/assets/5ab251d9-3128-45e0-bb1f-907376422df0" alt="Screenshot Before" width="300"/>
    </td>
    <td>
      <img src="https://github.com/user-attachments/assets/96f76a08-bb8d-497a-9c89-dca0e0bdbcbb" alt="Screenshot After" width="300"/>
    </td>
  </tr>
  <tr>
    <td align="center">
      <strong>Before</strong>
    </td>
    <td align="center">
      <strong>After</strong>
    </td>
  </tr>
</table>

Reviewed By: lunaleaps

Differential Revision: D65757069

Pulled By: cipolleschi

fbshipit-source-id: 1f51ed6927bfb4fe4e21018c541303dff44b2217
2024-11-18 05:26:38 -08:00
Rubén NorteandFacebook GitHub Bot 7be98c99bd Filter out AppRegistry logs from output (#47658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47658

Changelog: [internal]

AppRegistry logs are showing up again in Fantom because we changed the order and now they're not necessarily showing up last.

This fixes that by filtering them out in any position.

Reviewed By: sammy-SC

Differential Revision: D66094274

fbshipit-source-id: bd37394252ee6309f7093567f9a2b73b641938ce
2024-11-18 04:38:43 -08:00
Parsa NasirimehrandFacebook GitHub Bot 4dd60acb7d fix(iOS): unify prefetchImageWithMetadata's signature in JS and ObjC land (#47532)
Summary:
in `prefetchImageWithMetadata`'s implementation in ObjC, the method's `queryRootName` is treated as being nullable. The image spec for it in JS (and the Codegened ObjC header that gets built on top of it) treat the field as not nullable. This change makes the field nullable in the spec to match up what we have in the implementation.

I also noticed that the method is not defined in the [Image props](https://reactnative.dev/docs/image) on the RN website, so perhaps we should add this there as well.

bypass-github-export-checks

## Changelog:

[IOS] [CHANGED] - make `prefetchImageWithMetadata`'s `queryRootName` nullable in the spec

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

Test Plan:
yarn test:
<img width="1576" alt="Screenshot 2024-11-09 at 00 36 30" src="https://github.com/user-attachments/assets/4162ff79-1388-4f6f-9576-256fd9011fcf">
It has no iOS specific tests, so nothing to run on that side

Reviewed By: javache

Differential Revision: D65761208

Pulled By: cipolleschi

fbshipit-source-id: d050950486e9f804b65dab047d93761a610a71e7
2024-11-18 04:17:39 -08:00
dominictbandFacebook GitHub Bot e021e50d53 fix: scroll the cursor into view when focus (#46411)
Summary:
Currently in iOS, when focusing the multiline text input, the cursor is not automatically scrolled into view if it is out of view. This PR adds the small util to scroll the cursor into view when the text input focuses. This doesn't happen in Android due to [this](https://github.com/facebook/react-native/blob/defb0bd137711d3e76514d9202005a221a345871/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java#L360)

Original issue: https://github.com/Expensify/App/issues/48122
Original proposal: https://github.com/Expensify/App/issues/48122#issuecomment-2320769418

## 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] - Scroll the cursor into view when text input is focused

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

Test Plan:
Code to reproduce in rn-tester
```
const TextInputWithFocusButton = () => {
  const inputToFocusRef = React.useRef<React.ElementRef<typeof TextInput> | null>(null);
  return (
    <View>
      <ExampleTextInput
        ref={inputToFocusRef}
        placeholder="height increases with content"
        defaultValue="React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native."
        multiline={true}
        enablesReturnKeyAutomatically={true}
        returnKeyType="go"
        style={[styles.multiline, styles.multilineExpandable]}
      />
      <Button title="Focus" onPress={() => {
        inputToFocusRef.current?.focus();
      }} />
    </View>
  );
};
```

Steps:
- Move the cursor of the input to end of the input text
- Scroll up the input
- Blur the input
- Click on `Focus` button to re-focus the input

Note that before this fix, the cursor is not scrolled into view

- In iOS

<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>

https://github.com/user-attachments/assets/de589cbf-158c-4e28-81d6-8412bf05ab23

</td>
<td>

https://github.com/user-attachments/assets/81c571f9-653b-49a5-9ecb-6eeaa2c54ec7

</td>
</tr>
</table>

Reviewed By: sammy-SC

Differential Revision: D62847985

Pulled By: cipolleschi

fbshipit-source-id: c0367a7fc0a7a16b30c4538e59f42d971d959357
2024-11-18 03:38:49 -08:00
Fouad MagdyandFacebook GitHub Bot 794154e63a fix build failure on windows in android (#47641)
Summary:
This pull request addresses a CMake configuration issue where an invalid escape character in file paths caused the build process to fail. Specifically, it resolves the issue in the React Native CMake configuration file where the path separator was incorrectly handled, leading to an error in the build system.

the issue is in [This Issue](https://github.com/expo/expo/issues/32955) and [This](https://github.com/expo/expo/issues/32957)

## 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] [FIXED] - Corrected invalid escape character in CMake path handling

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

Test Plan:
To test the changes, I performed the following steps:

1. Cloned the repository and checked out the `fix-cmake-invalid-escape-character` branch.
2. Ran the CMake build on a Windows environment where the issue was previously occurring.
3. Verified that the build process completed successfully without the "invalid character escape" error.
4. Ensured that the path handling now works correctly in CMake on Windows platforms.

Reviewed By: rshest

Differential Revision: D66073896

Pulled By: cipolleschi

fbshipit-source-id: bd2a71bb00ce5c5509ed403842c995c32f58f91d
2024-11-18 02:38:32 -08:00
Samuel SuslaandFacebook GitHub Bot 89a7238acd introduce ability to flush messege queue from tests (#47646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47646

changelog: [internal]

In order to control scheduling of tests, test setup must be separated from test running. This is because of how internal scheduling of React Native is restricted until bundle is loaded via BufferedRuntimeExecutor. This is the reason for executing tests by calling global function `$$RunTests$$`. This is not a pretty solution but it is hidden within testing infrastructure and users of our test infra are not exposed to this.

There is a new method exposed to JavaScript: flushMessageQueue. This will flush everything that is inside of message queue. This is the queue where tasks are queued whenever RuntimeScheduler enqueues something by calling `runtimeExecutor_`.

Reviewed By: christophpurrer

Differential Revision: D65951894

fbshipit-source-id: 2e8e0c10fbeb998f4a51ee6d01ef229eb5f70448
2024-11-17 03:30:31 -08:00
Samuel SuslaandFacebook GitHub Bot 6f1c2a512e synchronise dispatching of view commands through RuntimeScheduler (#47604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47604

## Changelog:

[iOS] [Fixed] - Fixed use of view commands from layout effects

Mounting of views is delayed by runtime scheduler to allow React to run layout effects. Execution of view commands must by queued together with mounting of views, otherwise it might be executed before views are mounted. When this happens, view commands are ignored.

So before, if view command was executed from layout effect (or ref function), it would get dispatched to the UI thread as quickly as possible. But mounting of views would be delayed. To fix this, both mounting of views and view commands are put on the same queue inside of RuntimeScheduler.

## What about Android?
Android employs a [retry mechanism](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java#L211) that was needed for react tag based view commands. In paper, one could send a view command to a react tag which was completely disconnected from whether a view exists or not.

iOS was built with ref commands in mind, so it doesn't have this mechanism.

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

Reviewed By: javache, cipolleschi

Differential Revision: D65909191

fbshipit-source-id: 9d2a444879bee62a7b8b7d31edde450e18339b89
2024-11-16 08:22:37 -08:00
generatedunixname89002005232357andFacebook GitHub Bot 38fb83ca86 Revert D65556000 (#47642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47642

Reverts https://github.com/facebook/react-native/pull/47468

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D66030953

fbshipit-source-id: aea1f681e1916cc234b69bce650670451829bb55
2024-11-15 16:55:33 -08:00
Jack PopeandFacebook GitHub Bot 55a4d105e7 Enable ban_spread_key_props in xplat/js (#47636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47636

We're cleaning up key spreads across WWW/Fbsource. Flow's `ban_spread_key_props` option allows us to fix existing spreads and prevent new ones from being added in code covered by Flow.

Here we fix spreads within xplat/js.

Also based on a unit test keeping config in sync, I've added the option to metro and RN OSS as well.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D64427942

fbshipit-source-id: db8f4aa428ce1994304b5d814b9d241d26e8d522
2024-11-15 14:18:51 -08:00
David VaccaandFacebook GitHub Bot 7a5a10c95c Expose exceptionHandler as a parameter of DefaultReactHost.getDefaultReactHost() method (#47638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47638

This diff exposes exceptionHandler as a parameter of DefaultReactHost, this is necessary becuase apps using getDefaultReactHost are not able to set an exceptionHandler

We need to revisit this API as a follow up

changelog: [Android][Added] Add exceptionHandler as a parameter of DefaultReactHost.getDefaultReactHost() method

Reviewed By: alanleedev

Differential Revision: D66011047

fbshipit-source-id: 3f36aa0d064a0b1b47e9f71df55bbe466950048a
2024-11-15 12:43:06 -08:00
Samuel SuslaandFacebook GitHub Bot 84265fd3d9 move reference to RuntimeScheduler to pointer (#47605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47605

changelog: [internal]

use a pointer to RuntimeScheduler instead of getting a reference to it from context container each time.

Reviewed By: javache, cipolleschi

Differential Revision: D65909100

fbshipit-source-id: c53c9b573777803f7f3077656af1dae0db7eee88
2024-11-15 06:33:03 -08:00
Fabrizio CucciandFacebook GitHub Bot 6db883a56c Migrate com.facebook.react.views.text.ReactScrollViewCommandHelper to Kotlin (#47619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47619

As per title.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65660776

fbshipit-source-id: ca238729f511a6e446dedd89515c88b26563aef8
2024-11-15 05:56:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9c11d7ca68 Add changelog for 0.76.2 (#47620)
Summary:
Add changelog for 0.76.2

## Changelog:
[Internal] - Add changelog for 0.76.2

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

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D65963142

Pulled By: cipolleschi

fbshipit-source-id: f48fdfac2476e891c91a90a62caa1ad1be76e410
2024-11-15 04:58:13 -08:00
Rubén NorteandFacebook GitHub Bot 4cce3b8bf6 Fix bug in ReadOnlyNode.compareDocumentPosition (#47557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47557

Changelog: [internal]

Not published as a bugfix because this API isn't enabled in OSS yet.

Reviewed By: sammy-SC

Differential Revision: D65769326

fbshipit-source-id: 165d58304d8214c583fbc162d8888095e9f068aa
2024-11-15 03:00:17 -08:00
Rubén NorteandFacebook GitHub Bot 058624fc1d Add support for focused and skipped tests in React Native integration tests (#47559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47559

Changelog: [internal]

Adds support for focused and skipped tests and describe blocks:
* `fdescribe` / `describe.only`
* `xdescribe` / `describe.skip`
* `fit` / `it.only` / `test.only`
* `xit` / `it.skip` / `xtest` / `test.skip`

Reviewed By: rshest

Differential Revision: D65769325

fbshipit-source-id: ea26ae533400390b2efc4f2369340e5dc73c5d50
2024-11-15 03:00:17 -08:00
Rubén NorteandFacebook GitHub Bot d417788b24 Hook up RN integration tests in Jest pipeline at Meta (#47613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47613

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D65661703

fbshipit-source-id: 269444f8f7124082f06ffcf89cec40992a107d67
2024-11-15 03:00:17 -08:00
Rubén NorteandFacebook GitHub Bot 07b34f4ca3 Add Flow typing for test runner for RN integration tests (#47612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47612

Changelog: [internal]

Just using babel-register so we can use Flow types in the code for the RN integration tests runner.

Reviewed By: sammy-SC

Differential Revision: D65948801

fbshipit-source-id: 6c54b0463fe4b71c818ff1c4faa973cc8b13b5d2
2024-11-15 03:00:17 -08:00
Rubén NorteandFacebook GitHub Bot 48b361688f Fix some broken expectations in RN integration tests (#47615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47615

Changelog: [internal]

Fixes `.not` not being applied in some cases, and no logging the "not" label in case of error, and `.toBe` being flipped.

Reviewed By: javache

Differential Revision: D65952221

fbshipit-source-id: 030c0597b661d34e6324d69e5676375150a74f2e
2024-11-15 03:00:17 -08:00
Edmond ChuiandFacebook GitHub Bot 9a60038a40 fix r & d not working from Metro sometimes (#47624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47624

Changelog:
[iOS][Fixed] - fix `r` & `d` not working from Metro sometimes

While investigating these bugs, I've come across some cases where `r` (Reload) & `d` (Open Dev Menu) not working in Metro.

* T206141946 / [WP: Reconnecting dev tools does not work after restarting the app](https://fb.workplace.com/groups/rn.debugger.feedback/posts/1107620434125533)
* T206754760 / [WP: Can't launch DevTools from Metro sometimes](https://fb.workplace.com/groups/rn.debugger.feedback/posts/1112235073664069/)

This is because when we
1. Start app without Metro
1. Start Metro
1. Reload from Dev Menu (rage shake)

`RCTPackagerConnection` did not get notified about the change in bundle URL. It'd stay "listening" to the commands from the local bundle instead of Metro
.

Reviewed By: robhogan

Differential Revision: D65973309

fbshipit-source-id: a67a58b405bb78dfe56b814f2ec0bbee9e530e46
2024-11-14 20:58:10 -08:00
Alan LeeandFacebook GitHub Bot 74ed831a33 com.facebook.react.modules.intent.IntentModule.java (#47603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47603

Convert Java to Kotlin

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65874900

fbshipit-source-id: 19dbce0a6d822aae8c39860f45b90d064acebd74
2024-11-14 16:28:13 -08:00
Tim YungandFacebook GitHub Bot 1afde8bd25 RN: Improve usePressability Return Type (#47596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47596

Improves the Flow type of `usePressability` so that if the `config` argument is non-nullable, the return value is non-nullable. This helps reduce unnecessary null checks.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D65908791

fbshipit-source-id: 77de4391d8141d698a5689e617b692b337d01ae5
2024-11-14 14:07:01 -08:00
Sam ZhouandFacebook GitHub Bot bea6229a5d Deploy 0.253.0 to xplat (#47622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47622

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D65967280

fbshipit-source-id: 81ad422cc1d88682ab8ed5c0bf4d07df14295b62
2024-11-14 14:05:17 -08:00
Fabrizio CucciandFacebook GitHub Bot db3c1a47d5 Migrate com.facebook.react.views.text.ReactSwipeRefreshLayout to Kotlin (#47610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47610

As per title.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65661766

fbshipit-source-id: 3d56f94f90e7b70160e4ca7898aa0a49997ddb87
2024-11-14 09:27:40 -08:00
Thomas NardoneandFacebook GitHub Bot 184eb17261 ReactViewGroup - remove sHelperRect (#47588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47588

This is unnecessary - we can pass the params directly instead of first populating them in a Rect.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D65843834

fbshipit-source-id: 92bb3faa622bba81792fe92e357bc1667894d4ef
2024-11-14 09:16:43 -08:00
Samuel SuslaandFacebook GitHub Bot e5808f2af6 add nativeId to shadow node logs (#47594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47594

changelog: [internal]

helpful for debugging.

Reviewed By: christophpurrer

Differential Revision: D65895429

fbshipit-source-id: 51f361f00b070c2374232a375af1b17abb341a97
2024-11-14 08:10:47 -08:00
Rubén NorteandFacebook GitHub Bot 849c139a4c Initial implementation of Jest test runner for RN integration tests (#47558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47558

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D65661701

fbshipit-source-id: 0f0227debc769d0cebebc1989cbcfbbdd44dfc34
2024-11-14 06:20:47 -08:00
Rubén NorteandFacebook GitHub Bot fb32d93d17 Move ReactNativeTester to react-native repo (#47515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47515

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D65661699

fbshipit-source-id: ab28b4e04254987f5b2f5617d83b9731ee6ad95a
2024-11-14 06:20:47 -08:00
Tim YungandFacebook GitHub Bot 316170ce8d RN: Enable useInsertionEffectsForAnimations (#47595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47595

Enables the `useInsertionEffectsForAnimations` feature flag by default. This changes `useAnimatedProps` to enqueue updates to the `AnimatedNode` graph in `useInsertionEffect` instead of `useLayoutEffect`.

The main motivation for `useInsertionEffect` is to avoid unmounting `AnimatedNode` graphs when an `Activity` subtree becomes hidden.

Both `useInsertionEffect` and `useLayoutEffect` occur during the commit phase. Although they occur at different moments in the commit phase, the different is difficult to observe and unlikely to impact product code.

One observable impact is that with `useInsertionEffect`, animations can now be started from layout effects.

Changelog:
[General][Changed] - The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects.

Reviewed By: mdvacca

Differential Revision: D65906157

fbshipit-source-id: d09b2f1b76079eecafbed8c6f5d8ee4695a1f81c
2024-11-13 16:29:32 -08:00
sammy-SC (Meta Employee)andFacebook GitHub Bot 3a41086809 Update React Native shims to use export syntax (#31426) (#47551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47551

## Summary

I'm working to get the main `react-native` package parsable by modern
Flow tooling (both `flow-bundler`, `flow-api-translator`), and one
blocker is legacy `module.exports` syntax. This diff updates files which
are [synced to
`react-native`](https://github.com/facebook/react-native/tree/main/packages/react-native/Libraries/Renderer/shims)
from this repo.

## How did you test this change?

Files were pasted into `react-native-github` under fbsource, where Flow
validates .

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

Test Plan: Sandcastle tests

Reviewed By: sammy-SC

Differential Revision: D65672576

Pulled By: huntie

fbshipit-source-id: 3d1f2eee0a4872d6a167cbc10e9f022e20f2bdc3
2024-11-13 14:41:10 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 177bf4d043 feat: handle negative values in enums (#47452)
Summary:
This PR adds support for negative values in enums.

Currently when we try to use an enum with negative value:

```ts
enum MyEnum {
  ZERO = 0,
  POSITIVE = 1,
  NEGATIVE = -1,
}

export interface Spec extends TurboModule {
  useArg(arg: MyEnum): void;
}

export default TurboModuleRegistry.get<Spec>('Foo');
```

It will fail:

```
Enum values can not be mixed. They all must be either blank, number, or string values.
```

This is because negative values are parsed as `UnaryExpressions` which have `-` operator in front and value as argument.

With the new approach codegen properly generates enums with negative values.

## Changelog:

[GENERAL] [ADDED] - Codegen: Support negative values in enums

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

Test Plan: I've added tests to see if everything is working properly

Reviewed By: vzaidman

Differential Revision: D65887888

Pulled By: elicwhite

fbshipit-source-id: edb25f663dc58afa68c69cb84a47cfc67fc1f7e7
2024-11-13 12:20:16 -08:00
Zeya PengandFacebook GitHub Bot 08759121cd validate input before calling setSelection to restore selection range (#47577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47577

Changelog: [Android][Fixed] ensure setSelection in onAttachedToWindow is within text range

Reviewed By: javache

Differential Revision: D65824906

fbshipit-source-id: 3dc7d27bf4f9a10762f11fa4a0bcae8af13c7db7
2024-11-13 11:38:02 -08:00
Edmond ChuiandFacebook GitHub Bot 05367de5e6 Update debugger-frontend from ff343d8...b61aae3 (#47593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47593

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

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

Reviewed By: huntie

Differential Revision: D65894096

fbshipit-source-id: e2fd4bff7d643fc56abde2ddea0ef5fab91d2b4d
2024-11-13 11:27:38 -08:00
Pieter De BaetsandFacebook GitHub Bot 3da23f7093 Unbreak legacy ReactFontManager (#47585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47585

We have two classes named ReactFontManager and during the Kotlin migration this got mixed up.

Changelog: [Android][Fixed] Fixed crash in legacy ReactFontManager

Reviewed By: fabriziocucci

Differential Revision: D65877606

fbshipit-source-id: d9dc4f29045ad377adb216216334af5501c5546e
2024-11-13 09:29:35 -08:00
Mateo GuzmánandFacebook GitHub Bot 32931466ed feat(text-input): [iOS] inputAccessoryViewButtonLabel prop (#47441)
Summary:
Fixes https://github.com/facebook/react-native/issues/29244, also mentioned in https://github.com/facebook/react-native/issues/25009

As mentioned in the linked issues, the current return key label in the input accessory view is not localized. In the code, right now the texts are hardcoded (see: [RCTTextInputComponentView.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm#L552) and [RCTBaseTextInputView.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L694)). I could not find the historical reason for this, but doing some investigation there doesn't seem to be a way of getting the translated text into the code by using the existing props. (Ref: https://stackoverflow.com/a/58190342/5415299)

The solution: adding a new property `inputAccessoryViewButtonLabel` which can be used to overwrite these defaults non-translated values. The property is optional to avoid breaking changes.

The implementation works for both Fabric and Paper.

## Changelog:

[IOS] [ADDED] - TextInput `inputAccessoryViewButtonLabel` prop

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

Test Plan:
A new example has been added under the `TextInput` examples in the RNTester. See below:

<details>
<summary>Video demonstrating how the new prop behaves</summary>

https://github.com/user-attachments/assets/b15cb8b8-494a-4f41-b434-e33eeef5d267

</details>

Reviewed By: cipolleschi

Differential Revision: D65533493

Pulled By: javache

fbshipit-source-id: d80bf501ba3e38bf3b09833170780df45a26bb61
2024-11-13 06:44:23 -08:00
Eric RozellandFacebook GitHub Bot fc24171416 Revert "Extra log for case where availableHeight is undefined and sizing mode != max content (#1687)" (#47581)
Summary:
X-link: https://github.com/facebook/yoga/pull/1741

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

Reverting https://github.com/facebook/yoga/pull/1687 as it appears to regress Yoga performance anywhere from 10-33%.

## Changelog

[Internal]

Reviewed By: rshest

Differential Revision: D65863569

fbshipit-source-id: e6992e05dd59ba75548a5d633cb7f5c3fa99a6e4
2024-11-13 06:29:35 -08:00
Pieter De BaetsandFacebook GitHub Bot 9fa4845136 Change default for bridgeless-init related feature flags (#47567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47567

Changelog: [Android][Changed] Invocations to JS will now invoke their callbacks immediately if the instance is ready. Surface starts will not wait for the main thread to become available to dispatch the work in JS.

Reviewed By: rshest

Differential Revision: D65661888

fbshipit-source-id: c67802bd56fac6bc6c145b96d823274e2b97de69
2024-11-13 04:00:19 -08:00
Pieter De BaetsandFacebook GitHub Bot 663b5f9d19 Change feature flag default for initEagerTurboModulesOnNativeModulesQueueAndroid (#47566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47566

Changelog: [Android][Changed] TurboModules marked as requiring eager init will now be constructed on the mqt_native thread to increase concurrency in React Native init.

Reviewed By: rshest

Differential Revision: D65661887

fbshipit-source-id: c1863ea44771de5caedc2968a325abcc7022c792
2024-11-13 04:00:19 -08:00
David VaccaandFacebook GitHub Bot dc8c2f676e Annotate BridgeReactContext as VisibleForTesting (#47579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47579

BridgeReactContext is public only for testing. I'm annotating it with VisibileForTesting to make it explicit

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65705093

fbshipit-source-id: d4d7c4195926e2d0397e805b4c49b0710a82a7eb
2024-11-12 23:20:52 -08:00
Rubén NorteandFacebook GitHub Bot d3c5446a6e Clean up legacy feature flags for event loop (#47565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47565

Changelog: [internal]

We unified the feature flags for the event loop in https://github.com/facebook/react-native/pull/47084, but we left the legacy flags defined for temporary backwards compatibility.

We don't need that anymore, so we can clean them up.

Reviewed By: fabriziocucci

Differential Revision: D65606068

fbshipit-source-id: 403c278cef2afc8eddf07592d88cadc58765f660
2024-11-12 12:43:11 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f3b7c7c569 Add Changelog for 0.73.11 (#47574)
Summary:
Add changelog for 0.73.11

## Changelog:
[Internal] - Add Changelog for 0.73.11

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

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D65826153

Pulled By: cipolleschi

fbshipit-source-id: 9eb3bf6afbb1203296dc416d9abdcf83efcb28bc
2024-11-12 11:10:37 -08:00
Mateo GuzmánandFacebook GitHub Bot a0be88fd72 feat(image): [android] adding force-cache cache control option (#47426)
Summary:
This PR follows up on https://github.com/facebook/react-native/issues/47182 and https://github.com/facebook/react-native/issues/47348 by adding `force-cache`, the final missing option to align caching controls with the existing behavior on iOS.

Local caching behavior remains unchanged: if a cached image is available locally, it will be returned; otherwise, a network request will be made.

When an image request is sent over the network, the `force-cache` option sent from the sent fJS side will now use the `okhttp3.CacheControl.FORCE_CACHE` directive.

## Changelog:

[ANDROID] [ADDED] - Image `force-cache` caching control option

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

Test Plan:
New example added to the RNTester under the cache policy examples. Then inspecting that the cache control is set correctly before sending it in the `okhttp3.Request` builder.

```kt
FLog.w("ReactNative", "fetching uri: %s, with cacheControl: %s", uri, cacheControlBuilder.build().toString())
// fetching uri: https:...png?cacheBust=force-cache, with cacheControl: no-store, max-stale=2147483647, only-if-cached
```

This case was a bit more tricky to test in terms of e2e as it would involve some caching in the server as well, I'm open to suggestions to make this more complete.

Reviewed By: javache

Differential Revision: D65490360

Pulled By: Abbondanzo

fbshipit-source-id: f807a9793f85caea39c59a370d057b9a1d450a78
2024-11-12 10:44:09 -08:00
BIKI DASandFacebook GitHub Bot c69e330324 Dispatch onMomentumScrollEnd after programmatic scrolling (#45187)
Summary:
in iOS on a scroll generated programatically, the `onMomentScrollEnd` is fired, though in case of android the same does not happen, this PR tries to implement the same behaviour for android as well, while diving through the code it seems we have two extra `onMomentumScrollEnd` events. Only one event should be fired.

**iOS Behaviour on Programmatic Scroll**

https://github.com/facebook/react-native/assets/72331432/fb8f16b1-4db6-49fe-83a1-a1c40bf49705

https://github.com/facebook/react-native/assets/72331432/9842f522-b616-4fb3-b197-40817f4aa9cb

**Android Behaviour on Programmatic Scroll**

https://github.com/facebook/react-native/assets/72331432/c24d3f06-4e2a-4bef-81af-d9227a3b1a4a

https://github.com/facebook/react-native/assets/72331432/d4917843-730b-4bd7-90d9-33efb0f471a7

If closely observed we can see the `onMomentumScrollEnd` does not gets called in Android unlike to iOS.

## Changelog:

[Android][Fixed] - Dispatch onMomentumScrollEnd after programmatic scrolling

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

Test Plan:
i have added updates to the FlatList example and ScrollViewSimple
here is a ScreenRecording of `onMomentumScrollEnd` firing in android after the code changes

https://github.com/facebook/react-native/assets/72331432/f036d1a5-6ebf-47ba-becd-4db98a406b15

https://github.com/facebook/react-native/assets/72331432/8c788c39-3392-4822-99c5-6e320398714b

Reviewed By: javache

Differential Revision: D65539724

Pulled By: Abbondanzo

fbshipit-source-id: f3a5527ac5979f5ec0c6ae18d80fdc20c9c9c14b
2024-11-12 10:37:16 -08:00
Fabrizio CucciandFacebook GitHub Bot 6f59627903 Migrate com.facebook.react.views.text.ReactRawTextManager to Kotlin (#47571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47571

As per title.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65600851

fbshipit-source-id: cd88beca23f5d7b1036354457e67d0d530e62a95
2024-11-12 08:30:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot fe1057afcd Let lib maintainer be explicit with componentProvider mapping (#47520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47520

Right now, when a 3p library needs to register a component in the component system, we have to crawl the library to try and get the mappng, best effort.

With this approach, we are enriching the `codegenConfig` property to allow library developers to define the mapping themselves.

For example:
```json
//...
"codegenConfig": {
    //..
    "ios": {
      "componentProvider": {
        "RNTMyNativeView": "RNTMyNativeViewComponentView"
      }
    }
  },
```
means that the JS component `RNTMyNativeView` will be mapped to the `RNTMyNativeViewComponentView` class.

This also work for local apps, and it warns the users about what libraries are using the deprecated approach, so they can open an issue or a PR to those libraries.

## Changelog:
[iOS][Added] - Allow 3p developers to specify the association between components and classes in Fabric

Reviewed By: dmytrorykun

Differential Revision: D65666061

fbshipit-source-id: 692e753635873ff9260e131d2d18ed226b2378c2
2024-11-12 07:38:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8becc2514d Generate RCTThirdPartyComponentProvider (#47518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47518

This change reintroduce the generation of the `RCTThirdPartyComponentProvider` but in the right place and with the right patterns.

1. We are generating it in the user space, not in the node_modules (fixes the circular dependency)
2. We are not using weak function signature that have to be implicitly linked to some symbols found during compilation

The change needs to crawl the folder to retrieve the information it needs. We need to implement it this way not to be breaking with respect of the current implementation.

The assumption is that components have a function in their `.mm` file with this shape:
```objc
Class<RCTComponentViewProtocol> <componentName>Cls(void)
{
  return <ComponentViewClass>.class;
}
```
I verified on GH that all the libraries out there follow this pattern.

A better approach will let library owner to specify the association of `componentName, componentClass` in the `codegenConfig`.

We will implement that as the next step and we will support both for some versions for backward compatibility.

## Changelog
[iOS][Changed] - Change how components automatically register

Reviewed By: dmytrorykun

Differential Revision: D65614347

fbshipit-source-id: a378b8bc31c1ab3d49552f2f6a4c86c3b578746b
2024-11-12 07:38:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 60b9d3d89e Stop generating RCTThirdPartyLibraryComponentProvider (#47517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47517

The `RCTThirdPartyLibraryComponentProvider` has been introduced to automate the component registration of third party libraries in the apps. However, it has some serious flaws:

* It is generated in the React/Fabric folder, which means that it is generated in node_modules
* It is generated when the user installs the components in the app, which means that we can't prebuild and redistribute React Native as a binary
* it does not work with Frameworks and dynamic linking: in this scenarion, Fabric must build in isolation and if there are third party libraries involved, the lookup of the `xxxCls` function will fail

This change removes the generation of the `RCTThirdPartyLibraryComponentProvider`. In the next diffs we will implement a different mechanism to register components

## Changelog
[iOS][Changed] - Stop generating the RCTThirdPartyLibraryComponentProvider

Reviewed By: dmytrorykun

Differential Revision: D65601939

fbshipit-source-id: 9cc8c46102827d124b93b8aa6705b5e6014695c1
2024-11-12 07:38:03 -08:00
danandFacebook GitHub Bot 62a4e46551 Fix blog post link (#47560)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47560

Reviewed By: elicwhite

Differential Revision: D65790732

Pulled By: rickhanlonii

fbshipit-source-id: 7156f85c7525cec31aa80fb0757d853d517bbef8
2024-11-12 07:19:57 -08:00
Alex HuntandFacebook GitHub Bot 1e5286866a Configure unstable-react-profiling build mode (#47028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47028

This is a mostly internal diff enabling us to selectively enable Fusebox in release builds (experimental).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64110061

fbshipit-source-id: a5f5d59d7a512bb47603cf83fd60f2c2202c22ab
2024-11-12 06:55:53 -08:00
Fabrizio CucciandFacebook GitHub Bot a78a5af657 Migrate com.facebook.react.views.text.ReactTextUpdate to Kotlin (#47553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47553

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65598615

fbshipit-source-id: c4f0e137e3ff350b263f5ce11dd61b78a5be9894
2024-11-12 05:15:32 -08:00
Eli FrontandFacebook GitHub Bot 594c9d9a46 Add void prototype to RCTAppearance.h (#47564)
Summary:
Resolve warning on ios build:
```
.../ios/Pods/Headers/Public/React-Core/React/RCTAppearance.h:16:60 A function declaration without a prototype is deprecated in all versions of C
```

## 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] - Resolve deprecated function prototype warning in RCTAppearance.h

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

Test Plan:
Jest Result (`yarn test`):
```
Test Suites: 234 passed, 234 total
Tests:       2 skipped, 4899 passed, 4901 total
Snapshots:   1687 passed, 1687 total
Time:        46.387 s
Ran all test suites.
```

Reviewed By: cipolleschi

Differential Revision: D65816584

Pulled By: javache

fbshipit-source-id: 212021c39dfde7e638752940e67a9f964d2194ab
2024-11-12 05:15:23 -08:00
zhongwuzwandFacebook GitHub Bot 8cbc7c3357 Fixes rn-tester bundled images examples (#44482)
Summary:
Fixes rn-tester bundled images example

Before:
![image](https://github.com/facebook/react-native/assets/5061845/d33ae01b-f1de-4918-882e-b01be7e1df6f)
After:
![image](https://github.com/facebook/react-native/assets/5061845/19ff2702-e7b3-4cb0-b48b-46c270b1114d)

## Changelog:

[IOS] [FIXED] - Fixes rn-tester bundled images examples

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

Test Plan: N/L

Reviewed By: dmytrorykun

Differential Revision: D65757405

Pulled By: cipolleschi

fbshipit-source-id: 29a82acacee58d803f2bfea93444adae6aee1b79
2024-11-12 04:18:17 -08:00
Ramanpreet NaraandFacebook GitHub Bot 16eb53befa Integrate DevSupportManager into activity lifecycle (#47531)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47531

When the activity is paused, or destroyed, we should disable the devsupportmanager. (This performs cleanup).

When the activity is resumed, we should re-enable devsupportmanager. (This performs re-initialization).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D65689053

fbshipit-source-id: 99de0906b8cdc84f56b4d334ac0eeecc7b436dd5
2024-11-11 13:24:49 -08:00
Ramanpreet NaraandFacebook GitHub Bot a2959a915c earlyjs: Reset error handler state after js pipeline fails (#47528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47528

After the js pipeline fails to handle the error, reset the hasHandledFatalError var.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D65678387

fbshipit-source-id: ac7cd4724954ea78bf33542e208c5f5d3dba5383
2024-11-11 13:24:49 -08:00
Ramanpreet NaraandFacebook GitHub Bot ca7b9e9509 earlyjs: Extend C++ pipeline for non-js errors (#47529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47529

RuntimeExecutor, RuntimeScheduler, etc. can execute arbitrary c++ on the javascript thread.

If that c++ throws a non-jsi::JSError, it will bypass the js error handler (and start tearing down the react instance 😱).

Let's have the js error handler manage all exceptions raised while native is calling into js. This is more sane.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D64626610

fbshipit-source-id: 40132f24b4e2737ae3f055fbd09153111404e5bf
2024-11-11 13:24:49 -08:00
Mateo GuzmánandFacebook GitHub Bot 998ab262ea fix(rn-tester): pixel ratio example inputs not fully visible in dark mode (#47526)
Summary:
Found this small dark mode issue when navigating into the `PixelRatioExamples`

## Changelog:

[INTERNAL] [FIXED] - Fixing dark mode inputs for `PixelRatio` examples

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

Test Plan:
| Before  | After |
  | ---------- | ---------- |
  | ![Screenshot_1731090926](https://github.com/user-attachments/assets/9e20c44e-0152-4760-a436-3272b452a6a2) | ![Screenshot_1731090971](https://github.com/user-attachments/assets/17d038a8-b383-4c96-a30d-c7d213cc6f97) |

Reviewed By: lunaleaps

Differential Revision: D65735837

Pulled By: Abbondanzo

fbshipit-source-id: 5b0dc6d0ae45778723a92581cef00ce7ec4c56f1
2024-11-11 10:58:56 -08:00
Peter AbbondanzoandFacebook GitHub Bot 5b609cca09 Fix onMomentumScrollBegin not dispatching from animations (#47468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47468

Across our scroll view implementations on iOS, we fire `onMomentumScrollEnd` whenever the scroll view finishes decelerating, whether it comes from a user's touch or call to `setContentOffset` with animations. But we omit dispatching the `onMomentumScrollBegin` event in the latter cases.

This change updates both old and new architecture to dispatch `onMomentumScrollBegin` when a view-command-driven scroll occurs with animation, like `scrollTo` or `scrollToEnd`.

Changelog:
[iOS][Fixed] - Fixed `onMomentumScrollBegin` event not firing on command-driven scroll events

Reviewed By: javache

Differential Revision: D65556000

fbshipit-source-id: bc4b778c63d8a032e1d8e00b9d4d5f83a5d651d6
2024-11-11 10:12:33 -08:00
Mateo GuzmánandFacebook GitHub Bot 6295b81e79 test(image): [android] adding missing image resize mode test cases (#47527)
Summary:
Follow up from https://github.com/facebook/react-native/issues/47433, adding some missing scenarios in the unit tests for the image component in Android.

## Changelog:

[INTERNAL] [ADDED] - Improving Android `ImageResizeMode` unit tests

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: fabriziocucci

Differential Revision: D65735794

Pulled By: Abbondanzo

fbshipit-source-id: a420274c78d9eadf0439870cfaae4d16247c6034
2024-11-11 07:38:59 -08:00
oddlyspacedandFacebook GitHub Bot e70202e606 feat(Android): add support for detecting grayscale mode enabled on android (#47497)
Summary:
On android the isGrayScaleEnabled method of AccessibilityInfo always returns false due to missing implementation. This PR fills the gap by providing the native module logic for checking grayscale mode.

## Changelog:
- Added native module code to check for grayscale mode on android
- Updated js accessibility info module  to return the correct promise instead of default false for isGrayScaleEnabled()
- Moved the test for isGrayScaleEnabled() out of ios scope to common Android and iOS scope

[ANDROID] [ADDED] - logic to check for grayscale mode on android

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

Test Plan:
Tested on :
- Google Pixel 7 Pro (Android 14)
- OnePlus 12 (Android 14)
- Pixel 6 (Android 15)

Reviewed By: cortinico

Differential Revision: D65662583

Pulled By: javache

fbshipit-source-id: 39f9ce37c9375b5380257847395393045eedbadc
2024-11-11 07:38:21 -08:00
Pieter De BaetsandFacebook GitHub Bot 2c31fe99e1 Use rval for AttributedString::Fragment changes (#47494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47494

Changelog: [General][Changed] AttributedString `appendFragment` and `prependFragment` take an rval instead of a const ref; append/prependAttributedString have been removed

Reviewed By: mdvacca

Differential Revision: D65603864

fbshipit-source-id: 1160a9e2064470f826bea66736b4fce13caa3a73
2024-11-11 07:35:20 -08:00
David VaccaandFacebook GitHub Bot 3a4493f4c4 Migrate UnobservedErrorNotifier to kotlin (#47538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47538

Migrate UnobservedErrorNotifier to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738328

fbshipit-source-id: 651caecfbbe01d52aeac371f4427665c34b85107
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot 94839ed174 Migrate UnobservedTaskException to kotlin (#47542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47542

Migrate UnobservedTaskException to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738327

fbshipit-source-id: 251f8ee55497328212ce3facab7a4686fa1a29c8
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot 4f55161132 Internalize TaskCompletionSource class (#47543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47543

TaskCompletionSource is public but it shouldn't, in this diff I'm making it intenral

changelog: [Android][Breaking] Reduce visibility of TaskCompletionSource class

Reviewed By: javache

Differential Revision: D65738324

fbshipit-source-id: 61db35a408162c53398b20e45a52f3eb46de1eae
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot a4eb5794cc Migrate TaskCompletionSource to kotlin (#47541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47541

Migrate TaskCompletionSource to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738330

fbshipit-source-id: 34963ae4a95dbea2fcebbdaa33436e22a7ca4751
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot 7b21b9e69c Internalize Continuation (#47540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47540

Continuation is only used inside RN, we should make it internal

changelog: [Android][Changed] Reduce visibility of Continuation to internal, although this interface wasn't being exposed in any public API

Reviewed By: javache

Differential Revision: D65738329

fbshipit-source-id: 6fb1b9e9a253eafad0f6eb1e4c1363d6254846da
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot b8337ebf97 Migrate Continuation to kotlin (#47537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47537

Migrate Continuation interface to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738326

fbshipit-source-id: 1a119f6d349101951dc528583f3dbaf5441da91e
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot 17b69795c3 Migrate ExecutorException to kotlin (#47539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47539

Migrate ExecutorException to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738325

fbshipit-source-id: 0ae6adedf0f80d57426ebc749fd77c31942b3b47
2024-11-11 07:03:00 -08:00
David VaccaandFacebook GitHub Bot 443bc32dc4 Update KDocs for ReactHost.destroy() methods (#47536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47536

I'm updating KDoc for ReactHost.destroy() methods to warn about potential deadlock when waiting for completion

changelog: [Android][Changed] update documentation for ReactHost.destroy() APIs

Reviewed By: shwanton

Differential Revision: D65734396

fbshipit-source-id: b7924cafce2fd58e2633736f922d303c61f6ad14
2024-11-11 07:03:00 -08:00
Samuel SuslaandFacebook GitHub Bot 685facfd53 fix race condition in EventBeat (#47548)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47548

changelog: [internal]

This race condition only shows itself with flag `useOptimizedEventBatchingOnAndroid`

# Problem
EventBeat assumes method `induce` will be called repeatedly on every UI tick. This is true for iOS and existing implementation of event beat on Android. The first early exist inside of `induce` method is built with this assumption.

`useOptimizedEventBatchingOnAndroid` on Android changes this. `induce` will only be called after FabricUIManager.onRequestEventBeat is invoked and then it will stop. For one `FabricUIManager.onRequestEventBeat` call, `EventBeat::induce` is called once. And there is a chance for race condition.

Here is a simplified implementation of `induce`. This method may be called many times in sequence. The caller will set [isRequested_](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/core/EventBeat.cpp#L25) and then invoke [FabricUIManager.onRequestEventBeat](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/jni/react/fabric/AndroidEventBeat.cpp#L43). Notice how `FabricUIManager.onRequestEventBeat` is debounced if `isRequested_` flag is true.

```
void EventBeat::induce() const {
  if (!isRequested_ || isBeatCallbackScheduled_) {
   // isRequested_ is not set to false in case isBeatCallbackScheduled_) is true.
    return;
  }

  isRequested_ = false;
  isBeatCallbackScheduled_ = true;

  auto beat = std::function<void(jsi::Runtime&)>(
    // on JS queue
    isBeatCallbackScheduled_ = false;
    // beatCallback_(runtime)
  }

  runtimeScheduler_.scheduleWork(std::move(beat));
}
```

This can get into a state where `isRequested_` is not reset back to false even though `EventBeat::induce` is called when `isBeatCallbackScheduled_` is true.

`AndroidEventBeat::request` -> `isRequested_` is set to true -> `FabricUIManager::onRequestEventBeat` -> `EventBeat::induce` -> `isRequested_` is set to false -> `isBeatCallbackScheduled_` is set to true -> `AndroidEventBeat::request` -> `FabricUIManager::onRequestEventBeat` -> `EventBeat::induce` (early exit because `isBeatCallbackScheduled_` is true) -> `beat` is executed on the JS thread.

From this point on, subsequent calls to `AndroidEventBeat::request` are always debounced because flag `isRequested_` is true.

Any subsequent event on Android will end up calling `EventBeat::induce` and the mechanism gets unstuck.

# The fix

The fix is simple, any time `EventBeat::induce` is called, make sure `request_` flag is set to false. This then satisfied the expectation of `useOptimizedEventBatchingOnAndroid` optimisation.

Reviewed By: rubennorte

Differential Revision: D65566258

fbshipit-source-id: 5f15da8f5cb722b329f9f72b9ddca8e2cac04144
2024-11-11 07:01:53 -08:00
Rubén NorteandFacebook GitHub Bot d7cb6d95a8 Clean up forceBatchingMountItemsOnAndroid feature flag (#47546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47546

Changelog: [internal]

Cleaning up the feature flag as we've tested it's safe to land.

Reviewed By: javache

Differential Revision: D65749504

fbshipit-source-id: 964db7e9c31ebb8d7e4f7e2703a3040709c6ed6e
2024-11-11 06:05:28 -08:00
Samuel SuslaandFacebook GitHub Bot 6c577e96db remove unused import and declaration in EventQueue (#47545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47545

changelog: [internal]

Reviewed By: javache

Differential Revision: D65663098

fbshipit-source-id: b0a848de9ef01e2915a945a58a08e2e9c666a116
2024-11-11 05:27:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 97a4234b6e Fix Typo and skip generation of app-specific component registration (#47547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47547

In [#47176](https://github.com/facebook/react-native/pull/47176) we disabled the generation of the component registration for app specific components as it was creating a circular dependency between the app and React Native.

However, we made a couple of typos that make it not work as expected and users picked up those typos soon.

This change fixes them for good.

## Changelog
[iOS][Fixed] - Properly stop generating component registration for components defined in app.

Reviewed By: blakef

Differential Revision: D65750433

fbshipit-source-id: 1a879c5be014905558b9fd05e6f16ac36b784ed6
2024-11-11 04:55:23 -08:00
Fabrizio CucciandFacebook GitHub Bot 9db28834e2 Migrate com.facebook.react.views.text.ReactTextViewManagerCallback to Kotlin (#47516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47516

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65598258

fbshipit-source-id: 0ef7e9a4aefcb021bc55698eaf43c2a69bbb4f63
2024-11-11 02:49:09 -08:00
Pieter De BaetsandFacebook GitHub Bot a9a1c86a92 Convert com.facebook.react.bridge.ReactSoftExceptionLogger to Kotlin (#47513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47513

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65602362

fbshipit-source-id: 95e63bd04480c1c8a364fcf93d24f71f94057d65
2024-11-10 14:08:35 -08:00
David VaccaandFacebook GitHub Bot b60e36390c Introduce ReactHost.destroy() method to notifies when the React instance is destroyed (#47534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47534

This diff is introducing a new method to destroy React instance that allows the caller to be notified when the destroy finishes

This is necessary for apps to act upon destroy of the react instance

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D65721107

fbshipit-source-id: 2d3d9755db38461ba381b86c72df5869c542379b
2024-11-10 09:30:58 -08:00
Yedidya FeldblumandFacebook GitHub Bot ae43411008 let Value be nothrow-move-constructible (#47422)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47422

Reviewed By: Gownta

Differential Revision: D65273055

fbshipit-source-id: 6fda316137b1f797b8b4041521555e46e1098e7c
2024-11-10 02:42:41 -08:00
D NandFacebook GitHub Bot 44d619414c fix: Remove BackHandler.removeEventListener (#45892)
Summary:
All `removeEventListener` methods was removed  https://github.com/facebook/react-native/commit/2596b2f6954362d2cd34a1be870810ab90cbb916 perviously  but seems a `BackHandler` was missed

This can be a breaking change for some third-party modules.

**Migration**: Use `remove` on the EventSubscription from `addEventListener`:

```diff
useEffect(()=>{
+  const subscription = NativeModule.removeListener(name, listener);
+  return ()=>subscription.remove();
},[])
```

## Changelog:

[GENERAL] [REMOVED] - Remove `BackHandler.removeEventListener`

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

Test Plan: ...

Reviewed By: huntie

Differential Revision: D65663591

Pulled By: javache

fbshipit-source-id: 01b804cd6ec77ea4916a0ced7fee551d045f1684
2024-11-09 15:56:44 -08:00
David VaccaandFacebook GitHub Bot 3e27ef1f6e Deprecate CatalystInstance in old architecture (#47383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47383

CatalystInstance is deprecated and will be removed in new architecture

changelog: [Android][Changed] Deprecate CatalystInstance in old architecture

Reviewed By: cortinico

Differential Revision: D65430643

fbshipit-source-id: 96ba91c45760ead8155f9f28b6fad523be75929e
2024-11-08 20:40:18 -08:00
Thomas NardoneandFacebook GitHub Bot 7794d7af43 Add TextTransform KTX (#47525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47525

This API is awkward for nullsafe code.  Adding an extension allows Kotlin code to use `applyTextTransform()` on either nullable or non-null strings:
```
val a: String = string.applyTextTransform(...)
val b: String? = nullableString?.applyTextTransform(...)
```
Changelog:
[Android][Added] TextTransform ktx

Reviewed By: javache

Differential Revision: D65618709

fbshipit-source-id: 28a0fe61a0eaf27aa9677af39d932982f3b694b2
2024-11-08 16:14:37 -08:00
David VaccaandFacebook GitHub Bot 34c157f6b3 Undeprecate UIManagerProvider in the new architecture (#47386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47386

UIManagerProvider is actually useful to decouple client code from the FabricUIManagerClass
that's why I'm removing the DeprecatedInNewArchitecture annotation

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65430644

fbshipit-source-id: 46e95b9e40e99dd9ec6df9f2d51b1fa3d3d77d27
2024-11-08 16:13:17 -08:00
Sam ZhouandFacebook GitHub Bot cd9ece0553 Pre-suppress errors ahead of turn on partial react 19 ref-as-prop support
Summary:
`react.ref_as_prop=experimental.partial_support` will expose errors where a ref prop is passed to a function component without ref prop. This diff pre-suppresses the newly exposed errors.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D65686695

fbshipit-source-id: f241cc40f3ac414a2960dec60d9ba4633e5f93c0
2024-11-08 13:52:27 -08:00
Alex Taylor (alta)andFacebook GitHub Bot 84bfeec9b8 Deploy 0.252.0 to xplat + www (#47523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47523

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D65666666

fbshipit-source-id: 19f75611805777115febfca79d0945d31b7ea522
2024-11-08 12:27:49 -08:00
Pieter De BaetsandFacebook GitHub Bot 2f7957f2fd Merge RawText sequences (#47278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47278

When we have multiple spans of text inside a <Text> element, React will emit these as separate RawText ShadowNodes. RawText shadow nodes cannot have any properties beyond the text they contain, yet our current AttributedText logic will generate a separate span for each and duplicate all the relevant properties.

This can be particularly inefficient when JSX is used to interpolate strings, e.g. `<Text styles={styles.text}>Example {i}/{count}</Text>` results in 4 raw text elements with duplicated properties.

Changelog: [General][Changed] Improved AttributedText generation for raw text nodes.

Reviewed By: NickGerleman

Differential Revision: D65134912

fbshipit-source-id: dba4296ebe9987e989760cdee66f1e076fbb7a98
2024-11-08 11:32:51 -08:00
Jakub PiaseckiandFacebook GitHub Bot ee7b4e2763 Fix timers in headless tasks on bridgeless mode (#47496)
Summary:
Fixes https://github.com/facebook/react-native/issues/47495

`JavaTimerManager` is being registered to receive headless tasks events in the [`TimingModule`](https://github.com/facebook/react-native/blob/0ee963ea65bcc88122044d51027511e611bde584/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt#L28-L29). This module is not used on bridgeless: [1](https://github.com/facebook/react-native/blob/0ee963ea65bcc88122044d51027511e611bde584/packages/react-native/Libraries/Core/setUpTimers.js#L44-L61), [2](https://github.com/facebook/react-native/blob/0ee963ea65bcc88122044d51027511e611bde584/packages/react-native/Libraries/Core/setUpTimers.js#L123-L132) and since it's loaded lazily, the event listener is never registered.

This PR moves registration to the constructor of `JavaTimerManager` and deregistration to the `onInstanceDestroy` method. This way the event listener is always registered when an instance of the timer manager exists.

## Changelog:

[ANDROID] [FIXED] - Fix timers in headless tasks on bridgeless mode

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

Test Plan: See the reproducer from the issue

Reviewed By: javache

Differential Revision: D65615601

Pulled By: alanleedev

fbshipit-source-id: 6e1d36f8783e813065f79730a928b99c3e385718
2024-11-08 11:07:26 -08:00
Pieter De BaetsandFacebook GitHub Bot e3c3a0c8a7 Migrate NativeModuleRegistryBuilder to Kotlin (#47508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47508

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D60037204

fbshipit-source-id: 2b405e492520e075b83a075009d25fb7b7fa8925
2024-11-08 10:37:37 -08:00
Pieter De BaetsandFacebook GitHub Bot 2ec547ad28 Remove concurrentRoot from initialProps (#47512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47512

As can be seen in `renderApplication`, `useConcurrentRoot` is no longer used to decide whether to run the application in concurrent mode, as we default all Fabric-users to concurrent root.

Changelog: [General][Removed] Removed type for useConcurrentRoot from AppRegistry, as it was already ignored

Reviewed By: sammy-SC, fabriziocucci

Differential Revision: D65660681

fbshipit-source-id: c99e5ae14d515015709908ed21a854c780f628e0
2024-11-08 10:26:50 -08:00
Tim YungandFacebook GitHub Bot 090501d26d RN: Enable scheduleAnimatedEndCallbackInMicrotask (#47503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47503

Enables the `scheduleAnimatedEndCallbackInMicrotask` feature flag that was introduced in https://github.com/facebook/react-native/pull/46714.

Changelog:
[General][Changed] - Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.

Reviewed By: javache

Differential Revision: D65645981

fbshipit-source-id: ac159208b7c1df60549baa52704bb0e704da0acf
2024-11-08 10:22:12 -08:00
Pieter De BaetsandFacebook GitHub Bot 105f5f6000 Convert exceptions in com.facebook.react.bridge to Kotlin (#47493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47493

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65597240

fbshipit-source-id: 8014c756d7730bea617f6d27eb1e56d75c9156cf
2024-11-08 09:31:12 -08:00
Alex HuntandFacebook GitHub Bot 63ec67c591 Exclude Libraries/ReactPrivate/ from public-api-test
Summary:
As titled. This API is legacy / Meta-only.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65666574

fbshipit-source-id: f9700486aec0306b305910bff14ae7f3df3fab7f
2024-11-08 09:16:21 -08:00
Sam ZhouandFacebook GitHub Bot f5d7df6672 Pre-suppress errors to prepare for flow typing changes
Summary: Changelog: [Internal]

Reviewed By: cyan33

Differential Revision: D65633359

fbshipit-source-id: 7aaee2cab2d61b61eb5e1317d6b4ce58b6191fb8
2024-11-08 08:39:06 -08:00
Nicola CortiandFacebook GitHub Bot 7e268c9d52 Revert React 19RC to React 18.3.1 (#47380)
Summary:
While we're waiting for 19 stable, let's bring main back to 18.3.1 ahead of the 0.77 branch cut. We'll land this change just after 19 stable lands.

This is a cherry pick of b93b378fa0 which landed in 0.76 already

bypass-github-export-checks

## Changelog:

[INTERNAL] - Revert React 19RC to React 18.3.1

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D65430775

Pulled By: cortinico

fbshipit-source-id: f0f211754c8ffe5d037fd299e4de52c29d1d7913
2024-11-08 08:27:37 -08:00
Pieter De BaetsandFacebook GitHub Bot 8cb2ad6725 Improve robolectric shadows (#47460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47460

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65538979

fbshipit-source-id: 7a0b0f701968a9af9197246e6e89e0ccfd55653d
2024-11-08 06:14:13 -08:00
Fabrizio CucciandFacebook GitHub Bot 697a422bf5 Migrate com.facebook.react.views.text.FontMetricsUtil to Kotlin (#47510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47510

As per title.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65598073

fbshipit-source-id: 401750f2df9bd434a8310f107f46a686bfa6601c
2024-11-08 06:10:22 -08:00
Nicola CortiandFacebook GitHub Bot e64513bf4e RNGP - Do not attempt to substring to 1024 while logging. (#47509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47509

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

Changelog:
[Android] [Fixed] - RNGP - Do not attempt to substring to 1024 while logging

Reviewed By: javache

Differential Revision: D65659586

fbshipit-source-id: 8fa16131cea96b8b6aa9c0224c7b990a4f51175f
2024-11-08 04:57:15 -08:00
Pieter De BaetsandFacebook GitHub Bot 3c32da5bfe Convert com.facebook.react.bridge.NativeArray to Kotlin (#47456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47456

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65486257

fbshipit-source-id: d18d38fd7e605918d79e370dda7df51abac2f23c
2024-11-08 04:31:46 -08:00
Pieter De BaetsandFacebook GitHub Bot fd72537202 Convert com.facebook.react.bridge.JavaOnlyArray to Kotlin (#47424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47424

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65479614

fbshipit-source-id: d2ab86eb0e8c68a5733c602652b4b8dccc09a0a1
2024-11-08 04:31:46 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b32335c299 Only build ios in check nightlies (#47506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47506

The Check nightlies job prepare a new nightly app with additional libraries and on iOS it builds with `yarn ios`.

The command tries to launch the app on the simulator which sometimes fails and this can make the jobs keep running for hours.

This change make sure that we only build the app

## Changelog:
[Internal] - Only build iOS in CI for Check Nightlies

Reviewed By: blakef

Differential Revision: D65656812

fbshipit-source-id: 14db3738f33f8024c9e99fe206b170209154bac7
2024-11-08 04:28:32 -08:00
Fabrizio CucciandFacebook GitHub Bot 12180ca153 Migrate com.facebook.react.views.text.ReactTypefaceUtils to Kotlin (#47505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47505

As per title.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65596132

fbshipit-source-id: d08aea48ff293cc7f20ebc40a1d289dcb8158dcb
2024-11-08 04:03:46 -08:00
Tim YungandFacebook GitHub Bot f0ffcd4f5d RN: Enable enableAnimatedAllowlist and enableAnimatedPropsMemo (#47502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47502

Enables the two following feature flags:

- `enableAnimatedAllowlist`
- `enableAnimatedPropsMemo`

The former enables the use of an experimental optimization to provide `unstable_createAnimatedComponentWithAllowlist` and `useAnimatedProps` an allowlist of props that reduces the set of props iterated over by to find props with `AnimatedNode` (e.g. `Animated.Value`) instance values.

The latter enables improved memoization logic in `Animated` so that its intenal state is invalidated less frequently, reducing the cost of updating `Animated` components.

Changelog:
[General][Changed] - Optimized the performance of updating `Animated` components.

Reviewed By: rozele

Differential Revision: D65645985

fbshipit-source-id: 85f9e53072f09a59589d76d0c096f4cedd17bb4b
2024-11-07 23:43:30 -08:00
Joe VilchesandFacebook GitHub Bot cbab004eb9 Remove position type override on scroll view sticky headers (#47498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47498

I am trying to help someone with creating a sticky header on a scrollview, specifically one that floats on the side of the scrollview instead of the top Currently we can't really do that, since utilizing `position: absolute` to layout this properly will get overriden by the header styles changed in this diff

This was only added since static was the default and we needed to apply zIndex. With proper static implementation that is no longer the case, so I think it makes sense to remove this to support this use case.

Changelog: [General] [Breaking] - `position` of sticky headers on `ScrollView` will now be taken into account

Reviewed By: rozele

Differential Revision: D65626544

fbshipit-source-id: 8d650ca7654918e692435935e7c1094c412fd9f6
2024-11-07 16:34:31 -08:00
Arushi KesarwaniandFacebook GitHub Bot 846c4b1ea2 Reducing visibility of ImageStoreManager (#47443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47443

As part of sustainability week effort for switching to internal here:

https://fb.workplace.com/groups/251759413609061/permalink/872342228217440/

Reducing visibility of ImageStoreManager from public to internal

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

Reviewed By: javache

Differential Revision: D65520953

fbshipit-source-id: 0207be6a5e0b92dbbaee534735fc829e9202727d
2024-11-07 15:32:43 -08:00
Thomas NardoneandFacebook GitHub Bot d02da992a4 Convert + Internalize SwipeRefreshLayoutManager (#47470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47470

Convert to Kotlin and formalize it being an internal class (some methods were already `protected` in Java)

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

Reviewed By: cortinico

Differential Revision: D65481861

fbshipit-source-id: afc5c624373fbcd3ca2d28b2834d2682de672997
2024-11-07 11:39:35 -08:00
Ramanpreet NaraandFacebook GitHub Bot 8b053a4fca Implement always available js error handling (#47466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47466

Now, when the useAlwaysAvailableJSErrorHandling feature flag is true, React Native will use the earlyjs c++ error reporting pipeline for handling all javascript errors!

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D64715159

fbshipit-source-id: 597a5278eb792f87dca10e06fa9816b3a8c47b84
2024-11-07 11:22:57 -08:00
Fabrizio CucciandFacebook GitHub Bot 791afd3209 Migrate com.facebook.react.views.text.ReactFontManager to Kotlin (#47488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47488

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65594248

fbshipit-source-id: 5a21baefb768b1c6f8ec0c33158812d1de6113d5
2024-11-07 10:23:27 -08:00
Pieter De BaetsandFacebook GitHub Bot bcdf6ad1af Convert com.facebook.react.bridge.JavaOnlyMap to Kotlin (#47479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47479

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65595979

fbshipit-source-id: be8217ef1fd9f59af57a1e100a4d9e86b66d8027
2024-11-07 10:16:21 -08:00
Tim YungandFacebook GitHub Bot bf31c8f077 RN: Feature Flag to Disable InteractionManager (#47475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47475

Creates a feature flag to evalute the impact of disabling `InteractionManager` and replacing its scheduling behavior with `setImmediate`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D65577455

fbshipit-source-id: c0dc2b4d062eff4929ef37c5e217fd194addd790
2024-11-07 09:29:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0ee963ea65 Cleanup after Codegen refactoring (#47483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47483

I relaized too late that there were a couple of comments on [#47458](https://github.com/facebook/react-native/pull/47458) to add some explanation/remove commented code.

This change applies those comments

## Changelog
[Internal] - Cleanup after landing [#47458](https://github.com/facebook/react-native/pull/47458)

Reviewed By: dmytrorykun

Differential Revision: D65597157

fbshipit-source-id: 238bb75e4b45efae9a8736a7b4feb10f5af5e3d9
2024-11-07 07:53:07 -08:00
Peter AbbondanzoandFacebook GitHub Bot 425093863c Log image load errors (#47419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47419

Minor improvements to `ImageExample` so we log when images fail to load. Also replaces a `Text` component with `RNTesterText` so it's legible.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65363864

fbshipit-source-id: 6c7ce8d5af6aabfed21479c784911bdcffe4684e
2024-11-07 07:53:01 -08:00
Nicola CortiandFacebook GitHub Bot 7817ab5de2 Reland: Undo breaking change of UiManager.eventDispatcher by solving circular dependency (#47478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47478

That's a reland of D65540601

The `UIManager.eventDispatcher` return type is wrong and is causing a breaking change in 0.77

For 0.76 we fixed it in the release branch but we should fix it for good in main as well.
To solve it I had to fix the circular dependency between .bridge and .uimanager.

I wish I could have isolated the .events package better but as everythign is public, any
change we do is going to be a breaking change so I'm being over cautios here.

Changelog:
[Android] [Fixed] - Undo breaking change of UiManager.eventDispatcher return type

Reviewed By: javache

Differential Revision: D65595391

fbshipit-source-id: fc7f6dce78e531c5ec0cc493ed90c0012262b77f
2024-11-07 05:25:17 -08:00
Alex HuntandFacebook GitHub Bot 4567e2a897 Remove redundant UnimplementedView export from BackHandler (#47461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47461

As titled, is overwritten later in the file.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65546370

fbshipit-source-id: 4ea71d24e429b7bbded3e7bb7c75015a2c9d95d8
2024-11-07 05:13:53 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9e399d940a Remove XCBeautify from CI (#47482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47482

XCBeautify swallow some errors, especially all the linker errors when some symbol is not defined. The full error is not available in the raw log either.

This makes much harder to debug those issues when they happen.

We can remove xcbeautify for the time being, while we find a better solution.

## Changelog
[Internal] - Remove XCBeautify from ci

Reviewed By: dmytrorykun

Differential Revision: D65596745

fbshipit-source-id: 0550d4cbeadc5bec8acc61b5edc1320d3445bcaf
2024-11-07 04:57:49 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ffa159e147 Set ASSUME_NONULL in codegen files (#47481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47481

The Codegenerated files has this option turned off.
This is causing Xcode to output hundreds of warnings due to missing nullability options. RThis fixes them.

## CHANGELOG
[Internal] - Set ASSUME_NONNULL regions in codegen'd files

Reviewed By: dmytrorykun

Differential Revision: D65596598

fbshipit-source-id: bbf664944e103c05ef593a7e07bf5b767445950c
2024-11-07 04:50:55 -08:00
Mateo GuzmánandFacebook GitHub Bot 8bb3033d73 fix(flow): excluding packages/rn-tester/Pods/ from flow checks (#47474)
Summary:
When running the commands to check the flow types locally, there is quite some noise from files under `packages/rn-tester/Pods` that should not be checked as they are not from the source code itself.

<img width="839" alt="Screenshot 2024-11-07 at 00 50 55" src="https://github.com/user-attachments/assets/7ad3d96d-0f4a-4772-9e37-34d7e593b4cf">

## Changelog:

[INTERNAL] [FIXED] - Excluding `packages/rn-tester/Pods/` from flow checks

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

Test Plan:
```bash
yarn flow
```

Reviewed By: cortinico

Differential Revision: D65594400

Pulled By: cipolleschi

fbshipit-source-id: d5e8828f41fc87c9a95293c250f24673ebbc6cd4
2024-11-07 04:37:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ace690aba9 Generate RN specific Files in RN (#47458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47458

We are in a weird situation where React Native depends on some files that are generated by Codegen.

Codegen runs in the user project, so those dependencies are not available to React Native if we try to build it in isolation.

This is a problem and a blocker to prepare the prebuilds for iOS.

This image show the changes we are introducing:
On the right we have the current situation.
On the left the new one.

{F1954418630}

## Changelog:
[Internal] - Generate React Native specific code inside React Native

Reviewed By: cortinico, blakef

Differential Revision: D65541505

fbshipit-source-id: 1412d7f23c4d2230b795af41f1e832c8a70d5859
2024-11-07 04:08:58 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 5e18f7f788 fix: typo in spm.rb (#47480)
Summary:
This PR fixes a typo in spm.rb

## Changelog:

[IOS] [FIXED] - Typo in spm.rb

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

Test Plan: N/a

Reviewed By: GijsWeterings

Differential Revision: D65596339

Pulled By: cortinico

fbshipit-source-id: c318cec1422dbcb322e70dc5f189d86af42b626d
2024-11-07 04:01:20 -08:00
Alan LeeandFacebook GitHub Bot fb69f406df Make IntentModule Nullsafe (#47430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47430

Make IntentModule Nullsafe.
Fixed nullability warnings.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65463226

fbshipit-source-id: 2da597e66ad170ec4a2a2949348e522bb361c209
2024-11-07 01:03:33 -08:00
Tim YungandFacebook GitHub Bot 2dab7b078d ScrollView: Delete unstable_setEnableSyncOnScroll (#47399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47399

Deletes `unstable_setEnableSyncOnScroll` which we are no longer experirmenting with in React Native.

Changelog:
[Internal] - Deleted `unstable_setEnableSyncOnScroll` on `ScrollView`, which was never part of the React Native Public API.

Reviewed By: tdn120, sammy-SC

Differential Revision: D65449039

fbshipit-source-id: 6608d5ccca477f1da5e0168c4a342cce17014b08
2024-11-07 00:00:14 -08:00
Yedidya FeldblumandFacebook GitHub Bot f01b47257a let PointerValue::invalidate() be noexcept (#47354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47354

`PointerValue::invalidate()` is called from `Pointer` destructor, which is implicitly `noexcept`, and from `Pointer` move-assignment operator, which is now `noexcept`.

Reviewed By: neildhar

Differential Revision: D65271399

fbshipit-source-id: 26fd9707e4389da78537d0d607adaef0c68690ca
2024-11-06 23:10:36 -08:00
Mathieu ActhernoeneandFacebook GitHub Bot 7a6c7a462a feat(android): Edge-to-edge Modal (navigationBarTranslucent prop) (#47254)
Summary:
The future of Android is [edge-to-edge](https://github.com/react-native-community/discussions-and-proposals/discussions/827) and to make the React Native developer experience seamless in this regard, the ecosystem needs to transition from “opaque system bars by default” to “edge-to-edge by default.”

Currently, there's no easy way to have edge-to-edge modals, as they are implemented using `Dialog` instances (a separate `Window`) and only provide a `statusBarTranslucent` prop.

I tried to implement it in [`react-native-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge) by listening to the `topShow` `UIManager` event. But if it works well when there's a defined animation, we can see a quick jump when there's none, because there's too much delay before the event, and edge-to-edge cannot be applied quick enough to the dialog window.

### react-native-edge-to-edge implem with animation (no jump)

https://github.com/user-attachments/assets/4933a102-87a5-40e4-98d9-47f8c0817592

### react-native-edge-to-edge implem without animation (jump)

https://github.com/user-attachments/assets/e4675589-08fe-44fe-b9d8-0a6b3552b461

 ---

For this reason, and because listening to event feels a bit hacky, I think it will be better to go for a new prop directly on RN Modal component: `navigationBarTranslucent`

> [!NOTE]
> `navigationBarTranslucent` cannot be used without `statusBarTranslucent`, as setting both enable edge-to-edge, like [AndroidX would do](https://github.com/androidx/androidx/blob/androidx-main/activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt) and it would requires extra (and unecessary, given the direction Android is taking) work to find a way to keep the status bar opaque but the navigation bar transparent that work on Android 6 to 15+

### Additional infos

- Colors used for the buttons navigation bar in the PR are the default Android ones ([light](https://github.com/androidx/androidx/blob/androidx-main/activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt#L37) and [dark](https://github.com/androidx/androidx/blob/androidx-main/activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt#L42))
- Compared to the Google implementation, the light scrim is applied from `O_MR1` to `Q` (and not `O` to `Q`) as the [`android:windowLightNavigationBar`](https://developer.android.com/reference/android/R.attr#windowLightNavigationBar) style attribute is not available on `O` (it can only be applied programmatically on API 26).

## Changelog:

[ANDROID] [ADDED] - Add navigationBarTranslucent prop to Modal component

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

Test Plan:
Run the tester app, toggle `navigationBarTranslucent`:

https://github.com/user-attachments/assets/286d173b-35a5-4951-9105-f9f7562d6764

-----
did some additional testing with RNTester using different justification

|flex-start|flex-end|
|https://pxl.cl/5Rd20|https://pxl.cl/5Rd21|

Reviewed By: javache

Differential Revision: D65103501

Pulled By: alanleedev

fbshipit-source-id: ef6473ecd785976d3e26c77bbc212222ec96c9f2
2024-11-06 21:09:36 -08:00
Liron YahdavandFacebook GitHub Bot 61e660b40e Expose some VirtualizedList functions to allow creating VirtualizedListContextProvider outside of VirtualizedList (#47463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47463

Note this is just a temporary approach which will be cleaned up later.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D65514902

fbshipit-source-id: f722031c5cd34eb1400b3f732fd94c0b03d5434d
2024-11-06 20:15:08 -08:00
Nicola CortiandFacebook GitHub Bot 46526fc2fe Stable API - Make classes inside com.facebook.react.views.progressbar internal (#47376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47376

This makes several classes inside `com.facebook.react.views.progressbar` internal:
- ReactProgressBarViewManager
- ProgressBarShadowNode
- ProgressBarContainerView

Those classes should have not been exposed in the first place and users should not depend on them directly.
Marked as Breaking but verified that there are no meaningful usages in OSS.

Changelog:
[Android] [Breaking] - Stable API - Make classes inside `com.facebook.react.views.progressbar` internal

Reviewed By: javache

Differential Revision: D65423290

fbshipit-source-id: dc98fdca996eb648593adb2c32787cbf0d878e3e
2024-11-06 18:32:38 -08:00
Sam ZhouandFacebook GitHub Bot 0ca2ba082d Fix final few problematic React.ElementRef in react-native (#47473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47473

For example,

```
declare function C<T>(ref: React.RefSetter<Set<T>>): React.Node;

type T = React.ElementRef<typeof C>
```

Previously Flow will evaluate `T` to `Set<mixed>`, by automatically replacing generic types with their upper bounds. But in the future it might be replaced with `empty`.

This diff cleans up instances like this in react-native codebase.

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D65562571

fbshipit-source-id: bca2f4f022a5a23a5aa40886f5661899cb315f2e
2024-11-06 18:14:19 -08:00
Phillip PanandFacebook GitHub Bot 8e375f0505 introduce internal API to reload bridgeless without surface restart (#47404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47404

Changelog: [Internal]

introducing an internal API to reload without starting up the surfaces that were stopped at time of reload

Reviewed By: sammy-SC

Differential Revision: D65461606

fbshipit-source-id: 9e58bebdc3e03ead7f91376b7aaba5c7944bddcf
2024-11-06 18:13:34 -08:00
David VaccaandFacebook GitHub Bot bc3ea5c957 Revert migration of ReactHorizontalScrollContainerViewManager to use ViewManagerInterface (#47472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47472

using ViewManagerDelegates for ReactHorizontalScrollContainerViewManager which extends ReactClippingViewManager will introduce a bug (not updating props that are managed by ReactClippingViewManager)

I'm reverting the migration and we should fix the bug in codegen

This diff is a revert of D65428646

changelog: [internal] internal

Reviewed By: sammy-SC, Abbondanzo

Differential Revision: D65564730

fbshipit-source-id: ff183876321d4d36e51da8f38ff6f381207c7c3a
2024-11-06 18:04:31 -08:00
Ramanpreet NaraandFacebook GitHub Bot 50b3c2272f ExceptionsManager: Fix soft error reporting (#47465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47465

When you do @(NO), in objc, it creates an NSNumber.

So this if condition actually evaluates to true:

```
if (@(NO))
```

This means that all soft errors will get logged as fatals on ios.

Changelog: [Internal]

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: realsoelynn

Differential Revision: D65551648

fbshipit-source-id: 99b5bcb5fa1b0b5dc8055a3c86fc983863a25526
2024-11-06 17:58:27 -08:00
Alan LeeandFacebook GitHub Bot e6090df7dc xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/perftest/PerfTestConfig.java (#47440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47440

Removing file as it does not seem to be used

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D65457514

fbshipit-source-id: 39efa12176fe65a491fa4285099134f2bf753159
2024-11-06 15:43:58 -08:00
Alan LeeandFacebook GitHub Bot c53d3e1901 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java (#47431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47431

Convert Java to Kotlin

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65430703

fbshipit-source-id: a1fcab2dd577fe67a1507c330466dabe7483c843
2024-11-06 15:19:38 -08:00
Grace NicholsandFacebook GitHub Bot 147e6c3458 Revert D65540601: Undo breaking change of UiManager.eventDispatcher by solving circular dependency
Differential Revision:
D65540601

Original commit changeset: 4b1f62806baa

Original Phabricator Diff: D65540601

fbshipit-source-id: 9abc3a663882634bb7d42b16bc95d8c2934a2ca5
2024-11-06 12:58:27 -08:00
Adam Woods-MccormickandFacebook GitHub Bot e603fde886 Revert D65478448: Convert com.facebook.react.bridge.JavaOnlyMap to Kotlin
Differential Revision:
D65478448

Original commit changeset: 24e6732a80f5

Original Phabricator Diff: D65478448

fbshipit-source-id: fffd2259aa2757b816373bfded96948b3e6dfeba
2024-11-06 12:49:38 -08:00
Nicola CortiandFacebook GitHub Bot dbe509a23a Undo breaking change of UiManager.eventDispatcher by solving circular dependency (#47457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47457

The `UIManager.eventDispatcher` return type is wrong and is causing a breaking change in 0.77

For 0.76 we fixed it in the release branch but we should fix it for good in main as well.
To solve it I had to fix the circular dependency between .bridge and .uimanager.

I wish I could have isolated the .events package better but as everythign is public, any
change we do is going to be a breaking change so I'm being over cautios here.

Changelog:
[Android] [Fixed] - Undo breaking change of UiManager.eventDispatcher return type

Reviewed By: tdn120

Differential Revision: D65540601

fbshipit-source-id: 4b1f62806baac5f6c3ffdd51b8628ef088447604
2024-11-06 11:50:28 -08:00
Arushi KesarwaniandFacebook GitHub Bot abd118a719 Reducing visibility of OkHttpCallUtil (#47439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47439

As part of sustainability week effort for switching to internal here:
https://fb.workplace.com/groups/251759413609061/permalink/872342228217440/

Reducing visibility of OkHttpCallUtil from `public` to `internal`

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

Reviewed By: javache

Differential Revision: D65506859

fbshipit-source-id: 4ad55d9112da3b3f04b734f41c5a263f4eabfefb
2024-11-06 10:31:21 -08:00
Alex HuntandFacebook GitHub Bot 0c21db360c Remove unused ReactFabricInternals API (#47454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47454

As far as I can tell, this module is now unused both within the codebase and externally. Delete to reduce our public API surface (deep module is an accessible import path).

Changelog:
[General][Breaking] - Remove ReactFabricInternals module

Reviewed By: cortinico

Differential Revision: D65535378

fbshipit-source-id: 25ee16ccc637815ffe1c69a5fc546bd3e11d1689
2024-11-06 10:27:31 -08:00
Pieter De BaetsandFacebook GitHub Bot 1be0387796 Convert com.facebook.react.bridge.JavaOnlyMap to Kotlin (#47416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47416

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65478448

fbshipit-source-id: 24e6732a80f5ee858fec5dbb38617e7dfad63f58
2024-11-06 10:27:28 -08:00
Arushi KesarwaniandFacebook GitHub Bot 3dec672398 Reducing visibility of SimpleSettableFuture (#47438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47438

As part of sustainability week effort for switching to `internal` here:
https://fb.workplace.com/groups/251759413609061/permalink/872342228217440/

Reducing visibility of SimpleSettableFuture from `public` to `internal`

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

Reviewed By: javache

Differential Revision: D65502193

fbshipit-source-id: 4bdd9b43684c8bc075271d76856ef848c52e6b12
2024-11-06 10:26:16 -08:00
Mateo GuzmánandFacebook GitHub Bot 17c164621d test(image): [android] improving image property test cases (#47433)
Summary:
I've doing some enhancements around the Image component for Android, and in the process of understanding the codebase I saw some opportunity to improve the test cases as there is no much coverage around the underlying functionality.

## Changelog:

[INTERNAL] [ADDED] - Improving Android Image property test cases

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: javache

Differential Revision: D65530813

Pulled By: cortinico

fbshipit-source-id: b314eaf7493c6f3c859b7cb0d06771c109e5e854
2024-11-06 09:19:27 -08:00
Nicola CortiandFacebook GitHub Bot a3ab7895c9 Add missing \n on actOnLabel.js (#47451)
Summary:
I forgot to add some `\n` in the bot messages. This fixes it.

## Changelog:

[INTERNAL] - Add missing `\n` on actOnLabel.js

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D65533495

Pulled By: cortinico

fbshipit-source-id: c2214d00800f6b70ec331a9ae72578414f50cd43
2024-11-06 08:54:10 -08:00
qnnpandFacebook GitHub Bot 0244710c4b refactor(PermissionsAndroid): Use the TypeScript key in syntax to restrict permissions and types of results (#47299)
Summary:
Changelog:
[General][Added] Use the TypeScript key in syntax to restrict permissions and types of results

 - Use key in 'GRANTED' | 'DENIED' | 'NEVER_ASK_AGAIN for RESULTS constants to ensure that only these values are allowed

 - Use a detailed list of permission names for PERMISSIONS constants to restrict the type of key

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

Reviewed By: yungsters

Differential Revision: D65480410

Pulled By: tdn120

fbshipit-source-id: ec23750d72ede0ba6ed96e80c35242da08b2508e
2024-11-06 08:45:18 -08:00
Blake FriedmanandFacebook GitHub Bot e0be2efe4e fix/cli start (#47450)
Summary:
When decoupling the community-cli-plugin from the react-native-community/cli-server-api (https://github.com/facebook/react-native/issues/45311), a middleware stub was created to allow a runtime stub to be used in this case. This middleware should be used so as not to break when the optional cli-server-api dependency isn't present.

Changelog:
[General][Fixed] - Fix npm react-native start when cli-server-api isn't installed

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

Test Plan:
Forced a runtime exception simulating the package not being dependent and was able to build rn-tester.

![CleanShot 2024-11-06 at 10 49 58@2x](https://github.com/user-attachments/assets/c040ec5b-7000-43bd-ba54-52a672ff3675)

Reviewed By: cipolleschi

Differential Revision: D65532486

Pulled By: blakef

fbshipit-source-id: 2b380607de63ac2da906ef0cb1e48b9ef263cb68
2024-11-06 07:26:30 -08:00
Pieter De BaetsandFacebook GitHub Bot b04f5fbfba Add Binding.h header back for backwards compat (#47453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47453

`react-native-screens` [depends on this header](https://github.com/software-mansion/react-native-screens/blob/main/android/src/main/cpp/NativeProxy.cpp#L2) and this is an unnecessary API breakage.

Changelog: [Android][Fixed] Added back `<react/fabric/Binding.h>` header.

Reviewed By: fabriziocucci

Differential Revision: D65534176

fbshipit-source-id: ce252f29be1c5322f44e20b6e36ab51db9c7a8ef
2024-11-06 06:38:47 -08:00
Pieter De BaetsandFacebook GitHub Bot 5b41c7a84b Convert com.facebook.react.views.text.TextTransform to Kotlin (#47412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47412

Changelog: [Internal]

Reviewed By: cortinico, fabriziocucci

Differential Revision: D65478027

fbshipit-source-id: e65019b7a90b696c3764e1deaf94f5f8bb0a7a95
2024-11-06 06:38:29 -08:00
Nicola CortiandFacebook GitHub Bot 10f6d5adb5 Stable API - Make ClipboardModule internal (#47413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47413

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.clipboard.ClipboardModule

Changelog:
[Android] [Breaking] - Stable API - Make `ClipboardModule` internal

Reviewed By: mdvacca

Differential Revision: D65479065

fbshipit-source-id: 1c534cafffdb27b808553eec7346e21fe4f38c24
2024-11-06 04:16:43 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d352a9979d Add checkout step to check nightly (#47448)
Summary:
In order to use a reusable workflow in GHA, we need first to checkout the repository so the action has access to the other workflows.

## Changelog:
[Internal] - Add checkout step to Check Nightlies

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

Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11702038686?pr=47448

Reviewed By: cortinico

Differential Revision: D65532274

Pulled By: cipolleschi

fbshipit-source-id: 58117ac81973e3c07829d73d5bde4e6fd4d212f9
2024-11-06 04:07:13 -08:00
kunal.chavhanandFacebook GitHub Bot 92f51c009f add e2e test for empty case in flatlist (#47444)
Summary:
Part of https://github.com/facebook/react-native/issues/46757
Solves: ME2E0010

## Changelog:

[INTERNAL][ADDED] - add e2e test for empty case in flatlist

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

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

Reviewed By: cortinico

Differential Revision: D65531064

Pulled By: cipolleschi

fbshipit-source-id: 700c2fd6d43c24671021b6c3c5a4218e5699c7d9
2024-11-06 04:07:01 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f94ca27986 Add job to test libraries on nightlies (#47409)
Summary:
We want to test libraries against React Native nightlies to check when we introduce breakig change

## Changelog:
[Internal] - Add CI tests for libraries

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

Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11700016815/job/32583153239?pr=47409

Reviewed By: cortinico

Differential Revision: D65530787

Pulled By: cipolleschi

fbshipit-source-id: ef4d13c30995f119715ef4f12ea51eaa65152518
2024-11-06 02:32:16 -08:00
David VaccaandFacebook GitHub Bot fddf7aaad1 Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface (#47395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47395

Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428646

fbshipit-source-id: 7e36f3642ac31aa747c2b7f21c251173516fffad
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot bed778fa5a Migrate ReactUnimplementedViewManager to use ViewManagerInterface (#47392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47392

Migrate ReactUnimplementedViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428644

fbshipit-source-id: 011d06b6cb06c4fcc5e072b625b943ec6b7f1a62
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot b4a24a163c Migrate DebuggingOverlayManager to use ViewManagerDelegate (#47393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47393

Migrate DebuggingOverlayManager to use ViewManagerDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428645

fbshipit-source-id: 9cf6932a209935b6e85b7d8870a7aa610c45aded
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot 496b0a8729 Migrate ReactVirtualTextShadowNode to kotlin and make it internal (#47434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47434

Migrate ReactVirtualTextShadowNode to kotlin and make it internal

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

Reviewed By: shwanton

Differential Revision: D65493927

fbshipit-source-id: 2b5997d000b5dc489ba93edb226455ef0855b98b
2024-11-05 21:44:38 -08:00
David VaccaandFacebook GitHub Bot 4a119c4c3a Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal (#47402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47402

Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal

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

Reviewed By: cortinico

Differential Revision: D65462051

fbshipit-source-id: fa6daef4e557d527d594616ca032ebf0180cbba2
2024-11-05 21:44:38 -08:00
David VaccaandFacebook GitHub Bot 5c3c1524dd Exclude $$PropSetter classes from public API (#47432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47432

In this diff we are excluding the $$PropSetter classes from public API, we do this by adding the UnstableReactNativeAPI annotation on all $$PropSetter classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65488026

fbshipit-source-id: 9f1bbe7b25fa69c0a40f6cb0ff38a8ae6ee8d97d
2024-11-05 21:44:38 -08:00
Phillip PanandFacebook GitHub Bot b7ec7523cc clean up contextContainer->insert("ReactNativeConfig") from oss (#47350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47350

Changelog: [Internal]

we don't need any of these now since no one is calling `contextContainer_->at<std::shared_ptr>("ReactNativeConfig")` anymore

Reviewed By: NickGerleman

Differential Revision: D65304976

fbshipit-source-id: 5f835ab9ac429aa1942cc8d9669812c1ac994238
2024-11-05 17:43:18 -08:00
Nicola CortiandFacebook GitHub Bot 39dfbadd5d Stable API - Make classes in com.facebook.react.views.safeareaview internal (#47375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47375

This makes the following class internal:
- ReactSafeAreaView
- ReactSafeAreaViewManager

Those classes should have not been exposed in the first place. Marked as breaking but no
meaningful usages are available in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.views.safeareaview.ReactSafeAreaView

Changelog:
[Android] [Breaking] - Stable API - Make classes in `com.facebook.react.views.safeareaview` internal

Reviewed By: javache

Differential Revision: D65422197

fbshipit-source-id: d245155c7c92a408cfbb2a7a0015a73fd1d9f9b8
2024-11-05 16:38:17 -08:00
Ramanpreet NaraandFacebook GitHub Bot ef6b6f315c earlyjs: Attach js build to all errors (#46868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46868

jsBuild prasing was done at the js level.

But, for the c++ pipeline, we have to parse the js build in native.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63927093

fbshipit-source-id: ce7ee46714ee0e72e450003330dbca78acb264a3
2024-11-05 16:15:09 -08:00
Soe LynnandFacebook GitHub Bot 120a12f01a Convert [bridge_ reload] to RCTReloadCommand (#47400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47400

Changelog [Internal]:

Convert `[bridge_ reload]` to RCTReloadCommand

Reviewed By: cipolleschi

Differential Revision: D65455862

fbshipit-source-id: 5d5e504cc0b4151a2fb4c86c08e84dbd7040ed68
2024-11-05 15:45:22 -08:00
Yedidya FeldblumandFacebook GitHub Bot 2dcffef5c4 let Pointer be nothrow-move-constructible (#47331)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47331

Reviewed By: Gownta

Differential Revision: D65271354

fbshipit-source-id: cd3ff9db94f2ad332afd68dae438c404f8807f70
2024-11-05 15:44:57 -08:00
Nicola CortiandFacebook GitHub Bot a72c35f98c Stable API - Make VibrationModule internal (#47414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47414

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.vibration.VibrationModule

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

Reviewed By: mdvacca

Differential Revision: D65479292

fbshipit-source-id: 383790e6432c3c8c6f47289d2156099d263cc8ca
2024-11-05 15:41:41 -08:00
Nicola CortiandFacebook GitHub Bot c4f58d2452 Update messages for @react-native-bot (#47428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47428

This changes the messages that the bot is printing.
I've moved from using a table to using GitHub's admonitions that
renders nicely are are more informative.

Changelog:
[Internal] [Changed] - Update messages for react-native-bot

Reviewed By: mdvacca

Differential Revision: D65485633

fbshipit-source-id: f43f7bd75280bfd0aceab48b2517306c1057b778
2024-11-05 14:33:29 -08:00
Nicola CortiandFacebook GitHub Bot d2a91617da Prevent @react-native-bot from double posting on missing reproducer (#47427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47427

I've noticed that react-native-bot posts twice once we can't find a reproducer.
(see here: https://github.com/facebook/react-native/issues/47421)

This fixes it by letting it post only once.

Changelog:
[Internal] [Changed] - Prevent react-native-bot from double posting on missing reproducer

Reviewed By: mdvacca

Differential Revision: D65485634

fbshipit-source-id: dbe9b1311aef246dead6d9b922c1256363e894f7
2024-11-05 14:33:29 -08:00
Nicola CortiandFacebook GitHub Bot bbe714e487 Undo a breaking change on ReactViewGroup constructor (#47423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47423

cipolleschi found out that we broke the `ReactViewGroup` constructor when making this class Nullsafe.

Specifically now users would need to pass a `Context` and not a `Context?` as libraries will break (and this will break a lot of them).
So I'm undoing this change by annotating this parameter as Nullable.

Changelog:
[Android] [Changed] - Undo a breaking change on ReactViewGroup constructor

Reviewed By: tdn120

Differential Revision: D65483379

fbshipit-source-id: 43f7bcab5f10b1b8b5601de1dab314d7bbb1eefe
2024-11-05 13:59:31 -08:00
David VaccaandFacebook GitHub Bot 72bd840dd3 Deprecate BridgelessCatalystInstance class (#47385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47385

BridgelessCatalystInstance class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.

changelog: [Android][Changed] Deprecate BridgelessCatalystInstance class

Reviewed By: cortinico

Differential Revision: D65430789

fbshipit-source-id: 011b372c93c39862d5821713aa8f673084b52c2a
2024-11-05 12:34:51 -08:00
Soe LynnandFacebook GitHub Bot 2168dca4ac Fix warning for adjustImageWhenDisabled (#47401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47401

Changelog [Internal]:

Replace deprecated `adjustImageWhenDisabled` with `UIButtonConfiguration`

Reviewed By: cipolleschi

Differential Revision: D65457771

fbshipit-source-id: ffb5b4fc629ba671cb6fec1dc333bf693e4be8ea
2024-11-05 12:11:51 -08:00
Mateo GuzmánandFacebook GitHub Bot d8cfd98070 feat(image): support for resizeMode and objectFit value of 'none' (#47110)
Summary:
As part of https://github.com/facebook/react-native/issues/34425, `objectFit` value of `'none'` needs to be supported for the Image component.

In order to support this, a new value must also be added to support the equivalent in `resizeMode`. With this new value, the image will not be resized at all and keeping it in the initial position within a container (see in the screenshots).

In this PR the support is added for both Fabric and Paper.

## Changelog:

[GENERAL] [ADDED] - image `resizeMode` and `objectFit` support for `'none'`.

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

Test Plan:
Using the `rn-tester`, there is a new image example for both `resizeMode` and `objectFit`.

See below the results for both Android and iOS:

<details>
<summary>Fabric screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729232899](https://github.com/user-attachments/assets/ea765afc-9f85-4ac3-96ab-229b3f1def20) | ![Screenshot_1729232912](https://github.com/user-attachments/assets/75033e76-5faa-438d-81b1-4bf8436f9ef2) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 37](https://github.com/user-attachments/assets/ade02ba9-4792-4760-aada-6ea56b591801) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 55](https://github.com/user-attachments/assets/abf68db9-841a-4ee5-b5db-64fe84a69089) |

</details>

<details>
<summary>Paper screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729286528](https://github.com/user-attachments/assets/88e89191-d70a-4013-8380-2ecefd9532b4) | ![Screenshot_1729286542](https://github.com/user-attachments/assets/43d84ae0-2ed3-47ad-a725-ac6aea0b3245) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 22](https://github.com/user-attachments/assets/e14a81de-3a69-4e73-8c85-ec08ac30b04f) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 16](https://github.com/user-attachments/assets/595f9f5e-96a6-4f6b-9614-f6c236837ba8) |

</details>

Reviewed By: fabriziocucci

Differential Revision: D65420002

Pulled By: javache

fbshipit-source-id: df3bc8fc931b88cde5fe51d89685bf327e30ed9f
2024-11-05 11:36:27 -08:00
Nicola CortiandFacebook GitHub Bot d7d5de9f96 Stable API - Make NativeModulePerfLogger internal (#47415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47415

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.reactperflogger.NativeModulePerfLogger

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

Reviewed By: mdvacca

Differential Revision: D65479550

fbshipit-source-id: 545c33e2c526e396084af65fc19314f59c8a74f8
2024-11-05 11:35:12 -08:00
Alan LeeandFacebook GitHub Bot d1fb01cd85 Make FrescoBasedReactTextInlineImageViewManager Nullsafe (#47425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47425

Make FrescoBasedReactTextInlineImageViewManager Nullsafe.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65456481

fbshipit-source-id: c841494ba933be149a2124a461d6a5011ce7d993
2024-11-05 11:31:37 -08:00
Nick GerlemanandFacebook GitHub Bot 19b0acf754 Minor display: contents optimizations (#47358)
Summary:
X-link: https://github.com/facebook/yoga/pull/1736

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

`LayoutableChildren<yoga::Node>::Iterator` showed up to a surprising extent on a recent trace. Part of this was during pixel grid rounding, which does full tree traversal (we should fix that...), where the iterator is the first thing to read from the node.

I ran Yoga microbenchmark with Yoga compiled with `-O2`, where we saw a regression of synthetic performance by ~10%, but it turns out this build also had ASAN and some other heavy bits enabled, so the real impact was quite lower (~6%).

I was able to make some optimizations in the meantime against that, which still show some minor wins, reducing that overhead to ~4% in the properly optimized build (and a bit more before that). This is still measurable on the beefy server, and the code is a bit cleaner, so let's commit these!

Note that, in real scenarios, measure functions may dominate layout time, so display: contents does not mean end-to-end 4% regression, even after this change.

This change makes a few different optimizations
1. Removes redundant copies
2. Removes redundant index keeping
3. Mark which branches are likely vs unlikely
4. Shrink iterator size from 6 pointers to 3 pointers
5. Avoid usage in pixel grid rounding (so we don't need to have cache read for style)

In "Huge nested layout" example

| Before display: contents support | After display: contents support | After optimizations |
| 9.77ms | 10.39ms | 10.17ms |

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D65336148

fbshipit-source-id: 01c592771ed7accf2d87dddd5a3a9e0225098b56
2024-11-05 11:28:37 -08:00
Luna WeiandFacebook GitHub Bot 06071c68d5 Remove experimental types (#47405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47405

Changelog: [Internal] - With New Architecture out, delete experimental type definition and move types back to relevant definition files

Reviewed By: cortinico, jorge-cab

Differential Revision: D65462903

fbshipit-source-id: bd7fc5bb689eb054b3a30ec7b388e0f455ff1c93
2024-11-05 10:24:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ba41228a66 Back out "Add png extension only if file exist when load local image" (#47417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47417

Backing out this change as it was breaking an internal app. I'll reland this next week when I have more time.

## Changelog:
[iOS][Changed] - Revert fix that checks whether an image is present on disk.

## Facebook:
This is breaking twilight.

Differential Revision: D65479912

fbshipit-source-id: dcd5ac5f3d98ba2f10b9519f09d3eb1fd454da61
2024-11-05 10:06:35 -08:00
Luna WeiandFacebook GitHub Bot f489944051 Convert PanResponder example into functional component (#47381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47381

Convert PanResponder example into functional component

Changelog: [Internal] Update PanResponder example to functional component

Reviewed By: lyahdav

Differential Revision: D65430973

fbshipit-source-id: 0db09ce12a8c59ec74beaf2ee10326c984fa682c
2024-11-05 09:30:30 -08:00
Nicola CortiandFacebook GitHub Bot 8c50bf0beb Stable API - Make DevLoadingModule internal (#47368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47368

This class should be internal and has no meaningful usages outside of React Native.
See https://github.com/search?type=code&q=%22DevLoadingModule%3A%3Aclass%22

So technically breaking but I expect no impact for OSS at all.

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

Reviewed By: javache

Differential Revision: D64725164

fbshipit-source-id: 5f39e609c611662c71cc08bffa195f7bea5db5bd
2024-11-05 07:35:36 -08:00
Nicola CortiandFacebook GitHub Bot 287e200332 Stable API - Convert to Kotlin and make internal NotThreadSafeViewHierarchyUpdateDebugListener (#47371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47371

This interface should have not been exposed in the first place.
I'm converting it to Kotlin + making it `internal`.
I found no meaningful usage in OSS so I expect no breakages.

Changelog:
[Android] [Breaking] - Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener`

Reviewed By: javache

Differential Revision: D65420912

fbshipit-source-id: 5afdb013f588a5698b4e7467a7f1096c24d1733e
2024-11-05 04:11:48 -08:00
Nicola CortiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 WhiteandFacebook GitHub Bot 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 WhiteandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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
zhongwuzwandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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
oddlyspacedandFacebook GitHub Bot 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ánandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 NasirimehrandFacebook GitHub Bot 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 RousavyandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 AbbondanzoandFacebook GitHub Bot 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 TsaiandFacebook GitHub Bot 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
zhongwuzwandFacebook GitHub Bot 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ánandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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'BrienandFacebook GitHub Bot 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'BrienandFacebook GitHub Bot 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 NasirimehrandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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ánandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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
hexboyandFacebook GitHub Bot 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 PanandFacebook GitHub Bot 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 PanandFacebook GitHub Bot 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'BrienandFacebook GitHub Bot 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'BrienandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 VekrisandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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
zhongwuzwandFacebook GitHub Bot 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śniewskiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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
qyandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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śniewskiandFacebook GitHub Bot 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)andFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 RozellandFacebook GitHub Bot 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 RozellandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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
DawidandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 PanandFacebook GitHub Bot 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ödeckeandFacebook GitHub Bot 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 BelaliaandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 LeeandFacebook GitHub Bot 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ánandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 NorteandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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 NasirimehrandFacebook GitHub Bot 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 GerlemanandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 WhiteandFacebook GitHub Bot 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 PengandFacebook GitHub Bot 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 PengandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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
zhongwuzwandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 NaraandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 VaccaandFacebook GitHub Bot 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 NasirimehrandFacebook GitHub Bot 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 FriedmanandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 LuoandFacebook GitHub Bot 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
3078 changed files with 177064 additions and 80740 deletions
-4
View File
@@ -1,4 +0,0 @@
# Circle CI
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.
-13
View File
@@ -1,13 +0,0 @@
version: 2.1
workflows:
version: 2
stub:
jobs:
- circleci-stub
jobs:
circleci-stub:
docker:
- image: debian:bullseye
steps:
- run: echo "There is nothing here, just an empty job. Everything has been moved to GitHub Action"
+2
View File
@@ -3,12 +3,14 @@
docs/generatedComponentApiDocs.js
packages/react-native/flow/
packages/react-native/sdks/
packages/react-native/ReactAndroid/build
packages/react-native/ReactAndroid/hermes-engine/build/
packages/react-native/Libraries/Renderer/*
packages/react-native/Libraries/vendor/**/*
node_modules/
packages/*/node_modules
packages/*/dist
packages/*/types_generated
packages/debugger-frontend/dist/**/*
packages/react-native-codegen/lib
tools/eslint/rules/sort-imports.js
+10
View File
@@ -35,6 +35,16 @@ module.exports = {
'no-undef': 0,
},
},
{
files: [
'./packages/react-native/**/*.{js,flow}',
'./packages/assets/registry.js',
],
parser: 'hermes-eslint',
rules: {
'lint/no-commonjs-exports': 1,
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
+7 -1
View File
@@ -26,6 +26,9 @@
; helloworld
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
; Ignore rn-tester Pods
<PROJECT_ROOT>/packages/rn-tester/Pods/
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
@@ -38,6 +41,7 @@
flow-typed/
packages/react-native/interface.js
packages/react-native/flow/
packages/react-native/src/types/
[options]
enums=true
@@ -69,6 +73,8 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty
ban_spread_key_props=true
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
@@ -90,4 +96,4 @@ untyped-import
untyped-type-import
[version]
^0.250.0
^0.262.0
+3 -3
View File
@@ -69,10 +69,10 @@ body:
- 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.
label: Output of `npx @react-native-community/cli info`
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
...
System:
OS: macOS 14.1.1
@@ -48,10 +48,10 @@ body:
- 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.
label: Output of `npx @react-native-community/cli info`
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
...
System:
OS: macOS 14.1.1
@@ -81,10 +81,10 @@ body:
- 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.
label: Output of `npx @react-native-community/cli info`
description: Run `npx @react-native-community/cli info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
Paste the output of `npx @react-native-community/cli info` here. The output looks like:
...
System:
OS: macOS 14.1.1
+4 -1
View File
@@ -7,6 +7,8 @@ inputs:
run-e2e-tests:
default: 'false'
description: If we need to build to run E2E tests. If yes, we need to build also x86.
gradle-cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
runs:
using: composite
steps:
@@ -16,7 +18,7 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Set React Native Version
shell: bash
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
@@ -24,6 +26,7 @@ runs:
uses: ./.github/actions/setup-gradle
with:
cache-read-only: "false"
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Restore Android ccache
uses: actions/cache/restore@v4
with:
@@ -47,7 +47,7 @@ runs:
fi
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
@@ -14,8 +14,12 @@ runs:
shell: bash
run: |
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
sudo apt install -y git openssh-client build-essential \
libreadline-dev libicu-dev jq zip python3
# Install cmake 3.28.3-1build7
sudo apt-get install cmake=3.28.3-1build7
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
@@ -39,13 +39,13 @@ runs:
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: Downgrade CMake
shell: powershell
run: choco install cmake --version 3.31.6 --force
- 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 [...]
+15 -1
View File
@@ -11,6 +11,9 @@ inputs:
required: false
description: The GHA npm token, required only to publish to npm
default: ''
gradle-cache-encryption-key:
description: The encryption key needed to store the Gradle Configuration cache
runs:
using: composite
steps:
@@ -98,12 +101,23 @@ runs:
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: Download ReactNativeDependencies
uses: actions/download-artifact@v4
with:
pattern: ReactNativeDependencies*
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
merge-multiple: true
- name: Print Artifacts Directory
shell: bash
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Install dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Build packages
shell: bash
run: yarn build
+1 -1
View File
@@ -15,7 +15,7 @@ runs:
using: composite
steps:
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Configure Git
shell: bash
run: |
+9 -7
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
default: "20"
github-token:
description: "The GitHub token used by pull-bot"
required: true
@@ -15,9 +15,8 @@ runs:
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 yarn install
uses: ./.github/actions/yarn-install
- name: Run linters against modified files (analysis-bot)
shell: bash
run: yarn lint-ci
@@ -26,10 +25,13 @@ runs:
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
run: ./.github/workflow-scripts/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
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint-java --check
- name: Verify not committing repo after running build
shell: bash
run: yarn run build --check
- name: Run flowcheck
shell: bash
run: yarn flow-check
@@ -38,7 +40,7 @@ runs:
run: yarn test-typescript
- name: Check license
shell: bash
run: ./scripts/circleci/check_license.sh
run: ./.github/workflow-scripts/check_license.sh
- name: Check formatting
shell: bash
run: yarn run format-check
+13 -6
View File
@@ -25,13 +25,17 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Set up JDK 17
if: ${{ inputs.install-java == 'true' }}
uses: actions/setup-java@v4
@@ -52,12 +56,15 @@ runs:
if: ${{ inputs.flavor == 'debug' }}
run: ./packages/react-native-codegen/scripts/oss/build.sh
- name: Run e2e tests
id: run-tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
arch: x86
ram-size: '4096M'
ram-size: '8192M'
heap-size: '4096M'
disk-size: '10G'
cores: '4'
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 }}
@@ -69,16 +76,16 @@ runs:
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
uses: actions/upload-artifact@v4.3.4
if: always()
with:
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
report.xml
screen.mp4
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
if: 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 }}
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
+25 -57
View File
@@ -21,27 +21,36 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.39.7; 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
brew install facebook/fb/idb-companion
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
# build codegen or we will see a redbox
./packages/react-native-codegen/scripts/oss/build.sh
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
@@ -53,69 +62,28 @@ runs:
# 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
node .github/workflow-scripts/maestro-ios.js \
"${{ inputs.app-path }}" \
"${{ inputs.app-id }}" \
"${{ inputs.maestro-flow }}" \
"${{ inputs.jsengine }}" \
"${{ inputs.flavor }}" \
"${{ inputs.working-directory }}"
- 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 }}
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
video_record_${{ inputs.jsengine }}_1.mov
video_record_${{ inputs.jsengine }}_2.mov
video_record_${{ inputs.jsengine }}_3.mov
video_record_${{ inputs.jsengine }}_4.mov
video_record_${{ inputs.jsengine }}_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 }}
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
@@ -69,7 +69,7 @@ runs:
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download Hermes tarball
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
@@ -3,9 +3,6 @@ description: Prepare iOS Tests
runs:
using: composite
steps:
- name: brew install xcbeautify
run: brew install xcbeautify
shell: bash
- name: Run Ruby Tests
shell: bash
run: |
+6 -3
View File
@@ -4,17 +4,20 @@ 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"
cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
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
# Encryption key for the Gradle Configuration Cache.
# See https://docs.gradle.org/8.6/userguide/configuration_cache.html#config_cache:secrets:configuring_encryption_key
cache-encryption-key: ${{ inputs.cache-encryption-key }}
+2 -1
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: 'The node.js version to use'
required: false
default: '18'
default: '20'
runs:
using: "composite"
steps:
@@ -12,3 +12,4 @@ runs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: yarn
@@ -41,7 +41,7 @@ runs:
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
+15 -15
View File
@@ -41,7 +41,7 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download Hermes
uses: actions/download-artifact@v4
with:
@@ -109,8 +109,8 @@ runs:
export USE_FRAMEWORKS=dynamic
fi
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
export RCT_NEW_ARCH_ENABLED=0
fi
cd packages/rn-tester
@@ -118,27 +118,21 @@ runs:
bundle install
bundle exec pod install
- name: Build RNTester
if: ${{ inputs.run-unit-tests != 'true' && inputs.run-e2e-tests == 'false' }}
shell: bash
run: |
set -o pipefail && xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator | xcbeautify
- name: Build RNTester (E2E Tests)
shell: bash
if: ${{ inputs.run-e2e-tests == 'true' }}
run: |
set -o pipefail && xcodebuild \
xcodebuild \
-scheme "RNTester" \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-configuration "${{ inputs.flavor }}" \
-sdk "iphonesimulator" \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath "/tmp/RNTesterBuild" | xcbeautify
-derivedDataPath "/tmp/RNTesterBuild"
echo "Print path to *.app file"
find "/tmp/RNTesterBuild" -type d -name "*.app"
APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app")
echo "App found at $APP_PATH"
echo "app-path=$APP_PATH" >> $GITHUB_ENV
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
@@ -158,6 +152,12 @@ runs:
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- name: Upload RNTester App
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: RNTesterApp-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: ${{ env.app-path }}
- name: Store test results
if: ${{ inputs.run-unit-tests == 'true' }}
uses: actions/upload-artifact@v4.3.4
+2 -2
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
default: "20"
runs:
using: composite
steps:
@@ -13,7 +13,7 @@ runs:
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Run Tests - JavaScript Tests
shell: bash
run: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
@@ -0,0 +1,46 @@
name: test-library-on-nightly
description: Tests a library on a nightly
inputs:
library-npm-package:
description: The library npm package to add
required: true
platform:
description: whether we want to build for iOS or Android
required: true
runs:
using: composite
steps:
- name: Create new app
shell: bash
run: |
cd /tmp
npx @react-native-community/cli init RNApp --skip-install --version nightly
- name: Add library
shell: bash
run: |
cd /tmp/RNApp
yarn add ${{ inputs.library-npm-package }}
- name: Build iOS
shell: bash
if: ${{ inputs.platform == 'ios' }}
run: |
cd /tmp/RNApp/ios
bundle install
bundle exec pod install
xcodebuild build \
-workspace RNApp.xcworkspace \
-scheme RNApp \
-sdk iphonesimulator
- name: Setup Java for Android
if: ${{ inputs.platform == 'android' }}
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Build Android
shell: bash
if: ${{ inputs.platform == 'android' }}
run: |
cd /tmp/RNApp/android
./gradlew assembleDebug
@@ -1,28 +0,0 @@
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
+20
View File
@@ -0,0 +1,20 @@
name: yarn-install
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
MAX_ATTEMPTS=2
ATTEMPT=0
WAIT_TIME=20
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
yarn install --non-interactive --frozen-lockfile && break
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
sleep $WAIT_TIME
ATTEMPT=$((ATTEMPT + 1))
done
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
echo "All attempts to invoke yarn install failed - Aborting the workflow"
exit 1
fi
@@ -15,6 +15,7 @@ const {
const mockRun = jest.fn();
const mockSleep = jest.fn();
const mockGetNpmPackageInfo = jest.fn();
const mockVerifyPublishedPackage = jest.fn();
const silence = () => {};
jest.mock('../utils.js', () => ({
@@ -24,6 +25,10 @@ jest.mock('../utils.js', () => ({
getNpmPackageInfo: mockGetNpmPackageInfo,
}));
jest.mock('../verifyPublishedPackage.js', () => ({
verifyPublishedPackage: mockVerifyPublishedPackage,
}));
const getMockGithub = () => ({
rest: {
actions: {
@@ -46,7 +51,7 @@ describe('#publishTemplate', () => {
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yml',
workflow_id: 'release.yaml',
ref: '0.76-stable',
inputs: {
dry_run: true,
@@ -66,7 +71,7 @@ describe('#publishTemplate', () => {
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yml',
workflow_id: 'release.yaml',
ref: '0.76-stable',
inputs: {
dry_run: false,
@@ -82,77 +87,43 @@ describe('#verifyPublishedTemplate', () => {
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(
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'@react-native-community/template',
version,
null,
18,
);
});
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(
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'@react-native-community/template',
version,
'latest',
18,
);
});
describe('timeouts', () => {
let mockProcess;
beforeEach(() => {
mockProcess = jest.spyOn(process, 'exit').mockImplementation(code => {
throw new Error(`process.exit(${code}) called!`);
});
});
afterEach(() => mockProcess.mockRestore());
describe('retries', () => {
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);
await verifyPublishedTemplate('0.77.0', true, RETRIES),
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'@react-native-community/template',
'0.77.0',
'latest',
2,
);
});
});
});
@@ -0,0 +1,135 @@
/**
* 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 {verifyPublishedPackage} = require('../verifyPublishedPackage');
const mockRun = jest.fn();
const mockSleep = jest.fn();
const mockGetNpmPackageInfo = jest.fn();
const silence = () => {};
const REACT_NATIVE_PACKAGE = 'react-native';
jest.mock('../utils.js', () => ({
log: silence,
run: mockRun,
sleep: mockSleep,
getNpmPackageInfo: mockGetNpmPackageInfo,
}));
describe('#verifyPublishedPackage', () => {
beforeEach(jest.clearAllMocks);
it("waits on npm updating for version and not 'latest'", async () => {
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.78.0';
await verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, null);
expect(mockGetNpmPackageInfo).toHaveBeenLastCalledWith(
REACT_NATIVE_PACKAGE,
version,
);
});
it('waits on npm updating version and latest tag', async () => {
const version = '0.78.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 verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, 'latest');
expect(mockGetNpmPackageInfo).toHaveBeenCalledWith(
REACT_NATIVE_PACKAGE,
'latest',
);
});
it('waits on npm updating version and next tag', async () => {
const version = '0.78.0-rc.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 verifyPublishedPackage(REACT_NATIVE_PACKAGE, version, 'next');
expect(mockGetNpmPackageInfo).toHaveBeenCalledWith(
REACT_NATIVE_PACKAGE,
'next',
);
});
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(() =>
verifyPublishedPackage(
REACT_NATIVE_PACKAGE,
'0.77.0',
'latest',
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 verifyPublishedPackage(
REACT_NATIVE_PACKAGE,
'0.77.0',
'latest',
RETRIES,
);
}).rejects.toThrowError('process.exit(1) called!');
expect(mockGetNpmPackageInfo).toHaveBeenCalledTimes(RETRIES);
});
});
});
@@ -0,0 +1,109 @@
/**
* 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 {verifyReleaseOnNpm} = require('../verifyReleaseOnNpm');
const mockVerifyPublishedPackage = jest.fn();
const silence = () => {};
jest.mock('../utils.js', () => ({
log: silence,
sleep: silence,
}));
jest.mock('../verifyPublishedPackage.js', () => ({
verifyPublishedPackage: mockVerifyPublishedPackage,
}));
describe('#verifyReleaseOnNPM', () => {
beforeEach(jest.clearAllMocks);
it("waits on npm updating for version and not 'latest'", async () => {
const NOT_LATEST = false;
const version = '0.78.0';
await verifyReleaseOnNpm(version, NOT_LATEST);
expect(mockVerifyPublishedPackage).toHaveBeenLastCalledWith(
'react-native',
version,
null,
18,
);
});
it('waits on npm updating version and latest tag', async () => {
const IS_LATEST = true;
const version = '0.78.0';
await verifyReleaseOnNpm(version, IS_LATEST);
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
version,
'latest',
18,
);
});
it('waits on npm updating version, not latest and next tag', async () => {
const IS_LATEST = false;
const version = '0.78.0-rc.0';
await verifyReleaseOnNpm(version, IS_LATEST);
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
version,
'next',
18,
);
});
it('waits on npm updating version, latest and next tag', async () => {
const IS_LATEST = true;
const version = '0.78.0-rc.0';
await verifyReleaseOnNpm(version, IS_LATEST);
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
version,
'next',
18,
);
});
describe('timeouts', () => {
it('will timeout if npm does not update package version after a set number of retries', async () => {
const RETRIES = 2;
await verifyReleaseOnNpm('0.77.0', true, RETRIES),
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
'0.77.0',
'latest',
2,
);
});
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
const RETRIES = 7;
const IS_LATEST = true;
await verifyReleaseOnNpm('0.77.0', IS_LATEST, RETRIES);
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
'0.77.0',
'latest',
7,
);
});
});
});
+29 -41
View File
@@ -48,96 +48,84 @@ module.exports = async (github, context, labelWithContext) => {
switch (labelWithContext.label) {
case 'Type: Invalid':
await addComment(
`| :warning: | Issue is Invalid |\n` +
`| --- | --- |\n` +
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
`> [!CAUTION]\n` +
`> **Invalid issue**: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.`,
);
await closeIssue();
return;
case 'Type: Question':
await addComment(
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
);
await closeIssue();
return;
case 'Type: Docs':
await addComment(
`| :warning: | Documentation Issue |\n` +
`| --- | --- |\n` +
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
`> [!NOTE]\n` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
);
await closeIssue();
return;
case 'Resolution: For Stack Overflow':
await addComment(
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
`> [!NOTE]\n` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
);
await closeIssue();
return;
case 'Type: Docs':
await addComment(
`> [!NOTE]\n` +
`> **Docs issue**: This issue looks like an issue related to our docs. Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
);
await closeIssue();
return;
case 'Type: Expo':
await addComment(
`| :warning: | Issue is Related to Expo |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
`> [!NOTE]\n` +
`> **Expo related**: It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
);
await closeIssue();
return;
case 'Needs: Issue Template':
await addComment(
`| :warning: | Missing Required Fields |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
`> [!WARNING]\n` +
`> **Missing issue template**: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A&projects=&template=bug_report.yml). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.`,
);
await requestAuthorFeedback();
return;
case 'Needs: Environment Info':
await addComment(
`| :warning: | Missing Environment Information |\n` +
`| --- | --- |\n` +
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
`> [!WARNING]\n` +
`> **Missing info**: It looks like your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console.`,
);
await requestAuthorFeedback();
return;
case 'Newer Patch Available':
await addComment(
`| :warning: | Newer Version of React Native is Available! |\n` +
`| --- | --- |\n` +
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |`,
`> [!TIP]\n` +
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
);
return;
case 'Needs: Version Info':
await addComment(
`| :warning: | Add or Reformat Version Info |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
`> [!WARNING]\n` +
`> **Could not parse version**: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.`,
);
await requestAuthorFeedback();
return;
case 'Needs: Repro':
await addComment(
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
`> [!WARNING]\n` +
`> **Missing reproducer**: We could not detect a reproducible example in your issue report. Please provide either: <br/><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/upgrade related: a project using our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li><li>Otherwise send us a Pull Request with the [RNTesterPlayground.js](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js) edited to reproduce your bug.</li></ul>`,
);
await requestAuthorFeedback();
return;
case 'Type: Unsupported Version':
await addComment(
`| :warning: | Unsupported Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
`> [!WARNING]\n` +
`> **Unsupported version**: It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
);
await requestAuthorFeedback();
return;
case 'Type: Too Old Version':
await addComment(
`| :warning: | Too Old Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
`> [!CAUTION]\n` +
`> **Too old version**: It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
);
await closeIssue();
return;
@@ -4,8 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook}
GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native}
GITHUB_OWNER=-facebook
GITHUB_REPO=-react-native
export GITHUB_OWNER
export GITHUB_REPO
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# 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.
GITHUB_OWNER=-facebook
GITHUB_REPO=-react-native
export GITHUB_OWNER
export GITHUB_REPO
if [ -x "$(command -v shellcheck)" ]; then
IFS=$'\n'
find . \
-type f \
-not -path "*node_modules*" \
-not -path "*third-party*" \
-name '*.sh' \
-exec sh -c 'shellcheck "$1"' -- {} \;
else
echo 'shellcheck is not installed. See https://github.com/facebook/react-native/wiki/Development-Dependencies#shellcheck for instructions.'
exit 1
fi
+1 -25
View File
@@ -9,11 +9,6 @@
const NEEDS_REPRO_LABEL = 'Needs: Repro';
const NEEDS_AUTHOR_FEEDBACK_LABEL = 'Needs: Author Feedback';
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
const NEEDS_REPRO_MESSAGE =
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
const SKIP_ISSUES_OLDER_THAN = '2023-07-01T00:00:00Z';
module.exports = async (github, context) => {
@@ -25,7 +20,6 @@ module.exports = async (github, context) => {
const issue = await github.rest.issues.get(issueData);
const comments = await github.rest.issues.listComments(issueData);
const author = issue.data.user.login;
const issueDate = issue.data.created_at;
@@ -43,10 +37,6 @@ module.exports = async (github, context) => {
return;
}
const botComment = comments.data.find(comment =>
comment.body.includes(NEEDS_REPRO_HEADER),
);
const entities = [issue.data, ...comments.data];
// Look for Snack or a GH repo associated with the user that added an issue or comment
@@ -74,25 +64,11 @@ module.exports = async (github, context) => {
throw error;
}
}
if (!botComment) return;
await github.rest.issues.deleteComment({
...issueData,
comment_id: botComment.id,
});
} else {
await github.rest.issues.addLabels({
...issueData,
labels: [NEEDS_REPRO_LABEL, NEEDS_AUTHOR_FEEDBACK_LABEL],
});
if (botComment) return;
await github.rest.issues.createComment({
...issueData,
body: NEEDS_REPRO_MESSAGE,
});
}
};
@@ -101,7 +77,7 @@ function containsPattern(body, pattern) {
return body.search(regexp) !== -1;
}
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
async function hasMaintainerChangedLabel(github, issueData, author) {
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
@@ -7,7 +7,7 @@
set -e
# Make sure we don't introduce accidental references to PATENTS.
EXPECTED='scripts/circleci/check_license.sh'
EXPECTED='.github/workflow-scripts/check_license.sh'
ACTUAL=$(git grep -l PATENTS)
if [ "$EXPECTED" != "$ACTUAL" ]; then
+53 -9
View File
@@ -8,6 +8,7 @@
*/
const childProcess = require('child_process');
const fs = require('fs');
const usage = `
=== Usage ===
@@ -33,6 +34,38 @@ const MAESTRO_FLOW = args[2];
const IS_DEBUG = args[3] === 'debug';
const WORKING_DIRECTORY = args[4];
const MAX_ATTEMPTS = 3;
async function executeFlowWithRetries(flow, currentAttempt) {
try {
console.info(`Executing flow: ${flow}`);
const timeout = 1000 * 60 * 10; // 10 minutes
childProcess.execSync(
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${flow} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
{stdio: 'inherit', timeout},
);
} catch (err) {
if (currentAttempt < MAX_ATTEMPTS) {
console.info(`Retrying...`);
await executeFlowWithRetries(flow, currentAttempt + 1);
} else {
throw err;
}
}
}
async function executeFlowInFolder(flowFolder) {
const files = fs.readdirSync(flowFolder);
for (const file of files) {
const filePath = `${flowFolder}/${file}`;
if (fs.lstatSync(filePath).isDirectory()) {
await executeFlowInFolder(filePath);
} else {
await executeFlowWithRetries(filePath, 0);
}
}
}
async function main() {
console.info('\n==============================');
console.info('Running tests for Android with the following parameters:');
@@ -55,15 +88,21 @@ async function main() {
stdio: 'ignore',
detached: true,
});
metroProcess.unref();
console.info(`- Metro PID: ${metroProcess.pid}`);
}
console.info('Wait For Metro to Start');
await sleep(5000);
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'});
if (IS_DEBUG) {
console.info('Wait For App to warm from Metro');
await sleep(10000);
}
console.info('Start recording to /sdcard/screen.mp4');
childProcess
.exec('adb shell screenrecord /sdcard/screen.mp4', {
@@ -75,10 +114,15 @@ async function main() {
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'},
);
//check if MAESTRO_FLOW is a folder
if (
fs.existsSync(MAESTRO_FLOW) &&
fs.lstatSync(MAESTRO_FLOW).isDirectory()
) {
await executeFlowInFolder(MAESTRO_FLOW);
} else {
await executeFlowWithRetries(MAESTRO_FLOW, 0);
}
} catch (err) {
error = err;
} finally {
@@ -88,15 +132,15 @@ async function main() {
if (IS_DEBUG && metroProcess != null) {
const pid = metroProcess.pid;
console.info(`Kill Metro. PID: ${pid}`);
process.kill(-pid);
process.kill(pid);
console.info(`Metro Killed`);
process.exit();
}
}
if (error) {
throw error;
}
process.exit();
}
function sleep(ms) {
+176
View File
@@ -0,0 +1,176 @@
/**
* 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 fs = require('fs');
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} jsengine - The JSEngine to use for the test
@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 !== 6) {
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 JS_ENGINE = args[3];
const IS_DEBUG = args[4] === 'Debug';
const WORKING_DIRECTORY = args[5];
const MAX_ATTEMPTS = 5;
function launchSimulator(simulatorName) {
console.log(`Launching simulator ${simulatorName}`);
try {
childProcess.execSync(`xcrun simctl boot "${simulatorName}"`);
} catch (error) {
if (
!error.message.includes('Unable to boot device in current state: Booted')
) {
throw error;
}
}
}
function installAppOnSimulator(appPath) {
console.log(`Installing app at path ${appPath}`);
childProcess.execSync(`xcrun simctl install booted "${appPath}"`);
}
function extractSimulatorUDID() {
console.log('Retrieving device UDID');
const command = `xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid'`;
const udid = String(childProcess.execSync(command)).trim();
console.log(`UDID is ${udid}`);
return udid;
}
function bringSimulatorInForeground() {
console.log('Bringing simulator in foreground');
childProcess.execSync('open -a simulator');
}
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
async function launchAppOnSimulator(appId, udid, isDebug) {
console.log('Launch the app');
childProcess.execSync(`xcrun simctl launch "${udid}" "${appId}"`);
if (isDebug) {
console.log('Wait for metro to warm');
await sleep(20 * 1000);
}
}
function startVideoRecording(jsengine, currentAttempt) {
console.log(
`Start video record using pid: video_record_${jsengine}_${currentAttempt}.pid`,
);
const recordingArgs =
`simctl io booted recordVideo video_record_${jsengine}_${currentAttempt}.mov`.split(
' ',
);
const recordingProcess = childProcess.spawn('xcrun', recordingArgs, {
detached: true,
stdio: 'ignore',
});
return recordingProcess;
}
function stopVideoRecording(recordingProcess) {
if (!recordingProcess) {
console.log("Passed a null recording process. Can't kill it");
return;
}
console.log(`Stop video record using pid: ${recordingProcess.pid}`);
recordingProcess.kill('SIGINT');
}
function executeTestsWithRetries(
appId,
udid,
maestroFlow,
jsengine,
currentAttempt,
) {
const recProcess = startVideoRecording(jsengine, currentAttempt);
try {
const timeout = 1000 * 60 * 10; // 10 minutes
const command = `$HOME/.maestro/bin/maestro --udid="${udid}" test "${maestroFlow}" --format junit -e APP_ID="${appId}"`;
console.log(command);
childProcess.execSync(`MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 ${command}`, {
stdio: 'inherit',
timeout,
});
stopVideoRecording(recProcess);
} catch (error) {
// Can't put this in the finally block because it will be executed after the
// recursive call of executeTestsWithRetries
stopVideoRecording(recProcess);
if (currentAttempt < MAX_ATTEMPTS) {
executeTestsWithRetries(
appId,
udid,
maestroFlow,
jsengine,
currentAttempt + 1,
);
} else {
console.error(`Failed to execute flow after ${MAX_ATTEMPTS} attempts.`);
throw error;
}
}
}
async function main() {
console.info('\n==============================');
console.info('Running tests for iOS with the following parameters:');
console.info(`APP_PATH: ${APP_PATH}`);
console.info(`APP_ID: ${APP_ID}`);
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
console.info(`JS_ENGINE: ${JS_ENGINE}`);
console.info(`IS_DEBUG: ${IS_DEBUG}`);
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
console.info('==============================\n');
const simulatorName = 'iPhone 15 Pro';
launchSimulator(simulatorName);
installAppOnSimulator(APP_PATH);
const udid = extractSimulatorUDID();
bringSimulatorInForeground();
await launchAppOnSimulator(APP_ID, udid, IS_DEBUG);
executeTestsWithRetries(APP_ID, udid, MAESTRO_FLOW, JS_ENGINE, 1);
console.log('Test finished');
process.exit(0);
}
main();
+16 -34
View File
@@ -7,7 +7,8 @@
* @format
*/
const {run, sleep, getNpmPackageInfo, log} = require('./utils.js');
const {run, sleep, log} = require('./utils.js');
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
const TAG_AS_LATEST_REGEX = /#publish-packages-to-npm&latest/;
@@ -42,7 +43,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => {
await github.rest.actions.createWorkflowDispatch({
owner: 'react-native-community',
repo: 'template',
workflow_id: 'release.yml',
workflow_id: 'release.yaml',
ref,
inputs: {
dry_run: dryRun,
@@ -53,8 +54,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => {
});
};
const SLEEP_S = 10;
const MAX_RETRIES = 3 * 6; // 3 minutes
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
const TEMPLATE_NPM_PKG = '@react-native-community/template';
/**
@@ -68,36 +68,18 @@ module.exports.verifyPublishedTemplate = async (
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}`);
try {
if (version.startsWith('v')) {
version = version.slice(1);
}
await sleep(SLEEP_S);
await verifyPublishedPackage(
TEMPLATE_NPM_PKG,
version,
latest ? 'latest' : null,
retries,
);
} catch (e) {
console.error(e.message);
process.exit(1);
}
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);
};
+14 -10
View File
@@ -9,21 +9,25 @@
const {execSync} = require('child_process');
function run(...cmd) {
return execSync(cmd, 'utf8').toString().trim();
const log = (...args) => console.log(...args);
async function getNpmPackageInfo(pkg, versionOrTag) {
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
resp.json(),
);
}
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 =>
res.json(),
);
function run(cmd) {
return execSync(cmd, 'utf8').toString().trim();
}
module.exports.getNpmPackageInfo = getNpmPackageInfo;
module.exports.log = (...args) => console.log(...args);
module.exports = {
log,
getNpmPackageInfo,
sleep,
run,
};
@@ -0,0 +1,63 @@
/**
* 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 {log, getNpmPackageInfo, sleep} = require('./utils');
const SLEEP_S = 10;
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
async function verifyPublishedPackage(
packageName,
version,
tag = null,
retries = MAX_RETRIES,
) {
log(`🔍 Is ${packageName}@${version} on npm?`);
let count = retries;
while (count-- > 0) {
try {
const json = await getNpmPackageInfo(packageName, tag ? tag : version);
log(`🎉 Found ${packageName}@${version} on npm`);
if (!tag) {
return;
}
// check for next tag
if (tag === 'next' && json.version === version) {
log(`🎉 ${packageName}@next → ${version} on npm`);
return;
}
// Check for latest tag
if (tag === 'latest' && json.version === version) {
log(`🎉 ${packageName}@latest → ${version} on npm`);
return;
}
log(
`🐌 ${packageName}@${tag}${json.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 ${packageName}@${version} on npm`;
if (tag) {
msg += ` and ${tag} tag points to this version.`;
}
log(msg);
process.exit(1);
}
module.exports = {
verifyPublishedPackage,
};
@@ -0,0 +1,30 @@
/**
* 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, log} = require('./utils.js');
const {verifyPublishedPackage} = require('./verifyPublishedPackage.js');
const REACT_NATIVE_NPM_PKG = 'react-native';
const MAX_RETRIES = 3 * 6; // 18 attempts. Waiting between attempt: 10 s. Total time: 3 mins.
/**
* Will verify that @latest, @next 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.verifyReleaseOnNpm = async (
version,
latest = false,
retries = MAX_RETRIES,
) => {
const tag = version.includes('-rc.') ? 'next' : latest ? 'latest' : null;
if (version.startsWith('v')) {
version = version.slice(1);
}
await verifyPublishedPackage(REACT_NATIVE_NPM_PKG, version, tag, retries);
};
@@ -10,11 +10,6 @@
module.exports = async (github, context) => {
const issue = context.payload.issue;
// Ignore issues using upgrade template (they use a special label)
if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) {
return;
}
const issueVersionUnparsed =
getReactNativeVersionFromIssueBodyIfExists(issue);
const issueVersion = parseVersionFromString(issueVersionUnparsed);
+6
View File
@@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check nightly
run: |
TODAY=$(date "+%Y%m%d")
@@ -24,3 +26,7 @@ jobs:
else
echo 'Nightly Worked, All Good!'
fi
test-libraries:
uses: ./.github/workflows/test-libraries-on-nightlies.yml
needs: check-nightly
+2 -3
View File
@@ -18,9 +18,8 @@ jobs:
if: github.repository == 'facebook/react-native'
steps:
- uses: actions/checkout@v4
- name: Run Yarn Install on Root
run: yarn install
working-directory: .
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Danger
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: packages/react-native-bots
@@ -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
+27
View File
@@ -0,0 +1,27 @@
name: Monitor React Native New Issues
on:
schedule:
- cron: "0 0,6,12,18 * * *"
workflow_dispatch:
jobs:
monitor-issues:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Monitor New Issues
uses: react-native-community/repo-monitor@v1.0.1
with:
task: "monitor-issues"
git_secret: ${{ secrets.GITHUB_TOKEN }}
notifier: "discord"
fetch_data_interval: 6
repo_owner: "facebook"
repo_name: "react-native"
discord_webhook_url: "${{ secrets.DISCORD_WEBHOOK_URL }}"
discord_id_type: "role"
discord_ids: "1339243367841927228"
+8 -2
View File
@@ -100,6 +100,9 @@ jobs:
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
@@ -153,6 +156,7 @@ jobs:
uses: ./.github/actions/build-android
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
build_npm_package:
runs-on: 8-core-ubuntu
@@ -164,13 +168,14 @@ jobs:
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
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.
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
@@ -182,9 +187,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Publish NPM PAckage
- name: Build and Publish NPM Package
uses: ./.github/actions/build-npm-package
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
+183
View File
@@ -0,0 +1,183 @@
name: Prebuild iOS
on:
workflow_call: # this directive allow us to call this workflow from other workflows
jobs:
prepare_workspace:
name: Prepare workspace
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore cache if present
id: restore-ios-prebuilds
uses: actions/cache/restore@v4
with:
path: packages/react-native/third-party/
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
- name: Yarn Install
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
- name: Prepare Dependencies
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
run: |
node scripts/releases/prepare-ios-prebuilds.js -s
- name: Generate Package.swift
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
run: |
node scripts/releases/prepare-ios-prebuilds.js -w
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: ios-prebuilds-workspace
path: packages/react-native/third-party/
- name: Save Cache
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
path: packages/react-native/third-party/
build-apple-slices:
name: Build Apple Slice
runs-on: macos-14
needs: [prepare_workspace]
strategy:
fail-fast: false
matrix:
flavor: ['Debug', 'Release']
slice: ['ios',
'ios-simulator',
'macos',
'mac-catalyst',
'tvos',
'tvos-simulator',
'xros',
'xros-simulator']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.1'
- name: Restore slice folder
id: restore-slice-folder
uses: actions/cache/restore@v4
with:
path: packages/react-native/third-party/.build/Build/Products
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
- name: Yarn Install
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
- name: Restore workspace
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
name: ios-prebuilds-workspace
path: packages/react-native/third-party/
- name: Print third-party folder structure
run: ls -lR packages/react-native/third-party
- name: Install VisionOS
if: ${{ steps.restore-slice-folder.outputs.cache-hit != 'true' && (matrix.slice == 'xros' || matrix.slice == 'xros-simulator') }}
run: |
# https://github.com/actions/runner-images/issues/10559
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Build slice ${{ matrix.slice }} for ${{ matrix.flavor }}
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
run: node scripts/releases/prepare-ios-prebuilds.js -b -p ${{ matrix.slice }} -r ${{ matrix.flavor }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: prebuild-slice-${{ matrix.flavor }}-${{ matrix.slice }}
path: |
packages/react-native/third-party/.build/Build/Products
- name: Save Cache
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
path: |
packages/react-native/third-party/.build/Build/Products
create-xcframework:
name: Prepare XCFramework
runs-on: macos-14
needs: [build-apple-slices]
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.1'
- name: Restore XCFramework
id: restore-xcframework
uses: actions/cache/restore@v4
with:
path: |
packages/react-native/third-party/
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
# If cache hit, we already have our binary. We don't need to do anything.
- name: Yarn Install
if: steps.restore-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
- name: Download slices
if: steps.restore-xcframework.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
pattern: prebuild-slice-${{ matrix.flavor }}-*
path: packages/react-native/third-party/.build/Build/Products
merge-multiple: true
- name: Create XCFramework
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: node scripts/releases/prepare-ios-prebuilds.js -c
- name: Compress and Rename XCFramework
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: |
tar -cz -f packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz \
packages/react-native/third-party/ReactNativeDependencies.xcframework
- name: Show Symbol folder content
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: ls -lR packages/react-native/third-party/Symbols
- name: Compress and Rename dSYM
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: |
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
- name: Upload XCFramework Artifact
uses: actions/upload-artifact@v4
with:
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
- name: Upload dSYM Artifact
uses: actions/upload-artifact@v4
with:
name: ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
path: |
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
- name: Save XCFramework in Cache
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
uses: actions/cache/save@v4
with:
path: |
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
@@ -17,7 +17,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run Yarn Install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Build packages
run: yarn build
- name: Set NPM auth token
+19 -4
View File
@@ -96,6 +96,8 @@ jobs:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
build_hermesc_linux:
runs-on: ubuntu-latest
@@ -150,6 +152,7 @@ jobs:
uses: ./.github/actions/build-android
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
build_npm_package:
runs-on: 8-core-ubuntu
@@ -161,13 +164,14 @@ jobs:
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
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.
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
@@ -183,12 +187,13 @@ jobs:
with:
fetch-depth: 0
fetch-tags: true
- name: Build and Publish NPM PAckage
- name: Build and Publish NPM Package
uses: ./.github/actions/build-npm-package
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Publish @react-native-community/template
id: publish-template-to-npm
uses: actions/github-script@v6
@@ -205,12 +210,22 @@ jobs:
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {verifyPublished, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
const {verifyPublishedTemplate, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
const version = "${{ github.ref_name }}"
await verifyPublished(version, isLatest());
await verifyPublishedTemplate(version, isLatest());
- name: Update rn-diff-purge to generate upgrade-support diff
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 }}\" }}"
- name: Verify Release is on NPM
timeout-minutes: 3
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {verifyReleaseOnNpm} = require('./.github/workflow-scripts/verifyReleaseOnNpm.js');
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
const version = "${{ github.ref_name }}";
await verifyReleaseOnNpm(version, isLatest());
+54 -20
View File
@@ -116,6 +116,9 @@ jobs:
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
test_ios_rntester_ruby_3_2_0:
runs-on: macos-13
needs:
@@ -157,7 +160,7 @@ jobs:
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_rntester:
runs-on: macos-13
runs-on: macos-13-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
env:
@@ -169,6 +172,14 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
architecture: [NewArch, OldArch]
flavor: [Debug, Release]
exclude: # We don't want to test the Old Arch in Release for E2E
- jsengine: Hermes
architecture: OldArch
flavor: Release
- jsengine: JSC
architecture: OldArch
flavor: Release
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -181,12 +192,13 @@ jobs:
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
test_e2e_ios_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-13-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
[test_ios_rntester]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -200,21 +212,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run it
uses: ./.github/actions/test-ios-rntester
- name: Download App
uses: actions/download-artifact@v4
with:
jsengine: ${{ matrix.jsengine }}
architecture: ${{ matrix.architecture }}
run-unit-tests: "false"
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
run-e2e-tests: "true"
flavor: ${{ matrix.flavor }}
name: RNTesterApp-${{ matrix.architecture }}-${{ matrix.jsengine }}-${{ matrix.flavor }}
path: /tmp/RNTesterBuild/RNTester.app
- name: Check downloaded folder content
run: ls -lR /tmp/RNTesterBuild
- name: Run E2E Tests
uses: ./.github/actions/maestro-ios
with:
app-path: "/tmp/RNTesterBuild/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTester.app"
app-path: "/tmp/RNTesterBuild/RNTester.app"
app-id: com.meta.RNTester.localDevelopment
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro/
@@ -233,6 +241,7 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [Debug, Release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -241,7 +250,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
@@ -277,7 +286,12 @@ jobs:
cd /tmp/RNTestProject/ios
bundle install
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH bundle exec pod install
NEW_ARCH_ENABLED=1
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
echo "Disable the New Architecture"
NEW_ARCH_ENABLED=0
fi
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
xcodebuild \
-scheme "RNTestProject" \
@@ -295,6 +309,7 @@ jobs:
maestro-flow: ./scripts/e2e/.maestro/
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
test_e2e_android_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
@@ -306,13 +321,14 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [debug, release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
@@ -351,6 +367,16 @@ jobs:
cd /tmp/RNTestProject
echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties
if [[ ${{matrix.architecture}} == "OldArch" ]]; then
echo "Disabling the New Architecture"
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
fi
if [[ ${{matrix.jsengine}} == "JSC" ]]; then
echo "Using JSC instead of Hermes"
sed -i 's/hermesEnabled=true/hermesEnabled=false/' android/gradle.properties
fi
# Build
cd android
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
@@ -358,6 +384,7 @@ jobs:
- name: Run E2E Tests
uses: ./.github/actions/maestro-android
timeout-minutes: 60
with:
app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk
app-id: com.rntestproject
@@ -366,6 +393,7 @@ jobs:
install-java: 'false'
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
build_hermesc_linux:
runs-on: ubuntu-latest
@@ -419,10 +447,11 @@ jobs:
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
test_e2e_android_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: ubuntu-latest
runs-on: 4-core-ubuntu
needs: [build_android]
strategy:
fail-fast: false
@@ -435,7 +464,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download APK
uses: actions/download-artifact@v4
with:
@@ -445,6 +474,7 @@ jobs:
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
- name: Run E2E Tests
uses: ./.github/actions/maestro-android
timeout-minutes: 60
with:
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/app-${{ matrix.jsengine }}-x86-${{ matrix.flavor }}.apk
app-id: com.facebook.react.uiapp
@@ -462,6 +492,7 @@ jobs:
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
]
container:
image: reactnativecommunity/react-native-android:latest
@@ -478,6 +509,7 @@ jobs:
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
test_android_helloworld:
runs-on: 4-core-ubuntu
@@ -516,8 +548,10 @@ jobs:
path: /tmp/maven-local
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Prepare the Helloworld application
shell: bash
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
@@ -594,7 +628,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ["20", "18"]
node-version: ["22", "20", "18"]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -0,0 +1,75 @@
name: Test Libraries on Nightlies
on:
workflow_call:
jobs:
test-library-on-nightly-android:
name: "[Android] ${{ matrix.library }}"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: android
test-library-on-nightly-ios:
name: "[iOS] ${{ matrix.library }}"
runs-on: macos-13-large
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: ios
@@ -1,45 +0,0 @@
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 }}
@@ -1,18 +0,0 @@
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"
+13 -3
View File
@@ -68,6 +68,7 @@ local.properties
*.iml
/packages/react-native/android/*
!/packages/react-native/android/README.md
.kotlin/
# Node
node_modules
@@ -124,7 +125,7 @@ vendor/
!/packages/rn-tester/Pods/__offline_mirrors_jsc__
# @react-native/codegen
/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec
/packages/react-native/React/FBReactNativeSpec/
/packages/react-native-codegen/lib
/packages/react-native-codegen/tmp/
/packages/react-native/ReactCommon/react/renderer/components/rncore/
@@ -140,6 +141,11 @@ vendor/
/packages/react-native/sdks/hermesc
/packages/react-native/sdks/hermes-engine/hermes-engine-from-local-source-dir.tar.gz
# iOS prebuilds
/packages/react-native/third-party/
fix_*.patch
*.xcframework
# Visual Studio Code (config dir - if present, this merges user defined
# workspace settings on top of react-native.code-workspace)
/.vscode
@@ -153,5 +159,9 @@ vendor/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# CircleCI
.circleci/generated_config.yml
# Jest Integration
/packages/react-native-fantom/build/
/packages/react-native-fantom/tester/build/
# [Experimental] Generated TS type definitions
/packages/**/types_generated/
+1
View File
@@ -7,5 +7,6 @@
packages/*/dist
vendor
packages/**/types_generated/
packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
+705
View File
@@ -1,5 +1,646 @@
# Changelog
## v0.78.0
### Breaking
- **Codegen:** Separate component array types and command array types ([825492b199](https://github.com/facebook/react-native/commit/825492b1999b62de708e6f40d5d5de8d3d7cb8a9) by [@elicwhite](https://github.com/elicwhite))
- **DevTools:** The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`. ([1a9780f0e3](https://github.com/facebook/react-native/commit/1a9780f0e3714ac18ffae34cb67376c711b0e031) by [@huntie](https://github.com/huntie))
#### Android specific
- **APIs:** Changed visibility of `FrescoBasedReactTextInlineImageViewManager` to internal ([d5f33c19cb](https://github.com/facebook/react-native/commit/d5f33c19cb33e2f2c7d2470cc90872c1f065f20d) by [@alanleedev](https://github.com/alanleedev))
- **APIs:** Migrating pointerEvents API breaks compatibility for kotlin usages of this api as a val ([45e4a3afce](https://github.com/facebook/react-native/commit/45e4a3afceb4be3047cd01a60ec2c9f806ed30fe) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Convert `RootView` to Kotlin ([21c9491926](https://github.com/facebook/react-native/commit/21c94919260a68409f82081740169d0409e78933) by [@fabriziocucci](https://github.com/fabriziocucci))
- **APIs:** Delete unused abstract class `GuardedResultAsyncTask` ([67bff8734f](https://github.com/facebook/react-native/commit/67bff8734f4b92fe399910eecad5b67511a749c1) by [@mdvacca](https://github.com/mdvacca))
- **APIs**: Delete deprecated class `FabricViewStateManager` ([b25b65ba19](https://github.com/facebook/react-native/commit/b25b65ba19f3c674fd2efe5c01123ccc0ae55cbf) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Removed `ComponentNameResolver` from public API ([a4849cb3d6](https://github.com/facebook/react-native/commit/a4849cb3d6f4245d15eb3812e417a9f4248bb3a1) by [@mdvacca](https://github.com/mdvacca))
#### iOS specific
- **Image:** Change Image load event size info from logical size to pixel ([09995fc874](https://github.com/facebook/react-native/commit/09995fc8741cfdc6095d09627262b4f6fbbaafc2) by [@zhongwuzw](https://github.com/zhongwuzw))
### Added
- **C++:** Added `RawValue(Runtime*, jsi::Value&)` constructor to make a `RawValue` from a `jsi::Value`. ([03d2186ace](https://github.com/facebook/react-native/commit/03d2186ace2cb17c676b7763d5a545759a658b77) by [@hannojg](https://github.com/hannojg))
- **Codegen:** Include cxx modules in codegen schema ([cf5ab03d43](https://github.com/facebook/react-native/commit/cf5ab03d4324b7e3fce38f9eacc96da82b11b68a) by [@elicwhite](https://github.com/elicwhite))
- **Deps:** Add `jest-diff v29.7.0` to devDependencies ([b27bd00a38](https://github.com/facebook/react-native/commit/b27bd00a389295250ec003357df713ebf306374b) by [@andrewdacenko](https://github.com/andrewdacenko))
- **Logging:** Add support for the second parameter of `console.table` to specify a list of columns to print in the table. ([fd0894b1c7](https://github.com/facebook/react-native/commit/fd0894b1c7fcb20dd213ec1e93aafef25935d709) by [@rubennorte](https://github.com/rubennorte))
- **Logging:** Add "jsEngine: hermes" to JS runtime Error prototype ([85bdd75828](https://github.com/facebook/react-native/commit/85bdd75828f85230aaa90ed510666457c46f996c) by Maddie Lord)
- **Metro:** Add opt in for legacy Metro log streaming via `--client-logs` flag ([86db4fa90b](https://github.com/facebook/react-native/commit/86db4fa90b90919867a9b66f6caa28f77fba3a37) by [@huntie](https://github.com/huntie))
- **Text:** Added `pointerEvents` to `TextProps` type. ([3efbe33ce0](https://github.com/facebook/react-native/commit/3efbe33ce03f846932406742528652eb695b957d) by [@hyochan](https://github.com/hyochan))
#### Android specific
- **ActivityIndicator:** setting `resource-id` from the `testID` prop ([87b1bad45e](https://github.com/facebook/react-native/commit/87b1bad45e4eb730ea07686a2b2558253c60d3b7) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Codegen:** Fixing schema types for component command params of Arrays ([25c673e357](https://github.com/facebook/react-native/commit/25c673e35784d8d8c49555af104b9b4d8d37973d) by [@elicwhite](https://github.com/elicwhite))
- **Gradle:** Make the addition of JitPack repository configurable ([a98528e609](https://github.com/facebook/react-native/commit/a98528e609ff0ace4b7bc82f3aa273b7e3fa6443) by [@cortinico](https://github.com/cortinico))
- **Logging:** SoftException categories ([c832f94cf7](https://github.com/facebook/react-native/commit/c832f94cf713d0cb7616ef095f38583979e1cf43) by Thomas Nardone)
- **Logging:** Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null ([c2fd35a442](https://github.com/facebook/react-native/commit/c2fd35a4429c752dc2d10a789e4c5f48d22b1eeb) by Maddie Lord)
- **Runtime:** Added `getState` method for `StateWrapperImpl` ([ed36e896ac](https://github.com/facebook/react-native/commit/ed36e896ac34fcbefece87456dbdfdff30d22ad5) by [@hannojg](https://github.com/hannojg))
#### iOS specific
- **Codegen:** Add the `source` parameter to generate-codegen-artifacts to avoid generating files not needed by libraries. ([98b8f17811](https://github.com/facebook/react-native/commit/98b8f178110472e5fed97de80766c03b0b5e988c) by [@cipolleschi](https://github.com/cipolleschi))
- **Initialization:** Implement ReactNativeFactory ([081be01a5d](https://github.com/facebook/react-native/commit/081be01a5dd24d0a398c6aa8297575502a17d5ec) by [@okwasniewski](https://github.com/okwasniewski))
- **Text:** Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS ([1763321c89](https://github.com/facebook/react-native/commit/1763321c8960d30ddc4d3464a0fffdecdd44617a) by [@cxa](https://github.com/cxa))
- **TextInput:** Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads. ([0154372b93](https://github.com/facebook/react-native/commit/0154372b93eb1b02f0c62f2a75c95f4fc6a9f3e8) by [@rezkiy37](https://github.com/rezkiy37))
### Changed
- **Deps:** Bump Hermes ([0c8e15e8bb](https://github.com/facebook/react-native/commit/0c8e15e8bb16ec279290d2390caf75e83d52f518) by [@cipolleschi](https://github.com/cipolleschi))
- **Flow:** Improved types in `BoxInspector` and refactored a code ([f832c450a5](https://github.com/facebook/react-native/commit/f832c450a52c4c9d61c1d6b609fcad1332613556) by [@coado](https://github.com/coado))
- **Flow:** Improved types in StyleInspector and refactored a code ([49e5c58c59](https://github.com/facebook/react-native/commit/49e5c58c595265c9fffc84741aab6363d291f1f5) by [@coado](https://github.com/coado))
- **Flow:** Improved types in ElementBox and refactored a code ([2959d49e8d](https://github.com/facebook/react-native/commit/2959d49e8d09663f9ac437ffcb66d1c99162c6d0) by [@coado](https://github.com/coado))
- **Flow:** Improve types on BorderBox ([48a7840919](https://github.com/facebook/react-native/commit/48a784091989c695e3432cb8ba657139eb9f5e99) by [@coado](https://github.com/coado))
- **Flow:** Improve types on DrawerLayoutAndroid ([b5155fba89](https://github.com/facebook/react-native/commit/b5155fba895411e290faeeea06180fce24079f78) by [@huntie](https://github.com/huntie))
- **Logging:** Improved formatting of values logged via `console.table` (including Markdown format). ([7154c62afb](https://github.com/facebook/react-native/commit/7154c62afb5371f3f861663826792e41229c344a) by [@rubennorte](https://github.com/rubennorte))
- **Runtime:** Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic. ([8681fc2ab2](https://github.com/facebook/react-native/commit/8681fc2ab20aa1e5937a0bf3fc58ed03c3e0ee23) by [@lunaleaps](https://github.com/lunaleaps))
- **Runtime:** ([9aa21b5e87](https://github.com/facebook/react-native/commit/9aa21b5e8765f14a9806eac435636b87f62178cc) by [@lunaleaps](https://github.com/lunaleaps))
- **TypeScript:** Upgrading `typescript-config` module version to `esnext` ([5370347f54](https://github.com/facebook/react-native/commit/5370347f54719f318a4e032aba6cbf2269e7c3d7) by [@mateoguzmana](https://github.com/mateoguzmana))
- **VirtualizedList:** Fix item disappearing with scroll in VirtualizedList ([df7b6ae092](https://github.com/facebook/react-native/commit/df7b6ae092d03385ebd05efd0f068c59e727f723) by [@Tom910](https://github.com/Tom910))
- **Yoga:** Update YGNodeStyleGetGap to return YGValue ([331d99a941](https://github.com/facebook/react-native/commit/331d99a94154678848628122e8fe3373ee67fb9b) by [@heoblitz](https://github.com/heoblitz))
#### Android specific
- **APIs:** Introduce new public API `ViewManagerInterface` ([40a0cdbc99](https://github.com/facebook/react-native/commit/40a0cdbc99746f18ca15c48f3d8f03cdad1635af) by [@mdvacca](https://github.com/mdvacca))
- **Deps:** Bumped Android Gradle Plugin (AGP) to 8.8.0 ([4c7c836ebf](https://github.com/facebook/react-native/commit/4c7c836ebf956c13fa327170adaec43a076226e7) by [@cortinico](https://github.com/cortinico))
- **Deps:** Bump Gradle to 8.12 ([5e6478954c](https://github.com/facebook/react-native/commit/5e6478954c77f64a9086757ed4a879e83a1ab404) by [@cortinico](https://github.com/cortinico))
- **Deps:** Update Fresco to 3.6.0 ([819b5c2c8d](https://github.com/facebook/react-native/commit/819b5c2c8dfad620152b159838575b6c03e18ffe) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Deps:** Migrate jsc-android to mavenCentral ([e42a3a6b84](https://github.com/facebook/react-native/commit/e42a3a6b842d71fc25419c02f6015863fa019f05) by [@Kudo](https://github.com/Kudo))
- **Image:** Replaced custom XML decoder with Fresco's built-in decoder ([6feb90bb29](https://github.com/facebook/react-native/commit/6feb90bb290ab460df8df2f6f01531a77aac9008) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Kotlin:** Migrate `ComponentNameResolver` to kotlin ([385b9f4265](https://github.com/facebook/react-native/commit/385b9f4265316a1e1cf8627ea7ed3bed790cc8c5) by [@mdvacca](https://github.com/mdvacca))
- **Kotlin:** Migrate `ReactSwitchManager` to Kotlin ([b886bc4db9](https://github.com/facebook/react-native/commit/b886bc4db970d8c70de1596dc3f88bdc398de482) by [@krozniata](https://github.com/krozniata))
#### iOS specific
- **Accessibility:** Reduce memory allocations when computing `accessibilityLabel` ([74bdab8bd8](https://github.com/facebook/react-native/commit/74bdab8bd8be2413734004145507c0688232053e) by [@sparga](https://github.com/sparga))
- **CocoaPods:** Properly inherit OTHER_CPLUSPLUSLAGS ([fa03840e68](https://github.com/facebook/react-native/commit/fa03840e688067bf16a7fb60c00efdc9a1813f92) by [@WoLewicki](https://github.com/WoLewicki))
- **CocoaPods:** Pin 'concurrent-ruby' to a working version ([198adb47af](https://github.com/facebook/react-native/commit/198adb47af3676c85b35adb308c110c1d87120c8) by [@cipolleschi](https://github.com/cipolleschi))
### Removed
#### Android specific
- **APIs:** Made `ReactCookieJarContainer` internal. ([18ebea533d](https://github.com/facebook/react-native/commit/18ebea533d348329926bd7782bb55469aa228a4a) by [@javache](https://github.com/javache))
- **Config:** Remove as_const option (on by default) in fbsource ([e5a526ff44](https://github.com/facebook/react-native/commit/e5a526ff44c25afd935d117d6d4d342f210553a6) by [@panagosg7](https://github.com/panagosg7))
- **Flow:** Remove comment syntax from ReactNativeTypes ([a80baac58e](https://github.com/facebook/react-native/commit/a80baac58e9f2fc62829ab76b929f5c8b21c05a5) by [@hoxyq](https://github.com/hoxyq))
- **Metro:** Removed `JSCHeapCapture` module, deprecated PackagerCommandListener#onCaptureHeapCommand ([e06fa5d102](https://github.com/facebook/react-native/commit/e06fa5d1026843ec4a2ba3dd209652dc5290c0ba) by [@javache](https://github.com/javache))
### Fixed
- **Animations:** Removed unnecessary state updates in React to reflect the current state of looping animations. ([6059660c60](https://github.com/facebook/react-native/commit/6059660c607f5b6edba08a12906f0f9d6cb15d34) by [@rubennorte](https://github.com/rubennorte))
- **Animations:** Animation.stop() executes when `animatedShouldUseSingleOp` is enabled. ([746d584a23](https://github.com/facebook/react-native/commit/746d584a23f303493faa4f9d857ec542257a92ae) by [@javache](https://github.com/javache))
- **Animations:** Fix buttons becoming unresponsive when transform is animated ([2204ec94d4](https://github.com/facebook/react-native/commit/2204ec94d4b67a9ba559db3f54a5a1ef91e0f233) by [@sammy-SC](https://github.com/sammy-SC))
- **C++:** `JSBigFileString` fails for non-zero offset arguments ([7d0338cb0b](https://github.com/facebook/react-native/commit/7d0338cb0b24926aff648a4c8ba5d77b052010cc) by [@jwajgelt](https://github.com/jwajgelt))
- **Config:** Disable `react-in-jsx-scope` rule in eslint config ([ea56c432b7](https://github.com/facebook/react-native/commit/ea56c432b7a577d3805d1a7b4b46596799dd892e) by [@matinzd](https://github.com/matinzd))
- **Deps:** Fix peer dependencies on React types to React 19 ([4368368ef5](https://github.com/facebook/react-native/commit/4368368ef5c3f3d08a66ee6c13222f6d81a2d2df) by [@cipolleschi](https://github.com/cipolleschi))
- **Deps:** Add missing `invariant` dependency ([ee8088b615](https://github.com/facebook/react-native/commit/ee8088b6157837c239db47ac5bd3a8603ceefc3c) by [@tido64](https://github.com/tido64))
- **Fantom:** Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test. ([8696b79f73](https://github.com/facebook/react-native/commit/8696b79f73fec18a9e3785b9a2c150afc9965d76) by [@mijay](https://github.com/mijay))
- **Logging:** Modified `console.table` to avoid mutating the received argument. ([caa77fbe2b](https://github.com/facebook/react-native/commit/caa77fbe2b03e6969ae9b542d011f926a0ede3c7) by [@rubennorte](https://github.com/rubennorte))
- **Text:** Fixed `adjustsFontSizeToFit` not working for text with a single character ([47822e9048](https://github.com/facebook/react-native/commit/47822e90480d61e197a3f223e088ee88a0f38ad7) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture ([ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32](https://github.com/facebook/react-native/commit/ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32) by [@RickardZrinski](https://github.com/RickardZrinski))
#### Android specific
- **APIs** Re-introduce the deprecated constructor on ReactModuleInfo ([734730df75](https://github.com/facebook/react-native/commit/734730df75b3bdddeb5dbe65f4151cc92b988303) by [@cortinico](https://github.com/cortinico))
- **Dialog:** `FLAG_SECURE` not respected in Modal dialog ([7e029b0dcf](https://github.com/facebook/react-native/commit/7e029b0dcf6d1a6455a8a6343457b70e353d0ff6) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Events:** Fix crash for `setEventEmitterCallback` NoSuchMethodError on API lvl 26 ([7dcbc799eb](https://github.com/facebook/react-native/commit/7dcbc799eb2fb5792512b71320eafed08deec9ea) by [@cortinico](https://github.com/cortinico))
- **Gradle:** Fixed build issue when including mapbuffer jni headers in library code ([ecf17666ad](https://github.com/facebook/react-native/commit/ecf17666ad84e15d31944962e2d0e846a5670977) by [@hannojg](https://github.com/hannojg))
- **InteropLayer:** Fix execution of early InteropEvents ([4ed2b35bf6](https://github.com/facebook/react-native/commit/4ed2b35bf61426c81c9f8b30a142d77b44988fdb) by [@mdvacca](https://github.com/mdvacca))
- **JSC:** Fix JSC Debug instacrashing ([b10491a3c4](https://github.com/facebook/react-native/commit/b10491a3c457c802608758ca1fe659a72c18576b) by [@cortinico](https://github.com/cortinico))
- **JSC:**Fix JSC by avoiding use of unavailable `str.replaceAll()` ([b5b9e032c2](https://github.com/facebook/react-native/commit/b5b9e032c2b57aa44afb7141a879d83c8b889feb) by [@robhogan](https://github.com/robhogan))
- **Modal:** Setting `resource-id` from `testID` prop ([52b6592559](https://github.com/facebook/react-native/commit/52b65925595882d9b6c7f354a5ce3bfe3823738e) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Networking:** ReactOkHttpNetworkFetcher cache control headers getting overwritten by the rest of the headers ([81cb166d10](https://github.com/facebook/react-native/commit/81cb166d103f7caaa5135b5a1c66d4e978f3619f) by [@mateoguzmana](https://github.com/mateoguzmana))
- **DevTools:** Pass the bundle URL protocol when setting up HMR client on Android ([32fe244744](https://github.com/facebook/react-native/commit/32fe24474495f09f985a2c92e11103dd386f5fe3) by [@byCedric](https://github.com/byCedric))
- **Runtime:** Fix BackHandle callback undefined cause crash issue ([44705fe11b](https://github.com/facebook/react-native/commit/44705fe11bd9bb12c8f71d1e50a7b48e0af6a38d) by [@BleemIs42](https://github.com/BleemIs42))
- **Runtime:** Support Long values in WritableMap and WritableArray ([e7f943de2f](https://github.com/facebook/react-native/commit/e7f943de2fd71d2259ab53e7817d2dcf96559f7e) by [@WoLewicki](https://github.com/WoLewicki))
- **Runtime:** `SetColorScheme` should be called on the UI thread ([2aa79979d3](https://github.com/facebook/react-native/commit/2aa79979d3e4a54008f24c81b6c04553c98ff6b6) by lihaitao)
- **Style:** Fix background getting clipped when border-radius is set ([6d235853fb](https://github.com/facebook/react-native/commit/6d235853fb9e9ad4050ba5611d74921fa1b9c72d) by [@jorge-cab](https://github.com/jorge-cab))
- **Testing:** Handling `testID` correctly for horizontal scroll view ([81c74cd35f](https://github.com/facebook/react-native/commit/81c74cd35f9e40c8ad4663fc932d0dddeaa4bc19) by [@mateoguzmana](https://github.com/mateoguzmana))
- **TextInput:** Fix incorrect height of single line TextInputs without definite size ([9b646c8b7b](https://github.com/facebook/react-native/commit/9b646c8b7b9a23645b1563883768a9274897a1cd) by [@NickGerleman](https://github.com/NickGerleman))
#### iOS specific
- **C++:** Exclude Android HorizontalScrollContentView cxx component code ([4adaacb4f7](https://github.com/facebook/react-native/commit/4adaacb4f7cd136d5534c81fb9b8f5f2a0312d7f) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Ccache:** Fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts ([d31ac832c5](https://github.com/facebook/react-native/commit/d31ac832c5b866653f7179fd517427f7be11ad45) by [@ste7en](https://github.com/ste7en))
- **CocoaPods:** Resolve "Your project does not explicitly specify the CocoaPods master specs repo" `pod install` warning ([2f2281718a](https://github.com/facebook/react-native/commit/2f2281718a2ef905ffd15adf3b47a1b6b6fb8d95) by [@noway](https://github.com/noway))
- **Image:** Load images even when the extension is implicit ([b9f418e9bc](https://github.com/facebook/react-native/commit/b9f418e9bc35372438a34934254db985b7ad1840) by [@cipolleschi](https://github.com/cipolleschi))
- **Initialization:** Allow multiple RN instances to run at the same time ([444c7d4eff](https://github.com/facebook/react-native/commit/444c7d4eff3d4fbe25452c94cba7ffacb3c366cc) by [@cipolleschi](https://github.com/cipolleschi))
- **InteropLayer:** Avoid crashing the app when the InteropLayer can't find some methods in the native implementation ([3bd3f101b9](https://github.com/facebook/react-native/commit/3bd3f101b9dcff8551a2f8259ddeed9843fd69b8) by [@cipolleschi](https://github.com/cipolleschi))
- **InteropLayer:** Properly handle `null` value in TurboModule Interop layer ([ebfd7057af](https://github.com/facebook/react-native/commit/ebfd7057af049ebfbc593448918c70db37e39d48) by [@cipolleschi](https://github.com/cipolleschi))
- **JSC:** Fix Direct Debugging with JSC ([b04d17afca](https://github.com/facebook/react-native/commit/b04d17afcac82af1a47fd462a04fe4088d19b468) by [@Saadnajmi](https://github.com/Saadnajmi))
- **Keyboard:** Enable/disable keyboard shortcuts only on iOS ([8b0af4542e](https://github.com/facebook/react-native/commit/8b0af4542e6fd5628fefdc8e1699326c2225c3f0) by [@okwasniewski](https://github.com/okwasniewski))
- **RefreshControl:** Fix app becoming unresponsive when `RefreshControl` is used inside of <Modal /> ([6cb2684b43](https://github.com/facebook/react-native/commit/6cb2684b4343bd8698b9770c0f6ef8812683c783) by [@sammy-SC](https://github.com/sammy-SC))
- **DevTools:** Restore "Paused in debugger" overlay icon ([f30c46efbd](https://github.com/facebook/react-native/commit/f30c46efbd964d367f678181589865a3faa931cd) by [@robhogan](https://github.com/robhogan))
- **Runtime:** Emit `didUpdateDimensions` correctly ([920867d949](https://github.com/facebook/react-native/commit/920867d9494cbfcc9cb0e23607cb339ec1b89ca9) by TobiasH)
- **Runtime:** Fix `applicationDidEnterBackground` not being called ([adaceba546](https://github.com/facebook/react-native/commit/adaceba5462b4ad8676745f34e0be2bf5bb25166) by [@alextoudic](https://github.com/alextoudic))
- **Runtime:** Fixed problem with accessory view & 3rd party libs ([5fc582783d](https://github.com/facebook/react-native/commit/5fc582783d7f70ca9521e317c93624a8845bfff2) by [@kirillzyusko](https://github.com/kirillzyusko))
- **Style:** Dashed & dotted borders now work with overflow: hidden ([1b88c5b429](https://github.com/facebook/react-native/commit/1b88c5b429888e109b7acae4808b4b6f8b3f920f) by [@joevilches](https://github.com/joevilches))
- **Style:** Fixed `centerContent` losing taps and causing jitter ([fe7e97a2fd](https://github.com/facebook/react-native/commit/fe7e97a2fd272db0d9d9aa7d0561337a7c8e2c30) by [@gaearon](https://github.com/gaearon))
- **Xcode:** Properly escape paths in Xcode build script used when bundling an app. ([2fee13094b](https://github.com/facebook/react-native/commit/2fee13094b3d384c071978776fd8b7cff0b6530f) by [@kraenhansen](https://github.com/kraenhansen))
## v0.77.1
### Fixed
- **Dev-Middleware:** Add missing `invariant` dependency ([877e82c1a9](https://github.com/facebook/react-native/commit/877e82c1a97d6c667024a437d993e84af3b820a6) by [@tido64](https://github.com/tido64))
- **style:** Respect `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in New Architecture ([8baa858412](https://github.com/facebook/react-native/commit/8baa85841209679936938e7759c5be149304843c) by [RickardZrinski](https://github.com/RickardZrinski))
#### Android specific
- **layout:** Fix elevation prop on android has incorrect border-radius ([55d5c44976](https://github.com/facebook/react-native/commit/55d5c4497621a8dfd6545899754451fcf68dce70) by [@NickGerleman](https://github.com/NickGerleman))
- **Fabric:** Fix execution of early InteropEvents ([d8af0ae3f2](https://github.com/facebook/react-native/commit/d8af0ae3f22c906a9584e1f5d1aaf2dba3cc3fea) by [mdvacca](https://github.com/mdvacca))
#### iOS specific
- **Image:** Load images even when the extension is implicit ([bc35afefd5](https://github.com/facebook/react-native/commit/bc35afefd57a7d0516796dee209881120b82c0b1) by [@cipolleschi](https://github.com/cipolleschi))
- **Interop Layer:** Avoid crashing the app when the InteropLayer can't find some methods in the native implementation. ([83b986d370](https://github.com/facebook/react-native/commit/83b986d370139266bbbad3e2c356b871c56ae17c) by [@cipolleschi](https://github.com/cipolleschi))
- **Interop Layer:** Properly handle `null` values coming from NativeModules. ([475f797a51](https://github.com/facebook/react-native/commit/475f797a51237e63e4d2bb4e5718e6aa73157767) by [sammy-SC](https://github.com/sammy-SC))
### Added
- **DevX:** Add opt in for legacy Metro log streaming via `--client-logs` flag ([969eb3f007](https://github.com/facebook/react-native/commit/969eb3f0070dc9df2e89ea52a6eb2c68b05aa2d7) by [huntie](https://github.com/huntie))
## v0.77.0
### Breaking
- **Animation:** Native looping animation will not send React state update every time it finishes. ([4b035d820d](https://github.com/facebook/react-native/commit/4b035d820d3f1c3c9a98ce4f55bcc95a7ab064bf) by [@dmytrorykun](https://github.com/dmytrorykun))
- **Dev-Middleware:** Frameworks should specify `serverBaseUrl` relative to the middleware host. ([acf384a72e](https://github.com/facebook/react-native/commit/acf384a72e599691e4c9d53043f1801da01c58fd) by [@robhogan](https://github.com/robhogan))
- **JS:** Remove ReactFabricInternals module ([0c21db360c](https://github.com/facebook/react-native/commit/0c21db360cecc6a3265eea50d628106c58b67af8) by [@huntie](https://github.com/huntie))
- **layout:** `position` of sticky headers on `ScrollView` will now be taken into account ([cbab004eb9](https://github.com/facebook/react-native/commit/cbab004eb94f8312e9b10dae1502d3ca8632a006) by [@joevilches](https://github.com/joevilches))
- **layout:** More spec compliant absolute positioning ([0a2dec175e](https://github.com/facebook/react-native/commit/0a2dec175e92185943907f3e1f6073bae6cd663d) by [@NickGerleman](https://github.com/NickGerleman))
- **Native Modules:** Bridgeless: Make NativeModules.foo load turbomodules (unset turboModuleProxy in bridgeless). ([cc5f17d5a2](https://github.com/facebook/react-native/commit/cc5f17d5a2b185de1e7dec2a56a97b088e4c7a81) by [@RSNara](https://github.com/RSNara))
#### Android specific
- **APIs:** Removed ReactViewGroup.getBackgroundColor() ([6a472c5cf2](https://github.com/facebook/react-native/commit/6a472c5cf25d72f72ec7e261282d611a5ab0a662) by Thomas Nardone)
- **APIs:** ReadableArray non-primitive getters are now correctly typed as optional ([145c72f816](https://github.com/facebook/react-native/commit/145c72f8163048f0eee30d5ce850911f5dad865c) by [@javache](https://github.com/javache))
- **APIs:** Remove jsBundleLoader from DefaultReactHost.getDefaultReactHost() ([fbe4c0ed34](https://github.com/facebook/react-native/commit/fbe4c0ed347156a7ea24da29e09083a499c80cf5) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Reduce visibility of TaskCompletionSource class ([4f55161132](https://github.com/facebook/react-native/commit/4f551611326d63b6fb5cd53e63d536c2c6f04647) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make ImageStoreManager internal ([846c4b1ea2](https://github.com/facebook/react-native/commit/846c4b1ea2d139e3f3cbafa2f8ddbf159e3322e4) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make SwipeRefreshLayoutManager internal ([d02da992a4](https://github.com/facebook/react-native/commit/d02da992a4c0893313b9f059a8be228f43fffa7a) by Thomas Nardone)
- **APIs:** Stable API - Make classes inside `com.facebook.react.views.progressbar` internal ([46526fc2fe](https://github.com/facebook/react-native/commit/46526fc2fe1dd0ce937fad35469b64b9fb05eaa2) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make OkHttpCallUtil internal ([abd118a719](https://github.com/facebook/react-native/commit/abd118a719fe0aeb13f980729ff9ce5fb8358b83) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make SimpleSettableFuture internal ([3dec672398](https://github.com/facebook/react-native/commit/3dec672398729cd668aff92249f1fdde231fb928) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make `ClipboardModule` internal ([10f6d5adb5](https://github.com/facebook/react-native/commit/10f6d5adb538a9b20043312fc09b192759100d63) by [@cortinico](https://github.com/cortinico))
- **APIs:** Reduce visibility of ReactVirtualTextShadowNode to internal ([496b0a8729](https://github.com/facebook/react-native/commit/496b0a8729b41266683fdd84de5618b23d06ce3d) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Reduce visibility of ReactVirtualTextViewManager to internal ([4a119c4c3a](https://github.com/facebook/react-native/commit/4a119c4c3ac9bf4b234e2942a27a6efd68a801cc) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make classes in `com.facebook.react.views.safeareaview` internal ([39dfbadd5d](https://github.com/facebook/react-native/commit/39dfbadd5d3468d079bf3b039401237c6e7f363c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make ClipboardModule internal ([a72c35f98c](https://github.com/facebook/react-native/commit/a72c35f98ccd1a49d367678b46a29c814ad5de43) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make NativeModulePerfLogger internal ([d7d5de9f96](https://github.com/facebook/react-native/commit/d7d5de9f9630e7dcd0194830d7ccb32f167b619c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal ([623d481991](https://github.com/facebook/react-native/commit/623d4819915e7e6fafb8006c8e3b3b796e394974) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make `DevLoadingModule` internal ([8c50bf0beb](https://github.com/facebook/react-native/commit/8c50bf0beb17ced7fdafeae7a734edfc03e6e0b2) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener` ([287e200332](https://github.com/facebook/react-native/commit/287e20033207df5e59d199a347b7ae2b4cd7a59e) by [@cortinico](https://github.com/cortinico))
- **APIs:** Rename DevSupportManagerBase.getCurrentContext() -> getCurrentReactContext() ([0e7ba9094e](https://github.com/facebook/react-native/commit/0e7ba9094ea573d1512b2dc71e46f55b24201b7a) by [@RSNara](https://github.com/RSNara))
- **APIs:** Make DevSupportManagerBase.getCurrentReactContext() public ([5a6a42c7d0](https://github.com/facebook/react-native/commit/5a6a42c7d029d44799cb907c0ca3c8aa38fa1770) by [@RSNara](https://github.com/RSNara))
- **APIs:** Reduce visibility of ReactUnimplementedViewManager to internal ([fe656be26e](https://github.com/facebook/react-native/commit/fe656be26e0d71bf2505032578dbea54af36b2c5) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make InteropModuleRegistry internal ([cba1d4bae7](https://github.com/facebook/react-native/commit/cba1d4bae7285ba160b05f31ca18cfa0b91e9ef5) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal ([d7550293a2](https://github.com/facebook/react-native/commit/d7550293a2530f02f75b4249b7e6003edaf28ac9) by [@cortinico](https://github.com/cortinico))
- **APIs:** Added JSBundleLoader as parameter of DefaultReactHost ([143b9d172c](https://github.com/facebook/react-native/commit/143b9d172ca755e2457e8dfc6009eeef2475a4a1) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Deleting deprecated CompositeReactPackage ([2cb5198f1b](https://github.com/facebook/react-native/commit/2cb5198f1b589a57a4cfd3cc40a9ed6224fc5d75) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Make ReactHost.createSurface() method non nullable ([70c7616535](https://github.com/facebook/react-native/commit/70c761653564653bdfcb77a8c5ef3608dafcf5d7) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make AppStateModule internal ([dbf09fbe58](https://github.com/facebook/react-native/commit/dbf09fbe5823d77556b451317c14f833735067d9) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make `AccessibilityInfoModule` internal ([7168a9d1a2](https://github.com/facebook/react-native/commit/7168a9d1a2ed7459ebb056ebe45d86de791013e3) by [@cortinico](https://github.com/cortinico))
- **APIs:** Add 3 methods to ReactInstanceDevHelper ([c867aba2f3](https://github.com/facebook/react-native/commit/c867aba2f3dd7773be9d2ee0827bcd69481a394e) by [@cortinico](https://github.com/cortinico))
- **APIs:** Remove Deprecated DefaultDevSupportManagerFactory.create() ([f25abe51ce](https://github.com/facebook/react-native/commit/f25abe51ce93b97ef1fe97af5fc76f13a5a6ff03) by [@cortinico](https://github.com/cortinico))
- **APIs:** Remove BaseViewManagerInterface ([7fb3d830be](https://github.com/facebook/react-native/commit/7fb3d830beae3daf431ac90e9326b744ff8300a1) by [@NickGerleman](https://github.com/NickGerleman))
- **APIs:** Remove ReactNativeFlipper object, deprecated in 0.75 ([d1a256f51a](https://github.com/facebook/react-native/commit/d1a256f51a43f465823bdfb8a70fae5f92473d7c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Use BackgroundStyleApplicator when setting background color in BaseViewManager ([309cdea337](https://github.com/facebook/react-native/commit/309cdea337101cfe2212cfb6abebf1e783e43282) by [@NickGerleman](https://github.com/NickGerleman))
- **APIs:** Delete useTurboModules, enableFabricRenderer and enableBridgelessArchitecture fields from ReactFeatureFlags class ([10a33e0479](https://github.com/facebook/react-native/commit/10a33e04793befbeab6ae82d4068b1ebd7fdffd0) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Remove ReactViewBackgroundManager and ReactViewBackgroundDrawable ([51673e41ae](https://github.com/facebook/react-native/commit/51673e41ae12f06b2b378e048094ad39ca30c317) by [@NickGerleman](https://github.com/NickGerleman))
#### iOS specific
- **APIs:** Use the RCTDependencyProvider in the RCTAppDelegate, breaking the dependency with Codegen ([b91626af26](https://github.com/facebook/react-native/commit/b91626af2626bf611958b1e7d0dd0b7338ccc29e) by [@cipolleschi](https://github.com/cipolleschi))
- **APIs:** Delete experimental API RCTConstants.RCTGetMemoryPressureUnloadLevel ([d79dc48abd](https://github.com/facebook/react-native/commit/d79dc48abd2e65e4d203e488f99eb554c473a1fc) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Move `UseNativeViewConfigsInBridgelessMode` to a proper feature flag ([6fc500ee99](https://github.com/facebook/react-native/commit/6fc500ee9942e51519545c1ba1026bacad03dc61) by [@philIip](https://github.com/philIip))
- **APIs:** Delete partialBatchDidFlush ([a777a8937e](https://github.com/facebook/react-native/commit/a777a8937ee165993d7d9b35c7c981fe6698f9dc) by [@philIip](https://github.com/philIip))
- **APIs:** Remove the deprecated RCTRuntimeExecutor. ([cf8d09b279](https://github.com/facebook/react-native/commit/cf8d09b279c4bd667d96f9445c1c0b9acb0a0dfc) by [@philIip](https://github.com/philIip))
- **colors:** Replace uses of `CGColorRef` with UIColor to avoid manual memory management ([b70709dbc2](https://github.com/facebook/react-native/commit/b70709dbc27c75c69e9fd2b082ffa27e7e8db7fd) by [@Saadnajmi](https://github.com/Saadnajmi))
- **infra:** Cocoapods decide the C++ version for iOS pods ([bd50c4a460](https://github.com/facebook/react-native/commit/bd50c4a460a01dad3cd7cade8191273563675d24) by [@cipolleschi](https://github.com/cipolleschi))
- **Interop Layer:** Remove opt-out mechanism for Native Modules interop layer ([538bff710f](https://github.com/facebook/react-native/commit/538bff710f7afb4afa7ce91f20074668ad5c739d) by [@philIip](https://github.com/philIip))
### Added
- **Codegen:** Support negative values in enums ([177bf4d043](https://github.com/facebook/react-native/commit/177bf4d043ce862911e477e0f0039214d8541cfd) by [@okwasniewski](https://github.com/okwasniewski))
- **Codegen:** Add NumberLiteralTypeAnnotation support ([dd472101b7](https://github.com/facebook/react-native/commit/dd472101b76a964b7a64f0bb84d967f702500cad) by [@elicwhite](https://github.com/elicwhite))
- **Codegen:** Add cli --help details to combine-js-toschema-cli.js ([e4814b0d6d](https://github.com/facebook/react-native/commit/e4814b0d6d981cf96eef2803e8f20548263ea0e4) by [@blakef](https://github.com/blakef))
- **Codegen:** Codegen for Native Modules now supports string literals ([d2f3f06826](https://github.com/facebook/react-native/commit/d2f3f06826e2287ad5f5dc4e27201fc5dc9fcd5c) by [@elicwhite](https://github.com/elicwhite))
- **Codegen:** Codegen now supports Union Types in NativeModules ([3af126b562](https://github.com/facebook/react-native/commit/3af126b562cf7e0828906a4fe0ac79a886b557e6) by [@elicwhite](https://github.com/elicwhite))
- **DevMenu:** Export `DevMenu` from `react-native` ([e12c0d9551](https://github.com/facebook/react-native/commit/e12c0d95516924b5e6ca4f0d5ebcadb42bb19f30) by [@frankcalise](https://github.com/frankcalise))
- **FlatList:** Updated FlatList setNativeProps type ([b0ac99b477](https://github.com/facebook/react-native/commit/b0ac99b47781e3b68bee2ff737b109f58eeeba78) by [@JDMathew](https://github.com/JDMathew))
- **Flow:** Upgrade Flow to 0.245.2 ([1f65bf9545](https://github.com/facebook/react-native/commit/1f65bf9545cd84bbf1be7a7a91cb0b4f8b4b47ba) by [@SamChou19815](https://github.com/SamChou19815))
- **Image:** Image `resizeMode` and `objectFit` support for `'none'`. ([d8cfd98070](https://github.com/facebook/react-native/commit/d8cfd98070cbccc5e8a49446d76bdc2cb0c6939f) by [@mateoguzmana](https://github.com/mateoguzmana))
- **JS:** Eliminate usage of more than 1-arg `React.AbstractComponent` in React codebase ([6205aad81e](https://github.com/facebook/react-native/commit/6205aad81ef8154a106fa253a1f4b00aee568650) by [@SamChou19815](https://github.com/SamChou19815))
- **layout:** Added support for `display: contents` ([e7a3f479fe](https://github.com/facebook/react-native/commit/e7a3f479fe37a5d503770bafc03c80b1c2dcb8f7) by [@j-piasecki](https://github.com/j-piasecki))
- **Modal:** Added overlayColor prop to modal component for customisable background overlay ([4e1d7015c1](https://github.com/facebook/react-native/commit/4e1d7015c1d4e2703133b1347ed97a0cc93b1318) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **Perfetto:** Add FuseboxPerfettoDataSource to emit Fusebox traces using Perfetto ([ef0ea4d834](https://github.com/facebook/react-native/commit/ef0ea4d834ec61c5deede487b46a787a363f6a64) by Benoit Girard)
- **ReactNativeDevTools:** Add support for reload-to-profile in Fusebox (Part 2 of 2: JS) ([4df224ca6d](https://github.com/facebook/react-native/commit/4df224ca6df9dc593ab7090520578f27c520f361) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ReactNativeDevTools:** Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) ([91a40a28de](https://github.com/facebook/react-native/commit/91a40a28de3f74a389c6e6ad05fb917d58fc072d) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **runtime:** Add support for `rn_rootThreshold` in Intersection Observer ([a77d8d9d50](https://github.com/facebook/react-native/commit/a77d8d9d50e69a6a4563737c2ce68d26204eda7f) by [@lunaleaps](https://github.com/lunaleaps))
- **runtime:** Added `HostInstance` type to represent the instance of a `HostComponent<T>`. ([e24f9917c2](https://github.com/facebook/react-native/commit/e24f9917c25ed8c32c6e01d50a5fa49fe66a6ee1) by [@yungsters](https://github.com/yungsters))
- **style:** Removed `experimental` prefix and fully released `mixBlendMode` prop ([d2c48f3b1a](https://github.com/facebook/react-native/commit/d2c48f3b1a2a15e9832ea3240c19aea5186ceb24) by [@jorge-cab](https://github.com/jorge-cab))
- **Text:** Add JS layer for new text content type cellular EID and cellular IMEI ([118c1f7035](https://github.com/facebook/react-native/commit/118c1f7035cfcadb567b1ccd40d85c751dd65162) by [@cipolleschi](https://github.com/cipolleschi))
- **Text:** Expose missing text content type to JS ([d3d48cb357](https://github.com/facebook/react-native/commit/d3d48cb357e55b1f2ae0042a5960451fbe5ff5c7) by [@cipolleschi](https://github.com/cipolleschi))
- **TypeScript** Use the TypeScript key in syntax to restrict permissions and types of results ([0244710c4b](https://github.com/facebook/react-native/commit/0244710c4b1e5016069ec9f7b8e7116ff51f59f1) by [@qnnp-me](https://github.com/qnnp-me))
#### Android specific
- **Accessibility:** Added `isHighTextContrastEnabled()` to `AccessibilityInfo` to read `ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED` setting value ([d4ea147b41](https://github.com/facebook/react-native/commit/d4ea147b41e4d22253f80be8b74731dcf0439302) by Ariel Lin)
- **APIs:** Marked ReactPackage#getModule as stable. ([8fba7ebb5e](https://github.com/facebook/react-native/commit/8fba7ebb5e874d001dc5c16eb4229054a2ef4812) by [@javache](https://github.com/javache))
- **C++:** Add cmake arguments to support 16KB page size for native libraries ([65cdd5b82c](https://github.com/facebook/react-native/commit/65cdd5b82ce7652630b1920fa3a48c8f256c7983) by [@alanleedev](https://github.com/alanleedev))
- **Error Hadling:** Add exceptionHandler as a parameter of DefaultReactHost.getDefaultReactHost() method ([7a5a10c95c](https://github.com/facebook/react-native/commit/7a5a10c95ce6af1964ce5bd273c0c6513fb78a1e) by [@mdvacca](https://github.com/mdvacca))
- **graphics** Added PixelUtil extensions for Int and Long ([9406a09f87](https://github.com/facebook/react-native/commit/9406a09f871d3efa66e3d10237a6d1fd08ddee0b) by Thomas Nardone)
- **Image:** Image `force-cache` caching control option ([a0be88fd72](https://github.com/facebook/react-native/commit/a0be88fd727898d4626ca51876d0bfb4e50dcb77) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Image:** Enabling basic `Image` cache control for Android ([e5dd7d68bf](https://github.com/facebook/react-native/commit/e5dd7d68bf264669fc5c4ce5e69b24249d28558b) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Image:** Adds a new `resizeMethod`, `none`, which disables downsampling for an image ([6202319ed5](https://github.com/facebook/react-native/commit/6202319ed544e4d23f1f327ff5334c480af3819d) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Image:** Adds support for importing XML assets as images ([2e80f5acf1](https://github.com/facebook/react-native/commit/2e80f5acf11cd9726921a00a58700cab9e0bb0a7) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Modal:** Add navigationBarTranslucent prop to Modal component ([7a6c7a462a](https://github.com/facebook/react-native/commit/7a6c7a462a7898e13327438a6603d83a39147abb) by [@zoontek](https://github.com/zoontek))
- **resources:** Add a new Fresco decoder for XML resource types ([118b7c18a6](https://github.com/facebook/react-native/commit/118b7c18a6f827dabb00522bbd6a2416e1bf99da) by [@Abbondanzo](https://github.com/Abbondanzo))
- **runtime:** ReactDelegate and ReactActivityDelegate#getCurrentReactContext can be used to access the current context ([fe8cc62824](https://github.com/facebook/react-native/commit/fe8cc62824372229d90445b2769fed9c08604a7e) by [@javache](https://github.com/javache))
- **runtime:** Trigger Java GC on app reload ([de3c1ee097](https://github.com/facebook/react-native/commit/de3c1ee097f7041d6f9754a55a45cea80fd25813) by [@mrousavy](https://github.com/mrousavy))
- **runtime:** React Activity exposes ReactHost ([d78cb78b15](https://github.com/facebook/react-native/commit/d78cb78b15a520f3bebcdf00b82b26bf120f4180) by [@shwanton](https://github.com/shwanton))
- **runtime:** ReactDelegate `unloadApp` methods for unmounting surfaces without destroying ReactHost ([38593c440e](https://github.com/facebook/react-native/commit/38593c440e949a9b52df0a6821b80ac47b19a693) by [@rozele](https://github.com/rozele))
- **ScrollView:** Add OnLayoutChange API for scroll views ([d825a4d712](https://github.com/facebook/react-native/commit/d825a4d712a1ba53c0f4209c9da5d51578209a6d) by Thomas Nardone)
- **style:** Add overlapping radii resolution logic preventing incorrect rendering ([451ff70da4](https://github.com/facebook/react-native/commit/451ff70da422beefccfff5b87024145003bb49ff) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** Logic to check for grayscale mode on android ([e70202e606](https://github.com/facebook/react-native/commit/e70202e606be3101da33d28f5403443c3e84749e) by [@oddlyspaced](https://github.com/oddlyspaced))
- **style:** Add boxShadow support to BaseViewManager ([b69a92e2c9](https://github.com/facebook/react-native/commit/b69a92e2c95990fcfa95a6ab7b7260ac492f942c) by [@NickGerleman](https://github.com/NickGerleman))
- **style:** Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset` ([17faac4170](https://github.com/facebook/react-native/commit/17faac417035f2cc5f12ec60a46270991be0989a) by [@jorge-cab](https://github.com/jorge-cab))
- **Text:** TextTransform ktx ([7794d7af43](https://github.com/facebook/react-native/commit/7794d7af43b90b581574361af102f67ad7961a5e) by Thomas Nardone)
#### iOS specific
- **Accessibility** Added `isDarkerSystemColorsEnabled()` to `AccessibilityInfo` to read "Increase Contrast" setting value ([af3bee6511](https://github.com/facebook/react-native/commit/af3bee6511fe72fda7415bf974f937012b3eefec) by Ariel Lin)
- **ActionSheetIOS:** Added `disabledButtonTintColor` prop to ActionSheetIOS ([089c87e22e](https://github.com/facebook/react-native/commit/089c87e22e9f431d0e7f35292dce2e36fa86d09a) by [@henninghall](https://github.com/henninghall))
- **Cocoapods:** Extract RCTAppDependencyProvider in the ReactAppDependencyProvider pod ([102062fbc7](https://github.com/facebook/react-native/commit/102062fbc7d6a5c81192562c3ccb87bc4222a0cf) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Add RCTDependencyProvider protocol ([f2b3716426](https://github.com/facebook/react-native/commit/f2b371642684682916522dc82adee93464ba31fe) by [@cipolleschi](https://github.com/cipolleschi))
- **graphics:** Add `systemCyan` and `systemMint` colors on iOS ([4caf548a9f](https://github.com/facebook/react-native/commit/4caf548a9f2e485aef9cbaeeb0a666cf9b9d3e59) by [@EvanBacon](https://github.com/EvanBacon))
- **Hermes:** TvOS support for Hermes artifacts ([f673759c83](https://github.com/facebook/react-native/commit/f673759c83fed130964ea7dfe677c04608b8e64d) by [@douglowder](https://github.com/douglowder))
- **Image:** Image `only-if-cached` cache control option ([dc9db01665](https://github.com/facebook/react-native/commit/dc9db01665308ac931967326abfc86deb9ae7e2a) by [@mateoguzmana](https://github.com/mateoguzmana))
- **infra:** Declare supportedInterfaceOrientations only on iOS ([40c5e6b64a](https://github.com/facebook/react-native/commit/40c5e6b64a1d82b5b481717b9086340eca2aaef9) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** User-configurable BUNDLE_NAME when building bundles ([f8287e25e1](https://github.com/facebook/react-native/commit/f8287e25e11d56beb66ace414ca5f8a6a32405a9) by [@fivecar](https://github.com/fivecar))
- **infra:** User-configurable BUNDLE_NAME when building bundles ([f8287e25e1](https://github.com/facebook/react-native/commit/f8287e25e11d56beb66ace414ca5f8a6a32405a9) by [@fivecar](https://github.com/fivecar))
- **Layout:** Fix: Correct Layout Behavior for Combined align-content and align-items ([73a2be1243](https://github.com/facebook/react-native/commit/73a2be12437c93bbd138e0d63cd45d834529a3c4) by [@phuccvx12](https://github.com/phuccvx12))
- **runtime:** Pass the `RCTAppDependencyProvider` to the `RCTAppDelegate` ([95fc906930](https://github.com/facebook/react-native/commit/95fc906930ece9b30482eb1f0924d7e8614af7c6) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Introduce the RCTAppDependencyProvider to minimize the changes required y the users ([41c2502b36](https://github.com/facebook/react-native/commit/41c2502b3650e238b0a5d86b5044abcb538b76e3) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Introduce RCTArchConfiguratorProtocol ([ec0dbb729d](https://github.com/facebook/react-native/commit/ec0dbb729d3774184dee83efbff5f9beebce72ce) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Introduce RCTUIConfiguratorProtocol ([8850736188](https://github.com/facebook/react-native/commit/8850736188321f13c7bdeadedeed15c759ad72c1) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Add `CallInvoker` to `BindingsInstaller` ([87bae7f734](https://github.com/facebook/react-native/commit/87bae7f7349976cfc269b25584330c4d3d897d79) by [@mrousavy](https://github.com/mrousavy))
- **ScrollView:** Scroll the cursor into view when text input is focused ([e021e50d53](https://github.com/facebook/react-native/commit/e021e50d537884a55a9f5bea931adb19e9069dd6) by [@dominictb](https://github.com/dominictb))
- **style:** Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset` ([1288e38423](https://github.com/facebook/react-native/commit/1288e38423f93ed57737dd9b40ad55696494d6f4) by [@jorge-cab](https://github.com/jorge-cab))
- **Swift:** Expose RCT_NEW_ARCH_ENABLED to Swift ([d24507611d](https://github.com/facebook/react-native/commit/d24507611de7fefc71286fd54b2c909d98a4bf27) by [@okwasniewski](https://github.com/okwasniewski))
- **Text:** New text content type cellular EID and cellular IMEI ([14e0d0dffb](https://github.com/facebook/react-native/commit/14e0d0dffb9ee8b1d41d60ccbcfd63d53bfe4d48) by [@pasc0al](https://github.com/pasc0al))
- **TextInput:** TextInput `inputAccessoryViewButtonLabel` prop ([32931466ed](https://github.com/facebook/react-native/commit/32931466ed7e3d8d9eeeb65f12ce146e123870ba) by [@mateoguzmana](https://github.com/mateoguzmana))
- **TextInput:** Line break mode for TextInput components. **This includes JS APIs for the new mode.** ([ce2d34f194](https://github.com/facebook/react-native/commit/ce2d34f19451c91a90f0bd820064208912c86092) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
### Changed
- **Animated:** The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects. ([316170ce8d](https://github.com/facebook/react-native/commit/
- **Animated:** Optimized the performance of updating `Animated` components. ([f0ffcd4f5d](https://github.com/facebook/react-native/commit/f0ffcd4f5dfeab794fbfa3257bb9a8fd793ff2bc) by [@yungsters](https://github.com/yungsters))
- **Animated:** 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. ([fd8cf19625](https://github.com/facebook/react-native/commit/fd8cf1962585aa49e8921475d89c1a5c2423c51c) by [@yungsters](https://github.com/yungsters))
- **Animated:** The `Animation` superclass no longer exposes `__onEnd` as a property. Subclasses must instead invoke `super.start(…)` in their `start()` implementation. ([b3fe06b268](https://github.com/facebook/react-native/commit/b3fe06b2685e526fe2bc420a902a3ccd4e1381df) by [@yungsters](https://github.com/yungsters))
- **Animated:** Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag ([6e0e712c2a](https://github.com/facebook/react-native/commit/6e0e712c2a680cf4b4de1ee5fb25cc5282b242c5) by [@dmytrorykun](https://github.com/dmytrorykun))
- **Animated:** AnimatedNode (and its subclasses) once again implement `toJSON()`. ([7bd4a54968](https://github.com/facebook/react-native/commit/7bd4a5496815943b031b68ca46792560d8d798d8) by [@yungsters](https://github.com/yungsters))
- **Animated:** Improved the performance of unmounting (and updating, when an enclosing Activity becomes hidden) Animated components ([46abda55b9](https://github.com/facebook/react-native/commit/46abda55b9749dc171e0fec551ba83c027818eb7) by Royi Hagigi)
- **Animated:** AnimatedNode (and its subclasses) no longer implement `toJSON()`. ([fe6228512e](https://github.com/facebook/react-native/commit/fe6228512e076820c9c11869cfe24b19d1abfb58) by [@yungsters](https://github.com/yungsters))
- **Animated:** Animated now resolves `style` to the original prop value if it contains no `AnimatedNode` instances. Previously, it would resolve to a flattened style object. ([ca234ba10e](https://github.com/facebook/react-native/commit/ca234ba10e8d06630da7ea00aac515b222137645) by [@yungsters](https://github.com/yungsters))
- **AttributedString:** AttributedString `appendFragment` and `prependFragment` take an rval instead of a const ref; append/prependAttributedString have been removed ([2c31fe99e1](https://github.com/facebook/react-native/commit/2c31fe99e1cc5bfdb393d4f5c70231a042ea67ef) by [@javache](https://github.com/javache))
- **AttributedString:** Improved AttributedText generation for raw text nodes. ([2f7957f2fd](https://github.com/facebook/react-native/commit/2f7957f2fd424fdaa980d99a4ff05eb3237d662e) by [@javache](https://github.com/javache))
- **Flow:** Simplified Flow types to use `HostInstance` (which changing nominal types). ([177697f539](https://github.com/facebook/react-native/commit/177697f539ec68a47cbb8f57260cebe701589ef1) by [@yungsters](https://github.com/yungsters))
- **JS:** `useMergeRefs` and components using it (e.g. `Pressable`) now support ref cleanup functions. ([01e210fd28](https://github.com/facebook/react-native/commit/01e210fd28bc961e8c1b5fa454b3c947adda296c) by [@yungsters](https://github.com/yungsters))
- **JS:** Fix: use public instance in Fiber renderer and expose it from getInspectorDataForViewAtPoint (#31068) ([633ad4933e](https://github.com/facebook/react-native/commit/633ad4933e9514d4168d6dcdb7e56c9a1859482a) by [@hoxyq](https://github.com/hoxyq))
- **deps:** Bump serve-static to 1.16.2 to fix CVE-2024-43800 ([50e38cc9f1](https://github.com/facebook/react-native/commit/50e38cc9f1e6713228a91ad50f426c4f65e65e1a) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Folly to 2024.10.14.00 ([37375d8aba](https://github.com/facebook/react-native/commit/37375d8aba0869531567426466478b0de9a1aea3) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Update Metro to 0.81.0 ([0902b0af75](https://github.com/facebook/react-native/commit/0902b0af75ba30ec9d4abeda71769d0685637afa) by [@robhogan](https://github.com/robhogan))
- **deps:** Upgrade React DevTools to 6.0.0. ([ed4f6d6891](https://github.com/facebook/react-native/commit/ed4f6d68910677ab050e3fef5aaa87e42d582fe0) by [@hoxyq](https://github.com/hoxyq))
- **infra:** Do not print Bridgeless Mode is enabled on console anymore ([f3a969f38d](https://github.com/facebook/react-native/commit/f3a969f38d7a2c74bf63ee05c4c819c0873059a9) by [@cortinico](https://github.com/cortinico))
- **VirtualizedList:** Fix unnececary rerenders of VirtualizedListCells with strictMode={true} ([aafe696453](https://github.com/facebook/react-native/commit/aafe696453186d0e87ae96d0bca4c6650234d222) by [@Tom910](https://github.com/Tom910))
316170ce8d0aac1df3261c792b9f768665d134c5) by [@yungsters](https://github.com/yungsters))
#### Android specific
- **deps:** Updating targetSdk to 35 (apps can still choose their own targetSdk regardless of RN version) ([48ea6867a9](https://github.com/facebook/react-native/commit/48ea6867a96bd16dc7aed9af5a8e9ce12a487c22) by [@alanleedev](https://github.com/alanleedev))
9fa4845136969ec95ce5615b7ea78feaf0f7f109) by [@javache](https://github.com/javache))
- **deps:** AGP to 8.7.2 ([e1a1cead43](https://github.com/facebook/react-native/commit/e1a1cead434a6856b2b018274876b9ba8eab706a) by [@cortinico](https://github.com/cortinico))
- **deps:** Android NDK to 27.1 ([ba061a5d18](https://github.com/facebook/react-native/commit/ba061a5d18176fd455c3aa6350127506dac05211) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Bump fbjni to 0.7.0 ([1c002c7b4e](https://github.com/facebook/react-native/commit/1c002c7b4ea4f22729920e54a9032402247ea350) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Fresco to 3.4.0 ([091025e18b](https://github.com/facebook/react-native/commit/091025e18b1dc5212031e3ed06bfb6c450e788e2) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Kotlin 1.9.x to 2.0.x ([972c2c864c](https://github.com/facebook/react-native/commit/972c2c864c0b563163a36080a13908d1c0a3fb87) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Android Gradle Plugin (AGP) to 8.7.0 ([cbc0978bb6](https://github.com/facebook/react-native/commit/cbc0978bb65dcfd2a18a54201c845785a626b1b3) by [@cortinico](https://github.com/cortinico))
- **deps:** Gradle to 8.10.1 ([90f89a830a](https://github.com/facebook/react-native/commit/90f89a830acced9e6b8e80ef58aefd7e2c9666a8) by [@cortinico](https://github.com/cortinico))
- **deps:** Gradle to 8.11.1 ([490db92562](https://github.com/facebook/react-native/commit/490db92562df3baf6dc38737778179065f378715) by [@cortinico](https://github.com/cortinico))
- **Kotlin:** Migrated systeminfo module code from Java to Kotlin ([8dc2c90ce5](https://github.com/facebook/react-native/commit/8dc2c90ce5f4b30f4729560aed2412e6d29f39fa) by [@oddlyspaced](https://github.com/oddlyspaced))
- **Kotlin:** Migrate ReactFeatureFlags to Kotlin ([4076dbfc86](https://github.com/facebook/react-native/commit/4076dbfc8651fcd193b886bf63b23728fad466d7) by [@mdvacca](https://github.com/mdvacca))
- **Kotlin:** Migrate MainReactPackage to Kotlin (and make it final) ([7bbac8ee27](https://github.com/facebook/react-native/commit/7bbac8ee27daf092b580b57c2c7ee46d2723cd09) by [@cortinico](https://github.com/cortinico))
- **Native Modules:** TurboModules marked as requiring eager init will now be constructed on the mqt_native thread to increase concurrency in React Native init. ([663b5f9d19](https://github.com/facebook/react-native/commit/663b5f9d19a905520bd0aef62cda890f76ef9b6e) by [@javache](https://github.com/javache))
- **ReactViewGroup:** Consolidated ReactViewGroup add/remove overrides ([0b22b955f1](https://github.com/facebook/react-native/commit/0b22b955f1494f0e7441a01dd19b3fdf5e20c3dc) by Thomas Nardone)
- **runtime:** Invocations to JS will now invoke their callbacks immediately if the instance is ready. Surface starts will not wait for the main thread to become available to dispatch the work in JS. ([9fa4845136](https://github.com/facebook/react-native/commit/
- **runtime:** Update documentation for ReactHost.destroy() APIs ([443bc32dc4](https://github.com/facebook/react-native/commit/443bc32dc49a86534fce1d6ec0e31c97b8f33053) by [@mdvacca](https://github.com/mdvacca))
- **style:** Disabling `outline` props on Android to stay consistent with iOS ([7ab0002799](https://github.com/facebook/react-native/commit/7ab0002799d52a876a8cdd32f25ebef6d431650e) by [@jorge-cab](https://github.com/jorge-cab))
- **tracing:** Improve FpsDebugFrameCallback.getTotalTimeMS() accuracy ([d54c25fdae](https://github.com/facebook/react-native/commit/d54c25fdaee4d2642cdbca812b61c6973d3f203d) by [@aamagda](https://github.com/aamagda))
#### iOS specific
- **Codegen:** Change how components automatically register ([8becc2514d](https://github.com/facebook/react-native/commit/8becc2514d484c99b51ea76f479f06a8fcdd8265) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Stop generating the RCTThirdPartyLibraryComponentProvider ([60b9d3d89e](https://github.com/facebook/react-native/commit/60b9d3d89eba90a945070646c6220b3c03b3aeba) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** `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. ([13b93cfdda](https://github.com/facebook/react-native/commit/13b93cfddaa559697968ac1c19e55f7aaa053070) by Nolan O'Brien)
- **runtime:** Use `newArchEnabled` flag in RCTAppDelegate and RCTRootViewFactory ([7e1674fc59](https://github.com/facebook/react-native/commit/7e1674fc59abeeb70d946ee082a829fae4c671b7) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Do not move to the main queue synchronously when starting a new surface ([ab2c47be28](https://github.com/facebook/react-native/commit/ab2c47be285fde99a77d189fd04220ef8ad0933a) by [@cipolleschi](https://github.com/cipolleschi))
- **APIs**: Rename `RCTUIGraphicsImageRenderer` to `RCTMakeUIGraphicsImageRenderer` ([6a09fc09af](https://github.com/facebook/react-native/commit/6a09fc09af8eedbf409ab870d5714e44892b2a16) by [@Saadnajmi](https://github.com/Saadnajmi))
### Deprecated
#### Android specific
- **Codegen:** Deprecated shadows for ReadableNative[Map|Array].[Readable|Writable] ([d424bb9d7c](https://github.com/facebook/react-native/commit/d424bb9d7cf101dc5609e8f787ba8af2a33d0262) by [@javache](https://github.com/javache))
- **Fabric:** ReactContext.getFabricUIManager() method ([fb737ca7d3](https://github.com/facebook/react-native/commit/fb737ca7d34b636a3aa337a0935bf9a5a10c641d) by [@mdvacca](https://github.com/mdvacca))
- **runtime:** Deprecate CatalystInstance in old architecture ([3e27ef1f6e](https://github.com/facebook/react-native/commit/3e27ef1f6e024bba8725a3bd64e2648ffd6af496) by [@mdvacca](https://github.com/mdvacca))
- **runtime:** Deprecate BridgelessCatalystInstance class ([72bd840dd3](https://github.com/facebook/react-native/commit/72bd840dd3dc7b6e3e88a74ac9ddb000a0cb3a60) by [@mdvacca](https://github.com/mdvacca))
#### iOS specific
- **runtime:** Deprecating RCTBridgeModule batchDidComplete and adding configuration to disable it ([731bd95c43](https://github.com/facebook/react-native/commit/731bd95c430c752126aaaa34e4911ba2b87b382f) by [@philIip](https://github.com/philIip))
### Removed
- **DevX:** Remove "run on iOS" and "run on Android" from the dev server key commands ([19b971ff94](https://github.com/facebook/react-native/commit/19b971ff94a0fe353f82363e788c13f86815663b) by [@huntie](https://github.com/huntie))
- **JS:** Removed type for useConcurrentRoot from AppRegistry, as it was already ignored ([2ec547ad28](https://github.com/facebook/react-native/commit/2ec547ad28ca914c17e276abb91174dfa0dc87b2) by [@javache](https://github.com/javache))
- **TypeScript:** Removed `refs` property from `NativeMethods` TypeScript definition. ([223e98cc4b](https://github.com/facebook/react-native/commit/223e98cc4b656b94b48c88940114bfdc025f8ddf) by [@yungsters](https://github.com/yungsters))
#### Android specific
- **APIs:** Remove `BackHandler.removeEventListener` ([44d619414c](https://github.com/facebook/react-native/commit/44d619414c1de3dbf17a421afa8dbcec7cdab025) by [@retyui](https://github.com/retyui))
- **APIs:** DevToolsReactPerfLogger stats gathering now uses an internal API ([f503fe3f10](https://github.com/facebook/react-native/commit/f503fe3f100d96a31fc56451d7846d80ce5c342f) by [@javache](https://github.com/javache))
- **APIs:** BindingImpl is no longer part of the public interface ([18faf68b48](https://github.com/facebook/react-native/commit/18faf68b4825118253cf247572084c4da8f6366e) by [@javache](https://github.com/javache))
- **APIs:** FabricComponents is removed from public API ([300db67b27](https://github.com/facebook/react-native/commit/300db67b270a5d6fc85d27188d0d1089675f89c0) by [@javache](https://github.com/javache))
### Fixed
- **Animated:** Correctly pass down isLooping in parallel animation ([4014aa4528](https://github.com/facebook/react-native/commit/4014aa4528d43e905246850c83007a635938d7cb) by [@zeyap](https://github.com/zeyap))
- **Animated:** Improved types for AnimatedProps ([390925ea39](https://github.com/facebook/react-native/commit/390925ea39eb469768f21cf7069b8f75ccdec09d) by [@javache](https://github.com/javache))
- **Animated:** Order of operations related to platformConfig propagation in NativeAnimated ([a64183b0c6](https://github.com/facebook/react-native/commit/a64183b0c6a56e9d482c7b8b0f80965493ed87af) by [@rozele](https://github.com/rozele))
- **Animated:** Replace Object.hasOwn usages to fix Animated on JSC ([e996b3f346](https://github.com/facebook/react-native/commit/e996b3f346462a394012a722ce19990cdf9c3d9a) by [@robhogan](https://github.com/robhogan))
- **Animated:** Fix buttons becoming unresponsive when transform is animated (Revert #48669) ([c799aa07e2](https://github.com/facebook/react-native/commit/c799aa07e2148a2ca38939cb72468c949ed0c95f) by [@sammy-SC](https://github.com/sammy-SC))
- **Appearance:** Fixed jest error from Appearance.js ([ce838a4bcf](https://github.com/facebook/react-native/commit/ce838a4bcfb1c08728b637a9addd24cc6e3477e0) by [@Kudo](https://github.com/Kudo))
- **Appearance:** Fix `Appearance.setColorScheme(null)` not resetting color scheme value ([7d63235086](https://github.com/facebook/react-native/commit/7d63235086352d8c424d634c7039551f0a5025dc) by [@sangonz193](https://github.com/sangonz193))
- **C++:** Fix C++ bridging template compatibility with MSVC ([e6848ba5ba](https://github.com/facebook/react-native/commit/e6848ba5ba997d102cbaf6181c7c8c73e25a0827) by [@acoates-ms](https://github.com/acoates-ms))
- **C++** Fix cast and control paths errors on windows ([0794fa909b](https://github.com/facebook/react-native/commit/0794fa909b2e06fad5c40dce402c5f14a24bb946) by [@TatianaKapos](https://github.com/TatianaKapos))
- **C++** Fix type conversion error in react native windows build. ([13db1cb88b](https://github.com/facebook/react-native/commit/13db1cb88bdd454cf19be358d6f0cd62f5a6d0cc) by [@marlenecota](https://github.com/marlenecota))
- **Codegen:** Support nested objects in arrays ([13780126d3](https://github.com/facebook/react-native/commit/13780126d3cb17ad00c2954f9830a3623812dc3e) by [@tvanlaerhoven](https://github.com/tvanlaerhoven))
- **Codegen:** Make Codegen work with local modules ([7b6e8e7765](https://github.com/facebook/react-native/commit/7b6e8e776574e683821133f0c814969d74c4de61) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Upgrade Codegen dependency `jscodeshift@17.0.0` to resolve outdated dependencies ([39c98fb8f8](https://github.com/facebook/react-native/commit/39c98fb8f8af98aa40dc89a1580d6c1901fa86cf) by [@byCedric](https://github.com/byCedric))
- **Codegen:** Fix source mapping for codegenNativeCommands ([8fba154b66](https://github.com/facebook/react-native/commit/8fba154b6655b5d87609d7c9f136997141ea5e99) by [@vzaidman](https://github.com/vzaidman))
- **Codegen:** Skip hidden folders when looking for third party components. ([8ab524312a](https://github.com/facebook/react-native/commit/8ab524312ab3bf1192b94ae6e30d296a85baa944) by [@cipolleschi](https://github.com/cipolleschi))
- **Dev-Middleware:** Rewrite URLs in the inspector proxy to cover all configurations, not just Android emulators. ([74995bc90a](https://github.com/facebook/react-native/commit/74995bc90aa039b880e4875ad356d3bce324d902) by [@robhogan](https://github.com/robhogan))
- **Dev-Middleware:** Fix URL rewriting where device and debugger reach the server on different ports/protocols. ([5da7ebf99a](https://github.com/facebook/react-native/commit/5da7ebf99ae317c104d8e4bfbf36d3d89f66b5c9) by [@robhogan](https://github.com/robhogan))
- **Dev-Middleware:** Regex-escape IP addresses in urlRegex replacements ([aae3e03e57](https://github.com/facebook/react-native/commit/aae3e03e57096c3dc51589a3de240d49a8b9fadf) by [@robhogan](https://github.com/robhogan))
- **Dev-middleware:** Remove URL.canParse, restore compat with Node < 18.17 ([99767d43b0](https://github.com/facebook/react-native/commit/99767d43b04e41c83e3bcbfebe267d6fdc284549) by [@robhogan](https://github.com/robhogan))
- **Error Handling:** Improved error message when no view config is found. ([bca232ad90](https://github.com/facebook/react-native/commit/bca232ad90692da7a87be5e37ee2680380f94bef) by [@javache](https://github.com/javache))
- **FlatList:** Fixed accuracy of FlatList estimations to determine what elements are visible in the rendering window. ([40aaeb7181](https://github.com/facebook/react-native/commit/40aaeb71814a1987482d97fd3170af0add55bc6a) by [@rubennorte](https://github.com/rubennorte))
- **FormData:** Remove non compliant `filename*` attribute in a FormData `content-disposition` header ([f791fb9e66](https://github.com/facebook/react-native/commit/f791fb9e660fe15bccf55029045c48f4bbcbc5cb) by [@foyarash](https://github.com/foyarash))
- **graphics:** Linear gradient start and end point algorithm. ([221d1eceda](https://github.com/facebook/react-native/commit/221d1eceda0e5ab870e96dcdd26e22ab17a3870c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **Hermes:** Hermes: revert Intl removal ([4cffff35e0](https://github.com/facebook/react-native/commit/4cffff35e030f256c32bf69c5971dfee4e60723f) by [@robhogan](https://github.com/robhogan))
- **Image:** Passed height and width as native props to support cases where source is an array. ([45b177f50d](https://github.com/facebook/react-native/commit/45b177f50de624eefcb66bb2d8bc1ffb00855863) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **infra:** When using Babel with plain JavaScript files, support for additional user syntax plugins should be fixed (now uses Babel's parser instead of hermes-parser). There is no change for JS files annotated with `flow`, where extended JS syntax remains - unsupported. ([3de9892353](https://github.com/facebook/react-native/commit/3de989235365504468d2b6c0bb194e944bf1ce8e) by [@huntie](https://github.com/huntie))
- **infra:** Fix npm react-native start when cli-server-api isn't installed ([e0be2efe4e](https://github.com/facebook/react-native/commit/e0be2efe4e80edf99f96a2ae6a25856f6df5e0ca) by [@blakef](https://github.com/blakef))
- **infra:** Fix "punycode is deprecated" warning by replacing `node-fetch` with native `fetch` ([881d8a720f](https://github.com/facebook/react-native/commit/881d8a720fb24241d7b2127273ca6116833bf176) by [@jbroma](https://github.com/jbroma))
- **JS:** Do not discard props in the patch when they are not null while using `useNativeProps` ([4c3112c8d8](https://github.com/facebook/react-native/commit/4c3112c8d8685d6c34be9acf07b18871b3cee5b2) by [@cipolleschi](https://github.com/cipolleschi))
- **KeyboardAvoidingView:** Accessing KeyboardAvoidingEvent event in onLayout handler ([68db74205a](https://github.com/facebook/react-native/commit/68db74205afdd190304eb73ef71710781fa580b9) by [@mhoran](https://github.com/mhoran))
- **KeyboardAvoidingview:** Fix KeyboardAvoidingView not aware of the keyboard closing it is unmounted ([08bd8ac47d](https://github.com/facebook/react-native/commit/08bd8ac47da60121225e7b281bbf566e2c5a291e) by [@QichenZhu](https://github.com/QichenZhu))
- **layout:** Plumbing to get boxSizing prop to Yoga round 2 ([3ca796edc3](https://github.com/facebook/react-native/commit/3ca796edc327c5287533dcc8f4394033d5398c2d) by [@joevilches](https://github.com/joevilches))
- **layout:** Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints ([e7db7a7266](https://github.com/facebook/react-native/commit/e7db7a72661bd49948c13eb46d0f72fbe9e00bf3) by [@NickGerleman
](https://github.com/NickGerleman))
- **Modal:** Rename overlayColor prop in Modal to backdropColor ([7aeff18970](https://github.com/facebook/react-native/commit/7aeff18970a2b47cbb3fffc1408e4bb21eec6fed) by [@alanleedev](https://github.com/alanleedev))
- **Native Modules:** TurboModule::get is now a final method, override `create` to customize property lookup ([5b5e150eaf](https://github.com/facebook/react-native/commit/5b5e150eaff015540720225b9e61acb306e1d107) by [@javache](https://github.com/javache))
- **PointerEvents:** Fixed issues with W3C PointerEvents testsx ([1dcaf823f5](https://github.com/facebook/react-native/commit/1dcaf823f5e7d9b114dd803ce3181aa0b8f827ad) by [@rozele](https://github.com/rozele))
- **PointerEvents:** Fixed issue with W3C PointerEvents tests ([68a6b69b27](https://github.com/facebook/react-native/commit/68a6b69b27275998b4083797942f3e26a92d3adb) by [@rozele](https://github.com/rozele))
- **ReactNativeDevTools:** Don't assume 10.0.2.2 is an alias for localhost unless it's used to establish a connection to the server ([69400be4fc](https://github.com/facebook/react-native/commit/69400be4fc0abd38072f6586f3e7d5b6c33e54be) by [@robhogan](https://
- **ReactNativeDevTools:** Fix fetching sources and source maps when the dev-server is remote and not tunnelled via the same port+protocol. ([d1b0e9a30b](https://github.com/facebook/react-native/commit/d1b0e9a30b3afc56b9355453cf7f6e690bdd8aff) by [@robhogan](https://github.com/robhogan))
- **runtime:** Fixes typo in ReactHostImpl ([e3f03269c5](https://github.com/facebook/react-native/commit/e3f03269c5cea28977e44ddf5c5125968336b0e6) by [@rozele](https://github.com/rozele))
- **runtime:** Microtasks are now correctly executed after the code evaluation in Console panel of DevTools. ([3dfe22bd27](https://github.com/facebook/react-native/commit/3dfe22bd27429a43b4648c597b71f7965f31ca65) by [@hoxyq](https://github.com/hoxyq))
- **runtime:** Fix setImmediate/clearTimeout mismatch in NativeAnimatedHelper that could clear an unrelated setTimeout. ([a5dd1be889](https://github.com/facebook/react-native/commit/a5dd1be889be21f8daefbc609702989ec7c156cf) by Benoit Girard)
- **style:** Fix the nodes' owners not being updated when `display: contents` is used ([aa53bde21b](https://github.com/facebook/react-native/commit/aa53bde21b8952533cf17ffee234b273766f2133) by [@j-piasecki](https://github.com/j-piasecki))
- **style:** Fix for nodes with `display: contents` not being cleaned in some cases ([a88ddcecc9](https://github.com/facebook/react-native/commit/a88ddcecc93a9fa2d231907439d02b11bac8a944) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Fix text not taking full width ([550b0c0ed1](https://github.com/facebook/react-native/commit/550b0c0ed16a64ce58102f15d4657abe92aac71c) by [@s77rt](https://github.com/s77rt))
github.com/robhogan))
- **Text:** AnsiHighlight style in RTL layout ([9a3958a619](https://github.com/facebook/react-native/commit/9a3958a619fddb75ed3c6eddebd94f11c0d00e9f) by [@hexboy](https://github.com/hexboy))
- **Text:** TextTransform: capitalize better reflects the web behaviour ([dc2000c875](https://github.com/facebook/react-native/commit/dc2000c8750f42b2f01bdad75455750814d567c6) by [@javache](https://github.com/javache))
- **tracing:** `PerformanceEntryReporter::reportMark` and `PerformanceEntryReporter::reportMeasaure` now return created performance entries. ([32f7b3b4e0](https://github.com/facebook/react-native/commit/32f7b3b4e0b8be1d1138f43c46b3c86d9a64c29a) by [@robik](https://github.com/robik))
- **TypeScript** The definition of ts of resizeMethod attribute is none. ([758892a7d8](https://github.com/facebook/react-native/commit/758892a7d89cc1e316984f8f522738021410f530) by [@nianxiongdi](https://github.com/nianxiongdi))
- **VirtualizedList:** Fix onEndReached not being called when getItemLayout is present and we scroll past render window ([3485e9ed87](https://github.com/facebook/react-native/commit/3485e9ed871886b3e7408f90d623da5c018da493) by YunPeng Chong)
- **VirtualizedList** Fix onEndReached not being called when getItemLayout is present and we scroll past render window ([62b7396bf4](https://github.com/facebook/react-native/commit/62b7396bf45c04bd47e74fe4c1e5b5e59918244d) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **C++:** Fixes C++ TurboModules: Prioritise OnLoad.cpp, falling back to default-app-setup ([5a64bde701](https://github.com/facebook/react-native/commit/5a64bde701e28615a79ad52d0631de62ce6cab92) by [@timbocole](https://github.com/timbocole))
- **Codegen:** Fix IOException in `BuildCodegenCLITask` ([9147b0753a](https://github.com/facebook/react-native/commit/9147b0753a6c3afb2480b079f91614cd7189a28a) by [@vonovak](https://github.com/vonovak))
- **Dialog:** Fixed styling on alert dialog titles to wrap two lines and retain bold appearance ([c54b23ff9e](https://github.com/facebook/react-native/commit/c54b23ff9ed7a6bfbb52c081c5afe4b3911d0dd2) by [@Abbondanzo](https://github.com/Abbondanzo))
- **graphics:** Missing isInvertColorsEnabled implementation for Android ([cc1d2853fb](https://github.com/facebook/react-native/commit/cc1d2853fb2b64adfb884cb30c8d22ce0260be15) by [@oddlyspaced](https://github.com/oddlyspaced))
- **Headless Tasks:** Fix crash on HeadlessJsTaskService on old architecture ([4560fc0497](https://github.com/facebook/react-native/commit/4560fc049748a345d5945bc08d43f4b61ca51ff3) by [@cortinico](https://github.com/cortinico))
- **Image:** Apps will no longer fatally crash when trying to draw large images ([483b928224](https://github.com/facebook/react-native/commit/483b92822496fa2e6339f75049a33be1e9567f52) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Image:** Avoid blocking the main thread when decompressing drawable resources ([420229d669](https://github.com/facebook/react-native/commit/420229d66946320f06485c5a3d3c167eae1a407e) by [@Abbondanzo](https://github.com/Abbondanzo))
- **JSC:** Fixes RNTester JSC Debug instacrashing ([17a5d2be5a](https://github.com/facebook/react-native/commit/17a5d2be5a96703ed1c76d89990a8f1e37abd4d4) by [@cortinico](https://github.com/cortinico))
- **layout:** Reenable `setAndroidLayoutDirection` by default ([6cf0cfb5a4](https://github.com/facebook/react-native/commit/6cf0cfb5a47a437b8a17b50b4c70460be15ee1cd) by [@NickGerleman](https://github.com/NickGerleman))
- **Layout:** Restore layout/invalidate during ReactViewClippingManager.removeViewAt() ([e3970a4bb3](https://github.com/facebook/react-native/commit/e3970a4bb3f39ec5652277d78d8c58c89e87dc30) by [@tdn20](https://github.com/tdn20))
- **Layoutanimations:** LayoutAnimations work on full new architecture ([43af902693](https://github.com/facebook/react-native/commit/43af902693f0befde802a7f684e26b19ec7126c8) by [@javache](https://github.com/javache))
- **Modal:** Fix issues with Modals and lifecycle events in multi-surface apps ([1ffef5669c](https://github.com/facebook/react-native/commit/1ffef5669c21f4b2c5fec6bc58a85f95518cf10e) by [@rozele](https://github.com/rozele))
- **Modal:** Fix crash for Modal not attached to window manager ([eaa780de1c](https://github.com/facebook/react-native/commit/eaa780de1c799bf35fded2914d27b1953b093340) by [@cipolleschi](https://github.com/cipolleschi))
- **Permissions:** Prevent ArrayIndexOutOfBoundsException in permission check ([6aeca53b3e](https://github.com/facebook/react-native/commit/6aeca53b3ed4530e57a31d7a5593ae16b550b985) by [@antFrancon](https://github.com/antFrancon))
- **ReactNativeDevTools:** Fix source loading when using an Android emulator connecting to a dev server on the host. ([ca9c56329f](https://github.com/facebook/react-native/commit/ca9c56329fe548b6631934afee0c9be63e1752a1) by [@robhogan](https://github.com/robhogan))
- **RNGP** Do not attempt to substring to 1024 while logging ([e64513bf4e](https://github.com/facebook/react-native/commit/e64513bf4ecce60aff5c04e3bed91b203429d12f) by [@cortinico](https://github.com/cortinico))
- **runtime:** Fixes some deadlocks when doing commits and state updates synchronously from the UI thread (e.g.: from reanimated). ([3986eefed1](https://github.com/facebook/react-native/commit/3986eefed1733f305db5410737a96b635f0159e7) by [@rubennorte](https://github.com/rubennorte))
- **runtime:** Addressed race condition in surface start. ([6ba7cb3102](https://github.com/facebook/react-native/commit/6ba7cb310273a0ecce6a168bf3aae45fb85bf955) by [@javache](https://github.com/javache))
- **runtime:** Avoid null reference exception in bridgeless ReactDelegate ([0d664100bb](https://github.com/facebook/react-native/commit/0d664100bbf608550a5c42a4e9b02c6c5bd0f5b8) by [@rozele](https://github.com/rozele))
- **runtime:** Fix Frame Callback not being called after Host Resume ([e8f8ee3c0f](https://github.com/facebook/react-native/commit/e8f8ee3c0f28b8c5751ffaef495adea0b8daf1eb) by [@s77rt](https://github.com/s77rt))
- **runtime:** Merge Android ViewNativeComponent ViewConfig into BaseViewConfig ([0ba00fc998](https://github.com/facebook/react-native/commit/0ba00fc99891a333d3625db15d9dd832ca7eac88) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Add missing BaseViewManager props to BaseViewManagerDelegate ([6741fd94ad](https://github.com/facebook/react-native/commit/6741fd94ad26012938caa65a5129f0eca6f2246e) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix issue where `onDropViewInstance` cleanup was not being handled after `ReactRootView.unmountReactApplication` ([0449630612](https://github.com/facebook/react-native/commit/04496306123c46730b46accb2cd6239531e51fef) by [@rozele](https://github.com/rozele))
- **runtime:** Fix some cases where we override setBackgroundColor on View-level instead of VM level ([0b0ac81fbe](https://github.com/facebook/react-native/commit/0b0ac81fbeebf819e744b6ecc19d549aaab8406d) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix interactions between removeClippedSubviews and RTL ([513e9669e7](https://github.com/facebook/react-native/commit/513e9669e78a4bfd9b0380335c61f581343c4009) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix: ReactDelegate/ReactFragment crashing on New Architecture apps ([12dda31bc1](https://github.com/facebook/react-native/commit/12dda31bc12f4a04ec9df70d30328b1001bb2cec) by [@cortinico](https://github.com/cortinico))
- **runtime:** ReactFragment should properly instantiate ReactDelegate on Bridgeless ([7176d11ce4](https://github.com/facebook/react-native/commit/7176d11ce468ca37e9cbe8afcc1f6344c250dd0c) by [@cortinico](https://github.com/cortinico))
- **runtime:** ARG_DISABLE_HOST_LIFECYCLE_EVENTS in ReactFragment to allow unmounting a surface without destroying ReactHost. ([40c875deca](https://github.com/facebook/react-native/commit/40c875decabaa56d6dd45ce03b22e8b3931781ac) by [@vincenzovitale](https://github.com/vincenzovitale))
- **runtime:** Use appropriate Nullable attribute for ReactRootView field in ReactDelegate ([cbddcfc691](https://github.com/facebook/react-native/commit/cbddcfc6911101608df36f2a8d047768296c63b2) by [@rozele](https://github.com/rozele))
- **runtime:** Hover events were dispatched incorrectly when multiple ReactRoots were layered. ([533ef2ca37](https://github.com/facebook/react-native/commit/533ef2ca37d3b19fc909315f183e3f30dbf4b93d) by [@javache](https://github.com/javache))
- **runtime:** Handle removal of in-transition views. ([f402ed17fa](https://github.com/facebook/react-native/commit/f402ed17fa6d75aea24e2ad99a8b8d8ad20840e3) by [@kkafar](https://github.com/kkafar))
- **ScrollView** Dispatch onMomentumScrollEnd after programmatic scrolling ([c69e330324](https://github.com/facebook/react-native/commit/c69e330324724a1e363f4786b2b03ee7ff4b35c5) by [@Biki-das](https://github.com/Biki-das))
- **ScrollView:** Fix legacy arch RTL horizontal ScrollView regression ([bfca7cfe7a](https://github.com/facebook/react-native/commit/bfca7cfe7a8e0da10fdb776100fbc706233c0d8d) by [@NickGerleman](https://github.com/NickGerleman))
- **ScrollView:** Fix RTL ScrollView position when content smaller than container ([0df59d4f03](https://github.com/facebook/react-native/commit/0df59d4f03f79c0fcb9ede2d21bf4d49c97c21ef) by [@NickGerleman](https://github.com/NickGerleman))
- **ScrollView:** Fixed incorrect scroll event/position for scroll views when doing a smooth scroll animation. ([b4c41ec768](https://github.com/facebook/react-native/commit/b4c41ec7685da6e8ef35c41c30aa402639bc42c1) by [@rubennorte](https://github.com/rubennorte))
- **Suspense** Fix crash in getViewState when using suspense fallbacks. ([bd133b5dd5](https://github.com/facebook/react-native/commit/bd133b5dd57b18140eae51c6d7aaab02874455c1) by [@javache](https://github.com/javache))
- **style:** Enable mix-blend-mode on ReactRootView so blending works with app background ([24b0ded3cf](https://github.com/facebook/react-native/commit/24b0ded3cf715bb0e849d9f7ca8cd2d4d42cbf90) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** BoxShadow now supports platformColor. ([4ede9205a0](https://github.com/facebook/react-native/commit/4ede9205a0559fcaf7ac58a3d70bc902eb23fcb6) by [@javache](https://github.com/javache))
- **style:** MixBlendMode now properly does state updates ([fae572d815](https://github.com/facebook/react-native/commit/fae572d815c7fb9684fc6c3b7f001de35ea8fb69) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** Linear gradient with platform colors ([6866968a79](https://github.com/facebook/react-native/commit/6866968a79d44518884965959760983acdadc17c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **Text:** Ensure setSelection in onAttachedToWindow is within text range ([08759121cd](https://github.com/facebook/react-native/commit/08759121cda3785e4d7ee1f1c82011a3e3a955a9) by [@zeyap](https://github.com/zeyap))
- **Text:** Fixed crash in legacy ReactFontManager ([3da23f7093](https://github.com/facebook/react-native/commit/3da23f7093730e10aeda6b58f4934a381e226dd2) by [@javache](https://github.com/javache))
- **Text:** Reimplement Android lineHeight positioning/determination ([41265bac6b](https://github.com/facebook/react-native/commit/41265bac6b83ee0bb92d645ace81e314065bf5e0) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Text without explicit font styles was potentially cut-off. ([95a5d1c628](https://github.com/facebook/react-native/commit/95a5d1c6287c7301265207d1962ba8b50d178b20) by [@javache](https://github.com/javache))
- **Text:** Fix mising `ANTI_ALIAS_FLAG` when resetting Text Paint ([276e3a7df7](https://github.com/facebook/react-native/commit/276e3a7df7de1b04dec0891fa7ed72917568ee7b) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Properly fix measurement of trailing newlines ([060c594457](https://github.com/facebook/react-native/commit/060c59445740f9b92188d2193623b36c3d859ba7) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Fixed text being measured incorrectly when ending with an empty line on the new architecture ([bd323929dc](https://github.com/facebook/react-native/commit/bd323929dc5be5666ee36043babec7d981a095dc) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Improve text line height calculation ([65d8f66b50](https://github.com/facebook/react-native/commit/65d8f66b50471d2fb4ddd5e63e17fcc808623110) by [@mellyeliu](https://github.com/mellyeliu))
- **Text:** Fix generating empty line at the end of multiline text view when `textAlign` is set to `justify` ([08e8f6adfd](https://github.com/facebook/react-native/commit/08e8f6adfdcdfec59002f34bb7acf35bb842b331) by [@coado](https://github.com/coado))
- **TextInput:** Fix TextInput caret moving to the beginning when attached to window ([ca0abd1b9e](https://github.com/facebook/react-native/commit/ca0abd1b9ea164a566b39cb9090eaa75647aad5a) by [@QichenZhu](https://github.com/QichenZhu))
- **TextInput:** Fix NPE on ReactTextInputManager.setTextDecorationLine ([41c6ad5597](https://github.com/facebook/react-native/commit/41c6ad55978184cad1a32ec63c2d1f07e8282d5e) by [@cortinico](https://github.com/cortinico))
- **VirtualizedList:** Account for items dynamically scaling with the container when using `maintainVisibleContentPosition` in virtualized lists ([6c19996e10](https://github.com/facebook/react-native/commit/6c19996e10eda97a3501f53a68da246d1f122d01) by [@fabriziocucci](https://github.com/fabriziocucci))
- **Yoga:** Fix YogaConfig getting garbage collected #1678 ([7dcb10b6e7](https://github.com/facebook/react-native/commit/7dcb10b6e7e226034a496eaed5351601ae0a1ae2) by [@michaeltroger](https://github.com/michaeltroger))
#### iOS specific
- **Accessibility:** Make sure that the Increment and Decrement accessibility actions works on iOS ([303e0ed764](https://github.com/facebook/react-native/commit/303e0ed7641409acf2d852c077f6be426afd7a0c) by [@cipolleschi](https://github.com/cipolleschi))
- **ActionSheetIOS:** Fix ActionSheetIOS crash `attempt to insert nil object from objects` ([bebd6531b5](https://github.com/facebook/react-native/commit/bebd6531b5f4ef0300aa5a4b6f9d23e60b57a25e) by [@RodolfoGS](https://github.com/RodolfoGS))
- **AppClips:** Fix launching App Clips with nullish URLs. ([043e2fe14a](https://github.com/facebook/react-native/commit/043e2fe14a6f13885a552211f17d61292001fa76) by [@EvanBacon](https://github.com/EvanBacon))
- **Cocoapods:** Typo in spm.rb ([5e18f7f788](https://github.com/facebook/react-native/commit/5e18f7f788ccbea60e96b8e7deab29d423ccf1a6) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** Fallback to old resolve mechanism when node require fails to resolve react native path ([3cbaddbc16](https://github.com/facebook/react-native/commit/3cbaddbc164b9dc326b2a7ddc0b35ce885bc7d9d) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** Enable hermes debugger by configuration type instead of configuration name ([eda4f185b3](https://github.com/facebook/react-native/commit/eda4f185b381f7569a1029b7697f9a1c8bc6d108) by [@benhandanyan](https://github.com/benhandanyan))
- **ObjC:** Fix numerous class interfaces having incorrect designated initializer patterns ([b98846c2e3](https://github.com/facebook/react-native/commit/b98846c2e37c3ec895536ab942978d7701f51a5e) by Nolan O'Brien)
- **PrivacyInfo:** Don't reference PrivacyInfo.xcprivacy twice for new projects ([cadd41b1a2](https://github.com/facebook/react-native/commit/cadd41b1a2e16b1c77a8d3022f4ccbdbd5ea295f) by [@okwasniewski](https://github.com/okwasniewski))
- **ReactNativeDevTools:** "Reconnect DevTools" button not working sometimes ([8507204b53](https://github.com/facebook/react-native/commit/8507204b533cf87d1e4345a9c062cd10cf0022c1) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ReactNativeDevTools:** Fix `r` & `d` not working from Metro sometimes ([9a60038a40](https://github.com/facebook/react-native/commit/9a60038a40e16925ea1adeb3e3c937c22a615485) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ScrollView:** Fixed `onMomentumScrollBegin` event not firing on command-driven scroll events ([5b609cca09](https://github.com/facebook/react-native/commit/5b609cca099b3b0d4fc66d4cf50f69d3c5b7fc8e) by [@Abbondanzo](https://github.com/Abbondanzo))
- **ScrollView:** AutomaticallyAdjustKeyboardInsets not shifting scrollview content ([2d9933e616](https://github.com/facebook/react-native/commit/2d9933e616c3efe57ed0ca141277638182a69d9c) by [@zhongwuzw](https://github.com/zhongwuzw))
- **ScrollView:** Fixes scrollIndicatorInsets not work in old arch ([c1178ac208](https://github.com/facebook/react-native/commit/c1178ac2085e073afb07453eefc9095a1f5d530f) by [@zhongwuzw](https://github.com/zhongwuzw))
- **ScrollView:** fix: vertical scroll views are detected as horizontals ([ab8f3ff3e9](https://github.com/facebook/react-native/commit/ab8f3ff3e9e6445fa9961467e965792908d4c2bd) by [@coado](https://github.com/coado))
- **style:** Fixes CornerRadiiAreEqualAndSymmetrical error when check topLeftHorizontal == topLeftVertical ([af384a914a](https://github.com/facebook/react-native/commit/af384a914a4e9ef6a5d25b00bc14b0483e5af879) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text:** Fixes missing char mode of linebreakmode ([77889afa1c](https://github.com/facebook/react-native/commit/77889afa1c9d0bdb966102860a5d1d1d91187ae8) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text:** Fix possible NSRangeException when updating typing attributes in response to new text content ([6e06a810f0](https://github.com/facebook/react-native/commit/6e06a810f0ab1002f1d10351bc878babde36b1f1) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fixed use of view commands from layout effects ([6f1c2a512e](https://github.com/facebook/react-native/commit/6f1c2a512e44d25edefea53e864f688018745c07) by [@sammy-SC](https://github.com/sammy-SC))
- **runtime:** Fixed crash on promise rejection handler in iOS 18. ([26d8d490e4](https://github.com/facebook/react-native/commit/26d8d490e47bd3fa46dc4a3b8e66e9ec35c15cf7) by David Rickard)
- **runtime:** Cast the UIScene to UIWindowScene only if the scene respond to the selector ([fdee0ebbcb](https://github.com/facebook/react-native/commit/fdee0ebbcb88f40c23b92b07792fbb9d1041c546) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Fixes the exported synchronous method not being called on the method queue when it's the main queue ([8bfd7e1039](https://github.com/facebook/react-native/commit/8bfd7e10393e649554c7246df430019c4f78d5e0) by [@zhongwuzw](https://github.com/zhongwuzw))
- **TextInput:** Fixes numeric TextInput not triggering `onSubmitEditing` ([0bcb0c2b2f](https://github.com/facebook/react-native/commit/0bcb0c2b2f460ed1a9d525d1a5b343f4b71f9347) by [@zhongwuzw](https://github.com/zhongwuzw))
- **TextInput:** Fixed problem with third party libraries overwriting `inputAccessoryView` ([d34032b6c0](https://github.com/facebook/react-native/commit/d34032b6c0bb3564a7b77ef270cc3289d99365f2) by [@kirillzyusko](https://github.com/kirillzyusko))
- **TextInput:** Workaround for Mac Catalyst TextInput crash due to serialization attempt of WeakEventEmitter ([e04738b7ec](https://github.com/facebook/react-native/commit/e04738b7ecec9e7da3aab49bb24a6336b9496b94) by [@rozele](https://github.com/rozele))
- **TextInput:** Fix `maxLength` not working in old arch ([4b3ef3b00c](https://github.com/facebook/react-native/commit/4b3ef3b00ce0026c0d1e1f2a5546fcec249255d8) by [@mateoguzmana](https://github.com/mateoguzmana))
## v0.76.7
### Changed
#### iOS specific
- **Deps:** Pin 'concurrent-ruby' to a working version ([198adb47af](https://github.com/facebook/react-native/commit/198adb47af3676c85b35adb308c110c1d87120c8) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- **Text** Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture ([ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32](https://github.com/facebook/react-native/commit/ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32) by [@RickardZrinski](https://github.com/RickardZrinski))
- **Appearance:** Fix `Appearance.setColorScheme(null)` not resetting color scheme value ([7d63235086](https://github.com/facebook/react-native/commit/7d63235086352d8c424d634c7039551f0a5025dc) by [@sangonz193](https://github.com/sangonz193))
#### Android specific
- **Deps:** Add missing `invariant` dependency ([ee8088b615](https://github.com/facebook/react-native/commit/ee8088b6157837c239db47ac5bd3a8603ceefc3c) by [@tido64](https://github.com/tido64))
- **Turbomodule** Fix execution of early InteropEvents ([4ed2b35bf6](https://github.com/facebook/react-native/commit/4ed2b35bf61426c81c9f8b30a142d77b44988fdb) by [@mdvacca](https://github.com/mdvacca))
- **Deps:** Bump Kotlin to 1.9.25 to mitigate #49115 ([f8857ba3b5](https://github.com/facebook/react-native/commit/f8857ba3b51f26871d0a0b82b9581a0c35b6273d) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- **runtime:** `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. ([13b93cfdda](https://github.com/facebook/react-native/commit/13b93cfddaa559697968ac1c19e55f7aaa053070) by Nolan O'Brien)
- Be less strict with method parsing of TurboModule Interop Layer
- **Turbomodule:** Avoid crashing the app when the InteropLayer can't find some methods in the native implementation. ([3bd3f101b9](https://github.com/facebook/react-native/commit/3bd3f101b9dcff8551a2f8259ddeed9843fd69b8) by [@cipolleschi](https://github.com/cipolleschi))
- **Runtime:** Fix applicationDidEnterBackground not being called ([adaceba546](https://github.com/facebook/react-native/commit/adaceba5462b4ad8676745f34e0be2bf5bb25166) by [@alextoudic](https://github.com/alextoudic))
## v0.76.6
### Fixed
- **layout:** Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints ([f7a5db3c06](https://github.com/facebook/react-native/commit/f7a5db3c063b952321826ea431d3d238ef0de65d) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **layout:** Restore layout/invalidate during ReactViewClippingManager.removeViewAt() ([0683206927](https://github.com/facebook/react-native/commit/068320692748f0c46867625786a780366fdbb1d6) by Thomas Nardone)
- **Native Modules:** Prioritise local OnLoad.cpp, falling back to default-app-setup ([8b1f049879](https://github.com/facebook/react-native/commit/8b1f04987936ab2bc7dcf62adc92bf394d35f77b) by [@timbocole](https://github.com/timbocole))
- **runtime:** Remove feature flag for allowRecursiveCommitsWithSynchronousMountOnAndroid ([fb7f87ecb2](https://github.com/facebook/react-native/commit/fb7f87ecb27f9006e2018b9622d329feb1ba23a4) by [@cipolleschi](https://github.com/cipolleschi))
#### iOS specific
- **TextInput:** Fixing TextInput `maxLength` not working in old arch ([9ecf290d27](https://github.com/facebook/react-native/commit/9ecf290d270598e45832a75f657d73cf20088a37) by [@mateoguzmana](https://github.com/mateoguzmana))
## v0.76.5
### Fixed
- Better support filtering out non linked platforms ([fcbcf80d1c](https://github.com/facebook/react-native/commit/fcbcf80d1c080af42b5277fc8a153059194efb95) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Fix crash on HeadlessJsTaskService on old architecture ([4560fc0497](https://github.com/facebook/react-native/commit/4560fc049748a345d5945bc08d43f4b61ca51ff3) by [@cortinico](https://github.com/cortinico))
## v0.76.4
### Added
- Sync debugger-frontend to latest 0.76-stable (fix Expo node_modules entry points in Sources panel) ([43fe69c315](https://github.com/facebook/react-native/commit/43fe69c315e68aab96c303c7a6c9b3821a6e25e5) by [@huntie](https://github.com/huntie))
- Exclude unlinked libs from codegen ([3cedb09a65](https://github.com/facebook/react-native/commit/3cedb09a650adda0b3f24e931c25f27730af19b1) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Avoid NPE when touch event is triggered before SurfaceManager is initiated ([b8095f4692](https://github.com/facebook/react-native/commit/b8095f4692610c7f4631b851dc7d8dc9b149a277) by [@CHOIMINSEOK](https://github.com/CHOIMINSEOK))
## v0.76.3
### Fixed
#### Android specific
- Look for sdkmanager.bat ([6460d2b3e7](https://github.com/facebook/react-native/commit/6460d2b3e74c3a6e4075e9f12304c16427c3b1b2) by [@blakef](https://github.com/blakef))
- CMake Windows path normalization ([9946838bedd](https://github.com/facebook/react-native/commit/9946838beddac549053a3ba3eb3b1b49c22a3fd9) by [@blakef](https://github.com/blakef))
- Fix build failure on windows in android ([08b83005481](https://github.com/facebook/react-native/commit/08b830054812f4011becbbacdf1525701225df39) by [@FouadMagdy01](https://github.com/FouadMagdy01))
## v0.76.2
### Added
- **TypeScript** Add CodegenTypes for TS ([20b141508b](https://github.com/facebook/react-native/commit/20b141508b30324d52080c255dd3fb318718d746) by [@cipolleschi](https://github.com/cipolleschi))
### Changed
- **infra** Bump CLI to 15.0.1 ([51b98c24bd](https://github.com/facebook/react-native/commit/51b98c24bdc6369ce6fabcacaf8df2d2a706eada) by [@szymonrybczak](https://github.com/szymonrybczak))
#### iOS specific
- **TextInput** Include existing attributes in newly typed text ([557e3447f5](https://github.com/facebook/react-native/commit/557e3447f520e40a1ec0ae344126b4f2836d2e83) by [@NickGerleman](https://github.com/NickGerleman))
### Fixed
- **Hermes** Update Hermes to support Intl ([94d4bfd7c8](https://github.com/facebook/react-native/commit/94d4bfd7c80ba0d55adbff656441b55d59055bcc) by [@blakef](https://github.com/blakef))
- **infra** Skip hermes-parser under Babel for non-Flow JS code ([ff1261e7dc](https://github.com/facebook/react-native/commit/ff1261e7dc0ab7e241e1f14aa0d6fd17f2ba9328) by [@huntie](https://github.com/huntie))
- **infra** fix `semver` not being found in pnpm setups ([0def73d1a6](https://github.com/facebook/react-native/commit/0def73d1a6e398d451585032ea1213f96d84fe9c) by [@tido64](https://github.com/tido64))
- **Error Handling** Fix `setUpErrorHandling` to show early JS errors ([dac6d508af](https://github.com/facebook/react-native/commit/dac6d508afd0f919943d8053330d6314201319c3) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- **infra** Use absolute path when compiling appmodules.so sources ([3956955eaa](https://github.com/facebook/react-native/commit/3956955eaa3cd8c50dfe35a68a6cb8fdcac43155) by [@cortinico](https://github.com/cortinico))
- **infra** Properly handle paths with spaces in autolinking ([1f62529dc4](https://github.com/facebook/react-native/commit/1f62529dc4583af88ef06bee04c89ce6c2ef737f) by [@cortinico](https://github.com/cortinico))
- **Modal** Fix Regression - Modal content rendering below system bar on < API 30 when activity is edge-to-edge ([2cd48ef351](https://github.com/facebook/react-native/commit/2cd48ef351d10333a14091188bbe8e3bcd6a7a01) by [@alanleedev](https://github.com/alanleedev))
- **runtime** Fix timers in headless tasks on bridgeless mode ([ee7b4e2763](https://github.com/facebook/react-native/commit/ee7b4e276355146be53958b402bfb2d5af2dd1bc) by [@j-piasecki](https://github.com/j-piasecki))
#### iOS specific
- **Codegen** Properly stop generating component registration for components defined in app. ([97a4234b6e](https://github.com/facebook/react-native/commit/97a4234b6e51b3c35c82095029ef00270ad02e29) by [@cipolleschi](https://github.com/cipolleschi))
- **infra** Give apps access to Yoga headers ([e851e73c18](https://github.com/facebook/react-native/commit/e851e73c1806a7b7b898a67716be87f42ced491a) by [@cipolleschi](https://github.com/cipolleschi))
- **TextInput** Fix missing emitter attributes on iOS TextInput when controlled component value specified using `value` instead of `children` ([52cdedb40e](https://github.com/facebook/react-native/commit/52cdedb40e242c9ed280b821f8493a3872ef2b54) by [@NickGerleman](https://github.com/NickGerleman))
- **TextInput** Fix cursor moving in iOS controlled single line TextInput on Autocorrection (New Arch) ([36fd5533f6](https://github.com/facebook/react-native/commit/36fd5533f68b0f907a949db87884b58820015ba8) by [@NickGerleman](https://github.com/NickGerleman))
## 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
@@ -306,6 +947,40 @@ created on the mqt_native thread. ([c4a6bbc8fd](https://github.com/facebook/reac
- **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.5
### Added
- **Hermes:** Implement more missing methods on WithRuntimeDecorator ([80f67ca03c](https://github.com/facebook/react-native/commit/80f67ca03c99c688e2a3127e9b3dddd02625848e) by [@neildhar](https://github.com/neildhar))
### Changed
#### Android specific
- **Deps:** Bump Kotlin to 1.9.25 to mitigate [#49115](https://github.com/facebook/react-native/issues/49115) ([25e76a2717](https://github.com/facebook/react-native/commit/25e76a271781b3ffe8002108d8b12aa3d47442b5) by [@riteshshukla04](https://github.com/riteshshukla04))
#### iOS specific
- **Deps:** Pin Xcodeproj to < 1.26.0 ([2922af2e7e](https://github.com/facebook/react-native/commit/2922af2e7e8527a93c7956b10ddb314f25c334fa) by [@cipolleschi](https://github.com/cipolleschi))
- **Deps:** Pin concurrent-ruby to <= 1.3.4 ([794bf34e60](https://github.com/facebook/react-native/commit/794bf34e60cea8146aebad1fefe051d4140fc28b) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- **FormData:** fix: FormData filename in content-disposition ([78ef1e2bc2](https://github.com/facebook/react-native/commit/78ef1e2bc2ed30321745e2505713915b9015d920) by [@foyarash](https://github.com/@foyarash))
#### Android specific
- **TextInput:** Set TextInput selection correctly when attached to window in Android ([1656394bae](https://github.com/facebook/react-native/commit/1656394bae16cc54fb38687d38bcbf85138c98a2) by [@QichenZhu](https://github.com/QichenZhu))
#### iOS specific
- **Animation:** Fabric: Fixes animations strict weak ordering sorted check failed ([ea0bc54115](https://github.com/facebook/react-native/commit/ea0bc541155700e0973d960c94d01918d6b28c6b) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Hermes** Exclude dSYM from the archive ([fdb2631b5e](https://github.com/facebook/react-native/commit/fdb2631b5ea27765663046b94f84956d30ebaaeb) by [@cipolleschi](https://github.com/cipolleschi))
- **Image** Fix images not displayed when extension is implicit ([b6ed0d351e](https://github.com/facebook/react-native/commit/b6ed0d351e246c431bdc88a6c3d154ba35220c25) by [@cipolleschi](https://github.com/cipolleschi))
- **Xcode:** Fix the generation of .xcode.env.local ([dbffbf72d7](https://github.com/facebook/react-native/commit/dbffbf72d7287e021e965b6639e455e8555bbf2e) by [@cipolleschi](https://github.com/cipolleschi))
## v0.75.4
### Fixed
@@ -708,6 +1383,21 @@ created on the mqt_native thread. ([c4a6bbc8fd](https://github.com/facebook/reac
- **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.7
### Fixed
#### Android specific
- Fix #41226 by suppressing path adjustment when not actually drawing a border ([8501b6396b](https://github.com/facebook/react-native/commit/8501b6396b0a4fd7a9bd2add2b3c8b9c755c27ae) by [@knappam](https://github.com/knappam))
- RGNP - Remove unnecessary dependency on `gradle-tooling-api-builders` - serviceOf failure ([b6bdecd309](https://github.com/facebook/react-native/commit/b6bdecd309bf74cfa80b71204d5266667cb3f843) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- Fix iOS crash occurring when navigating to a new app screen with a displaying modal ([52888c0c1e](https://github.com/facebook/react-native/commit/52888c0c1e722a799f233c2f502e01b9dd4a7174) by Zhi Zhou)
- Fix ruby for CI ([1c80702e95](https://github.com/facebook/react-native/commit/1c80702e95a6bcf422f5448b4578d71e8e78071b) by [@cipolleschi](https://github.com/cipolleschi))
- Fixes animations strict weak ordering sorted check failed ([60889e170c](https://github.com/facebook/react-native/commit/60889e170ca3f6187e15719a3d85da0bc7e974ff) by [@zhongwuzw](https://github.com/zhongwuzw))
## v0.74.6
### Added
@@ -1389,6 +2079,21 @@ created on the mqt_native thread. ([c4a6bbc8fd](https://github.com/facebook/reac
- 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.11
### Fixed
#### Android specific
- Suppress path adjustment when not actually drawing a border ([c9cf6d4b60](https://github.com/facebook/react-native/commit/c9cf6d4b60b6c5f717b3e5c9f3e3720e8d588707) by [@tjzel](https://github.com/tjzel))
#### iOS specific
- Stop generating dSYM path in Hermes for the framework ([e992405e87](https://github.com/facebook/react-native/commit/e992405e87) by [@cipolleschi](https://github.com/cipolleschi))
- Pin Xcodeproj to < 1.26.0 ([dfcad7c678](https://github.com/facebook/react-native/commit/dfcad7c678) by [@cipolleschi](https://github.com/cipolleschi))
## v0.73.10
### Removed
+8
View File
@@ -5,3 +5,11 @@ ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '<= 1.3.4'
# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
+10
View File
@@ -14,6 +14,8 @@ GEM
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
benchmark (0.4.0)
bigdecimal (3.1.9)
claide (1.1.0)
cocoapods (1.14.2)
addressable (~> 2.8)
@@ -65,8 +67,10 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
logger (1.6.5)
minitest (5.20.0)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
@@ -90,7 +94,13 @@ PLATFORMS
DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
benchmark
bigdecimal
cocoapods (~> 1.13, != 1.15.1, != 1.15.0)
concurrent-ruby (<= 1.3.4)
logger
mutex_m
xcodeproj (< 1.26.0)
RUBY VERSION
ruby 3.2.0p0
-393
View File
@@ -1,393 +0,0 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the "Licensor." Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.
Creative Commons may be contacted at creativecommons.org.
+2 -5
View File
@@ -13,9 +13,6 @@
<a href="https://github.com/facebook/react-native/blob/HEAD/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="React Native is released under the MIT license." />
</a>
<a href="https://circleci.com/gh/facebook/react-native">
<img src="https://circleci.com/gh/facebook/react-native.svg?style=shield" alt="Current CircleCI build status." />
</a>
<a href="https://www.npmjs.org/package/react-native">
<img src="https://img.shields.io/npm/v/react-native?color=brightgreen&label=npm%20package" alt="Current npm package version." />
</a>
@@ -67,7 +64,7 @@ React Native is developed and supported by many companies and individual core co
## 📋 Requirements
React Native apps may target iOS 13.4 and Android 6.0 (API 23) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this.
React Native apps may target iOS 15.1 and Android 7.0 (API 24) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this.
## 🎉 Building your first React Native app
@@ -87,7 +84,7 @@ The full documentation for React Native can be found on our [website][docs].
The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
The source for the React Native documentation and website is hosted on a separate repository, [**@facebook/react-native-website**][repo-website].
[docs]: https://reactnative.dev/docs/getting-started
[r-docs]: https://react.dev/learn
+1 -1
View File
@@ -92,7 +92,7 @@ tasks.register("build") {
tasks.register("publishAllToMavenTempLocal") {
description = "Publish all the artifacts to be available inside a Maven Local repository on /tmp."
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
// We don't publish the external-artifacts to Maven Local as CircleCI is using it via workspace.
// We don't publish the external-artifacts to Maven Local as ci is using it via workspace.
dependsOn(
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
}
+4199
View File
File diff suppressed because it is too large Load Diff
-21
View File
@@ -1,21 +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
*/
declare module 'data-uri-to-buffer' {
declare interface ParsedDataURI {
type: string;
typeFull: string;
charset: TextDecoder$availableEncodings;
buffer: ArrayBuffer;
}
declare export function dataUriToBuffer(uri: string | URL): ParsedDataURI;
}
+13 -1
View File
@@ -11,6 +11,18 @@
// https://github.com/visionmedia/debug
// https://www.npmjs.com/package/debug
interface DebugFN {
(...args: Array<mixed>): void;
enable(match: string): void;
disable(): void;
enabled: () => boolean;
}
declare module 'debug' {
declare module.exports: (namespace: string) => (...Array<mixed>) => void;
declare module.exports: {
(namespace: string): DebugFN,
enable(match: string): void,
disable(): void,
enabled: () => boolean,
};
}
+17
View File
@@ -0,0 +1,17 @@
/**
* 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
* @format
*/
declare module 'deep-equal' {
declare module.exports: (
actual: mixed,
expected: mixed,
options?: {strict: boolean},
) => boolean;
}
+32
View File
@@ -0,0 +1,32 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
*/
// Built to match the API @ 5.0.0
declare module 'ini' {
export type Options = {
whitespace?: boolean,
align?: boolean,
section?: string,
sort?: boolean,
newline?: boolean,
platform?: 'win32' | 'linux' | 'darwin',
bracketedArrays?: boolean,
};
declare type Ini = {
parse: <T>(string: string, options?: Options) => T,
decode: <T>(string: string) => T,
stringify: (
object: {[key: string]: string, ...},
section: string,
) => string,
safe: (string: string) => string,
unsafe: (string: string) => string,
};
declare module.exports: Ini;
}
+40
View File
@@ -0,0 +1,40 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'jest-diff' {
import type {CompareKeys} from 'pretty-format';
declare export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type
declare export type DiffOptions = {
aAnnotation?: string,
aColor?: DiffOptionsColor,
aIndicator?: string,
bAnnotation?: string,
bColor?: DiffOptionsColor,
bIndicator?: string,
changeColor?: DiffOptionsColor,
changeLineTrailingSpaceColor?: DiffOptionsColor,
commonColor?: DiffOptionsColor,
commonIndicator?: string,
commonLineTrailingSpaceColor?: DiffOptionsColor,
contextLines?: number,
emptyFirstOrLastLinePlaceholder?: string,
expand?: boolean,
includeChangeCounts?: boolean,
omitAnnotationLines?: boolean,
patchColor?: DiffOptionsColor,
compareKeys?: CompareKeys,
};
declare export function diff(
a: mixed,
b: mixed,
options?: DiffOptions,
): string | null;
}
+77
View File
@@ -0,0 +1,77 @@
/**
* 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
* @format
* @oncall react_native
*/
declare module 'jest-snapshot' {
type SnapshotFormat = {...};
type UpdateSnapshot = 'all' | 'new' | 'none';
type ProjectConfig = {
rootDir: string,
prettierPath: string,
snapshotFormat: SnapshotFormat,
...
};
type SnapshotResolver = {
/** Resolves from `testPath` to snapshot path. */
resolveSnapshotPath(testPath: string, snapshotExtension?: string): string,
/** Resolves from `snapshotPath` to test path. */
resolveTestPath(snapshotPath: string, snapshotExtension?: string): string,
/** Example test path, used for preflight consistency check of the implementation above. */
testPathForConsistencyCheck: string,
};
declare export var EXTENSION: 'snap';
declare export function isSnapshotPath(path: string): boolean;
type LocalRequire = (module: string) => mixed;
declare export function buildSnapshotResolver(
config: ProjectConfig,
localRequire?: Promise<LocalRequire> | LocalRequire,
): Promise<SnapshotResolver>;
type SnapshotStateOptions = {
updateSnapshot: UpdateSnapshot,
prettierPath?: string | null,
expand?: boolean,
snapshotFormat: SnapshotFormat,
rootDir: string,
};
type SnapshotData = Record<string, string>;
type SaveStatus = {
deleted: boolean,
saved: boolean,
};
declare export class SnapshotState {
_dirty: boolean;
_updateSnapshot: UpdateSnapshot;
_snapshotData: SnapshotData;
_initialData: SnapshotData;
_uncheckedKeys: Set<string>;
added: number;
expand: boolean;
matched: number;
unmatched: number;
updated: number;
constructor(testPath: string, options: SnapshotStateOptions): void;
save(): SaveStatus;
getUncheckedCount(): number;
getUncheckedKeys(): Array<string>;
removeUncheckedKeys(): void;
}
}
-39
View File
@@ -1,39 +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
* @format
* @oncall react_native
*/
declare module '@pkgjs/parseargs' {
declare export function parseArgs<
TOptions: {[string]: util$ParseArgsOption} = {},
>(config: {
args?: Array<string>,
options?: TOptions,
strict?: boolean,
allowPositionals?: boolean,
tokens?: false,
}): {
values: util$ParseArgsOptionsToValues<TOptions>,
positionals: Array<string>,
};
declare export function parseArgs<
TOptions: {[string]: util$ParseArgsOption} = {},
>(config: {
args?: Array<string>,
options?: TOptions,
strict?: boolean,
allowPositionals?: boolean,
tokens: true,
}): {
values: util$ParseArgsOptionsToValues<TOptions>,
positionals: Array<string>,
tokens: Array<util$ParseArgsToken>,
};
}
+4 -1
View File
@@ -19,7 +19,6 @@ declare type Colors = {
tag: {close: string, open: string},
value: {close: string, open: string},
};
declare type CompareKeys = ((a: string, b: string) => number) | null | void;
declare type PrettyFormatPlugin =
| {
@@ -38,6 +37,10 @@ declare type PrettyFormatPlugin =
};
declare module 'pretty-format' {
declare export type CompareKeys =
| ((a: string, b: string) => number)
| null
| void;
declare export function format(
value: mixed,
options?: ?{
+43 -42
View File
@@ -1,29 +1,28 @@
// flow-typed signature: e556c06e721548417501c08b01fec911
// flow-typed version: ad3adf2de8/react-dom_v17.x.x/flow_>=v0.127.x
declare module 'react-dom' {
import type {Component} from 'react';
declare var version: string;
declare function findDOMNode(
componentOrElement: Element | ?React$Component<any, any>
componentOrElement: Element | ?Component<any, any>
): null | Element | Text;
declare function render<ElementType: React$ElementType>(
element: React$Element<ElementType>,
declare function render<ElementType: React.ElementType>(
element: ExactReactElement_DEPRECATED<ElementType>,
container: Element,
callback?: () => void
): React$ElementRef<ElementType>;
): React.ElementRef<ElementType>;
declare function hydrate<ElementType: React$ElementType>(
element: React$Element<ElementType>,
declare function hydrate<ElementType: React.ElementType>(
element: ExactReactElement_DEPRECATED<ElementType>,
container: Element,
callback?: () => void
): React$ElementRef<ElementType>;
): React.ElementRef<ElementType>;
declare function createPortal(
node: React$Node,
node: React.Node,
container: Element
): React$Portal;
): React.Portal;
declare function unmountComponentAtNode(container: any): boolean;
@@ -37,30 +36,32 @@ declare module 'react-dom' {
): void;
declare function unstable_renderSubtreeIntoContainer<
ElementType: React$ElementType
ElementType: React.ElementType
>(
parentComponent: React$Component<any, any>,
nextElement: React$Element<ElementType>,
parentComponent: Component<any, any>,
nextElement: ExactReactElement_DEPRECATED<ElementType>,
container: any,
callback?: () => void
): React$ElementRef<ElementType>;
): React.ElementRef<ElementType>;
}
declare module 'react-dom/server' {
declare var version: string;
declare function renderToString(element: React$Node): string;
declare function renderToString(element: React.Node): string;
declare function renderToStaticMarkup(element: React$Node): string;
declare function renderToStaticMarkup(element: React.Node): string;
declare function renderToNodeStream(element: React$Node): stream$Readable;
declare function renderToNodeStream(element: React.Node): stream$Readable;
declare function renderToStaticNodeStream(
element: React$Node
element: React.Node
): stream$Readable;
}
declare module 'react-dom/test-utils' {
import type {Component} from 'react';
declare interface Thenable {
then(resolve: () => mixed, reject?: () => mixed): mixed,
}
@@ -74,66 +75,66 @@ declare module 'react-dom/test-utils' {
};
declare function renderIntoDocument(
instance: React$Element<any>
): React$Component<any, any>;
instance: React.MixedElement
): Component<any, any>;
declare function mockComponent(
componentClass: React$ElementType,
componentClass: React.ElementType,
mockTagName?: string
): { [key: string]: mixed, ... };
declare function isElement(element: React$Element<any>): boolean;
declare function isElement(element: React.MixedElement): boolean;
declare function isElementOfType(
element: React$Element<any>,
componentClass: React$ElementType
element: React.MixedElement,
componentClass: React.ElementType
): boolean;
declare function isDOMComponent(instance: any): boolean;
declare function isCompositeComponent(
instance: React$Component<any, any>
instance: Component<any, any>
): boolean;
declare function isCompositeComponentWithType(
instance: React$Component<any, any>,
componentClass: React$ElementType
instance: Component<any, any>,
componentClass: React.ElementType
): boolean;
declare function findAllInRenderedTree(
tree: React$Component<any, any>,
test: (child: React$Component<any, any>) => boolean
): Array<React$Component<any, any>>;
tree: Component<any, any>,
test: (child: Component<any, any>) => boolean
): Array<Component<any, any>>;
declare function scryRenderedDOMComponentsWithClass(
tree: React$Component<any, any>,
tree: Component<any, any>,
className: string
): Array<Element>;
declare function findRenderedDOMComponentWithClass(
tree: React$Component<any, any>,
tree: Component<any, any>,
className: string
): ?Element;
declare function scryRenderedDOMComponentsWithTag(
tree: React$Component<any, any>,
tree: Component<any, any>,
tagName: string
): Array<Element>;
declare function findRenderedDOMComponentWithTag(
tree: React$Component<any, any>,
tree: Component<any, any>,
tagName: string
): ?Element;
declare function scryRenderedComponentsWithType(
tree: React$Component<any, any>,
componentClass: React$ElementType
): Array<React$Component<any, any>>;
tree: Component<any, any>,
componentClass: React.ElementType
): Array<Component<any, any>>;
declare function findRenderedComponentWithType(
tree: React$Component<any, any>,
componentClass: React$ElementType
): ?React$Component<any, any>;
tree: Component<any, any>,
componentClass: React.ElementType
): ?Component<any, any>;
declare function act(callback: () => void | Thenable): Thenable;
}
+45 -41
View File
@@ -1,50 +1,52 @@
// Type definitions for react-test-renderer 16.x.x
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
type ReactComponentInstance = React$Component<any>;
type ReactTestRendererJSON = {
type: string,
props: { [propName: string]: any, ... },
children: null | ReactTestRendererJSON[],
...
};
type ReactTestRendererTree = ReactTestRendererJSON & {
nodeType: "component" | "host",
instance: ?ReactComponentInstance,
rendered: null | ReactTestRendererTree,
...
};
type ReactTestInstance = {
instance: ?ReactComponentInstance,
type: string,
props: { [propName: string]: any, ... },
parent: null | ReactTestInstance,
children: Array<ReactTestInstance | string>,
find(predicate: (node: ReactTestInstance) => boolean): ReactTestInstance,
findByType(type: React$ElementType): ReactTestInstance,
findByProps(props: { [propName: string]: any, ... }): ReactTestInstance,
findAll(
predicate: (node: ReactTestInstance) => boolean,
options?: { deep: boolean, ... }
): ReactTestInstance[],
findAllByType(
type: React$ElementType,
options?: { deep: boolean, ... }
): ReactTestInstance[],
findAllByProps(
props: { [propName: string]: any, ... },
options?: { deep: boolean, ... }
): ReactTestInstance[],
...
};
type TestRendererOptions = { createNodeMock(element: React.MixedElement): any, ... };
declare module "react-test-renderer" {
declare export type ReactTestRenderer = {
import type {Component as ReactComponent} from 'react';
type ReactComponentInstance = ReactComponent<any>;
export type ReactTestRendererJSON = {
type: string,
props: { [propName: string]: any, ... },
children: null | ReactTestRendererJSON[],
...
};
export type ReactTestRendererTree = ReactTestRendererJSON & {
nodeType: "component" | "host",
instance: ?ReactComponentInstance,
rendered: null | ReactTestRendererTree,
...
};
export type ReactTestInstance = {
instance: ?ReactComponentInstance,
type: string,
props: { [propName: string]: any, ... },
parent: null | ReactTestInstance,
children: Array<ReactTestInstance | string>,
find(predicate: (node: ReactTestInstance) => boolean): ReactTestInstance,
findByType(type: React.ElementType): ReactTestInstance,
findByProps(props: { [propName: string]: any, ... }): ReactTestInstance,
findAll(
predicate: (node: ReactTestInstance) => boolean,
options?: { deep: boolean, ... }
): ReactTestInstance[],
findAllByType(
type: React.ElementType,
options?: { deep: boolean, ... }
): ReactTestInstance[],
findAllByProps(
props: { [propName: string]: any, ... },
options?: { deep: boolean, ... }
): ReactTestInstance[],
...
};
export type ReactTestRenderer = {
toJSON(): null | ReactTestRendererJSON,
toTree(): null | ReactTestRendererTree,
unmount(nextElement?: React.MixedElement): void,
@@ -65,6 +67,8 @@ declare module "react-test-renderer" {
}
declare module "react-test-renderer/shallow" {
import type {ReactTestInstance} from 'react-test-renderer';
declare export default class ShallowRenderer {
static createRenderer(): ShallowRenderer;
getMountedInstance(): ReactTestInstance;
+121
View File
@@ -0,0 +1,121 @@
/**
* 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
* @format
* @oncall react_native
*/
declare module 'tinybench' {
declare export class Task extends EventTarget {
name: string;
result: void | $ReadOnly<TaskResult>;
runs: number;
reset(): void;
run(): Promise<Task>;
runSync(): Task;
warmup(): Promise<void>;
}
export type Hook = (
task: Task,
mode: 'run' | 'warmup',
) => Promise<void> | void;
export type BenchOptions = {
iterations?: number,
name?: string,
now?: () => number,
setup?: Hook,
signal?: AbortSignal,
teardown?: Hook,
throws?: boolean,
time?: number,
warmup?: boolean,
warmupIterations?: number,
warmupTime?: number,
};
export interface Statistics {
aad: void | number;
critical: number;
df: number;
mad: void | number;
max: number;
mean: number;
min: number;
moe: number;
p50: void | number;
p75: void | number;
p99: void | number;
p995: void | number;
p999: void | number;
rme: number;
samples: number[];
sd: number;
sem: number;
variance: number;
}
export interface TaskResult {
critical: number;
df: number;
error?: Error;
hz: number;
latency: Statistics;
max: number;
mean: number;
min: number;
moe: number;
p75: number;
p99: number;
p995: number;
p999: number;
period: number;
rme: number;
samples: number[];
sd: number;
sem: number;
throughput: Statistics;
totalTime: number;
variance: number;
}
export type FnOptions = {
afterAll?: (this: Task) => void | Promise<void>,
afterEach?: (this: Task) => void | Promise<void>,
beforeAll?: (this: Task) => void | Promise<void>,
beforeEach?: (this: Task) => void | Promise<void>,
};
export type Fn = () => Promise<mixed> | mixed;
declare export class Bench extends EventTarget {
concurrency: null | 'task' | 'bench';
name?: string;
opts: $ReadOnly<BenchOptions>;
threshold: number;
constructor(options?: BenchOptions): this;
// $FlowExpectedError[unsafe-getters-setters]
get results(): Array<$ReadOnly<TaskResult>>;
// $FlowExpectedError[unsafe-getters-setters]
get tasks(): Array<Task>;
add(name: string, fn: Fn, fnOpts?: FnOptions): this;
getTask(name: string): void | Task;
remove(name: string): this;
reset(): void;
run(): Promise<Array<Task>>;
runSync(): Array<Task>;
table(
convert?: (task: Task) => Record<string, void | string | number>,
): void | Array<Record<string, void | string | number>>;
}
}
+20
View File
@@ -16,6 +16,13 @@ declare interface undici$Agent$Options {
}
declare module 'undici' {
declare export type RequestOptions = $ReadOnly<{
dispatcher?: Dispatcher,
method?: string,
headers?: HeadersInit,
...
}>;
declare export class Dispatcher extends events$EventEmitter {
constructor(): void;
}
@@ -23,4 +30,17 @@ declare module 'undici' {
declare export class Agent extends Dispatcher {
constructor(opts?: undici$Agent$Options): void;
}
declare export function request(
url: string | URL,
options: RequestOptions,
): Promise<{
statusCode: number,
headers: Headers,
body: {
read(): Promise<Buffer>,
...
},
...
}>;
}
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.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -3
View File
@@ -86,8 +86,7 @@ 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Vendored
-5
View File
@@ -1,8 +1,3 @@
@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
-1
View File
@@ -37,7 +37,6 @@ module.exports = {
'/node_modules/',
'<rootDir>/packages/react-native/sdks',
'<rootDir>/packages/react-native/Libraries/Renderer',
'<rootDir>/packages/react-native-test-renderer/src',
'<rootDir>/packages/react-native/sdks/hermes/',
...PODS_LOCATIONS,
],
+1 -1
View File
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
require('@fb-tools/babel-register');
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/build/babel-register').registerForMonorepo();
require('../scripts/babel-register').registerForMonorepo();
}
const transformer = require('@react-native/metro-babel-transformer');
+31 -29
View File
@@ -5,33 +5,33 @@
"license": "MIT",
"packageManager": "yarn@1.22.22",
"scripts": {
"android": "cd packages/rn-tester && npm run android",
"android": "yarn --cwd packages/rn-tester android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
"build": "node ./scripts/build/build.js",
"build-types": "node ./scripts/build/build-types.js",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"flow-check": "flow check",
"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",
"lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck",
"featureflags": "yarn --cwd packages/react-native featureflags",
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
"lint-java": "node ./scripts/lint-java.js",
"lint": "eslint .",
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
"print-packages": "node ./scripts/monorepo/print",
"shellcheck": "./scripts/circleci/analyze_scripts.sh",
"start": "cd packages/rn-tester && npm run start",
"shellcheck": "./.github/workflow-scripts/analyze_scripts.sh",
"start": "yarn --cwd packages/rn-tester start",
"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",
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
"test-ios": "./scripts/objc-test.sh test",
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib packages/react-native/types",
"test-typescript": "dtslint packages/react-native/types",
"test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json",
"test": "jest",
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
"update-lock": "npx yarn-deduplicate"
},
@@ -44,25 +44,26 @@
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/generator": "^7.25.0",
"@babel/plugin-syntax-typescript": "^7.25.4",
"@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.77.0-main",
"@react-native/metro-config": "0.77.0-main",
"@jest/create-cache-key-function": "^29.7.0",
"@react-native/metro-babel-transformer": "0.79.3",
"@react-native/metro-config": "0.79.3",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@types/react": "^19.0.0",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-syntax-hermes-parser": "0.24.0",
"babel-plugin-syntax-hermes-parser": "0.25.1",
"babel-plugin-transform-define": "^2.1.4",
"babel-plugin-transform-flow-enums": "^0.0.2",
"chalk": "^4.0.0",
"clang-format": "^1.8.0",
"connect": "^3.6.5",
"debug": "^2.2.0",
"deep-equal": "1.1.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-babel": "^5.3.1",
@@ -71,39 +72,40 @@
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-lint": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.24.0",
"flow-bin": "^0.250.0",
"flow-api-translator": "0.25.1",
"flow-bin": "^0.262.0",
"glob": "^7.1.1",
"hermes-eslint": "0.24.0",
"hermes-transform": "0.24.0",
"hermes-eslint": "0.25.1",
"hermes-transform": "0.25.1",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest": "^29.7.0",
"jest-diff": "^29.7.0",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "^0.81.0",
"metro-memory-fs": "^0.81.0",
"metro-transform-plugins": "^0.81.0",
"jest-snapshot": "^29.7.0",
"metro-babel-register": "^0.82.0",
"metro-memory-fs": "^0.82.0",
"metro-transform-plugins": "^0.82.0",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.24.0",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"prettier-plugin-hermes-parser": "0.25.1",
"react": "19.0.0",
"react-test-renderer": "19.0.0",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"tinybench": "^3.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
"react-is": "19.0.0"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.77.0-main",
"version": "0.79.3",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+10 -9
View File
@@ -4,13 +4,13 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict
* @format
*/
'use strict';
import type {PackagerAsset} from './registry.js';
/*:: import type {PackagerAsset} from './registry.js'; */
const androidScaleSuffix = {
'0.75': 'ldpi',
@@ -27,7 +27,7 @@ const ANDROID_BASE_DENSITY = 160;
* FIXME: using number to represent discrete scale numbers is fragile in essence because of
* floating point numbers imprecision.
*/
function getAndroidAssetSuffix(scale: number): string {
function getAndroidAssetSuffix(scale /*: number */) /*: string */ {
if (scale.toString() in androidScaleSuffix) {
// $FlowFixMe[invalid-computed-prop]
return androidScaleSuffix[scale.toString()];
@@ -47,15 +47,14 @@ const drawableFileTypes = new Set([
'jpg',
'ktx',
'png',
'svg',
'webp',
'xml',
]);
function getAndroidResourceFolderName(
asset: PackagerAsset,
scale: number,
): string {
asset /*: PackagerAsset */,
scale /*: number */,
) /*: string */ {
if (!drawableFileTypes.has(asset.type)) {
return 'raw';
}
@@ -73,7 +72,9 @@ function getAndroidResourceFolderName(
return 'drawable-' + suffix;
}
function getAndroidResourceIdentifier(asset: PackagerAsset): string {
function getAndroidResourceIdentifier(
asset /*: PackagerAsset */,
) /*: string */ {
return (getBasePath(asset) + '/' + asset.name)
.toLowerCase()
.replace(/\//g, '_') // Encode folder structure in file name
@@ -81,7 +82,7 @@ function getAndroidResourceIdentifier(asset: PackagerAsset): string {
.replace(/^(?:assets|assetsunstable_path)_/, ''); // Remove "assets_" or "assetsunstable_path_" prefix
}
function getBasePath(asset: PackagerAsset): string {
function getBasePath(asset /*: PackagerAsset */) /*: string */ {
const basePath = asset.httpServerLocation;
return basePath.startsWith('/') ? basePath.slice(1) : basePath;
}
+5 -3
View File
@@ -10,6 +10,7 @@
'use strict';
/*::
export type AssetDestPathResolver = 'android' | 'generic';
export type PackagerAsset = {
@@ -25,16 +26,17 @@ export type PackagerAsset = {
+resolver?: AssetDestPathResolver,
...
};
*/
const assets: Array<PackagerAsset> = [];
const assets /*: Array<PackagerAsset> */ = [];
function registerAsset(asset: PackagerAsset): number {
function registerAsset(asset /*: PackagerAsset */) /*: number */ {
// `push` returns new array length, so the first asset will
// get id 1 (not 0) to make the value truthy
return assets.push(asset);
}
function getAssetByID(assetId: number): PackagerAsset {
function getAssetByID(assetId /*: number */) /*: PackagerAsset */ {
return assets[assetId - 1];
}
@@ -30,18 +30,18 @@ const {
} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
let nativeComponentName = 'RCTModule';
export const __INTERNAL_VIEW_CONFIG = {
uiViewClassName: 'RCTModule',
uiViewClassName: \\"RCTModule\\",
bubblingEventTypes: {
topBubblingEventDefinedInlineNull: {
phasedRegistrationNames: {
captured: 'onBubblingEventDefinedInlineNullCapture',
bubbled: 'onBubblingEventDefinedInlineNull'
captured: \\"onBubblingEventDefinedInlineNullCapture\\",
bubbled: \\"onBubblingEventDefinedInlineNull\\"
}
}
},
directEventTypes: {
topDirectEventDefinedInlineNull: {
registrationName: 'onDirectEventDefinedInlineNull'
registrationName: \\"onDirectEventDefinedInlineNull\\"
}
},
validAttributes: {
@@ -93,18 +93,18 @@ const {
} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\");
let nativeComponentName = 'RCTModule';
export const __INTERNAL_VIEW_CONFIG = {
uiViewClassName: 'RCTModule',
uiViewClassName: \\"RCTModule\\",
bubblingEventTypes: {
topBubblingEventDefinedInlineNull: {
phasedRegistrationNames: {
captured: 'onBubblingEventDefinedInlineNullCapture',
bubbled: 'onBubblingEventDefinedInlineNull'
captured: \\"onBubblingEventDefinedInlineNullCapture\\",
bubbled: \\"onBubblingEventDefinedInlineNull\\"
}
}
},
directEventTypes: {
topDirectEventDefinedInlineNull: {
registrationName: 'onDirectEventDefinedInlineNull'
registrationName: \\"onDirectEventDefinedInlineNull\\"
}
},
validAttributes: {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.77.0-main",
"version": "0.79.3",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.77.0-main"
"@react-native/codegen": "0.79.3"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+3 -2
View File
@@ -15,7 +15,7 @@ Start the React Native development server.
#### Usage
```sh
npx react-native start [options]
npx @react-native-community/cli start [options]
```
#### Options
@@ -37,6 +37,7 @@ npx react-native start [options]
| `--cert <path>` | Specify path to a custom SSL cert. |
| `--config <string>` | Path to the CLI configuration file. |
| `--no-interactive` | Disable interactive mode. |
| `--client-logs` | **[Deprecated]** Enable plain text JavaScript log streaming for all connected apps. |
### `bundle`
@@ -45,7 +46,7 @@ Build the bundle for the provided JavaScript entry file.
#### Usage
```sh
npx react-native bundle --entry-file <path> [options]
npx @react-native-community/cli bundle --entry-file <path> [options]
```
#### Options
+8 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.77.0-main",
"version": "0.79.3",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,26 +22,23 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.77.0-main",
"@react-native/metro-babel-transformer": "0.77.0-main",
"@react-native/dev-middleware": "0.79.3",
"chalk": "^4.0.0",
"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",
"readline": "^1.3.0",
"metro": "^0.82.0",
"metro-config": "^0.82.0",
"metro-core": "^0.82.0",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.81.0"
"metro-resolver": "^0.82.0"
},
"peerDependencies": {
"@react-native-community/cli-server-api": "*"
"@react-native-community/cli": "*"
},
"peerDependenciesMeta": {
"@react-native-community/cli-server-api": {
"@react-native-community/cli": {
"optional": true
}
},
@@ -12,7 +12,6 @@
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
import chalk from 'chalk';
import fetch from 'node-fetch';
type PageDescription = $ReadOnly<{
id: string,
@@ -55,8 +54,11 @@ export default class OpenDebuggerKeyboardHandler {
'Failed to open debugger for %s (%s): %s',
target.title,
target.description,
e.message,
'Network error',
);
if (e.cause != null) {
this.#log('error', 'Cause: %s', e.cause);
}
this.#clearTerminalMenu();
}
}
@@ -95,6 +95,14 @@ const startCommand: Command = {
name: '--no-interactive',
description: 'Disables interactive mode',
},
{
name: '--client-logs',
description:
'[Deprecated] Enable plain text JavaScript log streaming for all ' +
'connected apps. This feature is deprecated and will be removed in ' +
'future.',
default: false,
},
],
};
@@ -9,9 +9,11 @@
* @oncall react_native
*/
import type {NextHandleFunction, Server} from 'connect';
import type {Server} from 'connect';
import type {TerminalReportableEvent} from 'metro/src/lib/TerminalReporter';
import {typeof createDevServerMiddleware as CreateDevServerMiddleware} from '@react-native-community/cli-server-api';
const debug = require('debug')('ReactNative:CommunityCliPlugin');
type MiddlewareReturn = {
@@ -30,10 +32,6 @@ type MiddlewareReturn = {
...
};
const noopNextHandle: NextHandleFunction = (req, res, next) => {
next();
};
// $FlowFixMe
const unusedStubWSServer: ws$WebSocketServer = {};
// $FlowFixMe
@@ -45,6 +43,12 @@ const communityMiddlewareFallback = {
port: number,
watchFolders: $ReadOnlyArray<string>,
}): MiddlewareReturn => ({
// FIXME: Several features will break without community middleware and
// should be migrated into core.
// e.g. used by Libraries/Core/Devtools:
// - /open-stack-frame
// - /open-url
// - /symbolicate
middleware: unusedMiddlewareStub,
websocketEndpoints: {},
messageSocketEndpoint: {
@@ -59,17 +63,28 @@ const communityMiddlewareFallback = {
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;
// `@react-native-community/cli` is an optional peer dependency of this
// package, and should be a dev dependency of the host project (via the
// community template's package.json).
const communityCliPath = require.resolve('@react-native-community/cli');
// Until https://github.com/react-native-community/cli/pull/2605 lands,
// we need to find `@react-native-community/cli-server-api` via
// `@react-native-community/cli`. Once that lands, we can simply
// require('@react-native-community/cli').
const communityCliServerApiPath = require.resolve(
'@react-native-community/cli-server-api',
{paths: [communityCliPath]},
);
// $FlowIgnore[unsupported-syntax] dynamic import
communityMiddlewareFallback.createDevServerMiddleware = require(
communityCliServerApiPath,
).createDevServerMiddleware as CreateDevServerMiddleware;
} catch {
debug(`⚠️ Unable to find @react-native-community/cli-server-api
Starting the server without the community middleware.`);
@@ -77,5 +92,3 @@ Starting the server without the community middleware.`);
export const createDevServerMiddleware =
communityMiddlewareFallback.createDevServerMiddleware;
export const indexPageMiddleware =
communityMiddlewareFallback.indexPageMiddleware;
@@ -19,10 +19,7 @@ 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 {createDevServerMiddleware} from './middleware';
import {createDevMiddleware} from '@react-native/dev-middleware';
import chalk from 'chalk';
import Metro from 'metro';
@@ -47,6 +44,7 @@ export type StartCommandArgs = {
config?: string,
projectRoot?: string,
interactive: boolean,
clientLogs: boolean,
};
async function runServer(
@@ -99,6 +97,11 @@ async function runServer(
require.resolve(plugin),
);
}
// TODO(T214991636): Remove legacy Metro log forwarding
if (!args.clientLogs) {
// $FlowIgnore[cannot-write] Assigning to readonly property
metroConfig.server.forwardClientLogs = false;
}
let reportEvent: (event: TerminalReportableEvent) => void;
const terminal = new Terminal(process.stdout);
@@ -149,11 +152,7 @@ async function runServer(
secure: args.https,
secureCert: args.cert,
secureKey: args.key,
unstable_extraMiddleware: [
communityMiddleware,
indexPageMiddleware,
middleware,
],
unstable_extraMiddleware: [communityMiddleware, middleware],
websocketEndpoints: {
...communityWebsocketEndpoints,
...websocketEndpoints,
+1 -1
View File
@@ -14,7 +14,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/build/babel-register').registerForMonorepo();
require('../../../scripts/babel-register').registerForMonorepo();
}
module.exports = require('./index.flow');
@@ -10,7 +10,6 @@
*/
import net from 'net';
import fetch from 'node-fetch';
/**
* Determine whether we can run the dev server.
@@ -92,6 +92,7 @@ Diff: ${chalk.dim.underline(newVersion?.diffUrl ?? 'none')}
// $FlowFixMe
function isDiffPurgeEntry(data: Partial<DiffPurge>): data is DiffPurge {
return (
// $FlowFixMe[incompatible-type-guard]
[data.name, data.zipball_url, data.tarball_url, data.node_id].filter(
e => typeof e !== 'undefined',
).length === 0
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.77.0-main",
"version": "0.79.3",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+1 -1
View File
@@ -14,7 +14,7 @@ export type * from './index.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../scripts/build/babel-register').registerForMonorepo();
require('../../../scripts/babel-register').registerForMonorepo();
}
module.exports = require('./index.flow');
+36 -4
View File
@@ -71,7 +71,14 @@ function checkPodfileInSyncWithManifest(
const FIRST = 1,
SECOND = 2,
THIRD = 3;
THIRD = 3,
FOURTH = 4,
FIFTH = 5;
function getNodePackagePath(packageName: string): string {
// $FlowIgnore[prop-missing] type definition is incomplete
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
}
/* eslint sort-keys: "off" */
export const tasks = {
@@ -79,26 +86,51 @@ export const tasks = {
bootstrap: (
options: AppleBootstrapOption,
): {
cleanupBuildFolder: Task<void>,
runCodegen: Task<void>,
validate: Task<void>,
installRubyGems: Task<ExecaPromise>,
installDependencies: Task<ExecaPromise>,
} => ({
validate: task(FIRST, 'Check Cocoapods and bundle are available', () => {
cleanupBuildFolder: task(FIRST, 'Cleanup build folder', () => {
execa.sync('rm', ['-rf', 'build'], {
cwd: options.cwd,
});
}),
runCodegen: task(SECOND, 'Run codegen', () => {
const reactNativePath = path.dirname(getNodePackagePath('react-native'));
const codegenScript = path.join(
reactNativePath,
'scripts',
'generate-codegen-artifacts.js',
);
execa.sync('node', [
codegenScript,
'-p',
process.cwd(),
'-o',
options.cwd,
'-t',
'ios',
]);
}),
validate: task(THIRD, 'Check Cocoapods and bundle are available', () => {
assertDependencies(
isOnPath('pod', 'CocoaPods'),
isOnPath('bundle', "Bundler to manage Ruby's gems"),
);
}),
installRubyGems: task(SECOND, 'Install Ruby Gems', () =>
installRubyGems: task(FOURTH, 'Install Ruby Gems', () =>
execa('bundle', ['install'], {
cwd: options.cwd,
}),
),
installDependencies: task(THIRD, 'Install CocoaPods dependencies', () => {
installDependencies: task(FIFTH, 'Install CocoaPods dependencies', () => {
const env = {
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
USE_FRAMEWORKS: options.frameworks,
USE_HERMES: options.hermes ? '1' : '0',
RCT_IGNORE_PODS_DEPRECATION: '1',
};
if (options.frameworks == null) {
delete env.USE_FRAMEWORKS;

Some files were not shown because too many files have changed in this diff Show More