Compare commits

..
Author SHA1 Message Date
Vitali Zaidman 98ca19eec7 renamed release testing scripts 2025-07-10 17:49:08 +01:00
Nicola Corti 4d1f1a4e29 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-10 09:36:54 -07:00
Christoph Purrer a98ee9147a Add noexcept specifications to Transform and Color methods (#52497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52497

Changelog: [Internal]

Is a good practice (and can reduce binary size):
https://cpp-core-guidelines-docs.vercel.app/errors#Re-noexcept

Reviewed By: philIip

Differential Revision: D77988686

fbshipit-source-id: 575c18aa0c8f593f363f4450e9e06d41c97a3d1a
2025-07-10 09:17:08 -07:00
Tomasz Zawadzki d1730ff960 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-10 08:25:50 -07:00
Vitali Zaidman e0efd3eb5b add 0.81.0-rc.0 release to the changelog file (#52517)
Summary:
Changelog: [INTERNAL] - Update the changelog to include `0.81.0-rc.0`

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

Reviewed By: cortinico

Differential Revision: D78021431

Pulled By: vzaidman

fbshipit-source-id: 3053aed68a947bf808ae29d4827599112175f531
2025-07-10 03:34:10 -07:00
Christian Falch 42d1a7934c 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-10 03:04:07 -07:00
Christian Falch f2b064c2d4 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-10 03:04:07 -07:00
Christian Falch 40e45f5366 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-10 03:04:07 -07:00
Fabrizio Cucci 5ec4e74bc7 Add changelog entry for 0.78.3 (#52518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52518

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78024356

fbshipit-source-id: e006edd4d86839c7d8635de7c68d333530d0a91d
2025-07-10 01:35:25 -07:00
Luna Wei e40c10b9f6 Introduce experimental VirtualView (#52519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52519

Changelog: [Internal] - Experiment with intersection logic for VirtualViews in scrollView. Currently only on Android

### Changes in detail
`VirtualViewContainer` is held by the ScrollView and is lazily instantiated once a VirtualView tries to access.

Upon initial layout, a VirtualView will add itself to the container and report its updated `rect`. `VirtualViewContainer` holds a sorted list of VirtualViews and iterates through them to update mode

Reviewed By: yungsters

Differential Revision: D77313890

fbshipit-source-id: 30843143bf1828dcac9091479964e83934bf330c
2025-07-09 21:12:45 -07:00
generatedunixname89002005287564 aa5b8551ce Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages/react-native/React/Fabric (#52523)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52523

Reviewed By: dtolnay

Differential Revision: D77993027

fbshipit-source-id: 2cf11338360613206a91a9acbeabbfa45934b98f
2025-07-09 20:43:05 -07:00
Eric Rozell 57c5eee51f Delete animatedShouldSignalBatch feature flag (#52521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52521

Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing.

## Changelog

[Internal]

Reviewed By: christophpurrer

Differential Revision: D78005971

fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
2025-07-09 20:15:57 -07:00
Vineeth K 586f5ba89c Added fix to use accessibility source props (#52397)
Summary:
accessibilityRole is not getting the default value from sourceProps.

This change will fix https://github.com/facebook/react-native/issues/52396

## Changelog:

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

Fixed accessibilityRole parsing.
Pick one each for the category and type tags:

[GENERAL] [FIXED] - Added fix for setting the default value for accessibility props

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

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

Test Plan: After this change accessibilityRole will get the default value from sourceProps.

Reviewed By: joevilches

Differential Revision: D77879025

Pulled By: NickGerleman

fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
2025-07-09 18:33:59 -07:00
Joe Vilches 384bd214ff Back out "Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility" (#52516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52516

Original commit changeset: 767ebc880a2e

Original Phabricator Diff: D77258926

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D78016839

fbshipit-source-id: 4f71764d5885c227b92840fc9191d0f3b86f6278
2025-07-09 18:10:56 -07:00
Jack Pope d18f1f7ca3 Enable Fragment Refs for intersection observers on Fabric (#52474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52474

1. Enables the feature flags for fragment refs on fbsource
2. Adds a test with Fantom for usage of `FragmentInstance#observeUsing` and `FragmentInstance#unobserveUsing`.
3. Exposes the `ReactFragmentInstance` type with the common methods that are used on native. We can override the DOM only methods in www libdefs.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74326262

fbshipit-source-id: e35ee45b23179ad3ba5527763567c9b04c127eff
2025-07-09 16:03:25 -07:00
Riccardo Cipolleschi 23f3bf9239 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-09 10:14:41 -07:00
Ruslan Lesiutin dfce5c7180 console.timeStamp: support warning color (#52511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52511

# Changelog: [Internal]

This is actually used in React for logging triggers, like Mount / Unmount / Reconnect / Disconnect.

Reviewed By: huntie

Differential Revision: D78008351

fbshipit-source-id: 9d39d45da499ce78172531c00cc7465b985c2646
2025-07-09 09:26:47 -07:00
Christoph Purrer 52815c2724 Improve NativeDOM Turbo Module typing (#52494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52494

Changelog: [Internal]

- Use C++ private namespace instead of C static methods
- Strongly type C++ TM functions via AsyncCallback

Reviewed By: javache

Differential Revision: D77978354

fbshipit-source-id: 2274b95cfc5b65392fc3c808bbdf54ec4ab3a37e
2025-07-09 08:40:25 -07:00
Alex Hunt 732bd12dc2 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-09 08:26:19 -07:00
Riccardo Cipolleschi bfc841d71d 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-09 08:12:58 -07:00
Riccardo Cipolleschi 6ed0279700 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-09 08:12:58 -07:00
Riccardo Cipolleschi 5e214f0dc8 Read the React Native version from the react-native's package.json (#52509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52509

When building the CI Workflow to build React Native prebuilds, we were reading the react-native's version from the root package.json. This package.json is not updated by the release script, so the version is always 1000.
This makes the build process fail for stable releases.

With this change, we read the version from the right package.json file

## Changelog:
[Internal] - Read React Native version from the right package.json file

Reviewed By: cortinico

Differential Revision: D78007906

fbshipit-source-id: 35f868a1c203245fdcf518ee81957352e3ab1de7
2025-07-09 08:12:58 -07:00
Riccardo Cipolleschi f37e983255 Back out "Add more logging around computeNightlyTarballURL" (#52510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52510

We reverted this change in the 0.81 release branch

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78007905

fbshipit-source-id: fec3df04423300571f629da19bf95cd82c952f12
2025-07-09 08:12:58 -07:00
Samuel Susla daf6ebd7b5 fix race condition in C++ Animated (#52505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52505

changelog: [internal]

there is a race condition where `startRenderCallbackIfNeeded` may be called from JS thread and the main thread at the same time, leading to a crash. To address this, this diff adds uses a boolean to make sure `startOnRenderCallback_` is only called once and `stopOnRenderCallback_` is only called after start was called.

Reviewed By: javache

Differential Revision: D77871230

fbshipit-source-id: 6d7fba596e7146adaff6f8dbe1f436ddd59950c6
2025-07-09 07:19:30 -07:00
Rubén Norte f578038cb2 Add test to show Fabric bug with intermediate states in JS and sync updates in UI (#52502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52502

Changelog: [internal]

This is just a test to show the bug reported in https://github.com/facebook/react-native/issues/52373

Reviewed By: javache

Differential Revision: D78000010

fbshipit-source-id: 5f53a02eb875255f5e384a748057997491518adc
2025-07-09 05:59:27 -07:00
Anupriya Verma 2ca88a0069 'return': conversion from 'int' to 'uint8_t', possible loss of data in CSSHexColor (#52496)
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14666
We faced this issue while integrating [0.79.0-nightly-20250220-41b597c73](https://github.com/microsoft/react-native-windows/pull/14662/files#top)

This warning is treated as error and should be fixed here as well.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Message

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

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

Test Plan:
Fixed error:
##[error]node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): Error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data
2>D:\a_work\1\s\node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data [D:\a_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
(compiling source file '../../node_modules/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp')

Tested E2E in RNW

Reviewed By: javache

Differential Revision: D78000818

Pulled By: rshest

fbshipit-source-id: 5caafc5e92540f722b009480f030276e526355af
2025-07-09 05:05:52 -07:00
generatedunixname89002005287564 47957f9adc 60 (#52493)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52493

Reviewed By: dtolnay

Differential Revision: D77920274

fbshipit-source-id: 42a68d5666f43f606ebcbbe4d207bb9b299760e7
2025-07-09 04:56:35 -07:00
Nicola Corti 9c172fbba3 Add more logging around computeNightlyTarballURL
Summary:
This is a backport of a fix we applied to the 0.81 branch.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: vzaidman

Differential Revision: D78000573

fbshipit-source-id: 64a4e90632158c1f52c45f9fbc3452e848271e94
2025-07-09 04:50:29 -07:00
generatedunixname89002005287564 7725a0aee3 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/rn-tester/android/app/src/main/jni (#52501)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52501

Reviewed By: javache, cortinico

Differential Revision: D77990137

fbshipit-source-id: 1fe4b7a0a821cf9bff5b21d38b6e78a3b164211d
2025-07-09 03:03:48 -07:00
Christoph Purrer b5329ecd6d NativeCxxModuleExample test for testing C++ TM E2E (#52477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52477

Changelog: [Internal]

This adds a Fantom test for

https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js

to test a C++ Turbo Module End 2 End (loading the C++ implementation in native code, accessing in JavaScript via Hermes VM and verifying the results of the API calls)

Reviewed By: rshest

Differential Revision: D77848654

fbshipit-source-id: 48a4ab88a330e9282ae8dab589743eaace62d124
2025-07-08 21:10:36 -07:00
Nicola Corti 6892dde363 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-08 16:33:18 -07:00
Adan Moreno eb61e6f783 Revert D77143018: Cleanup react-native-codegen DEFS
Differential Revision:
D77143018

Original commit changeset: 06ec43ce5149

Original Phabricator Diff: D77143018

fbshipit-source-id: cec53068f88548c4494da315914763beb6730573
2025-07-08 16:29:45 -07:00
Marco Wang df6ba3f155 Pre-suppress errors for boolean literals for xplat js (#52482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52482

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D77915593

fbshipit-source-id: 9238b89e92410cea350c6057044167727de3601a
2025-07-08 12:50:53 -07:00
Fabrizio Cucci 5baf1e6d00 Fix all workflows to use node 22.14.0 (#52491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52491

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

fbshipit-source-id: 48ca412f05d99459c4386499330584d9e560408b
2025-07-08 09:24:15 -07:00
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Pieter De Baets 6dfe59e1df Fix missing bundle errors not correctly reported on Android (#52441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52441

When an error is thrown using `handleHostException` from within the (immediate) execution of a `Task`, the `Task` will capture the error. If those errors are never consumed, the error is just silently swallowed. Instead we should make sure that this is raised outside of the context of a `Task` so the error correctly bubbles up and crashes the app (in release).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77798248

fbshipit-source-id: 41803aba0cace0e364a235501cf34bb946e7ff51
2025-07-08 05:58:56 -07:00
Moti Zilberman db65cb70de Fix typo in new app screen
Summary:
TSIA

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77928389

fbshipit-source-id: 038d11bed3fbbb96c97b7e2c5727e91973de9078
2025-07-08 05:48:00 -07:00
Mateo Guzmán a0e11904d6 Clean up unnecessary test setup for Android tests (#52471)
Summary:
This came out of https://github.com/facebook/react-native/issues/52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.

## Changelog:

[INTERNAL] - Clean up unnecessary test setup for Android tests

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

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

Reviewed By: cortinico

Differential Revision: D77926887

Pulled By: javache

fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
2025-07-08 05:31:11 -07:00
Pieter De Baets 120a417320 Cleanup react-native-codegen DEFS (#52468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52468

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77143018

fbshipit-source-id: 06ec43ce5149a139db78d38630191b01bc520461
2025-07-08 04:53:51 -07:00
Rubén Norte 5a79ece192 Use structuredClone to copy detail field in performance.mark and performance.measure (#52483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52483

Changelog: [internal]

This is a small refinement for `performance.mark` and `performance.measure` to use `structuredClone` to copy the value of the `detail` field, instead of assigning it by reference.

This still doesn't completely fix the semantics of `performance.mark` and `performance.measure`, as the entries returned by those methods aren't referentially equal to the entries reported by `PerformanceObserver` (and the latter don't have the `detail` field yet).

Reviewed By: huntie

Differential Revision: D77863037

fbshipit-source-id: 54d959612ecd560250e49bb0887bb12112a0142f
2025-07-08 04:40:49 -07:00
Ruslan Lesiutin f000116197 Fix Timestamps conversion for Custom Tracks (#52479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52479

# Changelog: [Internal]

The previous cast is incorrect.

Reviewed By: javache

Differential Revision: D77894512

fbshipit-source-id: 67e6b9a4ed43020a343a2a9b5d702509c34ae41a
2025-07-08 04:34:14 -07:00
Vitali Zaidman 5cf4d0899f Update debugger-frontend from 51a91a2...844f225 (#52486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52486

Changelog: [Internal] - Update `react-native/debugger-frontend` from 51a91a2...844f225

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

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [844f22500](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-08T10:16:09+01:00 | [Track when the stack trace symbolication succeeds (#187)](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) |
| [ffa6bb6af](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-07T16:21:55+01:00 | [parse "empty url" and "address at" frames as non-hyperlinked text (#188)](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) |

Reviewed By: robhogan

Differential Revision: D77926362

fbshipit-source-id: cbcf8b17cd175400d3d027ce2e8ebefa497f5d79
2025-07-08 04:15:32 -07:00
Marco Wang 68650badd2 Pre-suppress errors for null_void for xplat js (#52480)
Summary:
Changelog: [Internal]

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

Reviewed By: SamChou19815

Differential Revision: D77890434

fbshipit-source-id: cc0571e0ff1c7cec3fff8614f688d46e46970cc4
2025-07-07 20:35:08 -07:00
Luna Wei 5ec8e60581 Refactor VirtualView target structure on Android (#52476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52476

Changelog: [Internal] - Refactor package structure on Android to prepare for experimental VirtualView so that non-view related objects go under `virtual` and the native view goes under `view`.
This breaks dependency circles for experimental VirtualView in upcoming change.

Reviewed By: yungsters

Differential Revision: D77335426

fbshipit-source-id: 3b978e9cc5ad376c71aebc039cfc74d2515d2cfa
2025-07-07 16:00:13 -07:00
Alex Hunt 918f02dcc3 Consolidate JS API scripts under scripts/js-api/, update docs (#52469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52469

Organise `scripts/build-types/` and `scripts/diff-api-snapshot/` into a single grouping `scripts/js-api/` parent dir — matching the newly relocated `scripts/cxx-api/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77865488

fbshipit-source-id: 33754d9275e65c3bda686294f18d855221ec7bff
2025-07-07 15:04:37 -07:00
Alex Hunt 5fe782a800 Move cxx-api scripts under scripts/, add README (#52467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52467

Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77865490

fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
2025-07-07 15:04:37 -07:00
Christoph Purrer abfb9cbd40 Update outdated ReactNativeCPP.api (#52475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52475

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77887914

fbshipit-source-id: 1431205eff716bac86610750103df729553d22b9
2025-07-07 14:50:58 -07:00
Pieter De Baets 3bf5cb3d0e Deprecate MessageQueueThreadPerfStats (#52470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52470

These metrics are not actively consumed and are highly noisy.

Changelog: [Android][Removed] Deprecated MessageQueueThreadPerfStats API and replaced with stub.

Reviewed By: cortinico

Differential Revision: D77867087

fbshipit-source-id: 8bf7423ad60cb3bb21a5dbe94771d5a71832633d
2025-07-07 11:29:01 -07:00
Christoph Purrer ead669ade3 Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray (#52443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52443

Changelog: [General][Breaking] Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray

Those are not used anymore

Reviewed By: cortinico

Differential Revision: D77771186

fbshipit-source-id: e1f5e34238567241b4204d58ff85fd9067e321df
2025-07-07 11:04:01 -07:00
Nicola Corti 625f69f284 @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-07 10:20:43 -07:00
Christoph Purrer 06034554e4 Remove SampleTurboCxxModule example (#52442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442

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: D77771111

fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
2025-07-07 09:37:37 -07:00
Samuel Susla 298ec6ca5d Deprecate ShadowNode::ListOfWeak and replace with std::vector<std::weak_ptr<const ShadowNode>> (#52401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401

changelog: [internal]

- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias

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

Reviewed By: christophpurrer

Differential Revision: D77652083

fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
2025-07-07 09:29:57 -07:00
Christoph Purrer c1200718a0 Move RuntimeExecutor after copying it into BufferedRuntimeExecutor (#52404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52404

Changelog: [Internal]

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h#L23

is a copy-able type (it will be copied when passed into the BufferedRuntimeExecutor constructor).

Hence we can `std::move` it in the `BufferedRuntimeExecutor` constructor

Reviewed By: javache

Differential Revision: D77758211

fbshipit-source-id: 634b1cd0e1ed4d27a013ad8927b2123dc6977ad8
2025-07-07 08:59:56 -07:00
Rubén Norte a3933e6878 Remove legacy tests for Performance API (#52465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52465

Changelog: [internal]

Now that we have enough coverage for the Performance API in Fantom, Jest tests where most of the API is mocked are redundant and useless, so this removes them (and the mock).

Reviewed By: huntie

Differential Revision: D77860888

fbshipit-source-id: 7dbd1a8a43b056a3b34e4e37d578be9ccb521824
2025-07-07 06:42:23 -07:00
Rubén Norte 9f8179afa7 Add tests for durationThreshold option for PerformanceObserver (#52464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52464

Changelog: [internal]

This adds tests for the `durationThreshold` option for `PerformanceObserver.prototype.observe`.

Reviewed By: huntie

Differential Revision: D77860882

fbshipit-source-id: 1e56391166523d2c4f837f758bc367b58fe8e82e
2025-07-07 06:42:23 -07:00
Rubén Norte e6bff3f1fe Add tests for performance.eventCounts (#52463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52463

Changelog: [internal]

This adds Fantom tests for `performance.eventCounts`.

Reviewed By: huntie

Differential Revision: D77860881

fbshipit-source-id: 26b9ef56b9c610cbad7011bc0adde27251fda909
2025-07-07 06:42:23 -07:00
Rubén Norte feeef97554 Expand tests for the performance API (#52462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52462

Changelog: [internal]

This adds a few more tests for `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType`.

Reviewed By: huntie

Differential Revision: D77801746

fbshipit-source-id: 42f80c4e2b787c455b149ee38d071511181532b0
2025-07-07 06:42:23 -07:00
Rubén Norte 9005d93e32 Optimize performance.mark and performance.measure (#52429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52429

Changelog: [internal]

This implements a significant optimization for `performance.mark` and `performance.measure`. After these changes, they take 1/3 of the time they took before.

We've seen these methods show up too often in traces (in the Hermes sampling profiler) so this should significantly reduce their overhead.

I found out that most of the time spent in `performance.mark` and `performance.measure` was creating the `PerformanceMark` and `PerformanceMeasure` instances returned by those methods. I applied the same playbook I did for `ReactNativeElement` (avoiding private fields and `super()` calls, which yielded these wins.

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1678.19 ± 0.73%'    | '1633.00'           | '607139 ± 0.01%'           | '612370'                  | 595882  |
| 1       | 'mark (with custom startTime)'                            | '1920.23 ± 1.30%'    | '1843.00'           | '538217 ± 0.01%'           | '542594'                  | 520772  |
| 2       | 'measure (with start and end timestamps)'                 | '2651.72 ± 0.94%'    | '2554.00'           | '388312 ± 0.02%'           | '391543'                  | 377114  |
| 3       | 'measure (with mark names)'                               | '2815.84 ± 0.75%'    | '2744.00'           | '362303 ± 0.02%'           | '364431'                  | 355134  |
| 4       | 'clearMarks'                                              | '743.82 ± 0.06%'     | '731.00'            | '1363190 ± 0.01%'          | '1367989'                 | 1344417 |
| 5       | 'clearMeasures'                                           | '776.69 ± 0.07%'     | '761.00'            | '1306563 ± 0.01%'          | '1314060'                 | 1287512 |
| 6       | 'mark + clearMarks'                                       | '2043.97 ± 1.26%'    | '1973.00'           | '504750 ± 0.01%'           | '506842'                  | 489801  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '3048.39 ± 0.87%'    | '2965.00'           | '335285 ± 0.02%'           | '337268'                  | 328042  |
| 8       | 'measure + clearMeasures (with mark names)'               | '3132.75 ± 0.80%'    | '3065.00'           | '324365 ± 0.02%'           | '326264'                  | 319209  |

Reviewed By: huntie

Differential Revision: D77790874

fbshipit-source-id: baf7aca07d281fef4373956d125c63f006fab592
2025-07-07 06:42:23 -07:00
Rubén Norte 74c03b67e3 Fix bugs in performance.mark and performance.measure (#52430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52430

Changelog: [internal]

(This is marked as internal because this API hasn't been marked as stable yet).

This fixes multiple bugs and missing features in `performance.mark` and `performance.measure`. See re-enabled tests to see the specific behaviors.

Validated that performance isn't regressed by this change using the existing benchmark for `Performance` (`Performance-benchmark-itest`):

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5557.96 ± 0.34%'    | '5459.00'           | '182114 ± 0.02%'           | '183184'                  | 179922  |
| 1       | 'mark (with custom startTime)'                            | '5664.54 ± 1.71%'    | '5518.00'           | '180296 ± 0.02%'           | '181225'                  | 176537  |
| 2       | 'measure (with start and end timestamps)'                 | '6653.62 ± 0.94%'    | '6530.00'           | '152296 ± 0.02%'           | '153139'                  | 150295  |
| 3       | 'measure (with mark names)'                               | '6903.37 ± 0.42%'    | '6790.00'           | '146429 ± 0.02%'           | '147275'                  | 144857  |
| 4       | 'clearMarks'                                              | '782.98 ± 0.04%'     | '771.00'            | '1287735 ± 0.01%'          | '1297017'                 | 1277173 |
| 5       | 'clearMeasures'                                           | '792.24 ± 0.03%'     | '781.00'            | '1270847 ± 0.01%'          | '1280410'                 | 1262238 |
| 6       | 'mark + clearMarks'                                       | '5883.69 ± 0.52%'    | '5759.00'           | '172863 ± 0.02%'           | '173641'                  | 169962  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7222.22 ± 0.68%'    | '7021.00'           | '141204 ± 0.02%'           | '142430'                  | 138462  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7234.53 ± 0.34%'    | '7121.00'           | '139600 ± 0.02%'           | '140430'                  | 138227  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

Reviewed By: huntie

Differential Revision: D77795990

fbshipit-source-id: 97895065ca63f87f1f66710cf7bce97e1255a142
2025-07-07 06:42:23 -07:00
Rubén Norte 34201d8387 Fix Flow types for performance.measure (#52431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52431

Changelog: [internal]

`performance.measure` supports passing mark names as `start` and `end` options, so this fixes the Flow type before fixing the actual implementation.

It also makes it so you can't specify both `end` and `duration`, enforced by the type system.

Reviewed By: huntie

Differential Revision: D77795991

fbshipit-source-id: e89f509c7efc2fa49d17d79bc19bc1d14e007871
2025-07-07 06:42:23 -07:00
Rubén Norte 2edda6d967 Add basic Fantom tests for performance.mark and performance.measure (#52432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432

Changelog: [internal]

This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.

Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.

Reviewed By: huntie

Differential Revision: D77795989

fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
2025-07-07 06:42:23 -07:00
Samuel Susla 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
szymonrybczak 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 Hunt 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 Hunt 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 Purrer 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 Purrer 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 Purrer 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 Purrer 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 Purrer 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
generatedunixname89002005287564 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
generatedunixname89002005287564 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
generatedunixname89002005287564 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 Hogan 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 Hogan 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 Hunt 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 Lefever 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
generatedunixname89002005287564 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
generatedunixname89002005287564 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 Lesiutin 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 Zhou 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 Corti 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 Lesiutin 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 Lesiutin 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 Hunt 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 Childs 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 Hunt 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 Susla 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 Salama 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 Corti 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 Susla 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 Purrer 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 Corti 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 Corti 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 Purrer 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 Acosta 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 Acosta 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 Vacca 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 Purrer 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 Lesiutin 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 Acthernoene 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 Lesiutin 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ñas 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 Corti 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 Hunt 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 Hunt 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 Hunt 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 Hunt 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 Rozell 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 Corti 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 Corti 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 Vilches 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) 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 Gerleman 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 Gerleman 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 Gerleman 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'Brien 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'Brien 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 Lefever 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 Purrer 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 Cucci 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 Corti 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 Hunt 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 Corti 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 Zilberman 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 Zilberman 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 Cucci 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łecki 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 Susla 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łecki 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łecki 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łecki 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łecki 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łecki 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 Vacca 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 Yung 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 Baets 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 Gerleman 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 Pope 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án 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 Baets 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 Lesiutin 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 Lesiutin 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
generatedunixname89002005287564 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 Corti 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án 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 Zahariev 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 Zahariev 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 Vilches 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 Gerleman 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 Lynn 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 Lynn 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 Datsenko 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 Zaidman 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 Piasecki 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 Piasecki 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 Acthernoene 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 Corti 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 Hunt 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
generatedunixname89002005287564 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 Lynn 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 Lynn 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 Peng 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 Cipolleschi 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 Zhou 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 Gerleman 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 Zahariev 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 Lynn 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 Datsenko 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 Susla 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 Cipolleschi 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 Hunt 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 Hunt 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 Hunt 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 Hunt 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 Shestopalyuk 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 Falch 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 Lesiutin 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
pchalupa 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 Zilberman 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 Peng 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 Machom 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 Zahariev 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 Lesiutin 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 Lesiutin 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 Lesiutin 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 Lesiutin 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 Hunt 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 Piasecki 322142aab3 Further reduce naming collisions in the API snapshot (#52281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52281

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77355160

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

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77244751

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

Changelog: [Internal]

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

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

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

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

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

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

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

Reviewed By: huntie

Differential Revision: D77295302

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234066

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77307169

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

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

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234065

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

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

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

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

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234064

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

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234061

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

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

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234070

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

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

Reviewed By: christophpurrer

Differential Revision: D77150289

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

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77308192

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

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

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D77310876

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

Changelog: [Internal]

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

Reviewed By: rshest

Differential Revision: D77050457

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

## Summary

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

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

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

## How did you test this change?

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

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

Reviewed By: rubennorte

Differential Revision: D77296286

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

Reviewed By: javache

Differential Revision: D77290996

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

Reviewed By: javache

Differential Revision: D77289931

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

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

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

(see test plan for examples)

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

----

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

Reviewed By: rickhanlonii

Differential Revision: D75080385

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

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77304456

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

This commit fixes this.

## Changelog:

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

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

Test Plan: Build RN-tester with prebuilt

Reviewed By: cortinico

Differential Revision: D77303429

Pulled By: cipolleschi

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

## Changelog:

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

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

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

Reviewed By: rshest

Differential Revision: D77290330

Pulled By: cortinico

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

Changelog: [Internal]

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

Reviewed By: christophpurrer

Differential Revision: D77241819

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

# Changelog: [Internal]

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

Reviewed By: rubennorte

Differential Revision: D77164969

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

# Changelog: [Internal]

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

Reviewed By: motiz88

Differential Revision: D77148271

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

# Changelog: [Internal]

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

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

Reviewed By: rubennorte

Differential Revision: D77053032

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

# Changelog: [Internal]

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

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

Reviewed By: rubennorte

Differential Revision: D77053030

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

changelog: [internal]

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

Reviewed By: javache

Differential Revision: D77298889

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234069

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

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

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234062

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

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

This diff adds the toDynamic conversion function for `ImageSource`

 Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234063

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

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77284561

fbshipit-source-id: 46a5a9d00223283423b791456db3613abfc063aa
2025-06-25 04:17:28 -07:00
711 changed files with 24778 additions and 17827 deletions
+1 -2
View File
@@ -48,7 +48,6 @@ packages/react-native/flow/
[options]
enums=true
experimental.pattern_matching=true
experimental.pattern_matching.includes=<PROJECT_ROOT>/packages/react-native/src/private/components/virtualview/
casting_syntax=both
component_syntax=true
@@ -105,4 +104,4 @@ untyped-import
untyped-type-import
[version]
^0.274.0
^0.275.0
+1 -1
View File
@@ -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' ||
@@ -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/js-api/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
+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:
+2
View File
@@ -2,6 +2,8 @@ name: yarn-install
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
shell: bash
run: |
@@ -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);
+4
View File
@@ -18,6 +18,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
+1 -1
View File
@@ -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
@@ -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
View File
@@ -175,3 +175,6 @@ fix_*.patch
# [Experimental] Generated TS type definitions
/packages/**/types_generated/
/packages/debugger-shell/build/
/packages/*/dist/
@@ -1,5 +1,11 @@
# Changelog (pre 0.80)
## v0.79.5
### Fixed
- **Flow:** Publish top-level Flow types for `react-native` ([fbbd20dd63](https://github.com/facebook/react-native/commit/fbbd20dd632acd72d2abe861dd4a0e6e98437cf2) by [@buschco](https://github.com/buschco))
## v0.79.4
### Fixed
@@ -313,6 +319,31 @@ ChuiHW))
- **JSC:** Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method ([c8f1506f13](https://github.com/facebook/react-native/commit/c8f1506f13310ffafe370273805684e696d72d50) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Layout:** Remove no longer needed UISceneDelegate ([a033cf9d5e](https://github.com/facebook/react-native/commit/a033cf9d5e8ffbda8b6f86cf3ce152b4ccb73187) by [@okwasniewski](https://github.com/okwasniewski))
## v0.78.3
### Added
#### Android specific
- **Gradle:** RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror. ([6cb8dc37c7](https://github.com/facebook/react-native/commit/6cb8dc37c74995cba3f9f0a845919f305de53c3d) by [@cortinico](https://github.com/cortinico))
### Fixed
- **DevTools**: Temporarily disable eager evaluation and live expressions in the console tab ([07717b5275](https://github.com/facebook/react-native/commit/07717b5275d80cde7b2b4edbe032ab629127fbf0) by [@huntie](https://github.com/huntie))
- **InteropLayer:** Fixed adding child views to a native view using the interop layer ([d53a60dd23](https://github.com/facebook/react-native/commit/d53a60dd23c5df8afca058a867c50df8b61f62e2) by [@chrfalch](https://github.com/chrfalch))
- **Runtime:** Align timer IDs and timer function argument error handling with web standards. ([480a4642e5](https://github.com/facebook/react-native/commit/480a4642e5a644becf1c477d3d239f9b57efff3a) by [@kitten](https://github.com/kitten))
#### Android specific
- **StyleSheet:** Wrong `borderBottomEndRadius` on RTL ([68d6ada448](https://github.com/facebook/react-native/commit/68d6ada44893701b6006a6b1753131c7e880a30a) by [@riteshshukla04](https://github.com/riteshshukla04))
#### iOS specific
- **Codegen:** Skip codegen for selectively disabled libraries in react-native.config.js ([be8595b18a](https://github.com/facebook/react-native/commit/be8595b18a46635bf679d8e7473f2960c33530fa) by [@ismarbesic](https://github.com/ismarbesic))
- **Layout:** Layout direction changes are now honored on bundle reload ([36f29beac4](https://github.com/facebook/react-native/commit/36f29beac47259768612bf56e5d9acfa4b94ab1a) by [@chrsmys](https://github.com/chrsmys))
- **Runtime:** Re-enable enableFixForViewCommandRace feature flag ([ae59702f8e](https://github.com/facebook/react-native/commit/ae59702f8ee89e7bddec971e0a041744cb91e65c) by [@okwasniewski](https://github.com/okwasniewski))
- **Switch:** Fixed switches correctly reverting to controlled state ([aa8c072870](https://github.com/facebook/react-native/commit/aa8c072870f6f9740e567a0f455c0e500ff1400c) by [@javache](https://github.com/javache))
## v0.78.2
### Changed
+1084
View File
File diff suppressed because it is too large Load Diff
+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
+1 -1
View File
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
require('@fb-tools/babel-register');
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/babel-register').registerForMonorepo();
require('../scripts/shared/babelRegister').registerForMonorepo();
}
const transformer = require('@react-native/metro-babel-transformer');
+19 -15
View File
@@ -8,14 +8,16 @@
"android": "yarn --cwd packages/rn-tester android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
"build": "node ./scripts/build/build.js",
"build-types": "node ./scripts/build-types",
"build-types": "node ./scripts/js-api/build-types",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
"flow-check": "flow check",
"flow": "flow",
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
"format": "npm run prettier && npm run clang-format",
"featureflags": "yarn --cwd packages/react-native featureflags",
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
"lint-markdown": "markdownlint-cli2 2>&1",
"lint": "eslint --max-warnings 0 .",
@@ -26,13 +28,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 +51,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.0-main",
"@react-native/metro-config": "0.81.0-main",
"@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.29.0",
"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 +79,12 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.29.0",
"flow-bin": "^0.274.0",
"flow-api-translator": "0.29.1",
"flow-bin": "^0.275.0",
"glob": "^7.1.1",
"hermes-eslint": "0.29.0",
"hermes-transform": "0.29.0",
"hermes-eslint": "0.29.1",
"hermes-transform": "0.29.1",
"ini": "^5.0.0",
"inquirer": "^7.1.0",
"jest": "^29.7.0",
"jest-config": "^29.7.0",
@@ -89,14 +93,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.82.5",
"metro-memory-fs": "^0.82.5",
"metro-transform-plugins": "^0.82.5",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.29.0",
"prettier-plugin-hermes-parser": "0.29.1",
"react": "19.1.0",
"react-test-renderer": "19.1.0",
"rimraf": "^3.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "0.81.0-main"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.80.0-main",
"version": "0.81.0-main",
"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.0-main",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.82.4",
"metro-config": "^0.82.4",
"metro-core": "^0.82.4",
"metro": "^0.82.5",
"metro-config": "^0.82.5",
"metro-core": "^0.82.5",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.82.4"
"metro-resolver": "^0.82.5"
},
"peerDependencies": {
"@react-native-community/cli": "*",
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+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',
@@ -13,7 +13,7 @@ export type * from './version.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./version.flow');
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<cf5be4596d1f07e220b710fc286d02fa>>
Git revision: d95ac13bf0ab64a5e6c2eb18eb138587063b9c34
@generated SignedSource<<1ce3fb7dd23581737fedaf58528fe575>>
Git revision: 844f225009e6445d088ed0e431d1fc430325ed95
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
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-shell",
"version": "0.80.0-main",
"version": "0.81.0-main",
"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",
@@ -27,11 +27,11 @@
"license": "MIT",
"engines": {
"node": ">= 22.14.0",
"electron": ">=36.2.0"
"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',
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!Boolean(process.env.BUILD_EXCLUDE_BABEL_REGISTER)) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
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');
}
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
export * from './index.flow';
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.80.0-main",
"version": "0.81.0-main",
"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.0-main",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -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');
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
export * from './index.flow';
@@ -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.0-main",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"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.0-main",
"@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.0-main",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
@@ -18,8 +18,8 @@
"bugs": "https://github.com/facebook/react-native/issues",
"main": "index.js",
"devDependencies": {
"babel-plugin-syntax-hermes-parser": "0.29.0",
"hermes-eslint": "0.29.0"
"babel-plugin-syntax-hermes-parser": "0.29.1",
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.0"
+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 = {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -26,14 +26,14 @@
"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.0-main",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
},
"devDependencies": {
"babel-plugin-syntax-hermes-parser": "0.29.0",
"hermes-eslint": "0.29.0"
"babel-plugin-syntax-hermes-parser": "0.29.1",
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.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
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -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
@@ -39,6 +40,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()
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -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.0-main",
"@react-native/metro-babel-transformer": "0.81.0-main",
"metro-config": "^0.82.5",
"metro-runtime": "^0.82.5"
}
}
+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;
}
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/new-app-screen",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "NewAppScreen component for React Native",
"keywords": [
"react-native"
+1 -1
View File
@@ -65,7 +65,7 @@ const Links: Array<{
},
{
title: 'Community',
description: 'Expore & get help',
description: 'Explore & get help',
url: 'https://reactnative.dev/community/overview',
},
{
+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.0-main",
"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', {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Babel preset for React Native applications",
"repository": {
"type": "git",
@@ -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.29.0",
"@react-native/babel-plugin-codegen": "0.81.0-main",
"babel-plugin-syntax-hermes-parser": "0.29.1",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
},
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Babel transformer for React Native applications.",
"repository": {
"type": "git",
@@ -27,8 +27,8 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.80.0-main",
"hermes-parser": "0.29.0",
"@react-native/babel-preset": "0.81.0-main",
"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
};
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -30,7 +30,7 @@
],
"dependencies": {
"glob": "^7.1.1",
"hermes-parser": "0.29.0",
"hermes-parser": "0.29.1",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1",
"yargs": "^17.6.2"
@@ -43,7 +43,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.29.0",
"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,
}),
);
}
@@ -81,8 +81,8 @@ TEST(${componentName}_${testName}, etc) {
function getTestCasesForProp(
propName: string,
typeAnnotation: PropTypeAnnotation,
) {
const cases = [];
): Array<TestCase> {
const cases: Array<TestCase> = [];
if (typeAnnotation.type === 'StringEnumTypeAnnotation') {
typeAnnotation.options.forEach(option =>
cases.push({
@@ -40,6 +40,10 @@ ArrayPropsNativeComponentProps::ArrayPropsNativeComponentProps(
arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ArrayPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ArrayPropsNativeComponent\\";
}
folly::dynamic ArrayPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ArrayPropsNativeComponentProps();
@@ -51,18 +55,57 @@ folly::dynamic ArrayPropsNativeComponentProps::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 (dimensions != oldProps->dimensions) {
result[\\"dimensions\\"] = toDynamic(dimensions);
}
if (sizes != oldProps->sizes) {
result[\\"sizes\\"] = toDynamic(sizes);
}
if (object != oldProps->object) {
result[\\"object\\"] = toDynamic(object);
}
if (array != oldProps->array) {
result[\\"array\\"] = toDynamic(array);
}
if (arrayOfArrayOfObject != oldProps->arrayOfArrayOfObject) {
result[\\"arrayOfArrayOfObject\\"] = toDynamic(arrayOfArrayOfObject);
}
if (arrayOfMixed != oldProps->arrayOfMixed) {
result[\\"arrayOfMixed\\"] = toDynamic(arrayOfMixed);
}
return result;
}
#endif
@@ -98,6 +141,10 @@ ArrayPropsNativeComponentProps::ArrayPropsNativeComponentProps(
nativePrimitives(convertRawProp(context, rawProps, \\"nativePrimitives\\", sourceProps.nativePrimitives, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ArrayPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ArrayPropsNativeComponent\\";
}
folly::dynamic ArrayPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ArrayPropsNativeComponentProps();
@@ -109,6 +156,9 @@ folly::dynamic ArrayPropsNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (nativePrimitives != oldProps->nativePrimitives) {
result[\\"nativePrimitives\\"] = toDynamic(nativePrimitives);
}
return result;
}
#endif
@@ -144,6 +194,10 @@ BooleanPropNativeComponentProps::BooleanPropNativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName BooleanPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"BooleanPropNativeComponent\\";
}
folly::dynamic BooleanPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = BooleanPropNativeComponentProps();
@@ -193,6 +247,10 @@ ColorPropNativeComponentProps::ColorPropNativeComponentProps(
tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ColorPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ColorPropNativeComponent\\";
}
folly::dynamic ColorPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ColorPropNativeComponentProps();
@@ -242,6 +300,10 @@ CommandNativeComponentProps::CommandNativeComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName CommandNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"CommandNativeComponent\\";
}
folly::dynamic CommandNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = CommandNativeComponentProps();
@@ -288,6 +350,10 @@ CommandNativeComponentProps::CommandNativeComponentProps(
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {\\"\\"})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName CommandNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"CommandNativeComponent\\";
}
folly::dynamic CommandNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = CommandNativeComponentProps();
@@ -338,6 +404,10 @@ DimensionPropNativeComponentProps::DimensionPropNativeComponentProps(
marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName DimensionPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"DimensionPropNativeComponent\\";
}
folly::dynamic DimensionPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = DimensionPropNativeComponentProps();
@@ -349,6 +419,9 @@ folly::dynamic DimensionPropNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (marginBack != oldProps->marginBack) {
result[\\"marginBack\\"] = toDynamic(marginBack);
}
return result;
}
#endif
@@ -389,6 +462,10 @@ DoublePropNativeComponentProps::DoublePropNativeComponentProps(
blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName DoublePropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"DoublePropNativeComponent\\";
}
folly::dynamic DoublePropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = DoublePropNativeComponentProps();
@@ -458,6 +535,10 @@ EventsNestedObjectNativeComponentProps::EventsNestedObjectNativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventsNestedObjectNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"EventsNestedObjectNativeComponent\\";
}
folly::dynamic EventsNestedObjectNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventsNestedObjectNativeComponentProps();
@@ -507,6 +588,10 @@ EventsNativeComponentProps::EventsNativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName EventsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"EventsNativeComponent\\";
}
folly::dynamic EventsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EventsNativeComponentProps();
@@ -556,6 +641,10 @@ InterfaceOnlyComponentProps::InterfaceOnlyComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName InterfaceOnlyComponentProps::getDiffPropsImplementationTarget() const {
return \\"InterfaceOnlyComponent\\";
}
folly::dynamic InterfaceOnlyComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = InterfaceOnlyComponentProps();
@@ -602,6 +691,10 @@ ExcludedAndroidComponentProps::ExcludedAndroidComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ExcludedAndroidComponentProps::getDiffPropsImplementationTarget() const {
return \\"ExcludedAndroidComponent\\";
}
folly::dynamic ExcludedAndroidComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ExcludedAndroidComponentProps();
@@ -648,6 +741,10 @@ ExcludedAndroidIosComponentProps::ExcludedAndroidIosComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ExcludedAndroidIosComponentProps::getDiffPropsImplementationTarget() const {
return \\"ExcludedAndroidIosComponent\\";
}
folly::dynamic ExcludedAndroidIosComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ExcludedAndroidIosComponentProps();
@@ -694,6 +791,10 @@ ExcludedIosComponentProps::ExcludedIosComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ExcludedIosComponentProps::getDiffPropsImplementationTarget() const {
return \\"ExcludedIosComponent\\";
}
folly::dynamic ExcludedIosComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ExcludedIosComponentProps();
@@ -716,6 +817,10 @@ MultiFileIncludedNativeComponentProps::MultiFileIncludedNativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiFileIncludedNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MultiFileIncludedNativeComponent\\";
}
folly::dynamic MultiFileIncludedNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiFileIncludedNativeComponentProps();
@@ -770,6 +875,10 @@ FloatPropNativeComponentProps::FloatPropNativeComponentProps(
blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName FloatPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"FloatPropNativeComponent\\";
}
folly::dynamic FloatPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = FloatPropNativeComponentProps();
@@ -840,6 +949,10 @@ ImagePropNativeComponentProps::ImagePropNativeComponentProps(
thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ImagePropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ImagePropNativeComponent\\";
}
folly::dynamic ImagePropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ImagePropNativeComponentProps();
@@ -852,7 +965,7 @@ folly::dynamic ImagePropNativeComponentProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
@@ -889,6 +1002,10 @@ InsetsPropNativeComponentProps::InsetsPropNativeComponentProps(
contentInset(convertRawProp(context, rawProps, \\"contentInset\\", sourceProps.contentInset, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName InsetsPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"InsetsPropNativeComponent\\";
}
folly::dynamic InsetsPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = InsetsPropNativeComponentProps();
@@ -900,6 +1017,9 @@ folly::dynamic InsetsPropNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (contentInset != oldProps->contentInset) {
result[\\"contentInset\\"] = toDynamic(contentInset);
}
return result;
}
#endif
@@ -935,6 +1055,10 @@ Int32EnumPropsNativeComponentProps::Int32EnumPropsNativeComponentProps(
maxInterval(convertRawProp(context, rawProps, \\"maxInterval\\", sourceProps.maxInterval, {Int32EnumPropsNativeComponentMaxInterval::MaxInterval0})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName Int32EnumPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"Int32EnumPropsNativeComponent\\";
}
folly::dynamic Int32EnumPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = Int32EnumPropsNativeComponentProps();
@@ -946,6 +1070,9 @@ folly::dynamic Int32EnumPropsNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (maxInterval != oldProps->maxInterval) {
result[\\"maxInterval\\"] = toDynamic(maxInterval);
}
return result;
}
#endif
@@ -983,6 +1110,10 @@ IntegerPropNativeComponentProps::IntegerPropNativeComponentProps(
progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName IntegerPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"IntegerPropNativeComponent\\";
}
folly::dynamic IntegerPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = IntegerPropNativeComponentProps();
@@ -1040,6 +1171,10 @@ InterfaceOnlyComponentProps::InterfaceOnlyComponentProps(
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {\\"\\"})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName InterfaceOnlyComponentProps::getDiffPropsImplementationTarget() const {
return \\"InterfaceOnlyComponent\\";
}
folly::dynamic InterfaceOnlyComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = InterfaceOnlyComponentProps();
@@ -1090,6 +1225,10 @@ MixedPropNativeComponentProps::MixedPropNativeComponentProps(
mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MixedPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MixedPropNativeComponent\\";
}
folly::dynamic MixedPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MixedPropNativeComponentProps();
@@ -1101,6 +1240,9 @@ folly::dynamic MixedPropNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (mixedProp != oldProps->mixedProp) {
result[\\"mixedProp\\"] = mixedProp;
}
return result;
}
#endif
@@ -1140,6 +1282,10 @@ ImageColorPropNativeComponentProps::ImageColorPropNativeComponentProps(
point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ImageColorPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"ImageColorPropNativeComponent\\";
}
folly::dynamic ImageColorPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ImageColorPropNativeComponentProps();
@@ -1152,7 +1298,7 @@ folly::dynamic ImageColorPropNativeComponentProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
if (color != oldProps->color) {
@@ -1164,10 +1310,7 @@ folly::dynamic ImageColorPropNativeComponentProps::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;
}
@@ -1204,6 +1347,10 @@ NoPropsNoEventsComponentProps::NoPropsNoEventsComponentProps(
{}
#ifdef RN_SERIALIZABLE_STATE
ComponentName NoPropsNoEventsComponentProps::getDiffPropsImplementationTarget() const {
return \\"NoPropsNoEventsComponent\\";
}
folly::dynamic NoPropsNoEventsComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = NoPropsNoEventsComponentProps();
@@ -1251,6 +1398,10 @@ ObjectPropsProps::ObjectPropsProps(
objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName ObjectPropsProps::getDiffPropsImplementationTarget() const {
return \\"ObjectProps\\";
}
folly::dynamic ObjectPropsProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = ObjectPropsProps();
@@ -1262,6 +1413,9 @@ folly::dynamic ObjectPropsProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (objectProp != oldProps->objectProp) {
result[\\"objectProp\\"] = toDynamic(objectProp);
}
return result;
}
#endif
@@ -1297,6 +1451,10 @@ PointPropNativeComponentProps::PointPropNativeComponentProps(
startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName PointPropNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"PointPropNativeComponent\\";
}
folly::dynamic PointPropNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = PointPropNativeComponentProps();
@@ -1309,10 +1467,7 @@ folly::dynamic PointPropNativeComponentProps::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;
}
@@ -1349,6 +1504,10 @@ StringEnumPropsNativeComponentProps::StringEnumPropsNativeComponentProps(
alignment(convertRawProp(context, rawProps, \\"alignment\\", sourceProps.alignment, {StringEnumPropsNativeComponentAlignment::Center})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName StringEnumPropsNativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"StringEnumPropsNativeComponent\\";
}
folly::dynamic StringEnumPropsNativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = StringEnumPropsNativeComponentProps();
@@ -1360,6 +1519,9 @@ folly::dynamic StringEnumPropsNativeComponentProps::getDiffProps(
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
if (alignment != oldProps->alignment) {
result[\\"alignment\\"] = toDynamic(alignment);
}
return result;
}
#endif
@@ -1396,6 +1558,10 @@ StringPropComponentProps::StringPropComponentProps(
accessibilityRole(convertRawProp(context, rawProps, \\"accessibilityRole\\", sourceProps.accessibilityRole, {})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName StringPropComponentProps::getDiffPropsImplementationTarget() const {
return \\"StringPropComponent\\";
}
folly::dynamic StringPropComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = StringPropComponentProps();
@@ -1449,6 +1615,10 @@ MultiFile1NativeComponentProps::MultiFile1NativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiFile1NativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MultiFile1NativeComponent\\";
}
folly::dynamic MultiFile1NativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiFile1NativeComponentProps();
@@ -1474,6 +1644,10 @@ MultiFile2NativeComponentProps::MultiFile2NativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiFile2NativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MultiFile2NativeComponent\\";
}
folly::dynamic MultiFile2NativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiFile2NativeComponentProps();
@@ -1523,6 +1697,10 @@ MultiComponent1NativeComponentProps::MultiComponent1NativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiComponent1NativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MultiComponent1NativeComponent\\";
}
folly::dynamic MultiComponent1NativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiComponent1NativeComponentProps();
@@ -1548,6 +1726,10 @@ MultiComponent2NativeComponentProps::MultiComponent2NativeComponentProps(
disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {}
#ifdef RN_SERIALIZABLE_STATE
ComponentName MultiComponent2NativeComponentProps::getDiffPropsImplementationTarget() const {
return \\"MultiComponent2NativeComponent\\";
}
folly::dynamic MultiComponent2NativeComponentProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = MultiComponent2NativeComponentProps();
@@ -16,6 +16,7 @@ Map {
#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>
@@ -86,6 +87,16 @@ static inline std::string toString(const ArrayPropsNativeComponentSizesMaskWrapp
}
struct ArrayPropsNativeComponentObjectStruct {
std::string stringProp{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentObjectStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentObjectStruct &result) {
@@ -101,6 +112,12 @@ static inline std::string toString(const ArrayPropsNativeComponentObjectStruct &
return \\"[Object ArrayPropsNativeComponentObjectStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentObjectStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentObjectStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -113,6 +130,16 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ArrayPropsNativeComponentArrayObjectStruct {
std::string stringProp{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentArrayObjectStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayObjectStruct &result) {
@@ -128,6 +155,12 @@ static inline std::string toString(const ArrayPropsNativeComponentArrayObjectStr
return \\"[Object ArrayPropsNativeComponentArrayObjectStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentArrayObjectStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentArrayObjectStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -140,6 +173,16 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ArrayPropsNativeComponentArrayStruct {
std::vector<ArrayPropsNativeComponentArrayObjectStruct> object{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentArrayStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"object\\"] = ::facebook::react::toDynamic(object);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayStruct &result) {
@@ -155,6 +198,12 @@ static inline std::string toString(const ArrayPropsNativeComponentArrayStruct &v
return \\"[Object ArrayPropsNativeComponentArrayStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentArrayStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentArrayStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -167,6 +216,16 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ArrayPropsNativeComponentArrayOfArrayOfObjectStruct {
std::string stringProp{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentArrayOfArrayOfObjectStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayOfArrayOfObjectStruct &result) {
@@ -182,6 +241,12 @@ static inline std::string toString(const ArrayPropsNativeComponentArrayOfArrayOf
return \\"[Object ArrayPropsNativeComponentArrayOfArrayOfObjectStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentArrayOfArrayOfObjectStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<std::vector<ArrayPropsNativeComponentArrayOfArrayOfObjectStruct>> &result) {
auto items = (std::vector<std::vector<RawValue>>)value;
for (const std::vector<RawValue> &item : items) {
@@ -217,6 +282,8 @@ class ArrayPropsNativeComponentProps 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
};
@@ -254,6 +321,18 @@ struct ArrayPropsNativeComponentNativePrimitivesStruct {
std::vector<SharedColor> colors{};
std::vector<ImageSource> srcs{};
std::vector<Point> points{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ArrayPropsNativeComponentNativePrimitivesStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"colors\\"] = ::facebook::react::toDynamic(colors);
result[\\"srcs\\"] = ::facebook::react::toDynamic(srcs);
result[\\"points\\"] = ::facebook::react::toDynamic(points);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentNativePrimitivesStruct &result) {
@@ -277,6 +356,12 @@ static inline std::string toString(const ArrayPropsNativeComponentNativePrimitiv
return \\"[Object ArrayPropsNativeComponentNativePrimitivesStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ArrayPropsNativeComponentNativePrimitivesStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ArrayPropsNativeComponentNativePrimitivesStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -296,6 +381,8 @@ class ArrayPropsNativeComponentProps final : public ViewProps {
std::vector<ArrayPropsNativeComponentNativePrimitivesStruct> nativePrimitives{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -333,6 +420,8 @@ class BooleanPropNativeComponentProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -371,6 +460,8 @@ class ColorPropNativeComponentProps final : public ViewProps {
SharedColor tintColor{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -408,6 +499,8 @@ class CommandNativeComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -445,6 +538,8 @@ class CommandNativeComponentProps final : public ViewProps {
std::string accessibilityHint{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -469,6 +564,7 @@ Map {
#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 {
@@ -483,6 +579,8 @@ class DimensionPropNativeComponentProps final : public ViewProps {
YGValue marginBack{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -525,6 +623,8 @@ class DoublePropNativeComponentProps final : public ViewProps {
double blurRadius6{0.0};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -562,6 +662,8 @@ class EventsNestedObjectNativeComponentProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -599,6 +701,8 @@ class EventsNativeComponentProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -636,6 +740,8 @@ class InterfaceOnlyComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -673,6 +779,8 @@ class ExcludedAndroidComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -710,6 +818,8 @@ class ExcludedAndroidIosComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -747,6 +857,8 @@ class ExcludedIosComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -761,6 +873,8 @@ class MultiFileIncludedNativeComponentProps final : public ViewProps {
bool disabled{true};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -803,6 +917,8 @@ class FloatPropNativeComponentProps final : public ViewProps {
Float blurRadius6{0.0};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -841,6 +957,8 @@ class ImagePropNativeComponentProps final : public ViewProps {
ImageSource thumbImage{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -879,6 +997,8 @@ class InsetsPropNativeComponentProps final : public ViewProps {
EdgeInsets contentInset{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -933,6 +1053,16 @@ static inline std::string toString(const Int32EnumPropsNativeComponentMaxInterva
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const Int32EnumPropsNativeComponentMaxInterval &value) {
switch (value) {
case Int32EnumPropsNativeComponentMaxInterval::MaxInterval0: return 0;
case Int32EnumPropsNativeComponentMaxInterval::MaxInterval1: return 1;
case Int32EnumPropsNativeComponentMaxInterval::MaxInterval2: return 2;
}
}
#endif
class Int32EnumPropsNativeComponentProps final : public ViewProps {
public:
Int32EnumPropsNativeComponentProps() = default;
@@ -943,6 +1073,8 @@ class Int32EnumPropsNativeComponentProps final : public ViewProps {
Int32EnumPropsNativeComponentMaxInterval maxInterval{Int32EnumPropsNativeComponentMaxInterval::MaxInterval0};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -982,6 +1114,8 @@ class IntegerPropNativeComponentProps final : public ViewProps {
int progress3{10};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1019,6 +1153,8 @@ class InterfaceOnlyComponentProps final : public ViewProps {
std::string accessibilityHint{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1056,6 +1192,8 @@ class MixedPropNativeComponentProps final : public ViewProps {
folly::dynamic mixedProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1099,6 +1237,8 @@ class ImageColorPropNativeComponentProps final : public ViewProps {
Point point{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1136,6 +1276,8 @@ class NoPropsNoEventsComponentProps final : public ViewProps {
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1182,6 +1324,12 @@ static inline std::string toString(const ObjectPropsStringEnumProp &value) {
case ObjectPropsStringEnumProp::Option1: return \\"option1\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsStringEnumProp &value) {
return toString(value);
}
#endif
enum class ObjectPropsIntEnumProp { IntEnumProp0 = 0 };
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsIntEnumProp &result) {
@@ -1200,8 +1348,26 @@ static inline std::string toString(const ObjectPropsIntEnumProp &value) {
case ObjectPropsIntEnumProp::IntEnumProp0: return \\"0\\";
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsIntEnumProp &value) {
switch (value) {
case ObjectPropsIntEnumProp::IntEnumProp0: return 0;
}
}
#endif
struct ObjectPropsObjectPropObjectArrayPropStruct {
std::vector<std::string> array{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropObjectArrayPropStruct&) 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, ObjectPropsObjectPropObjectArrayPropStruct &result) {
@@ -1217,10 +1383,28 @@ static inline std::string toString(const ObjectPropsObjectPropObjectArrayPropStr
return \\"[Object ObjectPropsObjectPropObjectArrayPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropObjectArrayPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct {
ImageSource image{};
SharedColor color{};
Point point{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct&) 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, ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct &result) {
@@ -1244,8 +1428,24 @@ static inline std::string toString(const ObjectPropsObjectPropObjectPrimitiveReq
return \\"[Object ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsObjectPropNestedPropANestedPropBStruct {
std::string nestedPropC{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropNestedPropANestedPropBStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"nestedPropC\\"] = nestedPropC;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedPropANestedPropBStruct &result) {
@@ -1261,8 +1461,24 @@ static inline std::string toString(const ObjectPropsObjectPropNestedPropANestedP
return \\"[Object ObjectPropsObjectPropNestedPropANestedPropBStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedPropANestedPropBStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsObjectPropNestedPropAStruct {
ObjectPropsObjectPropNestedPropANestedPropBStruct nestedPropB{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropNestedPropAStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"nestedPropB\\"] = ::facebook::react::toDynamic(nestedPropB);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedPropAStruct &result) {
@@ -1278,8 +1494,24 @@ static inline std::string toString(const ObjectPropsObjectPropNestedPropAStruct
return \\"[Object ObjectPropsObjectPropNestedPropAStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedPropAStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct {
std::string stringProp{\\"\\"};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"stringProp\\"] = stringProp;
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct &result) {
@@ -1295,6 +1527,12 @@ static inline std::string toString(const ObjectPropsObjectPropNestedArrayAsPrope
return \\"[Object ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct &value) {
return value.toDynamic();
}
#endif
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
@@ -1307,6 +1545,16 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
struct ObjectPropsObjectPropNestedArrayAsPropertyStruct {
std::vector<ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct> arrayProp{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropNestedArrayAsPropertyStruct&) const = default;
folly::dynamic toDynamic() const {
folly::dynamic result = folly::dynamic::object();
result[\\"arrayProp\\"] = ::facebook::react::toDynamic(arrayProp);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedArrayAsPropertyStruct &result) {
@@ -1322,6 +1570,12 @@ static inline std::string toString(const ObjectPropsObjectPropNestedArrayAsPrope
return \\"[Object ObjectPropsObjectPropNestedArrayAsPropertyStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedArrayAsPropertyStruct &value) {
return value.toDynamic();
}
#endif
struct ObjectPropsObjectPropStruct {
std::string stringProp{\\"\\"};
bool booleanProp{false};
@@ -1337,6 +1591,29 @@ struct ObjectPropsObjectPropStruct {
ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct objectPrimitiveRequiredProp{};
ObjectPropsObjectPropNestedPropAStruct nestedPropA{};
ObjectPropsObjectPropNestedArrayAsPropertyStruct nestedArrayAsProperty{};
#ifdef RN_SERIALIZABLE_STATE
bool operator==(const ObjectPropsObjectPropStruct&) 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[\\"stringUserDefaultProp\\"] = stringUserDefaultProp;
result[\\"booleanUserDefaultProp\\"] = booleanUserDefaultProp;
result[\\"floatUserDefaultProp\\"] = floatUserDefaultProp;
result[\\"intUserDefaultProp\\"] = intUserDefaultProp;
result[\\"stringEnumProp\\"] = ::facebook::react::toDynamic(stringEnumProp);
result[\\"intEnumProp\\"] = ::facebook::react::toDynamic(intEnumProp);
result[\\"objectArrayProp\\"] = ::facebook::react::toDynamic(objectArrayProp);
result[\\"objectPrimitiveRequiredProp\\"] = ::facebook::react::toDynamic(objectPrimitiveRequiredProp);
result[\\"nestedPropA\\"] = ::facebook::react::toDynamic(nestedPropA);
result[\\"nestedArrayAsProperty\\"] = ::facebook::react::toDynamic(nestedArrayAsProperty);
return result;
}
#endif
};
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropStruct &result) {
@@ -1403,6 +1680,12 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
static inline std::string toString(const ObjectPropsObjectPropStruct &value) {
return \\"[Object ObjectPropsObjectPropStruct]\\";
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const ObjectPropsObjectPropStruct &value) {
return value.toDynamic();
}
#endif
class ObjectPropsProps final : public ViewProps {
public:
ObjectPropsProps() = default;
@@ -1413,6 +1696,8 @@ class ObjectPropsProps final : public ViewProps {
ObjectPropsObjectPropStruct objectProp{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1451,6 +1736,8 @@ class PointPropNativeComponentProps final : public ViewProps {
Point startPoint{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1496,6 +1783,12 @@ static inline std::string toString(const StringEnumPropsNativeComponentAlignment
}
}
#ifdef RN_SERIALIZABLE_STATE
static inline folly::dynamic toDynamic(const StringEnumPropsNativeComponentAlignment &value) {
return toString(value);
}
#endif
class StringEnumPropsNativeComponentProps final : public ViewProps {
public:
StringEnumPropsNativeComponentProps() = default;
@@ -1506,6 +1799,8 @@ class StringEnumPropsNativeComponentProps final : public ViewProps {
StringEnumPropsNativeComponentAlignment alignment{StringEnumPropsNativeComponentAlignment::Center};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1544,6 +1839,8 @@ class StringPropComponentProps final : public ViewProps {
std::string accessibilityRole{};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1581,6 +1878,8 @@ class MultiFile1NativeComponentProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1595,6 +1894,8 @@ class MultiFile2NativeComponentProps final : public ViewProps {
bool disabled{true};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1632,6 +1933,8 @@ class MultiComponent1NativeComponentProps final : public ViewProps {
bool disabled{false};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1646,6 +1949,8 @@ class MultiComponent2NativeComponentProps final : public ViewProps {
bool disabled{true};
#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};
@@ -1,6 +1,6 @@
{
"name": "@react-native/compatibility-check",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
"license": "MIT",
"repository": {
@@ -29,7 +29,7 @@
"dist"
],
"dependencies": {
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "0.81.0-main"
},
"devDependencies": {
"flow-remove-types": "^2.237.2",
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.80.0-main",
"version": "0.81.0-main",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "0.81.0-main"
},
"peerDependencies": {
"@types/react": "^19.1.0",
@@ -12,7 +12,9 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
@Suppress("DEPRECATION")
public class OSSLibraryExamplePackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
listOf(NativeSampleModule(reactContext))
@@ -1,6 +1,6 @@
{
"name": "@react-native/oss-library-example",
"version": "0.80.0-main",
"version": "0.81.0-main",
"private": true,
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
"license": "MIT",
@@ -26,7 +26,7 @@
],
"devDependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.80.0-main",
"@react-native/babel-preset": "0.81.0-main",
"react-native": "1000.0.0"
},
"peerDependencies": {
+2 -1
View File
@@ -12,6 +12,7 @@
import type {NativeSyntheticEvent} from '../Types/CoreEventTypes';
import type {PlatformConfig} from './AnimatedPlatformConfig';
import type {EventMapping} from './NativeAnimatedModule';
import NativeAnimatedHelper from '../../src/private/animated/NativeAnimatedHelper';
import {findNodeHandle} from '../ReactNative/RendererProxy';
@@ -37,7 +38,7 @@ export function attachNativeEventImpl(
): {detach: () => void} {
// Find animated values in `argMapping` and create an array representing their
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
const eventMappings = [];
const eventMappings: Array<EventMapping> = [];
const traverse = (value: mixed, path: Array<string>) => {
if (value instanceof AnimatedValue) {
@@ -247,10 +247,6 @@ describe('Animated', () => {
});
it('renders animated and primitive style correctly', () => {
ReactNativeFeatureFlags.override({
alwaysFlattenAnimatedStyles: () => true,
});
const anim = new Animated.Value(0);
const staticProps = {
style: [
@@ -376,8 +372,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.sequence([anim1, anim2]);
const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
expect(anim1.start).not.toBeCalled();
expect(anim2.start).not.toBeCalled();
@@ -402,8 +397,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
Animated.sequence([anim1, anim2]).start(cb);
Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]).start(cb);
anim1.start.mock.calls[0][0]({finished: false});
@@ -417,8 +411,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.sequence([anim1, anim2]);
const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
seq.start(cb);
seq.stop();
@@ -436,8 +429,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.sequence([anim1, anim2]);
const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
seq.start(cb);
@@ -460,8 +452,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.sequence([anim1, anim2]);
const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
seq.start(cb);
anim1.start.mock.calls[0][0]({finished: true});
@@ -487,8 +478,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation);
const loop = Animated.loop(animation as $FlowFixMe);
expect(animation.start).not.toBeCalled();
@@ -519,8 +509,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {iterations: -1});
const loop = Animated.loop(animation as $FlowFixMe, {iterations: -1});
expect(animation.start).not.toBeCalled();
@@ -551,8 +540,10 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {anotherKey: 'value'});
const loop = Animated.loop(
animation as $FlowFixMe,
{anotherKey: 'value'} as $FlowFixMe,
);
expect(animation.start).not.toBeCalled();
@@ -583,8 +574,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {iterations: 3});
const loop = Animated.loop(animation as $FlowFixMe, {iterations: 3});
expect(animation.start).not.toBeCalled();
@@ -615,8 +605,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {iterations: 1});
const loop = Animated.loop(animation as $FlowFixMe, {iterations: 1});
expect(animation.start).not.toBeCalled();
@@ -637,8 +626,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {iterations: 0});
const loop = Animated.loop(animation as $FlowFixMe, {iterations: 0});
expect(animation.start).not.toBeCalled();
@@ -656,8 +644,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
Animated.loop(animation).start(cb);
Animated.loop(animation as $FlowFixMe).start(cb);
expect(animation.start).toBeCalled();
expect(animation.reset).toHaveBeenCalledTimes(1);
expect(cb).not.toBeCalled();
@@ -680,8 +667,7 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation);
const loop = Animated.loop(animation as $FlowFixMe);
loop.start(cb);
loop.stop();
@@ -703,8 +689,10 @@ describe('Animated', () => {
};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const loop = Animated.loop(animation, {resetBeforeIteration: false});
const loop = Animated.loop(
animation as $FlowFixMe,
{resetBeforeIteration: false} as $FlowFixMe,
);
expect(animation.start).not.toBeCalled();
@@ -730,8 +718,7 @@ describe('Animated', () => {
it('restarts sequence normally in a loop if resetBeforeIteration is false', () => {
const anim1 = {start: jest.fn(), stop: jest.fn()};
const anim2 = {start: jest.fn(), stop: jest.fn()};
// $FlowFixMe[prop-missing]
const seq = Animated.sequence([anim1, anim2]);
const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
// $FlowFixMe[prop-missing]
const loop = Animated.loop(seq, {resetBeforeIteration: false});
@@ -761,9 +748,7 @@ describe('Animated', () => {
it('works with an empty element in array', () => {
const anim1 = {start: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[incompatible-call]
// $FlowFixMe[prop-missing]
Animated.parallel([null, anim1]).start(cb);
Animated.parallel([null as $FlowFixMe, anim1 as $FlowFixMe]).start(cb);
expect(anim1.start).toBeCalled();
anim1.start.mock.calls[0][0]({finished: true});
@@ -776,9 +761,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
// $FlowFixMe[prop-missing]
const par = Animated.parallel([anim1, anim2]);
const par = Animated.parallel([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
expect(anim1.start).not.toBeCalled();
expect(anim2.start).not.toBeCalled();
@@ -801,8 +784,7 @@ describe('Animated', () => {
const anim2 = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.parallel([anim1, anim2]);
const seq = Animated.parallel([anim1 as $FlowFixMe, anim2 as $FlowFixMe]);
seq.start(cb);
seq.stop();
@@ -823,8 +805,11 @@ describe('Animated', () => {
const anim3 = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
const seq = Animated.parallel([anim1, anim2, anim3]);
const seq = Animated.parallel([
anim1 as $FlowFixMe,
anim2 as $FlowFixMe,
anim3 as $FlowFixMe,
]);
seq.start(cb);
anim1.start.mock.calls[0][0]({finished: false});
@@ -851,8 +836,7 @@ describe('Animated', () => {
it('should call anim after delay in sequence', () => {
const anim = {start: jest.fn(), stop: jest.fn()};
const cb = jest.fn();
// $FlowFixMe[prop-missing]
Animated.sequence([Animated.delay(1000), anim]).start(cb);
Animated.sequence([Animated.delay(1000), anim as $FlowFixMe]).start(cb);
jest.runAllTimers();
expect(anim.start.mock.calls.length).toBe(1);
expect(cb).not.toBeCalled();
@@ -13,7 +13,6 @@ import type {AnimatedNodeConfig} from './AnimatedNode';
import type {AnimatedStyleAllowlist} from './AnimatedStyle';
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
import {findNodeHandle} from '../../ReactNative/RendererProxy';
import flattenStyle from '../../StyleSheet/flattenStyle';
import {AnimatedEvent} from '../AnimatedEvent';
@@ -58,9 +57,7 @@ function createAnimatedProps(
// we propagate the flattened `style` object to the `props` object.
const flatStyle = flattenStyle(value as $FlowFixMe);
node = AnimatedStyle.from(flatStyle, allowlist?.style, value);
if (ReactNativeFeatureFlags.alwaysFlattenAnimatedStyles()) {
staticValue = flatStyle;
}
staticValue = flatStyle;
}
} else if (value instanceof AnimatedNode) {
node = value;
@@ -164,9 +161,7 @@ export default class AnimatedProps extends AnimatedNode {
maybeNode.__replaceAnimatedNodeWithValues(mutableStyle);
props[key] = maybeNode.__getValueForStyle(mutableStyle);
} else {
if (ReactNativeFeatureFlags.alwaysFlattenAnimatedStyles()) {
props[key] = flatStaticStyle;
}
props[key] = flatStaticStyle;
}
} else if (maybeNode instanceof AnimatedNode) {
props[key] = maybeNode.__getValue();
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
end
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end

Some files were not shown because too many files have changed in this diff Show More