Commit Graph

38536 Commits

Author SHA1 Message Date
Abdennour JEBBAR 6ebee63ab7 Convert ReactTestHelper (#37768)
Summary:
As part of the effort to Kotlin-fy React Native tests, I've converted [ReactTestHelper](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java) to Kotlin.

## Changelog:

[Internal] [Changed] - Convert ReactTestHelper to Kotlin

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

Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: rshest

Differential Revision: D46587427

Pulled By: cortinico

fbshipit-source-id: 82d08d01cf4c7cb7c05a63696e1acdacf60b1ad5
2023-06-09 07:08:08 -07:00
brunohensel 0aa330801b Migrate MultipartStreamReaderTest to Kotlin (#37743)
Summary:
Migrate [MultipartStreamReaderTest.java](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java) to Kotlin.  See https://github.com/facebook/react-native/issues/37708

## Changelog:

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

Pick one each for the category and type tags:

[INTERNAL] [CHANGED] - Migrate MultipartStreamReaderTest to Kotlin

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

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

Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: mdvacca

Differential Revision: D46559844

Pulled By: cortinico

fbshipit-source-id: 4cc7b0cb9819930567c4021dace0c48e93be333c
2023-06-09 06:18:18 -07:00
Lorenzo Sciandra 5cc8ceeae2 add 0.71.9 and 0.71.10 changelog (#37760)
Summary:
Adds changelog for new patch.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.71.9 and 0.71.10

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

Test Plan: N/A

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D46525847

Pulled By: lunaleaps

fbshipit-source-id: 044e6c9f62db29c26754ab6981adf5cbeabf67b1
2023-06-08 21:53:05 -07:00
Nick Gerleman 48c0e41d06 Revert D46501420: Exclude trailing whitespace on measuring text width
Differential Revision:
D46501420

Original commit changeset: fba4acd38747

Original Phabricator Diff: D46501420

fbshipit-source-id: 64c76b96d0e12f9bd7edd4640904de9fce3b44e6
2023-06-08 18:38:55 -07:00
Genki Kondo 4b54c0b1fa return final animation values to JS when animation completes (#37782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37782

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

When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect

**This diff:**
- Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations

Next:
2. Update the Animated.Value to reflect the new values
3. Call the onEnd function if there is one set
4. Pass the new values down for layout calculations and the correct Pressability responder region

Changelog:
[General][Changed] - return animated values to JS for natively driven animations

Reviewed By: javache

Differential Revision: D44110833

fbshipit-source-id: ce8c09fbe20c0c155260ce9561a67f7dfba30515
2023-06-08 16:53:34 -07:00
Nick Gerleman 8f7f0bf2a3 Extract logic to CellMetricsAggregator (#37777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37777

This extracts the state and logic VirtualizedList uses to query information related to cell metrics. We will need to modify this (and other places) when fixing up RTL support for horizontal FlatList.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D46427052

fbshipit-source-id: 0a23f6c726447de0f20c583b4d507003efd6a754
2023-06-08 15:53:10 -07:00
Nick Gerleman 96225cec2b Rename FrameMetrics to CellMetrics (#37778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37778

These functions describe how to get the metrics of a specific cell. "Frame" here seems non-descriptive and redundant to the "Metrics" part. Renaming this before a larger refactor.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D46427058

fbshipit-source-id: e9ad9cf15e1adfd07604eb11526de0ed8cf99000
2023-06-08 15:53:10 -07:00
Intl Scheduler ec957f5c15 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907895823816
Sandcastle Job Instance ID: 18014399477912355
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46577121

fbshipit-source-id: 8f549f6ca7186a0aaa220d29fda10a6a7378ccf8
2023-06-08 15:45:20 -07:00
Randall71 67eb4946e3 (codegen 133) - Parser extractTypeFromTypeAnnotation (#37752)
Summary:
> [Codegen 133 - Assigned to Randall71] Create an extractTypeFromTypeAnnotation(typeAnnotation) function in the Parser base class. Implement it using [this code for Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L193-L197) and [this code for TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L189-L193). Replace the invocation of that function with the one from the parser

This is part of https://github.com/facebook/react-native/issues/34872

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

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

Test Plan: yarn jest packages/react-native-codegen > new tests written, as well as coverage from existing tests

Reviewed By: cipolleschi

Differential Revision: D46520245

Pulled By: rshest

fbshipit-source-id: 8c5d8ca8b46fb44399089c6b694998874463ecc8
2023-06-08 14:58:15 -07:00
tarunrajput 942bd615d1 extract buildPropertiesForEvent to parsers-commons (#37714)
Summary:
## 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
-->

Part of https://github.com/facebook/react-native/issues/34872

> Extract buildPropertiesForEvent into parsers-commons.js file. Use the code from either [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L258-L272) or [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L277-L288) which now should be equal. Delete the original ones and use the newly created method instead of those.

[Internal][Changed]: Extract buildPropertiesForEvent and update callsites

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

Test Plan: `yarn test`

Reviewed By: cipolleschi

Differential Revision: D46514046

Pulled By: rshest

fbshipit-source-id: 120e9a09180735f8eeb0419b16eac566d5dcc6ba
2023-06-08 14:39:28 -07:00
Rubén Norte 325072575a Expose instance handles from shadow nodes directly, instead of from event emitters/targets (#37553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37553

## Context

I added some getters in EventTarget/EventEmitter to access the React instance handle for a given shadow node/shadow node family in https://github.com/facebook/react-native/commit/43864a1d6025bfc4483dded115d51f7613018199 (D44022477), so I could implement DOM traversal methods easily.

I wanted to reuse that method to implement `MutationObserver` and `IntersectionObserver`, but unfortunately `EventEmitter`/`EventTarget` only allow access to the instance handle as long as the shadow node is mounted. That makes sense for events, but not for this use case, as with `MutationObserver` we intentionally want to have access to unmounted nodes when creating the list of `addedNodes` and `removedNodes` for the `MutationRecord` (depending on when exactly we generate this list, either `addedNodes` or `removedNodes` wouldn't be mounted).

## Changes

This reverts my original change and adds a new field in `ShadowNodeFamily` to provide access to the `InstanceHandle` at any point (even if the node isn't mounted).

This provides the same guarantees as the original method, keeping weak references to the handles to avoid memory leaks.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D46149084

fbshipit-source-id: f76abae50134a5d55a98cab42eebeb62084024f9
2023-06-08 14:38:00 -07:00
Rubén Norte a88c0edbd3 Remove references to ShadowNodeFamilyFragment when not used to create new instances of ShadowNodeFamily (#37772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37772

Changelog: [internal]

`ShadowNodeFragment` is used in multiple places as a general definition for the fragment, but it lacks information that's going to be constructed in the fragment itself in the future (like `eventEmitter` in D46149084).

This migrates some of the usages of this fragment to the `ShadowNodeFamily` directly (as they already have access to it).

Reviewed By: javache, sammy-SC

Differential Revision: D46190382

fbshipit-source-id: 3a879861106594d66a2580410d4d83523c288314
2023-06-08 14:38:00 -07:00
Rubén Norte 9bd5591c59 Remove references to ShadowNodeFamilyFragment from ComponentKit shadow node wrappers (#37773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37773

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D46190383

fbshipit-source-id: e85948fbfeaaa4e057e6ff736734da0de2c06d0f
2023-06-08 14:38:00 -07:00
Nicola Corti f3c86364da Create a Debug manifest inside React Native Android (#37771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37771

While working on debugging tools, I noticed that we ask in every template app to
- Add a "com.facebook.react.devsupport.DevSettingsActivity" activity
- Add the <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

This is error prone and can be cleanup as we now distribute React Native that is variant aware (debug/release).
So I'm creating a manifest inside `src/debug` that contains those directive so we don't need to ask users
to add them (I'm removing them from the template).

Changelog:
[Internal] [Changed] - Create a Debug manifest inside React Native Android

Reviewed By: cipolleschi

Differential Revision: D46556884

fbshipit-source-id: 10034a6b245bf419dfa663bc998c4d1ad5d24a90
2023-06-08 13:14:47 -07:00
Bernhard Owen Josephus 2674d9bf7c Exclude trailing whitespace on measuring text width (#37590)
Summary:
Multiline text in Android shows some extra space. It's easily noticeable when you set the text `alignSelf` to `flex-start`. This is because we are using `layout.getLineWidth` which will include trailing whitespace.
<img width="300" alt="image" src="https://github.com/facebook/react-native/assets/50919443/8939092b-caef-4ad8-9b34-2ccef5d20968">

Based on Android doc, `getLineMax` exclude trailing whitespace.
<img width="625" alt="image" src="https://github.com/facebook/react-native/assets/50919443/0b32e842-5fab-4fc7-8fd9-299877b9c553">

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width

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

Test Plan:
After applying the changes:
<img width="300" alt="image" src="https://github.com/facebook/react-native/assets/50919443/bfbf52b0-7e7d-4c89-8958-6af38d8bc1c7">

Code snippet:
```
<Text style={{backgroundColor: 'red', alignSelf: 'flex-start', color: 'white'}}>
    1{'\n'}
</Text>
```

Reviewed By: rshest

Differential Revision: D46501420

Pulled By: NickGerleman

fbshipit-source-id: fba4acd38747f09791ce8af4439ee88ab12ac827
2023-06-08 12:06:38 -07:00
Fábio Henriques 6b62f12ce9 Add smartInsertDelete prop to TextInput component (#36111)
Summary:
This PR add support to configure the `smartInsertDeleteType` property in iOS inputs [as described here](https://developer.apple.com/documentation/uikit/uitextinputtraits/2865828-smartinsertdeletetype), making possible toggle this autoformatting behavior.

PR for the docs update: https://github.com/facebook/react-native-website/pull/3560

## Changelog:

[IOS] [ADDED] - Add `smartInsertDelete` prop to `TextInput` component

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

Test Plan:
* Added an example in the RNTester app to test this behavior in iOS.
* If the `smartInsertDelete` prop is `true` or `undefined`, the system will use the default autoformatting behavior.
* If the `smartInsertDelete` prop is `false`, the system will disable the autoformatting behavior.

https://user-images.githubusercontent.com/20051562/217862828-70c20344-d687-4824-8f5d-d591eff856ef.mp4

Reviewed By: javache

Differential Revision: D46546277

Pulled By: NickGerleman

fbshipit-source-id: 3172b14fb196876d9ee0030186540608204b96de
2023-06-08 12:06:15 -07:00
Lorenzo Sciandra 09e152e004 add 0.70.10 and 0.69.11 changelog (#37781)
Summary:
Adds changelog for new patches.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.70.10 and 0.69.11

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

Test Plan: N/A

Reviewed By: NickGerleman

Differential Revision: D46564493

Pulled By: cipolleschi

fbshipit-source-id: c850e057d34f8862488b769076e36ebb5132f6cf
2023-06-08 11:42:42 -07:00
Fábio Henriques 9821d966e9 Convert NativeAnimatedInterpolationTest to Kotlin (#37742)
Summary:
This PR converts NativeAnimatedInterpolationTest.java to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/37708).

## Changelog:

[INTERNAL] [CHANGED] - Convert NativeAnimatedInterpolationTest to Kotlin

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

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

Reviewed By: cortinico, yungsters

Differential Revision: D46499088

Pulled By: mdvacca

fbshipit-source-id: 06efb2451760f7e02751b521af8590a6f49236a9
2023-06-08 10:39:24 -07:00
Amr Yousef 108309e407 Convert and re-enable TimingModuleTest (#37763)
Summary:
As part of the effort to Kotlin-fy React Native tests, I've converted [TimingModuleTest](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java) to Kotlin.

I noticed the test suite was ignored and it was failing locally but managed to get all the tests to pass except one which I kept ignored.

## Changelog:

[Internal] [Changed] - Convert TimingModuleTest to Kotlin

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

Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico

Differential Revision: D46543718

Pulled By: rshest

fbshipit-source-id: 761b778a6d07417c9c83457c2777ee87f198f158
2023-06-08 09:43:50 -07:00
Intl Scheduler 5662faa708 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907895447666
Sandcastle Job Instance ID: 31525198359258666
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46561431

fbshipit-source-id: a843a88714bbf6d3f0d1559feef07d6d35568002
2023-06-08 08:44:56 -07:00
Intl Scheduler b82aa2afe6 translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907895447666
Sandcastle Job Instance ID: 31525198359258666
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46561426

fbshipit-source-id: 95f24ac035bb6b6da466dcf560fe4253b6408539
2023-06-08 08:44:56 -07:00
Rubén Norte 0a5455132e Handle offsetParent for children of the root node correctly (#37727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37727

We currently throw an exception when trying to access `node.offsetParent` in direct children of the root node in Fabric. This fixes that with an additional check.

Changelog: [internal]

Reviewed By: twobassdrum

Differential Revision: D46485786

fbshipit-source-id: f64156ef774ae600c4042c0718b099cfb92cf7f1
2023-06-08 08:27:50 -07:00
Thomas Hoang e7d3662904 Convert ImageStoreManagerTest to Kotlin (#37737)
Summary:
Converts ImageStoreManagerTest.java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert ImageStoreManagerTest.java to Kotlin

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

Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cipolleschi

Differential Revision: D46552483

Pulled By: cortinico

fbshipit-source-id: 98da889bd61656f930912a10a13deb0dd581df23
2023-06-08 07:11:44 -07:00
Ryan Lucas 5ef5767c3c Convert ProgressiveStringDecoderTest to Kotlin (#37728)
Summary:
## Changelog:

[Internal] [Changed] - Convert ProgressiveStringDecoderTest to Kotlin

<!-- 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/37728

Reviewed By: cipolleschi

Differential Revision: D46552406

Pulled By: cortinico

fbshipit-source-id: 9fd75991cff98fcf71223c5bc386a7ee0b435d8d
2023-06-08 07:11:21 -07:00
Pieter De Baets 6a710670f0 Handle double SurfaceHandler#stop call (#37716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37716

We call `surfaceHandler.stop` both from `SurfaceHandlerBinding` as well as `Binding`. Since we don't check asserts in production, the second one should generally be a no-op, but may be causing a crash due to incorrectly de-referencing a unique_ptr.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D46441620

fbshipit-source-id: e93b9722fd717947ebf772f545f692c2e31f816e
2023-06-08 06:51:21 -07:00
Nicola Corti 3221f37ea1 Fix broken test_android on main due to wrong import (#37767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37767

`test_android` is currently broken on main due to a wrong import for the `encodeUtf8` function from OkIO

Changelog:
[Internal] [Changed] - Fix broken test_android on main due to wrong import

Reviewed By: cipolleschi

Differential Revision: D46555207

fbshipit-source-id: 4fd5dd2f8ddda0602873169c833420a7154b830b
2023-06-08 05:43:29 -07:00
M0Coding 2ac607803c Convert FakeLoggingDelegate to Kotlin (#37731)
Summary:
Converts FakeLoggingDelegate from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert FakeLoggingDelegate to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: rshest

Differential Revision: D46515330

Pulled By: cortinico

fbshipit-source-id: 29fb66386aca194fdaba1217ef9fa0a38c5c2fc4
2023-06-08 04:54:11 -07:00
Alex Danoff 79ae710cc5 W3CPointerEvents: fix NPE due to missing eventCoords (#37761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37761

Changelog: [Android] [Fixed] - W3CPointerEvents: fix a case where cancel can cause NPE

When we need to dispatch a pointercancel event, we clear the previous state (last coordinates, last hit path) for the active pointer ID (this is needed in order to fire the proper events when the action causing the cancel is over).

Previously, we stored the previous state in the form of references to the corresponding state in the current `PointerEventState`. However, this PointerEventState is also used later when actually dispatching the events. Since the dispatch can happen asynchronously, alterations to the event state might be visible during the dispatch. In particular, we saw some cases where an NPE can occur due to removing entries from our local state (which got reflected in the event state).

This change fixes the issue by making copies of the data from the PointerEventState instead of just storing references to it.

Reviewed By: rozele

Differential Revision: D46522585

fbshipit-source-id: 78d6dd60cf8f5419870fb9f6703443c957d4d048
2023-06-08 03:34:43 -07:00
Alexander Eggers 10d55888cc Add support for building with Xcode 15 (#37758)
Summary:
Fixes https://github.com/facebook/react-native/issues/37748

This PR adds a patch which fixes a build issue in Xcode 15.

## Changelog:

[IOS] [ADDED] - Add support for building with Xcode 15

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

Reviewed By: cortinico

Differential Revision: D46524009

Pulled By: cipolleschi

fbshipit-source-id: 9f6c12e12a15c154467282a7b4a00e80e5cc0af2
2023-06-08 03:06:31 -07:00
Aymane Missouri 3540d88809 Convert JSStackTraceTest to Kotlin (#37751)
Summary:
This PR converts JSStackTraceTest.java to Kotlin as requested in https://github.com/facebook/react-native/issues/37708.

## Changelog:
[INTERNAL] [CHANGED] - Convert JSStackTraceTest to Kotlin

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

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

Reviewed By: mdvacca

Differential Revision: D46525516

Pulled By: cortinico

fbshipit-source-id: 880479fc4a38fcacb4a09820e9dbc469393a6cdb
2023-06-08 02:24:45 -07:00
hurali97 767b97c4da refactor: re-write clipboard module test to kotlin (#37726)
Summary:
Migrates the **ClipboardModuleTest** Java class to Kotlin. It also changes the import for **ClipboardManager** from `android.text.ClipboardManager` to `android.content.ClipboardManager`. Since the import from `android.text` is deprecated and in the [ClipboardManager.java](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.java) the import refers to `android.content`, so it's safe to update the import in test file as well.

It's a sub-task of the umbrella issue [here](https://github.com/facebook/react-native/issues/37708)

## Changelog:

[INTERNAL] [CHANGED] ClipboardModuleTest class migrated from Java to Kotlin

<!-- 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/37726

Test Plan:
🟢 Test passes when running the following:

```sh
./gradlew :packages:react-native:ReactAndroid:test
```

Reviewed By: cortinico

Differential Revision: D46486129

Pulled By: mdvacca

fbshipit-source-id: 10ca6efdeea1236162dc40871cc0159cbe492335
2023-06-08 01:15:43 -07:00
Ryan Linton 84a3b898d5 Convert UIManagerModuleConstantsHelperTest to Kotlin (#37732)
Summary:
Converts UIManagerModuleConstantsHelperTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert UIManagerModuleConstantsHelperTest to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico

Differential Revision: D46493160

Pulled By: mdvacca

fbshipit-source-id: c7522c016e0ef36b12d1b77f37171a72c188edd0
2023-06-08 01:11:06 -07:00
M0Coding 29ee917a0e Convert TouchEventDispatchTest to Kotlin (#37725)
Summary:
Converts TouchEventDispatchTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert TouchEventDispatchTest to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico

Differential Revision: D46486161

Pulled By: mdvacca

fbshipit-source-id: ab7872347b42871416a3d8f23b001c564ff8c18a
2023-06-08 01:10:44 -07:00
Fábio Henriques e5dfe9964f Convert FallbackJSBundleLoaderTest to Kotlin (#37750)
Summary:
This PR converts FallbackJSBundleLoaderTest.java to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/37708).

## Changelog:

[INTERNAL] [CHANGED] - Convert FallbackJSBundleLoaderTest to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D46513866

Pulled By: rshest

fbshipit-source-id: fecdb38243e0195c4099a5c0bb54d2e61ca08e79
2023-06-07 19:00:18 -07:00
brunohensel ad6718a462 Migrate JSPackagerClientTest to Kotlin (#37747)
Summary:
Migrate [JSPackagerClientTest.java](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java) to Kotlin.  See https://github.com/facebook/react-native/issues/37708

## Changelog:

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

Pick one each for the category and type tags:

[INTERNAL] [CHANGED] - Migrate JSPackagerClientTest to Kotlin

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

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

Test Plan:
Tests pass: ./gradlew :packages:react-native:ReactAndroid:test
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico

Differential Revision: D46514210

Pulled By: rshest

fbshipit-source-id: ecec18a69b1401214e22c6cbea34d49528da1a79
2023-06-07 17:52:53 -07:00
Siddarth Kumar e1206da06d (refactor): kotlin-ify ShareModuleTest.java (#37746)
Summary:
This PR converts the java logic inside of `ShareModuleTest.java` to Kotlin as requested in https://github.com/facebook/react-native/issues/37708
We also swap `ShareModuleTest.java` for `ShareModuleTest.kt`

## Changelog:

[Internal][Changed]: Convert ShareModuleTest to Kotlin

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

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

## Screenshot of passing tests locally

![Screenshot 2023-06-07 at 1 32 22 PM](https://github.com/facebook/react-native/assets/64726664/008a5a5f-c378-4921-86e9-407e8aa9b4ad)

Reviewed By: cortinico

Differential Revision: D46514083

Pulled By: rshest

fbshipit-source-id: 7eb49fb4ccf5b889bfe38aa6274454e1633a8b0e
2023-06-07 16:32:36 -07:00
Gijs Weterings 8cf5da481d Upgrade @react-native/codegen-typescript-test's Jest dependency to Jest 29 (#37745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37745

`codegen-typescript-test` is using Jest 24 still, which has transitive dependencies on node-notifier < 8.0.1. This is causing us to fail our oss requirements (T139285789), but the original task for it got reaped (T81929770)

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D46506536

fbshipit-source-id: 83037459775f3c8edb000f34f6e6f77ea7059ff0
2023-06-07 15:05:48 -07:00
Alex Hunt 4540668c15 Move flow-typed definitions to repo root (#37636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37636

Moves `flow-typed/` directory from `packages/react-native/flow-typed/` to the repo root.

- This is a more suitable location for `flow-typed` definitions for 3P dependencies to be used across React Native packages.
- **Breaking**: We no longer publish these 3P libdefs as part of the `react-native` package (assuming that external use of React Native with Flow is extremely rare, and that these projects can manage their own package libdefs).

Changelog:
[General][Breaking] Remove included `flow-typed/` directory from the `react-native` package

- **Upgrade instructions**: Projects using Flow should install or replicate third party `flow-typed` definitions for React Native dependencies — see https://github.com/facebook/react-native/tree/main/flow-typed and [#37636](https://github.com/facebook/react-native/pull/37636).

Reviewed By: hoxyq

Differential Revision: D46313482

fbshipit-source-id: 3d97d5408e44dd43132664c4933f3ff1075f90a1
2023-06-07 13:44:13 -07:00
Jan Jiménez Serra 84200fe9f5 Convert InterpolatorTypeTest to Kotlin (#37724)
Summary:
Converts InterpolatorTypeTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert InterpolatorTypeTest to Kotlin

<!-- 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/37724

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico, yungsters

Differential Revision: D46486141

Pulled By: mdvacca

fbshipit-source-id: bcdfa6497b9170640b4b9f3f20f6afad8fb56bee
2023-06-07 13:31:11 -07:00
David Vacca 4002a251a5 Update documentation of ReactHost.reload method (#37691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37691

Update documentation of ReactHost.reload method

changelog: [internal] internal

Reviewed By: cortinico, philIip

Differential Revision: D46293519

fbshipit-source-id: 38372ca1016c50d5d74ec7a6e7f9e44238c4899b
2023-06-07 11:14:49 -07:00
David Vacca 57e79faf58 Reduce visibility of ReactHost.destroy() method (#37693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37693

This diff reduces the visibility of ReactHost.destroy() method

changelog: [internal] internal

Reviewed By: philIip, luluwu2032

Differential Revision: D46293388

fbshipit-source-id: 42a8fae5ef51a7ecbdca520ce0db9f67f62c1588
2023-06-07 11:14:49 -07:00
David Vacca 3edd5138d2 Reduce visibility in React Context (#37695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37695

In this diff I'm reducing visibility of RCTDeviceEventEmitter interface in ReactContext.

This is an internal interface that has no usages externally (neither at Meta or github source)

changelog: [internal] internal

Reviewed By: cortinico, luluwu2032

Differential Revision: D46241623

fbshipit-source-id: 297256b7394768c54b24125ad91f7b3fabbd42d0
2023-06-07 11:14:49 -07:00
arslandogar c6d895bec9 Remove InstanceHandleHelper as unused (#37740)
Summary:
Converts InstanceHandleHelper from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## 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 InstanceHandleHelper to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: rshest

Differential Revision: D46515395

Pulled By: cortinico

fbshipit-source-id: 5091d1932c2ad623f063972661ec82ceb4c74089
2023-06-07 10:50:34 -07:00
M0Coding 34dd7255be Convert CompositeReactPackageTest to Kotlin (#37734)
Summary:
Converts CompositeReactPackageTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert CompositeReactPackageTest to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: rshest

Differential Revision: D46515364

Pulled By: cortinico

fbshipit-source-id: e310199f744f36e735ac78124bc7d40798421303
2023-06-07 10:11:13 -07:00
Gijs Weterings 2fba8706b4 Add license header to SetSpanOperation.java
Summary: SetSpanOperation.java doesn't have the required licence header, causing a compliance failure for OSS repo checkup. This diff adds the header.

Reviewed By: cortinico

Differential Revision: D46505914

fbshipit-source-id: 278021ff08b30b4f051a0f0a6a7dec580e012225
2023-06-07 10:11:08 -07:00
tarunrajput 5048ef65fb Convert FakeEventDispatcher to kotlin (#37739)
Summary:
Part of https://github.com/facebook/react-native/issues/37708
Convert FakeEventDispatcher to Kotlin
## 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 FakeEventDispatcher to Kotlin

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

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

Reviewed By: rshest

Differential Revision: D46514164

Pulled By: cortinico

fbshipit-source-id: 355f568ad9b36073aa9f1981472a2c7567e7ab2d
2023-06-07 10:02:56 -07:00
David Angulo e4497067a9 Convert FakeRCTEventEmitter to Kotlin (#37733)
Summary:
Converts FakeRCTEventEmitter from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert FakeRCTEventEmitter to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: rshest

Differential Revision: D46513891

Pulled By: cortinico

fbshipit-source-id: 4ad70242d88cc89f8f8033fd437d43df2283c4a1
2023-06-07 05:59:08 -07:00
David Angulo ecfbabf532 Convert InteropModuleRegistryTest to Kotlin (#37735)
Summary:
Converts InteropModuleRegistryTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## Changelog:

[Internal] [Changed] - Convert InteropModuleRegistryTest to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico, yungsters

Differential Revision: D46492704

Pulled By: mdvacca

fbshipit-source-id: ce924c33a43129ce70a1590b72bf8428a7d0a8b3
2023-06-07 05:53:54 -07:00
Pranav Yadav e944bd7115 Bump autorebase.yml to v1.8 (#37584)
Summary:
`cirrus-actions/rebase` `v.1.8` fixes number of bugs.
`v1.8` Changelog: https://github.com/cirrus-actions/rebase/releases/tag/1.8
See: https://github.com/cirrus-actions/rebase

## Changelog:

[GENERAL] [SECURITY] - [Actions] Bump `autorebase.yml` to `v1.8`

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

Test Plan: - `/rebase` comment should rebase the PR as usual.

Reviewed By: rshest

Differential Revision: D46264711

Pulled By: cipolleschi

fbshipit-source-id: 49974e5c1841c0af3637cf5bdbcde9e79ea0e671
2023-06-07 04:42:32 -07:00
Agata Kosior 7b686a5d9c Convert StackTraceHelperTest to Kotlin (#37741)
Summary:
Converts StackTraceHelperTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708

## 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 StackTraceHelperTest to Kotlin

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

Test Plan:
Tests pass: `./gradlew :packages:react-native:ReactAndroid:test`
Formatted with [KtFmt](https://facebook.github.io/ktfmt/)

Reviewed By: cortinico

Differential Revision: D46498064

Pulled By: mdvacca

fbshipit-source-id: d0d62097edfa8fe3649e2c72acb4ae8b3d20a89a
2023-06-07 04:23:42 -07:00