Commit Graph

710 Commits

Author SHA1 Message Date
Vincent Riemer 63d9db891c Fix incorrect pointer coordinates caching (#39185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39185

Changelog: [Internal] - Fix incorrect pointer coordinates caching

In D48472486 I moved the updating of "previous" fields into the `handleHitStateDivergence` method which made sense considering that it's run on every event regardless but what I didn't take into account was the updating of the `mLastEventCoordinatesByPointerId` field. On `ACTION_HOVER_MOVE` events there's a filter that ensures that only move events that have a large enough distance are emitted (something that isn't done on iOS, hence why I didn't think of it), but after my changes in D48472486 it was updating `mLastEventCoordinatesByPointerId` **before** that hover move check, making the distance always 0 and never firing move events.

This diff fixes this by moving the updating of `mLastEventCoordinatesByPointerId` and `mLastButtonState` back to the end of `handleMotionEvent`.

Reviewed By: lunaleaps

Differential Revision: D48756372

fbshipit-source-id: 6f2e40366986ce8d1c6128e49bf3abd44137196d
2023-08-28 17:49:10 -07:00
Arushi Kesarwani cf358c4f36 Lint Errors for .clang-tidy (#39120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39120

Fix lint errors in `.clang-tidy`

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48545408

fbshipit-source-id: 0026aee642a9243d5be7717b3c46668ba16115f6
2023-08-28 17:46:27 -07:00
Arushi Kesarwani 62e1110af5 Bridgeless -> Runtime (#39099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39099

Renaming `bridgeless` -> `runtime` in JNI & ReactCommon changes

changelog: [General][Changed] - Renaming bridgeless to runtime

Reviewed By: rshest

Differential Revision: D48492107

fbshipit-source-id: 0c2843848869b41623839c05d7ad4eb72c700dfb
2023-08-28 17:46:27 -07:00
Arushi Kesarwani 1547b81ec1 Bridgeless -> Runtime (#39062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39062

Renaming `bridgeless` -> `runtime`

Package `com.facebook.react.bridgeless` -> `com.facebook.react.runtime`

changelog: [General][Changed] - Renaming bridgeless to runtime

Reviewed By: rshest

Differential Revision: D48440542

fbshipit-source-id: 5e310cfee13c7d34c7fac36d3eda94280880b1eb
2023-08-28 17:46:27 -07:00
Intl Scheduler ef7ab56c34 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940555081
Sandcastle Job Instance ID: 18014399541033695
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48725051

fbshipit-source-id: 03437f8e49491372e3ee84a220d5f726aa19eb02
2023-08-27 12:31:56 -07:00
Intl Scheduler e5fe7b391c translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940517829
Sandcastle Job Instance ID: 31525198421678702
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48717880

fbshipit-source-id: 5200b8b0bc5311b776fc8ff6f6d17a8204efa5b7
2023-08-26 14:50:27 -07:00
Intl Scheduler 31bfed33be translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940502274
Sandcastle Job Instance ID: 9007200283452584
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48713231

fbshipit-source-id: eb5fbaeda1a4e8ea9bce81e7c490fabb9bd0a36e
2023-08-26 02:33:17 -07:00
Ergul Azizler a0a544ffd9 Revert D48588376: reduce visibility of getNativeModuleIterator
Differential Revision:
D48588376

Original commit changeset: 6cbff90a4c51

Original Phabricator Diff: D48588376

fbshipit-source-id: 79b481b9784709e20074cda2d16605369568fc84
2023-08-25 03:09:18 -07:00
Ergul Azizler e7168c4a2e Revert D48588377: EZ cleanup of TurboReactPackage
Differential Revision:
D48588377

Original commit changeset: 5645acad938a

Original Phabricator Diff: D48588377

fbshipit-source-id: e0da38e5b721d6bfc7fd6b4607c7712301330a8f
2023-08-25 03:09:18 -07:00
Ergul Azizler c46858ab46 Revert D48588375: Make TurboReactPackage.getModule no nullable
Differential Revision:
D48588375

Original commit changeset: e510f76ea027

Original Phabricator Diff: D48588375

fbshipit-source-id: 62c8b062c8316bb7a90fced6390eb20f8274ea88
2023-08-25 03:09:18 -07:00
Christoph Purrer e716459d66 Fix crash in CompositeTurboModuleManagerDelegate (#39155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39155

[Changelog]: [Android][Fixed] Fix crash in CompositeTurboModuleManagerDelegate

CompositeTurboModuleManagerDelegate.cpp crashes as we pass in one or multiple
```
jni::alias_ref<TurboModuleManagerDelegate::javaobject> delegate
```
but don't retain a global reference to them. Fix use:
```
jni::make_global(delegate)
```

Differential Revision: D48670217

fbshipit-source-id: e805f28919918b2a867589dbb6e2a70d67dcd8c3
2023-08-24 21:33:09 -07:00
David Vacca 7eacf2770e Make TurboReactPackage.getModule no nullable (#39140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39140

TurboReactPackage.getModule is nullable, although the internals of ReactNative requires this method to be non null (otherwise there will a NPEs)
I'm making TurboReactPackage.getModule no nullable, this is important to simplify API and future migration to kotlin

changelog: [internal] internal/

Reviewed By: cortinico

Differential Revision: D48588375

fbshipit-source-id: e510f76ea0271ff33ab2ebe6c76382c4781e1787
2023-08-24 16:52:01 -07:00
David Vacca 42a7777f2a EZ cleanup of TurboReactPackage (#39139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39139

EZ cleanup of TurboReactPackage

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48588377

fbshipit-source-id: 5645acad938a4ebf84b81818dd0a915cc86a2682
2023-08-24 16:52:01 -07:00
David Vacca 40c13951ea reduce visibility of getNativeModuleIterator (#39137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39137

getNativeModuleIterator is not required to be public, reducing visibillity to package only

changelog: [internal] intenral

Reviewed By: philIip, rshest

Differential Revision: D48588376

fbshipit-source-id: 6cbff90a4c51d2af4b0693b84c1a674ea24b94d1
2023-08-24 16:52:01 -07:00
Andrew Wang 10a076f6e2 Ship the fix for local reference overflow in Yoga (#39132)
Summary:
X-link: https://github.com/facebook/litho/pull/954

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

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

# Context

Reviewed By: NickGerleman, astreet

Differential Revision: D48607502

fbshipit-source-id: 79552bc76879d1fc15341423ae6fbadeab2fb7af
2023-08-24 12:48:56 -07:00
Arushi Kesarwani d5b656c0e7 Kotlinfy ReactNativeConfig (#39142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39142

X-link: https://github.com/facebookresearch/playtorch/pull/227

`ReactNativeConfig.java` -> `ReactNativeConfig.kt`

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48585508

fbshipit-source-id: 46035062662eeebddf546814dbcef239e769e17f
2023-08-24 12:02:27 -07:00
Alex Hunt a002fbbd6c Upgrade CLI, restore prev status check value (#39077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39077

Follow-up to https://github.com/facebook/react-native/pull/38988.

- Upgrade to RN CLI `12.0.0-alpha.11`.
- Restore previous value check against `/status` response in test scripts (restored in above CLI alpha).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48432629

fbshipit-source-id: 175241ad75676281f4638e179873b2ce32f0ea3e
2023-08-22 12:56:19 -07:00
Jesse Watts-Russell 211f3145db Fixing nested horizontal scrollview scrolling on Android (#39097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39097

Changelog:
[Internal][Added] - Created mechanism to have nested horizontal scrollviews (or flatlists/sectionlists) by prioritizing scrolling on deeper nested scrollviews which have the enableNestedScroll prop equal to true.

Reviewed By: NickGerleman

Differential Revision: D48504762

fbshipit-source-id: 1a6d01f68e142d99ea494e2b5630979c7be2ecce
2023-08-22 07:30:44 -07:00
Intl Scheduler ccaae31a13 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940357720
Sandcastle Job Instance ID: 4503600652998134
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48560682

fbshipit-source-id: 4d7f7e7c311f720c220e2fa6aef0f50223336f71
2023-08-22 05:57:36 -07:00
Lulu Wu a6b0984893 Upgrade OSS target sdk version to 34 (#39103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39103

Changelog:
[Android][Changed] - Upgrade target sdk version to 34

Reviewed By: cortinico

Differential Revision: D48555585

fbshipit-source-id: 05a89fecdea52d73d35ba3fed8df76fc6bf51fe6
2023-08-22 05:25:40 -07:00
Vincent Riemer 826e74fc72 Fix proper pointercancel/leave behavior when scrolling (#39081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39081

Changelog: [Internal] - Fix pointer cancel/leave behavior when a child view scrolls

Reviewed By: lunaleaps

Differential Revision: D48472486

fbshipit-source-id: 9179cb5f897c2d36ab4df00b0462d2136a06b17d
2023-08-21 17:11:19 -07:00
Ramanpreet Nara f312d6eccd Ensure TM system has consistent view of interop flags (#39086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39086

Our largest blocker for the TurboModule interop layer is a "module not found" issue.

**Hypothesis:** This is a gating-related bug.

## Changes
This diff tries to simplify the gating of the TurboModule interop layer: Instead of reading the flags again and again from two different classes (the module manager and its delegate), just read the flags once, when the module system is initialized:

https://www.internalfb.com/code/fbsource/[ae79b760626ec81ceadbf2829e1593199d4df031]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java?lines=106-113%2C210-215%2C217-223%2C251

This will ensure that the TurboModule system has one consistent view of the interop layer flags, throughout its lifetime.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48489274

fbshipit-source-id: 05eb64c5f7bd89dd65aac7390c3eb09234d87f96
2023-08-21 15:44:07 -07:00
Ramanpreet Nara 606a92f0b3 Show RedBox when reloads fail
Summary:
When reloads fail, React Native currently just renders a blank screen.

We should provde some sort of feedback to the developer. Hence, this diff makes the RedBox show up.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48335851

fbshipit-source-id: 0681cd40f8c83960f9133853481013765634f5cf
2023-08-21 12:43:42 -07:00
Ramanpreet Nara 80b665966f Clean up pre-rendered surfaces properly during teardowns (#39000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39000

Whenever React Native tears down (including on logout), we need to drop unconsumed Pre-rendering surfaces.

D45012714 initially implemented this change, but this diff wasn't complete: it would only drop unconsumed pre-rendered surfaces when ***the Facebook infra* initiated** React Native to tear down. But, React Native could initiate tear down **by iteself** (e.g: via an uncaught exception on the Native Modules thread).

## Changes
In this diff, make the React Manager support an onBeforeDestroy listener. Then, integrate these listeners into the teardown/reload algorithms. That way, no matter how React Native tears down, we **alwasy** drop unconsumed pre-rendered surfaces.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48323647

fbshipit-source-id: 28f99500eea457b0e3c420fed28c434f8794ac23
2023-08-21 12:43:42 -07:00
Ramanpreet Nara f437224042 Enhance/fix error reporting in reload and destroy
Summary:
The new reload/create/destroy methods work by chaining tasks together.

This task chain has the type Task<ReactInstance>.

**The problem:** If any step in the chain fails, task.getResult() actually returns null - not the ReactInstance. Many steps in the existing reload() and destroy() task chains don't account for this case. So:
- The reload() and destroy() task chains sometimes swallow errors.
- Sometimes steps in the reload() and destroy() task chains don't execute: they use .successTask

This diff makes two changes:
1. Ensure each step **always** executes (i.e: use .continueWith vs .success)
2. Ensure each step first checks if the Task<ReactInstance> isn't faulted/cancelled. If the task is faulted/cancelled, a soft exception gets reported, and the current ReactInstance gets returned.

Changelog: [Internal

Reviewed By: mdvacca

Differential Revision: D48080779

fbshipit-source-id: 22f03ef1a54b538d01eeb5ecde6d82a84d32f1f8
2023-08-21 12:43:42 -07:00
Ramanpreet Nara 1f0094e40a Fix: RedBoxes don't show up after teardowns (#38997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38997

After React Native gets destroyed (e.g: via an exception), the ReactHost resets its current activity.

## Problem
React Native can display RedBoxes after React Native destruction (e.g: in the case of an exception).

Displaying RedBoxes requires the current activity, which gets nullified. So, the RedBox might not show up after destruction.

## Changes
This diff makes ReactHost keep a track of its last non-null activity in a WeakRef.
Then, the DevMenu just uses the last non-null activity to display RedBoxes (and everything else).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48076893

fbshipit-source-id: 6baddf8f329c03efe92f93ef1bfc6eb9569c1b38
2023-08-21 12:43:42 -07:00
Ramanpreet Nara aec22574cc Refactor: Use get/setCurrentActivity in ReactHost (#38998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38998

Instead of using the mActivity reference directly, let's just use getCurrentActivity() and setCurrentActivity().

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48076896

fbshipit-source-id: d988deaf8778bf0e3726d13f96e9e6e480d8fdc0
2023-08-21 12:43:42 -07:00
Ramanpreet Nara 75c5d74ea2 Fix: React Native reloads after teardown render a "blank screen" (#38999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38999

After React Native tears down, a RedBox can appear, prompting the user to reload.

**Problem:** After React Native reloads, the React Native screen wouldn't show up.

**Cause:** ReactContext.onHostResume() wasn't executed.

Why:
- React Native teardown moves the React manager into the **onHostDestroy()** state.
- During initialization, React Native only calls ReactContext.onHostResume(), if the React manager was *already* in the **onHostResume()** state.

https://www.internalfb.com/code/fbsource/[f82938c7cc9a0ee722c85c33d1027f326049d37c]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java?lines=924-925

**Question:** Why does React Native only call ReactContext.onHostResume(), **if the React manager was already in the onHostResume() state?**

In short, we want ReactContext.onHostResume() to be delayed until the user navigates to the first React Native screen. Please read the comments in the code to understand why.

## The fix
If we're initializing React Native during a reload, just always call ReactContext.onHostResume().

If React Native is reloading, it seems reasonable to assume that:
1. We must have navigated to a React Native screen in the past, or
2. We must be on a React Native screen.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48076895

fbshipit-source-id: 6794105920ee30d62cebd745256bb5dea805e891
2023-08-21 12:43:42 -07:00
Ramanpreet Nara ecd2feeea0 Fix: React Native teardown crashes app
Summary:
During React Native teardown, we should stop all React surfaces. Otherwise, the app could crash with this error:

```
08-06 14:54:08.644 14843 14843 F DEBUG   : Abort message: 'xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/scheduler/Scheduler.cpp:171: function ~Scheduler: assertion failed (surfaceIds.empty() && "Scheduler was destroyed with outstanding Surfaces.")'
```

When can teardown occur? One case: an exception occurs on the NativeModules thread.

NOTE: This diff impacts the **new** Bridgeless mode lifecycle methods.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D47926966

fbshipit-source-id: 62be90eb49091773976dfb18db5c2a7c0668c382
2023-08-21 12:43:42 -07:00
Ramanpreet Nara 3be4452de5 Easy: Rename adb logs: Rename old/newPreload() -> old/newStart() (#39001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39001

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D48076894

fbshipit-source-id: c1c845f2629810f77f1f1c0ff63a0ead3ccfd804
2023-08-21 12:43:42 -07:00
Nicola Corti ffa5742699 Cleanup BUCK setup for our JVM tests (#39061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39061

We're suppressing JVM tests using BUCK which is causing misalignment between which tests we run on Buck vs Gradle.
Instead we should be using the Ignore annotation (which we already do) to decide which tests to skip, so that Buck can just pick all the Java/Kotlin file in this folder.

Changelog:
[Internal] [Changed] - Cleanup BUCK setup for our JVM tests

Reviewed By: cipolleschi

Differential Revision: D48433432

fbshipit-source-id: 31070ef848932aefa5d2710a8e11f97646e4b51c
2023-08-21 04:20:41 -07:00
Intl Scheduler 84e5934290 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940206333
Sandcastle Job Instance ID: 31525198414697888
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48491307

fbshipit-source-id: d5c6b29f2700196b3201a0d24aef6c5a017f49bf
2023-08-18 18:59:02 -07:00
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