Commit Graph

38536 Commits

Author SHA1 Message Date
Gijs Weterings 568ba647cf fix nullsafe FIXMEs for ReactHostImpl.java and mark nullsafe
Summary:
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 ReactHostImpl.java nullsafe

Reviewed By: cortinico

Differential Revision: D72384082

fbshipit-source-id: 999903b1bf98ea61d2431ace5ca6584535ca4857
2025-04-10 06:56:29 -07:00
Gijs Weterings 87accdfe47 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72384065

fbshipit-source-id: 0f1df2a870d1975b0c522a2e6a17e8959aab6c7c
2025-04-10 06:56:29 -07:00
Gijs Weterings 58b0755b80 remove stale NULLSAFE_FIXME comment
Summary:
this is no longer actionable/relevant

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72787458

fbshipit-source-id: 44eda9c7b461228ff66b31f8831b85d0d5650905
2025-04-10 06:50:15 -07:00
Fabrizio Cucci 32b1b7c2a0 Kotlinify JsonWriterHelper (#50619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50619

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72782158

fbshipit-source-id: f81b60a1a965efe82e065d7426d26f69fc84b321
2025-04-10 06:26:02 -07:00
Nicola Corti b4965fcfa6 Convert to Kotlin - BridgelessAtomicRef
Summary:
This diff converts to Kotlin the following file: BridgelessAtomicRef.java
as part of our ongoing effort of migrating the codebase to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D72777272

fbshipit-source-id: b6e10ce32b701614cb323adde7d3df2aa2a8f293
2025-04-10 04:50:45 -07:00
Alan Lee ca2b2aac60 Convert StateWrapperImpl.java to Kotlin (#50615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50615

Convert Java to Kotlin

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D72752437

fbshipit-source-id: 7c437087f161538ab20ce9d123d7526b98cf4d90
2025-04-10 03:17:02 -07:00
Devansh Saini 07a1fb8e6b Migrate FileReaderModule to kotlin (#50562)
Summary:
This PR aims to migrate FileReaderModule from Java to kotlin as part of https://github.com/facebook/react-native/issues/50513

## Changelog:

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

Pick one each for the category and type tags:

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

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID][CHANGED]Migrate FileReaderModule to Kotlin

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

Test Plan: Tested on RN tester with both new and old arch

Reviewed By: arushikesarwani94

Differential Revision: D72726333

Pulled By: cortinico

fbshipit-source-id: 130393373a258f18f8baaa96745da8fdebd62436
2025-04-10 02:55:06 -07:00
Fabrizio Cucci f21e61f4c5 Kotlinify TouchTargetHelper
Summary:
As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72716749

fbshipit-source-id: 2e3e7ff41e2706808b112347fedd370eb9048f1e
2025-04-10 02:06:35 -07:00
Mateo Guzmán e424a5739e Make TextTransform internal (#50599)
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.views.text.TextTransform).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.text.TextTransform internal

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

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

Reviewed By: mdvacca

Differential Revision: D72746912

Pulled By: arushikesarwani94

fbshipit-source-id: 7a5b0d4179f23f457c79194f043ce9189f17fce7
2025-04-09 19:43:17 -07:00
Jorge Cabiedes Acosta b47bfcef5f Fix border-radius with outline-offset
Summary:
This is not mentioned on the spec https://drafts.csswg.org/css-ui/#outline-offset but web adds the outline-offset to the border-radius of the outline. With this change now we render outline in this case like web

Related issue: https://github.com/facebook/react-native/issues/50582

Changelog: [General][Fixed] - Outline now takes into account outline-offset to calculate its border-radius, same as web.

Reviewed By: joevilches

Differential Revision: D72749009

fbshipit-source-id: b3cd39e09e7856b6ccd45aab541cd51f05559832
2025-04-09 18:53:51 -07:00
Phillip Pan cbad8aafa5 cleanup rn_ama_new_arch_ios.bridge_batch_did_complete_fix (#50598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50598

changelog: [ios][breaking] delete BridgeModuleBatchDidComplete config helpers

this is not used anywhere, cleanup

Reviewed By: srinathvijay

Differential Revision: D72692359

fbshipit-source-id: 42220a64be59bc0d32efe76c1f1d8fc4508a6b0e
2025-04-09 18:17:57 -07:00
Intl Scheduler 89bcbed1a5 translation auto-update for batch 2/58 on master
Summary:
Chronos Job Instance ID: 1125907957165630
Sandcastle Job Instance ID: 13510800658866748

Processed xml files:
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/systeminfo/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml
android_res/com/facebook/catalyst/shell/res/values/strings.xml
android_res/com/facebook/anna/app/res/values/strings.xml
android_res/com/facebook/anna/app/res/values/strings.xml
android_res/com/facebook/orca/res/values/strings.xml
android_res/com/facebook/workshared/userstatus/donotdisturb/res/values/strings.xml
android_res/com/facebook/widget/tokenizedtypeahead/res/values/strings.xml
android_res/com/facebook/widget/refreshableview/res/values/strings.xml
android_res/com/facebook/video/player/res/values/strings.xml
android_res/com/facebook/spherical/res/values/strings.xml
android_res/com/facebook/saved/common/res/values/strings.xml
android_res/com/facebook/facecast/common/badge/res/values/strings.xml
android_res/com/facebook/ui/emoji/res/values/strings.xml
android_res/com/facebook/stickers/res/values/strings.xml
android_res/com/facebook/feedbase/res/values/strings.xml
android_res/com/facebook/rtc/common/res/values/strings.xml
android_res/com/facebook/payments/ui/res/values/strings.xml
android_res/com/facebook/fig/mediagrid/res/values/strings.xml
android_res/com/facebook/pages/app/clicktomessengerads/messagesuggestion/ui/res/values/strings.xml
android_res/com/facebook/messagingneue/res/values/strings.xml
android_res/com/facebook/messaging/widget/toolbar/res/values/strings.xml
android_res/com/facebook/messaging/shared/res/values/strings.xml
android_res/com/facebook/messaging/ui/stickerstore/res/values/strings.xml
android_res/com/facebook/caspian/res/values/strings.xml
android_res/com/facebook/timeline/widget/actionbar/res/values/strings.xml
android_res/com/facebook/showpages/res/values/strings.xml
android_res/com/facebook/nux/res/values/strings.xml
android_res/com/facebook/messaging/users/username/res/values/strings.xml
android_res/com/facebook/messaging/tincan/messenger/res/values/strings.xml
android_res/com/facebook/messaging/res/values/strings.xml
android_res/com/facebook/messaging/threadview/quickpromotion/res/values/strings.xml
android_res/com/facebook/messaging/threadview/message/res/values/strings.xml
android_res/com/facebook/messaging/threadview/games/res/values/strings.xml
android_res/com/facebook/messaging/xma/res/values/strings.xml
android_res/com/facebook/messaging/threadview/admin/res/values/strings.xml
android_res/com/facebook/messaging/reactions/res/values/strings.xml
android_res/com/facebook/messaging/threadview/attachment/video/res/values/strings.xml
android_res/com/facebook/messaging/settings/res/values/strings.xml
android_res/com/facebook/messaging/searchnullstate/res/values/strings.xml
android_res/com/facebook/messenger/login/res/values/strings.xml
android_res/com/facebook/messaging/promotion/res/values/strings.xml
android_res/com/facebook/messaging/presence/res/values/strings.xml
android_res/com/facebook/messaging/polling/adminmessage/res/values/strings.xml
android_res/com/facebook/messaging/photos/view/res/values/strings.xml
android_res/com/facebook/messaging/omnipicker/res/values/strings.xml
android_res/com/facebook/messaging/media/res/values/strings.xml
android_res/com/facebook/messaging/livelocation/shared/res/values/strings.xml
android_res/com/facebook/messaging/permissions/res/values/strings.xml
android_res/com/facebook/messaging/invites/res/values/strings.xml
android_res/com/facebook/messaging/groups/threadactions/res/values/strings.xml
android_res/com/facebook/messaging/groups/nullstate/res/values/strings.xml
android_res/com/facebook/messaging/groups/admin/res/values/strings.xml
android_res/com/facebook/messaging/extensions/res/values/strings.xml
android_res/com/facebook/messaging/ephemeral/res/values/strings.xml
android_res/com/facebook/messaging/emoji/res/values/strings.xml
android_res/com/facebook/ui/emoji/common/res/values/strings.xml
android_res/com/facebook/messaging/customthreads/res/values/strings.xml
android_res/com/facebook/messaging/contacts/picker/res/values/strings.xml
android_res/com/facebook/messaging/search/picker/res/values/strings.xml
android_res/com/facebook/contacts/res/values/strings.xml
android_res/com/facebook/messaging/connectivity/res/values/strings.xml
android_res/com/facebook/messaging/composer/tooltips/res/values/strings.xml
android_res/com/facebook/messaging/composer/platformmenu/res/values/strings.xml
android_res/com/facebook/messaging/composer/botcomposer/quickreply/res/values/strings.xml
android_res/com/facebook/messaging/composer/botcomposer/res/values/strings.xml
android_res/com/facebook/messaging/composer/res/values/strings.xml
android_res/com/facebook/xapp/messaging/composer/audio/button/res/values/strings.xml
android_res/com/facebook/mig/button/close/res/values/strings.xml
android_res/com/facebook/messaging/composer/messagereply/res/values/strings.xml
android_res/com/facebook/messaging/communitymessaging/adminactions/mutememberoptions/composer/res/values/strings.xml
android_res/com/facebook/messaging/chatheads/menuitem/res/values/strings.xml
android_res/com/facebook/messaging/chatheads/res/values/strings.xml
android_res/com/facebook/messaging/banner/res/values/strings.xml
android_res/com/facebook/maps/common/res/values/strings.xml
android_res/com/facebook/lowdatamode/res/values/strings.xml
android_res/com/facebook/mig/dialog/alert/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/ui/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/whatsapplogin/tos/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/whatsapplogin/authconfirmation/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/whatsapplogin/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/login/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/owners/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/remotepairing/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/language/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/multilocaletext/res/values/strings.xml
android_res/com/facebook/alohacommon/remote/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/remotedfu/res/values/strings.xml
android_res/com/facebook/alohacommon/ui/player2/res/values/strings.xml
android_res/com/facebook/alohaapp/debug/res/values/strings.xml
android_res/com/facebook/alohaapp/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/postinstall/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/passcode/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/name/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/mounting/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/enterpriseinternal/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/enterprise/res/values/strings.xml
android_res/com/facebook/alohacommon/devicesetup/dayzeroota/res/values/strings.xml
android_res/com/facebook/ui/mainview/res/values/strings.xml
android_res/com/facebook/audience/stories/storysurface/activity/main/res/values/strings.xml

allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D72759811

fbshipit-source-id: a83fc3eb1a6191f8e8007f44ae07c58df27baa32
2025-04-09 17:56:33 -07:00
Sam Zhou 178febd0aa Replace $Diff with Omit in react-native (#50603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50603

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D72740500

fbshipit-source-id: 829a51dfbdb597fec8b3cca29364a67158a8dd2a
2025-04-09 17:38:01 -07:00
Gijs Weterings f86de9724b Mark ReactApplicationContext.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark ReactApplicationContext.java as nullsafe

Reviewed By: javache

Differential Revision: D72704847

fbshipit-source-id: cd6907630839a8be2a6fb1d0a673357aef1395fc
2025-04-09 14:49:39 -07:00
Gijs Weterings 8d72e5eeb9 Mark Inspector.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark Inspector.java as nullsafe

Reviewed By: javache

Differential Revision: D72704854

fbshipit-source-id: fcd15a3cc2e9ea1ed90ecca13c068188b859afac
2025-04-09 14:49:39 -07:00
Gijs Weterings bf911e1f92 Mark JavaScriptModuleRegistry.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark JavaScriptModuleRegistry.java as nullsafe

Reviewed By: javache

Differential Revision: D72704846

fbshipit-source-id: d1bca84cd2f4543e154ab8e7948821b176088d64
2025-04-09 14:49:39 -07:00
Gijs Weterings 9d21f97ebe Mark JSBundleLoader.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark JSBundleLoader.java as nullsafe

Reviewed By: javache

Differential Revision: D72704848

fbshipit-source-id: 7995bda8200fff96ff66e54eb503fee53f8a19dd
2025-04-09 14:49:39 -07:00
Gijs Weterings 12b22dc57c Mark JSONArguments.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark JSONArguments.java as nullsafe

Reviewed By: javache

Differential Revision: D72704849

fbshipit-source-id: a545bca24d4d95930f0e334c5295584e3c03c10c
2025-04-09 14:49:39 -07:00
Gijs Weterings 1e4d016950 Mark ModuleSpec.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark ModuleSpec.java as nullsafe

Reviewed By: javache

Differential Revision: D72704851

fbshipit-source-id: 4cccc70ac846f1aa90831557841d2e621847bfc4
2025-04-09 14:49:39 -07:00
Gijs Weterings 27179a7cf2 Mark ReactContextBaseJavaModule.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark ReactContextBaseJavaModule.java as nullsafe

Reviewed By: javache

Differential Revision: D72704852

fbshipit-source-id: 65abc94d59aefc64ff214bd70ead16d9011dec20
2025-04-09 14:49:39 -07:00
Gijs Weterings 911c11f129 Mark ReactMarker.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark ReactMarker.java as nullsafe

Reviewed By: javache

Differential Revision: D72704853

fbshipit-source-id: 2d022f407070ab473a43281fab6f28c53fa09f21
2025-04-09 14:49:39 -07:00
Gijs Weterings 005c11ea0a Mark NativeModule.java as nullsafe
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!

Changelog: [Android][Fixed] Mark NativeModule.java as nullsafe

Reviewed By: javache

Differential Revision: D72704850

fbshipit-source-id: a71f3acddb0382410739b9632fba509fffcfebfd
2025-04-09 14:49:39 -07:00
Nick Gerleman 9528872692 Delete RNTesterTextInput
Summary:
This is not a TextInput and is totally unused (whoops).

Changelog: [Internal]

Reviewed By: cortinico, Abbondanzo

Differential Revision: D72683433

fbshipit-source-id: 1218701fdc473117774a9bdb6f94b6a4508599a4
2025-04-09 13:26:01 -07:00
Andrew Datsenko 1dd6c84339 Move rncxx uimanager (#50593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50593

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D72577247

fbshipit-source-id: dff49be35556f9b899d6f6f696dc89cfa83e115b
2025-04-09 12:23:07 -07:00
Mateo Hrastnik d816ba0a70 Inject dev machine IP on Android and improve error message when connection fails (#49166)
Summary:
I've implemented a feature that automatically bundles the Metro Bundler's IP address into Android builds. This change aligns the Android development experience with iOS, allowing the app to maintain a connection to the Metro Bundler even when disconnected from USB.

Currently, in iOS builds, the IP address of the computer running the Metro Bundler is automatically bundled into the app, ensuring seamless connectivity even when the device is disconnected from USB. In contrast, Android developers must manually input the IP address if the USB connection is lost, which can be tedious and error-prone.

More info in discussion thread: https://github.com/react-native-community/discussions-and-proposals/issues/870

I anticipate that a change where making IP the default method of connection will result in a lot of people running into issues where they can't connect to Metro server (for example, if they're on a different network, or they disable wifi). So I also changed the default error message you get in case the app can't connect to the bundler and updated the "Change Bundle Location" dev menu.

The previous error message

```
Unable to load script. Make sure you're either
running Metro (run 'npx react-native start') or
that your bundle 'RNTesterApp.android.bundle' is
packaged correctly for release.
```

was changed to:

```
Unable to load script.

Make sure you're running Metro (npx react-native start)
or that your bundle 'RNTesterApp.android.bundle' is
packaged correctly for release.

The device must be on the same WiFi as your laptop to
connect to Metro.

To use USB instead, shake the device to open the dev
menu and set the bundler location to 'localhost: 8081'
and run:
  adb reverse tcp:8081 tcp:8081

```

![image](https://github.com/user-attachments/assets/f4002c7a-ff8a-4518-acf7-85af4257e05b)

And the new dev menu UI looks like this:
![image](https://github.com/user-attachments/assets/ecaf6922-f074-4db9-b723-c4b18ececd91)

The two buttons with "10.0.2.2:8081" and "localhost:8081" are suggestions which when tapped fill the input with the text from the button. The first button suggests the IP of the development machine, and the second one is hardcoded to localhost:8081.

## Changelog:

[ANDROID] [CHANGED] - Automatically use Metro bundler IP address when installing apps on Android

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

Test Plan:
I've tested the implementation on a physical device and on emulator and it's working solid. However, I would invite further testing in order to catch possible edge cases.

I've recorded common scenarios

Scenario 1:
	Device doesn't have the app installed.
	We connect the device via USB, install the app and open it.
	Device is on the same network as the dev machine.
	Bundler location is by default set to the IP of the dev machine.
	When starting app, the app is able to connect to the dev machine and download the bundle.

Scenario 2:
	Device doesn't have the app installed.
	Wi-Fi is turned off on the device but device is connected via USB
	We install the app and open it.
	Bundler location is by default set to the IP of the dev machine.
	When starting app, the app is not able to connect to the dev machine and shows the error message.
	After opening the dev menu we see that the IP is set to the IP of the dev machine.
	We click the "localhost" option in the dev menu and click apply
	After that the app is able to connect to the dev machine and download the bundle (via USB) since the traffic is forwarded using adb reverse.

Notes:
	When we set an IP in the dev menu, the app will persist it.
	If we connect the device via USB and reinstall the app the persisted data stays the same, so the previously set IP will be used.
	However, the IP of the dev machine will be displayed as an option in the dev menu.

https://github.com/user-attachments/assets/cc2da5d4-de07-4980-a61c-68ca53db74c7

https://github.com/user-attachments/assets/407b8871-8b83-4a6b-a833-f87ddc0afc82

Reviewed By: huntie

Differential Revision: D69664231

Pulled By: cortinico

fbshipit-source-id: 5a339be50a17a59202416b99e72f4397d8ff4805
2025-04-09 11:58:05 -07:00
Pieter De Baets d60a9c1c06 Export WITH_FBSYSTRACE and fbsystrace deps
Summary:
We only use fbsystrace API's directly from cxxreact and reactperferflogger targets, so export the dependency and the preprocessor flag there so we do not have to duplicate (and potentially forget to do this) from all other targets in react-native.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72704827

fbshipit-source-id: 845c174b4f9ce0a67dd80be3f6274234328bbdb9
2025-04-09 11:47:20 -07:00
Pieter De Baets 6e701ce080 Fix crash on arm32 when configuring eventEmitterCallback (#50592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50592

For unclear reasons this is crashing on some devices when dereferencing the module ref. Instead we can just access the existing global_ref to the module instance and avoid any deallocation timing issues.

Also added some additional safeguards and validation against incorrect JNI invocations.

Changelog: [Android][Fixed] Fix crash when TurboModule event emitters are used on arm32

Reviewed By: cortinico

Differential Revision: D72716972

fbshipit-source-id: 3803329048d8388b3d30c9cb55a857e399569eea
2025-04-09 11:10:31 -07:00
David Vacca 029d41dd13 Mark ReactVirtualTextViewManager as @LegacyArchitecture (#50595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50595

Mark ReactVirtualTextViewManager as LegacyArchitecture

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D72594213

fbshipit-source-id: 623ff2aa1712bea716d9c69c20ab8797abd08a6e
2025-04-09 10:41:50 -07:00
David Vacca a649100299 Use ReactNativeFeatureFlagsForTests in uimanager tests (#50594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50594

Some tests are failing due to unsatisfied error when looking for C++ classes of feature flags, we fix this by calling ReactNativeFeatureFlagsForTests.setup()

changelog: [internal] internal

Reviewed By: yungsters, sbuggay

Differential Revision: D72721786

fbshipit-source-id: c41c05428b1f99db9b03bb67cd9ddc47ebec84b5
2025-04-09 10:41:50 -07:00
Fabrizio Cucci 06ad33b511 Kotlinify TransformHelper
Summary:
As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72574855

fbshipit-source-id: b10e6e9d0c3dc5ae674d37c9c69b7748c77d09e1
2025-04-09 10:22:42 -07:00
Gijs Weterings 25f5b4aafc Actually mark DynamicFromArray.java as nullsafe
Summary:
Forgot to actually apply the annotation in the previous diff.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72703917

fbshipit-source-id: d8f1374ebb9e11e6d67ee23541da71f8cfbd1574
2025-04-09 10:21:57 -07:00
Rubén Norte 33f4d49dcf Add linting for markdown with markdownlint (#50591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50591

Changelog: [internal]

This implements linting for Markdown files in React Native via `markdownlint`. We already have Prettier support for Markdown, but this adds some missing functionality, especially validation of local links.

Reviewed By: cortinico

Differential Revision: D72649666

fbshipit-source-id: 5e2c369332b270850d6d04d8960e6ce717f5ba7a
2025-04-09 10:21:03 -07:00
Pieter De Baets 97ddd17e5e fix nullsafe FIXMEs for FabicUIManager.java and mark nullsafe [reland]
Summary:
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 FabricUIManager.java nullsafe

Reviewed By: cortinico

Differential Revision: D72705994

fbshipit-source-id: 56786a5df78322e833401c94dafae4e9335feefe
2025-04-09 09:31:31 -07:00
Gijs Weterings 623dcc3902 fix nullsafe FIXMEs for TextAttributeProps.java and mark nullsafe
Summary:
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 TextAttributeProps.java nullsafe

Reviewed By: rshest

Differential Revision: D72460127

fbshipit-source-id: b5b098d8763ed45579c50068033374dfc88afa86
2025-04-09 09:07:30 -07:00
Gijs Weterings ff7da1d6d8 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72460132

fbshipit-source-id: 4ff177555f4d035be82ec6a134227f9ed2076fb9
2025-04-09 09:07:30 -07:00
Gijs Weterings 1929ebd00e fix nullsafe FIXMEs for ReactTextViewManager.java and mark nullsafe
Summary:
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 ReactTextViewManager.java nullsafe

Reviewed By: javache

Differential Revision: D72460124

fbshipit-source-id: a75705ac4ab486ccaa9162dee5bfd8cae77967c7
2025-04-09 09:07:30 -07:00
Gijs Weterings e03607fa5f Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D72460133

fbshipit-source-id: 7673e962e50946b504e3bd9446b3aef962271241
2025-04-09 09:07:30 -07:00
Gijs Weterings 021491bf51 Fix nullsafe FIXMEs for ReactTextView.java and mark nullsafe
Summary:
https://developer.android.com/reference/android/widget/TextView#onFocusChanged(boolean,%20int,%20android.graphics.Rect)

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 ReactTextView.java nullsafe

Reviewed By: javache

Differential Revision: D72460125

fbshipit-source-id: b68c19dbb37f1f1f5a549fd979329ec9b32be9e3
2025-04-09 09:07:30 -07:00
Gijs Weterings 2a330e0112 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72460130

fbshipit-source-id: fbc073e7b644326e85a05227c1e2e72e3dd5b870
2025-04-09 09:07:30 -07:00
Gijs Weterings 3857aa8baf Fix nullsafe FIXMEs for ReactTextShadowNode and mark nullsafe
Summary:
https://developer.android.com/reference/android/text/BoringLayout#make(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int)

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 ReactTextShadowNode.java nullsafe

Reviewed By: javache

Differential Revision: D72460126

fbshipit-source-id: bcf2808ac0df3f33080924a31752e83cedf24ccf
2025-04-09 09:07:30 -07:00
Gijs Weterings 854cb6254d Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D72460128

fbshipit-source-id: 5165055b1023a9eab86b97ef6cdfa9553c063ec0
2025-04-09 09:07:30 -07:00
Gijs Weterings e04b5b3ecf fix nullsafe FIXMEs for ReactTextAnchorViewManager.java and mark nullsafe
Summary:
https://developer.android.com/reference/android/widget/TextView#setEllipsize(android.text.TextUtils.TruncateAt) explicitly allows setting setEllipsize's argument in TextView to null to turn off ellipsizing, which is what we want for `clip`

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 ReactTextAnchorViewManager.java nullsafe

Reviewed By: alanleedev

Differential Revision: D72460123

fbshipit-source-id: 26d91d273ead5906060772f65a32fbf4389d0db3
2025-04-09 09:07:30 -07:00
Gijs Weterings c174c11336 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D72460131

fbshipit-source-id: d2b82fe1abcfd828490820f31862339bce9785b6
2025-04-09 09:07:30 -07:00
Gijs Weterings dbb5a23cad fix nullsafe FIXMEs for ReactBaseTextShadowNode.java and mark nullsafe
Summary:
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 ReactBAseTeextShadowNode.java nullsafe

Reviewed By: alanleedev

Differential Revision: D72460122

fbshipit-source-id: 772b19016fa1558b549d73ad2b23f891ce2f57f6
2025-04-09 09:07:30 -07:00
Gijs Weterings 6409ed5ef4 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D72460134

fbshipit-source-id: b5e8864ddd7454ef23c5632dc2c8e502050dfe2b
2025-04-09 09:07:30 -07:00
Gijs Weterings af516266db fix nullsafe FIXMEs for ViewManagerRegistry.java and mark nullsafe
Summary:
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 ViewManagerRegistry.java nullsafe

Reviewed By: alanleedev

Differential Revision: D72384049

fbshipit-source-id: dbca38ee6379e2e64b37c1d265c001585344661d
2025-04-09 09:07:30 -07:00
Gijs Weterings 95f0ee6660 Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D72384050

fbshipit-source-id: ac88074a45752a5512daa09fce8c385b256b3d41
2025-04-09 09:07:30 -07:00
Gijs Weterings 02fc3bd58c fix nullsafe FIXMEs for TouchTargetHelper.java and mark nullsafe
Summary:
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 TouchTargetHelper.java nullsafe

Reviewed By: rshest

Differential Revision: D72384076

fbshipit-source-id: 344d93484cb465f4841256d302a6d9eec1467643
2025-04-09 09:07:30 -07:00
Gijs Weterings 01fb82343f Apply nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D72384058

fbshipit-source-id: 543da56ed4410625f17d143b127aa5cc882e0327
2025-04-09 09:07:30 -07:00
Gijs Weterings 552338ce9f fix nullsafe FIXMEs for ThemedReactContext.java and mark nullsafe
Summary:
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 ThemedReactContext.java nullsafe

Reviewed By: alanleedev

Differential Revision: D72384053

fbshipit-source-id: 39ce998cfce1de358f13b4f068f180dfd1d88378
2025-04-09 09:07:30 -07:00