Compare commits

...
Author SHA1 Message Date
React Native Bot 57ff54492f Release 0.81.5
#publish-packages-to-npm&0.81-stable
2025-10-21 16:14:43 +00:00
Janic DuplessisandGitHub 34137a82ca Allow extending ReactTextViewManager (#53980) 2025-10-21 15:22:09 +02:00
25harshandReact Native Bot cf598f523b 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-10-20 13:41:47 +00:00
lukmccallandReact Native Bot 447a7a3527 Fix request permission is not always resolving in Android 16 (#53898)
Summary:
Fixes: https://github.com/facebook/react-native/issues/53887
Fixes: https://github.com/expo/expo/issues/39480

In the latest Android 16 update, requesting permissions does not always change the app's state (the `onPause` and `onResume` functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside the `ReactActivityDelegate` assumes that Android will call `onResume` after receiving permission state information from the system, which is no longer the case.

Probably connected with [this commit](https://android.googlesource.com/platform/packages/modules/Permission/%2B/5dca0ccb26f2b99d706a1d3e9402f851e849c913)

## Changelog:

[ANDROID] [FIXED] - Fix request permission not always resolving in Android 16

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

Test Plan:
- I've tested it in the RNTester by denying the camera permission three times.
- I've also checked if the patch works with the Expo permissions code.

Reviewed By: javache

Differential Revision: D83059478

Pulled By: cortinico

fbshipit-source-id: 7bf33b379a1b6606ad2da2f75d337bf951e3986b
2025-10-20 13:33:57 +00:00
Riccardo CipolleschiandGitHub 4106d54a6d fixed switch (#54155) 2025-10-20 15:28:01 +02:00
Christian FalchandReact Native Bot 779c768b6e fixed cp command to work with gnu coreutils (#54063)
Summary:
When using gnu coreutils, installation of ReactNativeDependenices on iOS fails at compile time with errors like in the following issue (in the Expo repo):

https://github.com/expo/expo/issues/38992

This is caused by a missing `.` in the end of the path name that the built-in MacOS cp command handles well, but that will create an extra Headers folder when using cp from gnu coreutils.

This commit fixes this by adding the missing `.`

## Changelog:

[IOS] [FIXED] - Fixed issue when using gnu coreutils cp command when using precompiled binaries causing compilation error

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

Test Plan:
- Verify that you're running gnu coreutils (`cp --version`)
- Create new expo app `npx create-expo-app`
- Build on iOS - should error without this fix, should work with the fix.

Reviewed By: christophpurrer

Differential Revision: D83964083

Pulled By: javache

fbshipit-source-id: 46dc074ca9b7fc97fa5a37ef48d68a895e3310ff
2025-10-20 13:24:07 +00:00
Pieter De BaetsandReact Native Bot 20e8bf3950 Fix useNativeTransformHelper behaviour when frame size is 0 (#53978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53978

Inconsistency between the previous and old version of `processTransform` - if frameSize is 0, the transform was being ignored, which is not correct when considering a fixed transform origin and a rotation animation for example. Instead, always apply the transform origin if it's set.

Changelog: [Android][Fixed] Fixed representation of transforms when view is originally zero-sized

Reviewed By: mdvacca

Differential Revision: D83469083

fbshipit-source-id: e9ae1500f64c700708edb00b2d5871e3f224fb07
2025-10-20 13:20:31 +00:00
Nicola Corti e7e32f70b0 [LOCAL] Use REACT_NATIVE_BOT_GITHUB_TOKEN token for changelog and bump lockfiles 2025-09-17 11:45:38 +01:00
Gabriel Donadel 4a27725362 Update Podfile.lock
Changelog: [Internal]
2025-09-10 15:33:11 -03:00
React Native Bot 5cb9187034 Release 0.81.4
#publish-packages-to-npm&0.81-stable
2025-09-10 13:51:32 +00:00
Phil PluckthunandReact Native Bot c3149f22a0 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 12:30:45 +00:00
Phil PluckthunandReact Native Bot bb73315a3f Use autolinking react-native-config output in iOS artifacts generator (#53503)
Summary:
Resolves https://github.com/facebook/react-native/issues/53501

This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.

The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.

Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.

This doesn't affect Android/Gradle, which are implemented correctly.

[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source

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

Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
  - Note: Contains this PR's changes as a patch
  - `bun install`
  - `bun expo run:ios`

Reviewed By: cortinico

Differential Revision: D81490755

Pulled By: cipolleschi

fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
2025-09-10 11:59:04 +00:00
Gabriel Donadel 97b23a3462 Update Podfile.lock
Changelog: [Internal]
2025-09-09 23:54:29 -03:00
React Native Bot 503f0e9ec9 Release 0.81.3
#publish-packages-to-npm&0.81-stable
2025-09-10 00:51:28 +00:00
Gabriel Donadel 537e3ad930 Revert "Use autolinking react-native-config output in iOS artifacts generator (#53503)"
This reverts commit a2eb29e5e7.
2025-09-09 19:14:11 -03:00
Gabriel Donadel 63619bcbad Update Podfile.lock
Changelog: [Internal]
2025-09-09 19:13:29 -03:00
React Native Bot 65119b0107 Release 0.81.2
#publish-packages-to-npm&0.81-stable
2025-09-09 16:43:27 +00:00
a346096da8 [0.81] Backport useNativeEqualsInNativeReadableArrayAndroid and useNativeTransformHelperAndroid in the experimental channel (#53567)
* Use native implementation of equals in ReadableNativeArray (#52611)

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

We compare the current transform (represented as a ReadableArray) with the incoming one to know whether to invalidate. This can be expensive as it requires to materialize the entire transform data structure over JNI. Instead, we can delegate this comparison to native code, which can compare the underlying folly::dynamic directly.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78340288

fbshipit-source-id: f44a054e234694c316fb080fe2dbc2017780123a

* Use native helpers to accelerate transform processing (#52603)

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

Processing transforms is expensive in Java, as it requires bridging the entire ReadableNativeArray/Map. Instead, we can use the existing parser logic `resolveTransform` logic to perform this operation in C++.

Ideally, we actually re-use the existing parsed transform from Props, that could be something we revisit after Props 2.0.

As a follow-up, we should consider also moving the matrix decomposition logic from MatrixMathHelper here, and make that the only information we send back to Java.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78298588

fbshipit-source-id: a698ac8587ccfb2be04665747082398ccdde9294

* Add TransformHelper.cpp to `reactnativejni_common` (#52640)

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

Not having `TransformHelper.cpp` included in CMake is causing the C++ code to fail compiling.
This diff fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi, javache

Differential Revision: D78414015

fbshipit-source-id: 4900427a86eb38bfec10e5e385296d89c73e9051

* [LOCAL] Unbreak compilation due to CMake dependencies

---------

Co-authored-by: Pieter De Baets <pieterdb@meta.com>
2025-09-09 15:25:02 +02:00
Nicola CortiandGitHub ed92bd67f4 [0.81] Backport: Create a debugOptimized buildType for Android (#53568)
* Migrate RNTester to use `{usesCleartextTraffic}` Manifest Placeholder (#52620)

Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

## Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

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

Test Plan:
Tested locally with RNTester by doing:

```
./gradlew installDebugOptimized
```

This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:

<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />

Rollback Plan:

Reviewed By: cipolleschi

Differential Revision: D78351347

Pulled By: cortinico

fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54

* Create a debugOptimized buildType for Android (#52648)

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

This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

Reviewed By: cipolleschi

Differential Revision: D78425138

fbshipit-source-id: c1e9ea3608e7df10fb871a5584352f0747cf560b
2025-09-09 15:22:13 +02:00
Phil PluckthunandReact Native Bot 366f2ad505 Replace execSync with spawnSync for tarball extraction paths that need to be escaped (#53540)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53194

This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds.

When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes.

That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically.

## Changelog:

[IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces

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

Test Plan: - Create a project in a folder `with spaces` and build a release build

Reviewed By: cipolleschi, cortinico

Differential Revision: D81406841

Pulled By: robhogan

fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
2025-09-09 13:09:05 +00:00
Phil PluckthunandGabriel Donadel a2eb29e5e7 Use autolinking react-native-config output in iOS artifacts generator (#53503)
Summary:
Resolves https://github.com/facebook/react-native/issues/53501

This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.

The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.

Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.

This doesn't affect Android/Gradle, which are implemented correctly.

[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source

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

Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
  - Note: Contains this PR's changes as a patch
  - `bun install`
  - `bun expo run:ios`

Reviewed By: cortinico

Differential Revision: D81490755

Pulled By: cipolleschi

fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
2025-09-09 10:05:03 -03:00
Fabrizio Cucci cc493fc8ff Update Podfile.lock
Changelog: [Internal]
2025-09-01 10:47:12 +01:00
React Native Bot 277a075b71 Release 0.81.1
#publish-packages-to-npm&latest
2025-08-27 14:32:35 +00:00
Phil PluckthunandReact Native Bot 03952ba3df Fix missing path escape patterns in Xcode scripts for projects with spaces (#53194)
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with`

This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.

## Changelog:

[IOS] [FIXED] - fix scripts for paths containing whitespaces

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

Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too)

Reviewed By: robhogan

Differential Revision: D79993537

Pulled By: cipolleschi

fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
2025-08-27 11:34:52 +00:00
riteshshukla04andReact Native Bot 8ace21f157 Fix: Setting maxLength to 0 in TextInput still allows typing on iOS (#52890)
Summary:
Trying to fix https://github.com/facebook/react-native/issues/52860
## 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] Setting maxLength to 0 in TextInput still allows typing on iOS

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

Test Plan:
https://github.com/user-attachments/assets/56549e0f-6bbf-461e-815c-794abdee2018

Tested on Android too

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D80095701

Pulled By: cipolleschi

fbshipit-source-id: 5e76f88798e32097e6a619c44ff6240b4f01fc6f
2025-08-27 11:28:44 +00:00
Riccardo CipolleschiandGitHub dffbfe6fd9 [LOCAL] Fix Switch layout for iOS 26 (#53389)
* Fix Switch layout with iOS26 (#53247)

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

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).

The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.

[iOS][Fixed] - Fix Switch layout to work with iOS26

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

Test Plan:
Tested locally with RNTester.

| iOS Version | Before | After |
| --- | --- | --- |
| < iOS 26 | https://github.com/user-attachments/assets/91d73ea3-30ba-4a5c-948e-ea5c63aa7c6d | https://github.com/user-attachments/assets/76061bc8-0f14-412a-a8fb-d1c3951772e6 |
| >= iOS 26 | https://github.com/user-attachments/assets/1abc477f-bc0a-4762-938e-98814fb2a054 | https://github.com/user-attachments/assets/77e562e1-b803-46ac-9cf6-102f062a1cd4 |

Rollback Plan:

Reviewed By: sammy-SC

Differential Revision: D79653120

Pulled By: cipolleschi

fbshipit-source-id: d99b353b7b7b5496b148779de4abe3e57dd38156

* feat: update js layout

* fix crash for feature flag
2025-08-27 12:27:24 +01:00
Riccardo Cipolleschi 6da5e66522 [LOCAL] Bump Podfile.lock 2025-08-27 12:26:01 +01:00
Christian FalchandRiccardo Cipolleschi ba221e1015 Fix copy symbol files in RNDeps precompile (#53353)
Summary:
Symbol files wasn't copied correctly when building - as with bundles we did overwrite the files and ended up with only the last symbol file.

This commit fixes this by mapping the framework build folder architecture type to the xcframework slices creating the correct file structure under the Symbols folder.

- Each slice gets a folder with the architecture name under Symbols containing the dSym folder for that slice
- Refactored getting correct architecture folder into a separate function.
- Refactored target folder lookup in copyBundles
- Removed unused async modifier on function

## Changelog:

[IOS] [FIXED] - Fixed how we copy and build the Symbols folder when precompiling ReactNativeDependencies

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

Test Plan: Run nightlies and verify that ReactNativeDependencies.framework.dSym files contains symbol files for all architectures.

Reviewed By: cortinico

Differential Revision: D80692019

Pulled By: cipolleschi

fbshipit-source-id: 77983bc29d1965edf3bc0fcbd9cb3177071991d3
2025-08-27 12:22:17 +01:00
7d4196cf05 fix(codegen): fix missing dependencies (#52884) (#53478)
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.

Resolves https://github.com/facebook/react-native/issues/52883

## Changelog:

[GENERAL] [FIXED] - Add missing Babel dependencies

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

Test Plan: See https://github.com/facebook/react-native/issues/52883

Reviewed By: cortinico, christophpurrer

Differential Revision: D79103092

Pulled By: robhogan

fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434

Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
2025-08-27 10:55:47 +01:00
Christian FalchandReact Native Bot 495b307ad5 Use correct version of jsi.cpp (#53266)
Summary:
When building the xcframeworks on iOS we're including the file `jsi/jsi.cpp` in the Swift Package. This file is also included in Hermes and React Native should use the hermes version of these symbols. This is even described (but overlooked) in the React-jsi podspec file.

This causes the error seen in the bug addressed by this commit.

The fix is to exclude the `jsi/jsi.cpp` file from the jsi target in our swift package.

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

## Changelog:

[IOS] [FIXED] - Fixed wrong jsi symbols in use when using React.xcframework

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

Test Plan: Tested using a precompiled xcframework in the reproduction repository.

Reviewed By: rshest

Differential Revision: D80252131

Pulled By: cipolleschi

fbshipit-source-id: 915e94a1d80c2f45575e58d8054239484e861285
2025-08-27 09:44:34 +00:00
Christian FalchandReact Native Bot cfd06d8f08 fixed copying bundles correctly (#53325)
Summary:
When copying bundle files from the platform folders in the .build output, the script had a bug where all bundles were copied - meaning that only the last one would be in the resulting xcframework output.

This caused an issue when we tried to publish an app built with precompiled binaries to AppStore where the field `CFBundleSupportedPlatforms` was wrong and caused the submission to be rejected. This was caused by the script copying the wrong bundle file into the final xcframework outputs.

This issue is described here:
https://github.com/react-native-community/discussions-and-proposals/discussions/923#discussioncomment-14089245

This commit fixes the above error by using the iOS 15 `vtool` to show the actual platform for a given framework and then making sure we don't copy bundles in the wrong way.

Testing this on my local machine for iOS/iOS-simulator/MacOS/catalyst yields the following results (before/after this fix):

**Before:**

```bash
Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
```

  **After:**

```bash
  Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
```

## Changelog:

[IOS] [FIXED] - Fixed copying bundles correctly to xcframeworks when precompiling ReactNativeDependencies.xcframework

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

Test Plan: Ensure that the info.plist files in the nightlies for the ReactNativeDepdendencies.xcframework has the correct bundles for its targets.

Reviewed By: andrewdacenko

Differential Revision: D80457335

Pulled By: cipolleschi

fbshipit-source-id: aeb4166f66218f72bdd29b6fc579fcc7b6d12844
2025-08-27 09:44:00 +00:00
Christian FalchandReact Native Bot f21d4151d0 aligned symbol folders with RNdeps (#53354)
Summary:
After fixing an isssue with ReactnativeDependencies and how it built symbols (https://github.com/facebook/react-native/issues/53353) this commit will align the output of the Symbols folder for the two frameworks.

Previously we had an output in the Symbols folder that looked like this (from a local build on my machine)

- catalyst
- iphone
- iphonesimulator

After this we now have the more correct arcitecture names on these folders:

- ios-arm64
- ios-arm64_x86_64-simulator
- ios-arm64_x86_64-maccatalyst

This is in line with how the ReactNativeDependencies Symbol folder is set up.

## Changelog:

[IOS] [FIXED] - Aligned Symbols folder in React.xcframework symbols with ReactNativeDependencies.xcframework symbols.

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

Test Plan: Nightlies

Reviewed By: cortinico

Differential Revision: D80692098

Pulled By: cipolleschi

fbshipit-source-id: e952b087d5dbdeb929b45d9e6d3d7e077c9d05cc
2025-08-27 09:42:39 +00:00
Christian FalchandReact Native Bot fcb86cca4e add SWIFT_ENABLE_EXPLICIT_MODULES to xcode 26 (#53457)
Summary:
XCode 26 introduces building explicit swift modules turned on (SWIFT_ENABLE_EXPLICIT_MODULES). This breaks building with precompiled binaries.

This commit fixes this by adding a step when not building from source where we explicitly set the `SWIFT_ENABLE_EXPLICIT_MODULES` flag to `NO`.

## Changelog:

[IOS] [FIXED] - Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26

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

Test Plan:
```bash
npx react-native-community/cli init MyApp --version nightly --skip-install
cd MyApp
yarn
cd ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Build above app with Xcode 26 and verify that it no longer fails

Reviewed By: motiz88

Differential Revision: D81025367

Pulled By: cipolleschi

fbshipit-source-id: 1db7c4d7de07d62f43b355aa784d7d9de478023c
2025-08-27 09:42:24 +00:00
Vojtech NovakandReact Native Bot e6e814cfc5 fix cp command in ReactNativeDependencies.podspec (#53136)
Summary:
When running `RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 pod install` I'm getting an error: `cp: framework/packages/react-native/..: File exists`

This is not seen consistently by everyone but I've seen in reported one more time at Expo. Could be related to running MacOS 26.

Somehow, apparently, the `..` is being treated as a literal directory name and cp is trying to create a directory named `..` inside `framework/packages/react-native/` which is not what we want. Using `/.` avoids that.

 ---
What also seemed to work(around) was to change `mkdir -p framework/packages/react-native` to `mkdir -p framework/packages/` and then `cp` can create the `framework/packages/react-native/..` folder. But this is definitely more confusing.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - fix "file exists" error in `ReactNativeDependencies.podspec`

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

Test Plan: tested locally, and in CI on older macOS: https://github.com/expo/expo/pull/38631 (the ios build succeeds)

Reviewed By: rshest

Differential Revision: D79990895

Pulled By: cipolleschi

fbshipit-source-id: 44ff9034800d3acd4e55ec39aabfb326382372cb
2025-08-27 09:34:13 +00:00
Maciej JastrzębskiandReact Native Bot 1ca723220d fix(a11y): TextInput aria-label handling (#53051)
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.

This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL] [FIXED] - a11y: fix `aria-label` on `TextInput`

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

Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.

iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c

iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d

Reviewed By: andrewdacenko

Differential Revision: D79635413

Pulled By: rshest

fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
2025-08-27 09:28:29 +00:00
Sharif MahmoudandReact Native Bot 4c781e4fbd Fix HEADER_SEARCH_PATHS for RuntimeExecutor when USE_FRAMEWORKS is enabled (#53099)
Summary:
`#include <ReactCommon/RuntimeExecutor.h>` stopped working in react-native 0.81 when using frameworks because it is not part of ReactCommon anymore when the split happened for iOS.

to fix this I am including RuntimeExecutor in search headers same way we include ReactCommon.

## Changelog:

[IOS] [FIXED] - Fix import RuntimeExecutor.h with USE_FRAMEWORKS

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

Test Plan:
You can enable USE_FRAMEWORKS and do `#include <react/renderer/uimanager/UIManager.h>` (which react-native-reanimated is doing).
Build will fail complaining that it can't find ReactCommon/RuntimeExecutor.h which is included in UIManager.h
Add my patch, it will work and build successfully

Reviewed By: cortinico

Differential Revision: D79796637

Pulled By: cipolleschi

fbshipit-source-id: f8bb669cfb9f4414653655ed98d2cc6bb431a3e5
2025-08-27 09:27:57 +00:00
Phil PluckthunandReact Native Bot 5f7542d3a0 Mark @react-native/metro-config as optional peer to fix warning (#53314)
Summary:
The `react-native/metro-config` peer was added in https://github.com/facebook/react-native/commit/fe2bcbf4ba7ce983fac0cd09727c165517b6337f / https://github.com/facebook/react-native/issues/51836 by robhogan

Side-note: It's pulled in via `react-native/community-cli-plugin` which is a direct dependency of `react-native` for the `scripts/bundle.js` script. While, for expo, we'd love to find a way to make this an optional dependency (to avoid excessive deps that `expo` replaces otherwise), for now, it's a direct dependency.

The problem here is that this isn't optional, which means:
- with auto-installing peer dependencies it is directly fulfilled (while `react-native-community/cli` is already marked as optional and skipped)
- with legacy/non-auto peer-dependencies it is flagged as missing, but in an Expo project it wouldn't make sense to install directly

This causes a **package manager regression in the form of either a peer dependency warning**, that shouldn't be fulfilled in an Expo project, or (in the best case scenario) pulls in dependencies [that a user does not need](https://npmgraph.js.org/?q=%40react-native%2Fmetro-config#zoom=w&select=exact%3A%40react-native%2Fmetro-config%400.81.0).

An error message is already in place to inform the user of this being missing when it's not installed, so marking it as optional seems appropriate.

## Changelog:

[INTERNAL] [FIXED] Mark added `react-native/metro-config` peer dependency as optional

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
Warnings like the following won't occur in fresh Expo (54/preview/`next`) projects
```
warning "workspace-aggregator-484d9ec3-587b-43cb-97de-4dcce3876578 > microfoam-mobile > react-native > react-native/community-cli-plugin@0.81.0" has unmet peer dependency "react-native/metro-config@*".
```

Reviewed By: cortinico

Differential Revision: D80450287

Pulled By: robhogan

fbshipit-source-id: c622fd4c24025676c0ec74de826f863f1e291669
2025-08-27 09:26:36 +00:00
6526a98d68 [iOS][precompile] Support dynamic static linkage with prebuilts (#53477)
* [ios][precompile] Add use_frameworks resolve method

To be able to handle cocoapods USE_FRAMEWORKS with both dynamic/static linkage and precompiled we needed a common way to resolve this.

The issue was that when using precompiled and USE_FRAMEWORKS our precompiled framework caused the resulting Pods project to only include header files - hence there where no need to change the header_mappings_dir which a lot of the podspecs did.

A method was added that handles this in a common way.

* [ios][precompile] added resolve_use_frameworks to podspecs

Replaced logic for resolving header mappings and module name using the new method `resolve_use_frameworks` in all podspecs.

Also added `React-oscompat` dependency on `React-jsiinspector_modern` which failed when linkage was "dynamic".

* [ios][precompile] added explicit handling of ReactCoden

When using precompiled and building with frameworks (USE_FRAMEWORKS) we need to explicitly add the correct path to ReactCodegen when calling `create_header_search_path_for_frameworks` to ensure libraries can access their codegen files.

This commit adds an explicit check to make sure we add the correct path when using frameworks and the pod is ReactCodegen.

Added includes in the NativeCXXModuleExample.cpp file to test this.

* Update packages/react-native/scripts/cocoapods/utils.rb

Co-authored-by: Riccardo Cipolleschi <cipolleschi@meta.com>

* codereview: removed test include files

* codereview: fixed issue in ruby.rb

After a github `suggestion` we had a superfluous `end`. Sorry for that.

---------

Co-authored-by: Christian Falch <christian.falch@gmail.com>
Co-authored-by: Christian Falch <875252+chrfalch@users.noreply.github.com>
2025-08-27 10:24:51 +01:00
React Native Bot 7404fb620b Release 0.81.0
#publish-packages-to-npm&latest
2025-08-12 09:47:45 +00:00
Vitali Zaidman fc65e3e48e Update Podfile.lock
Changelog: [Internal]
2025-08-06 11:20:21 +01:00
React Native Bot 32effad946 Release 0.81.0-rc.5
#publish-packages-to-npm&next
2025-08-05 14:52:01 +00:00
React Native Bot df63c608b9 Release 0.81.0-rc.4
#publish-packages-to-npm&next
2025-08-05 11:08:36 +00:00
Vitali ZaidmanandVitali Zaidman 6e921b4c9c renamed release testing scripts (#52541)
Summary:
Use a more suitable name for the [scripts used in the release process](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-testing.md) to generate a testing project to test a new React Native release against.
```diff
- test-e2e-local
+ test-release-local
```
## Changelog:
[INTERNAL]

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

Test Plan:
`yarn test-release-local-clean` works the same way:
<img width="1177" height="161" alt="Screenshot 2025-07-10 at 17 54 50" src="https://github.com/user-attachments/assets/5efe30c6-a738-476e-a670-696959e9a0fc" />

`yarn test-release-local` works the same way:
<img width="1077" height="395" alt="Screenshot 2025-07-10 at 17 59 29" src="https://github.com/user-attachments/assets/fe6c6443-9316-4ed0-b6dc-51de5ffb109c" />

Reviewed By: cipolleschi

Differential Revision: D78150648

Pulled By: vzaidman

fbshipit-source-id: 471715da271d03bc2a35afbda02074bf71f62734
2025-08-04 16:58:58 +01:00
lukmccallandVitali Zaidman 812824cc64 Fix ReactHostImpl.nativeModules always returning an empty list (#52986)
Summary:
During the Expo QA process, we discovered that `ReactContext.reactApplicationContext.nativeModules` always returns an empty list (https://github.com/expo/expo/blob/4e2bbb23edda74d0e24756fd1735b8763e38f7a7/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt#L12). This happens because, during object creation, the `reactInstance` is always null.

## Changelog:

[ANDROID] [FIXED] - Fix `ReactHostImpl.nativeModules` always returning an empty list

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

Test Plan: - RN tester compiles 

Reviewed By: mdvacca

Differential Revision: D79451613

Pulled By: cortinico

fbshipit-source-id: d5341bcc1193eb948db4e99f16ba32a63073a6db
2025-08-04 14:26:00 +01:00
Alex HuntandVitali Zaidman aac7dbefe2 Pin Node.js version in GitHub Actions to 24.4.1 (#53013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53013

Quick fix to restore CI on `main`. `actions/setup-node` is now pulling Node.js `24.5.0`, which introduces a bug affecting `packages/dev-middleware/src/__tests__/` Jest tests.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D79551277

fbshipit-source-id: 51951ad8ffe376a478da268b50aa54ac2d9bba03
2025-08-04 14:23:38 +01:00
React Native Bot 4bbc344ec8 [LOCAL] Bump Podfile.lock 2025-07-29 17:25:32 +00:00
React Native Bot 0e6009eecf Release 0.81.0-rc.3
#publish-packages-to-npm&next
2025-07-29 15:42:59 +00:00
Nicola CortiandReact Native Bot bd94a13c5d RNGP - Fix a race condition with codegen libraries missing sources (#52803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52803

I've just realized that our build suffer from a race condition. Specifically
libraries codegen needs to be executed before the app starts the evaluating CMake files.
Otherwise this could lead to a lot of missing files or folders.

Changelog:
[Android] [Fixed] - **rngp:** Fix a race condition with codegen libraries missing sources

Reviewed By: huntie

Differential Revision: D78886347

fbshipit-source-id: f59c201d2eab651bc4a08cf5a795acd379d18186
2025-07-29 13:14:26 +00:00
Riccardo CipolleschiandGitHub 5976618bf9 Properly setup headers for FBReactNativeSpec in prebuilds (#52783) (#52897)
Summary:
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/52783

This change reverts D78158734 which was a patch to make the dynamic frameworks work properly because we were not exporting the FBReactNativeSpec headers in prebuilds correctly.

This change fixes this, by exposritng those headers correctly.

[Internal] -

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D78803425

fbshipit-source-id: 5613ed0c790455ea86668eeb436f7b78a0c80918
2025-07-29 10:14:18 +01:00
Nicola CortiandMoti Zilberman 67f507a53f Also test node 20.19.4 in the test_js matrix (#52878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52878

Now that Metro is bumped to also support node >= 20.19.4
we should be able to run test_js on `main` against 20.19.4

Changelog:
[Internal] [Changed] -

Reviewed By: robhogan, motiz88

Differential Revision: D79087608

fbshipit-source-id: 2161a893ab2fd88dc7eb1b35aa385704962018e8
2025-07-28 17:32:22 +01:00
b58e5facbd fix: View component does not have a displayName (#52688) (#52880)
Summary:
Hello, I work on [Radon IDE](ide.swmansion.com) I encountered an issue while adding support for react native 81, this PR solves it:
In https://github.com/facebook/react-native/issues/51023 EvanBacon removed `displayName` filed from `View` component adding the following comment:
>Remove displayName in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to react/display-name eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md

Unfortunately the Fabric renderer uses the `displayName` property to generate the name of the component for the inspector functionality and in absence of it generates a name that might be confusing to the end user:

<img width="351" height="283" alt="Screenshot 2025-07-17 at 21 27 37" src="https://github.com/user-attachments/assets/852246aa-6586-4684-b80e-5d70b9678c6e" />

Problem is not specific to Radon and happens in chrome devtools as well:

<img width="501" height="130" alt="Screenshot 2025-07-17 at 22 16 52" src="https://github.com/user-attachments/assets/3514dd02-59f7-473a-87b1-6ed325d2034c" />

This PR brings back the `displayName` property to fix that.

[INTERNAL] [FIXED] - Bring back the displayName property to the View component

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

Test Plan:
- Run the application
- open chrome devtools and navigate to "components" tab
- before changes the View components would show up as `View_withRef` after they are named `View`

Rollback Plan:

Reviewed By: lunaleaps, cortinico

Differential Revision: D78512254

Pulled By: alanleedev

fbshipit-source-id: 46e4a224b09fe3fb938c055a675f687c86d7ddcb

Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
2025-07-28 14:46:36 +01:00
Nicola CortiandReact Native Bot 2e52c1aab0 Make accessors inside HeadlessJsTaskService open again (#52660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52660

The documentation for those methods mention that users should override them to
provide their own implementation.

However those vals are not `open` so users cannot really override them.
This fixes it.

See more context on https://github.com/facebook/react-native/pull/48800#issuecomment-3082665024

So this was practically a breaking change, that I'm attempting to mitigate.

Changelog:
[Android] [Fixed] - Make accessors inside HeadlessJsTaskService open again

Reviewed By: cipolleschi

Differential Revision: D78479162

fbshipit-source-id: eefc7332e2004198cd6bd64b60a66215f137ad4a
2025-07-28 13:40:28 +00:00
cb20a1cd32 [0.81] Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52862)
* Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52791)

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

Changelog: [internal]

This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.

Reviewed By: sammy-SC

Differential Revision: D78815892

fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5

* Implement solution for ShadowTree commmit exhaustion using recursive locks (behind a flag) (#52795)

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

Changelog: [internal]

This is another attempt to fix https://github.com/facebook/react-native/issues/51870, inspired by https://github.com/facebook/react-native/pull/52314 but gated behind a feature flag until we've tested it carefully.

Reviewed By: sammy-SC

Differential Revision: D78817100

fbshipit-source-id: 45e6cae019b212528f2b2e74b9f52fe43d07f537

* [LOCAL] Correctly sort preventShadowTreeCommitExhaustion after merge conflict

---------

Co-authored-by: Rubén Norte <rubennorte@meta.com>
2025-07-28 14:38:54 +01:00
Alex HuntandReact Native Bot 5f3d297eec Restore flow dir in react-native package files (#52735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52735

Changelog: [Internal] (Follow up to keep #50784 non-breaking)

Reviewed By: cortinico

Differential Revision: D78662770

fbshipit-source-id: 03d931c904c0092481dbd03e8420244639305610
2025-07-28 13:38:37 +00:00
225ca2b6a6 [0.81] Lower minimum Node.js version to 20.19.4 (#52879)
* Lower minimum Node.js version to 20.19.4 (#52678)

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

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265

* Bump Metro to ^0.83.1, lower minimum Node.js version to 20.19

Summary:
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.83.1

The only public-facing change is a lowering of the minimum Node.js version from 22.14 to 20.19.

This will need picking to RN `0.81-stable`

Changelog: [General][Changed] Metro to ^0.83.1

Reviewed By: huntie

Differential Revision: D78895160

fbshipit-source-id: b9ccffe972249b73897f51c14873861e57a97161

* Do not setup-node twice in test_js (#52737)

Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).

This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.

## Changelog:

[INTERNAL] -

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

Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up

Reviewed By: cipolleschi

Differential Revision: D78664671

Pulled By: cortinico

fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f

---------

Co-authored-by: Alex Hunt <huntie@meta.com>
Co-authored-by: Rob Hogan <robhogan@meta.com>
Co-authored-by: Nicola Corti <ncor@meta.com>
2025-07-28 14:37:23 +01:00
React Native Bot 3695258eed [LOCAL] Bump Podfile.lock 2025-07-21 17:47:34 +00:00
React Native Bot 68ef746ec5 Release 0.81.0-rc.2
#publish-packages-to-npm&next
2025-07-21 15:42:12 +00:00
dd12edf35f [0.81] Implement mechanism to prevent ShadowTree commit exhaustion (#52736)
* Implement mechanism to prevent ShadowTree commit exhaustion (#52645)

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

Changelog: [internal]

This add a new feature flag to test a fix for https://github.com/facebook/react-native/issues/51870

Reviewed By: cortinico, sammy-SC

Differential Revision: D78418504

fbshipit-source-id: 2792026b6936393d196fd1e3162f8b2c61a38ed6

* Fix incorrect locking and attempts check in ShadowTree experiment (#52681)

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

Changelog: [internal]

In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made 2 mistakes:
1. Used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.
2. The `attemps` variable wasn't incremented, so we never left the loop in case of exhaustion.

This propagates a flag to `tryCommit` to indicate we've already locked on the commitMutex_ so we don't need to lock again in that case and increases the counter, fixing the issue.

Reviewed By: cortinico

Differential Revision: D78497509

fbshipit-source-id: 546ccd0c84aed5416ce1aef47d79419b4fe06f66

* Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental (#52709)

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

We want to make user for folks in OSS to try
`preventShadowTreeCommitExhaustionWithLocking`. Therefore I'm updating the OSS
release channel for this flag to experimental.

Changelog:
[Internal] [Changed] - Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental

Reviewed By: rubennorte

Differential Revision: D78558655

fbshipit-source-id: 02a9d216c7b2f8f7bdc1340213f82b70c5692dc7

---------

Co-authored-by: Rubén Norte <rubennorte@meta.com>
2025-07-21 15:31:19 +01:00
Nick GerlemanandMoti Zilberman d61decce15 Fix build_android GHA Job (#52694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52694

build_android job is always failing, with this assertion. Seems like find/replace in D78484060 gone wrong?

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D78534334

fbshipit-source-id: 291bdd01b41fa6efea00ed63a0dee8bdb14cbc3a
2025-07-21 15:19:11 +01:00
Riccardo CipolleschiandMoti Zilberman be05c8fda8 Fix Windows CI (#52666)
Summary:
As per [this issue](https://github.com/actions/runner-images/issues/12416), Windows machine doesn't have access to D: drive anymore

## Changelog:
[Internal] -

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

Test Plan: GHA

Reviewed By: huntie

Differential Revision: D78484060

Pulled By: cipolleschi

fbshipit-source-id: 36d844f9d7d69f1d74a154b019307cc1e269ad66
2025-07-21 15:19:06 +01:00
Riccardo CipolleschiandGitHub cdd7f99581 [LOCAL][RN][Release] Fix E2E test script when the ci flag is not specified (#52609) 2025-07-21 15:04:30 +01:00
Riccardo CipolleschiandGitHub d8bf94489a [RN][Release]Fix E2E script when using CI artifacts (#52606) 2025-07-21 15:03:49 +01:00
Christian FalchandReact Native Bot ddadb2e788 resolve xcframework paths from conf switch script (#52664)
Summary:
When switching between debug/release we run a small script to make sure to copy the correct version of the RNDeps xcframework.

This script was missing a resolve function that fixed up some path issues that we do when installing in the podspec.

## Changelog:

[IOS] [FIXED] - Fixed issue with RNDeps release/debug switch failing

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

Test Plan:
- Create new RN App
- Install pod with prebuilt deps
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481590

Pulled By: cipolleschi

fbshipit-source-id: 2d02b0bc55e8aef6f3fafb4f7aa193c4cf00414e
2025-07-21 14:03:36 +00:00
Christian FalchandReact Native Bot 828287de3c added missing script in package.json (#52663)
Summary:
When switching between release/debug we're running a script to copy the correct xcframework. This script for the React-Core prebuilts was not part of the package.json file.

This caused the build to fail after trying to switch from debug -> release.

## Changelog:
[IOS] [FIXED] - Fixed missing script for resolving prebuilt xcframework when switching between release/debug

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

Test Plan:
- Create new RN App
- Install pod with prebuilt deps and core
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481302

Pulled By: cipolleschi

fbshipit-source-id: 1c7181e63219098ae140d77ff1cb2c0c9b9642e5
2025-07-21 14:00:14 +00:00
Tim YungandReact Native Bot 2e1d7111dd RN: Default Hermes Parser to reactRuntimeTarget: "19" (#52625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52625

Changes `react-native/babel-preset` so that by default, `hermes-parser` is configured with `reactRuntimeTarget: "19"`. This changes the compiled output of Component Syntax to not use `forwardRef` when a `ref` prop is present.

Additionally, this adds a new preset option property, `hermesParserOptions`. This object allows users of `react-native/babel-preset` to supply overrides for any `hermes-parser` options.

Changelog:
[General][Changed] - Configures `react-native/babel-preset` to target React 19 by default, meaning Component Syntax will not compile to `forwardRef` calls when a `ref` prop is present.
[General][Added] - Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options.

Reviewed By: SamChou19815

Differential Revision: D78383269

fbshipit-source-id: 1e6b66b9bfbeaf8a06fdc39031cb6de7e921765f
2025-07-21 13:58:43 +00:00
Alex HuntandReact Native Bot 14bfad58f6 Add optional safeAreaInsets prop to NewAppScreen (replacing SafeAreaView) (#52507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52507

Resolves https://github.com/reactwg/react-native-releases/issues/1011.

Changelog:
[General][Changed] - `NewAppScreen` no longer internally handles device safe area, use optional `safeAreaInsets` prop (aligned in 0.81 template)

Reviewed By: cortinico

Differential Revision: D78006238

fbshipit-source-id: 01fb16d6754b69a722ea11838d558bebd4748026
2025-07-21 13:58:04 +00:00
React Native Bot 10b63c15b6 [LOCAL] Bump Podfile.lock 2025-07-15 12:06:48 +00:00
React Native Bot b06bb89ddd Release 0.81.0-rc.1
#publish-packages-to-npm&next
2025-07-15 09:52:01 +00:00
Nicola Corti ab73961753 Revert "Fix Dimensions window values on Android < 15 (#47554)"
This reverts commit 9c4da7b905.
2025-07-14 14:39:05 +01:00
Jakub PiaseckiandMoti Zilberman c7cd66c64e Fix display: contents nodes not being cloned with the wrong owner (#52530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

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

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
2025-07-14 11:56:48 +01:00
Nicola CortiandMoti Zilberman 2b13f47ff9 Gradle to 8.14.3 (#52466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52466

Just another patch bump of Gradle 8.14

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

Reviewed By: NickGerleman

Differential Revision: D77865220

fbshipit-source-id: 450d175242f046909ab1984654d24e92a2536d5d
2025-07-14 11:50:00 +01:00
Christian FalchandMoti Zilberman 75dcb5fc79 fix wrong use of return in header file generation loop (#52490)
Summary:
Instead of returning when creating the list of header files from our podspecs, we now call `continue`. This is a bug that causes all subsequent globs in the header file list to be omitted after the first omitted glob.

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixed premature return in header file generation from podspec globs

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

Test Plan: Run prebuild scripts and verify that React-Fabric podspec headers are included in the resulting xcframework.

Reviewed By: mdvacca

Differential Revision: D78012399

Pulled By: cipolleschi

fbshipit-source-id: 2d334f4f7ff966ea4c778786a7056e13a255a708
2025-07-14 11:48:00 +01:00
Mathieu ActhernoeneandMoti Zilberman 9c4da7b905 Fix Dimensions window values on Android < 15 (#47554)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

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

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

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

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77547628

Pulled By: alanleedev

fbshipit-source-id: 9d841f642d5b7ef3294dfbf3868137087a672ad6
2025-07-14 11:47:46 +01:00
Riccardo CipolleschiandMoti Zilberman bb27a16d84 Fix RCTPushNotification podspec to work with prebuilds (#52531)
Summary:
This change tries to use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI

bypass-github-export-checks

## Changelog:
[Internal] -

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

Test Plan:
Build rntester using prebuilds:

```
# after downloading the prebuilds from CI and unzipping them
export HERMES_ENGINE_TARBALL_PATH=~/Downloads/hermes-ios-Debug.tar.gz
export RCT_USE_LOCAL_RN_DEP=~/Downloads/reactnative-dependencies-debug.tar.gz
export RCT_TESTONLY_RNCORE_TARBALL_PATH=~/Downloads/React.xcframework.tar.gz

USE_FRAMEWORKS=dynamic bundle exec pod install
open RNTesterPods.xcworkspace
```
And then build from Xcode.

Reviewed By: rshest

Differential Revision: D78158734

Pulled By: cipolleschi

fbshipit-source-id: 43cbb66bd44fa621292b69de0dadde5ed20c4574
2025-07-14 11:47:30 +01:00
Tomasz ZawadzkiandMoti Zilberman 6b8d1a07d9 Expose react_renderer_bridging headers via prefab (#52529)
Summary:
This PR fixes the following build error while trying to build `react-native@0.81.0-rc.0` app with `react-native-screens@4.10.0` installed using react-native prebuilds (AAR) due to a missing `react/renderer/bridging/bridging.h` file in `prefab/modules/` inside `react-android-0.81.0-rc.0-debug.aar`.

```
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:12:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/FabricUIManagerBinding.h:22:
  /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/uimanager/primitives.h:14:10: fatal error: 'react/renderer/bridging/bridging.h' file not found
     14 | #include <react/renderer/bridging/bridging.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
```

## Changelog:

[ANDROID] [CHANGED] - Expose `react_renderer_bridging` headers via prefab

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

Reviewed By: cipolleschi

Differential Revision: D78092428

Pulled By: cortinico

fbshipit-source-id: de8208ae7545201f600c277a0c8907575c310c58
2025-07-14 11:46:59 +01:00
Nicola CortiandMoti Zilberman d9bf351b12 Back out "Remove ShadowNodeTraits::Trait::DirtyYogaNode" (#52528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528

This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.

Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`

Original commit changeset: 869e81f0ae00

Original Phabricator Diff: D75324251

Reviewed By: huntie

Differential Revision: D78085848

fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
2025-07-14 11:46:27 +01:00
Christian FalchandMoti Zilberman c665a96939 add release/debug switch script (#52498)
Summary:
Fixes #T228219721

This commit adds the debug/release switch script like we have for rn deps and hermes for react-core prebuilt:

- Added script: replace-rncore-version-js
- Inserted script into React-Core-prebuilt podspec
- Updated rncore.rb with correct filenames

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - add release/debug switch script for React-Core-prebuilt

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

Test Plan: Run in RNTester and switch between release/debug

Reviewed By: rshest

Differential Revision: D78012917

Pulled By: cipolleschi

fbshipit-source-id: 71cad23cd41484a8253fc89d5dce8653649657a0
2025-07-14 11:46:05 +01:00
Christian FalchandMoti Zilberman c9263e71e1 add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

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

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
2025-07-14 11:45:03 +01:00
Riccardo CipolleschiandMoti Zilberman bbb322b4f4 Fix bump-podfile-lock job by using Xcode 16.2 (#52513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52513

We bumped the requirement for cocoapods to use Xcode 16.1 or greater.
This job was not update and therefore it failed when releasing 0.81.0-rc.0.

This change should fix it and it should be cherry picked in the release branch too.
By default, the macos executor in github actions are using Xcode 15.2

## Changelog
[Internal] -

Reviewed By: cortinico, fabriziocucci

Differential Revision: D78008316

fbshipit-source-id: 4d05233ca3b936cf128400030328124c453963ea
2025-07-14 11:44:49 +01:00
Riccardo CipolleschiandMoti Zilberman 528173eb96 Change polling to try and download the pom manifest (#52512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52512

The way Maven works is that the artifacts are uploaded and available way before the browsing UI will allow us to browse them.

By trying to download the `.pom` file instead of checking for the browsing website to be visible, we can shave some minutes during the release

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78008635

fbshipit-source-id: 96516163628d6d25db385d996a11b4af78db764a
2025-07-14 11:44:13 +01:00
Riccardo CipolleschiandMoti Zilberman 5d779bd60b Fix ENTERPRISE_REPOSITORY usage (#52553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52553

This change fixes the usage of `ENTERPRISE_REPOSITORY` in Ruby

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D78152641

fbshipit-source-id: e4ace014f1b7cbeb1ec5a0dea955d1fc2bae5b67
2025-07-14 11:43:39 +01:00
Riccardo CipolleschiandMoti Zilberman 31fdd536ca Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror (#52514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52514

As per title, this change add the `ENTERPRISE_REPOSITORY` env variable so that users can use their owm maven mirror to consume artifacts rather than the official url.

This is helpful as:
- we can reduce the traffic toward maven central
- companies can speed up their builds by relying on local/closer replicas

## Changelog:
[iOS][Added] - Add the `ENTERPRISE_REPOSITORY` env variable to cocopaods infra

Reviewed By: cortinico

Differential Revision: D78011424

fbshipit-source-id: 24b83b4866095d7fe3318362afc5075b99b146e7
2025-07-14 11:43:20 +01:00
Nicola CortiandMoti Zilberman 3a99e31e56 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-14 11:42:21 +01:00
Rob HoganandGitHub 6b9f5d622f Bump Metro to 0.83.0 (#52577) 2025-07-14 08:51:12 +02:00
Riccardo Cipolleschi 87c8e687d9 [LOCAL] Bump podfile.lock 2025-07-09 14:34:56 +01:00
React Native Bot 1fc81fe216 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-09 11:08:15 +00:00
Riccardo CipolleschiandGitHub 918e422620 [RN][CI]Fix prebuilds for stable releases (#52503) 2025-07-09 12:05:13 +01:00
Riccardo Cipolleschi bce7f544ac Revert "[LOCAL] Add more logging around computeNightlyTarballURL"
This reverts commit 1a6887bd70.
2025-07-09 12:00:37 +01:00
Riccardo Cipolleschi b22bed22b4 Revert "Release 0.81.0-rc.0"
This reverts commit b52ecff628.
2025-07-09 12:00:18 +01:00
React Native Bot b52ecff628 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-09 09:03:09 +00:00
Nicola Corti 1a6887bd70 [LOCAL] Add more logging around computeNightlyTarballURL 2025-07-09 09:59:38 +01:00
Nicola Corti e01cbf95e4 Revert "Release 0.81.0-rc.0"
This reverts commit 9879028183.
2025-07-09 09:59:01 +01:00
React Native Bot 9879028183 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-08 16:14:15 +00:00
Fabrizio CucciandMoti Zilberman de8aeb658e Fix all workflows to use node 22.14.0
Summary:
We hit this error when trying to release 0.81.0 (see [action run](https://github.com/facebook/react-native/actions/runs/16147471618/job/45570030039)):

> error react-native/metro-babel-transformer@0.81.0-main: The engine "node" is incompatible with this module. Expected version ">= 22.14.0". Got "20.19.2"

This should fix the issue.

Changelog: [Internal]

Reviewed By: motiz88, cortinico

Differential Revision: D77938906
2025-07-08 17:10:54 +01:00
Moti Zilberman 07579d4945 Bump hermes version for 0.81.0 2025-07-07 14:42:52 +01:00
Samuel SuslaandFacebook GitHub Bot 1c51d6684b Deprecate ShadowNode::ListOfShared and migrate to std::vector<std::shared_ptr<const ShadowNode>> (#52402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402

changelog: [internal]

Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.

Reviewed By: christophpurrer

Differential Revision: D77651676

fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
2025-07-07 06:15:29 -07:00
szymonrybczakandFacebook GitHub Bot 9d63098520 chore: bump @react-native-community/cli* devDependencies to 20.0.0-alpha (#52460)
Summary:
Upgrade `react-native-community/cli` to version 20.

## Changelog:

[INTERNAL] [CHANGED] - Upgrade react-native-community/cli to v20

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D77860027

Pulled By: cortinico

fbshipit-source-id: 3eb3942b38091b4216628b94cdf1449838daa8d3
2025-07-07 05:17:07 -07:00
Alex HuntandFacebook GitHub Bot 9d4d8dcb02 Move BugReporting module out of open source repo (#52425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52425

Changelog:
[General][Breaking] - All `react-native/Libraries/BugReporting` APIs have been removed

Reviewed By: javache

Differential Revision: D77014767

fbshipit-source-id: a074fb952948a58259be66033e1f85e04bacf2de
2025-07-07 05:08:57 -07:00
Alex HuntandFacebook GitHub Bot caff37df5a Remove internal calls to BugReporting (#52374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52374

Precursor to removing `BugReporting` from React Native's internals.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77014724

fbshipit-source-id: 91cd38fe6c39656573fecdeff18162073df2fb42
2025-07-07 05:08:57 -07:00
Christoph PurrerandFacebook GitHub Bot 7998914471 Remove outdated SampleTurboCxxModuleLegacyImpl (#52412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77770455

fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
2025-07-06 22:35:20 -07:00
Christoph PurrerandFacebook GitHub Bot 94aca598c7 Remove unused #include <ReactCommon/TurboModuleUtils.h> (#52411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52411

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D77770244

fbshipit-source-id: a300e377f8c6e52256ae04813c1372799cf5af59
2025-07-06 21:21:48 -07:00
Christoph PurrerandFacebook GitHub Bot 5e650d0105 Remove more unused #includes (#52389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52389

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77706943

fbshipit-source-id: b8662737699ec0857845cfded49302ee9e93b78e
2025-07-06 20:56:16 -07:00
Christoph PurrerandFacebook GitHub Bot 9d5033afb0 Delete non C++ Turbo Module SampleCxxModule (#52407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

Reviewed By: javache

Differential Revision: D77765443

fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
2025-07-06 19:54:06 -07:00
Christoph PurrerandFacebook GitHub Bot e8709355dc C++ Turbo Module > Allow Promise<void> types (#52388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52388

Changelog: [Internal]

Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>`

Reviewed By: rbergerjr

Differential Revision: D77712020

fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
2025-07-06 19:53:51 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 255977a7b9 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/utils (#52444)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52444

Reviewed By: dtolnay

Differential Revision: D77782134

fbshipit-source-id: 99989d45926a0eabcc6e19e12dce396a473e14ce
2025-07-06 13:33:29 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8531015941 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [A] (#52437)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52437

Reviewed By: cortinico

Differential Revision: D77790078

fbshipit-source-id: 3188cce596ffa382ca3a9bd27cd0aba8580bbb76
2025-07-06 13:30:04 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 4e62558e43 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [B] (#52434)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52434

Reviewed By: cortinico

Differential Revision: D77790202

fbshipit-source-id: 35b5bb46e8056cddf874b05bf511754878f0e1fc
2025-07-06 12:32:42 -07:00
Rob HoganandFacebook GitHub Bot 5cdea3c295 Remove last use of Metro deep imports (#52456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52456

Remove the last use of a Metro deep import in preparation for making all deep imports semver-private.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77450110

fbshipit-source-id: de7aa9c1f6b0d281fe8a6c3bd95e721c5bb58c63
2025-07-06 05:33:25 -07:00
Rob HoganandFacebook GitHub Bot 083644647e Update to Metro ^0.82.5 (#52454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52454

Bump Metro minimum from 0.82.4 to 0.82.5

Release notes: https://github.com/facebook/metro/releases/tag/v0.82.5

Changelog: [General][Changed] Bump Metro to ^0.82.5

Reviewed By: huntie

Differential Revision: D77450102

fbshipit-source-id: 7b0fdcbeb63d8021996ca82f98773145179c8a50
2025-07-06 04:30:38 -07:00
Alex HuntandFacebook GitHub Bot 987e3f8c00 Make NetworkingModule handlers internal (#52438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52438

Motivation: After some investigation, these make sense as private APIs, and we intend to modify `UriHandler` slightly in order to report blob response body payloads via CDP for Network debugging.

Changelog:
[Android][Removed] - Internalize `NetworkingModule`'s `UriHandler`, `RequestBodyHandler`, and `ResponseHandler` APIs

Reviewed By: cortinico

Differential Revision: D77799144

fbshipit-source-id: 20c36f52a900830091a253ab9917832c30b31d31
2025-07-05 09:07:22 -07:00
Nick LefeverandFacebook GitHub Bot 27723c70b7 Clean up prop diffing gen (#52436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52436

Reordered the different property types in the switch/case to group similar outputs together.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77799101

fbshipit-source-id: 5b7c6d188e9ffa0f1e41f44f82f438afeda04d74
2025-07-05 06:19:23 -07:00
generatedunixname89002005287564andFacebook GitHub Bot dcd430721f Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [A] (#52433)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52433

Reviewed By: cortinico

Differential Revision: D77789924

fbshipit-source-id: 017ab5456bf25f40cd4b283d0405498f6e1e2e00
2025-07-04 16:20:30 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 22ccf8a6f5 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [B] (#52435)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52435

Reviewed By: cortinico

Differential Revision: D77789998

fbshipit-source-id: 9ac93f890c9df245a105b71369dc91501deb78a4
2025-07-04 15:38:07 -07:00
Ruslan LesiutinandFacebook GitHub Bot c302902b1d upgrade[react-devtools]: 6.1.5 (#52440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52440

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.5

Reviewed By: huntie

Differential Revision: D77799615

fbshipit-source-id: aa010176f6378f6306e8a2a45fad7afe002a609c
2025-07-04 14:26:08 -07:00
Sam ZhouandFacebook GitHub Bot 0666885f6a Deploy 0.275.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77800436

fbshipit-source-id: ff5a6a629c950959678d6a6311cda053f6b5dd4c
2025-07-04 11:55:28 -07:00
Nicola CortiandFacebook GitHub Bot efdf73983c Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean) (#52439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52439

Users should not be passing true/false values for the 3 params in the `load()` method. The app template already uses the no param overload.
I'm deprecating it so it can go in 0.81.

Changelog:
[Android] [Changed] - Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean)

Reviewed By: rubennorte

Differential Revision: D77739268

fbshipit-source-id: c901d1ed2e9623b0fa39f4e2d79f25404c284b8d
2025-07-04 10:33:18 -07:00
Ruslan LesiutinandFacebook GitHub Bot 377baa2ef6 Update debugger-frontend from 35c4630...51a91a2
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from 35c4630...51a91a2

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/35c4630bd58bbcbc6f4c54c084b4e52994dc4940...51a91a2ad62e7f585912ed314a350a72de84d6ed).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [51a91a2ad](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-07-04T14:04:02+01:00 | [bump: react-devtools@6.1.4 (#189)](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) |
| [761b96907](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-04T12:55:39+01:00 | [fixed missing new line before string error causes (#186)](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) |
| [7774c38db](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) | Alex Hunt (hello@alexhunt.dev) | 2025-06-30T13:20:49+01:00 | [Disable request initiator panel in NetworkItemView (#185)](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) |

Reviewed By: huntie

Differential Revision: D77795834

fbshipit-source-id: 3c30f8e87593687415538902734b09b3144b70a4
2025-07-04 08:09:12 -07:00
Ruslan LesiutinandFacebook GitHub Bot c9e44fbcf2 upgrade[react-devtools]: 6.1.4 (#52426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52426

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.4

Reviewed By: huntie

Differential Revision: D77794756

fbshipit-source-id: 4b8a795a809f5e72e8753d65435c97212e38dd8a
2025-07-04 08:09:12 -07:00
Alex HuntandFacebook GitHub Bot f753158da4 Add JS implementation for PerformanceResourceTiming (#52427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52427

Adds and wires up a minimal implementation of `PerformanceResourceTiming` on the JS side. This materialises D74245441 in user space.

When all feature flags are enabled, network requests can now be observed from JS via `PerformanceObserver`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D75062713

fbshipit-source-id: 06523e70f57feaaa53432ef21fa92676d1e90360
2025-07-04 07:07:20 -07:00
Ian ChildsandFacebook GitHub Bot d2b55ad1ba Use build instead of targets in check-api.sh (#52424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52424

This makes sure the output is actually materialized.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D77793365

fbshipit-source-id: 5505abd0f4c2994f4ced1c27a506d9199f9454ca
2025-07-04 06:17:14 -07:00
Alex HuntandFacebook GitHub Bot 962a7dda44 Expose unstable_TextAncestorContext API (#52368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52368

Motivated by https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13497461.

Also align naming for internal usages.

Changelog:
[General][Added] - Expose `unstable_TextAncestorContext` API

Reviewed By: NickGerleman

Differential Revision: D77141176

fbshipit-source-id: d9a57d923994188f5ce7e0608ea28fdca98db860
2025-07-04 06:09:38 -07:00
Samuel SuslaandFacebook GitHub Bot bc4bce61df remove uses of ShadowNode::Shared from ShadowNode.cpp (#52422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52422

changelog: [internal]

In https://github.com/facebook/react-native/pull/52393 not all uses of ShadowNode::Shared were removed. Github CI fails if a deprecated API is used. Let's remove the last uses.

Reviewed By: cortinico

Differential Revision: D77790411

fbshipit-source-id: 6fbbbffaa784de1f0939d1032dc7ea6586f2ce7d
2025-07-04 04:49:12 -07:00
Mohamed SalamaandFacebook GitHub Bot b4dcc9831e Revert D77547628: Fix Dimensions window values on Android < 15
Differential Revision:
D77547628

Original commit changeset: 9d841f642d5b

Original Phabricator Diff: D77547628

fbshipit-source-id: 80ee528740eb4b39816e7873939d74e29d64caec
2025-07-04 04:19:27 -07:00
Nicola CortiandFacebook GitHub Bot 2d0aa1a747 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes
Summary:
reverting Refactor ViewManagerInterfaces codegen to generate kotlin classes because of warning in OSS, we will reland after 0.81 cut

Changelog: [Android][Breaking] - Revert of Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: lenaic, mlord93

Differential Revision: D77759777

fbshipit-source-id: c24b216b231cdc53296d8c9fca8d789d80daa596
2025-07-04 02:48:42 -07:00
Samuel SuslaandFacebook GitHub Bot 0e175ce5b6 Mark ShadowNode::Shared as deprecated and replace all usages (#52393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52393

## Changelog:
[General][Deprecated] - ShadowNode::Shared is now deprecated. Use `std::shared_ptr<const ShadowNode>` instead.

- Mark ShadowNode::Shared as deprecated in ShadowNode.h
- Replace all uses of ShadowNode::Shared with std::shared_ptr<const ShadowNode>.

This continues the systematic effort to remove ShadowNode type aliases in favor of explicit standard library types for improved code clarity and maintainability.

Reviewed By: christophpurrer

Differential Revision: D77650696

fbshipit-source-id: b4769e2a1e39f49d14d5927be105487ecf69fa3f
2025-07-04 00:29:54 -07:00
Christoph PurrerandFacebook GitHub Bot 2ce7eab5f9 Remove unused RAIICallbackWrapperDestroyer (#52390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52390

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77710424

fbshipit-source-id: 7c1d7e3181450394311a001af117c6fbdcaeba31
2025-07-03 16:44:16 -07:00
Nicola CortiandFacebook GitHub Bot ccb9edc717 Remove deprecated isStartSamplingProfilerOnInit from DeveloperSettings (#52405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52405

This field has been deprecated since RN 0.77, we can safely remove it ahead of the branch cut.

Changelog:
[Android] [Removed] - Remove deprecated `isStartSamplingProfilerOnInit` from `DeveloperSettings`

Reviewed By: mdvacca, javache

Differential Revision: D77734913

fbshipit-source-id: 231ecb360921d48ec941a3a214e73b4b89446c13
2025-07-03 15:28:06 -07:00
Nicola CortiandFacebook GitHub Bot f2ecb7e42c Make loadWithFeatureFlags correctly internal (#52395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52395

This method was exposed as `public` but there is no need for us to expose it in OSS.
So I'm marking it as internal.

Changelog:
[Internal] [Changed] - Make loadWithFeatureFlags correctly internal

Reviewed By: mlord93, mdvacca, javache

Differential Revision: D77734270

fbshipit-source-id: 34e1d7aaa4a5bf3563c78aad570e2310592bcc77
2025-07-03 15:17:38 -07:00
Christoph PurrerandFacebook GitHub Bot 47fe09f505 Make virtual destructors default implemented - instead of empty one (#52382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52382

Changelog: [Internal]

In C++, both `virtual ~CallInvoker() {}` and `virtual ~CallInvoker() = default` can be used to define a virtual destructor. However, they have slightly different implications:

1. `virtual ~CallInvoker() {}`:
    * This is the traditional way of defining a virtual destructor.
    * It provides an empty implementation for the destructor, which does nothing.
    * The compiler will not generate a default implementation, as you've provided one explicitly.
2. `virtual ~CallInvoker() = default`:
    * This is a more modern way of defining a virtual destructor (introduced in C++11).
    * It tells the compiler to generate a default implementation for the destructor.
    * The default implementation will perform the necessary cleanup operations, such as calling the destructors of base classes and member variables.

In general, `= default` is considered better because it:
* Avoids unnecessary code duplication: By letting the compiler generate the default implementation, you avoid duplicating code that's already generated by the compiler.
* Improves maintainability: If the class has member variables or base classes with non-trivial destructors, using `= default` ensures that the correct cleanup operations are performed without requiring manual updates.
* Conveys intent: Using `= default` clearly indicates that the destructor should perform its default behavior, making the code easier to understand.

So, unless you have a specific reason to provide a custom implementation, `virtual ~CallInvoker() = default` is generally the better choice.

Reviewed By: rshest

Differential Revision: D77685932

fbshipit-source-id: 78c81f8e400069ad38d8d7405dafeb0b6db8e67b
2025-07-03 13:32:28 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot c9f1778faf Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility (#52347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52347

We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.

With this we just manually build a tree that contains the elements we care about in the order we want.

We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77258926

fbshipit-source-id: 767ebc880a2efbf7934b9e7dee3013dd7822e5ad
2025-07-03 12:56:35 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 5b245767d6 Remove Virtual View accessibilityOrder implementation (#52297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52297

Doing virtual views is the only way of making it possible to add the host view into the order. This however is too complex for very little gain, we are opting to go for a cleaner solution with the trade off of not being able to add the host view.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77278752

fbshipit-source-id: 709b995f51a9a03f6d07f2e24f8aea21d62d95c4
2025-07-03 12:56:35 -07:00
David VaccaandFacebook GitHub Bot 76ff1aa5c6 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#51735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51735

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: javache

Differential Revision: D75719542

fbshipit-source-id: 7e9aa7ccc24e827bd7b6df72b3302e852932e731
2025-07-03 12:19:42 -07:00
Christoph PurrerandFacebook GitHub Bot 253606239b CallInvoker > Remove unused includes (#52381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52381

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D77685836

fbshipit-source-id: a01aedf51463d228ca14d37dc4a0869e6e9208c9
2025-07-03 11:56:03 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3561791ff8 fix: rename bottom stack frame (#33680) (#52400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52400

`react-stack-bottom-frame` -> `react_stack_bottom_frame`.

This survives `babel/plugin-transform-function-name`, but now frames
will be displayed as `at Object.react_stack_bottom_frame (...)` in V8.
Checks that were relying on exact function name match were updated to
use either `.indexOf()` or `.includes()`

For backwards compatibility, both React DevTools and Flight Client will
look for both options. I am not so sure about the latter and if React
version is locked.

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

Reviewed By: jackpope

Differential Revision: D77601866

fbshipit-source-id: 24ed8713af4bebbaeb7a612333cd79c51b696565
2025-07-03 11:38:05 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 85d10ed904 Fix Dimensions window values on Android < 15 (#47554)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

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

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

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

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77547628

Pulled By: alanleedev

fbshipit-source-id: 9d841f642d5b7ef3294dfbf3868137087a672ad6
2025-07-03 11:37:55 -07:00
Ruslan LesiutinandFacebook GitHub Bot facdc2f6f4 Support rename of React stack bottom frame (#52398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52398

# Changelog: [Internal]

Adaptation for https://github.com/facebook/react/pull/33680.

Reviewed By: jackpope

Differential Revision: D77737710

fbshipit-source-id: 6c6893935e8da8175c0cd9ceab21cc05e2092e7a
2025-07-03 09:34:58 -07:00
Enrique López MañasandFacebook GitHub Bot 477d8df312 Updated targetSdk to 36 (#52355)
Summary:
We need to upgrade the targetSdk to 36, which requires ensuring compatibility with the latest Android APIs and addressing any deprecations or behavior changes introduced in this version.

## Changelog:

[Android] [Changed] - Updated targetSdk to 36 in Android.

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

Test Plan:
- Verified that the app builds and runs successfully with targetSdkVersion 36.

- Ran the full suite of unit and instrumentation tests: all tests passed.

- Manually tested key user flows (login, navigation, data sync) on devices running Android 14 (API 34) and emulator with API 36

- Confirmed that there are no runtime crashes or warnings related to `targetSDK` upgrade.

Behavioral guide for migration: https://developer.android.com/about/versions/16/behavior-changes-16

Reviewed By: fabriziocucci

Differential Revision: D77728391

Pulled By: cortinico

fbshipit-source-id: 3f714f900bbeecc56c0cf46c54b4e42c532c8384
2025-07-03 08:01:47 -07:00
Nicola CortiandFacebook GitHub Bot 2e724e4743 Add changelog for 0.80.1 (#52392)
Summary:
Just the changelog for 0.80.1

## Changelog:

[INTERNAL] - Add changelog for 0.80.1

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D77725130

Pulled By: cortinico

fbshipit-source-id: 2eddb56e8893e0d8e71a6509b1303b3b9cab8769
2025-07-03 06:57:20 -07:00
Alex HuntandFacebook GitHub Bot f4a9aa3525 Implement connectionTiming and dataReceived NetworkReporter methods (#52335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52335

Adds support for `Network.requestWillBeSentExtraInfo` and `Network.dataReceived` CDP events in jsinspector-modern and wires up for iOS.

In particular, `Network.requestWillBeSentExtraInfo` is necessary to populate request headers in the UI.

**End of base Network implementation for iOS**

After this diff, we are spec-complete on all CDP Network methods for our V1, on iOS.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77489476

fbshipit-source-id: 84aa4da9d9fcbdc61eff236fc6bd2136496910a5
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot ebb831a0c9 Implement Network.loadingFailed (#52334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52334

Adds support for `Network.loadingFailed` in jsinspector-modern and wires up for iOS.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77489477

fbshipit-source-id: dc8156979fe49583819019fa4b88b6eb99dea734
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot 68342a4d12 Support CDP response previews for chunked data (#52331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52331

Updates the iOS inputs to `NetworkReporter` to support incremental string data HTTP responses (`Transfer-Encoding: chunked`).

This means that incremental responses, such as Metro bundle requests, can be displayed as previews in React Native DevTools.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77457109

fbshipit-source-id: 00a622dbac97c38e07c67b5ee3661c8d586f6fe1
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot 94c97db4da Implement Network.getResponseBody (#52332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52332

Adds support for the [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event in `jsinspector-modern` and configures this for iOS. This enables us to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.

This is integrated with `RCTNetworking.mm` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77457109.

**Implementation notes**

- Adds a new `BoundedRequestBuffer` construct to safely buffer response previews at a max memory size.
- `RCTNetworking` will always call `maybeStoreResponseBody` (when feature flag enabled), but is unaware whether there is an active CDP debugging session with network support or not.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74319394

fbshipit-source-id: c9dbb44551c15d1b1a7cce56b35bf829f8a99dc7
2025-07-03 05:01:57 -07:00
Eric RozellandFacebook GitHub Bot 9253fc3b42 Defer focus cell render mask updates (#52380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52380

Apps that rely support focus in FlatList rendered items are missing out on a FlatList optimization that defers rendering for offscreen content updates.

For example, on Android, if you focus and smooth scroll an item into view, the onScroll event will fire first. For most sufficiently large virtualization windows, the next render will be delayed by the render batch timeout as most materialization of virtualized views is not treated as a high pri render.

However, this batch / timeout mechanism isn't being used for cell render updates that occur as a result of a focus change.

This change adds the same timeout mechanism used for scroll events. In most cases, the view that is focused is in the viewport, and the extra rendering needed is already scheduled (or executed with high priority if needed) when the onScroll event is processed.

In cases where the focus change occurs outside the viewport, most platforms will want to do some kind of "bring into view" anyway, and the same applies - onScroll will take care of scheduling the cell rendering priority.

## Changelog

[Internal]

Reviewed By: NickGerleman

Differential Revision: D77681274

fbshipit-source-id: 1ade377e513eca21338a380ff9299dd410606aec
2025-07-03 04:15:41 -07:00
Nicola CortiandFacebook GitHub Bot 45fd7feb9f Convert UIManagerModuleConstantsHelper to Kotlin (#52358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52358

Another class going from Java to Kotlin.
This is quite involved due to the amount of Raw generics we were using so I'd appreaciate a couple of further eyes here.

Changelog:
[Android] [Changed] - Convert UIManagerModuleConstantsHelper to Kotlin

Reviewed By: mdvacca, javache

Differential Revision: D77589975

fbshipit-source-id: 477c1e2a8dfd31db60047fd1252f6d47c177f5c7
2025-07-03 02:52:01 -07:00
Nicola CortiandFacebook GitHub Bot 6cb8dc37c7 RNGP - Add support for exclusiveEnterpriseRepository (#52378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378

This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:

```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```

This will remove all the existing Maven repositories and only use the internal mirror they have.

Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.

Reviewed By: mdvacca

Differential Revision: D77667573

fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
2025-07-03 02:27:08 -07:00
Joe VilchesandFacebook GitHub Bot cec0de8f99 Change Scroller getter to protected (#52387)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52387

I would like to grab this in a subclass but unfortunately can't. It is kinda jank since this is a val obtained via reflection, but I figure this is better than copy and paste. I think that I could also expose a function that uses this scroller the way I want it to. Let me know if there are strong objections here

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D77684599

fbshipit-source-id: 6f02c1da5135c1cf34fa1483542e06bf8f0be75e
2025-07-02 22:13:16 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 097d482446 fix(ios): Correct gradient interpolation for when transitioning to transparent color (#52249)
Summary:
This change fixes an issue on iOS where gradients that fade to a transparent color-stop appear dark or "muddy." The fix ensures that the color's hue is preserved during the transition, matching the behavior on Android and web.

### The Problem
When creating a gradient on iOS (e.g., linear-gradient(red, transparent)), the transparent keyword is treated as transparent black (rgba(0,0,0,0)). The `CAGradientLayer` on iOS then interpolates all color channels linearly, causing the red, green, and blue components of the start color to fade to 0. This transition through black results in an undesirable dark or "muddy" appearance in the middle of the gradient.

## Changelog:
[IOS][FIXED] - Gradient interpolation for transparent colors
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
Checkout `LinearGradient` example in RNTester, checkout the newly added transparent color transition example, it should render same on android and iOS.

| Before | After |
| --- | --- |
| <img src="https://github.com/user-attachments/assets/c0bb54ad-ed0e-4a80-b37f-0458af0f1f77" width="300"> | <img src="https://github.com/user-attachments/assets/02da921a-bd0e-45c1-881c-cf6460d5ed43" width="300"> |
| `linear-gradient(to right, red, transparent)` transitions to black on iOS, creating a dark effect. | The gradient correctly fades the red color's alpha channel to zero |

Reviewed By: javache

Differential Revision: D77312194

Pulled By: NickGerleman

fbshipit-source-id: 053df8e44f52cd22a3f28fd01f583f7d03c66af5
2025-07-02 17:55:45 -07:00
Nick GerlemanandFacebook GitHub Bot 508b1526d9 Avoid array copies on every MapBuffer read (#52386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52386

Enum `values()` function makes a copy of an underlying array on each call. This happens in a hot path, and seems to show up during profiling. Let's cache it.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77623705

fbshipit-source-id: 5a33425822f477f63fe104ca9e5ed474385a2022
2025-07-02 17:26:48 -07:00
Nick GerlemanandFacebook GitHub Bot 0d455f3272 buildSpannableFromFragmentsOptimized (#52385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52385

This replaces `buildSpannableFromFragmentsOptimized()` with a more optimized version. There are a couple main changes.

1. We don't need a complicated structure around ordering, and span priority, that made its way from the Java ShadowNode logic. AttributedString already ensures there are no overlapping attributes per fragment.
2. `SpannableStringBuilder` is a complicated text-editor style data structure, optimized to allow text content to be modified, and spans re-applied. We can use a much lighter `SpannableString`, on top of the ahead-of-time known text content, which is faster, and saves around 500 bytes per string (and prepared layout). If we assign this to an `EditText`, which later gets edited, Android will copy it to a `SpannableStringBuilder`.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77622848

fbshipit-source-id: 69bbac86e1f0fd4a15dab6bc279cca305f2a53ae
2025-07-02 17:26:48 -07:00
Nick GerlemanandFacebook GitHub Bot a4b0d64395 ReactNativeFeatureFlags.enableAndroidTextMeasurementOptimizations() (#52384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52384

Adds the feature flag, controlling multiple optimizations up the stack.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77622983

fbshipit-source-id: 16500e8557d36db627c62faa511eeb4c73dc7484
2025-07-02 17:26:48 -07:00
Nolan O'BrienandFacebook GitHub Bot 22b8b53c77 Fix exhaustive switches (#52383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52383

Changelog: [General][Fixed] - Add `default:` case to avoid warnings/errors for targets that compile with `-Wswitch-enum` and `-Wswitch-default` enabled

Reviewed By: aary

Differential Revision: D77051150

fbshipit-source-id: a4f18bb7e47f027fd64cc42bacd7246263ef2454
2025-07-02 16:56:07 -07:00
Nolan O'BrienandFacebook GitHub Bot 9079b53c6f Fix exhaustive switches (#52379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52379

Changelog: [General][Fixed] - Add `default:` case to avoid warnings/errors for targets that compile with `-Wswitch-enum` and `-Wswitch-default` enabled

Reviewed By: aary, yungsters, astreet

Differential Revision: D77051152

fbshipit-source-id: 100b10f97cb3a5d73f1e3dcaf1b284baf6a43982
2025-07-02 14:21:18 -07:00
Nick LefeverandFacebook GitHub Bot da23346c7e Fix UNDEFINED YGValue serialization (#52376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52376

Correct the expected serialization based on the YogaValue parse implementation:
https://www.internalfb.com/code/fbsource/[ecdf90fe69d0]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaValue.java?lines=66-68

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77663413

fbshipit-source-id: e8b6091a5d57c6d0301411371c290a867c9b5224
2025-07-02 10:07:01 -07:00
Christoph PurrerandFacebook GitHub Bot ceb5f1dedb Remove unused SharedAttributedString alias (#52362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52362

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77630091

fbshipit-source-id: df297bc5150416b6ddf719addc3ae926e3b39f48
2025-07-02 08:34:21 -07:00
Fabrizio CucciandFacebook GitHub Bot faa8c7b8a1 Keep changelog references for previous versions in CHANGELOG (#52372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52372

This is just a follow-up on top D77025333 to make sure that the links in the blog posts and the GitHub releases keep working.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77654056

fbshipit-source-id: a1c6df44ebee058dd5b59e5b6a60c7c1e060e52c
2025-07-02 06:34:06 -07:00
Nicola CortiandFacebook GitHub Bot e20bb56f3b Bump Gradle to 8.14.2 (#52370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52370

This is just a patch bump of Gradle ahead of the 0.81 branch cut.

Changelog:
[Android] [Changed] - Bump Gradle to 8.14.2

Reviewed By: fabriziocucci

Differential Revision: D77601121

fbshipit-source-id: b2fdc8b022f2ab43997f412c77e0c924c01f1a5d
2025-07-02 04:36:22 -07:00
Alex HuntandFacebook GitHub Bot 4274d6f7c7 Tweak RNTester status bar on Android (#52369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52369

Tiny fix where the system status bar elements were no longer visible under Android edge-to-edge.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77653633

fbshipit-source-id: 1275a0de6665a6ef4599166fb205865cd581bb41
2025-07-02 04:34:10 -07:00
Nicola CortiandFacebook GitHub Bot b578a70bd5 Bump packages for next release (#52359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359

This is needed ahead of the 81 branch cut.

Changelog:
[Internal] - Bump all packages to 0.81.0-main

Reviewed By: huntie

Differential Revision: D77602196

fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
2025-07-02 03:53:34 -07:00
Moti ZilbermanandFacebook GitHub Bot bf51035e04 Scaffolding for custom RNDT shell binary (#52357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52357

Changelog: [Internal]

Adds a hyper-minimal build script using `electron/packager` that produces custom binaries for the experimental React Native DevTools standalone shell. The main user-facing benefit of this is replacing the Electron name and icon with our own branding.

NOTE: `electron/packager` is designed to include the application code in the resulting binary. This is arguably overkill for us - the current launch model of `electron src/electron/index.js` is actually wholly sufficient for what we need - but I decided to go with the grain of the available tooling for simplicity.

Icon design courtesy of huntie. 🙏

Reviewed By: huntie

Differential Revision: D77591742

fbshipit-source-id: a968465df4f54fba54c874b6300788e151600ed7
2025-07-02 03:48:51 -07:00
Moti ZilbermanandFacebook GitHub Bot 2d68a733f8 Fix run-ci-javascript-tests script (#52364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52364

Changelog: [Internal]

D76512374 broke error reporting in `run-ci-javascript-tests.js`. This is partly because the file was untyped and we missed that the `.code` check on the result of `execSync` was always going to be falsy. Also, `execSync`'s default error handling mechanism is not human-friendly - it throws an `Error` with `Buffer`s for stdout and stderr (see [example](https://github.com/facebook/react-native/actions/runs/16003656383/job/45144825919?pr=52357&fbclid=IwY2xjawLRyfpleHRuA2FlbQIxMQBicmlkETFZSG1xeWhTWWczR1paS0lKAR4pF46Z-J2CbSk7YdHZJ-N3F9eQJ7hR4EowfLV6mUtzMLg8j-EWdZiGY1la6A_aem_1Zbvn6fD5NS9YO-B7QJssg)).

Here, I'm adding types, removing dead code and preserving stdout and stderr from all child processes in a human-readable format.

Reviewed By: huntie

Differential Revision: D77648312

fbshipit-source-id: c6d98e668d6edf15729fa02fecb3408b9dd6debc
2025-07-02 03:09:18 -07:00
Fabrizio CucciandFacebook GitHub Bot 326467c856 Add changelog entry for 0.79.5 (#52367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52367

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77652098

fbshipit-source-id: c9ab8c7549e1f50b2e3ca7a1c7de6ec321926ee6
2025-07-02 02:52:12 -07:00
Dawid MałeckiandFacebook GitHub Bot c1168cf919 Fix deep react native imports eslint rule (#52365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52365

Adds type imports autofix support and pass `fb_internal` paths in react native deep imports eslint rule. The rule fixes imports with all matched types with static API mapping to prevent splits.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77445445

fbshipit-source-id: cd5b75b4b3b53792117b8297352dddc4d63dbf70
2025-07-02 02:13:31 -07:00
Samuel SuslaandFacebook GitHub Bot 2a6b55f0b1 put optimisation for VirtualView on iOS behind a flag (#52345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52345

changelog: [internal]

I would like to measure impact of D76597973 to get a better understanding of UIKit's rendering.

Reviewed By: yungsters

Differential Revision: D77542666

fbshipit-source-id: 4c2de4f36d2b374d83df934dd3a98d01b24f487f
2025-07-02 01:46:25 -07:00
Dawid MałeckiandFacebook GitHub Bot b41b924b2d Add diff-api-snapshot action to danger (#52045)
Summary:
This PR connects breaking change detection with a danger bot. The action takes snapshot from main branch and from the PR as inputs to`diff-api-snapshot` (saved in runner temp directory).

## Changelog:
[Internal]

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

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

Reviewed By: huntie

Differential Revision: D76735630

Pulled By: coado

fbshipit-source-id: 9208117340c1e0bf10d58b67892727717d22e62f
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 71f2f05f03 Align breaking change detection with new snapshot format (#52353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52353

This diff aligns breaking change detection script with new snapshot format. It compares hashes to determine if the API changed for each specifier.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77377762

fbshipit-source-id: e1c69692ace389fb08ae9470b9f9631e53834206
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 1c7b04db4a Delete public-api-test (#52342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52342

This diff deletes `public-api-test` for detecting changes in public API. It is replaced with public API snapshot validation (in D76340729) for better detection and understanding of changes that influence external interfaces.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77531763

fbshipit-source-id: a8ef2b6f52fa6efb5b312598ea3e4746fc51e4ec
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 128f5eb9ac Validate RN JS API snapshot on CI (#52352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52352

This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.

### Motivation

Detect react-native public API changes before they land.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76340729

fbshipit-source-id: 10c465418e0ba4eb05cf557a16119f9756843d9e
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 8f9bca5f74 Initial commit of ReactNativeApi.d.ts (#52343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52343

This diff commits our V2 JavaScript API snapshot for React Native.

This is a new format and workflow that replaces the previous `public-api-test` Jest test.

Please look at the file header for up-to-date instructions on updating the API snapshot.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77532617

fbshipit-source-id: d5faae815aa5071b0f472fcb02318b73772b11cf
2025-07-01 08:58:15 -07:00
David VaccaandFacebook GitHub Bot dcbbf275cb Reintroduce CppPropsIteratorSetter for Yoga Styles (#52351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52351

Reintroduce CppPropsIteratorSetter for Yoga Styles

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D77563504

fbshipit-source-id: 969c78e267db3e97ea567ad948489b5991c88678
2025-07-01 07:16:19 -07:00
Tim YungandFacebook GitHub Bot da520848c9 RN: Always Flatten Animated Styles (#52268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52268

Ships the feature flag introduced in https://github.com/facebook/react-native/pull/51719 to fix crahes that result from shadowed animated style values.

Changelog:
[General][Changed] - Animated now always flattens `props.style`, which fixes an error that results from `props.style` objects in which `AnimatedNode` instances are shadowed (i.e. flattened to not exist in the resulting `props.style` object).

Reviewed By: javache

Differential Revision: D77314904

fbshipit-source-id: b442d0256aee7a8925e28c7e87aee5e0a3f39425
2025-07-01 07:07:33 -07:00
Pieter De BaetsandFacebook GitHub Bot ce306aca34 Remove redundant check for NativeReactNativeFeatureFlags (#52354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52354

These should no longer be needed as `ReactNativeFeatureFlags` handles the missing native module gracefully.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D77365271

fbshipit-source-id: 92c6789b2175f24c79838118f681107a43c9ff0a
2025-07-01 03:49:58 -07:00
Nick GerlemanandFacebook GitHub Bot 5cc4d0a086 Reland Fix possible invalid measurements when width or height is zero pixels (#52348)
Summary:
X-link: https://github.com/facebook/yoga/pull/1823

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

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76851589

fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f
2025-06-30 20:46:39 -07:00
Jack PopeandFacebook GitHub Bot 3eeda07a69 Align AttributeConfiguration type in ReactNativeTypes (#33671)
Summary: DiffTrain build for [1e0d12b6f273d7345e32c16cd937475ed7c512ad](https://github.com/facebook/react/commit/1e0d12b6f273d7345e32c16cd937475ed7c512ad)

Reviewed By: kassens

Differential Revision: D77541776

fbshipit-source-id: ef9a99bfc7f16feee1d27685de62a970305f8e5a
2025-06-30 17:19:32 -07:00
Mateo GuzmánandFacebook GitHub Bot 7d01060a8b Kotlin: fix static code analysis weak warnings (6/n) (#52338)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Accessor call that can be replaced with property access syntax](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (6/n)

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

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

Reviewed By: NickGerleman

Differential Revision: D77504913

Pulled By: cortinico

fbshipit-source-id: 62661ba6adafb7893ce27811357020966d5ea4c1
2025-06-30 15:54:57 -07:00
Pieter De BaetsandFacebook GitHub Bot 69e4252ccb Fix access to observers outside lock in ImageResponseObserverCoordinator (#52346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52346

This is bypassing the mutex, and potentially not thread-safe.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D77541041

fbshipit-source-id: f97415d066786864806836768dbce2d5e68487ef
2025-06-30 13:22:36 -07:00
Ruslan LesiutinandFacebook GitHub Bot 69a55d7b76 Console: prioritize original console.timeStamp implementation (#52319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52319

# Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77315831

fbshipit-source-id: b4d7fd9c816dcb4b76cc7d026f509a6a24da58f8
2025-06-30 12:55:28 -07:00
Ruslan LesiutinandFacebook GitHub Bot 5340a00ac0 Define isProfiling option when Fusebox is used in Production mode (#52320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52320

# Changelog [Internal]

We are gating `__RCTProfileIsProfiling` global definition under this `isProfiling` option - [1].

Reviewed By: vzaidman

Differential Revision: D77315833

fbshipit-source-id: f71175a573aa6d77c16a657475c59820f9830aa6
2025-06-30 12:55:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot b8b79a3fc1 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon (#52344)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52344

Reviewed By: javache

Differential Revision: D77526780

fbshipit-source-id: 6ec8cac95cd0cf9bfc29c57b7ad85fb5e9ab65cb
2025-06-30 12:22:37 -07:00
Nicola CortiandFacebook GitHub Bot c4325c335b Fix broken Modal OSS E2E test due to createNewDialog setter (#52341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52341

The setter for `createNewDialog` is now wrong (after D76834213).
If the `createNewDialog` has been set to `true` by any other field, we should respect it and not set it to true/false regardless
(only considering the `isEdgeToEdgeFeatureFlagOn`) property.

This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77539533

fbshipit-source-id: a1deaf1f1b856895304e8b73fa5d0c0367e677af
2025-06-30 10:16:55 -07:00
Mateo GuzmánandFacebook GitHub Bot 73e513280d Kotlin: fix static code analysis weak warnings (5/n) (#52337)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Unnecessary type argument](https://www.jetbrains.com/help/inspectopedia/RemoveExplicitTypeArguments.html)
- [Variable declaration could be moved inside 'when'](https://www.jetbrains.com/help/inspectopedia/MoveVariableDeclarationIntoWhen.html)
- [Assignment can be replaced with operator assignment](https://www.jetbrains.com/help/inspectopedia/AssignmentReplaceableWithOperatorAssignment.html)
- [Negated call can be simplified](https://www.jetbrains.com/help/inspectopedia/SimplifyNegatedBinaryExpression.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (5/n)

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

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

Reviewed By: cortinico

Differential Revision: D77525702

Pulled By: rshest

fbshipit-source-id: b0bd2e7616340c22b22e7f58387c53c51cbf073e
2025-06-30 03:38:26 -07:00
George ZaharievandFacebook GitHub Bot 9a2c422b80 Deploy 0.274.2 to xplat (#52329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52329

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D77485965

fbshipit-source-id: 6a0b1a85696335a796133e665f41034e00d47ea3
2025-06-28 12:23:25 -07:00
George ZaharievandFacebook GitHub Bot 2e6cf96e47 Update hermes-parser and related packages in xplat/arvr/socialvr to 0.29.1 (#52316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52316

Bump hermes-parser and related packages to [0.29.1](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D77431991

fbshipit-source-id: d0ab4d7a338fdb68a529ed8151c7e1924600a809
2025-06-27 21:48:28 -07:00
Joe VilchesandFacebook GitHub Bot 132c2cdf12 Fix keyboard navigation if snapToAlignment is set
Summary:
There is an issue with keyboard navigation if some scroll view sets `snapToAlignment`. In this case, we are unable to find potential focus candidates if clipping is enabled since this prop will make it so that certain views in the hierarchy under the scroll view form a native view without any traits being set. The fix we have in place currently relies on `FormsStackingContext` to be set to discover potential candidates so it will break in this case. To fix this, we just return the entire ancestor list, since native will know how to deal with the cases that are not actual views, and in general has the official knowledge of what can be in the hierarchy or not.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D77467933

fbshipit-source-id: 35daaba06347c738cf7a85eef86adb7944a9cb26
2025-06-27 18:02:06 -07:00
Nick GerlemanandFacebook GitHub Bot 2d1db71bc0 Add global cache for Facsimile Layouts (#52308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52308

Experimentation shows, that we very heavily rely on the global text cache for performance (not sure how much of this is invalidation, vs repeated text, or revisiting previous surfaces).

This adds a global LRU cache, of prepared layouts, given a specific AttributedString and constraints. This is similar to the existing cache, with the caveat, that we need to have separate entries for any display states, instead of just those that effect metrics.

I sized it at 200 elements for now, since an Android `Layout` is much heavier than a `Size` (in practice, each seem to weight 1-3KB (though this will be significantly reduced with future change to move from `SpannableStringBuilder` to `SpannableString` and also contributes to the global JNI ref table, but set this up to be customizable via flag, so we can experiment, on perf impact, vs memory.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77341994

fbshipit-source-id: b453250dc475f6a281a3260b876bf80f301dd5dd
2025-06-27 14:37:33 -07:00
Soe LynnandFacebook GitHub Bot d96bbcdf0c Back out "Back out "Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless"" (#52323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52323

Original commit changeset: b144ca6db6f7

Original Phabricator Diff: D77388413

Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e

Original diff stack: D76908041
Revert diff stack: D77388940

Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file

Reviewed By: cortinico

Differential Revision: D77448293

fbshipit-source-id: ed40836c3ecb4ca551b23cb64de2c34cfda0dea1
2025-06-27 11:55:44 -07:00
Soe LynnandFacebook GitHub Bot faef2b1252 Back out "Back out "[react-native][PR] Migrate ReactDelegate to Kotlin"" (#52322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52322

Original commit changeset: 4a366205ea9c

Original Phabricator Diff: D77388940

Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e

Original diff stack: D76908041
Revert diff stack: D77388940

Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file

Reviewed By: cortinico

Differential Revision: D77448238

fbshipit-source-id: f41faa19f6761b7ed644e804019f5ec4738326a7
2025-06-27 11:55:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot ee02152fee Fix non standard hermes config internally (#52321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52321

Changelog: [Internal]
Allow non standard hermes internally.

Reviewed By: lenaic, rubennorte

Differential Revision: D77446774

fbshipit-source-id: 09919c8216932e15b2938d3e99b3df5d53e11c92
2025-06-27 09:47:34 -07:00
Vitali ZaidmanandFacebook GitHub Bot d5cd6ed152 Update debugger-frontend from d95ac13...35c4630 (#52317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52317

Changelog: [Internal] - Update `react-native/debugger-frontend` from d95ac13...35c4630

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/d95ac13bf0ab64a5e6c2eb18eb138587063b9c34...35c4630bd58bbcbc6f4c54c084b4e52994dc4940).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [35c4630bd](https://github.com/facebook/react-native-devtools-frontend/commit/35c4630bd) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-26T09:47:45+01:00 | [track stack trace symbolication failures (#183)](https://github.com/facebook/react-native-devtools-frontend/commit/35c4630bd) |
| [e4487ef2e](https://github.com/facebook/react-native-devtools-frontend/commit/e4487ef2e) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-24T14:29:35+01:00 | [support symbolication with native frames (#181)](https://github.com/facebook/react-native-devtools-frontend/commit/e4487ef2e) |

Reviewed By: huntie

Differential Revision: D77437936

fbshipit-source-id: 5b64195064aa5e157ae1adad01a3f2dc94045f98
2025-06-27 07:57:58 -07:00
Jakub PiaseckiandFacebook GitHub Bot 55d8581584 Cover versionExportedApis transform with tests (#52311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52311

Changelog: [Internal]

Adds test coverage for `versionExportedApis` transform

Reviewed By: huntie

Differential Revision: D77427733

fbshipit-source-id: 7bc6279602ce6a4194930fdaf0eb790c88425cd5
2025-06-27 07:00:39 -07:00
Jakub PiaseckiandFacebook GitHub Bot 5723de58b8 Explicitly cover more node types in versionExportedApis (#52310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52310

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77427734

fbshipit-source-id: d9b8caee508166b2d47d5a160b0e326c4cd7783e
2025-06-27 07:00:39 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 09ef774ff6 Add edge-to-edge opt-in support (#52088)
Summary:
This follows https://github.com/facebook/react-native/pull/47554

Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)

This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

- [Android] [Added] - Add edge-to-edge opt-in support

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

Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile

https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76834213

Pulled By: alanleedev

fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
2025-06-27 06:16:23 -07:00
Nicola CortiandFacebook GitHub Bot 78c9671c24 Migrate ThemedReactContext to Kotlin (#52309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52309

This is another class going from Java to Kotlin.
Thish should have no breaking changes, but I'll keep an eye to see if this is disruptive for users in the ecosystem.

I also haven't removed any of the Deprecated method, which can be cleaned up afterwards.

Changelog:
[Android] [Changed] - Migrate ThemedReactContext to Kotlin

Reviewed By: javache

Differential Revision: D77374236

fbshipit-source-id: d1787b21897b01c45bbf841fdda00972e0be58db
2025-06-27 05:00:05 -07:00
Alex HuntandFacebook GitHub Bot d4bf1b7af0 Remove experimental notice from V2 API snapshot and build by default (#52301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52301

Readying for imminent productionisation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77386064

fbshipit-source-id: 2769545eace4e6c09da0b2f0f34cf74b2fdcb730
2025-06-27 04:49:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot a0d4e18020 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/hermes/instrumentation (#52285)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52285

Reviewed By: cortinico

Differential Revision: D77359122

fbshipit-source-id: ad425cdfecf57210ae79a8bad25fde4896b476c1
2025-06-27 01:20:27 -07:00
Soe LynnandFacebook GitHub Bot fbd8281ab2 Back out "Migrate ReactDelegate to Kotlin" (#52304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52304

Investigating javascript crash regression between Store APK v269 and v270 T228736366 with mid https://www.internalfb.com/logview/system_vros_javascripterrors/4a0131b8b79e3994b639c7ca212db717?ds=%7B%22start%22%3A%221750796919%22%2C%22constraints%22%3A[]%2C%22end%22%3A%22now%22%7D&ds_nux_type=task

We suspect that this diff stack may be causing the issue could be caused by this Kotlin migration diff stack D76908041

Changelog: [Internal]
Reverting Kotlin migration for `ReactDelegate`

Reviewed By: gorodscy, mullender

Differential Revision: D77388940

fbshipit-source-id: 4a366205ea9c515a1561a4624b8d29e81ab9bae9
2025-06-26 14:44:36 -07:00
Soe LynnandFacebook GitHub Bot c360251b4a Back out "Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless" (#52303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52303

Investigating javascript crash regression between Store APK v269 and v270 T228736366 with mid https://www.internalfb.com/logview/system_vros_javascripterrors/4a0131b8b79e3994b639c7ca212db717?ds=%7B%22start%22%3A%221750796919%22%2C%22constraints%22%3A[]%2C%22end%22%3A%22now%22%7D&ds_nux_type=task

We suspect that this diff stack may be causing the issue could be caused by this Kotlin migration diff stack D76908041

Changelog: [Internal]
Reverting Kotlin migration for ReactDelegate

Reviewed By: mullender

Differential Revision: D77388413

fbshipit-source-id: b144ca6db6f75614c7988e474ef89f19714a4a09
2025-06-26 14:44:36 -07:00
Zeya PengandFacebook GitHub Bot 793023a4e2 Fewer calls to direct manipulation callback (#52296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52296

## Changelog:

[Internal] [Changed] - Fewer calls to direct manipulation callback

`NativeAnimatedNodesManager::onRender` is supposed to run each frame for c++ animation, from the callstack sample trace, the vast majority of time is spent on `updateNodes` (run update on all AnimatedNodes) and `commitProps` (where either Fabric ShadowTree commit or direct manipulation is called). Change in this PR is supposed to reduce time spent in `commitProps`

{F1979788964}

Reviewed By: sammy-SC

Differential Revision: D77380842

fbshipit-source-id: 2f25ca1fba4171a7b3e485298738379d0daff3ad
2025-06-26 14:17:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ffd6e5537d Remove RCTPushNotificationManager from umbrella header (#52306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52306

The RCTPushNotificationManager is deprecated and not part of the prebuilds as it is optional.
We mistakenly added it to the umbrella header and nightlies do not work with prebuilds.

This change removes the header ad should fix the build.

## Changelog:
[Internal] -

Reviewed By: philIip

Differential Revision: D77395754

fbshipit-source-id: 66371650dc56f5be16a00319d9e4a1078a7b68bd
2025-06-26 14:15:45 -07:00
Sam ZhouandFacebook GitHub Bot 505588b9aa Add annotations or make things readonly to prepare for object literal soundness fix in react-native (#52305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52305

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77386425

fbshipit-source-id: d69184abb1c8f7c516229aafe24dd418b5dd887e
2025-06-26 13:24:24 -07:00
Nick GerlemanandFacebook GitHub Bot a6a2884d63 Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback (#52276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52276

The line metrics reported do not process the Spannable, meaning their layout results may disagree with those used for measurement and display.

Changelog:
[Android][Fixed] - Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback

Reviewed By: lenaic

Differential Revision: D77261839

fbshipit-source-id: 87bdc86ce16a2ae9fa69532c5721c19567a53595
2025-06-26 12:09:54 -07:00
George ZaharievandFacebook GitHub Bot 56ccc87e63 Enable experimental.pattern_matching=true [DO NOT SHIP] (#52302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52302

Enable experimental.pattern_matching=true

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D77367102

fbshipit-source-id: a71352a58470c30fa7e466a67cb1909d80f0363e
2025-06-26 11:48:02 -07:00
Soe LynnandFacebook GitHub Bot ed756edd92 Back out "Revert D76757706: [iOS][RN] Fix LegacyViewManagerInteropComponentDescriptor" (#52269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52269

Relanding the reverted PR.

Differential Revision: D77282452

fbshipit-source-id: 1480d8ab067bbbb1b41a9cd03315748c1311f910
2025-06-26 11:21:43 -07:00
Andrew DatsenkoandFacebook GitHub Bot d0770ce425 Introduce isOSS (#52222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52222

Changelog: [Internal]
Introduce environment option to force usage of OSS fantom test runner.
If env is not set - check for BUCK file in tester which is checked in for FB but not for OSS.

Reviewed By: rubennorte

Differential Revision: D77160761

fbshipit-source-id: 1701ff140ff2be1bbeacfb4305e9f89089cacb42
2025-06-26 11:03:20 -07:00
Samuel SuslaandFacebook GitHub Bot e3f029fd17 make VirtualView hidden when it is not visible on screen (#52294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52294

changelog: [internal]

Views that are hidden provide couple perf benefits:
- The layer is skipped during hit-testing, so the view no longer receives touches.
- Compositing work for the layer is skipped, so nothing is uploaded to the GPU for that view.

Note, VirtualView still occupies space in memory and because this is infinite list and its numbers will grow unbounded.

In this diff, hidden = YES is only set when VirtualView does not participate in accessibility features.

Reviewed By: yungsters

Differential Revision: D76597973

fbshipit-source-id: 10eb36fccabba9e37cc6322ed5969b8502193a5f
2025-06-26 10:51:32 -07:00
Riccardo CipolleschiandFacebook GitHub Bot afb2afec26 Fix React-Fabric podspec to only use the sources for iOS (#52295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52295

The current setup for several of our podspecs abuses the `**` globbing mechanism, forcing us to specify some excluded folders.
By excplicitly mention the folders that we want to use on iOS, we can avoid the usage of the `exclude_files` property.

This should make the setup more reliable and it will also avoid to leak to OSS the presence of some folders we only use internally like `platform/macos` and `platform/windows`

## Changelog:
[Internal] -

Reviewed By: huntie

Differential Revision: D77381512

fbshipit-source-id: 4cb9118bf9f0ecd253d7d871341f733564d84c83
2025-06-26 10:46:39 -07:00
Alex HuntandFacebook GitHub Bot 895f9b444a Improve stable hash input for local type names (#52300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52300

Targeted improvement to `versionExportedApis` (D77303917) to reduce noise.

This eliminates the false positive from a rename to a local (unexported) type, that does not structurally change the shape of exported types.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D77314292

fbshipit-source-id: 4de90f5b5f1b622225762b2a73e386538000d54a
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot e50133a43d Support namespaced references in snapshot type versioning (#52299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52299

Correctness improvement to the `versionExportedApis` transform (D77303917). Now handles namespaced references (e.g. `Animated.Value`) by redirecting to the locally defined type name.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77314293

fbshipit-source-id: 6442d3ab0a3c8bebf6593455b1c2fb74266e657f
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot 050fb25c14 Add debug flag to show versionExportedApis graph in output (#52298)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52298

Exposes the ability to output inline debug annotations for the `versionExportedApis` transform (D77303917) as a formalised `--debug-version-annotations` CLI flag.

This is helpful for debugging and future maintenance, and will be used to show the effect of the next diffs.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77373723

fbshipit-source-id: 91c91abcb657ab88ee2f8209efccb4024602acc7
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot 94987205de Add versionExportedApis transform to JS API snapshot (#52292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52292

Adds a new transform that annotates all exported symbols in our V2 JS API snapshot with a version hash based on the shape of all input types.

This intends to be a reliable mechanism to indicate how changes to local types will ultimately affect exported types.

**Advantages** (over our alternative type inlining prototype)

- More intuitive to developers — in that source type changes are preserved closer to their original source code shapes.
- Enables useful Git blaming of individual exported APIs — hash for each export line will change every time a type is affected, and relevant commits can be looked up based on this.
- Handles recursive types.
- Can be **best-effort** with minimal structural effect over time. We are okay with false positives that over-match input type changes (these are refined later in the stack).
- Similar to this, is **lower risk** in terms of requiring future updates that may pollute the diff of the body of the API snapshot structurally.

**Example change**

Example type change with multiple references: D77378010

{F1979784798}

 8 char hash based on input type shapes printed next to each root-exported identifier
 For a source change to the `AccessibilityProps` type, 33 dependent exported types are updated with a new hash

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77303917

fbshipit-source-id: 9d43a617697418218eb4951e8e9858d125e222b3
2025-06-26 10:46:23 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot ffa6630243 Add API to get image loader instance from rncxx IMountingManager interface (#52293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52293

# Changelog:
[Internal] -

Adds a helper method to the `IMountingManager` API in order to get the platform specific image loader implementation, if available.

Reviewed By: christophpurrer

Differential Revision: D77379053

fbshipit-source-id: b7595d78c83e9270ec1818daf2d0f1d342661e52
2025-06-26 10:34:38 -07:00
Christian FalchandFacebook GitHub Bot 47b2fe4140 Refactored how we create umbrella, modulemap and header files (#52286)
Summary:
To make sure we are exposing the same public API to swift as without prebuilt, this commit changes the follow:

- ModuleMap / Umbrella file is generated from template, not dynamically to align with non-prebuilt (cocoapods). This is temporary, we are already working toward a solution to generate them dynamically.
- Headers are extracted by reading from podspec files and expanding their globs. This is now easy since we can use the podspec_sources function to look for file globs.

## Changelog:
[Internal] -  refactored header/umbrella/modulemap generation for prebuild

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

Test Plan:
- Run RN-tester with/without prebuilts
- Create new RN app based on nightly, build with/without prebuiltsTo make sure we expose all the swift features that we should, we expose and declare a variable from React_RCTAppDelegate

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77368255

Pulled By: cipolleschi

fbshipit-source-id: 88e2c9d1622753895c8667a9b5aeae4a0d332cc4
2025-06-26 10:25:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot ff97ca3134 Re-land Implement console.timeStamp
Summary:
# Changelog: [Internal]

Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].

NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.

Reviewed By: rubennorte

Differential Revision: D77374707

fbshipit-source-id: cb66b9fda06168f4b13af764afe95a63a0a8d5a0
2025-06-26 09:57:32 -07:00
pchalupaandFacebook GitHub Bot 0386b9bd51 Rename arguments of onContentSizeChange callback (#52291)
Summary:
The argument names in the `onContentSizeChange` callback's type definition differ from the [documentation](https://reactnative.dev/docs/scrollview#oncontentsizechange).

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[GENERAL] [FIXED] - Renamed argument names in the `onContentSizeChange` callback's type definition

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

Test Plan:
The IDE reflects updated argument names.
![Screenshot 2025-06-26 at 14 59 40](https://github.com/user-attachments/assets/1579998a-d9a8-4b98-a664-e5106ffb42f5)

Reviewed By: fabriziocucci

Differential Revision: D77373877

Pulled By: rshest

fbshipit-source-id: 2a171e1bc16103320f5ec31efab896f6b840fb96
2025-06-26 08:00:31 -07:00
Moti ZilbermanandFacebook GitHub Bot 49b7fff2a0 Support IPv6 dev server URLs in legacy standalone RDT connection
Summary:
Changelog: [Internal]

A minimal tweak to a legacy code path for React DevTools in React Native (**NOT** Fusebox!) that enables it to work / not crash when encountering an IPv6 dev server address. See doc comment for more.

Reviewed By: hoxyq

Differential Revision: D77150288

fbshipit-source-id: c11c742aad7b83861a1242dd13c5ed2753fbdf29
2025-06-26 07:59:16 -07:00
Zeya PengandFacebook GitHub Bot 63d8d978f5 Reduce call to folly::dynamic::object insert and remove unnecessary AnimatedNode::update calls (#52270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52270

## Changelog:

[Internal] [Changed] - Reduce call to `folly::dynamic::object` insert and remove unnecessary AnimatedNode::update calls

Reviewed By: christophpurrer

Differential Revision: D77315659

fbshipit-source-id: 656d7bcc957126ee8fa5a7463223273a93d31369
2025-06-26 06:52:05 -07:00
Jim Jetsada MachomandFacebook GitHub Bot 556957d458 Revert D76284119: Implement console.timeStamp
Differential Revision:
D76284119

Original commit changeset: c87c6645fe32

Original Phabricator Diff: D76284119

fbshipit-source-id: 186b09de34c3bb3a80eb62d5c14b47d04ca5a8e0
2025-06-26 06:09:05 -07:00
George ZaharievandFacebook GitHub Bot 7d84158700 Deploy 0.274.1 to xplat (#52287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52287

 Deploy 0.274.1 to xplat

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77349884

fbshipit-source-id: 44ebd2c111a6077dbf2e7beb60369283b2256feb
2025-06-26 05:45:51 -07:00
Ruslan LesiutinandFacebook GitHub Bot df0a2c847b Implement console.timeStamp (#52091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52091

# Changelog: [Internal]

Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].

NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.

Reviewed By: rubennorte

Differential Revision: D76284119

fbshipit-source-id: c87c6645fe32f56d84f5915ff57865cfd9723a47
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot 53d7e0f43b Move up forwardToOriginalConsole declaration (#52193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52193

# Changelog: [Internal]

Will be re-used for `console.timeStamp` installation.

Reviewed By: motiz88

Differential Revision: D77027561

fbshipit-source-id: ef251541d67011acd21fe9b2be87f9ac1a85a01e
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot c612ae424a @react-native/js-polyfills: polyfill console.timeStamp (#52168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52168

# Changelog: [Internal]

The main reason for the stub is to make sure this method is always installed. The actual implementation will be part of the `jsinspector-modern` stack, which is fully initialized in production builds.

Once there is a gurantee that RuntimeTarget globals are always installed in any environments, we can remove polyfills altogether.

Reviewed By: rubennorte, GijsWeterings

Differential Revision: D76987507

fbshipit-source-id: 2602af28f9e4359cf58dfafdf84802c0bf92372d
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3ed1af8a3c Fix incorrect rebase, apply lost changes (#52288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52288

# Changelog: [Internal]

Reviewed By: motiz88, rubennorte

Differential Revision: D77368159

fbshipit-source-id: 3beefb01d8e25596269c1212ce90864f39fd9f0c
2025-06-26 04:50:40 -07:00
Alex HuntandFacebook GitHub Bot fe0dc19131 Align devtoolsFrontendUrl within /json/list (#52289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52289

The old `devtools://devtools/...` URL is **unsupported** with our modern debugger backend.

This reference was something we'd been intentionally leaving in place to preserve the old experience in Flipper — we can now remove.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D77368319

fbshipit-source-id: 400183e9bc477a887d66d79b412277971cf425e5
2025-06-26 04:20:04 -07:00
Jakub PiaseckiandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 VilchesandFacebook GitHub Bot 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 ZilbermanandFacebook GitHub Bot 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 BaetsandFacebook GitHub Bot 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
generatedunixname89002005287564andFacebook GitHub Bot 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
generatedunixname89002005287564andFacebook GitHub Bot 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 ZaidmanandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 FalchandFacebook GitHub Bot 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ánandFacebook GitHub Bot 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 DatsenkoandFacebook GitHub Bot 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 LesiutinandFacebook GitHub Bot 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 LesiutinandFacebook GitHub Bot 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 LesiutinandFacebook GitHub Bot 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 LesiutinandFacebook GitHub Bot 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 SuslaandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 LefeverandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 CortiandFacebook GitHub Bot 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 FalchandFacebook GitHub Bot 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 FalchandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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 PiaseckiandFacebook GitHub Bot 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
generatedunixname89002005287564andFacebook GitHub Bot 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 YungandFacebook GitHub Bot 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 ZaharievandFacebook GitHub Bot 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 DoanandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 DatsenkoandFacebook GitHub Bot 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 CipolleschiandFacebook GitHub Bot 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 ZhouandFacebook GitHub Bot 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 AcostaandFacebook GitHub Bot 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 AcostaandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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 HuntandFacebook GitHub Bot 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
Alex HuntandFacebook GitHub Bot 11a1ad7a98 Expose *AnimationConfig types (#52227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52227

Changelog:
[General][Added] - Expose additional `*AnimationConfig` types on the `Animated` namespace

Differential Revision: D77222030

fbshipit-source-id: 8fd01d820c3c8d6e952a4115578ecc83ae7a0d0f
2025-06-24 08:55:21 -07:00
Alex HuntandFacebook GitHub Bot b01a5f91fe Expose Animated.InterpolationConfig type (#52224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52224

Changelog:
[General][Added] - `InterpolationConfig` is now exposed on the `Animated` namespace

Differential Revision: D77222031

fbshipit-source-id: c64c2f348bc899c598ee86c637300037a5a8de6f
2025-06-24 08:55:21 -07:00
Mateo GuzmánandFacebook GitHub Bot 65ae3dafcd Migrate UIManagerHelper to Kotlin (#52209)
Summary:
Migrate com.facebook.react.uimanager.UIManagerHelper to Kotlin.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D77210140

Pulled By: cortinico

fbshipit-source-id: 7a6669a6d92d33241d3f42edbabf20170a5a6ddf
2025-06-24 08:06:13 -07:00
Mateo GuzmánandFacebook GitHub Bot d3495fd162 Migrate ReactApplicationContext to Kotlin (#52208)
Summary:
Migrate com.facebook.react.bridge.ReactApplicationContext to Kotlin.

## Changelog:

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

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

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

Reviewed By: javache

Differential Revision: D77209812

Pulled By: cortinico

fbshipit-source-id: 2dae094d363e60efe05b4f2b3d55f0f84d921495
2025-06-24 08:03:22 -07:00
Andrew DatsenkoandFacebook GitHub Bot 252e1345bf Move fantom into OSS (#52201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52201

Changelog: [Internal]

Moving fantom tester into OSS.

Reviewed By: rubennorte

Differential Revision: D76928252

fbshipit-source-id: 3faf4a236eacba17896e0a440bac7a5032d063f9
2025-06-24 07:24:41 -07:00
Andrew DatsenkoandFacebook GitHub Bot dd1b795abe Introduce react_native_android_dep (#52194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52194

Changelog: [Internal]

Introducing a way to include sources and deps via function that react_native_android_dep.

This will help with Fantom OSS build.

Reviewed By: cortinico

Differential Revision: D77146189

fbshipit-source-id: 06b09d433741506bc1f58fbf1f9e6add9a9cff91
2025-06-24 07:24:41 -07:00
Mateo GuzmánandFacebook GitHub Bot c125f306c2 Kotlin: fix static code analysis weak warnings (4/n) (#52207)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Redundant curly braces in string template](https://www.jetbrains.com/help/inspectopedia/RemoveCurlyBracesFromTemplate.html)
- [Redundant call to toString() in string template](https://www.jetbrains.com/help/inspectopedia/RemoveToStringInStringTemplate.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (4/n)

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

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

Reviewed By: javache

Differential Revision: D77209873

Pulled By: cortinico

fbshipit-source-id: 2bf5fcf7dcbf02632e721aab0688f73d15f220b9
2025-06-24 06:36:11 -07:00
Alex HuntandFacebook GitHub Bot 03ab6a3098 Add nocommit to V2 JS API snapshot (#52200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52200

Remains in an experimental format. Add `\nocommit` to prevent accidental inclusion in the repo right now.

Also disable ESLint rule `redundant-undefined/redundant-undefined`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77150743

fbshipit-source-id: 645e7db5af2c2a648eef7c8f7e324bc1264b8065
2025-06-24 06:31:04 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 46b562b9b3 Ship the new React-Core-prebuilt.podspec in the package.json (#52221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52221

It is currently not possible to use prebuilds, because we are missing the `React-Core-prebuilt.podspec` from the npm package we publish.

This change should fix it.

## Changelog:
[iOS][Added] - Ship the `React-Core-prebuilt.podspec` in the package.json

Reviewed By: cortinico

Differential Revision: D77223271

fbshipit-source-id: ab068e1711fdd86f3f0069dc9aa3c0a591fcd26b
2025-06-24 06:01:36 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c1bf39bfdf Fix download of nightlies with SwiftPM (#52215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52215

We were not handling the download of the XML properly. Using `Net::HTTP.get` will directly return the body and that won't let us check on the status code of the response.

## Changelog:
[Internal] - use get_response instead of get when downloading the maven metadata

Reviewed By: cortinico

Differential Revision: D77216121

fbshipit-source-id: 4da0abff1624c687977a7b77db8a15f19e6b887d
2025-06-24 06:01:36 -07:00
nishan (o^▽^o)andFacebook GitHub Bot f238b74658 - Use CAGradientLayer for radial gradient (#52117)
Summary:
This PR replaces Core Graphics implementation with Core Animation for radial gradients. I found that `endPoints` for radial gradient type works differently than linear gradient type. The `endPoint.x` accounts for horizontal length and `endPoint.y` accounts for vertical. This makes it possible to draw ellipse gradients. So we don't need the core graphics API anymore.

## Changelog:

[IOS] [CHANGED] - Optimised Radial Gradients.

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

Pick one each for the category and type tags:

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

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

Test Plan: Non breaking change. Test Radial gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.

Reviewed By: rshest

Differential Revision: D77140709

Pulled By: javache

fbshipit-source-id: 6e3ad9fcf8e819d340ccf5f5946beb140e616cb0
2025-06-24 05:10:30 -07:00
Mateo GuzmánandFacebook GitHub Bot 76e2ab4ac8 Kotlin: fix static code analysis weak warnings (3/n) (#52206)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Return or assignment can be lifted out](https://www.jetbrains.com/help/inspectopedia/LiftReturnOrAssignment.html)
- [Verbose nullability and emptiness check](https://www.jetbrains.com/help/inspectopedia/VerboseNullabilityAndEmptiness.html)
- [Size check can be replaced with 'isNotEmpty()'](https://www.jetbrains.com/help/inspectopedia/ReplaceSizeCheckWithIsNotEmpty.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (3/n)

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

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

Reviewed By: javache

Differential Revision: D77209766

Pulled By: cortinico

fbshipit-source-id: c154ec6578125c16ad37c9dd15295a2edcacee4a
2025-06-24 04:55:33 -07:00
Mo JavadandFacebook GitHub Bot 35dba09724 Add explicit Build Tools Version to RN Tester Android App Benchmark (#52216)
Summary:
After bumping to SDK version 36, the build process for Android was still pulling in SDK v35 unnecessarily. This PR fixes that issue.

## Changelog:

[ANDROID] [FIXED] - Added explicit build tool version to RN Tester build.gradle to avoid automatic installation of Android SDK Build Tools.

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

Test Plan:
Tested in fork pipeline to ensure it's working correctly.

This is the logs from the pipeline before:
![image](https://github.com/user-attachments/assets/9dc7f158-8dea-437e-836e-e5f500b3d5ff)

And this is after the fix:
![image](https://github.com/user-attachments/assets/c6cc1c0a-5823-41cb-ba32-027b69d6eaa6)

Reviewed By: rshest

Differential Revision: D77219569

Pulled By: cortinico

fbshipit-source-id: 7a0ca462d00bfc4b015a30807aaef999ff60c719
2025-06-24 04:34:46 -07:00
Mateo GuzmánandFacebook GitHub Bot 9e96acbd0f Kotlin: fix static code analysis weak warnings (2/n) (#52205)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses:

- [Kotlin Java methods should be replaced with Kotlin analog](https://www.jetbrains.com/help/inspectopedia/ReplaceJavaStaticMethodWithKotlinAnalog.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (2/n)

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

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

Reviewed By: javache

Differential Revision: D77209667

Pulled By: cortinico

fbshipit-source-id: 09b01a170abf43248b8fdb6a08498d278b9d03bd
2025-06-24 03:40:58 -07:00
Alex HuntandFacebook GitHub Bot 40b8f4ad22 Adjust source types for better output (#52199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52199

Minor fixes to naming and generic type compatibility (→ TypeScript).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77148914

fbshipit-source-id: 2d3e65170f261b97ea8cf705d1a40a6f7bc5bcc7
2025-06-24 02:57:34 -07:00
George ZaharievandFacebook GitHub Bot 3306691d64 Update hermes-parser and related packages in xplat and socialvr to 0.29.0 (#52211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52211

Update hermes-parser and related packages in xplat and socialvr to 0.29.0

Changelog: [Internal]

Blocked on: https://fb.workplace.com/groups/relay.support/posts/28766057099682865

Reviewed By: SamChou19815

Differential Revision: D77004095

fbshipit-source-id: 5400ac07c0cbf1f9709d374929d842af9dd15d08
2025-06-23 19:19:50 -07:00
Antonio PiresandFacebook GitHub Bot f184b591cf adding scrollTo, and imperative handle exports for ScrollView (#52204)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52204

Changelog:
[General][Added] - Expose `ScrollViewImperativeMethods` and `ScrollViewScrollToOptions` types to public API

Reviewed By: huntie

Differential Revision: D76920770

fbshipit-source-id: 01b0a2788f7b8a3bad0b57e24b04a7380233ac34
2025-06-23 12:13:02 -07:00
Joe VilchesandFacebook GitHub Bot 62d8d30652 Revamp the accessibility order example in RNTester (#52122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52122

Would love to have a place with all the edge cases we can come back to when we try and tweak things.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D76942595

fbshipit-source-id: ce6e293e2c068383e54404af71a29a0586dbc04e
2025-06-23 11:07:52 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 60967fdffb Fix CQS signal modernize-use-nullptr in xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput (#52145)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52145

Reviewed By: javache

Differential Revision: D77010402

fbshipit-source-id: db2823f888b1fca279ff13f8a323e074fcdf61f0
2025-06-23 09:55:44 -07:00
Zane BaumanandFacebook GitHub Bot 4b91b63094 fix: add missing getNativeScrollRef type for ScrollView (#52203)
Summary:
### The Problem

When trying to measure the location of a `View` within a `ScrollView` (ie. for scrolling to the view), the current recommended method is to use `measureLayout` on the nested view to determine its location inside the containing scroll view:

```tsx
const MyComponent = () => {
  const scrollViewRef = useRef<ScrollView>(null);
  const nestedViewRef = useRef<View>(null);

  const scrollToNestedView = () => {
    if (!scrollViewRef.current || !nestedViewRef.current) {
      return;
    }

    nestedViewRef.current.measureLayout(
      scrollViewRef.current.getInnerViewNode(),
      (x, y) => { scrollViewRef.current.scrollTo({ y, animated: true }); },
    );
  }

  return (
    <ScrollView ref={scrollViewRef}>
      <View ref={nestedViewRef}>
        { /* content */ }
      </View>
    </ScrollView>
  );
}
```

This is valid in the Typescript types layer. However, the only two methods on `ScrollView` to use in this scenario that are [available in the type definitions](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts#L830) are `getScrollableNode` and `getInnerViewNode` – both of these methods [return a `number`](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L139-L140). The issue is that a `number` not a valid value to use with `measureLayout` because [its source returns early for that type](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js#L91-L102).

(Note, you can also use `findNodeHandle` with the scroll view ref, but this also returns a `number`.)

### The Solution

The long-term solution would be to update the types for both `measureLayout` and `ScrollView`. However, that would constitute a breaking change and require some fairly expansive updates. Instead, I am proposing an additive solution.

`ScrollView` has [a public method called `getNativeScrollRef`](https://github.com/facebook/react-native/blob/e69f0726cd2616fb112d2e4fabfeaafc8cada5d7/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L142) which returns the underlying `HostInstance`. This method correctly works in the runtime layer, but is not supported in the types layer. This PR exposes the public method in the type definition so that we can properly access the underlying instance without using `ts-ignore`.

## Changelog:[GENERAL] [FIXED] - Expose `ScrollView.getNativeScrollRef` on the type definition to allow accessing the underlying `HostInstance`.

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

Test Plan: None needed. This is only a type update exposing existing functionality.

Reviewed By: cortinico

Differential Revision: D77153959

Pulled By: rshest

fbshipit-source-id: 5880695da85406ed9fe49a1b736b5754db0e6382
2025-06-23 09:55:32 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 7f7655d711 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact (#52146)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52146

Reviewed By: javache

Differential Revision: D77014011

fbshipit-source-id: 35afa03482c9a4d1fe11325421615a7214337e2a
2025-06-23 09:52:30 -07:00
Dawid MałeckiandFacebook GitHub Bot 76e04fac82 Replace shelljs in run-ci-javascript-tests.js (#52095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52095

This diff removes `shelljs` from `run-ci-javascript-tests.js` and replaces `echo, exec, and exit` methods.

### Motivation

Decrease number of references to `shelljs` across the react-native-github.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76512374

fbshipit-source-id: 6e02901b570cf9a36bd13a075106a7066a85a2d9
2025-06-23 09:39:44 -07:00
Rubén NorteandFacebook GitHub Bot 18f4db44ef Clean up dead logic in RuntimeScheduler_Modern and simplify logic (#52192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52192

Changelog: [internal]

When we shipped the event loop we removed the need to run only expired tasks in `RuntimeScheduler_Modern`, but we never cleaned up the code properly. This does it.

Reviewed By: javache

Differential Revision: D77142978

fbshipit-source-id: f808edf80a134f487723fa36ab7a3593e4efe2d3
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 251eb3fd4c Log task ID when scheduling and executing tasks in RuntimeScheduler (#52191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52191

Changelog: [internal]

Some time ago we added logging for the timer ID in Systrace/Perfetto so we could see where timers were scheduled vs. executed.

This diff adds support for the same functionality for tasks in the runtime scheduler.

Reviewed By: javache

Differential Revision: D77039038

fbshipit-source-id: 792d2fe29b44fb209f9129f46f9d661dad7ebdff
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 3782fe865d Improve tracing metadata for IntersectionObserverManager (#52190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52190

Changelog: [internal]

This adds some tracing metadata to IntersectionObserver to contextualize the performance of certain operations (logging how many observers it's processing).

Reviewed By: javache

Differential Revision: D77039037

fbshipit-source-id: 9cee79ac0509f57e4658a16142f3fe2d10d71fdf
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 5742227dd8 Add Fantom benchmark for RuntimeScheduler (#52189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52189

Changelog: [internal]

This creates a benchmark to measure the changes in performance in RuntimeScheduler.

Reviewed By: javache

Differential Revision: D77142979

fbshipit-source-id: 1a6e6824f4c6fdb8d2c5cbad77fb4b8ba406ef29
2025-06-23 08:34:50 -07:00
Christian FalchandFacebook GitHub Bot 90654e4ba2 Integrate React Core prebuilds with apps (#52138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52138

Integrate React Core prebuilds with apps

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [ADDED] - Added support for using prebuilt RNCore with Cocoapods

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980286

Pulled By: cipolleschi

fbshipit-source-id: 0ef34599cf7a60e54f799708bce93bcf6fb9d950
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 60c01b4715 Update RNDependencies podspec to fail fast if framework is missing (#52134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52134

Update RNDependencies podspec to fail fast if framework is missing

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [CHANGED] - Fail fast when pod install i f using prebuild if frameworks are not present in the disk.

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980282

Pulled By: cipolleschi

fbshipit-source-id: 6ab029d0cb06e2f0a3d99ea9fc7b375865e7a966
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 69e028da45 Update the xcframework.js script to support swift (#52135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52135

Update the xcframework.js script to support Swift

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[INTERNAL] - Update the xcframework.js script to support Swift

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980285

Pulled By: cipolleschi

fbshipit-source-id: 4e5486b79c406ba4b375e2ada24cbe5450e2346f
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 152cb538f6 Update ReactCodegen to support Core prebuilds (#52137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52137

Update ReactCodegen to support Core prebuilds

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [CHANGED] - Update ReactCodegen to support Core prebuilds

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980283

Pulled By: cipolleschi

fbshipit-source-id: 4b120203e9e1628a63580b0b3b2e882837c0b818
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 2ec6e3d901 Update rndependencies.rb to use the same logic of rncore.rb (#52136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52136

Update rndependencies.rb to use the same logic of rncore.rb

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[INTERNAL] - Update rndependencies.rb to use the same logic of rncore.rb

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980284

Pulled By: cipolleschi

fbshipit-source-id: a7f09d931c66e2fdf468a09da4be1d40847f472b
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 1a86ee17fb Add React-Core-prebuild.podspec to integrate React native core prebuilds using cocoapods (#52133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52133

Add React-Core-prebuild.podspec to integrate React native core prebuilds using cocoapods

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [ADDED] - Add `React-Core-prebuild.podspec` to integrate React native core prebuilds using cocoapods

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980281

Pulled By: cipolleschi

fbshipit-source-id: ce102837d6df6ab0fa2e55862cc0c954125bd362
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 8888cf9a2d Introduce rncore.rb to manage the core prebuilds (#52109)
Summary:
Introduce rncore.rb to manage the prebuilds of RNCore.

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Added script to handle React Core prebuilds

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

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico, rshest

Differential Revision: D76979549

Pulled By: cipolleschi

fbshipit-source-id: 7a2b1809bf58b600293cc33ca2dcff0060f3fab0
2025-06-23 08:13:56 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 27c97ac942 Minimal implementation for ImageLoaderModule in ReactCxxPlatform (#52198)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52198

# Changelog:
[Internal] -

This provides an implementation of what was the RnCxx ImageLoaderModule stub inside ReactCxxPlatform, allowing the clients use dependency injection to provide the actual platform specific image loading functionality.

Reviewed By: javache

Differential Revision: D77015269

fbshipit-source-id: 7355dd75692c1f564de8c3daffd6c8a79182dc09
2025-06-23 07:44:36 -07:00
Nicola CortiandFacebook GitHub Bot e69f0726cd Make EventDispatcherImpl internal (#52154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52154

I wasn't able to find any meaningful usage of `EventDispatcherImpl` in OSS, therefore I'm making this class internal.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77024759

fbshipit-source-id: e1ff3329cedf96a8c75edb9b9ccc1ce21adfab11
2025-06-23 07:35:06 -07:00
Nicola CortiandFacebook GitHub Bot 1ced97fbe6 Convert EventDispatcherImpl to Kotlin (#52150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52150

This is another class moving from Java to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77021952

fbshipit-source-id: 0b04a10bcbe65b7dc14ddd2821f80d90a43f8610
2025-06-23 07:35:06 -07:00
Nicola CortiandFacebook GitHub Bot ff7e24f19a @DoNotStrip ReactModalHostView to prevent instacrash on release (#52195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52195

RNTester is currently instacrashing on release due to use minifying the `ReactModalHostView`.
In that class there is a static method that is accessed by JNI so we should annotated this class
as `DoNotStrip` as otherwise we won't be able to access it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D77148010

fbshipit-source-id: c5b2758fa2919bc1f5885433202a45b4c3f8ff99
2025-06-23 07:24:47 -07:00
Nicola CortiandFacebook GitHub Bot d9ec57a3b9 Add further logging to help investigate T228303477 (#52185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52185

It seems like one of the activity on the stack is not properly implementing `DefaultHardwareBackBtnHandler`.
This will make the crash more clear as it will be clear which activity is the one responsible for the crash.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77142320

fbshipit-source-id: 1913976d1ad5d3ceafcfc0569f3b74dad9e919ae
2025-06-23 06:07:50 -07:00
Nicola CortiandFacebook GitHub Bot 33fed54a16 Truncate the changelog pre-80 to a separate file.
Summary:
Splitting the CHANGELOG as it's getting too big to handle.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D77025333

fbshipit-source-id: cf2d54f2096f9c8c6a3fadb354d0c3065370440d
2025-06-23 06:00:07 -07:00
Andrew DatsenkoandFacebook GitHub Bot 7b7b538d6b fix cmake empty spaces and naming (#52186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52186

Changelog: [Internal]
Minor fixes to spacing in cmake files and naming inconsistency

Reviewed By: cortinico

Differential Revision: D77141854

fbshipit-source-id: d1e12e571dbc0f7630d9d38faad7b22d0833dd2f
2025-06-23 04:25:59 -07:00
Pieter De BaetsandFacebook GitHub Bot 9612d2e225 NativeAnimated Kotlin nits (#52148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52148

Address some Android Studio lint suggestions

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77017839

fbshipit-source-id: c0e025ee7eaae74560cfc8ff6ecc45a893e0dda1
2025-06-23 04:24:58 -07:00
Pieter De BaetsandFacebook GitHub Bot ee8b66e278 View clipping Kotlin nits (#52147)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52147

Simplify some of the nullability / checkNotNull behaviour

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76334294

fbshipit-source-id: 32c2d0ab50713789ddf6af5e40083bae2161c91f
2025-06-23 04:24:58 -07:00
Susmita HorrowandFacebook GitHub Bot f214a52a9a Revert D76814453: Reduce symbol collisions in the API snapshot
Differential Revision:
D76814453

Original commit changeset: fffbf585d63e

Original Phabricator Diff: D76814453

fbshipit-source-id: 418ae90fb49c8c05f077bca7e434c039ad49c7ba
2025-06-23 01:43:20 -07:00
Jakub PiaseckiandFacebook GitHub Bot f338db9c17 Reduce symbol collisions in the API snapshot (#52085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52085

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76814453

fbshipit-source-id: fffbf585d63e282443830c08397ae5e4d745785a
2025-06-23 00:34:05 -07:00
Jakub PiaseckiandFacebook GitHub Bot fe4047fe3a Replace ElementConfig with directly imported props (#51971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51971

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76502294

fbshipit-source-id: ed98c5e6d9ef5fd6a4d1adbd6a88ce8cda52b969
2025-06-22 23:58:45 -07:00
Andrew DatsenkoandFacebook GitHub Bot 9f479ff8d6 Add react_cxx_platform_react_utils cmake (#52177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52177

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_utils

Reviewed By: christophpurrer

Differential Revision: D77038580

fbshipit-source-id: 7cdd8defd57629342095587bd3e1819e04af50bd
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot dda8ab69d4 Add react_cxx_platform_react_threading cmake (#52176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52176

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_threading

Reviewed By: christophpurrer

Differential Revision: D77038544

fbshipit-source-id: 950e28af49c5de3870e11e03d5123f22a0f04a6b
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot f04d1f1ef7 Add react_cxx_platform_react_runtime cmake (#52178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52178

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_runtime

Reviewed By: christophpurrer

Differential Revision: D77038450

fbshipit-source-id: 54515f1aff84632c8a86abd8970107a1bd8ca043
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 54a1e41694 Add react_cxx_platform_react_renderer_uimanager cmake (#52175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52175

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_uimanager

Reviewed By: christophpurrer

Differential Revision: D77038183

fbshipit-source-id: 736651e170884f69313711f744c40194f259bfa1
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 269cf58140 Add react_cxx_platform_react_renderer_scheduler cmake (#52174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52174

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_scheduler

Reviewed By: christophpurrer

Differential Revision: D77038129

fbshipit-source-id: f843c719d08f42f379042484542f4f4e5b94a2c6
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 941853974b Add react_cxx_platform_react_renderer_animated cmake (#52173)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52173

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_animated

Reviewed By: christophpurrer

Differential Revision: D77038030

fbshipit-source-id: 6ca45f0251c74dc49b5c1d72c42575b80248eb2a
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 36c0826f56 Add react_cxx_platform_react_profiling cmake (#52172)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52172

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_profiling

Reviewed By: christophpurrer

Differential Revision: D77037934

fbshipit-source-id: 555a00cc59d48fd167810ba29075fb4cb3e53d62
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 7970f79078 Add react_cxx_platform_react_nativemodule cmake (#52171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52171

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_nativemodule

Reviewed By: christophpurrer

Differential Revision: D77037835

fbshipit-source-id: 09346824c5e39ca9c41edeb22462d65408d95f18
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 37e863e866 Add react_cxx_platform_react_logging cmake (#52170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52170

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_logging

Reviewed By: christophpurrer

Differential Revision: D77037715

fbshipit-source-id: ea21160473d876c0014dcfc2d17323b2e0c4c0b2
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 5961edd825 Add react_cxx_platform_react_io cmake (#52169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52169

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_io

Reviewed By: christophpurrer

Differential Revision: D77037593

fbshipit-source-id: 849c2b0b0de14b9a583b997f3137763df59b4af1
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 71d6d86ed6 Add react_cxx_platform_react_http cmake (#52167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52167

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_http

Reviewed By: christophpurrer

Differential Revision: D77037486

fbshipit-source-id: 7e90ed26cefa407a1e64ebdad8ac5835803c2c49
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 0a7e1342cd Add react_cxx_platform_react_devsupport cmake (#52166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52166

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_devsupport

Reviewed By: christophpurrer

Differential Revision: D77037372

fbshipit-source-id: e6ed42492f29abfb93fe22b0c01a5d3a2ca7cf53
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 891656d055 Add react_cxx_platform_react_coremodules cmake (#52165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52165

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_coremodules

Reviewed By: christophpurrer

Differential Revision: D77036283

fbshipit-source-id: 54141d32f61d1025ae40c60335a6831ec038217e
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot abbef4a0b8 Add react_renderer_observers_mutation cmake (#52164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52164

Changelog: [Internal]
Add cmake library react_renderer_observers_mutation

Reviewed By: christophpurrer

Differential Revision: D77036195

fbshipit-source-id: 6661b6aecab83b1fd254dd7f7fca1c906538aee5
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot e888329e9a Add react_renderer_observers_intersection cmake (#52163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52163

Changelog: [Internal]
Add cmake library react_renderer_observers_intersection

Reviewed By: christophpurrer

Differential Revision: D77036086

fbshipit-source-id: 9f7c2c9574c09f7775362a6155433fa194111f0b
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1f8374e1dd Add react_nativemodule_webperformance cmake (#52162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52162

Changelog: [Internal]
Add cmake library react_nativemodule_webperformance

Reviewed By: christophpurrer

Differential Revision: D77035999

fbshipit-source-id: da267ddf10d9a9de315038142f7764d81190131a
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot a10ee5808b Add react_nativemodule_mutationobserver cmake (#52161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52161

Changelog: [Internal]
Add missing lib react_nativemodule_mutationobserver

Reviewed By: christophpurrer

Differential Revision: D77035742

fbshipit-source-id: f900024f0ad4f4e4596c4fa5730463277ee17242
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ab2ce4f2d8 add react_nativemodule_intersectionobserver cmake (#52160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52160

Changelog: [Internal]
Add missing cmake lib for react_nativemodule_intersectionobserver

Reviewed By: christophpurrer

Differential Revision: D77035609

fbshipit-source-id: d6c372d48a2c60b403b33d1477e6085347fe8633
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ee256d11ae Add react_nativemodule_fantomspecificmethods cmake (#52159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52159

Changelog: [Internal]
Add missing cmake target for react_nativemodule_fantomspecificmethods

Reviewed By: christophpurrer

Differential Revision: D77035521

fbshipit-source-id: caedff8d4479c1bff3d03ec149b15a8cd5458092
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1f53d51e64 RN] Add missing link libraries for react_nativemodule_defaults (#52158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52158

Changelog: [Internal]
As title

Reviewed By: christophpurrer

Differential Revision: D77035424

fbshipit-source-id: 745cecd5e6d16a8cea6b2a883992fec75b565d31
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 4f71a9434d Create react/nativemodule/cputime/CMakeLists.txt (#52157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52157

Changelog: [Internal]

Add CMakeLists for `react/nativemodule/cputime`

Reviewed By: christophpurrer

Differential Revision: D77035337

fbshipit-source-id: c18289ed0558f8be7ba62f71bd74978a7c768e11
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ed9969b3d0 Fix cmake build for devtoolsruntimesettings (#52156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52156

Changelog: [Internal]

Fix devtoolsruntimesettings lib as it needs to be OBJECT library as it has source code included.

Reviewed By: christophpurrer

Differential Revision: D77035122

fbshipit-source-id: 27ad7fe637512afc79f3dcc6b0846dcfd4f22504
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 04da4800da Gate RN_SERIALIZABLE_STATE behind ANDROID flag (#52155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52155

Changelog: [Internal]

Gating RN_SERIALIZABLE_STATE behind ANDROID flag so we can build ReactCommon with cmake when targeting different platforms.
This will help build reac-native-fantom for OSS.

Reviewed By: christophpurrer

Differential Revision: D77034689

fbshipit-source-id: 15f9192c90693f4743f31fcf72f593802b622c47
2025-06-22 23:48:38 -07:00
Jakub PiaseckiandFacebook GitHub Bot bc093b8fa9 Remove undefined from optional type members in the API snapshot (#52009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52009

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76596252

fbshipit-source-id: 3d6c0ee10cbbb71435933e2ad74f1acc962f14b4
2025-06-22 23:29:29 -07:00
buschcoandFacebook GitHub Bot fbbd20dd63 publish index.js.flow instead of index.flow.js (#52179)
Summary:
I think in https://github.com/facebook/react-native/commit/50667eceb1be4771375d6a3cc2f4e42d4d8aad3a the file name was mixed up. Instead of `index.flow.js` it should be `index.js.flow` (see https://github.com/facebook/react-native/blob/main/packages/react-native/index.js.flow)

Should fix https://github.com/facebook/react-native/issues/51885

## Changelog:

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

[General][Added] Publish top-level Flow types for `react-native`

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

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

Test Plan:
Steps to reproduce

1. Setup a react-native project with flow (or clone https://github.com/buschco/react-native-flow + `cd ReproducerApp && npm i`)
2. `import {Alert} from 'react-native'` -> `Alert` has type `any`
3. add `index.js.flow` File (https://github.com/facebook/react-native/blob/v0.79.3/packages/react-native/index.js.flow) to `node_modules/react-native/index.js.flow` -> `Alert` no longer `any`

Reviewed By: christophpurrer

Differential Revision: D77052871

Pulled By: robhogan

fbshipit-source-id: 32b0052a9d96486aff66a1f6e4577ff62cbcd97e
2025-06-21 01:06:03 -07:00
Zeya PengandFacebook GitHub Bot 710e08cd54 Add Fantom test for layout props & fix an issue in c++ animated (#52110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52110

## Changelog:

[General] [Internal] - Add Fantom test for layout props

With this test it turns out `layoutStyleUpdated_` on PropsAnimatedNode actually can change after animation update, because its connected StyleAnimatedNodes might be changing. This bug was introduced since D74602321

Reviewed By: rshest

Differential Revision: D76753864

fbshipit-source-id: 5bebb11340086390df20c89adf80abaa63cadc90
2025-06-20 16:04:48 -07:00
Zeya PengandFacebook GitHub Bot cc442eb8c8 Add Fantom.getFabricUpdateProps (#52108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52108

## Changelog:

[General] [Added] - Add Fantom.getFabricUpdateProps

For reading fabric update props scheduled via `UIManager::updateShadowTree`

Reviewed By: rshest

Differential Revision: D76857429

fbshipit-source-id: d19312d0b1c6460258a7949054e66313f05afdbf
2025-06-20 16:04:48 -07:00
Mateo GuzmánandFacebook GitHub Bot aaad7e083d Kotlin: fix static code analysis weak warnings (1/n) (#52153)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Convert to primary constructor](https://www.jetbrains.com/help/inspectopedia/ConvertSecondaryConstructorToPrimary.html)
- [If-Then foldable to '?.'](https://www.jetbrains.com/help/inspectopedia/IfThenToSafeAccess.html)
- [Non-canonical modifier order](https://www.jetbrains.com/help/inspectopedia/SortModifiers.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (1/n)

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

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

Reviewed By: christophpurrer

Differential Revision: D77042260

Pulled By: arushikesarwani94

fbshipit-source-id: ea210976ccbcecbe4843ff5205238a83fc75d43b
2025-06-20 16:03:34 -07:00
Nicola CortiandFacebook GitHub Bot 999f437b02 Add categories for 0.80 changelog
Summary:
I've added categories for all the entries + sorted them alphabetically.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: fabriziocucci

Differential Revision: D77025334

fbshipit-source-id: 4c29bf3fa299078689473d7cf3c7cf8a79f4c097
2025-06-20 10:21:52 -07:00
Pieter De BaetsandFacebook GitHub Bot ffb37373ba Schedule OnViewAttachMountItems in GuardedRunnable (#52143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52143

Noticed that some of the `IndexOutOfBoundsException` crashes we've been tracking we're not being reported as soft errors because they were not running wrapped by the RN ExceptionHandler

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77017423

fbshipit-source-id: 760297a0c5ee3d58577931829a31d312dacffdf1
2025-06-20 08:42:32 -07:00
Alex HuntandFacebook GitHub Bot e297fe1582 Improve CLI output for build-types (#52151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52151

Update `yarn build-types` with incremental progress output in the terminal. Minor refactoring.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77022957

fbshipit-source-id: d4a000a85c779fbdcda317164413b29674474178
2025-06-20 08:21:29 -07:00
Andrew DatsenkoandFacebook GitHub Bot 386a930afb HermesInstance::createJSRuntime integration (#52111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52111

Changelog: [Internal]

JSRuntime integration with executor on messagequeue.

Inching closer to full integration with the rest of RN.

Reviewed By: rshest

Differential Revision: D76752667

fbshipit-source-id: 0ef8fe0c615dc1eb45355f7502e01663772ebf13
2025-06-20 07:08:28 -07:00
Nicola CortiandFacebook GitHub Bot 281f48daf4 Bump compileSdk to 36 (#52141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52141

This is to make sure we're using buildTools 36 (Android 16) to compile everything.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D77014531

fbshipit-source-id: 65b16abce7f88c4a4c0b8b1b77e632cff2e64197
2025-06-20 06:09:47 -07:00
Mateo GuzmánandFacebook GitHub Bot a44098ea27 Kotlin: clean up redundant visibility modifiers (2/2) (#52139)
Summary:
Follow up from https://github.com/facebook/react-native/issues/51960, this PR cleans up the remaining warnings for redundant visibility modifiers detected by static code analysis.

## Changelog:

[INTERNAL] - Kotlin: clean up redundant visibility modifiers (2/2)

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

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

Reviewed By: cortinico

Differential Revision: D76997415

Pulled By: sbuggay

fbshipit-source-id: 77244dc83f8ecbf90cf3ade0f299930871ab3ae9
2025-06-20 00:00:28 -07:00
Arushi KesarwaniandFacebook GitHub Bot 0f7bf66bba Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless (#52112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52112

Adding `shouldForwardToReactInstance` check in Bridgeless since it was missed in https://github.com/facebook/react-native/pull/43351

**Changelog:**
[ANDROID][FIXED] - Adding `shouldForwardToReactInstance` check in ReactDelegate for Bridgeless

Reviewed By: cortinico, javache

Differential Revision: D76908041

fbshipit-source-id: 20b8fce248d8e560ab862cf325b6f8b15be870e3
2025-06-19 18:37:50 -07:00
Sophie LandFacebook GitHub Bot 14a213229a fix: improve the grammar/clarity of the stale bot comments (#52124)
Summary:
this PR makes the stale bot messages a bit clearer and fixes a grammatical issue.

# Changelog:

[INTERNAL] [FIXED] Tweak stale bot messages

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

Test Plan: N/A

Reviewed By: andrewdacenko

Differential Revision: D76969503

Pulled By: cortinico

fbshipit-source-id: d030a0488b44521f61447e252bae5ded10826dbb
2025-06-19 10:42:05 -07:00
Nicola CortiandFacebook GitHub Bot 4223285a23 Fix broken LayoutableShadowNodeTest after Modal fix. (#52130)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52130

After D73948178, Modals now need to access JNI to get the dimension of the
screen to properly position the modal on first rendering.

Before my change, the Modal was positioned in 0,0 (which is the default
behavior for CXX).
I'm suppressing this test for Android, as it will keep on running with the
previous behavior for CXX.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979787

fbshipit-source-id: 78675712f97baee29036f943b2a8bcd23047e4ed
2025-06-19 10:31:53 -07:00
Nicola CortiandFacebook GitHub Bot 55b87a5293 Make PointerEvent internal (#52131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52131

This class is not used in OSS and can be made internal.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979122

fbshipit-source-id: 2d81e3605e6c51336b3bdb2671dd9faf8f25639b
2025-06-19 09:59:27 -07:00
Nicola CortiandFacebook GitHub Bot 0cf2985d27 Convert PointerEvent to Kotlin (#52132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52132

This is yet another class that is getting converted from Java to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979123

fbshipit-source-id: d1fc54e61d64b78a56cf0198ae5fe588702a8698
2025-06-19 09:59:27 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 2f3b104224 - Use CAGradientLayer for linear gradient (#52096)
Summary:
This PR replaces Core Graphics implementation with Core Animation for linear gradients. I came across a great [solution](https://stackoverflow.com/questions/38821631/cagradientlayer-diagonal-gradient/43176174#43176174) that makes the `CAGradientLayer`'s start and end point behaviour CSS spec compliant. This will make gradients much more performant.

## Changelog:

[IOS] [CHANGED] - Optimised Linear Gradients.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

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

Test Plan:
Non breaking change. Test Linear gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.

## Note:

I will be doing a PR to use `CAGradientLayer` for radial gradients as well. The next properties that I have locally working are `background-size`, `background-position` and `background-repeat`. These will be addressed in small PRs.

Reviewed By: NickGerleman

Differential Revision: D76905215

Pulled By: javache

fbshipit-source-id: 0094bdf70869d619272d491dd496983316b0dbf0
2025-06-19 09:50:45 -07:00
Pieter De BaetsandFacebook GitHub Bot 6a3116a8a9 Add screenshot tests for LinearGradient (#52128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52128

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D76972006

fbshipit-source-id: 657b78a842578df46f81d2416726665f49655a4f
2025-06-19 09:50:45 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 432ad09c41 Remove usage of SafeAreaView from RNTester (#52129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52129

This remove all the usages of SafeAreaView from RNTester.
The problem is that we introduced a warning that SafEAreaView is deprecated and, therefore, we had a warning in debug mode.

This was causing a yellow bubble to appear and the OSS E2E test started failing.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76978227

fbshipit-source-id: c45a31bae1602bc307e4fbbd71e7987a8ed78858
2025-06-19 09:29:40 -07:00
Nicola CortiandFacebook GitHub Bot b950fa2afb Fix Modal first frame being rendered on top-left corner (#51048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51048

Fixes https://github.com/facebook/react-native/issues/50442
Closes https://github.com/facebook/react-native/pull/50704

Users reported that Modals on Android are first renderer anchored in 0,0.
That results in them being on the top left corner of the screen for some seconds.

This is happening because the native state of the Modal on Android as width/height set at 0,0 - which we then update in a subsequent callback.

I'm fixing this by making sure we render the Modal the first time with the right screen size - the status bar size

Changelog:
[Android] [Fixed] - Fix Modal first frame being rendered on top-left corner

Reviewed By: javache

Differential Revision: D73948178

fbshipit-source-id: 055c12aa62d70acc1e4c5a2a5c4ea0c5608e22c7
2025-06-19 06:21:16 -07:00
Ruslan LesiutinandFacebook GitHub Bot 52df5dee91 Update debugger-frontend from 68cfd0a...d95ac13 (#52119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52119

Changelog: [Internal] - Update `react-native/debugger-frontend` from 68cfd0a...d95ac13

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/68cfd0ae84acb0ed8e47b421afd64ae3b0b5b727...d95ac13bf0ab64a5e6c2eb18eb138587063b9c34).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [d95ac13bf](https://github.com/facebook/react-native-devtools-frontend/commit/d95ac13bf) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-18T12:35:02+01:00 | [fix: hide workplace suggest on Sources placeholder element (#180)](https://github.com/facebook/react-native-devtools-frontend/commit/d95ac13bf) |

Reviewed By: huntie

Differential Revision: D76919604

fbshipit-source-id: 55aa28f9fc9288df71019e8ca9001b35863395b1
2025-06-19 05:08:55 -07:00
Mateo GuzmánandFacebook GitHub Bot 50ea5b4380 Migrate ReactDelegate to Kotlin (#52024)
Summary:
Migrate com.facebook.react.ReactDelegate to Kotlin.

## Changelog:

[ANDROID][BREAKING] - Migrate com.facebook.react.ReactDelegate to Kotlin. Some users implementing this class in Kotlin could have breakages.

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

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

Reviewed By: javache

Differential Revision: D76740335

Pulled By: cortinico

fbshipit-source-id: d9ad948a71438070500685042c067f621fd3ea26
2025-06-19 04:33:53 -07:00
Nicola CortiandFacebook GitHub Bot 184664d47b Fix support for react.internal.useHermesNightly (#52127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52127

Currently using `react.internal.useHermesNightly` is broken locally because we try to search for versions such as 0.0.0.+ while the nightlies version are of the form 0.81.0-...

This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D76901197

fbshipit-source-id: 51f7b2e7ec936aace67d4d62a8019554800347fc
2025-06-19 03:51:52 -07:00
Mateo GuzmánandFacebook GitHub Bot 2b75479fa2 Migrate to Kotlin and internalize MountItemDispatcher (#52121)
Summary:
Migrate to Kotlin and internalize com.facebook.react.fabric.mounting.MountItemDispatcher.

This class has [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.mounting.MountItemDispatcher) so it can be internalized as well as it exposes some other internal classes and we don't want to make those public again.

## Changelog:

[ANDROID][CHANGED] - Migrate to Kotlin and internalize com.facebook.react.fabric.mounting.MountItemDispatcher

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

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

Reviewed By: cortinico, rshest

Differential Revision: D76967018

Pulled By: javache

fbshipit-source-id: def4be448db15705fc11e50e3fe8f9e532d973bb
2025-06-19 03:48:27 -07:00
Rubén NorteandFacebook GitHub Bot 2a52ee8ddb Clean up feature flag enableIntersectionObserverEventLoopIntegration (#52102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52102

Changelog: [internal]

This ships the variant of IntersectionObserver that integrates directly with the Event Loop, avoiding dispatching notifications during observation and waiting for the end of the Event Loop tick instead. Also cleans up all the associated feature flags.

Reviewed By: lenaic

Differential Revision: D76892649

fbshipit-source-id: 9364b43a4d60b75c25b9a2d6ced7937b03376b04
2025-06-19 02:48:39 -07:00
Mateo GuzmánandFacebook GitHub Bot 1d945629bf Clean up incorrect @VisibleForTesting annotation usages (#52025)
Summary:
Static code analysis reports 18 warnings for incorrect usages of the `VisibleForTesting` annotation as some of the classes/functions/properties that are annotated are not used only in tests but also in other non-test files across the codebase. This PR cleans that up to fix those warnings.

## Changelog:

[INTERNAL] - Clean up incorrect VisibleForTesting annotation usages

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

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

Reviewed By: rshest

Differential Revision: D76745241

Pulled By: sbuggay

fbshipit-source-id: 4702a7258002916cc95c178dc8931c8bb471f7bc
2025-06-18 22:25:09 -07:00
Mateo GuzmánandFacebook GitHub Bot 7885508f9b Migrate ReactTextShadowNode to Kotlin (#52116)
Summary:
Migrate com.facebook.react.views.text.ReactTextShadowNode to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.views.text.ReactTextShadowNode to Kotlin

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

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

Reviewed By: NickGerleman

Differential Revision: D76930707

Pulled By: sbuggay

fbshipit-source-id: 8e5c2c1b96ccaa2185d5c7f606e204470c401cbd
2025-06-18 20:59:02 -07:00
Joe VilchesandFacebook GitHub Bot 5e331304cb Comma separate co-opted accessibility labels (#52120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52120

It is pretty jarring for semantically different labels to be read all at once, let's comma separate them - which VoiceOver will pause at. Android does this by default with its coopting implementation

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D76921000

fbshipit-source-id: afe1f93e38babde918137576d0693c1579101ef7
2025-06-18 15:20:56 -07:00
Luna WeiandFacebook GitHub Bot f00b449498 Export unstable_VirtualView with iOS, Android implementations (#51980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51980

Changelog: [Internal] - Export unstable_VirtualView. This is currently experimental

Reviewed By: mdvacca

Differential Revision: D76471250

fbshipit-source-id: 107b82c9ac93b31d7e30ea3473e341788176cdde
2025-06-18 14:11:39 -07:00
Peter AbbondanzoandFacebook GitHub Bot 94cbf206d6 Remove focus change listener and restore original when dropping view instance (#52093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52093

This change updates the `BaseViewManager` implementation to drop and restore the original focus listener when a view instance has its `onDropViewInstance` method called. This is necessary to support view recycling, since the `addEventEmitters` method is called each time a recycled view is popped out of the stack. This would result in N+1 `onFocus`/`onBlur` calls for each time the view is recycled.

Changelog: [Android][Fixed] - Remove focus change listener when dropping/recycling view instances

Reviewed By: NickGerleman

Differential Revision: D76852137

fbshipit-source-id: 9e980e7a1850a952baf04724bc251ff32186c6fa
2025-06-18 11:21:32 -07:00
Rubén NorteandFacebook GitHub Bot 6bfc1187a8 Improve formatting for benchmark output (#52106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52106

Changelog: [internal]

This slightly improves the formatting of the output produced by benchmarks, so we can just copy&paste the result to share it as valid Markdown.

Reviewed By: christophpurrer

Differential Revision: D76898244

fbshipit-source-id: dc1040ee3787c7f0dcb747c9fba8eb14086a0087
2025-06-18 09:36:36 -07:00
Rubén NorteandFacebook GitHub Bot 29704b1f02 Add support for Static Hermes staging in Fantom (#52105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52105

Changelog: [internal]

I just learnt there's a Hermes variant that we don't support (staging) so this adds support for it.

Reviewed By: christophpurrer

Differential Revision: D76897715

fbshipit-source-id: 3113edde3c785d71ad4a57dd435f16e13ab46976
2025-06-18 09:36:36 -07:00
892 changed files with 36799 additions and 24836 deletions
+2 -1
View File
@@ -47,6 +47,7 @@ packages/react-native/flow/
[options]
enums=true
experimental.pattern_matching=true
casting_syntax=both
component_syntax=true
@@ -103,4 +104,4 @@ untyped-import
untyped-type-import
[version]
^0.273.1
^0.275.0
@@ -15,8 +15,6 @@ runs:
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
@@ -45,6 +43,8 @@ runs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install
@@ -14,23 +14,23 @@ runs:
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: 'D:\tmp\hermes'
path: 'C:\tmp\hermes'
- name: Set up workspace
shell: powershell
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p C:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4
with:
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
C:\tmp\hermes\win64-bin\
C:\tmp\hermes\hermes\icu\
C:\tmp\hermes\hermes\deps\
C:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
@@ -83,4 +83,4 @@ runs:
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
path: C:\tmp\hermes\win64-bin\
+3 -3
View File
@@ -116,12 +116,12 @@ runs:
- name: Print Artifacts Directory
shell: bash
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Build packages
@@ -129,7 +129,7 @@ runs:
run: yarn build
- name: Build types
shell: bash
run: yarn build-types
run: yarn build-types --skip-snapshot
# Continue with publish steps
- name: Set npm credentials
if: ${{ inputs.release-type == 'release' ||
@@ -14,6 +14,8 @@ inputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn install
uses: ./.github/actions/yarn-install
- name: Configure Git
@@ -0,0 +1,23 @@
name: diff-js-api-breaking-changes
description: Check for breaking changes in the public React Native JS API
runs:
using: composite
steps:
- name: Fetch snapshot from PR head
shell: bash
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
run: |
mkdir $SCRATCH_DIR
git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|| echo "" > $SCRATCH_DIR/ReactNativeApi.d.ts
- name: Run breaking change detection
shell: bash
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
run: |
node ./scripts/diff-api-snapshot \
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
> $SCRATCH_DIR/output.json
+1 -1
View File
@@ -49,7 +49,7 @@ runs:
run: yarn run lint-markdown
- name: Build types
shell: bash
run: yarn build-types
run: yarn build-types --skip-snapshot
- name: Run typescript check of generated types
shell: bash
run: yarn test-generated-typescript
+2
View File
@@ -35,6 +35,8 @@ runs:
with:
java-version: '17'
distribution: 'zulu'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
@@ -17,9 +17,6 @@ outputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
@@ -67,6 +64,8 @@ runs:
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install
+1 -1
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: 'The node.js version to use'
required: false
default: '22'
default: '22.14.0'
runs:
using: "composite"
steps:
@@ -23,6 +23,8 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
@@ -34,8 +36,6 @@ runs:
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(0);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(90);
expect(mockExit).toHaveBeenCalledWith(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
});
@@ -13,13 +13,14 @@ const SLEEP_S = 60; // 1 minute
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
const ARTIFACT_URL =
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
const ARTIFACT_NAME = 'react-native-artifacts-';
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
if (version.startsWith('v')) {
version = version.substring(1);
}
const artifactUrl = `${ARTIFACT_URL}${version}`;
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
const response = await fetch(artifactUrl);
+5
View File
@@ -10,6 +10,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
@@ -18,6 +19,10 @@ jobs:
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.2.0'
- name: Extract branch name
run: |
TAG="${{ github.ref_name }}";
+2
View File
@@ -22,6 +22,8 @@ jobs:
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Run diff-js-api-breaking-changes
uses: ./.github/actions/diff-js-api-breaking-changes
- name: Danger
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: private/react-native-bots
+2
View File
@@ -10,6 +10,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
@@ -22,6 +23,7 @@ jobs:
- name: Generate Changelog
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {generateChangelog} = require('./.github/workflow-scripts/generateChangelog');
const version = '${{ github.ref_name }}';
+3 -3
View File
@@ -128,9 +128,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
+5 -5
View File
@@ -23,7 +23,7 @@ jobs:
id: restore-ios-slice
uses: actions/cache/restore@v4
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: packages/react-native/
- name: Setup node.js
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
@@ -83,7 +83,7 @@ jobs:
# Move the XCFramework in the destination directory
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
VERSION=$(jq -r '.version' package.json)
VERSION=$(jq -r '.version' packages/react-native/package.json)
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
cat "packages/react-native/third-party/version.txt"
# Check destination directory
@@ -117,7 +117,7 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
packages/react-native/.build/headers
@@ -140,7 +140,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: packages/react-native/.build/output/xcframeworks
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
- name: Setup node.js
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
@@ -209,4 +209,4 @@ jobs:
path: |
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
@@ -179,8 +179,9 @@ jobs:
- name: Compress and Rename dSYM
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: |
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
cd packages/react-native/third-party/Symbols/
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
- name: Upload XCFramework Artifact
uses: actions/upload-artifact@v4
with:
@@ -21,7 +21,7 @@ jobs:
- name: Build packages
run: yarn build
- name: Build types
run: yarn build-types
run: yarn build-types --skip-snapshot
- name: Set NPM auth token
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
- name: Find and publish all bumped packages
+3 -3
View File
@@ -125,9 +125,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
+2 -2
View File
@@ -14,8 +14,8 @@ jobs:
with:
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
days-before-stale: 180
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-issue-message: 'This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
stale-pr-message: 'This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.'
exempt-issue-labels: 'Help Wanted :octocat:, Good first issue, Never gets stale, Issue: Author Provided Repro'
+4 -4
View File
@@ -392,9 +392,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
@@ -593,7 +593,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ["24", "22"]
node-version: ["24.4.1", "22", "20.19.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
+3
View File
@@ -175,3 +175,6 @@ fix_*.patch
# [Experimental] Generated TS type definitions
/packages/**/types_generated/
/packages/debugger-shell/build/
/packages/*/dist/
+4877
View File
File diff suppressed because it is too large Load Diff
+824 -4805
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -124,7 +124,7 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(project(":packages:react-native:ReactAndroid:hermes-engine"))
.using(module("com.facebook.react:hermes-android:0.0.0-+"))
.using(module("com.facebook.react:hermes-android:0.+"))
.because("Users opted to use hermes from nightly")
}
}
+149
View File
@@ -0,0 +1,149 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declare module '@electron/packager' {
declare export type AsarOptions = $FlowFixMe;
declare export type ElectronDownloadRequestOptions = $FlowFixMe;
declare export type TargetDefinition = {
arch: TargetArch,
platform: TargetPlatform,
};
declare export type FinalizePackageTargetsHookFunction = (
targets: TargetDefinition[],
callback: HookFunctionErrorCallback,
) => void;
declare export type HookFunction = (
buildPath: string,
electronVersion: string,
platform: TargetPlatform,
arch: TargetArch,
callback: HookFunctionErrorCallback,
) => void;
declare export type IgnoreFunction = (path: string) => boolean;
declare export type HookFunctionErrorCallback = (err?: Error | null) => void;
declare export interface MacOSProtocol {
name: string;
schemes: string[];
}
declare export type NotaryToolCredentials = $FlowFixMe;
declare export type OsxSignOptions = $FlowFixMe;
declare export type OsxUniversalOptions = $FlowFixMe;
declare export type Win32MetadataOptions = $ReadOnly<{
CompanyName?: string,
FileDescription?: string,
OriginalFilename?: string,
ProductName?: string,
InternalName?: string,
'requested-execution-level'?:
| 'asInvoker'
| 'highestAvailable'
| 'requireAdministrator',
'application-manifest'?: string,
}>;
declare export type WindowsSignOptions = $FlowFixMe;
declare export type OfficialArch =
| 'ia32'
| 'x64'
| 'armv7l'
| 'arm64'
| 'mips64el'
| 'universal';
declare export type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas';
declare export type TargetArch = OfficialArch | string;
declare export type TargetPlatform = OfficialPlatform | string;
declare export type ArchOption = TargetArch | 'all';
declare export type PlatformOption = TargetPlatform | 'all';
declare export interface Options {
dir: string;
afterAsar?: HookFunction[];
afterComplete?: HookFunction[];
afterCopy?: HookFunction[];
afterCopyExtraResources?: HookFunction[];
afterExtract?: HookFunction[];
afterFinalizePackageTargets?: FinalizePackageTargetsHookFunction[];
afterInitialize?: HookFunction[];
afterPrune?: HookFunction[];
all?: boolean;
appBundleId?: string;
appCategoryType?: string;
appCopyright?: string;
appVersion?: string;
arch?: ArchOption | ArchOption[];
asar?: boolean | AsarOptions;
beforeAsar?: HookFunction[];
beforeCopy?: HookFunction[];
beforeCopyExtraResources?: HookFunction[];
buildVersion?: string;
darwinDarkModeSupport?: boolean;
derefSymlinks?: boolean;
download?: ElectronDownloadRequestOptions;
electronVersion?: string;
electronZipDir?: string;
executableName?: string;
extendHelperInfo?:
| string
| {
[property: string]: any,
};
extendInfo?:
| string
| {
[property: string]: any,
};
extraResource?: string | string[];
helperBundleId?: string;
icon?: string;
ignore?: RegExp | (string | RegExp)[] | IgnoreFunction;
junk?: boolean;
name?: string;
osxNotarize?: NotaryToolCredentials;
osxSign?: true | OsxSignOptions;
osxUniversal?: OsxUniversalOptions;
out?: string;
overwrite?: boolean;
platform?: TargetPlatform | 'all' | Array<TargetPlatform | 'all'>;
prebuiltAsar?: string;
protocols?: MacOSProtocol[];
prune?: boolean;
quiet?: boolean;
tmpdir?: string | false;
usageDescription?: {
[property: string]: string,
};
win32metadata?: Win32MetadataOptions;
windowsSign?: true | WindowsSignOptions;
}
declare function packager(options: Options): Promise<string[]>;
declare module.exports: typeof packager & {
packager: typeof packager,
default: typeof packager,
};
}
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+15 -14
View File
@@ -26,13 +26,13 @@
"set-version": "node ./scripts/releases/set-version.js",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
"test-ios": "./scripts/objc-test.sh test",
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
"test": "jest",
"fantom": "JS_DIR='..' yarn jest --config private/react-native-fantom/config/jest.config.js",
"fantom": "./scripts/fantom.sh",
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
"update-lock": "npx yarn-deduplicate"
},
@@ -49,16 +49,17 @@
"@babel/plugin-transform-regenerator": "^7.24.7",
"@babel/preset-env": "^7.25.3",
"@babel/preset-flow": "^7.24.7",
"@electron/packager": "^18.3.6",
"@jest/create-cache-key-function": "^29.7.0",
"@microsoft/api-extractor": "^7.52.2",
"@react-native/metro-babel-transformer": "0.80.0-main",
"@react-native/metro-config": "0.80.0-main",
"@react-native/metro-babel-transformer": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@tsconfig/node22": "22.0.2",
"@types/react": "^19.1.0",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-syntax-hermes-parser": "0.28.1",
"babel-plugin-syntax-hermes-parser": "0.29.1",
"babel-plugin-transform-define": "^2.1.4",
"babel-plugin-transform-flow-enums": "^0.0.2",
"clang-format": "^1.8.0",
@@ -76,11 +77,11 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.28.1",
"flow-bin": "^0.273.1",
"flow-api-translator": "0.29.1",
"flow-bin": "^0.275.0",
"glob": "^7.1.1",
"hermes-eslint": "0.28.1",
"hermes-transform": "0.28.1",
"hermes-eslint": "0.29.1",
"hermes-transform": "0.29.1",
"inquirer": "^7.1.0",
"jest": "^29.7.0",
"jest-config": "^29.7.0",
@@ -89,14 +90,14 @@
"jest-snapshot": "^29.7.0",
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^3.0.0",
"metro-babel-register": "^0.82.4",
"metro-memory-fs": "^0.82.4",
"metro-transform-plugins": "^0.82.4",
"metro-babel-register": "^0.83.1",
"metro-memory-fs": "^0.82.5",
"metro-transform-plugins": "^0.83.1",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.28.1",
"prettier-plugin-hermes-parser": "0.29.1",
"react": "19.1.0",
"react-test-renderer": "19.1.0",
"rimraf": "^3.0.2",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
@@ -17,7 +17,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"path-support.js",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -19,14 +19,14 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"index.js"
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "0.81.5"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+10 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,16 +22,16 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.80.0-main",
"@react-native/dev-middleware": "0.81.5",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.82.4",
"metro-config": "^0.82.4",
"metro-core": "^0.82.4",
"metro": "^0.83.1",
"metro-config": "^0.83.1",
"metro-core": "^0.83.1",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.82.4"
"metro-resolver": "^0.83.1"
},
"peerDependencies": {
"@react-native-community/cli": "*",
@@ -40,9 +40,12 @@
"peerDependenciesMeta": {
"@react-native-community/cli": {
"optional": true
},
"@react-native/metro-config": {
"optional": true
}
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
@@ -147,7 +147,7 @@ async function runServer(
// $FlowIgnore[cannot-write] Assigning to readonly property
metroConfig.reporter = reporter;
const serverInstance = await Metro.runServer(metroConfig, {
const {httpServer: serverInstance} = await Metro.runServer(metroConfig, {
host: args.host,
secure: args.https,
secureCert: args.cert,
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
@@ -21,7 +21,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"dist"
+2 -3
View File
@@ -76,9 +76,8 @@ function getNodePackagePath(packageName: string): string {
}
function metro(...args: $ReadOnlyArray<string>): ExecaPromise {
const metroPath = getNodePackagePath(path.join('metro', 'src', 'cli.js'));
log(`🚇 ${metroPath} ${args.join(' ')} `);
return execa('node', [metroPath, ...args]);
log(`🚇 metro ${args.join(' ')} `);
return execa('npx', ['--offline', 'metro', ...args]);
}
export const tasks = {
+1 -1
View File
@@ -125,7 +125,7 @@ export const tasks = {
}),
),
installDependencies: task(FIFTH, 'Install CocoaPods dependencies', () => {
const env = {
const env: {[string]: string | void} = {
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
USE_FRAMEWORKS: options.frameworks,
USE_HERMES: options.hermes ? '1' : '0',
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<9ada78dff12dcfc7937c8934261f47f4>>
Git revision: 68cfd0ae84acb0ed8e47b421afd64ae3b0b5b727
@generated SignedSource<<8c4db6a5e1ba269169ac93cc53f95538>>
Git revision: 51a91a2ad62e7f585912ed314a350a72de84d6ed
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebook/react-native-devtools-frontend
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
@@ -20,6 +20,6 @@
"BUILD_INFO"
],
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-shell",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
"keywords": [
"react-native",
@@ -8,7 +8,7 @@
],
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/debugger-shell#readme",
"bugs": "https://github.com/facebook/react-native/issues",
"main": "./src/node/index.js",
"main": "./src/index.js",
"exports": {
".": {
"node": "./src/node/index.js",
@@ -26,12 +26,12 @@
},
"license": "MIT",
"engines": {
"node": ">= 22.14.0",
"electron": ">=36.2.0"
"node": ">= 20.19.4",
"electron": ">=36.3.0"
},
"dependencies": {
"cross-spawn": "^7.0.6",
"electron": "36.2.0"
"electron": "36.3.0"
},
"devDependencies": {
"semver": "^7.1.3"
@@ -10,6 +10,7 @@
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
const {BrowserWindow, app, shell, ipcMain} = require('electron') as any;
const path = require('path');
const util = require('util');
const windowMetadata = new WeakMap<
@@ -68,6 +69,8 @@ function handleLaunchArgs(argv: string[]) {
partition: 'persist:react-native-devtools',
preload: require.resolve('./preload.js'),
},
// Icon for Linux
icon: path.join(__dirname, 'resources', 'icon.png'),
});
// Open links in the default browser instead of in new Electron windows.
@@ -90,7 +93,7 @@ function handleLaunchArgs(argv: string[]) {
}
app.whenReady().then(() => {
handleLaunchArgs(process.argv.slice(2));
handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2));
app.on(
'second-instance',
Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

+26
View File
@@ -0,0 +1,26 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
// As far as Flow is concerned, this package is Node-only.
/*::
export type * from './node';
const Node = require('./node');
declare module.exports: typeof Node;
*/
// Because Electron doesn't support package.json `exports`, we need to
// switch at runtime.
if ('electron' in process.versions) {
// $FlowIgnore[invalid-export]
module.exports = require('./electron');
} else {
// $FlowIgnore[invalid-export]
module.exports = require('./node');
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.80.0-main",
"@react-native/debugger-frontend": "0.81.5",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -35,7 +35,7 @@
"ws": "^6.2.3"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"devDependencies": {
"selfsigned": "^2.4.1",
@@ -9,6 +9,7 @@
*/
import type {JsonPagesListResponse} from '../inspector-proxy/types';
import type {BrowserLauncher} from '../types/BrowserLauncher';
import DefaultBrowserLauncher from '../utils/DefaultBrowserLauncher';
import {fetchJson, requestLocal} from './FetchUtils';
@@ -22,7 +23,7 @@ const PAGES_POLLING_DELAY = 2100;
jest.useFakeTimers();
describe('enableStandaloneFuseboxShell experiment', () => {
const BrowserLauncherWithFuseboxShell = {
const BrowserLauncherWithFuseboxShell: BrowserLauncher = {
...DefaultBrowserLauncher,
unstable_showFuseboxShell: () => {
throw new Error('Not implemented');
@@ -81,6 +81,7 @@ export default function createDevMiddleware({
projectRoot,
serverBaseUrl,
logger,
// $FlowFixMe[prop-missing]
unstable_browserLauncher = DefaultBrowserLauncher,
unstable_eventReporter,
unstable_experiments: experimentConfig = {},
@@ -22,6 +22,7 @@ import type {
import type {IncomingMessage, ServerResponse} from 'http';
import getBaseUrlFromRequest from '../utils/getBaseUrlFromRequest';
import getDevToolsFrontendUrl from '../utils/getDevToolsFrontendUrl';
import Device from './Device';
import EventLoopPerfTracker from './EventLoopPerfTracker';
import InspectorProxyHeartbeat from './InspectorProxyHeartbeat';
@@ -249,13 +250,15 @@ export default class InspectorProxy implements InspectorProxyQueries {
const webSocketUrlWithoutProtocol = `${host}${WS_DEBUGGER_URL}?device=${deviceId}&page=${page.id}`;
const webSocketDebuggerUrl = `${webSocketScheme}://${webSocketUrlWithoutProtocol}`;
// For now, `/json/list` returns the legacy built-in `devtools://` URL, to
// preserve existing handling by Flipper. This may return a placeholder in
// future -- please use the `/open-debugger` endpoint.
const devtoolsFrontendUrl =
`devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&${webSocketScheme}=` +
encodeURIComponent(webSocketUrlWithoutProtocol);
const devtoolsFrontendUrl = getDevToolsFrontendUrl(
this.#experiments,
webSocketDebuggerUrl,
this.#serverBaseUrl.origin,
{
relative: true,
useFuseboxEntryPoint: page.capabilities.prefersFuseboxFrontend,
},
);
return {
id: `${deviceId}-${page.id}`,
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -16,13 +16,13 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "index.js",
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.80.0-main",
"@react-native/eslint-plugin": "0.81.5",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint-config-prettier": "^8.5.0",
@@ -31,6 +31,8 @@ eslintTester.run('../no-deep-imports', rule, {
"import Foo from 'react/native/Foo';",
"import 'react-native/Libraries/Core/InitializeCore';",
"require('react-native/Libraries/Core/InitializeCore');",
"import Foo from 'react-native/src/fb_internal/Foo'",
"require('react-native/src/fb_internal/Foo')",
],
invalid: [
{
@@ -103,5 +105,25 @@ eslintTester.run('../no-deep-imports', rule, {
],
output: null,
},
{
code: "import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes';",
errors: [
{
messageId: 'deepImport',
data: {importPath: 'react-native/Libraries/Types/RootTagTypes'},
},
],
output: "import type {RootTag} from 'react-native';",
},
{
code: "import type {ModalBaseProps, Foo} from 'react-native/Libraries/Modal/Modal';",
errors: [
{
messageId: 'deepImport',
data: {importPath: 'react-native/Libraries/Modal/Modal'},
},
],
output: null,
},
],
});
@@ -31,7 +31,8 @@ module.exports = {
ImportDeclaration(node) {
if (
!isDeepReactNativeImport(node.source) ||
isInitializeCoreImport(node.source)
isInitializeCoreImport(node.source) ||
isFbInternalImport(node.source)
) {
return;
}
@@ -40,25 +41,55 @@ module.exports = {
'react-native/'.length,
);
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
if (publicAPIDefaultComponent) {
if (publicAPIDefaultComponent && publicAPIDefaultComponent.default) {
context.report({
...getStandardReport(node.source),
fix(fixer) {
return fixer.replaceText(
node,
`import {${publicAPIDefaultComponent}} from 'react-native';`,
`import {${publicAPIDefaultComponent.default}} from 'react-native';`,
);
},
});
} else {
context.report(getStandardReport(node.source));
}
} else if (isTypeImport(node)) {
const reactNativeSource = node.source.value.slice(
'react-native/'.length,
);
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
if (publicAPIDefaultComponent && publicAPIDefaultComponent.types) {
const typeNames = [];
for (const specifier of node.specifiers) {
const importedName = specifier.imported.name;
if (!publicAPIDefaultComponent.types.includes(importedName)) {
context.report(getStandardReport(node.source));
return;
}
typeNames.push(importedName);
}
context.report({
...getStandardReport(node.source),
fix(fixer) {
return fixer.replaceText(
node,
`import type {${typeNames.join(', ')}} from 'react-native';`,
);
},
});
}
} else {
context.report(getStandardReport(node.source));
}
},
CallExpression(node) {
if (!isDeepRequire(node) || isInitializeCoreImport(node.arguments[0])) {
if (
!isDeepRequire(node) ||
isInitializeCoreImport(node.arguments[0]) ||
isFbInternalImport(node.arguments[0])
) {
return;
}
@@ -71,13 +102,13 @@ module.exports = {
) {
const reactNativeSource = importPath.slice('react-native/'.length);
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
if (publicAPIDefaultComponent) {
if (publicAPIDefaultComponent && publicAPIDefaultComponent.default) {
context.report({
...getStandardReport(node.arguments[0]),
fix(fixer) {
return fixer.replaceText(
parent,
`{${publicAPIDefaultComponent}} = require('react-native')`,
`{${publicAPIDefaultComponent.default}} = require('react-native')`,
);
},
});
@@ -109,6 +140,10 @@ module.exports = {
);
}
function isTypeImport(node) {
return node.type === 'ImportDeclaration' && node.importKind === 'type';
}
function isDeepRequire(node) {
return (
node.callee.type === 'Identifier' &&
@@ -137,5 +172,13 @@ module.exports = {
return source.value === 'react-native/Libraries/Core/InitializeCore';
}
function isFbInternalImport(source) {
if (source.type !== 'Literal' || typeof source.value !== 'string') {
return false;
}
return source.value.startsWith('react-native/src/fb_internal/');
}
},
};
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
@@ -18,10 +18,10 @@
"bugs": "https://github.com/facebook/react-native/issues",
"main": "index.js",
"devDependencies": {
"babel-plugin-syntax-hermes-parser": "0.28.1",
"hermes-eslint": "0.28.1"
"babel-plugin-syntax-hermes-parser": "0.29.1",
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+507 -86
View File
@@ -17,92 +17,513 @@
* If the path is not matched, the auto-fix won't be suggested.
*/
const publicAPIMapping = {
'Libraries/Components/AccessibilityInfo/AccessibilityInfo':
'AccessibilityInfo',
'Libraries/Components/ActivityIndicator/ActivityIndicator':
'ActivityIndicator',
'Libraries/Components/Button': 'Button',
'Libraries/Components/DrawerAndroid/DrawerLayoutAndroid':
'DrawerLayoutAndroid',
'Libraries/Components/LayoutConformance/LayoutConformance':
'experimental_LayoutConformance',
'Libraries/Lists/FlatList': 'FlatList',
'Libraries/Image/Image': 'Image',
'Libraries/Image/ImageBackground': 'ImageBackground',
'Libraries/Components/TextInput/InputAccessoryView': 'InputAccessoryView',
'Libraries/Components/Keyboard/KeyboardAvoidingView': 'KeyboardAvoidingView',
'Libraries/Modal/Modal': 'Modal',
'Libraries/Components/Pressable/Pressable': 'Pressable',
'Libraries/Components/ProgressBarAndroid/ProgressBarAndroid':
'ProgressBarAndroid',
'Libraries/Components/RefreshControl/RefreshControl': 'RefreshControl',
'Libraries/Components/SafeAreaView/SafeAreaView': 'SafeAreaView',
'Libraries/Components/ScrollView/ScrollView': 'ScrollView',
'Libraries/Lists/SectionList': 'SectionList',
'Libraries/Components/StatusBar/StatusBar': 'StatusBar',
'Libraries/Components/Switch/Switch': 'Switch',
'Libraries/Text/Text': 'Text',
'Libraries/Components/TextInput/TextInput': 'TextInput',
'Libraries/Components/Touchable/Touchable': 'Touchable',
'Libraries/Components/Touchable/TouchableHighlight': 'TouchableHighlight',
'Libraries/Components/Touchable/TouchableNativeFeedback':
'TouchableNativeFeedback',
'Libraries/Components/Touchable/TouchableOpacity': 'TouchableOpacity',
'Libraries/Components/Touchable/TouchableWithoutFeedback':
'TouchableWithoutFeedback',
'Libraries/Components/View/View': 'View',
'Libraries/Lists/VirtualizedList': 'VirtualizedList',
'Libraries/Lists/VirtualizedSectionList': 'VirtualizedSectionList',
'Libraries/ActionSheetIOS/ActionSheetIOS': 'ActionSheetIOS',
'Libraries/Alert/Alert': 'Alert',
'Libraries/Animated/Animated': 'Animated',
'Libraries/Utilities/Appearance': 'Appearance',
'Libraries/ReactNative/AppRegistry': 'AppRegistry',
'Libraries/AppState/AppState': 'AppState',
'Libraries/Utilities/BackHandler': 'BackHandler',
'Libraries/Components/Clipboard/Clipboard': 'Clipboard',
'Libraries/Utilities/DeviceInfo': 'DeviceInfo',
'src/private/devsupport/devmenu/DevMenu': 'DevMenu',
'Libraries/Utilities/DevSettings': 'DevSettings',
'Libraries/Utilities/Dimensions': 'Dimensions',
'Libraries/Animated/Easing': 'Easing',
'Libraries/ReactNative/I18nManager': 'I18nManager',
'Libraries/Interaction/InteractionManager': 'InteractionManager',
'Libraries/Components/Keyboard/Keyboard': 'Keyboard',
'Libraries/LayoutAnimation/LayoutAnimation': 'LayoutAnimation',
'Libraries/Linking/Linking': 'Linking',
'Libraries/LogBox/LogBox': 'LogBox',
'Libraries/NativeModules/specs/NativeDialogManagerAndroid':
'NativeDialogManagerAndroid',
'Libraries/EventEmitter/NativeEventEmitter': 'NativeEventEmitter',
'Libraries/Network/RCTNetworking': 'Networking',
'Libraries/Interaction/PanResponder': 'PanResponder',
'Libraries/PermissionsAndroid/PermissionsAndroid': 'PermissionsAndroid',
'Libraries/Utilities/PixelRatio': 'PixelRatio',
'Libraries/PushNotificationIOS/PushNotificationIOS': 'PushNotificationIOS',
'Libraries/Settings/Settings': 'Settings',
'Libraries/Share/Share': 'Share',
'Libraries/StyleSheet/StyleSheet': 'StyleSheet',
'Libraries/Performance/Systrace': 'Systrace',
'Libraries/Components/ToastAndroid/ToastAndroid': 'ToastAndroid',
'Libraries/TurboModule/TurboModuleRegistry': 'TurboModuleRegistry',
'Libraries/ReactNative/UIManager': 'UIManager',
'Libraries/Animated/useAnimatedValue': 'useAnimatedValue',
'Libraries/Utilities/useColorScheme': 'useColorScheme',
'Libraries/Utilities/useWindowDimensions': 'useWindowDimensions',
'Libraries/UTFSequence': 'UTFSequence',
'Libraries/Vibration/Vibration': 'Vibration',
'Libraries/Utilities/codegenNativeComponent': 'codegenNativeComponent',
'Libraries/Utilities/codegenNativeCommands': 'codegenNativeCommands',
'Libraries/EventEmitter/RCTDeviceEventEmitter': 'DeviceEventEmitter',
'Libraries/StyleSheet/PlatformColorValueTypesIOS': 'DynamicColorIOS',
'Libraries/EventEmitter/RCTNativeAppEventEmitter': 'NativeAppEventEmitter',
'Libraries/BatchedBridge/NativeModules': 'NativeModules',
'Libraries/Utilities/Platform': 'Platform',
'Libraries/StyleSheet/PlatformColorValueTypes': 'PlatformColor',
'Libraries/StyleSheet/processColor': 'processColor',
'Libraries/ReactNative/requireNativeComponent': 'requireNativeComponent',
'Libraries/ReactNative/RootTag': 'RootTagContext',
'Libraries/Components/AccessibilityInfo/AccessibilityInfo': {
default: 'AccessibilityInfo',
types: null,
},
'Libraries/Components/ActivityIndicator/ActivityIndicator': {
default: 'ActivityIndicator',
types: ['ActivityIndicatorProps'],
},
'Libraries/Components/Button': {
default: 'Button',
types: ['ButtonProps'],
},
'Libraries/Components/DrawerAndroid/DrawerLayoutAndroid': {
default: 'DrawerLayoutAndroid',
types: ['DrawerLayoutAndroidProps', 'DrawerSlideEvent'],
},
'Libraries/Components/LayoutConformance/LayoutConformance': {
default: 'experimental_LayoutConformance',
types: ['LayoutConformanceProps'],
},
'Libraries/Lists/FlatList': {
default: 'FlatList',
types: ['FlatListProps'],
},
'Libraries/Image/Image': {
default: 'Image',
types: [
'ImageBackgroundProps',
'ImageErrorEvent',
'ImageLoadEvent',
'ImageProgressEventIOS',
'ImageProps',
'ImagePropsAndroid',
'ImagePropsBase',
'ImagePropsIOS',
'ImageResolvedAssetSource',
'ImageSize',
'ImageSourcePropType',
],
},
'Libraries/Image/ImageSource': {
default: null,
types: ['ImageRequireSource', 'ImageSource', 'ImageURISource'],
},
'Libraries/Image/ImageBackground': {
default: 'ImageBackground',
types: null,
},
'Libraries/Components/TextInput/InputAccessoryView': {
default: 'InputAccessoryView',
types: ['InputAccessoryViewProps'],
},
'Libraries/Components/Keyboard/KeyboardAvoidingView': {
default: 'KeyboardAvoidingView',
types: ['KeyboardAvoidingViewProps'],
},
'Libraries/Modal/Modal': {
default: 'Modal',
types: [
'ModalBaseProps',
'ModalProps',
'ModalPropsAndroid',
'ModalPropsIOS',
],
},
'Libraries/Components/Pressable/Pressable': {
default: 'Pressable',
types: [
'PressableAndroidRippleConfig',
'PressableProps',
'PressableStateCallbackType',
],
},
'Libraries/Components/ProgressBarAndroid/ProgressBarAndroid': {
default: 'ProgressBarAndroid',
types: ['ProgressBarAndroidProps'],
},
'Libraries/Components/RefreshControl/RefreshControl': {
default: 'RefreshControl',
types: [
'RefreshControlProps',
'RefreshControlPropsAndroid',
'RefreshControlPropsIOS',
],
},
'Libraries/Components/SafeAreaView/SafeAreaView': {
default: 'SafeAreaView',
types: null,
},
'Libraries/Components/ScrollView/ScrollView': {
default: 'ScrollView',
types: [
'ScrollResponderType',
'ScrollViewProps',
'ScrollViewPropsAndroid',
'ScrollViewPropsIOS',
'ScrollViewImperativeMethods',
'ScrollViewScrollToOptions',
],
},
'Libraries/Lists/SectionList': {
default: 'SectionList',
types: [
'SectionListProps',
'SectionListRenderItem',
'SectionListRenderItemInfo',
'SectionListData',
],
},
'Libraries/Components/StatusBar/StatusBar': {
default: 'StatusBar',
types: ['StatusBarAnimation', 'StatusBarProps', 'StatusBarStyle'],
},
'Libraries/Components/Switch/Switch': {
default: 'Switch',
types: ['SwitchChangeEvent', 'SwitchProps'],
},
'Libraries/Text/Text': {
default: 'Text',
types: ['TextProps'],
},
'Libraries/Components/TextInput/TextInput': {
default: 'TextInput',
types: [
'AutoCapitalize',
'EnterKeyHintTypeOptions',
'KeyboardTypeOptions',
'InputModeOptions',
'TextContentType',
'TextInputAndroidProps',
'TextInputIOSProps',
'TextInputProps',
'TextInputChangeEvent',
'TextInputContentSizeChangeEvent',
'TextInputEndEditingEvent',
'TextInputFocusEvent',
'TextInputKeyPressEvent',
'TextInputSelectionChangeEvent',
'TextInputSubmitEditingEvent',
'ReturnKeyTypeOptions',
'SubmitBehavior',
],
},
'Libraries/Components/Touchable/Touchable': {
default: 'Touchable',
types: null,
},
'Libraries/Components/Touchable/TouchableHighlight': {
default: 'TouchableHighlight',
types: ['TouchableHighlightProps'],
},
'Libraries/Components/Touchable/TouchableNativeFeedback': {
default: 'TouchableNativeFeedback',
types: ['TouchableNativeFeedbackProps'],
},
'Libraries/Components/Touchable/TouchableOpacity': {
default: 'TouchableOpacity',
types: ['TouchableOpacityProps'],
},
'Libraries/Components/Touchable/TouchableWithoutFeedback': {
default: 'TouchableWithoutFeedback',
types: ['TouchableWithoutFeedbackProps'],
},
'Libraries/Components/View/View': {
default: 'View',
types: null,
},
'Libraries/Components/View/ViewAccessibility': {
default: null,
types: [
'AccessibilityActionEvent',
'AccessibilityProps',
'AccessibilityRole',
'AccessibilityState',
'AccessibilityValue',
'Role',
],
},
'Libraries/Components/View/ViewPropTypes': {
default: null,
types: [
'GestureResponderHandlers',
'TVViewPropsIOS',
'ViewProps',
'ViewPropsAndroid',
'ViewPropsIOS',
],
},
'Libraries/Lists/VirtualizedList': {
default: 'VirtualizedList',
types: [
'ListRenderItemInfo',
'ListRenderItem',
'Separators',
'VirtualizedListProps',
],
},
'Libraries/Lists/VirtualizedSectionList': {
default: 'VirtualizedSectionList',
types: [
'ScrollToLocationParamsType',
'SectionBase',
'VirtualizedSectionListProps',
],
},
'Libraries/ActionSheetIOS/ActionSheetIOS': {
default: 'ActionSheetIOS',
types: [
'ActionSheetIOSOptions',
'ShareActionSheetIOSOptions',
'ShareActionSheetError',
],
},
'Libraries/Alert/Alert': {
default: 'Alert',
types: ['AlertType', 'AlertButtonStyle', 'AlertButton', 'AlertOptions'],
},
'Libraries/Animated/Animated': {
default: 'Animated',
types: null,
},
'Libraries/Utilities/Appearance': {
default: 'Appearance',
types: null,
},
'Libraries/ReactNative/AppRegistry': {
default: 'AppRegistry',
types: [
'TaskProvider',
'ComponentProvider',
'ComponentProviderInstrumentationHook',
'AppConfig',
'Runnable',
'Runnables',
'Registry',
'WrapperComponentProvider',
'RootViewStyleProvider',
],
},
'Libraries/AppState/AppState': {
default: 'AppState',
types: ['AppStateStatus', 'AppStateEvent'],
},
'Libraries/Utilities/BackHandler': {
default: 'BackHandler',
types: ['BackPressEventName'],
},
'Libraries/Components/Clipboard/Clipboard': {
default: 'Clipboard',
types: null,
},
'Libraries/Utilities/DeviceInfo': {
default: 'DeviceInfo',
types: ['DeviceInfoConstants'],
},
'src/private/devsupport/devmenu/DevMenu': {
default: 'DevMenu',
types: null,
},
'Libraries/Utilities/DevSettings': {
default: 'DevSettings',
types: null,
},
'Libraries/Utilities/Dimensions': {
default: 'Dimensions',
types: [
'DimensionsPayload',
'DisplayMetrics',
'DisplayMetricsAndroid',
'ScaledSize',
],
},
'Libraries/Animated/Easing': {
default: 'Easing',
types: ['EasingFunction'],
},
'Libraries/ReactNative/I18nManager': {
default: 'I18nManager',
types: null,
},
'Libraries/Interaction/InteractionManager': {
default: 'InteractionManager',
types: ['Handle', 'PromiseTask', 'SimpleTask'],
},
'Libraries/Components/Keyboard/Keyboard': {
default: 'Keyboard',
types: [
'AndroidKeyboardEvent',
'IOSKeyboardEvent',
'KeyboardEvent',
'KeyboardEventEasing',
'KeyboardEventName',
'KeyboardMetrics',
],
},
'Libraries/LayoutAnimation/LayoutAnimation': {
default: 'LayoutAnimation',
types: [
'LayoutAnimationAnim',
'LayoutAnimationConfig',
'LayoutAnimationProperties',
'LayoutAnimationProperty',
'LayoutAnimationType',
'LayoutAnimationTypes',
],
},
'Libraries/Linking/Linking': {
default: 'Linking',
types: null,
},
'Libraries/LogBox/LogBox': {
default: 'LogBox',
types: ['ExtendedExceptionData', 'IgnorePattern', 'LogData'],
},
'Libraries/NativeModules/specs/NativeDialogManagerAndroid': {
default: 'NativeDialogManagerAndroid',
types: null,
},
'Libraries/EventEmitter/NativeEventEmitter': {
default: 'NativeEventEmitter',
types: [
'EventSubscription',
'EmitterSubscription',
'NativeEventSubscription',
],
},
'Libraries/Network/RCTNetworking': {
default: 'Networking',
types: null,
},
'Libraries/Interaction/PanResponder': {
default: 'PanResponder',
types: [
'PanResponderCallbacks',
'PanResponderGestureState',
'PanResponderInstance',
],
},
'Libraries/PermissionsAndroid/PermissionsAndroid': {
default: 'PermissionsAndroid',
types: ['Permission', 'PermissionStatus', 'Rationale'],
},
'Libraries/Utilities/PixelRatio': {
default: 'PixelRatio',
types: null,
},
'Libraries/PushNotificationIOS/PushNotificationIOS': {
default: 'PushNotificationIOS',
types: ['PushNotificationEventName', 'PushNotificationPermissions'],
},
'Libraries/Settings/Settings': {
default: 'Settings',
types: null,
},
'Libraries/Share/Share': {
default: 'Share',
types: ['ShareAction', 'ShareContent', 'ShareOptions'],
},
'Libraries/StyleSheet/StyleSheet': {
default: 'StyleSheet',
types: [
'ColorValue',
'ImageStyle',
'FilterFunction',
'FontVariant',
'NativeColorValue',
'OpaqueColorValue',
'StyleProp',
'TextStyle',
'TransformsStyle',
'ViewStyle',
],
},
'Libraries/StyleSheet/StyleSheetTypes': {
default: null,
types: [
'BoxShadowValue',
'CursorValue',
'DimensionValue',
'DropShadowValue',
'EdgeInsetsValue',
'PointValue',
],
},
'Libraries/StyleSheet/Rect': {
default: null,
types: ['Insets'],
},
'Libraries/Performance/Systrace': {
default: 'Systrace',
types: null,
},
'Libraries/Components/ToastAndroid/ToastAndroid': {
default: 'ToastAndroid',
types: null,
},
'Libraries/TurboModule/TurboModuleRegistry': {
default: 'TurboModuleRegistry',
types: null,
},
'Libraries/TurboModule/RCTExport': {
default: null,
types: ['TurboModule'],
},
'Libraries/ReactNative/UIManager': {
default: 'UIManager',
types: null,
},
'Libraries/Animated/useAnimatedValue': {
default: 'useAnimatedValue',
types: null,
},
'Libraries/Utilities/useColorScheme': {
default: 'useColorScheme',
types: null,
},
'src/private/specs_DEPRECATED/modules/NativeAppearance': {
default: null,
types: ['ColorSchemeName'],
},
'Libraries/Utilities/useWindowDimensions': {
default: 'useWindowDimensions',
types: null,
},
'Libraries/UTFSequence': {
default: 'UTFSequence',
types: null,
},
'Libraries/Vibration/Vibration': {
default: 'Vibration',
types: null,
},
'Libraries/Utilities/codegenNativeComponent': {
default: 'codegenNativeComponent',
types: null,
},
'Libraries/Utilities/codegenNativeCommands': {
default: 'codegenNativeCommands',
types: null,
},
'Libraries/EventEmitter/RCTDeviceEventEmitter': {
default: 'DeviceEventEmitter',
types: null,
},
'Libraries/StyleSheet/PlatformColorValueTypesIOS': {
default: 'DynamicColorIOS',
types: ['DynamicColorIOSTuple'],
},
'Libraries/EventEmitter/RCTNativeAppEventEmitter': {
default: 'NativeAppEventEmitter',
types: null,
},
'Libraries/BatchedBridge/NativeModules': {
default: 'NativeModules',
types: null,
},
'Libraries/Utilities/Platform': {
default: 'Platform',
types: null,
},
'./Libraries/Utilities/PlatformTypes': {
default: null,
types: ['PlatformOSType', 'PlatformSelectSpec'],
},
'Libraries/StyleSheet/PlatformColorValueTypes': {
default: 'PlatformColor',
types: null,
},
'Libraries/StyleSheet/processColor': {
default: 'processColor',
types: ['ProcessedColorValue'],
},
'Libraries/ReactNative/requireNativeComponent': {
default: 'requireNativeComponent',
types: null,
},
'Libraries/ReactNative/RootTag': {
default: 'RootTagContext',
types: ['RootTag'],
},
'Libraries/Types/RootTagTypes': {
default: null,
types: ['RootTag'],
},
'src/private/types/HostInstance': {
default: null,
types: [
'HostInstance',
'NativeMethods',
'NativeMethodsMixin',
'MeasureInWindowOnSuccessCallback',
'MeasureLayoutOnSuccessCallback',
'MeasureOnSuccessCallback',
],
},
'src/private/types/HostComponent': {
default: null,
types: ['HostComponent'],
},
'Libraries/vendor/core/ErrorUtils': {
default: null,
types: ['ErrorUtils'],
},
'Libraries/ReactPrivate/ReactNativePrivateInterface': {
default: null,
types: ['PublicRootInstance', 'PublicTextInstance'],
},
};
module.exports = {
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -26,16 +26,16 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@react-native/codegen": "0.80.0-main",
"@react-native/codegen": "0.81.5",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
},
"devDependencies": {
"babel-plugin-syntax-hermes-parser": "0.28.1",
"hermes-eslint": "0.28.1"
"babel-plugin-syntax-hermes-parser": "0.29.1",
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
@@ -1,5 +1,5 @@
[versions]
agp = "8.10.1"
agp = "8.11.0"
gson = "2.8.9"
guava = "31.0.1-jre"
javapoet = "1.13.0"
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -16,7 +16,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"scripts": {
"build": "./gradlew build",
@@ -100,10 +100,10 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
* Allows to specify the debuggable variants (by default just 'debug'). Variants in this list will
* not be bundled (the bundle file will not be created and won't be copied over).
*
* Default: ['debug']
* Default: ['debug', 'debugOptimized']
*/
val debuggableVariants: ListProperty<String> =
objects.listProperty(String::class.java).convention(listOf("debug"))
objects.listProperty(String::class.java).convention(listOf("debug", "debugOptimized"))
/** Hermes Config */
@@ -18,6 +18,7 @@ import com.facebook.react.tasks.GenerateEntryPointTask
import com.facebook.react.tasks.GeneratePackageListTask
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForApp
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForLibraries
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildTypesForApp
import com.facebook.react.utils.AgpConfiguratorUtils.configureDevServerLocation
import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries
import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap
@@ -84,6 +85,7 @@ class ReactPlugin : Plugin<Project> {
configureAutolinking(project, extension)
configureCodegen(project, extension, rootExtension, isLibrary = false)
configureResources(project, extension)
configureBuildTypesForApp(project)
}
// Library Only Configuration
@@ -26,5 +26,21 @@ class ReactRootProjectPlugin : Plugin<Project> {
it.evaluationDependsOn(":app")
}
}
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
// tasks. This is necessary in order to have all the codegen generated code before the CMake
// configuration build kicks in.
project.gradle.projectsEvaluated {
val appProject = project.rootProject.subprojects.find { it.name == "app" }
val appPreBuild = appProject?.tasks?.findByName("preBuild")
if (appPreBuild != null) {
// Find all other subprojects' preBuild tasks
val otherPreBuildTasks =
project.rootProject.subprojects
.filter { it != appProject }
.mapNotNull { it.tasks.findByName("preBuild") }
// Make :app:preBuild depend on all others
appPreBuild.dependsOn(otherPreBuildTasks)
}
}
}
}
@@ -70,6 +70,7 @@ abstract class GenerateEntryPointTask : DefaultTask() {
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.views.view.WindowUtilKt;
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
import com.facebook.soloader.SoLoader;
@@ -93,6 +94,10 @@ abstract class GenerateEntryPointTask : DefaultTask() {
if ({{packageName}}.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
DefaultNewArchitectureEntryPoint.load();
}
if ({{packageName}}.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
}
}
}
"""
@@ -148,6 +148,7 @@ abstract class GeneratePackageListTask : DefaultTask() {
{{ packageImports }}
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -11,6 +11,7 @@ import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import com.android.build.api.variant.LibraryAndroidComponentsExtension
import com.android.build.gradle.LibraryExtension
import com.facebook.react.ReactExtension
import com.facebook.react.utils.ProjectUtils.isEdgeToEdgeEnabled
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
import java.io.File
@@ -18,6 +19,7 @@ import java.net.Inet4Address
import java.net.NetworkInterface
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import kotlin.plus
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.AppliedPlugin
@@ -26,6 +28,36 @@ import org.w3c.dom.Element
@Suppress("UnstableApiUsage")
internal object AgpConfiguratorUtils {
fun configureBuildTypesForApp(project: Project) {
val action =
Action<AppliedPlugin> {
project.extensions
.getByType(ApplicationAndroidComponentsExtension::class.java)
.finalizeDsl { ext ->
ext.buildTypes {
val debug =
getByName("debug").apply {
manifestPlaceholders["usesCleartextTraffic"] = "true"
}
getByName("release").apply {
manifestPlaceholders["usesCleartextTraffic"] = "false"
}
maybeCreate("debugOptimized").apply {
manifestPlaceholders["usesCleartextTraffic"] = "true"
initWith(debug)
externalNativeBuild {
cmake {
arguments("-DCMAKE_BUILD_TYPE=Release")
matchingFallbacks += listOf("release")
}
}
}
}
}
}
project.pluginManager.withPlugin("com.android.application", action)
}
fun configureBuildConfigFieldsForApp(project: Project, extension: ReactExtension) {
val action =
Action<AppliedPlugin> {
@@ -39,6 +71,8 @@ internal object AgpConfiguratorUtils {
project.isNewArchEnabled(extension).toString())
ext.defaultConfig.buildConfigField(
"boolean", "IS_HERMES_ENABLED", project.isHermesEnabled.toString())
ext.defaultConfig.buildConfigField(
"boolean", "IS_EDGE_TO_EDGE_ENABLED", project.isEdgeToEdgeEnabled.toString())
}
}
project.pluginManager.withPlugin("com.android.application", action)
@@ -8,12 +8,14 @@
package com.facebook.react.utils
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_PUBLISHING_GROUP
import com.facebook.react.utils.PropertyUtils.EXCLUSIVE_ENTEPRISE_REPOSITORY
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY_DEFAULT
import com.facebook.react.utils.PropertyUtils.INTERNAL_PUBLISHING_GROUP
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO
import com.facebook.react.utils.PropertyUtils.INTERNAL_USE_HERMES_NIGHTLY
import com.facebook.react.utils.PropertyUtils.INTERNAL_VERSION_NAME
import com.facebook.react.utils.PropertyUtils.SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY
import com.facebook.react.utils.PropertyUtils.SCOPED_INCLUDE_JITPACK_REPOSITORY
import java.io.File
import java.net.URI
@@ -28,6 +30,12 @@ internal object DependencyUtils {
* party libraries which are auto-linked.
*/
fun configureRepositories(project: Project) {
val exclusiveEnterpriseRepository = project.rootProject.exclusiveEnterpriseRepository()
if (exclusiveEnterpriseRepository != null) {
project.logger.lifecycle(
"Replacing ALL Maven Repositories with: $exclusiveEnterpriseRepository")
}
project.rootProject.allprojects { eachProject ->
with(eachProject) {
if (hasProperty(INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO)) {
@@ -36,6 +44,16 @@ internal object DependencyUtils {
repo.content { it.excludeGroup("org.webkit") }
}
}
if (exclusiveEnterpriseRepository != null) {
// We remove all previously set repositories and only configure the proxy provided by the
// user.
rootProject.repositories.clear()
mavenRepoFromUrl(exclusiveEnterpriseRepository)
// We return here as we don't want to configure other repositories as well.
return@allprojects
}
// We add the snapshot for users on nightlies.
mavenRepoFromUrl("https://central.sonatype.com/repository/maven-snapshots/") { repo ->
repo.content { it.excludeGroup("org.webkit") }
@@ -181,4 +199,13 @@ internal object DependencyUtils {
property(INCLUDE_JITPACK_REPOSITORY).toString().toBoolean()
else -> INCLUDE_JITPACK_REPOSITORY_DEFAULT
}
internal fun Project.exclusiveEnterpriseRepository() =
when {
hasProperty(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
property(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
hasProperty(EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
property(EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
else -> null
}
}
@@ -11,9 +11,11 @@ import com.facebook.react.ReactExtension
import com.facebook.react.model.ModelPackageJson
import com.facebook.react.utils.KotlinStdlibCompatUtils.lowercaseCompat
import com.facebook.react.utils.KotlinStdlibCompatUtils.toBooleanStrictOrNullCompat
import com.facebook.react.utils.PropertyUtils.EDGE_TO_EDGE_ENABLED
import com.facebook.react.utils.PropertyUtils.HERMES_ENABLED
import com.facebook.react.utils.PropertyUtils.NEW_ARCH_ENABLED
import com.facebook.react.utils.PropertyUtils.REACT_NATIVE_ARCHITECTURES
import com.facebook.react.utils.PropertyUtils.SCOPED_EDGE_TO_EDGE_ENABLED
import com.facebook.react.utils.PropertyUtils.SCOPED_HERMES_ENABLED
import com.facebook.react.utils.PropertyUtils.SCOPED_NEW_ARCH_ENABLED
import com.facebook.react.utils.PropertyUtils.SCOPED_REACT_NATIVE_ARCHITECTURES
@@ -59,6 +61,13 @@ internal object ProjectUtils {
HERMES_FALLBACK
}
internal val Project.isEdgeToEdgeEnabled: Boolean
get() =
(project.hasProperty(EDGE_TO_EDGE_ENABLED) &&
project.property(EDGE_TO_EDGE_ENABLED).toString().toBoolean()) ||
(project.hasProperty(SCOPED_EDGE_TO_EDGE_ENABLED) &&
project.property(SCOPED_EDGE_TO_EDGE_ENABLED).toString().toBoolean())
internal val Project.useThirdPartyJSC: Boolean
get() =
(project.hasProperty(USE_THIRD_PARTY_JSC) &&
@@ -14,10 +14,14 @@ object PropertyUtils {
const val NEW_ARCH_ENABLED = "newArchEnabled"
const val SCOPED_NEW_ARCH_ENABLED = "react.newArchEnabled"
/** Public property that toggles the New Architecture */
/** Public property that toggles Hermes */
const val HERMES_ENABLED = "hermesEnabled"
const val SCOPED_HERMES_ENABLED = "react.hermesEnabled"
/** Public property that toggles edge-to-edge */
const val EDGE_TO_EDGE_ENABLED = "edgeToEdgeEnabled"
const val SCOPED_EDGE_TO_EDGE_ENABLED = "react.edgeToEdgeEnabled"
/** Public property that excludes jsctooling from core */
const val USE_THIRD_PARTY_JSC = "useThirdPartyJSC"
const val SCOPED_USE_THIRD_PARTY_JSC = "react.useThirdPartyJSC"
@@ -30,6 +34,12 @@ object PropertyUtils {
const val INCLUDE_JITPACK_REPOSITORY = "includeJitpackRepository"
const val SCOPED_INCLUDE_JITPACK_REPOSITORY = "react.includeJitpackRepository"
/**
* Public property that allows to configure an enterprise repository proxy as exclusive repository
*/
const val EXCLUSIVE_ENTEPRISE_REPOSITORY = "exclusiveEnterpriseRepository"
const val SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY = "react.exclusiveEnterpriseRepository"
/** By default we include JitPack to avoid breaking user builds */
internal const val INCLUDE_JITPACK_REPOSITORY_DEFAULT = true
@@ -55,6 +55,7 @@ class GenerateEntryPointTaskTest {
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.views.view.WindowUtilKt;
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
import com.facebook.soloader.SoLoader;
@@ -78,6 +79,10 @@ class GenerateEntryPointTaskTest {
if (com.facebook.react.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
DefaultNewArchitectureEntryPoint.load();
}
if (com.facebook.react.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
}
}
}
"""
@@ -233,6 +233,7 @@ class GeneratePackageListTaskTest {
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -311,7 +312,8 @@ class GeneratePackageListTaskTest {
import com.facebook.react.aPackage;
// @react-native/another-package
import com.facebook.react.anotherPackage;
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -10,6 +10,7 @@ package com.facebook.react.utils
import com.facebook.react.tests.createProject
import com.facebook.react.utils.DependencyUtils.configureDependencies
import com.facebook.react.utils.DependencyUtils.configureRepositories
import com.facebook.react.utils.DependencyUtils.exclusiveEnterpriseRepository
import com.facebook.react.utils.DependencyUtils.getDependencySubstitutions
import com.facebook.react.utils.DependencyUtils.mavenRepoFromURI
import com.facebook.react.utils.DependencyUtils.mavenRepoFromUrl
@@ -99,6 +100,24 @@ class DependencyUtilsTest {
.isNotNull()
}
@Test
fun configureRepositories_withExclusiveEnterpriseRepository_replacesAllRepositories() {
val repositoryURI = URI.create("https://maven.myfabolousorganization.it")
val project = createProject()
project.rootProject.extensions.extraProperties.set(
"exclusiveEnterpriseRepository", repositoryURI.toString())
configureRepositories(project)
assertThat(project.repositories).hasSize(1)
assertThat(
project.repositories.firstOrNull {
it is MavenArtifactRepository && it.url == repositoryURI
})
.isNotNull()
}
@Test
fun configureRepositories_withIncludeJitpackRepositoryFalse_doesNotContainJitPack() {
val repositoryURI = URI.create("https://www.jitpack.io")
@@ -470,7 +489,7 @@ class DependencyUtilsTest {
@Test
fun shouldAddJitPack_withUnscopedProperty() {
val project = createProject(tempFolder.root)
project.extensions.extraProperties.set("react.includeJitpackRepository", "false")
project.extensions.extraProperties.set("includeJitpackRepository", "false")
assertThat(project.shouldAddJitPack()).isFalse()
}
@@ -479,4 +498,28 @@ class DependencyUtilsTest {
val project = createProject(tempFolder.root)
assertThat(project.shouldAddJitPack()).isTrue()
}
@Test
fun exclusiveEnterpriseRepository_withScopedProperty() {
val project = createProject(tempFolder.root)
project.extensions.extraProperties.set(
"react.exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
assertThat(project.exclusiveEnterpriseRepository())
.isEqualTo("https://maven.myfabolousorganization.it")
}
@Test
fun exclusiveEnterpriseRepository_withUnscopedProperty() {
val project = createProject(tempFolder.root)
project.extensions.extraProperties.set(
"exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
assertThat(project.exclusiveEnterpriseRepository())
.isEqualTo("https://maven.myfabolousorganization.it")
}
@Test
fun exclusiveEnterpriseRepository_defaultIsTrue() {
val project = createProject(tempFolder.root)
assertThat(project.exclusiveEnterpriseRepository()).isNull()
}
}
@@ -12,6 +12,7 @@ import com.facebook.react.model.ModelCodegenConfig
import com.facebook.react.model.ModelPackageJson
import com.facebook.react.tests.createProject
import com.facebook.react.utils.ProjectUtils.getReactNativeArchitectures
import com.facebook.react.utils.ProjectUtils.isEdgeToEdgeEnabled
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
@@ -98,7 +99,7 @@ class ProjectUtilsTest {
}
@Test
fun isNewArchEnabled_withDisabledViaProperty_returnsFalse() {
fun isHermesEnabled_withDisabledViaProperty_returnsFalse() {
val project = createProject()
project.extensions.extraProperties.set("hermesEnabled", "false")
assertThat(project.isHermesEnabled).isFalse()
@@ -150,6 +151,32 @@ class ProjectUtilsTest {
assertThat(project.isHermesEnabled).isTrue()
}
@Test
fun isEdgeToEdgeEnabled_returnsFalseByDefault() {
assertThat(createProject().isEdgeToEdgeEnabled).isFalse()
}
@Test
fun isEdgeToEdgeEnabled_withDisabledViaProperty_returnsFalse() {
val project = createProject()
project.extensions.extraProperties.set("edgeToEdgeEnabled", "false")
assertThat(project.isEdgeToEdgeEnabled).isFalse()
}
@Test
fun isEdgeToEdgeEnabled_withEnabledViaProperty_returnsTrue() {
val project = createProject()
project.extensions.extraProperties.set("edgeToEdgeEnabled", "true")
assertThat(project.isEdgeToEdgeEnabled).isTrue()
}
@Test
fun isEdgeToEdgeEnabled_withInvalidViaProperty_returnsFalse() {
val project = createProject()
project.extensions.extraProperties.set("edgeToEdgeEnabled", "¯\\_(ツ)_/¯")
assertThat(project.isEdgeToEdgeEnabled).isFalse()
}
@Test
fun needsCodegenFromPackageJson_withCodegenConfigInPackageJson_returnsTrue() {
val project = createProject()
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -16,7 +16,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"exports": {
".": "./src/index.js",
@@ -26,9 +26,9 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.80.0-main",
"@react-native/metro-babel-transformer": "0.80.0-main",
"metro-config": "^0.82.4",
"metro-runtime": "^0.82.4"
"@react-native/js-polyfills": "0.81.5",
"@react-native/metro-babel-transformer": "0.81.5",
"metro-config": "^0.83.1",
"metro-runtime": "^0.83.1"
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
export {mergeConfig} from 'metro-config';
let frameworkDefaults = {};
let frameworkDefaults: InputConfigT = {};
export function setFrameworkDefaults(config: InputConfigT) {
frameworkDefaults = config;
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/new-app-screen",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "NewAppScreen component for React Native",
"keywords": [
"react-native"
@@ -30,6 +30,6 @@
}
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+17 -12
View File
@@ -13,10 +13,7 @@ import {ThemedText, useTheme} from './Theme';
import * as React from 'react';
import {
Image,
Platform,
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
TouchableHighlight,
@@ -29,24 +26,32 @@ import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNa
export type NewAppScreenProps = $ReadOnly<{
templateFileName?: string,
safeAreaInsets?: $ReadOnly<{
top: number,
bottom: number,
left: number,
right: number,
}>,
}>;
const statusBarHeightOffset = Platform.select({
android: StatusBar.currentHeight || 0,
default: 0,
});
export default function NewAppScreen({
templateFileName = 'App.tsx',
safeAreaInsets = {top: 0, bottom: 0, left: 0, right: 0},
}: NewAppScreenProps): React.Node {
const {colors} = useTheme();
const isDarkMode = useColorScheme() === 'dark';
const isLargeScreen = useWindowDimensions().width > 600;
return (
<SafeAreaView style={{backgroundColor: colors.background}}>
<ScrollView>
<View style={[styles.container, {paddingTop: statusBarHeightOffset}]}>
<View
style={{
backgroundColor: colors.background,
paddingTop: safeAreaInsets.top,
paddingLeft: safeAreaInsets.left,
paddingRight: safeAreaInsets.right,
}}>
<ScrollView style={{paddingBottom: safeAreaInsets.bottom}}>
<View style={styles.container}>
<View style={styles.header}>
<Image
style={styles.logo}
@@ -99,7 +104,7 @@ export default function NewAppScreen({
</View>
</View>
</ScrollView>
</SafeAreaView>
</View>
);
}
+8
View File
@@ -11,6 +11,14 @@ import type * as React from 'react';
export type NewAppScreenProps = Readonly<{
templateFileName?: string | undefined;
safeAreaInsets?:
| Readonly<{
top: number;
bottom: number;
left: number;
right: number;
}>
| undefined;
}>;
export function NewAppScreen(props: NewAppScreenProps): React.ReactNode;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
@@ -1,277 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
const LOG_LEVELS = {
trace: 0,
info: 1,
warn: 2,
error: 3,
};
describe('console', () => {
describe('.table(data, rows)', () => {
let originalNativeLoggingHook;
let logFn;
beforeEach(() => {
originalNativeLoggingHook = global.nativeLoggingHook;
logFn = global.nativeLoggingHook = jest.fn();
});
afterEach(() => {
global.nativeLoggingHook = originalNativeLoggingHook;
});
it('should print the passed array as a Markdown table', () => {
console.table([
{name: 'First', value: 500},
{name: 'Second', value: 600},
{name: 'Third', value: 700},
{name: 'Fourth', value: 800, extraValue: true},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | extraValue |
| ------- | -------- | ----- | ---------- |
| 0 | 'First' | 500 | |
| 1 | 'Second' | 600 | |
| 2 | 'Third' | 700 | |
| 3 | 'Fourth' | 800 | true |`,
LOG_LEVELS.info,
]);
});
it('should print the passed dictionary as a Markdown table', () => {
console.table({
first: {name: 'First', value: 500},
second: {name: 'Second', value: 600},
third: {name: 'Third', value: 700},
fourth: {name: 'Fourth', value: 800, extraValue: true},
});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | extraValue |
| ------- | -------- | ----- | ---------- |
| first | 'First' | 500 | |
| second | 'Second' | 600 | |
| third | 'Third' | 700 | |
| fourth | 'Fourth' | 800 | true |`,
LOG_LEVELS.info,
]);
});
it('should work with different types of values', () => {
console.table([
{
string: '',
number: 0,
boolean: true,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'a',
number: 1,
boolean: true,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'aa',
number: 2,
boolean: false,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'aaa',
number: 3,
boolean: false,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | string | number | boolean | function | object | null | undefined |
| ------- | ------ | ------ | ------- | -------- | ------ | ---- | --------- |
| 0 | '' | 0 | true | ƒ | {} | null | undefined |
| 1 | 'a' | 1 | true | ƒ | {} | null | undefined |
| 2 | 'aa' | 2 | false | ƒ | {} | null | undefined |
| 3 | 'aaa' | 3 | false | ƒ | {} | null | undefined |`,
LOG_LEVELS.info,
]);
});
it('should print the keys in all the objects', () => {
console.table([
{name: 'foo'},
{name: 'bar', value: 1},
{value: 2, surname: 'baz'},
{address: 'other'},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | surname | address |
| ------- | ----- | ----- | ------- | ------- |
| 0 | 'foo' | | | |
| 1 | 'bar' | 1 | | |
| 2 | | 2 | 'baz' | |
| 3 | | | | 'other' |`,
LOG_LEVELS.info,
]);
});
it('should print an empty string for empty arrays', () => {
console.table([]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
});
it('should print an empty string for empty dictionaries', () => {
console.table({});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
});
// This test is currently failing
it('should print an indices table for an array of empty objects', () => {
console.table([{}, {}, {}, {}]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) |
| ------- |
| 0 |
| 1 |
| 2 |
| 3 |`,
LOG_LEVELS.info,
]);
});
it('should print an indices table for a dictionary of empty objects', () => {
console.table({
first: {},
second: {},
third: {},
fourth: {},
});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) |
| ------- |
| first |
| second |
| third |
| fourth |`,
LOG_LEVELS.info,
]);
});
it('should not modify the logged value', () => {
global.nativeLoggingHook = jest.fn();
const array = [
{name: 'First', value: 500},
{name: 'Second', value: 600},
{name: 'Third', value: 700},
{name: 'Fourth', value: 800, extraValue: true},
];
const originalArrayValue = JSON.parse(JSON.stringify(array));
console.table(array);
expect(array).toEqual(originalArrayValue);
const object = {
first: {name: 'First', value: 500},
second: {name: 'Second', value: 600},
third: {name: 'Third', value: 700},
fourth: {name: 'Fourth', value: 800, extraValue: true},
};
const originalObjectValue = JSON.parse(JSON.stringify(object));
console.table(object);
expect(object).toEqual(originalObjectValue);
});
it('should only print the selected columns, if specified (arrays)', () => {
console.table(
[
{first: 1, second: 2, third: 3},
{first: 4, second: 5},
{third: 7, fourth: 8},
{fifth: 9},
],
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | first | fifth |
| ------- | ----- | ----- |
| 0 | 1 | |
| 1 | 4 | |
| 2 | | |
| 3 | | 9 |`,
LOG_LEVELS.info,
]);
});
it('should only print the selected columns, if specified (dictionaries)', () => {
console.table(
{
a: {first: 1, second: 2, third: 3},
b: {first: 4, second: 5},
c: {third: 7, fourth: 8},
d: {fifth: 9},
},
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | first | fifth |
| ------- | ----- | ----- |
| a | 1 | |
| b | 4 | |
| c | | |
| d | | 9 |`,
LOG_LEVELS.info,
]);
});
});
});
@@ -0,0 +1,275 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
const LOG_LEVELS = {
trace: 0,
info: 1,
warn: 2,
error: 3,
};
describe('console.table(data, rows)', () => {
let originalNativeLoggingHook;
let logFn;
beforeEach(() => {
originalNativeLoggingHook = global.nativeLoggingHook;
logFn = global.nativeLoggingHook = jest.fn();
});
afterEach(() => {
global.nativeLoggingHook = originalNativeLoggingHook;
});
it('should print the passed array as a Markdown table', () => {
console.table([
{name: 'First', value: 500},
{name: 'Second', value: 600},
{name: 'Third', value: 700},
{name: 'Fourth', value: 800, extraValue: true},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | extraValue |
| ------- | -------- | ----- | ---------- |
| 0 | 'First' | 500 | |
| 1 | 'Second' | 600 | |
| 2 | 'Third' | 700 | |
| 3 | 'Fourth' | 800 | true |`,
LOG_LEVELS.info,
]);
});
it('should print the passed dictionary as a Markdown table', () => {
console.table({
first: {name: 'First', value: 500},
second: {name: 'Second', value: 600},
third: {name: 'Third', value: 700},
fourth: {name: 'Fourth', value: 800, extraValue: true},
});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | extraValue |
| ------- | -------- | ----- | ---------- |
| first | 'First' | 500 | |
| second | 'Second' | 600 | |
| third | 'Third' | 700 | |
| fourth | 'Fourth' | 800 | true |`,
LOG_LEVELS.info,
]);
});
it('should work with different types of values', () => {
console.table([
{
string: '',
number: 0,
boolean: true,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'a',
number: 1,
boolean: true,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'aa',
number: 2,
boolean: false,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
{
string: 'aaa',
number: 3,
boolean: false,
function: () => {},
object: {a: 1, b: 2},
null: null,
undefined: undefined,
},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | string | number | boolean | function | object | null | undefined |
| ------- | ------ | ------ | ------- | -------- | ------ | ---- | --------- |
| 0 | '' | 0 | true | ƒ | {} | null | undefined |
| 1 | 'a' | 1 | true | ƒ | {} | null | undefined |
| 2 | 'aa' | 2 | false | ƒ | {} | null | undefined |
| 3 | 'aaa' | 3 | false | ƒ | {} | null | undefined |`,
LOG_LEVELS.info,
]);
});
it('should print the keys in all the objects', () => {
console.table([
{name: 'foo'},
{name: 'bar', value: 1},
{value: 2, surname: 'baz'},
{address: 'other'},
]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | name | value | surname | address |
| ------- | ----- | ----- | ------- | ------- |
| 0 | 'foo' | | | |
| 1 | 'bar' | 1 | | |
| 2 | | 2 | 'baz' | |
| 3 | | | | 'other' |`,
LOG_LEVELS.info,
]);
});
it('should print an empty string for empty arrays', () => {
console.table([]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
});
it('should print an empty string for empty dictionaries', () => {
console.table({});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
});
// This test is currently failing
it('should print an indices table for an array of empty objects', () => {
console.table([{}, {}, {}, {}]);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) |
| ------- |
| 0 |
| 1 |
| 2 |
| 3 |`,
LOG_LEVELS.info,
]);
});
it('should print an indices table for a dictionary of empty objects', () => {
console.table({
first: {},
second: {},
third: {},
fourth: {},
});
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) |
| ------- |
| first |
| second |
| third |
| fourth |`,
LOG_LEVELS.info,
]);
});
it('should not modify the logged value', () => {
global.nativeLoggingHook = jest.fn();
const array = [
{name: 'First', value: 500},
{name: 'Second', value: 600},
{name: 'Third', value: 700},
{name: 'Fourth', value: 800, extraValue: true},
];
const originalArrayValue = JSON.parse(JSON.stringify(array));
console.table(array);
expect(array).toEqual(originalArrayValue);
const object = {
first: {name: 'First', value: 500},
second: {name: 'Second', value: 600},
third: {name: 'Third', value: 700},
fourth: {name: 'Fourth', value: 800, extraValue: true},
};
const originalObjectValue = JSON.parse(JSON.stringify(object));
console.table(object);
expect(object).toEqual(originalObjectValue);
});
it('should only print the selected columns, if specified (arrays)', () => {
console.table(
[
{first: 1, second: 2, third: 3},
{first: 4, second: 5},
{third: 7, fourth: 8},
{fifth: 9},
],
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | first | fifth |
| ------- | ----- | ----- |
| 0 | 1 | |
| 1 | 4 | |
| 2 | | |
| 3 | | 9 |`,
LOG_LEVELS.info,
]);
});
it('should only print the selected columns, if specified (dictionaries)', () => {
console.table(
{
a: {first: 1, second: 2, third: 3},
b: {first: 4, second: 5},
c: {third: 7, fourth: 8},
d: {fifth: 9},
},
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
expect(logFn.mock.lastCall).toEqual([
`
| (index) | first | fifth |
| ------- | ----- | ----- |
| a | 1 | |
| b | 4 | |
| c | | |
| d | | 9 |`,
LOG_LEVELS.info,
]);
});
});
@@ -0,0 +1,41 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @fantom_mode *
* @fantom_flags fuseboxEnabledRelease:*
*/
describe('console.timeStamp()', () => {
it('installed', () => {
expect(typeof console.timeStamp).toBe('function');
});
it("doesn't throw when label is not specified", () => {
expect(() => console.timeStamp()).not.toThrow();
});
it("doesn't throw when label is specified", () => {
expect(() => console.timeStamp('label')).not.toThrow();
});
it("doesn't throw when additional arguments are specified", () => {
expect(() =>
// $FlowExpectedError[extra-arg]
console.timeStamp('label', 100, 500, 'Track', 'Group', 'error'),
).not.toThrow();
});
it("doesn't throw when invalid arguments are specified", () => {
// $FlowExpectedError[incompatible-call]
expect(() => console.timeStamp({})).not.toThrow();
expect(() =>
// $FlowExpectedError[extra-arg]
console.timeStamp('label', true, null, {}, [], () => {}),
).not.toThrow();
});
});
+7
View File
@@ -569,6 +569,11 @@ function consoleAssertPolyfill(expression, label) {
}
}
// https://developer.mozilla.org/en-US/docs/Web/API/console/timeStamp_static.
// Non-standard API for recording markers on a timeline of the Performance instrumentation.
// The actual logging is not provided by definition.
function consoleTimeStampPolyfill() {}
if (global.nativeLoggingHook) {
const originalConsole = global.console;
// Preserve the original `console` as `originalConsole`
@@ -580,6 +585,7 @@ if (global.nativeLoggingHook) {
}
global.console = {
timeStamp: consoleTimeStampPolyfill,
...(originalConsole ?? {}),
error: getNativeLogFunction(LOG_LEVELS.error),
info: getNativeLogFunction(LOG_LEVELS.info),
@@ -694,6 +700,7 @@ if (global.nativeLoggingHook) {
profile: stub,
profileEnd: stub,
table: stub,
timeStamp: stub,
};
Object.defineProperty(console, '_isPolyfilled', {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -18,7 +18,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"console.js",
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Babel preset for React Native applications",
"repository": {
"type": "git",
@@ -13,7 +13,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "src/index.js",
"files": [
@@ -66,8 +66,8 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.80.0-main",
"babel-plugin-syntax-hermes-parser": "0.28.1",
"@react-native/babel-plugin-codegen": "0.81.5",
"babel-plugin-syntax-hermes-parser": "0.29.1",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
},
+22 -14
View File
@@ -38,19 +38,6 @@ function isFirstParty(fileName) {
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
const loose = true;
const defaultPlugins = [
[require('babel-plugin-syntax-hermes-parser'), {parseLangTypes: 'flow'}],
[require('babel-plugin-transform-flow-enums')],
[require('@babel/plugin-transform-block-scoping')],
[require('@babel/plugin-transform-class-properties'), {loose}],
[require('@babel/plugin-transform-private-methods'), {loose}],
[require('@babel/plugin-transform-private-property-in-object'), {loose}],
[require('@babel/plugin-syntax-dynamic-import')],
[require('@babel/plugin-syntax-export-default-from')],
...passthroughSyntaxPlugins,
[require('@babel/plugin-transform-unicode-regex')],
];
// For Static Hermes testing (experimental), the hermes-canary transformProfile
// is used to enable regenerator (and some related lowering passes) because SH
// requires more Babel lowering than Hermes temporarily.
@@ -234,7 +221,28 @@ const getPreset = (src, options) => {
plugins: [require('@babel/plugin-transform-flow-strip-types')],
},
{
plugins: defaultPlugins,
plugins: [
[
require('babel-plugin-syntax-hermes-parser'),
{
parseLangTypes: 'flow',
reactRuntimeTarget: '19',
...options.hermesParserOptions,
},
],
[require('babel-plugin-transform-flow-enums')],
[require('@babel/plugin-transform-block-scoping')],
[require('@babel/plugin-transform-class-properties'), {loose}],
[require('@babel/plugin-transform-private-methods'), {loose}],
[
require('@babel/plugin-transform-private-property-in-object'),
{loose},
],
[require('@babel/plugin-syntax-dynamic-import')],
[require('@babel/plugin-syntax-export-default-from')],
...passthroughSyntaxPlugins,
[require('@babel/plugin-transform-unicode-regex')],
],
},
{
test: isTypeScriptSource,
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Babel transformer for React Native applications.",
"repository": {
"type": "git",
@@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "src/index.js",
"files": [
@@ -27,8 +27,8 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.80.0-main",
"hermes-parser": "0.28.1",
"@react-native/babel-preset": "0.81.5",
"hermes-parser": "0.29.1",
"nullthrows": "^1.1.1"
},
"peerDependencies": {
@@ -40,6 +40,10 @@ ArrayPropsNativeComponentViewProps::ArrayPropsNativeComponentViewProps(
arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ArrayPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ArrayPropsNativeComponentView\\";
}
folly::dynamic ArrayPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ArrayPropsNativeComponentViewProps();
@@ -51,18 +55,57 @@ folly::dynamic ArrayPropsNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (names != oldProps->names) {
result[\\"names\\"] = toDynamic(names);
}
if (disableds != oldProps->disableds) {
result[\\"disableds\\"] = toDynamic(disableds);
}
if (progress != oldProps->progress) {
result[\\"progress\\"] = toDynamic(progress);
}
if (radii != oldProps->radii) {
result[\\"radii\\"] = toDynamic(radii);
}
if (colors != oldProps->colors) {
result[\\"colors\\"] = toDynamic(colors);
}
if (srcs != oldProps->srcs) {
result[\\"srcs\\"] = toDynamic(srcs);
}
if (points != oldProps->points) {
result[\\"points\\"] = toDynamic(points);
}
if (edgeInsets != oldProps->edgeInsets) {
result[\\"edgeInsets\\"] = toDynamic(edgeInsets);
}
if (dimensions != oldProps->dimensions) {
result[\\"dimensions\\"] = toDynamic(dimensions);
}
if (sizes != oldProps->sizes) {
result[\\"sizes\\"] = toDynamic(sizes);
}
if (object != oldProps->object) {
result[\\"object\\"] = toDynamic(object);
}
if (arrayOfObjects != oldProps->arrayOfObjects) {
result[\\"arrayOfObjects\\"] = toDynamic(arrayOfObjects);
}
if (arrayOfMixed != oldProps->arrayOfMixed) {
result[\\"arrayOfMixed\\"] = toDynamic(arrayOfMixed);
}
return result;
}
#endif
@@ -99,6 +142,10 @@ BooleanPropNativeComponentViewProps::BooleanPropNativeComponentViewProps(
disabledNullable(convertRawProp(context, rawProps, \\"disabledNullable\\", sourceProps.disabledNullable, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName BooleanPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"BooleanPropNativeComponentView\\";
}
folly::dynamic BooleanPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = BooleanPropNativeComponentViewProps();
@@ -152,6 +199,10 @@ ColorPropNativeComponentViewProps::ColorPropNativeComponentViewProps(
tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ColorPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ColorPropNativeComponentView\\";
}
folly::dynamic ColorPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ColorPropNativeComponentViewProps();
@@ -202,6 +253,10 @@ DimensionPropNativeComponentViewProps::DimensionPropNativeComponentViewProps(
marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName DimensionPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"DimensionPropNativeComponentView\\";
}
folly::dynamic DimensionPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = DimensionPropNativeComponentViewProps();
@@ -213,6 +268,9 @@ folly::dynamic DimensionPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (marginBack != oldProps->marginBack) {
result[\\"marginBack\\"] = toDynamic(marginBack);
}
return result;
}
#endif
@@ -248,6 +306,10 @@ EdgeInsetsPropNativeComponentViewProps::EdgeInsetsPropNativeComponentViewProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EdgeInsetsPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EdgeInsetsPropNativeComponentView\\";
}
folly::dynamic EdgeInsetsPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EdgeInsetsPropNativeComponentViewProps();
@@ -295,6 +357,10 @@ EnumPropNativeComponentViewProps::EnumPropNativeComponentViewProps(
intervals(convertRawProp(context, rawProps, \\"intervals\\", sourceProps.intervals, {EnumPropNativeComponentViewIntervals::Intervals0})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EnumPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EnumPropNativeComponentView\\";
}
folly::dynamic EnumPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EnumPropNativeComponentViewProps();
@@ -306,7 +372,13 @@ folly::dynamic EnumPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (alignment != oldProps->alignment) {
result[\\"alignment\\"] = toDynamic(alignment);
}
if (intervals != oldProps->intervals) {
result[\\"intervals\\"] = toDynamic(intervals);
}
return result;
}
#endif
@@ -342,6 +414,10 @@ EventNestedObjectPropsNativeComponentViewProps::EventNestedObjectPropsNativeComp
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventNestedObjectPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EventNestedObjectPropsNativeComponentView\\";
}
folly::dynamic EventNestedObjectPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventNestedObjectPropsNativeComponentViewProps();
@@ -391,6 +467,10 @@ EventPropsNativeComponentViewProps::EventPropsNativeComponentViewProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EventPropsNativeComponentView\\";
}
folly::dynamic EventPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventPropsNativeComponentViewProps();
@@ -446,6 +526,10 @@ FloatPropsNativeComponentViewProps::FloatPropsNativeComponentViewProps(
blurRadiusNullable(convertRawProp(context, rawProps, \\"blurRadiusNullable\\", sourceProps.blurRadiusNullable, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName FloatPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"FloatPropsNativeComponentView\\";
}
folly::dynamic FloatPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = FloatPropsNativeComponentViewProps();
@@ -520,6 +604,10 @@ ImagePropNativeComponentViewProps::ImagePropNativeComponentViewProps(
thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ImagePropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ImagePropNativeComponentView\\";
}
folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ImagePropNativeComponentViewProps();
@@ -532,7 +620,7 @@ folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
@@ -571,6 +659,10 @@ IntegerPropNativeComponentViewProps::IntegerPropNativeComponentViewProps(
progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName IntegerPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"IntegerPropNativeComponentView\\";
}
folly::dynamic IntegerPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = IntegerPropNativeComponentViewProps();
@@ -628,6 +720,10 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps(
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {\\"\\"})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"InterfaceOnlyNativeComponentView\\";
}
folly::dynamic InterfaceOnlyNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = InterfaceOnlyNativeComponentViewProps();
@@ -678,6 +774,10 @@ MixedPropNativeComponentViewProps::MixedPropNativeComponentViewProps(
mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MixedPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"MixedPropNativeComponentView\\";
}
folly::dynamic MixedPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MixedPropNativeComponentViewProps();
@@ -689,6 +789,9 @@ folly::dynamic MixedPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (mixedProp != oldProps->mixedProp) {
result[\\"mixedProp\\"] = mixedProp;
}
return result;
}
#endif
@@ -728,6 +831,10 @@ MultiNativePropNativeComponentViewProps::MultiNativePropNativeComponentViewProps
point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiNativePropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"MultiNativePropNativeComponentView\\";
}
folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiNativePropNativeComponentViewProps();
@@ -740,7 +847,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
if (color != oldProps->color) {
@@ -752,10 +859,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
}
if (point != oldProps->point) {
folly::dynamic pointResult = folly::dynamic::object();
pointResult[\\"x\\"] = point.x;
pointResult[\\"y\\"] = point.y;
result[\\"point\\"] = pointResult;
result[\\"point\\"] = toDynamic(point);
}
return result;
}
@@ -792,6 +896,10 @@ NoPropsNoEventsNativeComponentViewProps::NoPropsNoEventsNativeComponentViewProps
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName NoPropsNoEventsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"NoPropsNoEventsNativeComponentView\\";
}
folly::dynamic NoPropsNoEventsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = NoPropsNoEventsNativeComponentViewProps();
@@ -841,6 +949,10 @@ ObjectPropsNativeComponentProps::ObjectPropsNativeComponentProps(
objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ObjectPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ObjectPropsNativeComponent\\";
}
folly::dynamic ObjectPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ObjectPropsNativeComponentProps();
@@ -852,8 +964,17 @@ folly::dynamic ObjectPropsNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (objectProp != oldProps->objectProp) {
result[\\"objectProp\\"] = toDynamic(objectProp);
}
if (objectArrayProp != oldProps->objectArrayProp) {
result[\\"objectArrayProp\\"] = toDynamic(objectArrayProp);
}
if (objectPrimitiveRequiredProp != oldProps->objectPrimitiveRequiredProp) {
result[\\"objectPrimitiveRequiredProp\\"] = toDynamic(objectPrimitiveRequiredProp);
}
return result;
}
#endif
@@ -889,6 +1010,10 @@ PointPropNativeComponentViewProps::PointPropNativeComponentViewProps(
startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName PointPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"PointPropNativeComponentView\\";
}
folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = PointPropNativeComponentViewProps();
@@ -901,10 +1026,7 @@ folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (startPoint != oldProps->startPoint) {
folly::dynamic pointResult = folly::dynamic::object();
pointResult[\\"x\\"] = startPoint.x;
pointResult[\\"y\\"] = startPoint.y;
result[\\"startPoint\\"] = pointResult;
result[\\"startPoint\\"] = toDynamic(startPoint);
}
return result;
}
@@ -942,6 +1064,10 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps(
defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName StringPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"StringPropNativeComponentView\\";
}
folly::dynamic StringPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = StringPropNativeComponentViewProps();
@@ -16,6 +16,7 @@ Object {
#include <cinttypes>
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/graphicsConversions.h>
#include <react/renderer/core/propsConversions.h>
#include <react/renderer/graphics/Color.h>
#include <react/renderer/graphics/Point.h>
@@ -87,6 +88,16 @@ static inline std::string toString(const ArrayPropsNativeComponentViewSizesMaskW
}
struct ArrayPropsNativeComponentViewObjectStruct {
std::string prop{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentViewObjectStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"prop\\"] = prop;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewObjectStruct &result) {
@@ -102,6 +113,12 @@ static inline std::string toString(const ArrayPropsNativeComponentViewObjectStru
return \\"[Object ArrayPropsNativeComponentViewObjectStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentViewObjectStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentViewObjectStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -115,6 +132,17 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ArrayPropsNativeComponentViewArrayOfObjectsStruct {
Float prop1{0.0};
int prop2{0};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentViewArrayOfObjectsStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"prop1\\"] = prop1;
result[\\"prop2\\"] = prop2;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewArrayOfObjectsStruct &result) {
@@ -134,6 +162,12 @@ static inline std::string toString(const ArrayPropsNativeComponentViewArrayOfObj
return \\"[Object ArrayPropsNativeComponentViewArrayOfObjectsStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentViewArrayOfObjectsStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentViewArrayOfObjectsStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -165,6 +199,8 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps {
std::vector<folly::dynamic> arrayOfMixed{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -203,6 +239,8 @@ class BooleanPropNativeComponentViewProps final : public ViewProps {
bool disabledNullable{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -241,6 +279,8 @@ class ColorPropNativeComponentViewProps final : public ViewProps {
SharedColor tintColor{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -265,6 +305,7 @@ Object {
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/graphicsConversions.h>
#include <yoga/Yoga.h>
namespace facebook::react {
@@ -279,6 +320,8 @@ class DimensionPropNativeComponentViewProps final : public ViewProps {
YGValue marginBack{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -316,6 +359,8 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -360,6 +405,12 @@ static inline std::string toString(const EnumPropNativeComponentViewAlignment &v
case EnumPropNativeComponentViewAlignment::BottomRight: return \\"bottom-right\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const EnumPropNativeComponentViewAlignment &value) {
return toString(value);
}
#endif
enum class EnumPropNativeComponentViewIntervals { Intervals0 = 0, Intervals15 = 15, Intervals30 = 30, Intervals60 = 60 };
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, EnumPropNativeComponentViewIntervals &result) {
@@ -391,6 +442,17 @@ static inline std::string toString(const EnumPropNativeComponentViewIntervals &v
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const EnumPropNativeComponentViewIntervals &value) {
switch (value) {
case EnumPropNativeComponentViewIntervals::Intervals0: return 0;
case EnumPropNativeComponentViewIntervals::Intervals15: return 15;
case EnumPropNativeComponentViewIntervals::Intervals30: return 30;
case EnumPropNativeComponentViewIntervals::Intervals60: return 60;
}
}
#endif
class EnumPropNativeComponentViewProps final : public ViewProps {
public:
EnumPropNativeComponentViewProps() = default;
@@ -402,6 +464,8 @@ class EnumPropNativeComponentViewProps final : public ViewProps {
EnumPropNativeComponentViewIntervals intervals{EnumPropNativeComponentViewIntervals::Intervals0};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -439,6 +503,8 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -476,6 +542,8 @@ class EventPropsNativeComponentViewProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -519,6 +587,8 @@ class FloatPropsNativeComponentViewProps final : public ViewProps {
Float blurRadiusNullable{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -557,6 +627,8 @@ class ImagePropNativeComponentViewProps final : public ViewProps {
ImageSource thumbImage{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -596,6 +668,8 @@ class IntegerPropNativeComponentViewProps final : public ViewProps {
int progress3{10};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -633,6 +707,8 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps {
std::string title{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -670,6 +746,8 @@ class MixedPropNativeComponentViewProps final : public ViewProps {
folly::dynamic mixedProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -713,6 +791,8 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps {
Point point{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -750,6 +830,8 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -798,6 +880,12 @@ static inline std::string toString(const ObjectPropsNativeComponentStringEnumPro
case ObjectPropsNativeComponentStringEnumProp::Large: return \\"large\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentStringEnumProp &value) {
return toString(value);
}
#endif
enum class ObjectPropsNativeComponentIntEnumProp { IntEnumProp0 = 0, IntEnumProp1 = 1 };
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentIntEnumProp &result) {
@@ -820,6 +908,15 @@ static inline std::string toString(const ObjectPropsNativeComponentIntEnumProp &
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp1: return \\"1\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentIntEnumProp &value) {
switch (value) {
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp0: return 0;
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp1: return 1;
}
}
#endif
struct ObjectPropsNativeComponentObjectPropStruct {
std::string stringProp{\\"\\"};
bool booleanProp{false};
@@ -827,6 +924,21 @@ struct ObjectPropsNativeComponentObjectPropStruct {
int intProp{0};
ObjectPropsNativeComponentStringEnumProp stringEnumProp{ObjectPropsNativeComponentStringEnumProp::Small};
ObjectPropsNativeComponentIntEnumProp intEnumProp{ObjectPropsNativeComponentIntEnumProp::IntEnumProp0};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
result[\\"booleanProp\\"] = booleanProp;
result[\\"floatProp\\"] = floatProp;
result[\\"intProp\\"] = intProp;
result[\\"stringEnumProp\\"] = ::facebook::react::toDynamic(stringEnumProp);
result[\\"intEnumProp\\"] = ::facebook::react::toDynamic(intEnumProp);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPropStruct &result) {
@@ -862,8 +974,24 @@ static inline std::string toString(const ObjectPropsNativeComponentObjectPropStr
return \\"[Object ObjectPropsNativeComponentObjectPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsNativeComponentObjectArrayPropStruct {
std::vector<std::string> array{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectArrayPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"array\\"] = ::facebook::react::toDynamic(array);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectArrayPropStruct &result) {
@@ -879,10 +1007,28 @@ static inline std::string toString(const ObjectPropsNativeComponentObjectArrayPr
return \\"[Object ObjectPropsNativeComponentObjectArrayPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectArrayPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct {
ImageSource image{};
SharedColor color{};
Point point{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"image\\"] = ::facebook::react::toDynamic(image);
result[\\"color\\"] = ::facebook::react::toDynamic(color);
result[\\"point\\"] = ::facebook::react::toDynamic(point);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &result) {
@@ -905,6 +1051,12 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
static inline std::string toString(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &value) {
return \\"[Object ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &value) {
return value.toDynamic();
}
#endif
class ObjectPropsNativeComponentProps final : public ViewProps {
public:
ObjectPropsNativeComponentProps() = default;
@@ -917,6 +1069,8 @@ class ObjectPropsNativeComponentProps final : public ViewProps {
ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct objectPrimitiveRequiredProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -955,6 +1109,8 @@ class PointPropNativeComponentViewProps final : public ViewProps {
Point startPoint{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -993,6 +1149,8 @@ class StringPropNativeComponentViewProps final : public ViewProps {
std::string defaultValue{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -40,6 +40,10 @@ ArrayPropsNativeComponentViewProps::ArrayPropsNativeComponentViewProps(
arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ArrayPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ArrayPropsNativeComponentView\\";
}
folly::dynamic ArrayPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ArrayPropsNativeComponentViewProps();
@@ -51,18 +55,57 @@ folly::dynamic ArrayPropsNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (names != oldProps->names) {
result[\\"names\\"] = toDynamic(names);
}
if (disableds != oldProps->disableds) {
result[\\"disableds\\"] = toDynamic(disableds);
}
if (progress != oldProps->progress) {
result[\\"progress\\"] = toDynamic(progress);
}
if (radii != oldProps->radii) {
result[\\"radii\\"] = toDynamic(radii);
}
if (colors != oldProps->colors) {
result[\\"colors\\"] = toDynamic(colors);
}
if (srcs != oldProps->srcs) {
result[\\"srcs\\"] = toDynamic(srcs);
}
if (points != oldProps->points) {
result[\\"points\\"] = toDynamic(points);
}
if (edgeInsets != oldProps->edgeInsets) {
result[\\"edgeInsets\\"] = toDynamic(edgeInsets);
}
if (dimensions != oldProps->dimensions) {
result[\\"dimensions\\"] = toDynamic(dimensions);
}
if (sizes != oldProps->sizes) {
result[\\"sizes\\"] = toDynamic(sizes);
}
if (object != oldProps->object) {
result[\\"object\\"] = toDynamic(object);
}
if (arrayOfObjects != oldProps->arrayOfObjects) {
result[\\"arrayOfObjects\\"] = toDynamic(arrayOfObjects);
}
if (arrayOfMixed != oldProps->arrayOfMixed) {
result[\\"arrayOfMixed\\"] = toDynamic(arrayOfMixed);
}
return result;
}
#endif
@@ -99,6 +142,10 @@ BooleanPropNativeComponentViewProps::BooleanPropNativeComponentViewProps(
disabledNullable(convertRawProp(context, rawProps, \\"disabledNullable\\", sourceProps.disabledNullable, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName BooleanPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"BooleanPropNativeComponentView\\";
}
folly::dynamic BooleanPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = BooleanPropNativeComponentViewProps();
@@ -152,6 +199,10 @@ ColorPropNativeComponentViewProps::ColorPropNativeComponentViewProps(
tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ColorPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ColorPropNativeComponentView\\";
}
folly::dynamic ColorPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ColorPropNativeComponentViewProps();
@@ -202,6 +253,10 @@ DimensionPropNativeComponentViewProps::DimensionPropNativeComponentViewProps(
marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName DimensionPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"DimensionPropNativeComponentView\\";
}
folly::dynamic DimensionPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = DimensionPropNativeComponentViewProps();
@@ -213,6 +268,9 @@ folly::dynamic DimensionPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (marginBack != oldProps->marginBack) {
result[\\"marginBack\\"] = toDynamic(marginBack);
}
return result;
}
#endif
@@ -248,6 +306,10 @@ EdgeInsetsPropNativeComponentViewProps::EdgeInsetsPropNativeComponentViewProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EdgeInsetsPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EdgeInsetsPropNativeComponentView\\";
}
folly::dynamic EdgeInsetsPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EdgeInsetsPropNativeComponentViewProps();
@@ -295,6 +357,10 @@ EnumPropNativeComponentViewProps::EnumPropNativeComponentViewProps(
intervals(convertRawProp(context, rawProps, \\"intervals\\", sourceProps.intervals, {EnumPropNativeComponentViewIntervals::Intervals0})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EnumPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EnumPropNativeComponentView\\";
}
folly::dynamic EnumPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EnumPropNativeComponentViewProps();
@@ -306,7 +372,13 @@ folly::dynamic EnumPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (alignment != oldProps->alignment) {
result[\\"alignment\\"] = toDynamic(alignment);
}
if (intervals != oldProps->intervals) {
result[\\"intervals\\"] = toDynamic(intervals);
}
return result;
}
#endif
@@ -342,6 +414,10 @@ EventNestedObjectPropsNativeComponentViewProps::EventNestedObjectPropsNativeComp
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventNestedObjectPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EventNestedObjectPropsNativeComponentView\\";
}
folly::dynamic EventNestedObjectPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventNestedObjectPropsNativeComponentViewProps();
@@ -391,6 +467,10 @@ EventPropsNativeComponentViewProps::EventPropsNativeComponentViewProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"EventPropsNativeComponentView\\";
}
folly::dynamic EventPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventPropsNativeComponentViewProps();
@@ -446,6 +526,10 @@ FloatPropsNativeComponentViewProps::FloatPropsNativeComponentViewProps(
blurRadiusNullable(convertRawProp(context, rawProps, \\"blurRadiusNullable\\", sourceProps.blurRadiusNullable, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName FloatPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"FloatPropsNativeComponentView\\";
}
folly::dynamic FloatPropsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = FloatPropsNativeComponentViewProps();
@@ -520,6 +604,10 @@ ImagePropNativeComponentViewProps::ImagePropNativeComponentViewProps(
thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ImagePropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"ImagePropNativeComponentView\\";
}
folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ImagePropNativeComponentViewProps();
@@ -532,7 +620,7 @@ folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
@@ -571,6 +659,10 @@ IntegerPropNativeComponentViewProps::IntegerPropNativeComponentViewProps(
progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName IntegerPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"IntegerPropNativeComponentView\\";
}
folly::dynamic IntegerPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = IntegerPropNativeComponentViewProps();
@@ -628,6 +720,10 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps(
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {\\"\\"})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"InterfaceOnlyNativeComponentView\\";
}
folly::dynamic InterfaceOnlyNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = InterfaceOnlyNativeComponentViewProps();
@@ -678,6 +774,10 @@ MixedPropNativeComponentViewProps::MixedPropNativeComponentViewProps(
mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MixedPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"MixedPropNativeComponentView\\";
}
folly::dynamic MixedPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MixedPropNativeComponentViewProps();
@@ -689,6 +789,9 @@ folly::dynamic MixedPropNativeComponentViewProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (mixedProp != oldProps->mixedProp) {
result[\\"mixedProp\\"] = mixedProp;
}
return result;
}
#endif
@@ -728,6 +831,10 @@ MultiNativePropNativeComponentViewProps::MultiNativePropNativeComponentViewProps
point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiNativePropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"MultiNativePropNativeComponentView\\";
}
folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiNativePropNativeComponentViewProps();
@@ -740,7 +847,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
if (color != oldProps->color) {
@@ -752,10 +859,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
}
if (point != oldProps->point) {
folly::dynamic pointResult = folly::dynamic::object();
pointResult[\\"x\\"] = point.x;
pointResult[\\"y\\"] = point.y;
result[\\"point\\"] = pointResult;
result[\\"point\\"] = toDynamic(point);
}
return result;
}
@@ -792,6 +896,10 @@ NoPropsNoEventsNativeComponentViewProps::NoPropsNoEventsNativeComponentViewProps
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName NoPropsNoEventsNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"NoPropsNoEventsNativeComponentView\\";
}
folly::dynamic NoPropsNoEventsNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = NoPropsNoEventsNativeComponentViewProps();
@@ -841,6 +949,10 @@ ObjectPropsNativeComponentProps::ObjectPropsNativeComponentProps(
objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ObjectPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ObjectPropsNativeComponent\\";
}
folly::dynamic ObjectPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ObjectPropsNativeComponentProps();
@@ -852,8 +964,17 @@ folly::dynamic ObjectPropsNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (objectProp != oldProps->objectProp) {
result[\\"objectProp\\"] = toDynamic(objectProp);
}
if (objectArrayProp != oldProps->objectArrayProp) {
result[\\"objectArrayProp\\"] = toDynamic(objectArrayProp);
}
if (objectPrimitiveRequiredProp != oldProps->objectPrimitiveRequiredProp) {
result[\\"objectPrimitiveRequiredProp\\"] = toDynamic(objectPrimitiveRequiredProp);
}
return result;
}
#endif
@@ -889,6 +1010,10 @@ PointPropNativeComponentViewProps::PointPropNativeComponentViewProps(
startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName PointPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"PointPropNativeComponentView\\";
}
folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = PointPropNativeComponentViewProps();
@@ -901,10 +1026,7 @@ folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (startPoint != oldProps->startPoint) {
folly::dynamic pointResult = folly::dynamic::object();
pointResult[\\"x\\"] = startPoint.x;
pointResult[\\"y\\"] = startPoint.y;
result[\\"startPoint\\"] = pointResult;
result[\\"startPoint\\"] = toDynamic(startPoint);
}
return result;
}
@@ -942,6 +1064,10 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps(
defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName StringPropNativeComponentViewProps::getDiffPropsImplementationTarget() const {
return \\"StringPropNativeComponentView\\";
}
folly::dynamic StringPropNativeComponentViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = StringPropNativeComponentViewProps();
@@ -16,6 +16,7 @@ Object {
#include <cinttypes>
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/graphicsConversions.h>
#include <react/renderer/core/propsConversions.h>
#include <react/renderer/graphics/Color.h>
#include <react/renderer/graphics/Point.h>
@@ -87,6 +88,16 @@ static inline std::string toString(const ArrayPropsNativeComponentViewSizesMaskW
}
struct ArrayPropsNativeComponentViewObjectStruct {
std::string prop{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentViewObjectStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"prop\\"] = prop;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewObjectStruct &result) {
@@ -102,6 +113,12 @@ static inline std::string toString(const ArrayPropsNativeComponentViewObjectStru
return \\"[Object ArrayPropsNativeComponentViewObjectStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentViewObjectStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentViewObjectStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -115,6 +132,17 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ArrayPropsNativeComponentViewArrayOfObjectsStruct {
Float prop1{0.0};
int prop2{0};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentViewArrayOfObjectsStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"prop1\\"] = prop1;
result[\\"prop2\\"] = prop2;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewArrayOfObjectsStruct &result) {
@@ -134,6 +162,12 @@ static inline std::string toString(const ArrayPropsNativeComponentViewArrayOfObj
return \\"[Object ArrayPropsNativeComponentViewArrayOfObjectsStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentViewArrayOfObjectsStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentViewArrayOfObjectsStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -165,6 +199,8 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps {
std::vector<folly::dynamic> arrayOfMixed{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -203,6 +239,8 @@ class BooleanPropNativeComponentViewProps final : public ViewProps {
bool disabledNullable{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -241,6 +279,8 @@ class ColorPropNativeComponentViewProps final : public ViewProps {
SharedColor tintColor{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -265,6 +305,7 @@ Object {
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/graphicsConversions.h>
#include <yoga/Yoga.h>
namespace facebook::react {
@@ -279,6 +320,8 @@ class DimensionPropNativeComponentViewProps final : public ViewProps {
YGValue marginBack{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -316,6 +359,8 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -360,6 +405,12 @@ static inline std::string toString(const EnumPropNativeComponentViewAlignment &v
case EnumPropNativeComponentViewAlignment::BottomRight: return \\"bottom-right\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const EnumPropNativeComponentViewAlignment &value) {
return toString(value);
}
#endif
enum class EnumPropNativeComponentViewIntervals { Intervals0 = 0, Intervals15 = 15, Intervals30 = 30, Intervals60 = 60 };
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, EnumPropNativeComponentViewIntervals &result) {
@@ -391,6 +442,17 @@ static inline std::string toString(const EnumPropNativeComponentViewIntervals &v
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const EnumPropNativeComponentViewIntervals &value) {
switch (value) {
case EnumPropNativeComponentViewIntervals::Intervals0: return 0;
case EnumPropNativeComponentViewIntervals::Intervals15: return 15;
case EnumPropNativeComponentViewIntervals::Intervals30: return 30;
case EnumPropNativeComponentViewIntervals::Intervals60: return 60;
}
}
#endif
class EnumPropNativeComponentViewProps final : public ViewProps {
public:
EnumPropNativeComponentViewProps() = default;
@@ -402,6 +464,8 @@ class EnumPropNativeComponentViewProps final : public ViewProps {
EnumPropNativeComponentViewIntervals intervals{EnumPropNativeComponentViewIntervals::Intervals0};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -439,6 +503,8 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -476,6 +542,8 @@ class EventPropsNativeComponentViewProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -519,6 +587,8 @@ class FloatPropsNativeComponentViewProps final : public ViewProps {
Float blurRadiusNullable{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -557,6 +627,8 @@ class ImagePropNativeComponentViewProps final : public ViewProps {
ImageSource thumbImage{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -596,6 +668,8 @@ class IntegerPropNativeComponentViewProps final : public ViewProps {
int progress3{10};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -633,6 +707,8 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps {
std::string title{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -670,6 +746,8 @@ class MixedPropNativeComponentViewProps final : public ViewProps {
folly::dynamic mixedProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -713,6 +791,8 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps {
Point point{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -750,6 +830,8 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -798,6 +880,12 @@ static inline std::string toString(const ObjectPropsNativeComponentStringEnumPro
case ObjectPropsNativeComponentStringEnumProp::Large: return \\"large\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentStringEnumProp &value) {
return toString(value);
}
#endif
enum class ObjectPropsNativeComponentIntEnumProp { IntEnumProp0 = 0, IntEnumProp1 = 1 };
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentIntEnumProp &result) {
@@ -820,6 +908,15 @@ static inline std::string toString(const ObjectPropsNativeComponentIntEnumProp &
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp1: return \\"1\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentIntEnumProp &value) {
switch (value) {
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp0: return 0;
case ObjectPropsNativeComponentIntEnumProp::IntEnumProp1: return 1;
}
}
#endif
struct ObjectPropsNativeComponentObjectPropStruct {
std::string stringProp{\\"\\"};
bool booleanProp{false};
@@ -827,6 +924,21 @@ struct ObjectPropsNativeComponentObjectPropStruct {
int intProp{0};
ObjectPropsNativeComponentStringEnumProp stringEnumProp{ObjectPropsNativeComponentStringEnumProp::Small};
ObjectPropsNativeComponentIntEnumProp intEnumProp{ObjectPropsNativeComponentIntEnumProp::IntEnumProp0};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
result[\\"booleanProp\\"] = booleanProp;
result[\\"floatProp\\"] = floatProp;
result[\\"intProp\\"] = intProp;
result[\\"stringEnumProp\\"] = ::facebook::react::toDynamic(stringEnumProp);
result[\\"intEnumProp\\"] = ::facebook::react::toDynamic(intEnumProp);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPropStruct &result) {
@@ -862,8 +974,24 @@ static inline std::string toString(const ObjectPropsNativeComponentObjectPropStr
return \\"[Object ObjectPropsNativeComponentObjectPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsNativeComponentObjectArrayPropStruct {
std::vector<std::string> array{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectArrayPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"array\\"] = ::facebook::react::toDynamic(array);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectArrayPropStruct &result) {
@@ -879,10 +1007,28 @@ static inline std::string toString(const ObjectPropsNativeComponentObjectArrayPr
return \\"[Object ObjectPropsNativeComponentObjectArrayPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectArrayPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct {
ImageSource image{};
SharedColor color{};
Point point{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"image\\"] = ::facebook::react::toDynamic(image);
result[\\"color\\"] = ::facebook::react::toDynamic(color);
result[\\"point\\"] = ::facebook::react::toDynamic(point);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &result) {
@@ -905,6 +1051,12 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
static inline std::string toString(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &value) {
return \\"[Object ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &value) {
return value.toDynamic();
}
#endif
class ObjectPropsNativeComponentProps final : public ViewProps {
public:
ObjectPropsNativeComponentProps() = default;
@@ -917,6 +1069,8 @@ class ObjectPropsNativeComponentProps final : public ViewProps {
ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct objectPrimitiveRequiredProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -955,6 +1109,8 @@ class PointPropNativeComponentViewProps final : public ViewProps {
Point startPoint{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -993,6 +1149,8 @@ class StringPropNativeComponentViewProps final : public ViewProps {
std::string defaultValue{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
+6 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.80.0-main",
"version": "0.81.5",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -18,7 +18,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"scripts": {
"build": "yarn clean && node scripts/build.js --verbose",
@@ -29,8 +29,10 @@
"lib"
],
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/parser": "^7.25.3",
"glob": "^7.1.1",
"hermes-parser": "0.28.1",
"hermes-parser": "0.29.1",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1",
"yargs": "^17.6.2"
@@ -43,7 +45,7 @@
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7",
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/preset-env": "^7.25.3",
"hermes-estree": "0.28.1",
"hermes-estree": "0.29.1",
"micromatch": "^4.0.4",
"prettier": "2.8.8",
"rimraf": "^3.0.2"
@@ -245,6 +245,7 @@ function getLocalImports(
return;
case 'DimensionPrimitive':
imports.add('#include <yoga/Yoga.h>');
imports.add('#include <react/renderer/core/graphicsConversions.h>');
return;
default:
(name: empty);
@@ -85,6 +85,7 @@ function generatePropsDiffString(
case 'StringTypeAnnotation':
case 'Int32TypeAnnotation':
case 'BooleanTypeAnnotation':
case 'MixedTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = ${prop.name};
@@ -94,6 +95,14 @@ function generatePropsDiffString(
return `
if ((${prop.name} != oldProps->${prop.name}) && !(std::isnan(${prop.name}) && std::isnan(oldProps->${prop.name}))) {
result["${prop.name}"] = ${prop.name};
}`;
case 'ArrayTypeAnnotation':
case 'ObjectTypeAnnotation':
case 'StringEnumTypeAnnotation':
case 'Int32EnumTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
@@ -103,38 +112,23 @@ function generatePropsDiffString(
result["${prop.name}"] = *${prop.name};
}`;
case 'ImageSourcePrimitive':
case 'PointPrimitive':
case 'EdgeInsetsPrimitive':
case 'DimensionPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = ${prop.name}.toDynamic();
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'ImageRequestPrimitive':
// Shouldn't be used in props
throw new Error(
'ImageRequestPrimitive should not be used in Props',
);
case 'PointPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
folly::dynamic pointResult = folly::dynamic::object();
pointResult["x"] = ${prop.name}.x;
pointResult["y"] = ${prop.name}.y;
result["${prop.name}"] = pointResult;
}`;
case 'EdgeInsetsPrimitive':
case 'DimensionPrimitive':
// TODO: Implement diffProps for complex types
return '';
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation':
case 'ObjectTypeAnnotation':
case 'StringEnumTypeAnnotation':
case 'Int32EnumTypeAnnotation':
case 'MixedTypeAnnotation':
default:
// TODO: Implement diffProps for complex types
return '';
}
})
@@ -142,6 +136,10 @@ function generatePropsDiffString(
return `
#ifdef RN_SERIALIZABLE_STATE
ComponentName ${className}::getDiffPropsImplementationTarget() const {
return "${componentName}";
}
folly::dynamic ${className}::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ${className}();
@@ -85,6 +85,8 @@ class ${className} final${extendClasses} {
${props}
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -115,6 +117,12 @@ static inline std::string toString(const ${enumName} &value) {
${toCases}
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ${enumName} &value) {
return toString(value);
}
#endif
`.trim();
const IntEnumTemplate = ({
@@ -122,11 +130,13 @@ const IntEnumTemplate = ({
values,
fromCases,
toCases,
toDynamicCases,
}: {
enumName: string,
values: string,
fromCases: string,
toCases: string,
toDynamicCases: string,
}) =>
`
enum class ${enumName} { ${values} };
@@ -144,19 +154,39 @@ static inline std::string toString(const ${enumName} &value) {
${toCases}
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ${enumName} &value) {
switch (value) {
${toDynamicCases}
}
}
#endif
`.trim();
const StructTemplate = ({
structName,
fields,
fromCases,
toDynamicCases,
}: {
structName: string,
fields: string,
fromCases: string,
toDynamicCases: string,
}) =>
`struct ${structName} {
${fields}
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ${structName}&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
${toDynamicCases}
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ${structName} &result) {
@@ -168,6 +198,12 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
static inline std::string toString(const ${structName} &value) {
return "[Object ${structName}]";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ${structName} &value) {
return value.toDynamic();
}
#endif
`.trim();
const ArrayConversionFunctionTemplate = ({
@@ -401,6 +437,16 @@ function generateIntEnum(
)
.join('\n' + ' ');
const toDynamicCases = values
.map(
value =>
`case ${enumName}::${toIntEnumValueName(
prop.name,
value,
)}: return ${value};`,
)
.join('\n' + ' ');
const valueVariables = values
.map(val => `${toIntEnumValueName(prop.name, val)} = ${val}`)
.join(', ');
@@ -410,6 +456,7 @@ function generateIntEnum(
values: valueVariables,
fromCases,
toCases,
toDynamicCases,
});
}
@@ -701,12 +748,30 @@ function generateStruct(
})
.join('\n ');
const toDynamicCases = properties
.map((property: NamedShape<PropTypeAnnotation>) => {
const name = property.name;
switch (property.typeAnnotation.type) {
case 'BooleanTypeAnnotation':
case 'StringTypeAnnotation':
case 'Int32TypeAnnotation':
case 'DoubleTypeAnnotation':
case 'FloatTypeAnnotation':
case 'MixedTypeAnnotation':
return `result["${name}"] = ${name};`;
default:
return `result["${name}"] = ::facebook::react::toDynamic(${name});`;
}
})
.join('\n ');
structs.set(
structName,
StructTemplate({
structName,
fields,
fromCases,
toDynamicCases,
}),
);
}

Some files were not shown because too many files have changed in this diff Show More