Commit Graph

38536 Commits

Author SHA1 Message Date
Mateo Guzmán 402b93dd0c Internalize classes exposed for TextInputEventsTestCase (#50305)
Summary:
TextInputEventsTestCase is a test that no longer exists; it seems like in the past, some classes/methods were made public to allow this file to use them. We can clean this up by removing its reference from the codebase and internalizing what's not used in OSS.

Internalized classes:
- [ReactContentSizeChangedEvent](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.views.textinput.ReactContentSizeChangedEvent)
- [ReactTextChangedEvent](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.views.textinput.ReactTextChangedEvent)

Both classes above are used only in gutenberg aztec (archived repo)

Internalized methods:
- ReactEditText.maybeSetText (method only used within the class itself)

## Changelog:

[INTERNAL] - Internalize classes exposed for TextInputEventsTestCase

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

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

Reviewed By: Abbondanzo

Differential Revision: D71964410

Pulled By: javache

fbshipit-source-id: fa6476ed12cc71a28498479f3c56eb143a51c6bc
2025-03-27 10:25:10 -07:00
Sam Zhou 11e532de4f Make JestMockFn's TArguments type parameter bound by $ReadOnlyArray<mixed> instead of $ReadOnlyArray<any> (#50326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50326

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D71978753

fbshipit-source-id: 52774ca29f6019b5a1382cc76f6c387ea36532e4
2025-03-27 10:23:12 -07:00
Pieter De Baets 902f82656e Make NativeModuleSoLoader and FabricSoLoader internal (#50316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50316

This should only be used internally

Changelog: [Android][Removed] Remove FabricSoLoader from public API

Reviewed By: Abbondanzo

Differential Revision: D71965740

fbshipit-source-id: 41c2377a9efcaa21378b2ac49af0c1a544589371
2025-03-27 09:40:35 -07:00
Pieter De Baets f477dbcfde Rename ReactBridge to BridgeSoLoader (#50315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50315

Make it clearer that the only purpose of this class is to manage the soloading of the core bridge so file.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D71965759

fbshipit-source-id: d333f3e768a2359b082d4df279548cbd4b58ec76
2025-03-27 09:40:35 -07:00
Sam Zhou d24db7b0ae Replace $PropertyType with indexed access type in ReactNativeTypes (#32733)
Summary: DiffTrain build for [b59f18601179bb06a2c32a76547fd4929aa1ce9c](https://github.com/facebook/react/commit/b59f18601179bb06a2c32a76547fd4929aa1ce9c)

Reviewed By: jackpope

Differential Revision: D71788054

fbshipit-source-id: 1b1263018e4d9f349c64a5dcc22a86c71da9d7ca
2025-03-27 09:25:15 -07:00
Mateo Guzmán 9ba47b8852 Migrate ReactCxxErrorHandler to Kotlin (#50300)
Summary:
Migrate com.facebook.react.bridge.ReactCxxErrorHandler to Kotlin.

## Changelog:

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

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

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

Reviewed By: huntie

Differential Revision: D71964503

Pulled By: javache

fbshipit-source-id: f7cb2de8bdeae52680ef2fd72bd052d67e727a1a
2025-03-27 08:14:53 -07:00
Alex Hunt 68741d74ee Delete react-native/android/ directory (#50319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50319

Originally removed in 0.71, leaving a README file as an FYI, which is now removed.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D71968498

fbshipit-source-id: 81d380570df346f709a35727090c8e3b8b043183
2025-03-27 07:50:29 -07:00
Kudo Chien 7786805337 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.

## Changelog:

[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-27 06:39:30 -07:00
Vitali Zaidman 041014b8de track situations where devices are not reporting a valid debug page (#50314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50314

Changelog:
[General][Internal] track situations where devices are not reporting a valid debug page

Reviewed By: robhogan

Differential Revision: D71898522

fbshipit-source-id: 5ab83472148c20bd3376915a80834c42b5fff26e
2025-03-27 05:14:12 -07:00
Vitali Zaidman e52f251284 Add hints about why devices running in the background might not report debuggable pages (#50288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50288

Add hints about why devices running in the background might not report debuggable pages:
- Taking them from background might be enough
- Force killing them to restart them properly might be needed on Android.

Changelog:
[General][Internal]

Reviewed By: huntie

Differential Revision: D71888615

fbshipit-source-id: dda54b15daa7eebd1bc28a4d327a9b3d006397a4
2025-03-27 05:14:12 -07:00
Dawid Małecki fc1e73470a Use intersection of AnimatedProps and PassThroughProps to generate correct TS type (#50287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50287

Using keys intersection to iterate over Props and PassThroughProps is not legal in TS. The issue can be mitigated by using intersection of AnimatedProps and PassThroughProps.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D71898246

fbshipit-source-id: 8505989f60622654034e5a775b884945dd9388ca
2025-03-27 04:09:15 -07:00
Arushi Kesarwani 529c24ad92 Fixing Fabric Interop layer bug defaulting to UnstableLegacyViewManagerAutomaticComponentDescriptor irrespective of feature flag (#50186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50186

When `useFabricInterop` is disabled, deleting component descriptors in Component Registry is failing since  https://github.com/facebook/react-native/pull/47321 removed the Fabric Interop check from the ComponentDescriptorRegistry.cpp which was added earlier in https://github.com/facebook/react-native/pull/42294

Adding back the logic of Fallback component descriptor and error for the same.

**Changelog:**
[General][Fixed] Fixing Fabric Interop layer bug defaulting to UnstableLegacyViewManagerAutomaticComponentDescriptor irrespective of feature flags.

**Facebook:**
Upon deleting component descriptors in [CatalystRegistry](https://www.internalfb.com/code/fbsource/fbandroid/java/com/facebook/fbreact/fabric/components/jni/CatalystRegistry.cpp) D71426627 & [TwilightRegistry](https://www.internalfb.com/code/fbsource/fbandroid/java/com/oculus/twilight/crossapp/reactpackage/fabric/components/jni/TwilightRegistry.cpp) D71206103 the apps weren't erroring or causing crash as expected even upon disabling `useFabricInterop` and this was because D65192744 removed the Fabric Interop check from the ComponentDescriptorRegistry.cpp which was added earlier in D52663244

Reviewed By: cipolleschi

Differential Revision: D71582553

fbshipit-source-id: 0e87a789e5f0f8acba1958f74f9552dba1fe95c0
2025-03-26 22:14:50 -07:00
Arushi Kesarwani aef1f9ba1d Enable useFabricInterop by default for internal apps (#50295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50295

Enabling `useFabricInterop` by default for internal apps since before D71582553 iOS wasn't using useFabricInterop in it's codebase and old architecture with Interop enabled is harmless.

This is to keep the current behaviour consistent.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D71908601

fbshipit-source-id: 825338db486d8f64c44c2d4c28394d8b789c4195
2025-03-26 22:14:50 -07:00
Arushi Kesarwani 21c858ce3e Enable useFabricInterop for Stable in OSS (#50237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50237

Enabling `useFabricInterop` for Stable in OSS just as done in Android here:

https://github.com/facebook/react-native/blob/26ca802e8462e978282180e6cfd65e644d67bbc7/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt#L15

**Changelog:**
[iOS][Added]  Enabled `useFabricInterop` by default in OSS

Reviewed By: cipolleschi

Differential Revision: D71751048

fbshipit-source-id: 8d3bfb4fde04ba9262d07e349a27aea5cc8c8aaa
2025-03-26 22:14:50 -07:00
Joe Vilches 27b7512d85 Back out "Finish adding accessibilityOrder to ReactNative"
Summary:
This isn't ready yet, we shouldn't expose it.

Original commit changeset: 110ba4c42adc

Original Phabricator Diff: D71420768

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D71938547

fbshipit-source-id: 5026dcc11c151ad16386c1f11a702b46308a0e51
2025-03-26 21:45:27 -07:00
Michael Lee 0b1d0e84ee Add missing folly header (#50299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50299

## Changelog
[General] [Fixed] – Add explicit `folly/dynamic.h` include where it is actually used

## Internal
This symbol is used in the file, so ensure we actually declare it. That way we do not need to depend on some other header to provide the symbol

Reviewed By: NickGerleman

Differential Revision: D71910330

fbshipit-source-id: 4fbb584cafc688bd58f6863370efc1ede3a4c5f1
2025-03-26 21:45:17 -07:00
Alex Hunt 4f709afa6d Add type exports to index.js.flow (#50225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50225

Updates `index.js.flow` to export (what should be) all public types for `react-native`, closely matching the resolved exported types of `types/index.d.ts` (current manual TS defs).

- Note that this first pass doesn't have to be exhaustive (not yet load bearing) — however, I've done a best-effort scan, which passes our current `__typetests__` fixtures.

**Approach: Explicit type imports in `index.js.flow`**

We have a number of options for how we organise and re-export values and types from the new index file — for now, we're opting for explicitly exporting each symbol here.

- While this clutters the index file somewhat, it also provides a single scannable source of truth — without introducing / altering each contributing module's type exports (we might want to do this eventually, but we're far from having strong organisation denoting the public API boundary). It's self-documenting that the index file contains all root exports by name.
- At the same time, we currently have some exceptions that use `export [type] *` to line up with TypeScript `namespace`s. We aim to review and update these within this release cycle, to enforce the above system.

Changelog: [Internal] - The `react-native` package now exports all public types in Flow (fbsource)

Reviewed By: rubennorte

Differential Revision: D71741575

fbshipit-source-id: 770e2b490e494ee195f4240358fec39f69145a94
2025-03-26 20:46:41 -07:00
Eric Rozell c12fdc0fcf Back out "Allow listeners in EventEmitter" (#50298)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50298

Given EventDispatcher already synchronously calls EventListener, this convenience method for listening to events directly from EventEmitter was short-sighted. We will revisit how to handle JS vs. UI dispatched events for NativeAnimated purposes in future diffs. For now, this reverts https://github.com/facebook/react-native/pull/49998

This change is not being marked as breaking since the change that added this API has not yet been shipped to stable.

## Changelog

[General][Removed] - EventEmitter addListener and removeListener APIs

Reviewed By: zeyap

Differential Revision: D71909828

fbshipit-source-id: 9246de5c7a33368d182369a2d6eb57aa960b415b
2025-03-26 20:42:10 -07:00
Mateo Guzmán d49ec1d79c Migrate CxxModuleWrapperBase to Kotlin (#50251)
Summary:
Migrate com.facebook.react.bridge.CxxModuleWrapperBase to Kotlin.

## Changelog:

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

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

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

Reviewed By: alanleedev

Differential Revision: D71830747

Pulled By: arushikesarwani94

fbshipit-source-id: 174dff86f6d1ad8228491c15e226986dad2edb1b
2025-03-26 20:35:13 -07:00
Tim Yung 4a7946bef5 Animated: Pass Target into {dis,}connectAnimatedView (#50229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50229

Makes a few internal improvements to `AnimatedProps`:

- Change `__connectAnimatedView` and `__disconnectAnimatedView` to be private methods, so that we can confidently change their type signatures.
- Pass `#targetInstance` into those methods, so that the responsibility of verifying `#targetInstance`'s non-nullability is hoisted to the call sites.

There should be no observable runtime behavior change.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D71740601

fbshipit-source-id: 6abc6faf63f3c3274fd2d92baf0958d2471d4a63
2025-03-26 20:05:28 -07:00
Tim Yung c9ff9570ab Animated: Type #animatedView in AnimatedProps (#50228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50228

Properly annotate the type of `#animatedView` in `AnimatedProps` and rename it to `#targetInstance`.

Otherwise, no runtime behavior change.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D71739606

fbshipit-source-id: c97e4bd323ad9b1c08fd4976f13b6b20e8fe4793
2025-03-26 20:05:28 -07:00
Danny Su f3a5d1957a Don't throw again in JsErrorHandler
Summary:
JsErrorHandler throwing again masks what the real problem is.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D71920942

fbshipit-source-id: 1697f6f4c779d5c896df1be8e696a185f1c2c828
2025-03-26 19:35:02 -07:00
Nick Gerleman 177b8b4c40 Move CornerRadii resolution logic out of LengthPercentage (#50306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50306

`LengthPercentage` is a class representing a length, or a percentage of a reference length.

Having a function on it, specific to resolving asymetrical corner radius is the wrong organization. Let's move it to where it belongs.

Very technically breaking, but I would be shocked if anyone is using this API.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D71922893

fbshipit-source-id: 4660c861e21c1dffae15d3f463c135a494124e2a
2025-03-26 19:29:24 -07:00
Tim Yung a8a4ab10d0 RN: Ship disableInteractionManager (#50233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50233

Ships the `disableInteractionManager` feature flag, which disables `InteractionManager` and replaces its scheduler with `setImmediate`.

Changelog:
[General][Changed] - InteractionManager is deprecated and will be removed in a future release. Its behavior has been changed to be the same as `setImmediate`, and callers should migrate away from it.

Reviewed By: javache

Differential Revision: D71766877

fbshipit-source-id: 36710fdf17c92f8cdee141e43a3c4d0bd9ef0e81
2025-03-26 17:59:40 -07:00
Alex Hunt 116437e46e Support CDP Response.statusText (#50174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50174

Add `httpReasonPhrase` util and use to populate CDP `Response.statusText` value.

AFAIK, neither platform, and none of our dependencies, reliably provide this mapping — so this is implemented directly.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D71470037

fbshipit-source-id: f3f6437d0fb3227858b5910a71170e3a634aa962
2025-03-26 15:40:42 -07:00
Alex Hunt 4a055e4812 Configure prod version of NetworkReporter (#50286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50286

Configures a thinner version of `NetworkReporter.cpp` (the entry point to `jsinspector_network`) in production builds (i.e. dev or profiling build, as gated by `REACT_NATIVE_DEBUGGER_ENABLED`).

Even though enabling the CDP Network domain isn't reachable in prod, this will reduce the compiled code footprint of `jsinspector_network`.

We also don't need `glog` here any more — remove dep.

**Implementation notes**

The reason to gate the logic within each method, with inline `#ifdefs`, rather than swapping between complete implementation files, is because each `report*` function will also have load-bearing logic (for the Performance API) in all prod builds. Therefore, this will reduce duplication (and file switching) down the line — and can be understood at a glance with this pattern.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D71636694

fbshipit-source-id: 50e7c008bb6fd128fe1248d767832b36ccb0219b
2025-03-26 15:40:42 -07:00
Alex Hunt c91cafae32 Refactor NetworkReporter internals (#50173)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50173

Refactors the internals of `NetworkReporter` (and the `jsinspector_network` library) to better organise concepts before we scale to more Network CDP events.

- Introduces `cdp::network` structs modelling CDP `Network` domain events and data types.
- Moves implementation details in converting input data objects to CDP types into `CdpNetwork.cpp` and `HttpUtils.cpp`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D71470039

fbshipit-source-id: 0c04ffb40efbbb6d6d9782959f5adb33c9097ccb
2025-03-26 15:40:42 -07:00
Ramanpreet Nara 7d739ae89c Migrate modules off lazy main queue setup
Summary:
These modules don't actually use ui things in their setup. So, they don't need to be set up on the main queue.

Changelog: [Internal]

Reviewed By: lyahdav

Differential Revision: D71849447

fbshipit-source-id: d9d6ee043cac112731c27ff920e857fccdd54bc0
2025-03-26 15:16:45 -07:00
Ramanpreet Nara b432e4cb16 Make Appearance use main queue setup (#50110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50110

## Rationale
Rendering can now include main -> js sync calls.

If we allow js -> main sync calls during rendering, react native can deadlock.

So, this diff moves the js -> main sync calls to "main queue module setup", which occurs before rendering.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D71347452

fbshipit-source-id: 894f21c703981c633fc0966e1edd647251d0fe2c
2025-03-26 15:16:45 -07:00
Tim Yung 6346689c3d RN: Remove eslint-config-prettier Overrides (#50302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50302

Changes `eslint-config-react-native` to stop overriding rules that are disabled by `eslint-config-prettier`, which disables rules that conflict with Prettier formatting.

This also adds a Jest unit test to enforce that this invariant even as the configs change.

Changelog:
[General][Changed] - `eslint-config-react-native` now respects rules disabled by `eslint-config-prettier`.

Reviewed By: kassens

Differential Revision: D71922014

fbshipit-source-id: 55ba46e880d6129a417e864ab2fbb5704c57997b
2025-03-26 15:10:22 -07:00
zhongwuzw 62536db8c7 Fabric: Fixes color hash type to prevent bits truncation (#50285)
Summary:
I made a mistake before, it seems we should use std::size_t to prevent bits truncation.

## Changelog:

[IOS] [FIXED] - Fabric: Fixes color hash type to prevent bits truncation

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

Test Plan: N/A

Reviewed By: javache

Differential Revision: D71895413

Pulled By: cipolleschi

fbshipit-source-id: 26cc036bee851902e11abfa8ed5c5c8222421b09
2025-03-26 14:13:19 -07:00
Gabriel Donadel 0f4e93987e Update Changelog for 0.76.8 (#50296)
Summary:
Update changelog for the 0.76.8 release:

[All commits: https://github.com/facebook/react-native/compare/v0.77.1...0.77-stable](https://github.com/facebook/react-native/compare/v0.76.7...v0.76.8)

## Changelog:

[INTERNAL] [ADDED] - Changelog for 0.76.8

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

Test Plan: N/A

Reviewed By: shwanton

Differential Revision: D71911064

Pulled By: arushikesarwani94

fbshipit-source-id: 515f48d0cf6525c56024e5791b45a3c1f8a12186
2025-03-26 13:48:14 -07:00
Alex Hunt 1c04cf5ca0 Minimize operations in RCTInspectorNetworkReporter in prod (#50242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50242

Similar to D71636694, adds conditional compile to `RCTInspectorNetworkReporter.mm` to minimize code size and operations performed in production builds.

Specifically:

- Expensive copy of `httpBody` is eliminated.
- Other optional fields that are only mapped when CDP support is enabled are also omitted.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D71637716

fbshipit-source-id: 6c7688b1ac82d2b1047b42a812834a7dfb37cd0f
2025-03-26 12:25:00 -07:00
Alex Hunt 793094fc0f Implement core Network CDP events on iOS (#50142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50142

This is a first pass at integrating `NetworkReporter` in our networking stack on iOS (`RCTNetworking.mm`).

**Implemented events**

Wires up minimal events sufficient to populate the Chrome DevTools Network panel:

- `Network.requestWillBeSent`
- `Network.responseReceived`
- `Network.loadingFinished`

**Other notes**

`RCTNetworking` is used (tentatively) as the integration point since it:

- Is the default implementation for the network stack on iOS.
    - Should allow us to pair with originating JS call site down the line.
- Intercepts Blob requests (at least `RCTImageLoader`).
- Sits outside the user-configurable `RCTNetworkingResponseHandler` and `RCTNetworkingRequestHandler` concepts.
- Is where network events are currently sent to JavaScript (`sendEventWithName`).

NOTE: Reminder: `NetworkReporter` is currently a no-op without the `fuseboxNetworkInspectionEnabled` experiment set.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D71470038

fbshipit-source-id: 069d77473c333a98f796b3dffa670a39b3016b2b
2025-03-26 12:25:00 -07:00
Rubén Norte bcce235841 Add basic tests for Event Timing API (#50289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50289

Changelog: [internal]

Adding basic Fantom tests for the new Event Timing API.

Reviewed By: huntie

Differential Revision: D71734778

fbshipit-source-id: b5da3162fade64eadede72346af50df68b4facd9
2025-03-26 11:09:42 -07:00
Rubén Norte 499eef1fc8 Rename LongTask as LongTasks in test (#50290)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50290

Changelog: [internal]

Small rename as the official name of the API is LongTasks.

Reviewed By: yungsters

Differential Revision: D71734777

fbshipit-source-id: fac085e3b0d304f7d05087143c15d32cf2b0971b
2025-03-26 11:09:42 -07:00
Joe Vilches 33bd90e07c Improve accessibilityOrder algo on iOS (#50265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50265

This is a fun one!

"Improvements" consist of
* Performance is better now. Previously we did a tree walk for each ID in the array, now its just one :)
* Properly handles coopting (more on that below)

**Performance**
The previous implementation naively walked the tree until it found the right nativeId for each nativeId in the prop. This new algo just does a single tree walk and collects the views that have the right nativeIds as we are doing that walk.

**Coopting**
Our iOS code implements a form of accessibility coopting, where an element can "speak for" a descendant. This happens when some parent element does not have an accessibility label but a descendant does. We look at the subtree and grab every node that has a label and lift it up to the aforementioned element without a label. This enables some nice a11y features like wrapping `Text` in a `View` and letting the `View` just read all the `Text` inside (imagine a button with a label, you would only want to focus the button and just read the text instead of the text itself).

This feature is nice but it becomes buggy when we introduce `accessibilityOrder`. Previously, there was no way to access nested elements on iOS, the platform prohibits this. However, you can get around this by using `accessibilityElements`, which our `accessibilityOrder` prop maps to. So you could define the order as `['parent', 'child']` and access both elements just fine. However, if that `parent` is a `View` that coopts `Text`, we have some issues. The `View` will read the `Text` but then when the user swipes we focus the `Text` and read it again!

To get around this we check up the superview chain in RCTParagraphViewComponentView looking for Views that might coopt us and a cooresponding accessibilityElements with said candidates. If there is such a View we do not announce ourselves. Performance is iffy here, we need to iterate up to root for all text focusing, but this should be fairly fast for all intents and purposes and I have not noticed any lag when changing focus ordering.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D71562476

fbshipit-source-id: 31fd935df0764459403464bd645aae2e664c69cb
2025-03-26 11:08:36 -07:00
Alex Hunt 701859b397 Deprecate *EventData types in favour of *Event (#50215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50215

Backwards compatible updates to `CoreEventTypes`, `Image`, `Switch`, `TextInput` to align types and reduce root exports.

The effects of this change can be seen in `packages/react-native/types/__typetests__/index.tsx` (smoke test file against current manual TypeScript definitions).

Under Flow, exports on each `*EventData` type are directly removed (unreferenced).

Changelog:
[General][Deprecated] - Deprecate `*EventData` types on `Image`, `Switch`, `TextInput` components. These can be substituted for `*Event`, e.g. `NativeSyntheticEvent<ImageLoadEventData>` becomes `ImageLoadEvent`.

Reviewed By: NickGerleman

Differential Revision: D71734361

fbshipit-source-id: 287c775e840319242984d248169c267abf8f032b
2025-03-26 09:55:33 -07:00
Riccardo Cipolleschi 4b82896390 Automate checking for artifacts on Maven (#50275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50275

This change adds a check to automate a step in the release process: https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-process.md#verify-assets-have-been-uploaded-to-maven

The script will poll maven for 90 minutes and return when the artifacts are available. If, after 90 minutes, artifacts are not available, it exits with code 1 that should fail the Release workflow. The Release Crew should have a look at what's happened.

## Changelog:
[Internal] - Automate the check for artifacts being on Maven

Reviewed By: fabriziocucci

Differential Revision: D71825014

fbshipit-source-id: 8879bf9c8fc4519e86b55ad8f9bd3ecf3f8ecfb7
2025-03-26 08:26:01 -07:00
Riccardo Cipolleschi 515976cb4a 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

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

Reviewed By: fabriziocucci

Differential Revision: D71892679

fbshipit-source-id: b03b65986fbdbe781b616f31dfb6bceb38b8b3b7
2025-03-26 08:25:25 -07:00
Tim Yung 2abe623d9f Animated: Omit allowlist in avoidStateUpdateInAnimatedPropsMemo Experiment (#50232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50232

While reviewing the `avoidStateUpdateInAnimatedPropsMemo` experiment, I noticed that the control and test groups were invoking `areCompositeKeysEqual` differently:

- Test group was passing in `allowlist`.
- Control group was not passing in `allowlist`.

Passing it in is technically more correct, but let's restore the control group behavior for now to isolate the tested changes.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D71746745

fbshipit-source-id: aa34db0532ef53ead08bbd632aab0994b31b9340
2025-03-26 08:07:53 -07:00
Saad Najmi 4789744164 chore: add jest-config to monorepo dependencies (#50280)
Summary:
The React Native monorepo depends on `jest-config` in `jest.config.js` but does not specify it as a dependency. This means we got it as a phantom / transitive dependency. In React Native macOS, I am testing using Yarn 4 with pnpm layout to protect against such dependencies (See https://github.com/microsoft/react-native-macos/pull/2366). The simplest way to fix this is to just declare it as a dependency.

## Changelog:

[INTERNAL] [FIXED] - Add jest-config as a dependency

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

Test Plan: This change should be a no-op in React Native, we already had the package in our lock.

Reviewed By: yungsters, huntie

Differential Revision: D71891841

Pulled By: robhogan

fbshipit-source-id: 5b4720e9e09e25b2f1eebb80675bfe4f3a48e2dc
2025-03-26 08:02:00 -07:00
Mateo Guzmán 8b449c2694 Migrate GuardedRunnable to Kotlin (#50259)
Summary:
Migrate com.facebook.react.bridge.GuardedRunnable to Kotlin.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D71846384

Pulled By: Abbondanzo

fbshipit-source-id: b465ce107f9a32e273442644ef6079347fe7e401
2025-03-26 07:30:22 -07:00
Mateo Guzmán c372dc1ec8 Migrate GuardedAsyncTask to Kotlin (#50254)
Summary:
Migrate com.facebook.react.bridge.GuardedAsyncTask to Kotlin.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D71846375

Pulled By: Abbondanzo

fbshipit-source-id: e4befe99333512312d1930b09b1edd9501a2f80a
2025-03-26 07:25:09 -07:00
Mateo Guzmán 9a5a67912b Migrate CallbackImpl to Kotlin (#50263)
Summary:
Migrate com.facebook.react.bridge.CallbackImpl to Kotlin.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D71855490

Pulled By: Abbondanzo

fbshipit-source-id: 72f15083010601b56f415493d58fc557f3ab35ef
2025-03-26 07:20:15 -07:00
Vitali Zaidman 2bc0fe621d Update debugger-frontend from 46feed4...26e19a4 (#50277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50277

Changelog: [Internal] - Update `react-native/debugger-frontend` from 46feed4...26e19a4

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/46feed41c15bcaafa086c1397562fa2af7cc503b...26e19a44bd2a55668effe4fdf7c0fef42b1944b7).

Reviewed By: hoxyq

Differential Revision: D71888932

fbshipit-source-id: e968d2a4bbb325354bc9ab265f0e8c1d48eef7d4
2025-03-26 05:50:22 -07:00
Jorge Cabiedes Acosta 8184ed634e Add OnHierarchyChangeListener to accessibilityOrder parent to track changes in hierarchy (#50261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50261

Since now we have the optimization of only running the custom accessibility order when we define the tree as dirty we need to add a hierarchy change listener on all ViewGroups within the parent to notify accessibility services of potential changes in hierarchy and so mark the subtree as dirty.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D71821636

fbshipit-source-id: 25649efa1679024a205e94c340511dc58783d575
2025-03-26 05:42:16 -07:00
Jorge Cabiedes Acosta 8cf4d5b531 Finish adding accessibilityOrder to ReactNative (#50255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50255

Few details where missing for fully enabling accessibilityOrder on ReactNative

Changelog: [General][Added] Add accessibilityOrder to iOS and Android

Reviewed By: joevilches

Differential Revision: D71420768

fbshipit-source-id: 110ba4c42adc193b34e200aab5dd059badbc2e62
2025-03-26 05:42:16 -07:00
Rob Hogan f60e2cad62 Update Changelog for 0.77.2 (#50239)
Summary:
Update changelog for the 0.77.2 release:

All commits: https://github.com/facebook/react-native/compare/v0.77.1...0.77-stable

## Changelog:

[INTERNAL] [ADDED] - Changelog for 0.77.2

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

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D71815842

Pulled By: robhogan

fbshipit-source-id: c5040dd0673aa1c7d61e1a03daa8ba64c4f9aeec
2025-03-26 04:37:47 -07:00
Dawid Małecki 0a58bb569b Align flattenStyle to accept animated styles (#50250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50250

Aligned flattenStyle to also accept Animated styles.

Changelog:
[Internal] - Aligned flattenStyle to accept animated styles.

Reviewed By: huntie

Differential Revision: D71814372

fbshipit-source-id: 3bfb5f1dcd8e6dd3d38dca547b69a3c43b87b356
2025-03-26 03:02:52 -07:00