Commit Graph
678 Commits
Author SHA1 Message Date
Stewart Sum 3dbb759506 Convert Java tests for JSDebuggerWebSocketClient to Kotlin (#38941)
Summary:
Migrate Java tests to Kotlin for the JSDebuggerWebSocketClient class.

## Changelog:

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Update Java tests to Kotlin for the referenced file

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

Test Plan: All unit tests passed.

Reviewed By: mdvacca, rshest

Differential Revision: D48354172

Pulled By: cortinico

fbshipit-source-id: e8d3c98216b4e2c3ff462433c7e37d628d06f0c6
2023-08-18 05:22:09 -07:00
Nick Gerleman 5d47bad74f Fix segfault calling YGJNILogFunc (#39051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39051

X-link: https://github.com/facebook/yoga/pull/1344

`YGJNILogFunc` has a bug where it uses a `va_list` to determine the length of a printf string, then reuses the same `va_list` later after it has already been iterated through. Even if no arguments are present, this may cause a crash looking something like:

```
C  [libsystem_platform.dylib+0xf12]  _platform_strlen+0x12
C  [libsystem_c.dylib+0x31bf]  __vfprintf+0x1339
C  [libsystem_c.dylib+0x307ce]  _vsnprintf+0x100
C  [libsystem_c.dylib+0x6965]  vsnprintf+0x44
C  [libyoga.dylib+0x5161]  YGJNILogFunc(YGConfig*, YGNode*, YGLogLevel, void*, char const*, __va_list_tag*)+0x59
```

Fixing this fixes crashing unit tests which are not explicitly disabled.

Reviewed By: yungsters

Differential Revision: D48388548

fbshipit-source-id: 492e7a89aeb5f9d15485ce31641875a295356bef
2023-08-18 00:07:51 -07:00
Zeya Peng 915e9bd227 executeMount: declare ternary fallback value beforehand (#38991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38991

Changelog: [Internal]

Reviewed By: jlhe97, sammy-SC

Differential Revision: D48198573

fbshipit-source-id: 222beb27f4648750877fd6b42904b7b3eab5c9ce
2023-08-17 13:48:51 -07:00
Thiago Brezinski 4a48fd2bb5 Convert ReactPropConstantsTest to Kotlin (#39005)
Summary:
Converts ReactPropConstantsTest to Kotlin, as requested in https://github.com/facebook/react-native/issues/38825

## 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
-->

[INTERNAL] [CHANGED] - Convert ReactPropConstantsTest to Kotlin
[INTERNAL] [CHANGED] - Add null-check to ViewManagersPropertyCache.java

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

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: mdvacca, rshest

Differential Revision: D48430460

Pulled By: cortinico

fbshipit-source-id: cc425f14bf15ec6e5a334c631d52ca962d06a2a9
2023-08-17 11:02:29 -07:00
Fábio Henriques 10feddcf03 Convert MatrixMathHelperTest to Kotlin (#39046)
Summary:
This PR converts `MatrixMathHelperTest.java` to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/38825).

## Changelog:

[INTERNAL] [CHANGED] - Convert MatrixMathHelperTest to Kotlin

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

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: mdvacca

Differential Revision: D48430157

Pulled By: cortinico

fbshipit-source-id: d371e6958a561797ffd8f9e14382a144f82f105e
2023-08-17 10:35:58 -07:00
Intl Scheduler d1e2cbb4b3 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940152907
Sandcastle Job Instance ID: 1024566126
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48431884

fbshipit-source-id: e6eb7f6002121abe6c7dea907b55fce4875d1bf7
2023-08-17 06:09:52 -07:00
Arushi Kesarwani aafbe7a458 Fixing getSurfaceHandler() to package in ReactSurface (#39029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39029

Reducing visibility of `getSurfaceHandler()` in ReactSurface

changelog: [internal] internal

Reviewed By: luluwu2032

Differential Revision: D48376643

fbshipit-source-id: 6e0873372d96435cc5a3b8baa54b1b592e7327c4
2023-08-16 21:23:56 -07:00
Arushi Kesarwani 8fa19abd71 Refactor ReactSurfaceImpl.detach() (#39050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39050

Adding `detach()` to the interface `ReactSurface`

changelog: [internal] internal

Reviewed By: mdvacca

Differential Revision: D48377508

fbshipit-source-id: 210bd39ae96f0bce4d929afbc985811fe0cc0aa2
2023-08-16 17:46:24 -07:00
Kolin Krewinkel 02408e1df2 Override canScrollHorizontally() to expose when scrolling is disabled
Summary:
**Context**
We have a bug where a ReactHorizontalScrollView is set to scrollEnabled = false. However, it still has a "scrollable width." When other components evaluate how to handle touches, they assume this view wants it...but `onInterceptTouch()` will return NO. To fix this in the most generic way and without making the other code aware of this class, I'm overriding `View.canScrollHorizontally()`.

**Notes**
- I also considered making the other code invoke onInterceptTouch(), but I don't want to have non-OS code invoking that and messing up state. The order of the input events matters.
- The [docs explicitly state](https://developer.android.com/reference/android/view/View#canScrollHorizontally(int)) "this is without regard to whether the view is enabled or not, or if it will scroll in response to user input or not"
  - I'm not so sure this is useful.
  - Other Android OS classes disregard it. :)
    - https://cs.android.com/android/platform/superproject/+/master:packages/apps/Messaging/src/com/android/messaging/ui/PagingAwareViewPager.java;l=91?q=%20canScrollHorizontally%5C(&start=21
    - https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/src/com/android/systemui/qs/NonInterceptingScrollView.java;l=107?q=canScrollHorizontal

Reviewed By: NickGerleman

Differential Revision: D48343681

fbshipit-source-id: 4e133bc5509f68efdf510115f26aa56cfa115d94
2023-08-16 13:28:17 -07:00
giolaq 35b913017b Migrated UIManagerModuleConstantsTest.java to UIManagerModuleConstant… (#38994)
Summary:
This PR converts UIManagerModuleConstantsTest.java into Kotlin as requested in [https://github.com/facebook/react-native/issues/38825](https://github.com/facebook/react-native/issues/38825)

## Changelog:

[INTERNAL] [CHANGED] - Convert to UIManagerModuleConstantsTest.java to UIManagerModuleConstantsText.kt

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

Test Plan:
```./gradlew :packages:react-native:ReactAndroid:test``` must pass and CI must be green

<img width="1297" alt="Screenshot 2023-08-14 at 17 43 14" src="https://github.com/facebook/react-native/assets/2865799/13a9c2b0-3f47-48da-b663-87e2cb652c69">

Reviewed By: mdvacca, rshest

Differential Revision: D48387980

Pulled By: cortinico

fbshipit-source-id: d5ab3f9a4ada2d0442daecb6c893458d9baa7558
2023-08-16 12:16:03 -07:00
Samuel Susla 492c9d1041 Fix condition to detect use of Paper renderer in TextInput on Android
Summary:
changelog: [internal]

In D47993140 I removed FabricViewStateManager but made a mistake during refactoring in one of the conditions that detects if we are in paper or fabric.. This fixes it.

Reviewed By: cipolleschi

Differential Revision: D48390478

fbshipit-source-id: ff6e728f3eaae755b2200e9cd8edd3acdc4708aa
2023-08-16 10:07:33 -07:00
Intl Scheduler 61255a3013 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940106395
Sandcastle Job Instance ID: 4503600647715906
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48391625

fbshipit-source-id: 30cd0bc7e26fa433a690d465c97c125b751e97f5
2023-08-16 05:38:06 -07:00
Rubén Norte 0ba9808c88 Fix NullPointerException when reporting mounts for mount hooks (#39022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39022

Fixes a possible NullPointerException thrown when trying to access the binding after the instance has been destroyed to report mounts.

I added a check for the mount item just in case 😅

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D48355738

fbshipit-source-id: 401d2e0a52b0764ed89498ecc0176d160226e509
2023-08-16 04:38:47 -07:00
Xin Chen 50638714f5 Add init react runtime start time in performance API (#38858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38858

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

This diff adds the two extra markers `initializeRuntimeStart` and `initializeRuntimeEnd` to the startup performance API. The runtime start time matches the existing android marker `GET_REACT_INSTANCE_MANAGER_START`, which is the first marker we have on the RN android app.

Changelog:
[Android][Added] - Add `performance.reactNativeStartupTiming.initializeRuntimeStart` and `performance.reactNativeStartupTiming.initializeRuntimeEnd` API

Reviewed By: rshest

Differential Revision: D47941110

fbshipit-source-id: d7e65f822f1c60a46dccacc8fd5bba84174f9f31
2023-08-15 18:51:07 -07:00
Vincent Viego 8cfd80f52c Default to AsynchronousBatched priority (#39011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39011

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D48210134

fbshipit-source-id: aac2aec11c35dd6a47bc8fd4bf74f2fa00ab3d7e
2023-08-15 18:31:31 -07:00
Yasin Çidem 66d6384d4d Kotlinify ReactTextInputPropertyTest class (#38981)
Summary:
This PR converts ReactTextInputPropertyTest.java to Kotlin. https://github.com/facebook/react-native/issues/38825
## Changelog:
[INTERNAL] [CHANGED] - Kotlinify ReactTextInputPropertyTest.java
<!-- 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

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

Test Plan:
`./gradlew :packages:react-native:ReactAndroid:test` must pass

### Screenshot
<img width="40%" alt="image" src="https://github.com/facebook/react-native/assets/13544246/456622f0-2260-47c3-ada7-725c59ecbc09">

### FYI:

https://github.com/facebook/react-native/blob/ae88aef12c755d61a821ccf98ebb4b75f7c2dfc9/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.java#L385

**testSelection** function removed because selection prop removed from ReactTextInputManager.java https://github.com/facebook/react-native/commit/84a1cacfa5cdaf484b93d1d9402c65d0c7084fad

Reviewed By: yungsters

Differential Revision: D48351651

Pulled By: cortinico

fbshipit-source-id: 750668dbc409f08827eff1f11886b3d12c3b240c
2023-08-15 15:20:40 -07:00
David Vacca 3b43d56f38 Ez refactor in NetworkingModule (#38970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38970

Ez refactor in NetworkingModule to remove to lint warns

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D48275729

fbshipit-source-id: a0fb66ebeeee1b8360bd6ab3d3be6c8626f2faab
2023-08-15 12:26:12 -07:00
Riccardo Cipolleschi 540c41be91 Publish dSYM to Maven when doing a release (#38992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38992

This Diff publishes the Hermes dSYMs to Maven while doing a release.
These were missing and so the Stack traces can't be fully symbolicated when a crash occurs.

## Changelog:
[Internal] - Publish dSYM to Maven

Reviewed By: cortinico

Differential Revision: D48309198

fbshipit-source-id: a5514e544587daadd0a0d7614f25a30fccd16a5b
2023-08-15 03:48:47 -07:00
Samuel Susla 3fb94e7c13 Delete FabricViewStateManager (#38958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38958

changelog: [internal]

This is an unnecessary abstraction, let's remove it.

It originally served as a retry mechanism for C++ state update but it no longer serves that purpose. It obscures visibility into StateWrapper state.

jest_e2e[run_all_tests]

Reviewed By: mdvacca, luluwu2032

Differential Revision: D47993140

fbshipit-source-id: 81e81153d2de90f69d1495b14db66ee66670ba0f
2023-08-15 02:42:27 -07:00
Alex Hunt fdcb94ad13 Upgrade CLI and Metro, update status check refs (#38988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38988

- Upgrade to RN CLI `12.0.0-alpha.9`, including Metro bump to `0.78.0`.
- Update test scripts, since this CLI release made a breaking change to the `/status` response.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D48311214

fbshipit-source-id: bb0be3c32edb629355b9fbbd754b28f9878f47ef
2023-08-15 02:33:22 -07:00
Nicola Corti 913e92737e Bump Mockito to 3.x and remove PowerMock (#38924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38924

## The Problem
We're currently compiling React Native with two JDK, 11 and 17.
This is necessary as we use PowerMock to mock static classes in our tests. PowerMock is effectively unmaintained and is preventing us from using only JDK 17.
Using two JDKs requires a bigger docker container and leads to build failures when contributors try to contribute to RN so we should be moving to use only a single JDK (also we can expect Google to bumpthe requirement to JDK 21 at some point in the future).

## The Solution
Practically, Mockito 3 offers the same capabilities that PowerMock offers.
I've removed PowerMock from our codebase and bumped Mockito to 3.

I've verified that all the un-ignored tests are green both with Gradle and Buck.
I've updated the Ignore-d tests to don't use PowerMock (as the project won't compile otherwise).
When we un-suppress them we will have to make sure everything works.
I've also left some TODOs referencing the old code for the future.

Changelog:
[Internal] [Changed] - Bump Mockito to 3.x and remove PowerMock

Reviewed By: cipolleschi

Differential Revision: D48228603

fbshipit-source-id: 5d4af902d813f347f19fc17361d53a73b685544d
2023-08-13 23:31:22 -07:00
Nicola Corti 1a765b6d08 Cleanup and scope all the Gradle Properties (#38885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38885

We do have several Gradle Properties that are used to configure the build.

I've refactored them all and moved them inside the PropertyUtils file:
https://github.com/facebook/react-native/blob/main/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt

Specifically properties should be 'scoped' under `react.` if public, and `react.internal.` if for internal usage.

Property that I cleaned up are:
- REACT_NATIVE_MAVEN_LOCAL_REPO becomes react.internal.mavenLocalRepo
- REACT_WINDOWS_BASH becomes react.internal.windowsBashPath
- GROUP becomes react.internal.publishingGroup

I've also added support for scoping for public properties with backward compat (so both the scoped and unscoped properties are accepted):
- react.newArchEnabled
- react.hermesEnabled
- react.nativeArchitectures

Changelog:
[Android] [Changed] - Cleanup and scope all the Gradle Properties

Reviewed By: mdvacca

Differential Revision: D48188310

fbshipit-source-id: 1a92d31105270a4c2f80029b7d36bcb33916d0fb
2023-08-13 23:11:29 -07:00
Intl Scheduler 0279a7074e translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907939833620
Sandcastle Job Instance ID: 18014399528190591
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48302683

fbshipit-source-id: 0d1d54cef22427c5f91e40b57fb53a4385197d39
2023-08-13 13:15:51 -07:00
Intl Scheduler dea9c35016 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907939160894
Sandcastle Job Instance ID: 27021598779145631
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48271626

fbshipit-source-id: d1850c35297ea3c2af7f74d24ee19f77162341ac
2023-08-11 10:08:27 -07:00
Nicola Corti 27aa60a1c0 Consoliate Native deps version inside the Version Catalog (#38945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38945

Another pass of moving version numbers into a single place.
This time I've moved all the native dependencies from gradle.properties to the version catalog

Changelog:
[Internal] [Changed] - Consoliate Native deps version inside the Version Catalog

Reviewed By: cipolleschi

Differential Revision: D48263910

fbshipit-source-id: 0743908282dc658e2da347052e3b721704859f12
2023-08-11 09:31:40 -07:00
Nicola Corti d655d44532 Consoliate Android SDK version inside the Version Catalog (#38949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38949

I've done another pass and moved all the compileSdk/minSdk/targetSdk and buildToolVersion in a single place so that we can easily bump one for all the projects.

Changelog:
[Internal] [Changed] - Consoliate Android SDK version inside the Version Catalog

Reviewed By: cipolleschi

Differential Revision: D48263891

fbshipit-source-id: bb9565cded37bae986865f37f4891575396128d0
2023-08-11 08:34:37 -07:00
Nicola Corti 6aed446886 Consolidate Gradle Plugin versions inside the version catalog (#38946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38946

I'm doing another pass of moving all the various version numbers of the Gradle Plugin inside the `[plugins]` section of the version catalog.

Changelog:
[Internal] [Changed] - Consolidate Gradle Plugin versions inside the version catalog

Reviewed By: mdvacca

Differential Revision: D48233147

fbshipit-source-id: afd12e5377d2d88c53cef4e6913b5c49b3da5bbb
2023-08-11 08:34:37 -07:00
Nicola Corti fe7b3414db Convert external-artifacts Gradle file to Kotlin DSL (#38883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38883

Convert external-artifacts Gradle file to Kotlin DSL

Changelog:
[Internal] [Changed] - Convert external-artifacts Gradle file to Kotlin DSL

Reviewed By: cipolleschi

Differential Revision: D48187571

fbshipit-source-id: 2e5ff203c93d8d4ac21f5b87f6efdb96a864dd8e
2023-08-11 01:46:31 -07:00
Nick Gerleman bbcdb40d80 C++ 17 style critical sections
Summary:
C++ 17 added `std::scoped_lock`, which effectively supersedes `std::lock_guard`. See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cp21-use-stdlock-or-stdscoped_lock-to-acquire-multiple-mutexes for why it was added.

This diff replaces usages of `std::lock_guard` with `std::scoped_lock` and CTAD.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D48244308

fbshipit-source-id: d0a090d92c4c7276fdeea7fb1275900e5e0d3617
2023-08-10 20:02:46 -07:00
Arushi Kesarwani 01b9b509cf ReactHostInterface & ReactHost refactoring (#38826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38826

`ReactHostInterface` -> `ReactHost`
`ReactHost` -> `ReactHostImpl`

changelog: [internal] internal

allow-large-files

Reviewed By: cortinico

Differential Revision: D48054716

fbshipit-source-id: b926877a0119f906ff794a496df4e30351b71423
2023-08-10 17:24:46 -07:00
David Vacca 75c1422286 Allow configuration of 'allWarningsAsErrors' in gradle (#38930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38930

As we migrate java to kotlin I noticed that we've introduced few warnings here and there.
I'm introducing a way to configure allWarningsAsErrors in gradle

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D48238321

fbshipit-source-id: 745847bc6e6df94decc54afa8c9041552d91dfee
2023-08-10 16:22:40 -07:00
David Vacca 450e00e5ce Fix warning in ReactImagePropertyTest
Summary:
Fix warning in ReactImagePropertyTest

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D48234859

fbshipit-source-id: 8217289ed18b07ee6977d32c7d0b68ce74c0131b
2023-08-10 16:22:40 -07:00
David Vacca 1348314b6f Fix compilation warnings in JSPointerDispatcherTest.kt (#38914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38914

Fix compilation warnings in JSPointerDispatcherTest.kt

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48213629

fbshipit-source-id: 6b46b86d9340311f1b2d750cc11d79227cb8682f
2023-08-10 16:22:40 -07:00
David Vacca e94c7e0a44 Fix warning in SimpleViewPropertyTest (#38913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38913

Fix few warnings in  SimpleViewPropertyTest

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48206413

fbshipit-source-id: f398e035624200cb6fc327568cf85e015ad83d76
2023-08-10 16:22:40 -07:00
David Vacca 354bfc3587 Rename jSBundleLoader -> jsBundleLoader (#38910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38910

Rename jSBundleLoader -> jsBundleLoader

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051752

fbshipit-source-id: 4443e9fc1801e3a0794b9dfad677318e897d5400
2023-08-10 15:14:13 -07:00
Ruslan Shestopalyuk 6860ffa350 Move nativePerformanceNow binding call into common core code (#38928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38928

## Changelog:
[Internal] -

This moves the call to bind the `nativePerformanceNow` function to the common place in C++ code (`JSIExecutor::initializeRuntime`), as opposed on relying on calling it from every platform-specific implementation.

I believe the reason why it was don this way, to begin with, was historical, since we did use to have a different implementation of this function on every platform. Now we have a common one in C++, anyway, so there is no reason whatsoever to have this binding platform-specific.

Reviewed By: rubennorte

Differential Revision: D48232883

fbshipit-source-id: 164dc464ab7f89e993d83a4562906e033aabb3b7
2023-08-10 14:43:29 -07:00
Janic Duplessis 1a1a79871b Fix null crash when using maintainVisibleContentPosition on Android (#38891)
Summary:
`mFirstVisibleView` is a weak ref so it can also be null when dereferencing.

This was reported on the original PR here https://github.com/facebook/react-native/pull/35049#discussion_r1288195469

## Changelog:

[ANDROID] [FIXED] - Fix null crash when using maintainVisibleContentPosition on Android

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

Test Plan: Not sure exactly in what cases this can happen, but the fix is trivial and makes sense.

Reviewed By: cortinico

Differential Revision: D48192154

Pulled By: rshest

fbshipit-source-id: 57a38a22a0e216a33603438355bde0013c014fbf
2023-08-10 11:23:06 -07:00
Nicola Corti 0c483d309c Introduce a build_android step (#38848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38848

In order to parallelize the Android CI, I've moved most of the building to a `build_android` step which executes before the `build_npm_package` step.

As currently, building Hermes for Android is on the critical path, this should reduce much of the execution time on CI.

Changelog:
[Internal] [Changed] - Introduce a build_android step

Reviewed By: mdvacca

Differential Revision: D48148418

fbshipit-source-id: bfe3175fcc11d96e264eb31d8d5555bd1f83c01d
2023-08-10 05:34:13 -07:00
David Vacca e2ef6b98a0 Rename jSEngineInstance -> jsEngineInstance (#38909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38909

Rename jSEngineInstance -> jsEngineInstance

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051751

fbshipit-source-id: ae96270f9dfa56b39bcc42ea8ac108235695311c
2023-08-09 23:30:01 -07:00
David Vacca 2e5b122f23 Rename jSMainModulePath -> jsMainModulePath (#38908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38908

Rename jSMainModulePath -> jsMainModulePath

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48051753

fbshipit-source-id: af20a18ec6a01de7db6484b7a7a2e3b2b3353396
2023-08-09 23:30:01 -07:00
David Vacca fff0cd11d4 Rename BridgelessReactPackage to CoreReactPackage (#38775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38775

Rename BridgelessReactPackage to CoreReactPackage

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48050452

fbshipit-source-id: 7ac54af0123412ed0cb9e960ccc13fd70a1a8ebc
2023-08-09 23:30:01 -07:00
David Vacca 56aceb3f27 Make BridgelessReactPackage package only (#38777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38777

Make BridgelessReactPackage package only

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D48050454

fbshipit-source-id: 8f6fac8bdc57004610dec27950bbec38f12b13fe
2023-08-09 23:30:01 -07:00
David Vacca 54b368b926 Move BridgelessReactPackage from com.facebook.react to com.facebook.react.bridgeless (#38776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38776

in this diff I'm moving BridgelessReactPackage from com.facebook.react to com.facebook.react.bridgeless.

the goal is to hide this class from the API

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D48050453

fbshipit-source-id: 54ac042d491a7b8fe83e543c94e0d06bd9b88cda
2023-08-09 23:30:01 -07:00
Nicola Corti fdab18b0a1 Fix compilation avoidance bug with buildCodegenCLI (#38903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38903

Currently Android is not rebuilding the CLI if its content changes. This is a bug.
It's resolution is a bit more complicated as we do have various `buildCodegenCLI` tasks, also in user projects.

I've removed the tasks from the user projects, as they're practically not needed (users always consume a prebuilt codegen).

And I've also updated the setup to have only one `buildCodegenCLI` in the ReactAndroid project.
This allows us to ensure the job executes only once and has correct input/outputs.

Changelog:
[Internal] [Changed] -  Fix compilation avoidance bug with buildCodegenCLI

Reviewed By: mdvacca

Differential Revision: D48199157

fbshipit-source-id: ba3be6a0ca959ac4e1240e8feb99b8274e4e2b46
2023-08-09 14:33:00 -07:00
bufgix cb60e5c67b Convert ReactImagePropertyList to kotlin (#38845)
Summary:
Issue: https://github.com/facebook/react-native/issues/38825#issuecomment-1669205837

## Changelog:
[GENERAL] [CHANGED] - ReactImagePropertyList.java => ReactImagePropertyList.kt

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

Test Plan: `./gradlew :packages:react-native:ReactAndroid:test`

Reviewed By: cortinico, NickGerleman

Differential Revision: D48171953

Pulled By: mdvacca

fbshipit-source-id: ae1fbf32f2ef6d18ebe593e31664e45ca339941c
2023-08-09 13:45:07 -07:00
David Vacca 2013c2cd67 Fix Android build warning
Summary:
Fix Android build warning reporting usage of depreacted APIs: Robolectric.setupActivity() is deprecated in Android unit test

Following Google Android recommendations: https://developer.android.com/reference/androidx/test/core/app/ActivityScenario

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48168983

fbshipit-source-id: ac37235715578af6e28da2e219c6a942bfafca2a
2023-08-09 11:56:44 -07:00
Nicola Corti b7c4736eb6 Convert flipper-integartion Gradle file to Kotlin DSL (#38884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38884

Convert flipper-integartion Gradle file to Kotlin DSL

Changelog:
[Internal] [Changed] - Convert flipper-integartion Gradle file to Kotlin DSL

Reviewed By: luluwu2032

Differential Revision: D48187572

fbshipit-source-id: ff463f2ccf5ea3333893b3c6c691808d478a855d
2023-08-09 10:08:27 -07:00
Siddarth Kumar 5657d2d3bd (refactor): kotlinify JSPointerDispatcherTest.java (#38878)
Summary:
This PR converts the java logic inside of `JSPointerDispatcherTest.java` to Kotlin as requested in https://github.com/facebook/react-native/issues/38825
We also swap `JSPointerDispatcherTest.java` for `JSPointerDispatcherTest.kt`

## Changelog:

[Internal][Changed]: Convert JSPointerDispatcherTest to Kotlin

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

Test Plan:
`./gradlew :packages:react-native:ReactAndroid:test` must pass and CI must be green

## Screenshot of Tests passing locally:

![Screenshot 2023-08-09 at 12 48 04 PM](https://github.com/facebook/react-native/assets/64726664/566fc648-adb7-4f52-87fc-67ef2f39a1a2)

Reviewed By: rshest

Differential Revision: D48189629

Pulled By: cortinico

fbshipit-source-id: 92d869f690457986413bcae33a15225aa6e006be
2023-08-09 10:05:14 -07:00
Madhusudan Sapkota baa2714648 SimpleViewPropertyTest.java => SimpleViewPropertyTest.kt (#38856)
Summary:
This PR converts SimpleViewPropertyTest into Kotlin as requested in [https://github.com/facebook/react-native/issues/38835](https://github.com/facebook/react-native/issues/38825#issuecomment-1669634951)

## 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
-->

[INTERNAL] [CHANGED] - Convert to SimpleViewPropertyTest Kotlin

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

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test.`
2. All tests should pass.

Reviewed By: NickGerleman

Differential Revision: D48171939

Pulled By: mdvacca

fbshipit-source-id: eaa93a696faba1793b85186e6a072a7d3f043d0c
2023-08-08 20:14:34 -07:00
Intl Scheduler 5d67460447 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907937909496
Sandcastle Job Instance ID: 36028798033748901
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48178204

fbshipit-source-id: 057881c7aaa207066d6d21b31a24b6d97a3c24ae
2023-08-08 18:17:11 -07:00