Commit Graph

38536 Commits

Author SHA1 Message Date
Jakub Piasecki 322142aab3 Further reduce naming collisions in the API snapshot (#52281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52281

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77355160

fbshipit-source-id: b1a59b3817b88bf6de953816fc272633b14b3a54
2025-06-26 03:37:05 -07:00
Moti Zilberman 74ae2ae8b6 Upgrade Electron to 36.3.0 (#52261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52261

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77244751

fbshipit-source-id: 97c45286d18d3b266e1acd33408ea6067504f790
2025-06-26 03:22:17 -07:00
Jakub Piasecki df5cd55cdb Flatten built-in utility types in the API snapshot (#52280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52280

Changelog: [Internal]

Adds a type-simplifyng transform for the API snapshot, with the goal of resolving some built-in TS types during build time. Most notably, it's able to simplify `Omit` structures emitted by the `flow-api-translator` when translating Flow's type spread operator.

It builds upon a simplified type inlining transform from the previous approach. The type inlining transform is able to handle inlining type references and resolution of built-in TS types on literal types:
- `Omit`
- `Readonly`
- `Partial`
- `keyof`

Reference inlining is performed top-down and built-in type resolution is performed bottom-up, which makes it possible for the second step to assume working on type literals.

Type simplifying transform uses the type inlining to reduce type references encountered inside `Omits` to their literal shapes, which makes possible to determine whether `Omit` is neccessary case-by-case. If `Omit` is redundant, it can be safely removed. If it's not, the omitted keys can be reduced to represent a subset of keys existing in the target type.

It also keeps the ability to resolve `Partial` and `Readonly` types on type literals, simplifying the snapshot further.

An example diff the transform can handle:
Before:
```
export declare type AccessibilityProps = Readonly<
  Omit<
    AccessibilityPropsAndroid,
    | keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    | keyof AccessibilityPropsIOS
  > &
    Omit<
      AccessibilityPropsIOS,
      keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    > & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

After:
```
export declare type AccessibilityProps = Readonly<
  AccessibilityPropsAndroid &
    AccessibilityPropsIOS & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

Reviewed By: huntie

Differential Revision: D77295302

fbshipit-source-id: 213aef46035bde4f9783353b5344a6986a418399
2025-06-26 03:05:27 -07:00
Nick Lefever c6608685cb Mark prop diffing availability for codegen props (#52246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52246

This diff adds the required override to codegen props to make the `FabricMountingManager` aware of the availability of a prop diffing implementation for native components using codegen props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234066

fbshipit-source-id: 8e95628348f491c5ee08609bc7d7b3d30bc7151b
2025-06-25 18:28:22 -07:00
Nick Lefever 53ce247dbd Add codegen for MixedType diffing (#52266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52266

Native components may use `MixedType` properties in rare cases to hold untyped data. This diff adds support for serializing and prop diffing these types of props so that all of the props and object fields would be included in prop diffing results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77307169

fbshipit-source-id: ae6b00207ef857c9cfa4bdf9c235972915410a29
2025-06-25 18:28:22 -07:00
Nick Lefever e441954c82 Add codegen for ArrayType diffing (#52244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52244

The ArrayType props converts to std::vector. This prompted the need for `toDynamic(const T&)` conversion functions as this breaks to potential reliance on all type instances having a `toDynamic()` function available. This includes:
- array of arrays types
- array of objects types
- object with arrays

The ArrayType conversion uses the availability of the `toDynamic` conversion methods for all supported types to convert the values stored by the `std::vector` to `folly::dynamic` values to be stored on a `folly::dynamic::array`.

The diff removes unnecessary conversion methods implemented previously for the core components prop diffing. These are now handled by the generic `toDynamic(const std::vector<T>&)` conversion method.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234065

fbshipit-source-id: 97a3b175ff07fe4a6de3adb14ee6cb42db1a2cfe
2025-06-25 18:28:22 -07:00
Nick Lefever b50ad49a4d Add codegen for ObjectType diffing (#52243)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52243

Building on the availability of `toDynamic` conversion methods for all supported property types, this diff adds support for diffing of `ObjectType` props.

The template adds the generation of a default comparator for the generated C++ struct. The struct also gains a `toDynamic` conversion method that will convert each property of the object type to a `folly::dynamic` value.

Primitive types make use of the implicit conversion supported by `folly::dynamic`, all other types are converted using `toDynamic`.

The `toDynamic` logic is implemented as a method defined on the struct to avoid increased binary size when required multiple times by the prop diffing implementation.

The external `toDynamic` conversion function calls the struct method directly. This enables support for converting object types using object types within their props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234064

fbshipit-source-id: 21deb3104303aa374fb65b969af57a6aca6db38c
2025-06-25 18:28:22 -07:00
Nick Lefever 8c806ec31b Add codegen for DimensionType diffing (#52242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52242

Codegen supports `DimensionType` props which represents a YGValue. This diff adds a conversion to `folly::dynamic` supporting all the existing value types `YGValue` can represent.

This completes codegen support for all allowed `ReservedPropTypeAnnotation` prop types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234061

fbshipit-source-id: 6c3aef5e3ab0459d8a68ebd8efaccfecb83b0b08
2025-06-25 18:28:22 -07:00
Nick Lefever a164874b1a Add codegen for EnumType diffing (#52241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52241

Add support for converting string and int32 enum types to `folly::dynamic` and generating the correct property diffing for it conditionally adding the prop value to the prop diff result.

This diff updates the template to convert the enum back to the original string representation provided from the JS side based on the current generated C++ enum value.

The string enum re-uses the existing `toString` conversion. The number enum generates the switch-case mapping required to map back the C++ enum value to the original value assigned to it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234070

fbshipit-source-id: 8c669d5b2e21bd6022c6ba36149465495e4d4bf3
2025-06-25 18:28:22 -07:00
Moti Zilberman 0031377ae6 Correctly synchronise access to WebSocketDelegate
Summary:
Changelog: [Internal]

Fixes a thread safety bug in the C++ platform's `InspectorPackagerConnectionDelegate::WebSocket` implementation. Since D60520747 `IWebSocketDelegate` event calls have been required to be made on the inspector thread, but the C++ platform was making them on the platform's WebSocket thread instead.

Reviewed By: christophpurrer

Differential Revision: D77150289

fbshipit-source-id: f57de05eaccbbe9db674076fc9e60f8d0dd243c5
2025-06-25 13:49:00 -07:00
Sam Zhou 6b85c54ef4 Add annotations to array and object literal declarations to fix future natural inference errors (#52267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52267

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77308192

fbshipit-source-id: 21fa2f6d3df632941327b9b2d7910b035f16b7d2
2025-06-25 13:44:09 -07:00
Joe Vilches 7e8eadc041 Fix accessibility order example (#52271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52271

In my haste I messed up a few of these. Either type in the text, or giving them props they should not have.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D77310876

fbshipit-source-id: 9c5a28285d4bb3673fe99630fa7ed97033b17904
2025-06-25 13:06:08 -07:00
Moti Zilberman bc7a9d9c4e Add dev server host/port settings to ReactInstanceConfig (#52263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52263

Changelog: [Internal]

Adds a bare-bones API to set the dev server host and port at the time of creating a `ReactInstance` in the C++ platform.

Reviewed By: rshest

Differential Revision: D77050457

fbshipit-source-id: 642dc96d3cb486a2e7faa177adcbf8a15b8fb668
2025-06-25 12:02:22 -07:00
Pieter De Baets 167ec92f86 Consume ReactNativeAttributePayloadFabric from ReactNativePrivateInterface (#33616) (#52256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52256

## Summary

ReactNativeAttributePayloadFabric was synced to react-native in
https://github.com/facebook/react-native/commit/0e42d33cbcfadcf5d787108da785d56a83d07a9f.
We should now consume these methods from the
ReactNativePrivateInterface.

Moving these methods to the React Native repo gives us more flexibility
to experiment with new techniques for bridging and diffing props
payloads.

I did have to leave some stub implementations for existing unit tests,
but moved all detailed tests to the React Native repo.

## How did you test this change?

* `yarn prettier`
* `yarn test ReactFabric-test`

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

Reviewed By: rubennorte

Differential Revision: D77296286

fbshipit-source-id: a26aa0fe0f7f1c8a42407d759351734a4c85f970
2025-06-25 09:30:08 -07:00
generatedunixname89002005287564 1348d7ee78 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/jsc (#52250)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52250

Reviewed By: javache

Differential Revision: D77290996

fbshipit-source-id: 582a090ea0b0ab6171f625b7a2147607abef1cab
2025-06-25 08:23:43 -07:00
generatedunixname89002005287564 2ae154f650 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit/fb (#52251)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52251

Reviewed By: javache

Differential Revision: D77289931

fbshipit-source-id: ff61aa3a92a96492027c111ea2db25d5b86a777e
2025-06-25 08:08:12 -07:00
Vitali Zaidman 5ba0e1f97a Improve how throws from components are reported to the console (#52050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52050

Uncaught errors are currently raising a custom error to `console.error`:
* With somewhat unclear messaging.
* Only the **component stack** is reported.
* The top-most stack leads to the component where the throw occurred and not to the actual error being thrown.
* The actual error being thrown is never logged

After this change:
* We print the actual error thrown
* The *Owner stack* is attached

(see test plan for examples)

## Changelog:
[General][Breaking] Improve messaging and add error stack trace in console errors generated on throws from components.

----

This is a breaking change because someone might be monkey-patching console.errors, or just listens to them.

Reviewed By: rickhanlonii

Differential Revision: D75080385

fbshipit-source-id: 824f30a804a3bb836ea1be7257784e56c00077c1
2025-06-25 07:54:55 -07:00
Jakub Piasecki 482f737ee1 Move stripping unstable identifiers earlier in the API Snapshot pipeline (#52260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52260

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77304456

fbshipit-source-id: 2c623fa6d5b6c75e985dc8aa79872019582c50d5
2025-06-25 07:47:38 -07:00
Christian Falch 02203f8608 revert changes in ReactCodegen template (#52257)
Summary:
After switching to the new backwards compatible cocoapods structure with prebuilts, we no longer need any change in the ReactCodegen template.

This commit fixes this.

## Changelog:

[IOS] [FIXED] - revert changes in ReactCodegen template

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

Test Plan: Build RN-tester with prebuilt

Reviewed By: cortinico

Differential Revision: D77303429

Pulled By: cipolleschi

fbshipit-source-id: d251d7d67b1c902082891ba705db5158c558e842
2025-06-25 07:36:56 -07:00
Mateo Guzmán d6efe9a56f Migrate ReactContextBaseJavaModule to Kotlin (#52210)
Summary:
Migrate com.facebook.react.bridge.ReactContextBaseJavaModule to Kotlin.

## Changelog:

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

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

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

Reviewed By: rshest

Differential Revision: D77290330

Pulled By: cortinico

fbshipit-source-id: 1218af30c8a94ed11cc4db557ba34c7bfff2fc0c
2025-06-25 07:21:27 -07:00
Andrew Datsenko 0b4429a33e Use RegExp instead of micromatch (#52234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52234

Changelog: [Internal]

Use raw regex instead of micromatch as it depends on node imports.

Reviewed By: christophpurrer

Differential Revision: D77241819

fbshipit-source-id: c579b42f064f67c2e44e15e40ab6262f45a90797
2025-06-25 06:20:10 -07:00
Ruslan Lesiutin ca647c13c2 Avoid copying strings when serializing TraceEvent / lock only on buffer operations (#52220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52220

# Changelog: [Internal]

Mainly, 2 changes:
1. `PerformanceTracer::serializeTraceEvent(const TraceEvent& event)` -> `PerformanceTracer::serializeTraceEvent(TraceEvent&& event)` for less copies, actually move strings from the `TraceEvent` into the serialized `folly:object`.
2. When collecting events from the buffer, only lock when accessing buffer, not when serializing.

Reviewed By: rubennorte

Differential Revision: D77164969

fbshipit-source-id: c7dd84dd3c94dae22b89ffd4b229974e6d8084de
2025-06-25 05:38:31 -07:00
Ruslan Lesiutin 448fe573e0 Avoid potential copies of TraceEvent before serialization (#52196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52196

# Changelog: [Internal]

Probably been overlooked for quite some time, but shouldn't be a bottleneck.

Reviewed By: motiz88

Differential Revision: D77148271

fbshipit-source-id: e8eb32137086d6c280aab2ec5903be03f96175ad
2025-06-25 05:38:31 -07:00
Ruslan Lesiutin 823414e691 Avoid potential copies of TraceEvent when buffering (#52188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52188

# Changelog: [Internal]

`buffer_.push_back` -> `buffer_.emplace_back`

I didn't measure if there were any runtime wins from this, because I don't expect there would be. Let's avoid potential copies, if possible.

Reviewed By: rubennorte

Differential Revision: D77053032

fbshipit-source-id: 80a0d3759bf95b1945ebe560806712bfa6a4f924
2025-06-25 05:38:31 -07:00
Ruslan Lesiutin e5049091c5 refactor: well-defined behaviour (#52187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52187

# Changelog: [Internal]

- `bool tracing_` -> `std::atomic<bool> tracingAtomic_`.
- More doc-comments to explain the usage of mutex and atomics.
- `PerformanceTracer::isTracing()` -> `inline PerformanceTracer::isTracing()`.
- `uint64_t processId_` -> `const uint64_t processId_`.

The main change is that the boolean flag that controls "if we are tracing" is now atomic, which should eliminate potential data races. To avoid "logic" races, we are still going to lock mutex, and then check again. The use of `std::atomic` allows us to perform cheaper check first to avoid potentially unnecessary serializations from other systems that report events into `PerformanceTracer`.

Reviewed By: rubennorte

Differential Revision: D77053030

fbshipit-source-id: 82966055db0d75f828e7b95ad4c6cd7f18902265
2025-06-25 05:38:31 -07:00
Samuel Susla 818e62e977 fix crash in view culling when culling context is incorrectly compared (#52254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52254

changelog: [internal]

View culling would generate incorrect mounting instructions because view culling context is checked before it is changed by a view.

Reviewed By: javache

Differential Revision: D77298889

fbshipit-source-id: 2f98dc4de90f34673ff6f627b597942d80fda865
2025-06-25 05:33:49 -07:00
Nick Lefever 3d97bac5f2 Add codegen for EdgeInset type diffing (#52239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52239

Add `toDynamic` conversion function for `EdgeInset` which allowed for removing the custom conversion implemented for the `ViewProps`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234069

fbshipit-source-id: 3aecad8a6d78468f0056167fa1523ccdfb68f369
2025-06-25 04:33:12 -07:00
Nick Lefever 9b82e706fb Add codegen for PointPrimitive prop type diffing (#52238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52238

Add prop diffing codegen for `PointPrimitive` prop type by adding a `toDynamic` conversion for the struct and the prop diffing conditional result update.

The addition of the `toDynamic` function will allow for converting the type when used in array and object types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234062

fbshipit-source-id: d0f52e8fd78ac7712925ea2a47cdd0fe3392d5b0
2025-06-25 04:33:12 -07:00
Nick Lefever da0938edfd Add toDynamic conversion function for ImageSource (#52237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52237

For array props conversion following later in this stack, each type should have a toDynamic conversion available that can be called upon to convert all supported types to a `folly::dynamic` result.

This diff adds the toDynamic conversion function for `ImageSource`

 Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234063

fbshipit-source-id: 392cbaf172595936f7f66faa824900dadd58bdcf
2025-06-25 04:33:12 -07:00
Jakub Piasecki dca83bc158 Move remaining transform to the typescript dir (#52247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52247

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77284561

fbshipit-source-id: 46a5a9d00223283423b791456db3613abfc063aa
2025-06-25 04:17:28 -07:00
Nicola Corti 04858ecbab Bump AGP to 8.11.0 (#52248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52248

Just keep the AGP version update.

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

Reviewed By: rshest

Differential Revision: D77292284

fbshipit-source-id: 2d0bfe1b50e613690bc3cc6b81ae352136543fd4
2025-06-25 03:49:48 -07:00
Christian Falch d8e00f0bb1 Added backwards compatible use of prebuild through cocoapods (#52252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52252

Instead of declaring two different sets of Pods for prebuilt and build from source, this commit now keeps the pod structure the same for both modes so that consuming libraries can expect to have the same pods and header files available - without this, libraries would have to be updated to take advantage of the prebuilds.

This PR does:
- Added React-Core-prebuilt as a pod in React-Core if prebuilt is enabled
- Simplified react_native_pods to keep pods structure and add React-Core-prebuilt pod if prebuilts are enabled
- Added function for selecting source sets based on prebuilt/build from source

To be able to function both in prebuilt and in regular build from source mode, all podspecs are now using the switch function podspec_sources so that they only include header files if we are in prebuild mode.

Also added React-Core-prebuilt as dependency on React-Core if we are in prebuilt mode so that we install the React.XCFramework.

## Changelog:

[IOS] [FIXED] - Added backwards compatible use of prebuild through cocoapods

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

Test Plan:
Tested in RN-Tester both with and without prebuild.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77296047

Pulled By: cipolleschi

fbshipit-source-id: f3eb4d56b2a78bfc8e10ad852746be1ceaf828b2
2025-06-25 03:44:03 -07:00
Christian Falch 07f6f70aef Add missing RCTVibration target in SwiftPM (#52223)
Summary:
`Package.swift` was missing the `RCTVibration` target. This commit adds this target.

## Changelog:

[Internal] - Added RCTVibration to SwiftPM

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

Test Plan: Tested in RN-Tester both with and without prebuild.

Reviewed By: cortinico

Differential Revision: D77257066

Pulled By: cipolleschi

fbshipit-source-id: 13c918387a2ed4a8e3941ddce8b7ba11c24eaab5
2025-06-25 03:44:03 -07:00
Alex Hunt ece8ca82cd Update JS API snapshot to group exports in single block (#52235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52235

Adds `organizeDeclarations` transform, replacing `sortTypeDefinitions`.

All `export declare ...` statements are now collected and represented at the end of the snapshot in a single `export {}` block — significantly improving readability and diffing.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77150017

fbshipit-source-id: 1bd451c0e2a18fd6fc0504970b10a5d2502ac872
2025-06-25 02:55:42 -07:00
Tim Yung 08a59c59e0 VirtualView: Minimize Events w/ Render State (#52245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52245

Changes `VirtualView` to avoid dispatching redundant mode change events by reading the last committed `renderState` to determine whether the desired render state is already in effect.

This enables `VirtualView` to avoid dispatching synchronous `Visible` mode change events when a previous `Prerender` mode change event has already been committed.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D77271865

fbshipit-source-id: 75418aec1416995737f308a1beff407f2cedb940
2025-06-25 02:18:52 -07:00
Jakub Piasecki fbd44ade3a Change Animated methods' local names to avoid symbol collisions in the API snapshot (#52219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52219

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77221690

fbshipit-source-id: 149711ee8c9d89c50178bf3d41de8b44fbc1d464
2025-06-25 00:16:24 -07:00
Jakub Piasecki 4f94028ca6 Reduce symbol collisions in the API snapshot (#52213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52213

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77207979

fbshipit-source-id: 10d8b9c8f24ddb52423197f5aa300402b1e45ebe
2025-06-25 00:16:24 -07:00
generatedunixname89002005287564 0a567a63cd Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit (#52217)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52217

Reviewed By: javache

Differential Revision: D77211475

fbshipit-source-id: 22a89c5211ffc5f9f09ad27dc5e2597c6ceefd99
2025-06-24 22:55:27 -07:00
Tim Yung 19ebd4c188 VirtualView: Prerender w/o Window Focus (#52240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52240

Changes `VirtualView` to detect when its window is not in a focused window (e.g. scroll position or layout changes when it is blurred) and to instead dispatch an async `Prerender` event instead of a sync `Visible` event.

This minimizes unnecessary main thread synchronous work that is needed for a view that is not important to the user experience.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D77261958

fbshipit-source-id: 32acef9bc938005a0d73c5166f1741aebadf23bb
2025-06-24 22:33:07 -07:00
George Zahariev a2a72e239d Enable experimental Flow 'match' syntax for react-native-github/packages/react-native/src/private/components/virtualview/ (#52236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52236

Enable experimental Flow 'match' syntax for `react-native-github/packages/react-native/src/private/components/virtualview/` and adopt in one case to see if there are any issues.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D77250963

fbshipit-source-id: 0b2a5817a05f3332031f0c0590fe956eaa74ddd3
2025-06-24 17:55:57 -07:00
Cao Doan fedceecc37 Correct some cpp imports (#52212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52212

Correcting some C++ imports that show up when build with Xcode 26:
- Missing `<string>` imports.
- `<tgmath.h>` is a deprecated C++ header file, which in this case can be substituted with `<cmath>`.

## Changelog: [Internal]

[iOS][Fixed] - Fix deprecated C++ imports

Reviewed By: zhenma

Differential Revision: D77192276

fbshipit-source-id: 30c836947cb3eb54f6e7ac42b87fd2493334a4f4
2025-06-24 15:38:23 -07:00
Sam Zhou e3047db0dc Deploy 0.274.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D77246379

fbshipit-source-id: 4a86da380109e85b5e1d53f5723f6ea07e6ea429
2025-06-24 12:58:53 -07:00
Andrew Datsenko 1e212f91bc Add remaining dependencies (#52202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52202

Changelog: [Internal]

Build fantom_tester for OSS

Reviewed By: mdvacca

Differential Revision: D76928253

fbshipit-source-id: a95e8751326f45a25cd512b7a5d05260b37a0305
2025-06-24 12:33:59 -07:00
Riccardo Cipolleschi 4f1f72ea34 Fix downloading nightly prebuilds (#52233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52233

When working on [c1bf39bfdf](https://github.com/facebook/react-native/commit/c1bf39bfdfaa0381be3a20d0d89ce159e482afe1) I forgot to add a `.body` to extract the body from the response.

As a result, we can't install prebuilds in a nightly.

This change fixes this.

## Changelog:
[Internal] -

Reviewed By: realsoelynn

Differential Revision: D77241914

fbshipit-source-id: 013ed927e1a3cd6476a551995577ade80c477dd7
2025-06-24 12:05:51 -07:00
Sam Zhou fe1aacae6d Pre-suppress errors in fbsource ahead of 0.274.0 release (#52232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52232

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D77230727

fbshipit-source-id: 890b819ffa3ea9996fa11d254215ea1304ba02b4
2025-06-24 11:04:37 -07:00
Jorge Cabiedes Acosta a82b5acf3d Fix jumping talkback triggering scroll when reaching a view with accessibilityOrder (#52231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52231

Not calling `super.onInitializeAccessibilityNodeInfo` on the host view with accessibilityOrder prevents setting proper dimensions for the node that backs the view which leads TalkBack to trigger scrolling when under a ScrollVIew.

We still need the host's node to not be accessible so we still set it to not be focusable and not have a content description since this should be handled by the virtual views

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77180494

fbshipit-source-id: fe8794cf421cdc9548cf3e18a62d4bb3e8c26b09
2025-06-24 09:37:36 -07:00
Jorge Cabiedes Acosta 8cc2874d3f Fix View Coopting View edge case on Android (#52066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52066

Before, to disable views that were excluded from the order we were setting them to be not important for accessibility. This however breaks coopting behavior of parent views, because parent views will not announce content descriptions of children that are not important for accessibility.

Instead of disabling by setting `important for accessibility = no` now we just set `isFocusable = false` which disables focusing but still allows parent views to coopt

We also add functionality to restore view focusability when enabling disabling screen readers since `isFocusable` changes keyboard focusability and when screen readers are disabled we don't want to change it.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76745057

fbshipit-source-id: cc237c5f8a4b894a7caa3e34207080777de440ac
2025-06-24 09:37:36 -07:00
Alex Hunt d012b2c19b Fix stripUnstableApis to match type alias declarations (#52229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52229

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148443

fbshipit-source-id: 423da38dfe5ca42e639e274461868a51e9987384
2025-06-24 09:15:53 -07:00
Alex Hunt cfc6960bc4 Update all transforms to apply sequentially (#52228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52228

To avoid unexpected behaviour, apply all Babel transforms within `build-types` sequentially, so that each transform plugin has an accurate starting AST.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148444

fbshipit-source-id: f86beac12b7a08ef800e28db1ff88755970cf64e
2025-06-24 09:15:53 -07:00
Alex Hunt ef742dbc68 Subfolder build-types transforms by language (#52230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52230

Reorganisation/refactoring.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148446

fbshipit-source-id: fd29c6d47347efd5ad3da933b2112e864064dba7
2025-06-24 09:15:53 -07:00