Commit Graph

38536 Commits

Author SHA1 Message Date
Alex Hunt 1bb929baed Add explicit compatibility for platform specific files under "exports" (#50426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50426

Prepares [platform-specific extensions](https://reactnative.dev/docs/platform-specific-code) compatibility for subpath imports ahead of D72228547 (`"exports"` field reattempt).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D72235790

fbshipit-source-id: 8e76999c632460fdc4795d56e19db75f327ea126
2025-04-03 09:22:50 -07:00
Mateo Guzmán 403d609d83 Make LogBoxModule internal (#50456)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.devsupport.LogBoxModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.devsupport.LogBoxModule internal

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

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

Reviewed By: javache, cortinico

Differential Revision: D72344264

Pulled By: zeyap

fbshipit-source-id: 56eccb026da5d435198d85dada641c18e241ba6a
2025-04-03 08:32:13 -07:00
Riccardo Cipolleschi 91622459ce Add Changelog for 0.76.9 (#50475)
Summary:
Add changelog for 0.76.9

## Changelog:
[Internal] - Add changelog for 0.76.9

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D72388443

Pulled By: cipolleschi

fbshipit-source-id: 41c8aac00a0ac11fdfab2a3032d86f04a86a0d7e
2025-04-03 08:31:45 -07:00
Alex Hunt d32ca8e899 Move build-types config into own module (#50450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50450

Intends to be reused by the incoming `buildApiSnapshot` behaviour.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72306509

fbshipit-source-id: 9e03c95f2469e10c05bdd0be39d4e217a6cc197f
2025-04-03 08:31:23 -07:00
Alex Hunt 293e89e7f6 Move build-types script into separate dir (#50448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50448

In preparation for API snapshot generation and README documentation, move into dedicated dir.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72306094

fbshipit-source-id: 3663f9ba9987a59918bae54cfc5a27555b90a9f9
2025-04-03 08:31:23 -07:00
Gijs Weterings eba9ebe0a9 Fix nullsafe FIXMES for Task.java and mark nullsafe (#50355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50355

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made Task.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979582

fbshipit-source-id: f4104e5deb1d0538fe8b4968dc1411036a3e9634
2025-04-03 08:01:59 -07:00
Gijs Weterings af4f0d0cff Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java (#50361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50361

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979592

fbshipit-source-id: 07f3b74362b85803eec90c0c974a88d061d8e816
2025-04-03 08:01:59 -07:00
Gijs Weterings ff6601bfb7 Fix nullsafe FIXMES for ReconnectingWebSocket.java and mark nullsafe (#50354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50354

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ReconnectingWebSocket.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979606

fbshipit-source-id: d71e26fe37bdf5abbe7b933d0fee25e05d0da87d
2025-04-03 08:01:59 -07:00
Gijs Weterings f94174f2dc Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/ReconnectingWebSocket.java (#50368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50368

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979580

fbshipit-source-id: 0eaeaf327421db47a8499a9b6154fa6d5ab8a4fd
2025-04-03 08:01:59 -07:00
Gijs Weterings 4e7d09ceff FIx nullsafe FIXMEs for DialogModule and mark nullsafe (#50353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50353

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made DialogModule.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979604

fbshipit-source-id: 556b2b10ef0879bf7cd4eac6eaf3c9c3cc1c5413
2025-04-03 08:01:59 -07:00
Gijs Weterings 6d96f70abc Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java (#50351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50351

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979584

fbshipit-source-id: 52e29ac578edcbcd9bd14de4d327564d54f421cf
2025-04-03 08:01:59 -07:00
Gijs Weterings 8f5aaf13b2 Fix Nullsafe FIXMEs for FileReaderModule.java and mark nullsafe (#50352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50352

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made FileReaderModule.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979585

fbshipit-source-id: 3bef5ff48d1d27838d2668367785a85b2b863f05
2025-04-03 08:01:59 -07:00
Gijs Weterings b9ad9966e6 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/blob/FileReaderModule.java (#50360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50360

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979587

fbshipit-source-id: 50c248def66360f2a063d9eb213cfae5d6787943
2025-04-03 08:01:59 -07:00
Gijs Weterings 020db409a2 Fix Nullsafe FIXMEs for BlobProvider.java and mark nullsafe (#50363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50363

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made BlobProvider.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979597

fbshipit-source-id: a6fba0d83f3558b3bed21de484b59ee6b17bb643
2025-04-03 08:01:59 -07:00
Gijs Weterings 0702e74277 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.java (#50350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50350

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979586

fbshipit-source-id: 155fc505d131acc1fa3444692928448b8567cbd5
2025-04-03 08:01:59 -07:00
Gijs Weterings 7aaf0cb3f1 Fix Nullsafe FIXMES for MountingManager.java and mark nullsafe (#50362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50362

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made MountingManager.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979607

fbshipit-source-id: 0a41e3a6405500c29ec4710ea3ed57e6705f1b4a
2025-04-03 08:01:59 -07:00
Gijs Weterings 141060a230 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java (#50356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50356

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979593

fbshipit-source-id: 4dbe6ae7f44694b77ebf64170cb71393b532b981
2025-04-03 08:01:59 -07:00
Gijs Weterings e957bdb8fa Fix Nullsafe FIXMEs for MountItemDispatcher.java and mark nullsafe (#50348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50348

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made MountItemDispatcher.java nullsafe

Reviewed By: cortinico

Differential Revision: D71979589

fbshipit-source-id: 0133fa6bd56d5595e8397029517b43d0a95b260b
2025-04-03 08:01:59 -07:00
Gijs Weterings a98e15cf5d Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java (#50349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50349

Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71979596

fbshipit-source-id: a463b916328d4aecb6b8d91c37be170a8f6fb355
2025-04-03 08:01:59 -07:00
Jakub Piasecki 939d1a37f6 Update ScrollView symbols (#50469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50469

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72383377

fbshipit-source-id: 4381d9d692de011e4872c27b55d77c10cb848e02
2025-04-03 07:53:58 -07:00
Mateo Guzmán 2be407cd97 Make SoundManagerModule internal (#50457)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.sound.SoundManagerModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.sound.SoundManagerModule internal

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

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

Reviewed By: javache, cortinico

Differential Revision: D72344289

Pulled By: zeyap

fbshipit-source-id: a7303dfa7353e66b7c369cf34f6f0e018c25d9cf
2025-04-03 07:46:22 -07:00
Nicola Corti 1786912263 Decouple NativeMap and NativeArray from reactnativejni (#50437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50437

Currently we do have `NativeArray`, `NativeMap` being tightly coupled with the old arch (i.e. everything inside `libreactnativejni.so`).
Those classes however are primitives used also by the New Arch and they should be accessible even without the bridge infra.

I've noticed this dependency while working on the Legacy Arch warnings.

Here I'm refactoring those primitives to live in a separate `libreactnativejni_common` module that can be loaded indipendently.

Changelog:
[Internal] [Changed] - Decouple NativeMap and NativeArray from `reactnativejni`

Reviewed By: javache, mdvacca

Differential Revision: D71635967

fbshipit-source-id: 64b0fc26491977a0e6c5be4688ff91969c81d680
2025-04-03 06:49:59 -07:00
Vitali Zaidman adff5fcd35 log time since last communication (#50436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50436

Changelog: [Internal]

`is_idle` was a confusing concept that I didn't find useful when researching why disconnections happen. Instead, I'd like to know when the last communication with inspector proxy took place.

Reviewed By: hoxyq

Differential Revision: D72251072

fbshipit-source-id: 10f83bde6c8f3ed4b661bcfbef57f86f34039e5d
2025-04-03 05:47:05 -07:00
Vitali Zaidman ca7baa1d17 also report message size in inspector proxy cdp traffic reporter (#50435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50435

Changelog: [Internal] when reporting how many cdp messages passed inspector proxy, also report their total size

Reviewed By: hoxyq

Differential Revision: D72245498

fbshipit-source-id: 777274527b7e180c984b11414bec54d0e6f9d27b
2025-04-03 05:47:05 -07:00
Riccardo Cipolleschi e14230267c Pin cmake version to 3.31.6 (#50464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50464

Runners in GHA has been updated by github and they now ship with CMake 4.0. (actions/runner-images#11926)

This version is not compatible with React Native, so we are pinning cmake to 3.36.1

## Changelog:
[Internal] - Pin cmake to 3.36.1

Reviewed By: cortinico

Differential Revision: D72379834

fbshipit-source-id: ab09009102118e6590f02cf57fa6f9149482f62b
2025-04-03 05:05:38 -07:00
Mateo Guzmán f02607badb Make DeviceInfoModule internal (#50458)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.deviceinfo.DeviceInfoModule).

All GH search results are forks – there is only one relevant case for the repository [renavigation2/renavigation2](https://github.com/renavigation2/renavigation2/blob/82582c11a9eb2e4e7c56d84d53fbc4e575cb0174/packages/navigation/android/src/main/java/com/navigation/reactnative/SceneView.java#L17), but the repo has no been updated for 4 years, marked as work in progress and its packages have 0 downloads, so this won't break OSS but I'm marking it as breaking just in case (let me know if you think we should open an issue on their side).

## Changelog:

[ANDROID][BREAKING] - Make com.facebook.react.modules.deviceinfo.DeviceInfoModule internal

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

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

Reviewed By: cortinico

Differential Revision: D72377448

Pulled By: javache

fbshipit-source-id: 974146474f649ce2bc80d74c3eb8d6d8f987c372
2025-04-03 04:56:05 -07:00
Alex Hunt 7b5ba57255 Move ToastAndroid fallback to separate module, copy doc comments (#50427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50427

Move non-Android implementation into `ToastFallback.js`. The added `Platform.OS` check allows compatibility when this import subpath is specified in package.json `"exports"`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D72238079

fbshipit-source-id: 6ccc5c17a36015a3d76573b447b61467f47fb419
2025-04-03 03:26:38 -07:00
Nicola Corti d13be5723f Exclude __mocks__ folder from codegen podspec generation
Summary:
We should not be adding files inside Jest's __mocks__ folder inside the generated podspec.
This takes care of it.

Context: https://github.com/reactwg/react-native-new-architecture/discussions/282

Changelog:
[Internal] [Changed] - Exclude __mocks__ folder from codegen podspec generation

Reviewed By: fabriziocucci

Differential Revision: D72318736

fbshipit-source-id: 73a8c3f3cd84794ead9e7ce622f7ac4299d943f1
2025-04-03 02:53:49 -07:00
Aliaksei Andreyeu e6ae02a6db Report JS events as instant track markers
Summary:
Currently markers are ignored in RN apps. Utilizing newly added instant track event type for sytrace so the markers are displayed nicely on the timeline. The time delta decoding will be addressed separately for proper timestamp assignment during backend processing.

## Changelog:

[Internal] [Added] - Support for logging mark events with fbsystrace

Reviewed By: javache

Differential Revision: D72094455

fbshipit-source-id: 4cd8f53ddd0b40dfded8d6d8df367698515588c7
2025-04-02 23:57:54 -07:00
Sam Zhou fae1532f4b Remove $PropertyType shim
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D72347503

fbshipit-source-id: 11d00394a0b0e50a28aefdbb984a55ebdbc5bb58
2025-04-02 17:27:55 -07:00
Ramanpreet Nara 3af66fd423 RFC: Mitigate main queue js execution deadlocks now and forever
Summary:
Make RCTScreenSize and RCTScreenScale initialize during React Native init.

After this diff, there shouldn't be any sync dispatches to the main queue. So, we can just introduce an error into RCTUnsafeExecuteOnMainQueueSync.

## Note
If people manually dispatch to the main queue like so, react native can still deadlock:

```
dispatch_sync(dispatch_get_main_queue(), ^{});
```

Changelog: [Internal]

Reviewed By: lyahdav

Differential Revision: D72273163

fbshipit-source-id: 6211851b380b4f5cd556f48f4d717a6f53d65d32
2025-04-02 16:45:18 -07:00
Ramanpreet Nara a74649d285 Convert RCTUtils into objc++
Summary:
I'll need to use feature flags in this file. And those are only accessible from c++.

Changelog: [Internal]

Reviewed By: lyahdav

Differential Revision: D72326982

fbshipit-source-id: 4c9dfd0e5baa69d979b12914f289d58be6e123a8
2025-04-02 16:45:18 -07:00
Dawid Małecki 1b24182a17 Reexport NativeMethodsMixin type from the root
Summary:
Reexport `NativeMethodsMixin` type to align closer with manual types.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D72150912

fbshipit-source-id: 91a09297df7f609741dcf7e7506cc7dc07375de1
2025-04-02 09:12:34 -07:00
Alex Hunt 3587f57192 Add error code exit for build-types with nonempty errors (#50449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50449

Productionisation step before we enable in CI.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72303190

fbshipit-source-id: 15dcd85a817549a3a20aa8a56cb8855a68ed5839
2025-04-02 07:50:22 -07:00
Jakub Piasecki b4e64546fd Add a post transform to rename the default export names (#50397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50397

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72170157

fbshipit-source-id: 9067a83c5e941ef8ade7b846799d9a09f7dc4e62
2025-04-02 07:03:15 -07:00
Dawid Małecki 0615b056e6 Add lint rule preventing importing React as default (#50432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50432

This diff adds lint rule to keep React imports consistent across the react native repo. There is a fix suggestion in case if only React is imported.

Changelog:
[internal]

Reviewed By: NickGerleman

Differential Revision: D72244838

fbshipit-source-id: b783d6320520d76c2e5d5ce5c5b7c2a4548d50fe
2025-04-02 06:59:33 -07:00
Dawid Małecki 83399e245b Migrate import React to import * as React (#50433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50433

Make React imports consistent across react-native source code to also align with Flow tooling.

flow-api-translator adds `import * as React from 'react';` if there is no React import and React namespace has to be used after translation.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D72238732

fbshipit-source-id: 5f8cfeab26f397684b1d802731729be7071b5da7
2025-04-02 06:59:33 -07:00
Jakub Piasecki a7c38ddd34 Update type names to reduce symbol duplication (#50443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50443

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72298410

fbshipit-source-id: dd1b0fdfe63f64e97cc5001b8e7baeaf37c0d5d9
2025-04-02 05:39:33 -07:00
Jakub Piasecki 53b210079b Remove leftover ignored entrypoints (#50445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50445

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72302085

fbshipit-source-id: 6d35452a8b2f630388080bbfa56ef50abf048221
2025-04-02 03:45:58 -07:00
Jakub Piasecki 7325512219 Reduce duplication of TextInput props (#50430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50430

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72244423

fbshipit-source-id: 6ab76d32b269c0c33390b2e84a745549bcf9a66e
2025-04-02 00:45:29 -07:00
Ramanpreet Nara 094876367f Delete RCTComputeScreenScale
Summary:
This method is redundant. You could just call RCTScreenScale()

Changelog: [iOS][Removed] Delete RCTComputeScreenScale

Reviewed By: philIip

Differential Revision: D72258778

fbshipit-source-id: 0b469169efc4f2def85b2e6b736f3c4570e6b428
2025-04-01 19:49:45 -07:00
Riccardo Cipolleschi 1c21ec21e7 Changelog for 0.78.2 (#50434)
Summary:
Add changelog for RN 0.78.2

## Changelog:
[Internal] - Add changelog for RN 0.78.2

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

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D72247395

Pulled By: cipolleschi

fbshipit-source-id: c9852fe7f1fb6d1f87e7523719e9e6ae160b74be
2025-04-01 19:40:40 -07:00
Ramanpreet Nara dc97df10a2 Delete RCTFloorPixelValue
Summary:
This is dead code. Let's remove this for now.

This api is unsafe: if it's called from a non-ui thread, it may dispatch to the ui thread synchronously.

Changelog: [iOS][Removed] - Remove RCTFloorPixelValue

Reviewed By: NickGerleman

Differential Revision: D72260694

fbshipit-source-id: d032917643c957a395ee380ef925a047abd5dace
2025-04-01 19:39:19 -07:00
Ramanpreet Nara 61bd649c93 RCTTextLayoutManager: Migrate off screen scale access
Summary:
## Problem
If RCTScreenScale() is called from a non-ui thread, it will synchronously dispatch to the ui thread.

If the calling thread is the javascript thread, this could deadlock React Native.

## Changes
Move the method calls to the ui thread.

In the future, once all call-sites are migrated to the ui thread, we will just make these methods assert that they're being called from the ui thread.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72177192

fbshipit-source-id: daadf713f059d33e8fff4559b4184f9d4b6b420d
2025-04-01 19:28:08 -07:00
Nicola Corti 526f6cbe07 Delete unnecessary NativeModuleSoLoader (#50199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50199

We don't really need another wrapper around SoLoader to decide when to load a library. SoLoader already does this for us. See:
https://github.com/facebook/SoLoader/blob/62c2028a07f146bbc56c0337dacf226fcd6f95ef/java/com/facebook/soloader/SoLoader.java#L1070-L1139
I'm removing this extra unnecessary class.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D71637449

fbshipit-source-id: 33a146b56f8027fdb7fc48fd6f68bdbcf0b34fd6
2025-04-01 19:19:04 -07:00
Jakub Piasecki 597c457b68 Update types exported from the root package (#50418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50418

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72223744

fbshipit-source-id: 00abe0e5a83f3625f53e4386cf7a8b8e25cfa180
2025-04-01 19:18:22 -07:00
Mateo Guzmán 1012445ef5 Fix unresolved KDoc references (#50403)
Summary:
Static code analysis detected some unresolved KDoc references. In this PR, I’m addressing a few of them.

## Changelog:

[INTERNAL] - Fix some unresolved KDoc references

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

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

Reviewed By: cortinico

Differential Revision: D72234349

Pulled By: javache

fbshipit-source-id: 0877992cce5d76124b83c5261ec680683caadc9c
2025-04-01 12:19:01 -07:00
Alan Hughes 9eb75d4bd5 Change exception handele type in ReleaseDevSupportManager (#50400)
Summary:
In expo-updates, we would like to handle exceptions on app launch. We used to do this by reassigning our own `DefaultJSExceptionHandler` to the property on the  `ReleaseDevSupportManager `.  This class has been migrated to kotlin and is now final so we can no longer do this. Instead of having the `defaultJSExceptionHandler` typed as `DefaultJSExceptionHandler` we'd like to change it to the interface, `JSExceptionHandler` so we can do this https://github.com/expo/expo/blob/93b7e9b1724a7be11b9d79c0313a2e5a2fd5e5bf/packages/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt#L118C82-L118C97

## Changelog:

[ANDROID] [CHANGED] Change `defaultJSExceptionHandler`'s type to  `JSExceptionHandler` on the `ReleaseDevSupportManager`

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

Test Plan: RNTester runs without issue in a release build.

Reviewed By: huntie

Differential Revision: D72173667

Pulled By: cortinico

fbshipit-source-id: 978fd696322432e638a90014ff3c8c2b09fae761
2025-04-01 07:42:37 -07:00
Jakub Piasecki 09d21955ac Update Keyboard instantiation to align with other singletons (#50420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50420

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72223852

fbshipit-source-id: 3a131153cd329347250d81e1fc2043fbbd6e687e
2025-04-01 07:12:56 -07:00
Mateo Guzmán ecd902a9f1 Make MessageQueueThreadHandler internal (#50375)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.queue.MessageQueueThreadHandler).

All GH search results for this class point to error trace files.

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.queue.MessageQueueThreadHandler internal

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

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

Reviewed By: cortinico

Differential Revision: D72076724

Pulled By: javache

fbshipit-source-id: fa49f62c8d6b8efaeb1831ef2c69e293cf418520
2025-04-01 06:20:40 -07:00