Commit Graph

38536 Commits

Author SHA1 Message Date
Alex Hunt c93036ce7d Annotate deprecated APIs (#51599)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51599

Adds `deprecated` to 2x API exports via `index.js.flow`. This will flag these APIs appropriately to the developer under TypeScript.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75403796

fbshipit-source-id: 670c4bd0c262a58413e7703f09d6db2927d51408
2025-05-26 05:51:00 -07:00
Rob Hogan 8ad43da3be Update Metro imports to use package root exports (#51261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51261

Cleanup to use the new public type / API exports from `metro` landed in Metro 0.82.3, which is RN's minimum as of D74181990 / [PR](https://github.com/facebook/react-native/pull/51122), in preference to deep imports.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74141939

fbshipit-source-id: 9405f88a85e248abe8a92be1dd5a5f1ea6ceeb87
2025-05-26 04:54:26 -07:00
Alex Hunt 0e37db80f9 Delete accidentally committed helloworld test in Flow (#51598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51598

Accidentally staged as part of D75060846. `App.test.tsx` remains.

Fixes CI.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75402566

fbshipit-source-id: 6f698cfcd4f342591f81c308b2353e7637842e7d
2025-05-26 04:08:23 -07:00
Rob Hogan a3447d6b8b community-cli-plugin: Refactor CLI build command to use Metro.runBuild (#51124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51124

Metro 0.82.3's `runBuild` API now supports retrieving assets and passing through `unstable_transformProfile`, and fine control of output paths via `bundleOut`/`sourcemapOut`, so we can use it directly in the implementation of `community-cli-plugin`'s `bundle` command with no loss of function or API change.

This simplifies the implementation by re-using Metro's, and removes use of Metro internal APIs.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74151840

fbshipit-source-id: 3dcadaf8d38e7e77d21bacdf29e5d40467139d88
2025-05-26 03:45:58 -07:00
Dawid Małecki 7af8c01f46 Disable deep import warning on rn-tester package (#51565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51565

This diff silence deep import warnings globally for rn-tester package.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75291027

fbshipit-source-id: 7b4b2fe46a5c992a420b21f09a72f17944c54f6d
2025-05-26 02:53:24 -07:00
Dawid Małecki d8dc2d255a Remove prepare-flow-api-translator from build-types script and all experimental references (#51497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51497

It removes `prepare-flow-api-translator` which is no longer needed as `flow-api-translator` version was bumped already and it blocks `build-types` script from running on CI (due to reference to `flow-api-translator` source). It also removes "Experimental" annotations.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75138541

fbshipit-source-id: 897009c91adeeeaae21603dbf90020b52b61c5d5
2025-05-26 01:45:05 -07:00
Sam Zhou 5dbe32ee14 Deploy 0.272.1 to xplat (#51584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51584

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D75356543

fbshipit-source-id: 29234de4f1b6ee2b8857b24a5de566a4afd31030
2025-05-25 08:36:30 -07:00
Samuel Susla bf974e8de1 remove enable_shared_from_this from NativeAnimatedNodesManager (#51589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51589

changelog: [internal]

With D75140890, there is a guarantee that `startOnRenderCallback_` won't be called after the owning class is destroyed.

There shouldn't be any events flowing through Fabric when the RN instance is torn down. Passing this to eventEmitterListener_ should be safe.

This helps with C++ binary size a little bit.

Reviewed By: rshest

Differential Revision: D75148616

fbshipit-source-id: 5110736c2ddcff738fce395bd0b9844d44e8dcb2
2025-05-25 04:20:59 -07:00
Samuel Susla 44ebf31f3b remove use of shared_ptr from AnimatedNode (#51588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51588

changelog: [internal]

AnimatedNode never outlive NativeAnimatedNodesManager. We can safely use raw pointer here instead of shared_ptr.

This improves a C++ binary size a little bit.

Reviewed By: rshest

Differential Revision: D75148487

fbshipit-source-id: 4c2f6dc6e4de670be37dd3b65dc3a8d63d546150
2025-05-25 04:20:59 -07:00
Samuel Susla 1db4874bb3 Use unique_ptr instead of shared_ptr in activeAnimations_ (#51587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51587

changelog: [internal]

use unique_ptr instead of shared_ptr to manage memory of activeAnimations_.

Active animations are only owned by NativeAnimatedNodesManager and their ownership isn't shared with any other class.

This saves a little bit of C++ binary size.

Reviewed By: rshest

Differential Revision: D75142643

fbshipit-source-id: c09753b68e70e95fedcb7b2b8fb19a0fd7010059
2025-05-25 04:20:59 -07:00
Samuel Susla 1e31392211 remove use of shared_ptr from NativeAnimatedNodesManager::animatedNodes_ and NodesQueueItem (#51586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51586

changelog: [internal]

using shared_ptr here is not necessary because AnimatedNodes are not shared between multiple entities, they are only owned by NativeAnimatedNodesManager.

This saves a little bit C++ binary size.

Reviewed By: rshest

Differential Revision: D75148952

fbshipit-source-id: 18b8231061cda970ad96842ee6ca3135c2ec5d68
2025-05-24 16:05:01 -07:00
Samuel Susla afb543683c introduce a way to inspect shadow node revision in Fantom (#51566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51566

changelog: [internal]

Expose [revision](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h#L229) of shadow node in Fantom tests. This makes it possible to write tests verifying that shadow nodes are only cloned when they should.

Even though excessive cloning does not usually lead to bugs, it may lead to performance problems.

Also introduce a test showing a performance problem where changing height of "Sibling" view from 1 to 2 will lead to component `D` being cloned by Yoga. Component D is not affected by the size change of Sibling and the clone is unnecessary.

```jsx
<ScrollView>
  <View id="Sibling" style={{ height: 1 }} />
  <View id="A">
    <View id="B">
      <View id="C">
        <View id="D" ref={ref} />
      </View>
    </View>
  </View>
</ScrollView>
```

Reviewed By: rshest

Differential Revision: D75287261

fbshipit-source-id: ea5acb2f5d7ba6e1e5bf895d8f82a16471122ec5
2025-05-24 15:44:11 -07:00
Pieter De Baets ca5f4d1721 Disable enableModuleArgumentNSNullConversionIOS by default (#51576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51576

This is causing some internal test failures for now, so disabling the behaviour to prevent further rollout.

Changelog: [iOS][Removed] Disable fix for #51103 until more testing can be done.

Differential Revision: D75320842

fbshipit-source-id: 39c115afd11e5b1aca6cdc1fc18ec7e83eb10382
2025-05-23 16:05:44 -07:00
Soe Lynn b6292d2646 Remove static from the local scoped variable for getConstants - part 2 (#51573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51573

Changelog: [Internal]

Remove unnecessary `static` in a local scoped variable.

Reviewed By: RSNara

Differential Revision: D75306776

fbshipit-source-id: 52decae228c65ea993bd5fde0be66ab094c8fcf1
2025-05-23 12:02:11 -07:00
Vitali Zaidman e04ab60784 Update debugger-frontend from 7e19a54...343405b
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from 7e19a54...343405b

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/7e19a540aa1b4a2000ba94ba767a1d9dac5947e9...343405ba784fca9290486cbce57e7f2ca953dc14).

Reviewed By: huntie

Differential Revision: D75298472

fbshipit-source-id: 13fd990669eaa37b96f770193640417de3cddd08
2025-05-23 11:51:42 -07:00
Vitali Zaidman e757c09b96 fixed typo in UNREGISTERED_DEVICE error (#51561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51561

Changelog: [Internal] fix typo in InspectorProxy

Reviewed By: huntie

Differential Revision: D75217049

fbshipit-source-id: 2473ddf4a120175305b195ed78704e734554b423
2025-05-23 11:51:42 -07:00
Rob Hogan fa79fd8f96 Bump Metro to 0.82.4 (#51567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51567

Bump Metro minimum from 0.82.3 to 0.82.4

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

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

Reviewed By: vzaidman

Differential Revision: D75294674

fbshipit-source-id: 750e83db2fb5cd9a6bf4b1971cb701ac23dfa961
2025-05-23 10:53:17 -07:00
Joe Vilches d87790846b Fixup focusability logic of PreparedLayoutTextView (#51508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51508

For now, we are opting to not auto-focus `PreparedLayoutTextViews` if they have links. The reason being this would not work well with Text nested in a View which is also accessible. If that Text had links, and was set to focusable, then TalkBack would individually focus that Text, which users may not want.

So this diff removes that link detection, and fixes up accessibility in general. Since this isn't a TextView, we need to explicitly set the `text` on the `AccessibilityNodeInfo` object in the delegate so TalkBack know what to annouce.

In the future we aim to bring back auto-focusing with links, but only if a screen reader is not on, so that keyboard users can benefit from this.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75103779

fbshipit-source-id: 05e17f4eb8d5d79ed1d84458f6d5fc6d1571e382
2025-05-23 10:42:37 -07:00
Samuel Susla 0f73a7ac28 Mark methods in NativeAnimatedNodesManager as noexcept (#51557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51557

changelog: [internal]

use noexcept in NativeAnimatedNodesManager whenever feasible to lower C++ binary size.

Reviewed By: rshest

Differential Revision: D75149555

fbshipit-source-id: 03838c048d78bcfd9ad563c71a9a7a1f3c5cd2e3
2025-05-23 08:46:39 -07:00
Samuel Susla e657862709 Do not throw error in PropsAnimatedNode (#51563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51563

changelog: [internal]

Throwing errors in C++ is expensive and slow. Let's replace it with logging.

This is to reduce binary size of C++ Animated.

Reviewed By: mdvacca

Differential Revision: D75140875

fbshipit-source-id: 32909572141d8e1b51b60f317716f783aa760265
2025-05-23 07:10:56 -07:00
Pieter De Baets ae4eac1eb6 RCTTurboModule nits (#51499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51499

Small nits as follow-up to D74208525

 Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75141440

fbshipit-source-id: 466ee3573c4afe88878f306d902c5aa82df2a3f3
2025-05-23 06:39:41 -07:00
zhongwuzw 4a4fd1cb8b Turbo module: Fixes dictionary stripped out when value is null (#51103)
Summary:
Fixes https://github.com/facebook/react-native/issues/51083. Turbo stripped out the dictionary when the value is null. The old architecture transforms null to NSNull. The null seems useful in cases like #51803 for removing the storage of the key. cipolleschi can you please help to review?

## Changelog:

[IOS] [FIXED] - Turbo module: Fixes dictionary stripped out when value is null

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

Test Plan: Repro please see https://github.com/facebook/react-native/issues/51083.

Reviewed By: rshest

Differential Revision: D74208525

Pulled By: javache

fbshipit-source-id: 53d630c265fba15d25309a3e1deb19dca24f298c
2025-05-23 06:39:41 -07:00
Samuel Susla 6ff500d694 Stop render callback on destruction to prevent crash (#51558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51558

changelog: [internal]

we must call stopRenderCallbackIfNeeded to prevent UI tick from being called when
`NativeAnimatedNodesManager` is deallocated.

Reviewed By: mdvacca

Differential Revision: D75140890

fbshipit-source-id: 9ad32956a877f9ee8256790ba32cb5982a5b0c2f
2025-05-23 05:51:26 -07:00
Ruslan Lesiutin a633d93f7f Define sampling methods implementations for Hermes fallback target delegate (#51519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51519

# Changelog: [Internal]

Hermes Sampling Profiler doesn't require debugger to be enabled - we can use it in fallback Hermes Runtime target delegate. That's probably the last thing to make Hermes really run in `opt` mode.

When Hermes Target is compiled with no Debugger support, we can still define implementation for sampling profiler methods and call them on Hermes Runtime.

Reviewed By: huntie

Differential Revision: D75188276

fbshipit-source-id: e3e0dccd09e0870264e8abc65f96052735d63ad8
2025-05-23 05:33:38 -07:00
Alex Hunt 38acb4c074 Remove flow libdefs from npm package (#51556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51556

Excludes `packages/react-native/flow/` from being published to npm.

**As far as I know**, we already axed open source Flow support with a similar change in D46313482 (Jun 2023).

Changelog:
[General][Breaking] - The `react-native` package no longer ships with the `flow` directory

Reviewed By: cipolleschi

Differential Revision: D75060845

fbshipit-source-id: 3cb81820499383bf095abc97a9ab7e9061c870d6
2025-05-23 04:29:05 -07:00
Rubén Norte a573049c0a Improve support for multi-config benchmarks (#51559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51559

Changelog: [internal]

Improves the support for multi-config benchmarks in Fantom by printing the Fantom configuration summary in the header of the table with the benchmark results for each variant.

Reviewed By: rshest

Differential Revision: D75281972

fbshipit-source-id: 80caf2e668a30ea1454cb932e91dac91192323bf
2025-05-23 04:24:44 -07:00
Rubén Norte 0ff4566ac7 Enable multi-config in IntersectionObserver-itest (#51541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51541

Changelog: [internal]

Now that we have support for tests with multiple configurations in Fantom, we can configure the test for IntersectionObserver to run with all the flag configurations that affect its behavior, and make sure it doesn't break for anyone while we're rolling out the changes.

Reviewed By: rshest

Differential Revision: D75231300

fbshipit-source-id: e7addf51cffad8c94bb3bf34e99272ee1dd9da2a
2025-05-23 04:24:44 -07:00
Rubén Norte 936666d3b4 Migrate ReactFabricPublicInstance tests to a single multi-config test (#51543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51543

Changelog: [internal]

For `ReactFabricPublicInstance-itest` we used a specific pattern to be able to run the same test with different feature flags (having multiple entrypoints with the configuration and a single implementation file). We can simplify this now that we have support for multiple configurations per test file in Fantom.

Reviewed By: rshest

Differential Revision: D75231301

fbshipit-source-id: ffd047b23217c06b1b15ba07da8b5c191cc652e7
2025-05-23 04:24:44 -07:00
Rubén Norte cc9be3048a Add support multi-config test runs (#51542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51542

Changelog: [internal]

This adds support for Fantom to run specific test suites with different combinations of options/flags, using wildcards as values.

See the new documentation for this feature in this diff for more details.

Reviewed By: rshest

Differential Revision: D75231299

fbshipit-source-id: 0e953e6de68f004944ee29206af49770c8b7dd9b
2025-05-23 04:24:44 -07:00
Rubén Norte 9d58eb5719 Display Fantom test configuration in test output (#51528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51528

Changelog: [internal]

This adds some logic to the Fantom runner to display the test configuration with the test results.

Reviewed By: lenaic

Differential Revision: D75063176

fbshipit-source-id: 8371e90247c1a0c24f29a13ead25fa5dbf98ec10
2025-05-23 04:24:44 -07:00
Christian Falch 592b09781b added missing search path to reactPerfLogger (#51555)
Summary:
ReactPerfLogger target now has an include file that wasn't in the search path.

This commit fixes this by adding "ReactCommon" as search path to the target.

## Changelog:

[IOS] [FIXED] - Added missing search path to swift package

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

Test Plan: No tests yet.

Reviewed By: cortinico

Differential Revision: D75279320

Pulled By: rshest

fbshipit-source-id: b4d217bdcdb45d4b2decee0aeee155b829cdec9d
2025-05-23 03:22:39 -07:00
Wojciech Lewicki 90da666691 fix: call delete instead of free in imagefetcher (#51492)
Summary:
I've been digging into memleaks in RN for some time and noticed that instances of `FabricUIManager` are leaking on reload action even on an empty app. I managed to pinpoint it to [ContextContainer](https://github.com/facebook/react-native/blob/36df97f500aa0aa8031098caf7526db358b6ddc1/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp#L522) (which holds `FabricUIManager` on the cpp side) not being deallocated after reload. After much much digging (since contextContainer is passed around in many places) I found that destructor of `ImageFetcher` never runs on reload, and its instance holds `contextContainer`. It turns out that `ImageManager`, which holds `ImageFetcher`, was calling `free` instead of `delete` and the former does not call destructor. After applying it, `contextContainer` does not leak making `FabricUIManager` instances not to leak too 🎉.

## Changelog:

[ANDROID] [FIXED] - Change `free` to `delete` to call destructor of `ImageFetcher` and release `contextContainer`.

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

Test Plan: Run empty RN app in AS, do reload multiple times and see in AS profiler that instances of `FabricUIManager` are kept in memory without this change.

Reviewed By: Abbondanzo

Differential Revision: D75141983

Pulled By: javache

fbshipit-source-id: f13eea96cb7b614c1d6b53184498ef6294614986
2025-05-23 02:38:54 -07:00
Tomek Zawadzki 2da4a6059a Apply baseline offset separately for each line of text on iOS (#51344)
Summary:
This PR removes extraneous blank space at the bottom of multiline `TextInput` when using nested `Text` with different font sizes on iOS with the New Architecture enabled.

| Before | After |
|:-:|:-:|
| <img width="283" alt="Screenshot 2025-05-15 at 12 16 05" src="https://github.com/user-attachments/assets/47256267-86ff-45f9-9e60-162d444a4b9d" /> | <img width="286" alt="Screenshot 2025-05-15 at 12 01 32" src="https://github.com/user-attachments/assets/43ce4b0b-6410-4ca5-be37-59c6374ea15c" /> |

The proposed solution is to call `RCTApplyBaselineOffset` separately for each line of text.

Ideally, we would call it separately for each part of text with different font size.

## Changelog:

[IOS] [FIXED] - Fixed blank space at the bottom of multiline TextInput on iOS

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

Test Plan:
```tsx
<TextInput
  multiline
  style={{borderWidth: 1, width: 300, fontSize: 20}}
  ref={ref}
  placeholder="Type here...">
  First line{'\n'}
  <Text style={{fontSize: 30, lineHeight: 60}}>Second line</Text>
  {'\n'}Third line{'\n'}Fourth line
  {'\n'}
  Fifth line
</TextInput>
```

Reviewed By: NickGerleman

Differential Revision: D74802648

Pulled By: j-piasecki

fbshipit-source-id: 30f02ae8af66264c1776d241ed8542899e9cdf99
2025-05-22 23:02:34 -07:00
Luna Wei 139f3d5ef9 Clean up double render flag (#51552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51552

Changelog: [Internal] - Clean up double state render experiment

Reviewed By: yungsters

Differential Revision: D75248135

fbshipit-source-id: 360c7918ae7b7e7f3ddd76a58d54daf31e4b122a
2025-05-22 21:43:22 -07:00
Tim Yung 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Tim Yung 5a4be31a6a RN: Fix Extraneous & Erroneous Pragma in Headers (#51553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51553

Fixes extraneous and erroneous pragma in file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264384

fbshipit-source-id: b104c48dae09d6afbbb51450618c917be0df9e38
2025-05-22 21:18:53 -07:00
Nick Gerleman b70c73d8f7 Fix missing height constraints when creating Fabric layout for adjustsFontSizeToFit (#51550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51550

`adjustsFontSizeToFit` will adjust font size so that given text fits in both veritcal and horizontal bounds. The algorithm to mutate text to fit is executed during TextLayoutManager during layout creation for Fabric, and then re-executed in `TextView.onDraw()`. See D56134348 which introduced the logic.

In Facsimile, we were not seeing font size adjusted when text is too tall. This is because we are only incorporating the height constraint during Spannable mutation during draw, but not the original layout, which Facsimile uses directly.

This could potentially fix other bugs, where width may not corredpond to the final font size we settle on during drawing.

Changelog:
[Android][Fixed] - Fix missing height constraints when creating Fabric layout for `adjustsFontSizeToFit`

Reviewed By: mdvacca

Differential Revision: D75251391

fbshipit-source-id: 77d90c49d48911e63131f9f088cfce13946c67d6
2025-05-22 17:42:29 -07:00
Peter Abbondanzo 1040cd62b6 Remove unused constructor (#51546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51546

A bit of housekeeping: this constructor is deprecated and unused as the class is internal

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75233988

fbshipit-source-id: 8272ef4a9465c447d04b377b42071f9834092709
2025-05-22 14:57:06 -07:00
Alex Taylor (alta) 535444bca4 Deploy 0.272.0 to xplat (#51536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51536

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D75228208

fbshipit-source-id: ad6666deedd976b02e8e0e475831df27b3a63984
2025-05-22 13:22:01 -07:00
David Vacca f4cea64ff0 Update documentation for DebugCorePackage (#51501)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51501

Update documentation for DebugCorePackage

changelog: [internal] internal

Reviewed By: javache, arushikesarwani94

Differential Revision: D75113218

fbshipit-source-id: e02e5385b42453623369a52f788c0225d644625f
2025-05-22 12:46:43 -07:00
David Vacca 95d6b03b61 Avoid reflection call to ReactInstanceManager.handleCxxError when MINIFY_LEGACY_ARCHITECTURE is enabled (#51484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51484

In this diff I'm avoiding a reflection call to ReactInstanceManager.handleCxxError when MINIFY_LEGACY_ARCHITECTURE is enabled, to help proguard to compile-out this method when MINIFY_LEGACY_ARCHITECTURE is enabled

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D75085524

fbshipit-source-id: c80246fdb5940c549cc1d310f7ad042cc0482f0f
2025-05-22 12:46:43 -07:00
Nick Lefever 86ffa88bbd Add missing dependency to CMakeLists for mounting (#51540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51540

The view culling `CullingContext` depends on the ScrollView component. This adds the dependency to the mounting target in CMakeLists

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75233669

fbshipit-source-id: 8342ed791082174ac6d5c6f21270b0cd0adcc95f
2025-05-22 12:27:51 -07:00
Panos Vekris 206cdc1f05 enable natural inference in xplat/js (#51538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51538

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D75196563

fbshipit-source-id: 1039e2234cb4f7ca81fef28bb1acbf4c6bd7e7d9
2025-05-22 11:50:16 -07:00
Panos Vekris ff9d33073d unbreak flow trunk (#51544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51544

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D75235560

fbshipit-source-id: 7767aa3a9cabc6174d778f437bc31624224a530e
2025-05-22 11:29:22 -07:00
Alex Hunt 44e36e6d9f Consolidate location for Flow libdefs (#51539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51539

Follow up to D70322032. Relocates some of our newly added Flow library definitions into the package level `flow/` directory, to help disambiguate their use.

**Types directories after changes**

`packages/react-native/`

- `flow/` — Longstanding location for Flow package/global library definitions. Not imported by source code.
- `src/types/` — Contains public typedefs useful to 3P consumers (TypeScript) (today, just `globals.d.ts` as one module). Not imported by source code.
- `src/private/types/` — Source type modules **in Flow**, that **are imported** by other files in `src/private/`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75060846

fbshipit-source-id: 750a31e11b8f65579ce0831273df4d3b86335bdc
2025-05-22 10:34:04 -07:00
Ruslan Lesiutin 3dc58f04dd Remove JSExecutor::performanceNow() (#51513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51513

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

# Changelog: [Internal]

This is replaced by `HighResTimeStamp::now()`, which is available in a dedicated smal `react/timing` module.

Reviewed By: lenaic

Differential Revision: D75185783

fbshipit-source-id: 2eb37ce25ca319f3c37def43de4e1db89e0f5be9
2025-05-22 10:16:45 -07:00
Ruslan Lesiutin f03268b896 Replace DOMHighResTimeStamp alias in ReactCommon with new abstractions (#51512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51512

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

# Changelog: [Internal]

Replaces `DOMHighResTimeStamp` alias completely in `ReactCommon` with `HighResTimeStamp`.

`DOMHighResTimeStamp` as a type is now expected to be used only in JavaScript.

I didn't update places where we explcitly use `std::chrono::high_resolution_clock`, since it is platform-specific and there is no guarantee that `std::chrono::high_resolution_clock` == `std::chrono::steady_clock`.

Also, places that are isolated and not part of the Web Performance APIs, such as Telemetry for Fabric, are not updates as part of this diff. Although these subsystems are also using `std::chrono::steady_clock` as a low-level representation, they are not sharing it with other parts of the React Native core.

Reviewed By: rubennorte

Differential Revision: D75185613

fbshipit-source-id: 889719368de163e6f529689df6cc16d816fde66c
2025-05-22 10:16:45 -07:00
Ruslan Lesiutin aa7202861f Use HighResTimeStamp (#51511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51511

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Reviewed By: rubennorte, huntie

Differential Revision: D75185467

fbshipit-source-id: 37444392f12e8c9c4479c47c42b2c4badca7ecfd
2025-05-22 10:16:45 -07:00
Riccardo Cipolleschi cd01ecbb6a Rename RNDEP_VERSION to RN_DEP_VERSION (#51537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51537

To adhere more closely to our conventions, this change renames `RNDEP_VERSION` to `RN_DEP_VERSION`

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75223248

fbshipit-source-id: 7ba44d7b358981bfbabe71c9876e3c865bdf9f50
2025-05-22 10:06:14 -07:00
Riccardo Cipolleschi 66ec4b3778 Add documentation to the SwiftPM structure (#51532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51532

This change adds documentation to the SwiftPM structure to simplify changing it, especially if we have to port some changes from the cocoapods infra to the Swift PM implementation.

## Changelog:
[Internal] - Add docs

Reviewed By: cortinico

Differential Revision: D75217331

fbshipit-source-id: 153e87883d10ceed5a899c9a7dc362b4d2b7e510
2025-05-22 10:06:14 -07:00