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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
This is not a TextInput and is totally unused (whoops).
Changelog: [Internal]
Reviewed By: cortinico, Abbondanzo
Differential Revision: D72683433
fbshipit-source-id: 1218701fdc473117774a9bdb6f94b6a4508599a4
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
```

And the new dev menu UI looks like this:

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-68ca53db74c7https://github.com/user-attachments/assets/407b8871-8b83-4a6b-a833-f87ddc0afc82
Reviewed By: huntie
Differential Revision: D69664231
Pulled By: cortinico
fbshipit-source-id: 5a339be50a17a59202416b99e72f4397d8ff4805
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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