Commit Graph

38536 Commits

Author SHA1 Message Date
Riccardo Cipolleschi a7cd3cc08f Make codegen generate a Package.swift file for Codegen'd target (#53619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53619

With this change, we are making Codegen generate a Package.swift file so that we can integrate the `ReactCodegen` and the `ReactAppDependencyProvider` in apps only using SwiftPM

## Changelog
[iOS][Added] - Make codegen generate PAckage.swift file for the codegen targets

Reviewed By: cortinico

Differential Revision: D81769543

fbshipit-source-id: 1f1a1b9f41126e142931d5eda6e75109a69f828c
2025-09-10 05:25:54 -07:00
Riccardo Cipolleschi 87f8e85b7f Move generated code to ReactCodegen and ReactappDependencyProvider folder (#53618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53618

This change makes sure that we generate the codegen files in the ReactCodegen and ReactAppDependencyProvider folder.

This is necessary as Swift PM needs the source code of packages to be grouped in folders that are children of where the Package.swift is located.

This is not a breaking change, because Cocoapods has been updated accordingly, import/include paths are not changed and the folder layout should not be accessed by anybody directly

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81769522

fbshipit-source-id: 7c70f96a9aa503c4faaf173b94c8ee0e326094a1
2025-09-10 05:25:54 -07:00
Phil Pluckthun f6f5ea0b2e Remove outdated artifacts codegen early return (#53690)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53503 for a regression

When no React Native module is present this bail condition stops us from generating the artifacts podspec that's needed to complete build.

## Changelog:

[IOS] [FIXED] - Fix regression that skips artifacts code generation

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

Test Plan:
- Create an app **without** any React Native modules, run `pod install`; without this fix the podspec will be missing and the build will fail
  - With expo this can be reproduced using `create-expo-app --template blank-typescript@next` on `react-native@0.81.2`
  - With the community CLI this can be reproduced using `npx react-native-community/cli@latest init test --skip-install --version 0.81.2` and uninstalling `react-native-safe-area-context`

Reviewed By: javache

Differential Revision: D82103491

Pulled By: cipolleschi

fbshipit-source-id: 3d9619b5a935ca920220824b3963a9a107f926ca
2025-09-10 05:24:28 -07:00
Riccardo Cipolleschi 6c49572ee4 Make sure we don't run RN CI on forks (#53707)
Summary:
We had reports from the Community of the RN CI running on forks and causing high costs and bills for them
This change should make sure that the most impactful jobs only runs on the React Native CI and not on forks.

## Changelog:
[Internal] -

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D82107313

Pulled By: cipolleschi

fbshipit-source-id: ff7f418344975e7bb8306a6356d774c26bea3db1
2025-09-10 04:49:14 -07:00
Rubén Norte 529f55c8c9 Implement performance.timeOrigin (#53660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53660

Changelog: [internal]

(This is internal because these APIs aren't enabled in OSS yet)

Implements `performance.timeOrigin` to allow converting timestamps from `performance.now()` to be based on the Unix epoch.

This implementation isn't fully spec-compliant to align with the current implementation of `performance.now()`, where the base of the clock is system boot time instead of app startup / navigation time.

Reviewed By: huntie

Differential Revision: D82016724

fbshipit-source-id: e3a066721cecf41e2fd963beb94a0a2f1c5d6493
2025-09-10 04:48:55 -07:00
generatedunixname537391475639613 481fb612a2 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareGflagsTaskTest.kt (#53702)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53702

Reviewed By: cortinico

Differential Revision: D82093601

fbshipit-source-id: 133936f59d155fa1d68358abe4015c7b7b1613a6
2025-09-10 04:41:29 -07:00
Oskar Kwaśniewski 3ce6a05aac fix: add conditional checks for facebook/react-native repo for nightly (#53700)
Summary:
This PR adds additional checks to run nightly jobs only on the main repo.

I noticed pretty heavy usage on my fork of React Native:

<img width="951" height="179" alt="Screenshot 2025-09-10 at 11 47 29" src="https://github.com/user-attachments/assets/91cb9e4a-8658-42bd-bbfe-ffba01b0b3b3" />

I also noticed a typo in this file with output instead of outputs

## Changelog:

[INTERNAL] [FIXED] - add conditional checks for facebook/react-native repo for nightly workflow

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

Test Plan: Check if the syntax is correct.

Reviewed By: cortinico

Differential Revision: D82104958

Pulled By: cipolleschi

fbshipit-source-id: fc2e6e0299345ebd115c7a574a5a8161f2b0ca5c
2025-09-10 03:57:54 -07:00
Jakub Piasecki 813b9441ca Read Hermes V1 opt-in flag from the app's properties (#53665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53665

Changelog: [ANDROID][FIXED] - Read the Hermes V1 opt-in flag from the apps properties when building from source

Reviewed By: cortinico

Differential Revision: D82018545

fbshipit-source-id: f3c6fdbac190f47b6bf6836105d9e0909d8b86ba
2025-09-10 00:51:41 -07:00
Zeya Peng cf5040b4f8 fix array type parsing in DynamicEventPayload::extractValue (#53689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53689

## Changelog:

[General] [Fixed] - fix array type parsing in DynamicEventPayload::extractValue

When unwrapping event mapping like `e.nativeEvent.touches[0].locationX` e.g. for Animated.event like below,

```
onTouchMove={Animated.event(
  [
    {
      nativeEvent: {
        touches: {
          0: {locationX: animatedValue},
        },
      },
    },
  ],
  {useNativeDriver: true},
)}
```
here it'll throw exception `terminating due to uncaught exception of type folly::TypeError: TypeError: expected dynamic type 'object', but had type 'array'` when getting into folly dynamic array, because array index in the event path is string instead of integer

Reviewed By: rozele

Differential Revision: D82050538

fbshipit-source-id: ed25c8917b90190c995d1fcd6d60af207e72e270
2025-09-09 21:12:26 -07:00
Luna Wei 019a553ea4 Remove enable_eager_alternate_state_node_cleanup param (#53693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53693

Changelog: [Internal] - Remove usage of `enableEagerAlternateStateNodeCleanup`  as it is default true now

Reviewed By: yungsters

Differential Revision: D81962955

fbshipit-source-id: 80b0d9321b1162dd79d052b05acb3dc9459e37d2
2025-09-09 18:46:39 -07:00
generatedunixname89002005287564 2ae5a74f06 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages (#53661)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53661

Reviewed By: javache

Differential Revision: D81764229

fbshipit-source-id: 617716ddb5cf17d41a4927c3a6cce6074278d8b0
2025-09-09 11:37:24 -07:00
generatedunixname537391475639613 3d4a4caac8 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GeneratePackageListTaskTest.kt (#53614)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53614

Reviewed By: javache

Differential Revision: D81764947

fbshipit-source-id: de19d7d89f3a7e19285928f9541b0b47b503d160
2025-09-09 11:34:37 -07:00
Alex Hunt cdc4a8ead4 Wire up background tracing and actions in Perf Monitor (#53460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53460

Completes the first pass of adding background performance trace controls in the V2 Perf Monitor UI.

Key changes:
- Initiates background trace on `PerfMonitorOverlayManager::init`.
- Wires up background trace recording states in button dialog, and connects `pauseAndAnalyzeBackgroundTrace` and `resumeBackgroundTrace` actions.
- Moves UI manager/view classes into `perfmonitor` subpackage.
- Fixes `responsivenessScore` determination/UI coloring.
- Adds tooltip UI to the overlay view.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D80807554

fbshipit-source-id: 53360c2d454adfbba40fd795d400b28d90ff9e61
2025-09-09 10:31:04 -07:00
generatedunixname537391475639613 226d2ba160 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt (#53656)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53656

Reviewed By: cortinico

Differential Revision: D82005918

fbshipit-source-id: 5b0728e68fff865e8a9271c0dfc0a3cc19baa54c
2025-09-09 08:13:12 -07:00
Rubén Norte a16c6c9477 Add feature flag to enable Web Performance APIs by default (#53547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53547

Changelog: [internal]

This creates a new feature flag to enable the modern Web performance APIs in RN by default. It's disabled by default so it shouldn't have any effect at the moment.

Reviewed By: rshest

Differential Revision: D80811430

fbshipit-source-id: 47d5fd12ac8809aa3c5ad37cdd31c0d9e3ed5912
2025-09-09 08:07:31 -07:00
Vitali Zaidman 59b8974d3c changelog/v0.80.0-rc.1 (#53662)
Summary:
Changelog: [Internal]

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

Reviewed By: fabriziocucci

Differential Revision: D82020526

Pulled By: vzaidman

fbshipit-source-id: 43eb1d038f71dbeb30bd1bf4a94779a9fad56215
2025-09-09 07:46:35 -07:00
generatedunixname537391475639613 2c30215bc7 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/core/tests/TestComponent.h (#53658)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53658

Reviewed By: javache

Differential Revision: D81904578

fbshipit-source-id: 03725446586cc206690995f7d2d274c0b1249abe
2025-09-09 04:57:44 -07:00
generatedunixname537391475639613 f568c9b953 xplat/js/react-native-github/packages/gradle-plugin/shared-testutil/src/main/kotlin/com/facebook/react/tests/OsRule.kt (#53655)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53655

Reviewed By: cortinico

Differential Revision: D82008708

fbshipit-source-id: 9ba77512a5e6e7749981726d739d88df287a63d3
2025-09-09 03:42:58 -07:00
25harsh 968909488a fix(iOS): Fix RCTDeviceInfo crash when application.delegate.window is nil (#53645)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

Fixes a crash in `RCTDeviceInfo.interfaceOrientationDidChange` when `application.delegate.window` is nil. This crash affects multiple modern iOS app architectures where the traditional window property may not be set:

- **SwiftUI apps using `main`** instead of traditional AppDelegate
- **Brownfield React Native integrations** where the host app manages windows
- **Scene-based lifecycle apps** (iOS 13+) using SceneDelegate
- **Custom window management** setups

**The Problem:**
```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[MyApp.AppDelegate window]: unrecognized selector sent to instance'
```

This occurs when trying to access `.frame` on a nil window object during orientation changes. Modern iOS development patterns don't always require setting `application.delegate.window`, but React Native's RCTDeviceInfo assumes this property exists.

**The Solution:**
Replace direct `application.delegate.window` access with `RCTKeyWindow()` and add nil-safe fallback:

```objc
// Before (crashes in modern apps)
BOOL isRunningInFullScreen =
    CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);

// After (safe for all app configurations)
UIWindow *delegateWindow = RCTKeyWindow();
BOOL isRunningInFullScreen = delegateWindow ?
    CGRectEqualToRect(delegateWindow.frame, delegateWindow.screen.bounds) : YES;
```

This approach:
- Uses `RCTKeyWindow()` pattern already established elsewhere in RCTDeviceInfo
- Provides safe fallback defaulting to fullscreen when window state is unknown
- Maintains existing multitasking detection behavior (Split View, Slide Over)
- Is backward compatible with traditional React Native apps

## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS][FIXED] - Fix RCTDeviceInfo crash when application.delegate.window is nil in modern iOS app architectures

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

Test Plan:
### Manual Testing

**1. SwiftUI main App Test:**
```bash
# Created SwiftUI app with main lifecycle
# Integrated React Native component
# Result: No crash during orientation changes, fullscreen detection works
 PASS: Orientation changes handled safely
 PASS: Multitasking detection stable
```

**2. Traditional React Native App:**
```bash
# Tested with standard RN template app
# Verified existing behavior unchanged
 PASS: Existing functionality preserved
 PASS: No regressions in dimension reporting
```

**3. Brownfield Integration:**
```bash
# Integrated RN in existing iOS app without window property
# Triggered orientation changes and multitasking transitions
 PASS: No crashes during orientation events
 PASS: Split View and Slide Over work correctly
```

**4. Scene-based Lifecycle App:**
```bash
# Created app using SceneDelegate for window management
# Tested orientation and multitasking scenarios
 PASS: Proper handling when SceneDelegate manages windows
 PASS: No crashes during app lifecycle transitions
```

### Edge Case Testing

**RCTKeyWindow() Returns Nil:**
- Confirmed defaults to `YES` (fullscreen)
- No crashes when no key window available
- Multitasking detection remains stable

**Multiple Window Scenarios:**
- Tested with iPad multiple windows
- Uses correct key window for measurements
- Proper behavior in complex window hierarchies

**Orientation During Transitions:**
- App backgrounding/foregrounding during orientation
- Multitasking mode changes during rotation
- No crashes or inconsistent states

### Automated Testing

```bash
# All existing tests pass
yarn test
 RCTDeviceInfoTests pass

# Code style compliance
yarn lint
 Follows React Native Objective-C guidelines
```

### Impact Verification

**Before Fix:**
- Crash in SwiftUI apps using main
- Crash in Scene-based lifecycle apps
- Crash in brownfield integrations

**After Fix:**
- All app architectures work safely
- Multitasking detection preserved
- Backward compatibility maintained
- No performance impact

Rollback Plan:

Reviewed By: javache

Differential Revision: D81931754

Pulled By: cipolleschi

fbshipit-source-id: c3ea1a2922b1d48ca6bc1fc32861b490322fd254
2025-09-09 02:23:52 -07:00
Alex Hunt e7ce4ff0bf Move NetworkReporter out of jsinspector-modern (#53484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53484

Refactor to better organise network event reporting features.

- Introduce new `ReactCommon/react/networking` package, containing `NetworkReporter` class (outer-most interface with each platform).
    - Move `ReactCommon/performance/timeline` dependency to this level, removing jsinspector→performance dependency.
- Simplifies the remaining `NetworkHandler` in `jsinspector-modern/network` — which now is only focused on CDP network reporting.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D81129562

fbshipit-source-id: 6c36045e872b0fd9510d0fa3e98acb0969e74d72
2025-09-08 13:35:23 -07:00
Riccardo Cipolleschi 49be01add1 Move headers from .h to .mm file (#53617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53617

In the RCTAppDelegate.h file there are a couple of headers that are not used and that can be either removed or moved to the .mm file.
This reduce the coupling between the AppDelegate library and React Core and allow us to reduce the size of the exported headers in the umbrella header.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81769485

fbshipit-source-id: b811dde0331e8a668618e0c8eb250fd81bf48545
2025-09-08 10:27:24 -07:00
Nicola Corti 13120f630d Remove unnecessary extra quote on hermesVersionProvider (#53641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53641

This extra quote is causing the build on the 0.82-stable to fail. The reason is that the Path for the `.hermesversion` file is composed wrongly so we attempt to build hermes from the `main` branch.

Changelog:
[Internal] [Changed] -

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: j-piasecki, vzaidman

Differential Revision: D81925624

fbshipit-source-id: 700f9d44b6c7efdb845232dad8ca7c2e3136385d
2025-09-08 09:09:23 -07:00
Rick Hanlon d0140ce53b enable opt-in for enableDefaultTransitionIndicator (#34373)
Summary:
So we can test the feature.

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

Reviewed By: kassens

Differential Revision: D81599263

fbshipit-source-id: a33ca01250206a2a35350f7fad09e43071522df7
2025-09-08 08:43:40 -07:00
Jakub Piasecki d0fb33822d Check value of the Hermes V1 flag instead of whether it's defined (#53637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53637

Changelog: [ANDROID][FIXED] - Check for the value of the HERMES_V1_ENABLED flag instead of whether it's defined

Reviewed By: cortinico

Differential Revision: D81920483

fbshipit-source-id: 550ae9fd27f666affe102b1c5c3f51bde7b5923e
2025-09-08 07:16:48 -07:00
Rob Hogan 2152180fa0 Minor bump memfs dev dependency (#53628)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53628

Bump the `memfs` dependency used in tests to the latest minor - there have been a considerable number of updates since 4.7 including support for various newer (and some old) Node fs APIs: https://github.com/streamich/memfs/blob/master/CHANGELOG.md

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D81879137

fbshipit-source-id: e75946dac100809cb39c88971fd6ed397dc9f49e
2025-09-08 06:54:09 -07:00
Ramanpreet Nara e7aeea26bd Deprecate legacy javascript apis (#53630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53630

These JavaScript apis were a part of react native's legacy architecture. Let's deprecate them, so that we can eventually remove them in the future.

Changelog: [General][Deprecated] - Deprecate legacy javascript react native apis

Reviewed By: cortinico

Differential Revision: D81795732

fbshipit-source-id: 0a2bd142fa7e08c1f3daaa437ee127a2156e045b
2025-09-08 04:30:21 -07:00
Bartosz Kaszubowski c04248dc5c chore: Add Bluesky badge to README (#53616)
Summary:
Add Bluesky badge to README.

## Changelog:

[INTERNAL][ADDED] Add Bluesky badge to README

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

Test Plan:
The updated README has been checked out on the PR branch.

## Preview:

<img width="1880" height="746" alt="Screenshot 2025-09-05 at 13 00 34" src="https://github.com/user-attachments/assets/dc1dfa9c-9e08-449d-82b8-dcb92ae92268" />

Reviewed By: cipolleschi

Differential Revision: D81909921

Pulled By: cortinico

fbshipit-source-id: b5fa79f152f126944bc1c31c8fbb86889f0f25db
2025-09-08 03:48:46 -07:00
Nick Lefever 02e3a999ed Back out "Use uint32_t as internal Color representation" (#53622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53622

Reverting to avoid lossy conversion on hosts expecting signed int values for color conversion.

Changelog: [Internal]

Reviewed By: rozele, javache

Differential Revision: D81785268

fbshipit-source-id: 4a8d099e378fa55e76a58c2ab0356d88e344de2c
2025-09-05 20:37:58 -07:00
Mark Verlingieri 44b2da0df2 Revert D81766029: Make feature flag "enableViewRecyclingForScrollView" true by default
Differential Revision:
D81766029

Original commit changeset: df4a260b9bde

Original Phabricator Diff: D81766029

fbshipit-source-id: f1cd2a2cef632cfe9cbf0cd13e9ec20cfa5cc6ae
2025-09-05 11:58:48 -07:00
Zeya Peng dae2f606c7 Course correct props at SurfaceMountingManager.updateProps() (#53589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53589

## Changelog:

[Android] [Changed] - [c++ animated] Course correct props at SurfaceMountingManager.updateProps()

Sometimes a React update will try to commit to the same view that native animated modified before via direct manipulation, and after the update host view will use the prop value currently in Fabric. In `AnimatedMountingOverrideDelegate` there's logic to course correct at ShadowTree mount, but if this update is from JS thread, it takes some time to reach mounting layer, at the same time UI thread can still be doing more direct animation updates, and once the corrected change gets there it's already stale.

In this diff I added mechanism to keep track of direct manipulation props (or "synchronous mount props" to match the naming of java function `synchronouslyUpdateView...`) and use it to correct what reaches host view. `SurfaceMountingManager.updateProps()` is called by both regular mount and direct manipulation and it's always called on UI thread, so it could be a good candidate to synchronize these 2 scenarios

Reviewed By: sammy-SC

Differential Revision: D81611823

fbshipit-source-id: 638a59bcd94b3d7e8bab68defd472b2b482dc92f
2025-09-05 09:18:50 -07:00
Zeya Peng 5774bd105d create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid (#53603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53603

## Changelog:

[General] [Added] - create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid

Reviewed By: rshest

Differential Revision: D81690079

fbshipit-source-id: cb381004135ef9cd072c6f99703d9e7f4a40dd6a
2025-09-05 09:18:50 -07:00
generatedunixname89002005287564 3a3f3a417d Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages [B] (#53611)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53611

Reviewed By: rshest

Differential Revision: D81699709

fbshipit-source-id: 6f512fcc01e3f1d33b4e94c4766ee3ab759463e5
2025-09-05 06:37:04 -07:00
Ruslan Shestopalyuk 71edbe1548 Make feature flag "enableViewRecyclingForScrollView" true by default
Summary:
## Changelog:
[Internal] -

Noticed that the default value for this one is inconsistent with all the other similar ones, which can cause confusion during setting up the experiment, fixing it.

Note that top level view recycling is still controlled via `enableViewRecycling`, which will also disable all the other ones when false (which it is by default).

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D81766029

fbshipit-source-id: df4a260b9bde20d1c85b7786df00fa91298a27b7
2025-09-05 06:01:47 -07:00
generatedunixname89002005287564 f6a4f24090 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages [A] (#53612)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53612

Reviewed By: rshest

Differential Revision: D81699159

fbshipit-source-id: b711e066b206d70ec40570b63dd1290d800e531f
2025-09-05 03:05:35 -07:00
Jakub Piasecki 1be852781d Add tests for isHermesV1Enabled (#53601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53601

Changelog: [Internal]

Adds tests covering the `isHermesV1Enabled` utility function.

Reviewed By: cortinico

Differential Revision: D81681635

fbshipit-source-id: c2c50db65f93b8b58ce1730ccfdf4367a024ce7b
2025-09-04 23:31:08 -07:00
Tim Yung a50ddf3d8e JS: Upgrade to signedsource@2.0.0 (#53606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53606

Upgrades projects to `signedsource@2.0.0`, which includes a critical bug fix to the `isSigned` and `signFile` functions:

```lang=diff
isSigned(data) {
-  return !PATTERN.exec(data);
+  return PATTERN.exec(data) != null;
},
```

Changelog:
[Internal]

Reviewed By: bvanderhoof, jehartzog

Differential Revision: D81723007

fbshipit-source-id: 0606eef35df1e5ec988b537aa012bc2c6d3c2d3a
2025-09-04 19:12:08 -07:00
Sam Zhou 020c92efac Deploy 0.281.0 to xplat (#53607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53607

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

Reviewed By: gkz

Differential Revision: D81728906

fbshipit-source-id: 161eb62d7520398c97f05db40676e1ea2ac4d0a9
2025-09-04 16:51:26 -07:00
Gang Zhao d7315563fe Allow ReactInstance to evaluate SH unit when possible (#53471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53471

When IHermes::getSHUnitCreator() returns non-null pointer, call
`evaluateSHUnit()` on that instead of `evaluateJavaScript()`.

Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D80916868

fbshipit-source-id: 9c1e2327b720cab4b374d4752a9c64f87c592ad6
2025-09-04 16:27:46 -07:00
Moti Zilberman 1f57ae5249 Distribute React Native DevTools binaries via GitHub Releases (#52930)
Summary:
bypass-github-export-checks

OSS release infrastructure for the (experimental) React Native DevTools standalone shell.

Currently, binaries are built continuously on Meta infra and served from the Meta CDN using fbcdn.net URLs checked into a DotSlash file in the repo, e.g.:

https://github.com/facebook/react-native/blob/15373218ec572c0e43325845b80a849ad5174cc3/packages/debugger-shell/bin/react-native-devtools#L9-L18

For open source releases we want to primarily distribute the binaries as GitHub release assets, while keeping the Meta CDN URLs as a secondary option. This PR makes the necessary changes to the release workflows to support this:

* `workflows/create-release.yml` (modified): As part of the release commit, rewrite the DotSlash file to include the release asset URLs.
  * **NOTE:** After this commit, **the new URLs don't work yet**, because they refer to a release that hasn't been published. Despite this, the DotSlash file remains valid and usable (because DotSlash will happily fall back to the Meta CDN URLs, which are still in the file).
* `workflows/create-draft-release.yml` (modified): After creating a draft release, fetch the binaries from the Meta CDN and reupload them to GitHub as release assets. This is based on the contents of the DotSlash file rewritten by `create-release.yml`.
* `workflows/validate-dotslash-artifacts.yml` (new): After the release is published, all URLs referenced by the DotSlash (both Meta CDN URL and GH release asset URLs) should be valid and refer to the same artifacts. This workflow checks that this is the case.
  * If this workflow fails on a published release, the release may need to be burned or a hotfix release may be necessary - as the release will stop working correctly once the Meta CDN stops serving the assets.
  * This workflow will also be running continuously on `main`. If it fails on a commit in `main`, there might be a connectivity issue between the GHA runner and the Meta CDN, or there might be an issue on the Meta side.

NOTE: These changes to the release pipeline are generic and reusable; if we later add another DotSlash-based tool whose binaries need to be mirrored as GitHub release assets, we just need to add it to the `FIRST_PARTY_DOTSLASH_FILES` array.

## Changelog:

[Internal] Mirror React Native DevTools binaries in GitHub Releases

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

Test Plan:
### Step 0: Unit tests

I've added unit tests for `dotslash-utils`, `curl-utils`, and for the majority of the logic that makes up the new release scripts (`write-dotslash-release-assets-urls`, `upload-release-assets-for-dotslash`, `validate-dotslash-artifacts`).

### Step 1: Test release commit

Created a test branch and draft PR: https://github.com/facebook/react-native/pull/53147.

Locally created a release commit, simulating the create-release GH workflow:

```
node scripts/releases/create-release-commit.js --reactNativeVersion 0.82.0-20250903-0830 --no-dry-run
```

This updated the DotSlash file in the branch: https://github.com/facebook/react-native/pull/53147/commits/2deeb7e70376ee80b99f27bea4825789f22a89a3#diff-205a9ff6005e30be061eaa64b9cb50b15b0e909dd188e0866189e952655a3483

NOTE: I've also ensured that the `create-release-commit` script correctly updates the DotSlash file when running from a branch that already has a release commit - see screenshot:
<img width="1483" height="587" alt="image" src="https://github.com/user-attachments/assets/1ffd859b-e02b-483d-8067-9cc9116829a4" />

### Step 2: Test draft release

Enabled testing the create-draft-release GH workflow in the test branch using these temporary hacks:

* https://github.com/facebook/react-native/pull/53147/commits/81f334eac5147d4dbf5f6d7d627ddfa52cd197be
* https://github.com/facebook/react-native/pull/53147/commits/6d8851657629de7e0b710ed8f5dd7d0f7b9847cc
* https://github.com/facebook/react-native/pull/53147/commits/1428a8da8b9fb29c45fc33d79f311dd1fe273433

Workflow run: https://github.com/facebook/react-native/actions/runs/17426711373/job/49475327346
Draft release: https://github.com/facebook/react-native/releases/tag/untagged-c6a62a58e5baa37936e1
Draft release screenshot for posterity (since we'll likely delete the draft release after landing this):

<img width="1024" height="814" alt="image" src="https://github.com/user-attachments/assets/1900da15-48f6-4274-b29c-0ac2019d92c0" />

### Step 3: Test post-release validation script

For obvious reasons, I've avoided actually publishing the above draft release. But I have run the `validate-dotslash-artifacts` workflow on the *current* branch to ensure that the logic is correct: https://github.com/motiz88/react-native/actions/runs/17426885205/job/49475888486

Running `node scripts/releases/validate-dotslash-artifacts.js` in the release branch (without publishing the release first) fails, as expected:

<img width="1105" height="748" alt="image" src="https://github.com/user-attachments/assets/ed23a2e2-7a31-42eb-a324-f1d50eafe2fb" />

## Next steps

This PR is all the infra needed ahead of the 0.82 ~~branch cut~~ infra freeze to support the React Native DevTools standalone shell, at least on the GitHub side. ~~Some minor infra work remains on the Meta side, plus some product/logic changes to the React Native DevTools standalone shell that I'm intending to finish in time for 0.82 (for an experimental rollout).~~ EDIT: All the planned work has landed; the feature is code-complete on `main` as well as in `0.82-stable` (apart from this infra change).

As a one-off, once we've actually published 0.82.0-rc.1, we'll want to have a human look at the published artifacts and CI workflow logs to ensure everything is in order. (I'll make sure to communicate this to the 0.82 release crew.) Afterwards, the automation added in this PR should be sufficient.

Reviewed By: huntie

Differential Revision: D81578704

Pulled By: motiz88

fbshipit-source-id: 6a4a48c3713221a89dd5fc88851674c1ddc6bb10
2025-09-04 11:25:39 -07:00
Vitali Zaidman 47f32ffae0 add comments regarding RCTPackagerConnection's reconnect (#53558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53558

Changelog: [Internal]
Got confused regarding why "reconnect" does not actually trigger a reconnect. It turns out, it only triggers a reconnect if the URL has changed.

Reviewed By: cipolleschi, huntie

Differential Revision: D80629308

fbshipit-source-id: 098ef5e91f3748deb9bc707b79bc0395d2442ca4
2025-09-04 10:00:18 -07:00
Ruslan Shestopalyuk 0a3b3fcd18 Add RN feature flag for Image view recycling (#53600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53600

# Changelog:
[Internal] -

Adds the corresponding feature flag, similarly as it's done for other component types.

The flag is used in the next diff.

Reviewed By: mdvacca

Differential Revision: D81681404

fbshipit-source-id: f9f155379034695f5df6cc4f0d3787ff4c69df7f
2025-09-04 09:47:15 -07:00
Vitali Zaidman 2b4c48ae47 export Logger type from dev-middleware (#53586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53586

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D81588537

fbshipit-source-id: e6537dd831cfb73ce93326e2e0c0a2bcd3929caa
2025-09-04 08:13:04 -07:00
Jakub Piasecki 2e0bd13a25 Use hermesc from node_modules when consuming prebuilt hermes (#53581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53581

Changelog: [General][Changed] - Changed the source of hermesc binary to be an npm package

Reviewed By: cipolleschi, cortinico

Differential Revision: D81224001

fbshipit-source-id: 552d0e66fb891974d7b688bfc0bec95e19345d86
2025-09-04 07:42:12 -07:00
Jakub Piasecki 3e9990f860 Allow to opt-in to use the new Hermes on Android (#53580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53580

Changelog: [ANDROID][ADDED] Added opt-in to use the new Hermes

Reviewed By: cortinico

Differential Revision: D81035114

fbshipit-source-id: d01e44190941d161cf641ec4e03ed487aff18dd8
2025-09-04 07:42:12 -07:00
Jakub Piasecki e9cdc308b4 Allow to opt-in to use the new Hermes on iOS (#53579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53579

Changelog: [IOS][ADDED] Added opt-in to use the new Hermes

Reviewed By: cipolleschi

Differential Revision: D81035113

fbshipit-source-id: b12ca68824ec4e736edd4393a93c28803312eb32
2025-09-04 07:42:12 -07:00
Jakub Piasecki 30432addfb Gate legacy debugger behind a preprocessor directive (#53578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53578

Changelog: [Internal]

Adds a new preprocessor directive which should be set when the new Hermes is being used. This directive will disable the legacy debugger which isn't supported by it.

Reviewed By: cipolleschi, cortinico

Differential Revision: D81035112

fbshipit-source-id: b30ae348b3419ec2d064dfe7f91c9d664a66f5cf
2025-09-04 07:42:12 -07:00
Andrew Datsenko 10a46f7b52 Add support for JS coverage (#53410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53410

Changelog: [Internal]
Adding babel-istanbul-plugin to instrument bundle code with coverage reporting.
Metro will transform source code only when coverage flag is set up globally in jest.
Coverage map is then provided by runner as part of test result.

Reviewed By: sammy-SC

Differential Revision: D80716433

fbshipit-source-id: 3831f227f8793f874f0d2366759bb6916e747c72
2025-09-04 07:19:56 -07:00
generatedunixname89002005287564 8d33e1c205 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53593)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53593

Reviewed By: rshest

Differential Revision: D81573635

fbshipit-source-id: a367572b7d2b3a9422e47fa05d3c001e607ec0e3
2025-09-04 04:01:12 -07:00
generatedunixname89002005287564 95b187bb37 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53596)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53596

Reviewed By: rshest

Differential Revision: D81574342

fbshipit-source-id: 9423d3341a9c349d7e7519b5acb7ee41f6ceb2b3
2025-09-04 03:56:08 -07:00
generatedunixname537391475639613 7a4d5ad644 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt (#53597)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53597

Reviewed By: cortinico

Differential Revision: D81662100

fbshipit-source-id: f41c89a059dd0d8e312e5edc07172e1d8cac6597
2025-09-04 03:49:37 -07:00