Commit Graph
40625 Commits
Author SHA1 Message Date
Ivor Zhou ef38dbb28d Update hermes-parser and related packages in fbsource to 0.36.1 (#56806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56806

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

Bump hermes-parser and related packages to 0.36.1.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D104122338

fbshipit-source-id: 7e938ec114355cf517ff2e76ffbb941f6352d213
2026-05-14 22:13:53 -07:00
Christoph Purrer 0ff4c859de Migrate RCTAlertManager to handle synchronous void method execution (#56801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56801

In preparation for enabling `enableSyncVoidMethods` (D104331837), which makes TurboModule void methods execute synchronously on the JS thread instead of being dispatched asynchronously.

Currently, this module overrides `methodQueue` to return `dispatch_get_main_queue()` so its void methods execute on the main thread. When `enableSyncVoidMethods` is enabled, the `methodQueue` override is ignored for void methods — they execute directly on the JS thread. This causes crashes for any UI operations that must run on the main thread.

**Fix:** Remove the `methodQueue` override. The `alertWithArgs` method already dispatches UI work onto the main thread via `RCTExecuteOnMainQueue`, so it is already safe.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D104771644

fbshipit-source-id: 4f1eae55c64e56990efc20c4b32af1d722520037
2026-05-14 08:50:33 -07:00
Rob Hogan e4cb767653 Babel preset: Add unstable_preserveBlockScoping to experiment with disabling block-scoping transform for SH (#56825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56825

Disable `babel/plugin-transform-block-scoping` when `customTransformOptions.unstable_preserveBlockScoping` is truthy. This allows us to experiment with native let/const block scoping support in Static Hermes.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D93013927

fbshipit-source-id: 6e2c1274426943fcf1ce5a8c09d677e1d0afb35f
2026-05-14 06:21:07 -07:00
Pieter De Baets 67303dfb82 Move CxxCallbackImpl to native-types (#56822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56822

Changelog: [Internal]

Reviewed By: thegreatercurve

Differential Revision: D104870951

fbshipit-source-id: 3b4bc9664ec1088eb944e68bf958e5e2b7b2d74c
2026-05-14 05:37:24 -07:00
Alex Hunt 0b9969f7f5 Prune no-op Omit keys from generated types (#56824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56824

Update the `simplifyTypes` transform (Flow → TS generation) to prune non-overlapping keys from `Omit<>` helpers in TypeScript `interface` unions.

This greatly reduces API snapshot churn/inflation in the next two diffs, which convert a number of `type` declarations (trivial unions) to `interface` (`Omit<>` required for correct union).

#### In detail

`flow-api-translator` emits `Omit<ParentType, keys>` to faithfully translate Flow's object spread override semantics to TypeScript.

```
// Flow
type Base = {x: string, y: number};
type Child = {...Base, x: boolean}; // Later properties in an object spread override earlier ones

// TypeScript
type Base = {x: string; y: number};
type Child = Omit<Base, "x" | "y"> & {x: boolean};  // Later properties in an object spread *merge*, rather than override. So we must use Omit<> for matched keys.
```

For `interface` type unions with overlapping keys, this can result in a number of unnecessary lines in the API snapshot, with little/no human readable value.

This diff extends existing `Omit<>` handling by `simplifyTypes` to recursively resolve all property keys reachable from a type, and prune keys that don't exist on the parent type.

```
// TypeScript
type Child = Omit<Base, "x"> & {x: boolean};  // Only "x" matched - strip `| "y"`
type ChildTwo = Base & {z: string};  // No property collision - strip entire `Omit<>`
```

- See changes to `ReactNativeApi.d.ts`, [P2325468482](https://www.internalfb.com/phabricator/paste/view/P2325468482?view=diff) for examples.
- **Decision point**: This diff opts to preserve correctness in TS — even though the snapshot isn't/isn't intended to be read directly/programatically, vs the conciseness tradeoff if we dropped all `Omit<>`s (human readable but ambiguous to the typechecker).

Changelog: [Internal] - JS API snapshot changes are a simplification refactor only

Reviewed By: robhogan

Differential Revision: D105150070

fbshipit-source-id: 43b0ef517164332a5cfaee7a5de5747749ac5e7c
2026-05-14 04:16:19 -07:00
Alex Hunt a9be1b12c6 Add --watch mode to build-types script (#56808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56808

Adds a `--watch` flag to `yarn build-types`. Helpful when debugging output TS types end-to-end.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D104815967

fbshipit-source-id: 23ca53bffd5b0508272a5fad8bd4ca4314bb9d06
2026-05-14 04:16:19 -07:00
Peter Abbondanzo 3abe228941 Add Image.getSize device coverage (#56746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56746

Add an RNTester PlatformTest case that calls Image.getSize against a small PNG, a large JPEG, and an EXIF-rotated JPEG, then verifies the dimensions reported by native image metadata. Extend the existing Image Maestro flow to open the new test and wait for the pass result, so the same flow can run against Android and iOS RNTester builds.

Changelog:
[Internal][Added] - Add RNTester device coverage for Image.getSize dimensions

Reviewed By: christophpurrer

Differential Revision: D104535939

fbshipit-source-id: 4f181ce7320af679dd4c409a5c813555914e580c
2026-05-14 00:09:32 -07:00
generatedunixname1608173377072046 2c6cb27f88 Add null guard for changedTouches in ResponderTouchHistoryStore.recordTouchTrack (#56819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56819

The native iOS touch system can occasionally dispatch touch events to JavaScript where `nativeEvent.changedTouches` is undefined due to inconsistencies between local and UIKit touch registries. This causes a TypeError crash in `ResponderTouchHistoryStore.recordTouchTrack` when it unconditionally calls `.forEach()` on `changedTouches`.

The fix adds a defensive null check: if `changedTouches` is null/undefined, we log a DEV warning and bail out early from `recordTouchTrack`. Additionally, `nativeEvent.touches` accesses use optional chaining to prevent secondary crashes.

Changelog: [iOS][Fixed] - Fix TypeError crash in ResponderTouchHistoryStore when changedTouches is undefined

Reviewed By: fkgozali

Differential Revision: D105023000

fbshipit-source-id: d3ade24e93f45614b094932e436f7190c8c0a985
2026-05-13 17:53:57 -07:00
Eric Rozell fafcfcd5f6 Do not include an expanded property by default in accessibilityState (#56814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56814

Any time we have a non-nullable accessibilityState prop, it appears to always set `expanded` false, which causes most Android screen readers to append or prepend "collapsed". This fixes the issue.

## Changelog
[Android][Fixed] Screen reader behavior for accessibilityState expanded

Reviewed By: javache

Differential Revision: D105035390

fbshipit-source-id: 4b3b1b2a9b6e661cfde0f39d7de6a7cd7af91bb0
2026-05-13 14:14:17 -07:00
Alex Hunt 37be9351c8 Update react-native-devtools-frontend URLs (#56812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56812

Update load-bearing `react/react-native-devtools-frontend` URLs following repo move. In particular, the `sync-and-build` script.

URLs in code comments are preserved (rely on redirect / avoid churn).

Changelog: [Internal]

___

overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: react_native_iroc

Differential Revision: D105033074

fbshipit-source-id: 78545cb92d9623d9a115d1a940ba7efc78a5a6d8
2026-05-13 11:13:55 -07:00
Christian Falch 814ebb12b6 fix(cocoapods) Podfile.lock SPEC CHECKSUMS drift for React XCFrameworks (#56803)
Summary:
Two developers (or one developer on two paths, or CI vs. local) running pod install on the same React Native project at the same commit get different SPEC CHECKSUMS entries for React-Core-prebuilt and ReactNativeDependencies in Podfile.lock. That breaks pod install-deployment style verification and any workflow that expects Podfile.lock to be reproducible.

CocoaPods derives each SPEC CHECKSUMS entry by hashing the in-memory podspec JSON. So anything embedded in source.http, prepare_command, user_target_xcconfig, etc. becomes part of the hash. Two podspec-resolution sites in this repo build their source.http from an absolute on-disk path.

Because project_pods_root is an absolute path, the resulting file://<abs>/... URL differs across machines or working-tree paths, so the hashed JSON differs, so the checksum differs.

### How

The Maven URL for each tarball is already computed inside both functions (stable_tarball_url(...) / nightly_tarball_url(...) / release_tarball_url(...)). Returning that URL — a stable string identical across machines — instead of the local file:// URL makes source.http path-free. CocoaPods downloads from Maven and caches the tarball itself, so functionality is preserved.

The pre-existing local-tarball download is kept untouched (its only remaining consumer is the opt-in  `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1` dSYM-injection path in rncore.rb, which still needs file:// to feed CocoaPods a mutated tarball — gated by unless @download_dsyms so the leak is preserved only for that flag).

**Out of scope: **

hermes-engine.podspec has the same shape of leak in user_target_xcconfig.HERMES_CLI_PATH. Fixing it requires a paired change to ensure hermesc lands at the new ${PODS_ROOT}-relative path; that's a separate PR.

## Changelog:

[IOS] [FIXED] - Fix Pod install checksum drifting

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

Test Plan:
Run `pod install` and verify that none of the following files contains absolute paths:

- Pods/Local Podspecs/React-Core-prebuilt.podspec.json
- Pods/Local Podspecs/ReactNativeDependencies.podspec.json

Reviewed By: christophpurrer

Differential Revision: D104889112

Pulled By: CalixTang

fbshipit-source-id: 97505a8bf78f7df57bda2d87705da5a20c934d2b
2026-05-13 10:47:42 -07:00
Sam Zhou 668ca295ca Deploy 0.314.0 to xplat (#56810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56810

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D105015188

fbshipit-source-id: e224f3112fa1c4b707fb1485c9474df5c5f6e53a
2026-05-13 10:36:36 -07:00
Nicola Corti 6e262624fc Migrate YogaWrap enum to Kotlin (#56793)
Summary:
X-link: https://github.com/facebook/yoga/pull/1949

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

Migrate YogaWrap.java to YogaWrap.kt by adding Wrap to KOTLIN_ENUM_NAMES in enums.py and regenerating. All enums are now migrated to Kotlin — KOTLIN_ENUM_NAMES now contains all enum names.

Reviewed By: fabriziocucci

Differential Revision: D104666339

fbshipit-source-id: c30cac3d1f8cd5d8ac863c961ad7c90f4371cc58
2026-05-12 18:22:02 -07:00
Nicola Corti 97cf21dd41 Migrate YogaUnit enum to Kotlin (#56784)
Summary:
X-link: https://github.com/facebook/yoga/pull/1944

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

Migrate YogaUnit.java to YogaUnit.kt by adding Unit to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666347

fbshipit-source-id: 99f58b2d1cbea1592a3f4d1aa2608d42ba17e095
2026-05-12 18:22:02 -07:00
Nicola Corti d181829b9c Migrate YogaPositionType enum to Kotlin (#56789)
Summary:
X-link: https://github.com/facebook/yoga/pull/1945

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

Migrate YogaPositionType.java to YogaPositionType.kt by adding PositionType to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666349

fbshipit-source-id: 7f81f15000f561fc11283313f74b4ae3112c2f75
2026-05-12 18:22:02 -07:00
Nicola Corti 14c1d164d5 Migrate YogaOverflow enum to Kotlin (#56790)
Summary:
X-link: https://github.com/facebook/yoga/pull/1954

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

Migrate YogaOverflow.java to YogaOverflow.kt by adding Overflow to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666340

fbshipit-source-id: afbea3493fcba811b100d8bffc859f3ff65aab88
2026-05-12 18:22:02 -07:00
Nicola Corti bb137aa028 Migrate YogaNodeType enum to Kotlin (#56792)
Summary:
X-link: https://github.com/facebook/yoga/pull/1953

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

Migrate YogaNodeType.java to YogaNodeType.kt by adding NodeType to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666338

fbshipit-source-id: aed887c3cd1ca5f86e4ce68c38a4c75b5ab7c594
2026-05-12 18:22:02 -07:00
generatedunixname1608173377072046 1faa66551a Guard against OTA mismatch in NativeAnimatedHelper queue (#56802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56802

When MobileConfig flags (`cxxNativeAnimatedEnabled` and `useSharedAnimatedBackend`) are enabled server-side, `connectAnimatedNodeToShadowNodeFamily` is added to the method names list in `createNativeOperations()`. However, MobileConfig values and what is available in the AnimatedModule on the client can mismatch due to OTA updates — the JS bundle may have the flag enabled while the native module on the device does not yet implement the method. In this case, `nullthrows(NativeAnimatedModule)[methodName]` returns `undefined`, which gets queued as `() => undefined(...args)` and throws TypeError when the queue is flushed.

This fix adds a runtime check that `NativeAnimatedModule?.connectAnimatedNodeToShadowNodeFamily != null` before including the method in the list, preventing the mismatch from surfacing. The specific guard at the registration site is sufficient — if the method is not available on the native module, it will never be registered, so the general null guard in the method wrapper is unnecessary.

Fixes T270861607.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D104775294

fbshipit-source-id: ece86a3ab37792bf9624985eebfc53059af61677
2026-05-12 17:56:45 -07:00
Alex Hunt 2991a97731 Upgrade TypeScript to ^6.0.3 (#56772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56772

Upgrades to TypeScript 6.0.3 and updates `typescript-eslint/*` for TS 6.0 compatibility across `react-native` and `metro`.

#### Motivation

TypeScript 6.0 (Mar 2026) will resolve https://github.com/facebook/react-native/issues/53565. Before updating in the React Native CLI template, align in RN and Metro source for consistency.

This is an internal change since:
- This upgrade only applies to TS analysis of these repos' source code.
- Edits to `react-native/typescript-config/tsconfig.json` (which *is* distributed) maintain backwards compatibility.

#### Changes

**react-native**

- Bump `typescript` from `^5.8.3` to `^6.0.3`
- Bump `typescript-eslint/*` from `^8.24.0` to `^8.59.2`
- Replace deprecated `moduleResolution: "node"` with `"node16"` and `target: "es5"` with `"es2015"` in codegen-typescript-test
- Add explicit `types: ["jest", "node"]` where needed (TS 6.0 defaults `types` to `[]`)
- Set `strict: false` in configs that only enable specific strict flags (TS 6.0 defaults `strict` to `true`)
- Update `ModuleResolutionKind.NodeJs` to `Node16` in build config

**metro**

- Bump `typescript` from `5.8.3` to `^6.0.3`
- Bump `typescript-eslint/*` from `^8.36.0` to `^8.59.2`
- No tsconfig changes needed (`tsconfig/node20` preset is already TS 6.0 compatible)

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D104658690

fbshipit-source-id: 9a2feeb257d5783431941a911b17065fcd0389a5
2026-05-12 17:53:54 -07:00
Kevin Gozali e028946658 Add C++ test for Scheduler delegate UAF after JS-throw teardown (#56800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56800

Reproduces, in a standalone gtest, the use-after-free race between Scheduler
teardown and pending rendering-update lambdas previously enqueued via
runtimeScheduler->scheduleRenderingUpdate inside
Scheduler::uiManagerDidFinishTransaction.

The lambda captures the SchedulerDelegate by raw pointer; when the delegate
is destroyed (as part of an instance teardown triggered by an uncaught fatal
error) before the lambda runs, the dereference is a use-after-free unless
the invalidation-token guard in Scheduler::setDelegate
(enableSchedulerDelegateInvalidation) is enabled at queue time.

The test:
- Drives the *real* Scheduler::uiManagerDidFinishTransaction so the lambda
  is enqueued via the regular code path into a real RuntimeScheduler's
  pending-rendering-updates queue.
- Initiates teardown via an uncaught JSI host-function throw routed through
  RuntimeScheduler's onTaskError callback (the test's analog of a host-side
  fatal handler), which drops the delegate.
- Triggers the next event loop tick to drain the queue.

Three test cases:
1. Sanity_LambdaRunsOnNextTickWhenDelegateAlive -- baseline: lambda runs and
   reaches the delegate when no teardown happens.
2. GuardEnabled_JSThrowInitiatedTeardownIsSafe -- with the guard ON, the
   pending lambda observes the invalidation token after teardown and returns
   without touching the freed delegate. Safe.
3. GuardDisabled_JSThrowInitiatedTeardownIsUAF -- with the guard OFF, the
   lambda dereferences the destroyed delegate. Caught by EXPECT_DEATH via a
   magic-sentinel ASSERT_EQ in the recording delegate, or by AddressSanitizer
   on the vptr load.

Fantom is intentionally not used here: it shares the global runtime VM across
tests, which would interfere with this test's contract that no further JS
executes after a fatal-driven instance teardown.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D104777850

fbshipit-source-id: 7ecacaf21a4a9b121575fcc66c2fcbb6bfd4adc7
2026-05-12 15:42:18 -07:00
Mathieu Acthernoene 8823a8009b Fix Image.getSize returning downsampled dimensions on Android (#56736)
Summary:
`Image.getSize` and `getSizeWithHeaders` call Fresco's `fetchDecodedImage`, which returns a `CloseableImage` whose width / height reflect the bitmap after Fresco's automatic downsampling (typically capped at the screen size).

For sources larger than the screen this returned the wrong dimensions. ex: a 4000x3000 image on a 1920x1080 device came back as 1920x1440.

Switch to `fetchEncodedImage` and read the dimensions from the parsed image metadata (JPEG / PNG / WebP / HEIF headers), so the values are the true source dimensions. Swap width / height for 90°/270° EXIF rotation to match the iOS behavior in `RCTImageLoader`.

Fixes https://github.com/facebook/react-native/issues/33498
Closes facebook/fresco#2236

## 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] - `Image.getSize` and `Image.getSizeWithHeaders` now return the true source dimensions instead of Fresco's downsampled values

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

Test Plan:
In the RNTester app, add:

```ts
useEffect(() => {
  Image.getSize(
    'https://images.pexels.com/photos/842711/pexels-photo-842711.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2',
    (width, height) => {
      console.log({width, height});
    },
  );
}, []);
```

### Before

<img width="811" height="467" alt="before" src="https://github.com/user-attachments/assets/6fb401ed-cf5a-4496-bcc1-4cfd243bc0b7" />

### After

<img width="811" height="467" alt="after" src="https://github.com/user-attachments/assets/dc809d5f-c554-45d6-a3a3-7712bf39ac44" />

Reviewed By: javache

Differential Revision: D104533593

Pulled By: Abbondanzo

fbshipit-source-id: f087d528474c40cffbf24eb1e3958b4b18fb118e
2026-05-12 11:03:26 -07:00
Nicola Corti b7801f29c5 Migrate YogaMeasureMode enum to Kotlin (#56785)
Summary:
X-link: https://github.com/facebook/yoga/pull/1958

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

Migrate YogaMeasureMode.java to YogaMeasureMode.kt by adding MeasureMode to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666333

fbshipit-source-id: 649ecf9a670153026e08c54ee45baa6e4a16dd93
2026-05-12 10:15:10 -07:00
Nicola Corti 5d5350b1e4 Migrate YogaLogLevel enum to Kotlin (#56794)
Summary:
X-link: https://github.com/facebook/yoga/pull/1943

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

Migrate YogaLogLevel.java to YogaLogLevel.kt by adding LogLevel to KOTLIN_ENUM_NAMES in enums.py and regenerating. Also adds DO_NOT_STRIP support to the Kotlin codegen path to preserve the DoNotStrip annotation.

Reviewed By: fabriziocucci

Differential Revision: D104666343

fbshipit-source-id: 6307e0f72559d505a8db115d63669271cbd8754a
2026-05-12 10:15:10 -07:00
Nicola Corti 084a77631f Migrate YogaJustify enum to Kotlin (#56796)
Summary:
X-link: https://github.com/facebook/yoga/pull/1950

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

Migrate YogaJustify.java to YogaJustify.kt by adding Justify to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666331

fbshipit-source-id: c28e62b7e411d317bb1b10edec4995d29684cb90
2026-05-12 10:15:10 -07:00
Nicola Corti 26862a0251 Migrate YogaGutter enum to Kotlin (#56791)
Summary:
X-link: https://github.com/facebook/yoga/pull/1955

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

Migrate YogaGutter.java to YogaGutter.kt by adding Gutter to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666345

fbshipit-source-id: 12dbfc582c07be31cfb37d7a520961bea1f212b4
2026-05-12 07:48:48 -07:00
Nicola Corti f1b488f5da Migrate YogaGridTrackType enum to Kotlin (#56786)
Summary:
X-link: https://github.com/facebook/yoga/pull/1952

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

Migrate YogaGridTrackType.java to YogaGridTrackType.kt by adding GridTrackType to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666336

fbshipit-source-id: 4b2966b14f09bfce9a64854bbfe161b7849195a8
2026-05-12 07:48:48 -07:00
Nicola Corti 984621b212 Migrate YogaFlexDirection enum to Kotlin (#56788)
Summary:
X-link: https://github.com/facebook/yoga/pull/1948

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

Migrate YogaFlexDirection.java to YogaFlexDirection.kt by adding FlexDirection to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666341

fbshipit-source-id: ea52f553ad0ebdbf9392c7c0ed125a33685e2c31
2026-05-12 07:48:48 -07:00
Nicola Corti 70ebd43a1a Migrate YogaExperimentalFeature enum to Kotlin (#56797)
Summary:
X-link: https://github.com/facebook/yoga/pull/1946

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

Migrate YogaExperimentalFeature.java to YogaExperimentalFeature.kt by adding ExperimentalFeature to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666330

fbshipit-source-id: 803d54b16697015b4ddf91d1c145179e9635b183
2026-05-12 07:48:48 -07:00
Nicola Corti d695a5cff4 Migrate YogaErrata enum to Kotlin (#56798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56798

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

Migrate YogaErrata.java to YogaErrata.kt by adding Errata to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666332

fbshipit-source-id: d06a17fb6dc74f0a34d4ed216c842c0f8d03f8d1
2026-05-12 07:48:48 -07:00
Nicola Corti 2be96e8d92 Migrate YogaEdge enum to Kotlin (#56782)
Summary:
X-link: https://github.com/facebook/yoga/pull/1942

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

Migrate YogaEdge.java to YogaEdge.kt by adding Edge to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666351

fbshipit-source-id: d771d8ad80c5f1f85d15ab5dc1d7b50eeb789b4e
2026-05-12 07:48:48 -07:00
Nicola Corti 9580a54273 Migrate YogaDisplay enum to Kotlin (#56781)
Summary:
X-link: https://github.com/facebook/yoga/pull/1956

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

Migrate YogaDisplay.java to YogaDisplay.kt by adding Display to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666346

fbshipit-source-id: b49d06c947ce2fb2c24aee96a207e1ab737e5c10
2026-05-12 07:48:48 -07:00
Nicola Corti 2d2b9924e3 Migrate YogaDimension enum to Kotlin (#56795)
Summary:
X-link: https://github.com/facebook/yoga/pull/1951

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

Migrate YogaDimension.java to YogaDimension.kt by adding Dimension to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666342

fbshipit-source-id: 506c2ea8d1cb98c7a385168cdca9dba1892d8149
2026-05-12 07:48:48 -07:00
Nicola Corti fe154568e5 Migrate YogaBoxSizing enum to Kotlin (#56787)
Summary:
X-link: https://github.com/facebook/yoga/pull/1941

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

Migrate YogaBoxSizing.java to YogaBoxSizing.kt by adding BoxSizing to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Reviewed By: fabriziocucci

Differential Revision: D104666350

fbshipit-source-id: 0d7464d9dc55648e54be315058f4939facec7dce
2026-05-12 07:48:48 -07:00
Nicola Corti d0f1197578 Migrate YogaAlign enum to Kotlin (#56783)
Summary:
X-link: https://github.com/facebook/yoga/pull/1947

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

Migrate YogaAlign.java to YogaAlign.kt by adding Align to KOTLIN_ENUM_NAMES in enums.py and regenerating.

Changelog:
[Internal] -

Reviewed By: fabriziocucci

Differential Revision: D104666334

fbshipit-source-id: b14bdd56104e41fd68c7f98aeae341e3f6e4ec23
2026-05-12 07:48:48 -07:00
Christian Brevik efcab20908 Fix ScrollView touch events ignored in contentInset area on iOS (#56747)
Summary:
Fixes https://github.com/facebook/react-native/issues/54123

In RN 0.80, `betterHitTest:withEvent:` in `RCTScrollViewComponentView` was added, which returns `self` (the `RCTScrollViewComponentView` wrapper view) when a touch point falls inside the scroll view's bounds. This causes touches in the contentInset area — where no content is rendered — to be absorbed by the wrapper rather than forwarded to the underlying UIScrollView, making scroll gestures in that region completely non-functional.

The fix returns `_scrollView` instead of `self`, so hit-tested touches are correctly attributed to the `UIScrollView` and scrolling works throughout the full bounds, including the inset area.

## Changelog:

[IOS] [FIXED] - Fix ScrollView touch events ignored in contentInset area on Fabric

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

Test Plan:
Couldn't use the snack-repro from https://github.com/facebook/react-native/issues/54123 since this requires a native change. But using the `ScrollViewSimpleExample` from the RNTester, and removing a lot of the items demonstrates the behaviour change.

The two videos show attempted dragging from the region below the ScrollView content.

### Before: Dragging in the inset area does nothing — scroll view does not respond
https://github.com/user-attachments/assets/55468ca8-78a7-4034-9e34-0191d55f7da1

### After: Dragging in the inset area scrolls the content correctly
https://github.com/user-attachments/assets/d1f10729-9b41-4a55-8738-16faf27031d7

Reviewed By: christophpurrer

Differential Revision: D104644045

Pulled By: javache

fbshipit-source-id: c8b856ff133705f2197ce9938d5ebafae46d0c17
2026-05-12 07:32:27 -07:00
Federico Bartoli b09fce6db5 Clarify Android AppState background API docs (#56779)
Summary:
Syncs the in-package AppState API documentation with the Android AppState clarification added in facebook/react-native-website#5079.

Android AppState `background` was already documented as including another `Activity`. This clarifies that temporary system activities, such as autofill credential pickers, are included too.

## Changelog:

[GENERAL] [CHANGED] - Clarify Android AppState background API documentation.

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

Test Plan:
Documentation-only change.

Verified with:
- `git diff --check`
- `prettier --check packages/react-native/Libraries/AppState/AppState.js packages/react-native/Libraries/AppState/AppState.d.ts`

Reviewed By: cortinico

Differential Revision: D104810583

Pulled By: huntie

fbshipit-source-id: 17d2ec312c65c91b8086bd382f733f3cceb4da8a
2026-05-12 05:28:57 -07:00
W3D 74b1a4d026 - Fix hover out timeout stored in wrong variable in Pressability (#56328)
Summary:
The `onMouseLeave` handler in `Pressability` stores the delayed `onHoverOut` timeout in `_hoverInDelayTimeout` instead of `_hoverOutDelayTimeout`. This is a copy-paste error from the `onMouseEnter` handler above it.

The Pointer Events path (`onPointerLeave`, line 593) correctly uses `_hoverOutDelayTimeout`. The Mouse Events path (`onMouseLeave`, line 645) incorrectly uses `_hoverInDelayTimeout`.

This causes:
- `_cancelHoverOutDelayTimeout()` to not cancel the pending `onHoverOut` callback
- `_cancelHoverInDelayTimeout()` to incorrectly cancel `onHoverOut` instead of `onHoverIn`
- A pending `onHoverIn` timeout to be silently overwritten if it exists

Affects non-mobile platforms (web, desktop) when `delayHoverOut > 0`.

## Changelog:

[General] [Fixed] - Fix hover out timeout stored in wrong variable in Pressability

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

Test Plan:
- All 37 existing Pressability tests pass: `yarn jest packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js`
- Prettier and ESLint checks pass.
- Verified by code inspection: the Pointer Events path (line 593) correctly uses `_hoverOutDelayTimeout`, the Mouse Events path (line 645) now matches.

Reviewed By: christophpurrer

Differential Revision: D104657310

Pulled By: javache

fbshipit-source-id: 66b0b353168102a5e8664e0c9b558cb6a1d7503c
2026-05-12 04:42:14 -07:00
generatedunixname1395667395051502 ddccf61022 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D104244225

fbshipit-source-id: 5f98f5d3c7f376327cae1aee1668a5cfd5414dd1
2026-05-12 03:41:19 -07:00
Andrew Datsenko ab8b40df81 Add TextEffect component and registry for custom text span effects (#56720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56720

Introduces a generic TextEffect system that lets apps register custom text
span effects without modifying React Native core. This can serve for use cases like `react-native-live-markdown`, or product specific effects.

The implementation is pretty dumb right now. It's just a marker, where we can add some JSON serializable data, to be serialized during Spannable creation on JS side MapBuffer.

**JS API:**
```js
import requireNativeTextEffect from 'react-native/Libraries/Text/requireNativeTextEffect';
const Spoiler = requireNativeTextEffect<{}>('RCTSpoiler');

<Text>Normal <Spoiler>hidden text</Spoiler></Text>
```

**Android registration** (via FabricUIManager):
```kotlin
val fabricUIManager = UIManagerHelper.getUIManager(
    context, UIManagerType.FABRIC) as? FabricUIManager
fabricUIManager?.textEffectRegistry?.register("RCTSpoiler") { props ->
    MyCustomSpan()
}
```

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D98812222

fbshipit-source-id: 7000a0452b7592cdc2b26e7eaa37ec95736efce4
2026-05-11 13:17:34 -07:00
Calix Tang 497177f3d2 Bump @babel/plugin-transform-modules-systemjs to fix CVE-2026-44728 (#56775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56775

babel/plugin-transform-modules-systemjs versions >= 7.12.0 and <= 7.29.3 are affected by CVE-2026-44728 (GHSA-fv7c-fp4j-7gwp), a HIGH severity vulnerability. The react-native repo resolves this package at 7.25.9 via babel/preset-env. This adds a Yarn resolution to force the package to ^7.29.4, the first patched version.

#Changelog: [Internal]
[General] - Bump `babel/plugin-transform-modules-systemjs` to 7.29.4

Reviewed By: robhogan

Differential Revision: D104687110

fbshipit-source-id: ce95afcae024d6ea2a83eae9067d3ab3fd3baa0c
2026-05-11 13:13:41 -07:00
Riccardo Cipolleschi e2936cbee4 Remove old hermes nightly script files (#56752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56752

Delete the old script files that were renamed in prior commits:
- scripts/releases/use-hermes-nightly.js (renamed to use-hermes-prebuilt.js)
- scripts/try-set-nightly-hermes-compiler.js (renamed to try-set-hermes-compiler-prebuilt.js)

These deletions were accidentally omitted from their respective rename commits.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104650744

fbshipit-source-id: a0f1e3279622f792a0e79d011d942539e5168eaf
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi e4e3e93d13 Update hermesTag fixture to current version format (#56751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56751

The hermes-utils test used an old-style Hermes git tag
('hermes-2022-04-28-RNv0.69.0-...') as its fixture. Hermes now uses semver
version strings (e.g. '250829098.0.13'). Update the fixture to match the
current format so the test better represents real usage.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649627

fbshipit-source-id: 00562fd7d0325acde6f4ccf906e4c34e3c705375
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi b05ab2f8d8 Update stale 'Hermes V1' comments (#56757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56757

Update comments that still say 'Hermes V1' as if it is an opt-in feature.
Since Hermes (formerly called Hermes V1) is now the only supported engine:
- hermes-engine.podspec: drop 'when using Hermes V1' from hermesc note
- PathUtils.kt: rewrite the hermesc path comment to drop the 'opted in to Hermes V1' phrasing
- hermes-engine/build.gradle.kts: 'Hermes V1 by default...' -> 'Hermes by default...'

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649634

fbshipit-source-id: 9b0a05ed013c7ba908c7abe467d5e3c1c3c2f26c
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi ca4aafffb3 Rename use-hermes-nightly workflow input to use-hermes-prebuilt (#56756)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56756

The use-hermes-nightly boolean input of prebuild-ios-core.yml was misleadingly named.
It controls whether to use the latest prebuilt Hermes from npm's latest-v1 dist-tag
(not a 'nightly' build). Rename:
- prebuild-ios-core.yml input: use-hermes-nightly -> use-hermes-prebuilt
- Update description of the input
- Update comment to move the TODO note inline
- Update callers in nightly.yml and test-all.yml

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649628

fbshipit-source-id: 71c75b07caebfe5e7d03e80d47cefba883843c9a
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi ac48b56a1a Rename try-set-nightly-hermes-compiler.js (#56758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56758

Rename scripts/try-set-nightly-hermes-compiler.js to
scripts/try-set-hermes-compiler-prebuilt.js. The script sets the hermes-compiler
version to the latest prebuilt (latest-v1 on npm), not a nightly build.
Update the preinstall script reference in the root package.json.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649635

fbshipit-source-id: 8375d0518ea8c9ca99a59fd65366210eeea91e50
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi f37513595f Rename use-hermes-nightly.js to use-hermes-prebuilt.js (#56750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56750

Rename scripts/releases/use-hermes-nightly.js to scripts/releases/use-hermes-prebuilt.js.
The script fetches the latest prebuilt Hermes from the 'latest-v1' npm dist-tag, not a
true 'nightly' build. Update:
- Script name: use-hermes-nightly.js -> use-hermes-prebuilt.js
- Internal log message: 'nightly update' -> 'prebuilt update'
- Import: updateHermesVersionsToNightly -> updateHermesVersionsToPrebuilt
- CI step names: 'Set nightly Hermes versions' -> 'Set Hermes prebuilt version'
- Script path references in test-all.yml, test-ios-helloworld/action.yml,
  test-ios-rntester/action.yml

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649633

fbshipit-source-id: ea74dbdba5a7f31aa58e5f581249e384581e6620
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi 041b6d5f9e Rename 'nightly' functions to 'prebuilt' in release scripts (#56753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56753

The functions getLatestHermesNightlyVersion() and updateHermesVersionsToNightly() were
misleadingly named: they actually fetch from the 'latest-v1' npm dist-tag, not a 'nightly'
tag. Rename them to better reflect what they do:
- getLatestHermesNightlyVersion -> getLatestHermesVersion
- updateHermesVersionsToNightly -> updateHermesVersionsToPrebuilt

Update all call sites in publish-npm.js and publish-npm-test.js.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649629

fbshipit-source-id: b1d60b9bb48ef51946e99877a73d5760db585a4c
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi 99988aba7b Remove V0 nightly download path from hermes-utils.rb (#56755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56755

Remove the legacy Hermes V0 nightly (Maven Snapshots) download path:
- Remove DOWNLOAD_PREBUILT_NIGHTLY_TARBALL source type constant
- Remove nightly_artifact_exists(), nightly_tarball_url(), podspec_source_download_prebuilt_nightly_tarball()
- Remove net/http and rexml/document requires (only needed for nightly XML parsing)
- Rename BUILD_FROM_GITHUB_MAIN -> BUILD_FROM_GITHUB_STABLE_BRANCH (was always targeting the stable V1 branch)
- Rename force_build_from_main -> force_build_from_stable_branch
- Rename podspec_source_build_from_github_main -> podspec_source_build_from_github_stable_branch
- Extract HERMES_STABLE_BRANCH constant so the hardcoded branch is in one place

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649630

fbshipit-source-id: f0d0834b72ee77183276dba0058c49a0308d1158
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi 06d6229b7b Remove V0 nightly download path from ios-prebuild (#56759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56759

The legacy Hermes V0 nightly dist-tag ('nightly') has been removed. This commit
cleans up the ios-prebuild Hermes download logic:
- Remove the 'nightly' sentinel string and getNightlyVersionFromNPM()
- Remove DOWNLOAD_PREBUILT_NIGHTLY_TARBALL source type and downloadPrebuiltNightlyTarball()
- Remove getNightlyTarballUrl() (was fetching from Maven Snapshots for V0 nightlies)
- Rename getLatestV1VersionFromNPM -> getLatestHermesVersionFromNPM
- Update prepare-app-utils.js to use 'latest-v1' instead of 'nightly' for HERMES_VERSION

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649632

fbshipit-source-id: 91f7c67ee59a3ef835d78146e5ad5ecab25a17bf
2026-05-11 12:55:12 -07:00
Riccardo Cipolleschi 26040d8d54 Remove isHermesV1 from Babel preset (#56754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56754

Hermes V1 (Static Hermes) is now always enabled. Remove the isHermesV1 variable and inline its effects:
- enableRegenerator is always based on dev mode (was isHermesV1 && dev)
- preserveClasses is always true (was isHermesV1)

Also update the comments to drop the 'V1' framing.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D104649639

fbshipit-source-id: 70d4cbc0ad365df551b744e3cc16e880ce41c90c
2026-05-11 12:55:12 -07:00