Commit Graph

12270 Commits

Author SHA1 Message Date
Nicola Corti 7ca2811750 Add a legacyWarningsEnabled property to enable Legacy Warnings on NewArch (#50470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50470

This diff introduces a new property called `legacyWarningsEnabled` for `gradle.properties` that
toggles the Legacy Arch warnings for users.

I've also introduced a new `ReactNativeApplicationEntryPoint` that is generated by RNGP. This class
effectively wrap `DefaultNewArchitectureEntryPoint` by setting warnings and also invoking SoLoader.
It will reduce the errors in the user space.

As of now warnigns appear in Logcat, but I'm looking into adding some UI in a subsequent diff.

Changelog:
[Android] [Added] - Add a `legacyWarningsEnabled` property to enable Legacy Warnings on NewArch

Reviewed By: mdvacca

Differential Revision: D72383907

fbshipit-source-id: bcd659a23ec5b468958124f0f6650ff72d01ce81
2025-04-04 08:17:07 -07:00
Rubén Norte e17a6caf0a Replace module-relative paths with RN package-relative paths in some tests (#50490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50490

Changelog: [internal]

This follows the good practice in Fantom tests.

Reviewed By: javache

Differential Revision: D72454795

fbshipit-source-id: 412ee53f61073c63295a23fd7decd6f19a72bf99
2025-04-04 07:44:44 -07:00
Mateo Guzmán 3f8134880c Make ClassFinder internal (#50482)
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.common.ClassFinder).

## Changelog:

[INTERNAL] - Make com.facebook.react.common.ClassFinder internal

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

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

Reviewed By: cortinico

Differential Revision: D72445636

Pulled By: javache

fbshipit-source-id: 678327173afbbd5140eef163782051203b4f175b
2025-04-04 06:45:32 -07:00
Rubén Norte 150b1ccaba Clean up enableUIConsistency feature flag (#50484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50484

Changelog: [internal]

This cleans up the `enableUIConsistency` feature flag (shipping the feature) after we verified it was stable and performance in production.

Reviewed By: yungsters

Differential Revision: D72387602

fbshipit-source-id: 11d225d962f7e3a47e858d039b7fd5c70a6cadfd
2025-04-04 05:38:29 -07:00
Mateo Guzmán 76cfce768d Make DevMenuModule internal (#50483)
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.debug.DevMenuModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.debug.DevMenuModule internal

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

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

Reviewed By: cortinico

Differential Revision: D72445725

Pulled By: javache

fbshipit-source-id: 6bace7a31b0b27e5a36e20106ac81d6059553adb
2025-04-04 04:30:55 -07:00
Mateo Guzmán d0ae2d62b8 Remove unused SendAccessibilityEvent class (#50478)
Summary:
Found this unused class with static code analysis. It is internal and has no OSS usages, so it seems like it can be safely deleted.

## Changelog:

[INTERNAL] - Remove unused com.facebook.react.fabric.mounting.mountitems.SendAccessibilityEvent class

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

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

Reviewed By: fabriziocucci

Differential Revision: D72445544

Pulled By: javache

fbshipit-source-id: ebbb035da22111e41b04131596d3ec61d4e1423c
2025-04-04 03:44:10 -07:00
Pieter De Baets 007cefd94e Cache performanceNow method
Summary: Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D72410946

fbshipit-source-id: 7097e7bf6ac613adccce7fe1267fb70785f976b3
2025-04-04 03:21:08 -07:00
Joe Vilches 4b89096cda Fix tons of extra whitespace in OSS feature flag files (#50480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50480

The map in the script has an if in it checking for proper release channel. For feature flags that do not pass this if, they do not have an alternative return, so `map` just maps this to `undefined`. That means there is still an element in this array which gets joined by 2 new lines. As a result every new feature flag will add 2 new lines of white space making these files look rather silly.

Fix is to filter undefined out.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D72427349

fbshipit-source-id: 87e1d63c8854652296ce9160ab7171a948983d54
2025-04-03 23:53:13 -07:00
Jiawei Lü ad37783615 Back out "Fix nullsafe FIXMES for Task.java and mark nullsafe"
Summary:
The original diff caused some breakages.

Changelog: Backout [Android][Fixed] Made Task.java nullsafe

Differential Revision: D72433889

fbshipit-source-id: 53f7e730455ccaadde197a0f400fc6e834c1ffdd
2025-04-03 21:13:56 -07:00
generatedunixname89002005287564 725d9683b3 Fix CQS signal. Id] 31464309 -- modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni
Reviewed By: dtolnay

Differential Revision: D72376833

fbshipit-source-id: 68e5e4130914631442072a868b75c03260d80b35
2025-04-03 17:48:28 -07:00
Jorge Cabiedes Acosta e3f7c8f456 Fix <Image> components not being able to be set as focusable for Voice Over
Summary:
Image component was missing an override which enables setting accessibility values and properties.

The main issue is the lack of this prevented Image component from being accessed by VoiceOver.

Changelog: [iOS][Fixed] - Fixed accessible prop no-opts on Image components

Reviewed By: joevilches

Differential Revision: D72410952

fbshipit-source-id: 5612205aca1710fe4bfed6132efeb59065ebf0b3
2025-04-03 17:23:17 -07:00
Sam Zhou 70260f4d8b Replace $Rest in react-native
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D72413524

fbshipit-source-id: 2b9d2b5addb6660fd63ee8fe1a0e13d94cc1968f
2025-04-03 16:13:09 -07:00
David Vacca 793001a39b Unmark LegacyArchitecture from ReactContextBaseJavaModule
Summary:
Unmark LegacyArchitecture from ReactContextBaseJavaModule

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D72405195

fbshipit-source-id: 1ae96db72b5a1258e923ebbc9469eb0e9d6b13d1
2025-04-03 15:05:36 -07:00
David Vacca 7826dc379d Mark concrete classes of shadow node as @LegacyArchitecture
Summary:
Mark concrete classes of shadow node as LegacyArchitecture

These classes won't be included in legacy architecture apks

changelog: [internal] internal

Reviewed By: joevilches, mlord93, Abbondanzo

Differential Revision: D72351188

fbshipit-source-id: 4727cdd1486b2fafb87fe3b512440af3264ad189
2025-04-03 13:03:01 -07:00
Riccardo Cipolleschi ce7a602edf Add flag to turn off legacy warning (#50249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50249

This change introduces a flag to turn off the legacy architecture warning if they become too annoying.

The flag can be set in the Info.plist of the React Native architecture and it is controlled by the key: `RCTLegacyWarningsEnabled`.

* If the key is missing or with a value of `YES`, logs are enabled
* If the key has a value of `NO`, react native will not output any log.

We decided to use the Info.plist file to configure the logs because in that way it will work also with React Native prebuilds.

## Changelog:
[iOS][Added] - Add flag to enable or disable legacy warning.

Reviewed By: cortinico

Differential Revision: D71814001

fbshipit-source-id: b6ae6b032ff7add6bae3d73dba490adeaceffa1f
2025-04-03 12:22:17 -07:00
Riccardo Cipolleschi 8acc53da57 Add warning when a component is loaded with the interop layer (#50244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50244

This change adds warning to React Native whenever a component is loaded using the interop layer.

The warning is emitted only once per component.

## Changelog:
[iOS][Added] - Add warnings when components are loaded using the interop layer.

Reviewed By: cortinico

Differential Revision: D71808323

fbshipit-source-id: ce864f73c7789512d4e5e67368b5aa67f94e0570
2025-04-03 12:22:17 -07:00
Arushi Kesarwani 20a12f6025 Fixing Fabric Interop layer bug defaulting to UnstableLegacyViewManagerAutomaticComponentDescriptor irrespective of feature flag (#50441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50441

When useFabricInterop is disabled, deleting component descriptors in Component Registry is failing since  https://github.com/facebook/react-native/pull/47321 removed the Fabric Interop check from the ComponentDescriptorRegistry.cpp which was added earlier in https://github.com/facebook/react-native/pull/42294
Adding back the logic of Fallback component descriptor and error for the same.

Changelog:
[General][Fixed] Fixing Fabric Interop layer bug defaulting to UnstableLegacyViewManagerAutomaticComponentDescriptor irrespective of feature flags.

Reviewed By: javache

Differential Revision: D72266017

fbshipit-source-id: 1f3093d37dbe2b96ca26aa80c0a59d5c3026e9cf
2025-04-03 11:25:33 -07:00
Arushi Kesarwani 3fe24910c1 Altering useFabricInterop definition for handling Twilight + Fb4a (#50440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50440

Making the following changes to definition of `useFabricInterop` feature flag:

1. Changing default value to True for both internal and OSS.
2. Changing expected Release Value to false since aiming at disabling interop finally with new architecture strict mode.
3. Hence changed the `ossReleaseStage` from `canary` to `none`
4. Removing all existing over-rides of `useFabricInterop` to True now that the default is True itself.
5. Adding the over-ride to false for Facebook since that doesn't need the interop as is already in new architecture without interop mode.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72266336

fbshipit-source-id: ff16c5b9d0f39837706a86bd0d178a66a8f2e920
2025-04-03 11:25:33 -07:00
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
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
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
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