Commit Graph

31218 Commits

Author SHA1 Message Date
Fabrizio Cucci 0e4aed1061 Kotlinify JSInstance (#43893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43893

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55791330

fbshipit-source-id: 5b5b687a126cfe9dc867032a45033f0cb70dc31d
2024-04-06 05:08:51 -07:00
Fabrizio Cucci d50f6ffd8e Kotlinify ReadableArray (#43899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43899

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55791026

fbshipit-source-id: 748da23474230ac6f7e48779ccd39058217202d5
2024-04-06 03:22:14 -07:00
Ramanpreet Nara 7facb32f30 Remove core modules from the default tmmdelegate (#43939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43939

## Problem
If we link the default tmmdelegate with our vr apps, we get this issue:

```
ld.lld: error: duplicate symbol: facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)
>>> defined at firsttimenux_v2AppModulesCodegen-generated.cpp:1367 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-codegen-modules-jni_cpp__/out/firsttimenux_v2AppModulesCodegen-generated.cpp:1367)
>>>            firsttimenux_v2AppModulesCodegen-generated.cpp.pic.o:(facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-jni__/libfirsttimenux_v2AppModulesCodegen-jni.pic.a
>>> defined at rncore-generated.cpp:606 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-codegen-modules-jni_cpp__/out/rncore-generated.cpp:606)
>>>            rncore-generated.cpp.pic.o:(.text._ZN8facebook5react27NativeDevLoadingViewSpecJSIC2ERKNS0_15JavaTurboModule10InitParamsE+0x0) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-jniAndroid__/librncore-jniAndroid.pic.a
```

## Cause
My best understanding of the problem:
- Default tmmdelegate links against rncore, which contains codegen for react native's standard library of modules.
- But, the default delegate also pulls in this appmodules.so library. That library also contains codegen for react native's standard library of modules + the app's modules.

So, two so libraries define the same symbols. Hence the build fails.

## Solution
Remove the codegen for react native's standard library of modules from the default tmmdelegate.

Prereq: In open source, also make appmodules.so include the codegen for react native's standard library of modules.

Changelog: [Android][Breaking] - Make the app responsible for returning core turbomodule jsi hostobjects

Reviewed By: cortinico

Differential Revision: D55613024

fbshipit-source-id: 6406a9f388ff9de01288de0e263a78a079e7a0da
2024-04-05 20:12:17 -07:00
Fabrizio Cucci a0d809cdd3 Kotlinify ViewGroupClickEvent (#43866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43866

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55749364

fbshipit-source-id: 184c43da537e550842cb9a675c525fa18cdee9f6
2024-04-05 17:00:47 -07:00
Fabrizio Cucci 93a2dd9545 Kotlinify Systrace (#43917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43917

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55796784

fbshipit-source-id: f793e94cee18af717b9de7a09ae8c478f2a3d5fe
2024-04-05 16:32:55 -07:00
Fabrizio Cucci 0ee40aac39 Kotlinify ReadableType (#43901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43901

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55790585

fbshipit-source-id: e3b539626d93d195809101826f3be74f1054f946
2024-04-05 16:28:23 -07:00
Fabrizio Cucci f4bafdd616 Kotlinify ModulusAnimatedNode (#43889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43889

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55767001

fbshipit-source-id: cec29691185f7f0b9fa99c8b0194e94af9fc5933
2024-04-05 16:22:49 -07:00
D N 0a0cd6517f chore: [TS] Remove tvParallaxProperties prop & add missing focusable, rejectResponderTermination props (#43912)
Summary:
I do TV developing using a RN, and found one missing prop in TS:

```tsx
<TouchableOpacity focusable={false} />
//                          ^^^ Error: Property focusable does not exist on type Readonly<TouchableOpacityProps>
```

Then I decides to compare Flow & TS types definitions and found more:

1.  `tvParallaxProperties` - [was removed](https://github.com/search?q=repo%3Afacebook%2Freact-native%20tvParallaxProperties&type=code) and never used in the runtime (but [`rn-tvos`](https://github.com/react-native-tvos/react-native-tvos/blob/92f73d1d7966dd41e3d8d9101a4e298e9462887b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js#L299) has own ver. of `TouchableOpacity`  & handle its types)
2. `focusable` is missing
3. `rejectResponderTermination` is missing

## Changelog:

[GENERAL] [REMOVED] - [TS] Remove `tvParallaxProperties` prop from `TouchableOpacity` & add missing `focusable`, `rejectResponderTermination` props

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

Test Plan: TypeScript tests were updated

Reviewed By: NickGerleman

Differential Revision: D55805520

Pulled By: javache

fbshipit-source-id: 5eb8c65857beb86361e74b9369a1739b1ae18190
2024-04-05 15:28:26 -07:00
Fabrizio Cucci 81b27c9204 Kotlinify WindowFocusChangeListener (#43906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43906

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: javache

Differential Revision: D55794517

fbshipit-source-id: 09301521494660b768633f23e60a55e5bea75dea
2024-04-05 14:16:41 -07:00
Fabrizio Cucci efb00077ae Kotlinify LinearCountingRetryPolicy (#43871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43871

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55753695

fbshipit-source-id: 4a46b02b2dd18981968371a94d2fa07af90fc74e
2024-04-05 14:14:06 -07:00
Fabrizio Cucci 7cffdf2d73 Kotlinify LayoutUpdateAnimation (#43890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43890

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55766128

fbshipit-source-id: a7f5fc653bd44ec7fc9f4995e82193d8b0d28660
2024-04-05 14:09:29 -07:00
Andrew Datsenko 092ed2fc21 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/sound:soundAndroid (#43860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43860

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/1239557953/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: cortinico

Differential Revision: D55725322

fbshipit-source-id: 8f78d221a8f04136019055a6ea64d8ec05bfd8a2
2024-04-05 14:08:53 -07:00
Fabrizio Cucci 5cf4f25d96 Kotlinify UnexpectedNativeTypeException (#43919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43919

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55796709

fbshipit-source-id: 68609954bd6dd8f9a9d81c243df86f6e1b8a0f0d
2024-04-05 14:07:09 -07:00
Fabrizio Cucci f6a8e4337f Kotlinify PointerEvents (#43876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43876

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55764512

fbshipit-source-id: 49f3eabf8064d39ced9d28f240e91cfdc8ab98c9
2024-04-05 14:04:56 -07:00
Nicola Corti 98a38cc1a7 Convert the whole com.facebook.react.views.text.internal.span package to Kotlin (#43923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43923

Another round of Kotlin migration.
This time I'm doing `com.facebook.react.views.text.internal.span` which has been recently been annotated as `Nullsafe`

Changelog:
[Internal] [Changed] - Convert the whole `com.facebook.react.views.text.internal.span` package to Kotlin

Reviewed By: tdn120

Differential Revision: D55802155

fbshipit-source-id: 4bed023557f45a43d921df73dfc685e547788fd4
2024-04-05 13:59:21 -07:00
Nicola Corti 47a00f97d8 Migrate AndroidUnicodeUtils to Kotlin (#43929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43929

Migrate AndroidUnicodeUtils to Kotlin

Changelog:
[Internal] [Changed] - Migrate AndroidUnicodeUtils to Kotlin

Reviewed By: tdn120

Differential Revision: D55804037

fbshipit-source-id: 932fd08e3d826ddf131c74f8b4722732cd9ac46a
2024-04-05 13:55:48 -07:00
Fabrizio Cucci 2aef4418ea Kotlinify NativeGestureUtil (#43867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43867

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55750840

fbshipit-source-id: 356828e6fc9c1b4c77e130cce281e5503ffb0d16
2024-04-05 13:54:51 -07:00
Fabrizio Cucci d5dcaf3c1e Kotlinify DispatchStringCommandMountItem (#43870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43870

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55752447

fbshipit-source-id: 1965cc39601f514d0664d4d73bff4546f7c0f170
2024-04-05 13:47:44 -07:00
Fabrizio Cucci 3f05ad6e8e Kotlinify DispatchIntCommandMountItem (#43868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43868

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55751796

fbshipit-source-id: 60349c63c11c27bb4049f41ae43bb84bd3090c21
2024-04-05 13:44:59 -07:00
Fabrizio Cucci 0c2d4d3fb8 Kotlinify LifecycleEventListener (#43897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43897

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55790235

fbshipit-source-id: 9e1132304238137154467deeb96666abf537024f
2024-04-05 13:44:24 -07:00
Nicola Corti 2f46e1ac72 Move libreact_cxxreactpackage.so to INTERFACE library (#43930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43930

We don't need `libreact_cxxreactpackage.so` as there is nothing to load. I'm moving this to be an INTERFACE library as there is only a Header file now to load.
Move libreact_cxxreactpackage.so to INTERFACE library

Changelog:
[Internal] [Changed] - Move libreact_cxxreactpackage.so to INTERFACE library

Reviewed By: javache

Differential Revision: D55805573

fbshipit-source-id: 9ef99c430c19250439b8ace5d26b0984a8fb759e
2024-04-05 12:19:22 -07:00
Nicola Corti d45b843398 Fix crash of RNTester on back navigation (#43931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43931

RN Tester is crashing on back navigation with this stacktrace:

```
04-05 17:14:22.906 25051 25051 E AndroidRuntime: FATAL EXCEPTION: main
04-05 17:14:22.906 25051 25051 E AndroidRuntime: Process: com.facebook.react.uiapp, PID: 25051
04-05 17:14:22.906 25051 25051 E AndroidRuntime: java.lang.NullPointerException: Parameter specified as non-null is null: method com.facebook.react.devsupport.DoubleTapReloadRecognizer.didDoubleTapR, parameter view
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.devsupport.DoubleTapReloadRecognizer.didDoubleTapR(Unknown Source:2)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactDelegate.shouldShowDevMenuOrReload(ReactDelegate.java:302)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactActivityDelegate.onKeyUp(ReactActivityDelegate.java:158)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.facebook.react.ReactActivity.onKeyUp(ReactActivity.java:89)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.KeyEvent.dispatch(KeyEvent.java:2878)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.app.Activity.dispatchKeyEvent(Activity.java:4164)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:126)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:404)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6377)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6243)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5946)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6104)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3159)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2723)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2714)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3136)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.MessageQueue.nativePollOnce(Native Method)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.MessageQueue.next(MessageQueue.java:335)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:161)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7842)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
04-05 17:14:22.906 25051 25051 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
```

This is happening because the `view: View` parameter is actually null at that point. I'm fixing it.

Changelog:
[Internal] [Changed] - Fix crash of RNTester on back navigation

Reviewed By: tdn120

Differential Revision: D55805574

fbshipit-source-id: 368109ef70725dad2cf72789b259726f859f05b8
2024-04-05 12:19:22 -07:00
Nicola Corti f14746f48b Fix broken HermesExecutor compilation (#43932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43932

Converting to Kotlin the `RuntimeConfig` class caused the project to stop compiling.

Changelog:
[Internal] [Changed] - Fix broken HermesExecutor compilation

Reviewed By: tdn120

Differential Revision: D55805572

fbshipit-source-id: bc53c91280d65ecaf2605009b17045200669f240
2024-04-05 12:19:22 -07:00
Andrew Datsenko 0a7984435f //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/devtoolssettings:devtoolssettingsAndroid (#43922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43922

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725626

fbshipit-source-id: 1cb1ced5adab5c3c20f12ae0783d1f01d73b4829
2024-04-05 12:16:55 -07:00
Andrew Datsenko 13432b5d8c //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/reactperflogger:reactperfloggerAndroid (#43872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43872

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55725695

fbshipit-source-id: bdb9112203c744b59e74bb099f8a994e3a8b8dbe
2024-04-05 11:53:25 -07:00
Andrew Datsenko dc8b7f8322 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/vibration:vibrationAndroid (#43918)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43918

Changelog: [Internal]
_____

## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.

## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.

## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)

See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)

_____

## Questions / Comments / Feedback?

**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

_____

## Codemod Metadata

NOTE: You won't need to read this section to review this diff.

https://www.internalfb.com/intern/sandcastle/job/1239558926/

|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|

Rules run:
- CodemodTransformerFBSourceScript

This diff was created with [CodemodService](https://fburl.com/CodemodService).

Reviewed By: javache

Differential Revision: D55725326

fbshipit-source-id: f0960e42cf248ea78613299c16c6a47aa6169c7a
2024-04-05 11:46:39 -07:00
Fabrizio Cucci 49ea2a43c2 Kotlinify NativeArrayInterface (#43892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43892

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55789985

fbshipit-source-id: 5523012a66179b2a35cc046c948bfd4f7cccf200
2024-04-05 11:21:33 -07:00
Nicola Corti ed4106736a Convert ReactModalHostManager to Kotlin (#43844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43844

This converts the last class inside `com.facebook.react.views.modal` to Kotlin

Changelog:
[Internal] [Changed] - Convert ReactModalHostManager to Kotlin

Reviewed By: javache

Differential Revision: D55739386

fbshipit-source-id: 6bf85449c2bfd6d81a2d899bd044835b9b72c185
2024-04-05 11:12:02 -07:00
Nicola Corti ab44550f6e Convert ReactModalHostView to Kotlin (#43845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43845

This class is quite legacy and requires a couple of eyes before merging it.
I've tested that modals are working fine on RN-Tester both Old & New Arch.

Changelog:
[Internal] [Changed] - ReactModalHostView to Kotlin

Reviewed By: javache

Differential Revision: D55739128

fbshipit-source-id: 740d24df39ceb7b6a8120ae5315cf0684d1e6e27
2024-04-05 11:12:02 -07:00
Nicola Corti 20c1cc5e65 Bump AGP from 8.2.1 to 8.3.1 (#43925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43925

Another diff to keep our dependencies updated.

Changelog:
[Internal] [Changed] - Bump AGP from 8.2.1 to 8.3.1

Reviewed By: cipolleschi

Differential Revision: D55803537

fbshipit-source-id: f94512799f5d32c667520cd11b8db38c93485ab7
2024-04-05 10:14:42 -07:00
Nicola Corti acd6d154e5 Bump Kotlin to 1.9.23 (#43928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43928

This is a patch version for Kotlin, no practical changes expected.

Changelog:
[Internal] [Changed] - Bump Kotlin to 1.9.23

Reviewed By: cipolleschi

Differential Revision: D55803534

fbshipit-source-id: 99fcf444885cbc7b95baec2983303cfee88874a6
2024-04-05 10:14:42 -07:00
Nicola Corti ca7cc32288 Bump Gradle to 8.7 (#43926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43926

Just keeping our dependencies up-to-date.

Changelog:
[Internal] [Changed] - Bump Gradle to 8.7

Reviewed By: cipolleschi

Differential Revision: D55803535

fbshipit-source-id: 90bc2902d8692f1fa621a088189f6bae74c3c61f
2024-04-05 10:14:42 -07:00
Nicola Corti 854c57c3e8 Bump SoLoader to 0.11.0 in OSS (#43924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43924

Just keeping our dependecies up to date.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.11.0 in OSS

Reviewed By: cipolleschi

Differential Revision: D55803536

fbshipit-source-id: a1bea4d53c325db3f56986b08e3f3963c75f2269
2024-04-05 10:14:42 -07:00
Fabrizio Cucci 33a1794755 Kotlinify RuntimeConfig (#43891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43891

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55788661

fbshipit-source-id: 1da14b556c013d679a671ae78671df690ebd9326
2024-04-05 08:42:22 -07:00
Nicola Corti 03c75c22fa Rename reactnative.a -> react_cxxreact.a (#43859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43859

This frees up the `reactnative` CMake target so we could use it as single .so
for the CMake build.

Changelog:
[Internal] [Changed] - Rename reactnative.a -> react_cxxreact.a

Reviewed By: javache

Differential Revision: D55745640

fbshipit-source-id: 3cad512cc07a277af2a0cea696863c85a17dabc1
2024-04-05 08:02:35 -07:00
Riccardo Cipolleschi 041bca4227 do not force CMake version for windows (#43916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43916

build_hermesc_windows is starting to fail because version 3.14.7 is [not available anymore](https://app.circleci.com/pipelines/github/facebook/react-native/44621/workflows/0c7d3474-ddf4-4138-bdbc-3fec59486f6c/jobs/1452518?invite=true#step-108-735_84) on chocolatey. By removing the version, the system should try to download the latest available.

## Changelog:
[Internal] - use the latest cmake on chocolatey for windows

Reviewed By: cortinico

Differential Revision: D55799078

fbshipit-source-id: d33a3a5f2c45c05e86a0cdf775ed820df5f8b9d4
2024-04-05 07:49:56 -07:00
Thomas Nardone 8c0b5df05a Convert systrace module (#43877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43877

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D55765258

fbshipit-source-id: 1582500d73239064272f567f183f6f6f406d815d
2024-04-05 07:37:15 -07:00
Nicola Corti bc832ca3aa Fix Android instacrashing on JSC with NoSuchMethodException (#43907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43907

JSC is currently instacrashing because we missed a JvmStatic.
Android will attempt to load JSCInstance.initHybrid which is missing unless we specify JvmStatic.

Changelog:
[Internal] [Changed] - Fix Android instacrashing on JSC with NoSuchMethodException

Reviewed By: GijsWeterings

Differential Revision: D55795290

fbshipit-source-id: 5d10344e3f481dc5832706d77ccf2bf163dfb30f
2024-04-05 05:25:31 -07:00
Dmitry Rykun d6c21495f7 Print Hermes build script shell commands only in CI (#43767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43767

Print Hermes build script shell commands only in CI.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55635527

fbshipit-source-id: f0a901e11c523987e97a28b5238dcc08586516dd
2024-04-05 05:08:25 -07:00
Riccardo Cipolleschi 627bff2c38 Remove duplicated include when preparing prefabs (#43865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43865

Some of the includes in the task that prepares prefabs are duplicated. Removing the duplication

## Changelog:
[Internal] - Cleanup android prefabs

Reviewed By: cortinico

Differential Revision: D55751660

fbshipit-source-id: 2ea610937f122f82bc91e09fac1a2c78efa83410
2024-04-05 01:18:05 -07:00
Soe Lynn d2a8222bc6 Back out "Update useNativeViewConfigsInBridgelessMode" (#43883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43883

Changelog: [Internal]

Backing out original diff `D55705805` to fix CircleCI Dynamic library test failure

Reviewed By: philIip

Differential Revision: D55773581

fbshipit-source-id: 2ec1b82241389166c1c31c979106c4ee6ead83fe
2024-04-04 23:03:47 -07:00
Soe Lynn b5db214d2a Deprecate RedBox from RCTBridge to RCTModuleRegistry (#43717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43717

As we are going to bridgeless in new architecture, we want to clean up the usage of RCTBridge to use RCTModuleRegistry to access NativeModule.

Changelog:
[iOS][Breaking] Remove `RCTRedBox` access through `RCTBridge`

Reviewed By: philIip

Differential Revision: D55532209

fbshipit-source-id: 62aa2a24b60ab54d7f3cf25c34beda4449aaeaed
2024-04-04 20:27:32 -07:00
Alan Lee bf1a5d4934 convert ViewUtil to Kotlin (#43799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43799

convert Java to Kotlin: `/react/uimanager/common/ViewUtil.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55651762

fbshipit-source-id: 26896a41df8efec9fa032f0e16e3e50342dd54f8
2024-04-04 18:30:57 -07:00
Thomas Nardone fd3ef7b692 Avoid !! in ResourceDrawableHelper.kt (#43820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43820

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55701291

fbshipit-source-id: afdce3ffa59bc488d6c36d78a8cf3176089599ba
2024-04-04 15:00:41 -07:00
Samuel Susla 70c3158b64 delete unused trait: AndroidMapBufferPropsSupported (#43787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43787

changelog: [internal]

This is not used. Let's delete it.

Reviewed By: fabriziocucci

Differential Revision: D55485422

fbshipit-source-id: 13c2e75aa384810ad07c055cedb3bb18f30b8378
2024-04-04 13:08:11 -07:00
Alan Lee 445c9ce806 convert LayoutMetricsConversions to Kotlin (#43863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43863

convert Java to Kotlin: `react/fabric/mounding/LayoutMetricsConversions.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55714004

fbshipit-source-id: fbf167cb6030916789f6676c1bd0690f144cf330
2024-04-04 13:07:26 -07:00
Fabrizio Cucci c84faadd50 Kotlinify DoubleTapReloadRecognizer (#43862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43862

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: andrewdacenko

Differential Revision: D55747942

fbshipit-source-id: 07376f5ca2790d1656903cd03705f32c2050a589
2024-04-04 12:36:06 -07:00
Fabrizio Cucci 0132142446 Kotlinify ReactUnimplementedView (#43828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43828

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55709336

fbshipit-source-id: 714e6d806cfe7ff4a2979e896201b640de4f5182
2024-04-04 12:33:18 -07:00
Fabrizio Cucci e36baddff7 Kotlinify NoRetryPolicy (#43831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43831

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708871

fbshipit-source-id: c557743bf35cd27559fe8365025ca071bef57701
2024-04-04 12:33:18 -07:00
Fabrizio Cucci 06a3028694 Kotlinify SimpleViewManager (#43834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43834

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708429

fbshipit-source-id: ff76e5dc2e8c6d99b7792ed58e8bcd5e1441b2dd
2024-04-04 12:30:49 -07:00