Commit Graph
32109 Commits
Author SHA1 Message Date
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
Mateusz Mędrek 22b39d7434 Convert BlobModuleTest class to Kotlin (#37719)
Summary:
[Migrate](https://github.com/facebook/react-native/issues/37708) BlobModuleTest class 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] `BlobModuleTest` class migrated from Java to Kotlin

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

Test Plan:
Tests should pass

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

Reviewed By: yungsters

Differential Revision: D46485981

Pulled By: cortinico

fbshipit-source-id: 69858fedfd84b59d6c1c2aca99f6fa9c0a8832fa
2023-06-07 03:54:44 -07:00
Pieter Vanderwerff 08dc0a63ce Update prettier to v2.8.8 (#37738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37738

Upgrade Prettier to the latest stable version, 2.8.8.

Reviewed By: SamChou19815

Differential Revision: D46403769

fbshipit-source-id: 551d64db0b701a8d3f275900dd8f6324c115a3e6
2023-06-06 20:06:25 -07:00
David Vacca fdfa012dae Introduce BoltsFutureTask class to avoid leaking bolts.Task into ReactHost API (#37744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37744

This diff introduces the new generic class BoltsFutureTask<> that will be used by ReactHost to expose async task in its API.
The goal of BoltsFutureTask is to avoid leadking the bolts.Task dependency into the ReactHost API.

Public methods of this class follow the spec defined in the Future interface, see: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html. I didn't add javadocs to avoid duplicated documentation with Future and also
becuase this is private class.

Task Cancellation follows the patters defined in bolts documentation: https://github.com/BoltsFramework/Bolts-Android#cancelling-tasks

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D46170466

fbshipit-source-id: eed92584bcd3ff0145e7cbb5d735139fbb6b0f33
2023-06-06 17:43:26 -07:00
Alex Danoff 396cdac629 W3CPointerEvents: properly update hit path during native gestures (#37638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: de796217bac27b169ccf9ed5e0df85f7b63d8c5e
2023-06-06 11:52:07 -07:00
Matt Blagden 3f0caedd4d Handle null connections (#37626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37626

`inspector_->connect` can return `null` when the connection fails. Check for `null` and raise an exception (preventing a later crash when the `null` connection is used).

Changelog: [Internal]

Reviewed By: voideanvalue

Differential Revision: D46126080

fbshipit-source-id: 42e08687b4d425dd87642cf6b61f675e77c738ee
2023-06-06 08:25:55 -07:00
Pieter De Baets 7fb9e4f46c Provide jsi::Runtime directly to RCTTurboModuleManager (#37687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37687

We end up creating a stub RuntimeExecutor wherever we configure this, and might as well pass in the runtime directly, to match the other binding installer signatures.

Changelog: [iOS][Deprecated] Use -[RCTTurboModuleManager installJSBindings:] instead of -[RCTTurboModuleManager installJSBindingWithRuntimeExecutor:]

Reviewed By: philIip

Differential Revision: D46390501

fbshipit-source-id: df7644ccbd04462dbbe752c60e5d5961ab50dff5
2023-06-06 08:19:19 -07:00
Nicola Corti ea4724b37c Remove CircularDepsValidator.cmake as is not needed
Summary:
We haven't really used this macro, so it's safe to remove as of now.

Changelog:
[Internal] [Changed] - Remove CircularDepsValidator.cmake as is not needed

Reviewed By: javache

Differential Revision: D46443083

fbshipit-source-id: 2a48749d7af31c393828668006d53c7a6755ac5d
2023-06-06 05:40:20 -07:00
Siddarth Kumar a497882384 Add function emitMixedProp to parser-primitives (#37608)
Summary:
[Codegen 132] This PR introduces `emitMixedProp` to parser-primitives and abstracts the logic out of typescript and parser events as requested on https://github.com/facebook/react-native/issues/34872

## Changelog:

[Internal] [Changed] - Add emitMixedProp  to parser-primitives and update usages.

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

Test Plan:
Run yarn jest react-native-codegen and ensure CI is green

## Screenshot of tests passing locally:

<img width="1182" alt="Screenshot 2023-05-28 at 12 46 49 PM" src="https://github.com/facebook/react-native/assets/64726664/dbea4daf-d954-4c7f-b121-c6aad1fb318e">

Reviewed By: dmytrorykun

Differential Revision: D46275638

Pulled By: cipolleschi

fbshipit-source-id: 803d82055c7925e49aca1f408b5c7a50c687349a
2023-06-06 02:31:51 -07:00
MaeIg 663a018709 Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers (#37573)
Summary:
This PR aims to remove the duplicated logic in [flow|typescript]/components/events.js files to move it in specific parsers. It is a task of https://github.com/facebook/react-native/issues/34872:
> [Codegen 114 - Assigned to MaeIg] Add a function getTypeAnnotationFromProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L174-L177) and parsers/typescript/components/events.js. Use the parsers in the buildPropertiesForEvent.

## Changelog:

[Internal] [Changed] - Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers

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

Test Plan:
Flow:
<img width="600" alt="image" src="https://github.com/facebook/react-native/assets/40902940/554bb82d-b492-4550-9a84-254fc4f78285">

Eslint:
<img width="498" alt="image" src="https://github.com/facebook/react-native/assets/40902940/53a302b7-c2aa-4008-9583-2e3b4cddc14c">

Jest:
<img width="395" alt="image" src="https://github.com/facebook/react-native/assets/40902940/c7ff53f1-2be1-4099-b2e6-081128cf5333">

Reviewed By: dmytrorykun

Differential Revision: D46190831

Pulled By: cipolleschi

fbshipit-source-id: 393a4c4968139ee7061ed4ea524d083af6950e38
2023-06-06 02:31:51 -07:00
tarunrajput 8ffaede05a add handleGenericTypeAnnotation in parser-commons (#37525)
Summary:
Part of https://github.com/facebook/react-native/issues/34872
Move the switch construct from [parsers/typescript/utils.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/utils.js#L59-L93) and [parsers/flow/utils.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/utils.js#L56-L81) to the parsers-commons.js file, in a handleGenericTypeAnnotation function. Use that function in place of the switch.

## 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][Added]: Added handleGenericTypeAnnotation in parsers-commons

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

Test Plan: `yarn test`

Reviewed By: cortinico

Differential Revision: D46264650

Pulled By: cipolleschi

fbshipit-source-id: a315ee8cad24d91c9e98e5533d4cdc8b43ebc9a0
2023-06-06 02:31:51 -07:00
Arushi Kesarwani 0af806e96c Fixing line truncation issue when numberOfLines = {1} (#37667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37667

Changelog:
[Android][Fixed] - Fixing line truncation issue in Text containing /n when numberOfLines = {1}

When the text has multiple lines (with new line characters \n to hard-break the lines), and the first line is short enough to fit, Text component with `numberOfLines = {1}` doesn't display "..." at the end and rather disrespects the /n character.

With `numberOfLines = {1}`, On iOS it translates to
`line 1`, on Android & Web it translates to `line 1 line 2...`

**Expected Behavior :**

`line 1...`

Reviewed By: javache, NickGerleman

Differential Revision: D46175963

fbshipit-source-id: 3377c38ab65e6801bddb1f262432f8d156a2641f
2023-06-05 23:31:10 -07:00
Luna Wei cf27e246ce Fix rm (#37706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37706

Changelog: [Internal] Fix wrong usage of shelljs `rm`

Reviewed By: NickGerleman

Differential Revision: D46450762

fbshipit-source-id: 9e519222642421b596827675af38f643fa84c9f7
2023-06-05 23:25:18 -07:00
Phillip Pan b6b247b874 move host:didInitializeRuntime: to public api
Summary:
Changelog: [Internal]

it appears that having some access to jsi in userland will be necessary for framework developers, so i'm moving this API to the public header.

bypass-github-export-checks

Reviewed By: mdvacca

Differential Revision: D46385184

fbshipit-source-id: 7261c0a8ba8c8c9302f65d440a3a3fb2782c0666
2023-06-05 21:31:29 -07:00
David Vacca 80134f7211 Revert changes on ReactHostDelegate (#37712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37712

This diff is reverting a change on ReactHostDelegate (D45662329) that caused MobileConfig to not being properly initialize in fb4a.

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D46468413

fbshipit-source-id: 4013ba1b5bdfa50e4cf500bb1524e92303826d90
2023-06-05 20:48:09 -07:00
Phillip Pan 7b763cd3db clean up comments and imports in RCTHost header
Summary:
Changelog: [Internal]

now that we've wrapped up the first iteration of the venice stable apis, let's clean up old comments and reorganize things to prepare this header for documentation.

bypass-github-export-checks

Reviewed By: mdvacca

Differential Revision: D46334662

fbshipit-source-id: 68d6d2e41d7f7c5b1c69f3bb72482c418e771f72
2023-06-05 19:48:29 -07:00
tarunrajput 5062553c62 Add enterKeyHint in TextInput type declaration (#37624)
Summary:
Resolves: https://github.com/facebook/react-native/issues/37622

Related:
https://github.com/facebook/react-native/pull/34482
https://reactnative.dev/docs/textinput#enterkeyhint

## 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][Added]: Add enterKeyHint in TextInput type declaration

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

Reviewed By: cortinico, NickGerleman

Differential Revision: D46292040

Pulled By: lunaleaps

fbshipit-source-id: a037b7f8dd0d60880dcf1aec64749546fa54a95d
2023-06-05 13:08:05 -07:00
Phillip Pan 46d14ceab2 delete RCTHostCreationHelpers (#37703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37703

Changelog: [Internal]

i did too good of a job refactoring that these functions don't abstract any arguments away anymore, so let's just delete it

Reviewed By: javache

Differential Revision: D46303713

fbshipit-source-id: 7e0508a7296ebc3d5c62cf0824071bd2ef041193
2023-06-05 12:31:19 -07:00
Phillip Pan e0a1a18d4b introduce RCTContextContainerHandling (#37702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37702

Changelog: [Internal]

the context container is a DI object in our internal infra. the delegate method `createContextContainer` is used to pass down internal implementations that may be used in our infra, notably the `ReactNativeConfig`. this API used to be required for the app delegate to implement.

in this change, i introduce a protocol, `RCTContextContainerHandling`, where we shift the burden of creating the DI container to our internal infra where userland can now optionally add dependencies to this.

this also removes more C++ boilerplate for the bridgeless setup.

Reviewed By: sammy-SC

Differential Revision: D46245433

fbshipit-source-id: 552a9ab0b6a178bab592743863694ff886b152f8
2023-06-05 12:31:19 -07:00
Phillip Pan 2861dd2b1e remove bindingsInstallFunc argument from bridgeless api (#37604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37604

Changelog: [Internal]

this isn't needed anymore, so we can delete it and remove it from our public api

Reviewed By: javache

Differential Revision: D46215054

fbshipit-source-id: 97bc7821aeea47223a4b10684efe750ff1899fa2
2023-06-05 12:31:19 -07:00
Phillip Pan 50fd76ab04 introduce internal delegate callback for jsi runtime initialization (#37605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37605

Changelog: [Internal]

in this stack, i remove the `bindingsInstallFunc` argument from `RCTHost`'s public API.

the bindingsInstallFunc is a lambda that provides a runtime parameter, which the consumer can "install bindings" to. we have our specific use case for this internally, but there's no need to expose this.

in this change, i introduce a delegate callback path that notifies an internal delegate that the react runtime has been created.

Reviewed By: javache

Differential Revision: D46215051

fbshipit-source-id: 732d6949064b0948b5cf883dc3c0ab494c2ecd94
2023-06-05 12:31:19 -07:00
Siddarth Kumar e73c00f576 Add getProperties to Parsers and update usages (#37633)
Summary:
[Codegen 138] This PR introduces `getProperties` to Parser base class and implements the function in Typescript and Flow Parsers.
This PR also gets rid of `getProperties` from :
- `packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js`
- `packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js`
and updates the usages with `getProperties` from the respective parser objects as requested on https://github.com/facebook/react-native/issues/34872

## Changelog:

[Internal] [Changed] - Add getProperties  to Parsers base class and update usages.

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

Test Plan:
Run yarn jest react-native-codegen and ensure CI is green

## Screenshot of tests passing locally:

![Screenshot 2023-05-31 at 4 38 41 PM](https://github.com/facebook/react-native/assets/64726664/dd660369-eabd-4c2e-a440-a41ed6f9d47a)

Reviewed By: cipolleschi

Differential Revision: D46322882

Pulled By: rshest

fbshipit-source-id: 5506ce5ff395946ea8c1258b152716fea0142b95
2023-06-05 11:48:04 -07:00
Rubén Norte 9c11b81630 Add some additional Systrace markers in Fabric (#37675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37675

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D46393554

fbshipit-source-id: 905097c82c96c7f627f1999f53b509ba0f434dd5
2023-06-05 08:53:54 -07:00
ahmadao2214 52154e54a2 Create emitInt32Prop function (#37663)
Summary:
Create a function emitInt32Prop(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L53-L59) and [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L63-L69) into that function. Use that function in the original call site.

## Changelog:
[INTERNAL][ADDED] - emitInt32Prop in parser-primitves

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

Test Plan: `yarn jest packages/react-native-codegen`

Reviewed By: cipolleschi

Differential Revision: D46437495

Pulled By: rshest

fbshipit-source-id: cebe3958c2ad9c4ab9a6c087fee4317b5e57bc58
2023-06-05 07:48:22 -07:00
shubham0142 34c19232d3 refactor(codegen): extract getCommandProperties to parsers-common (#37666)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872

> Extract the buildCommandProperties function ([Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/index.js#L76-L80), [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/index.js#L64-L113)) from the index.js's files to the parsers-commons.js file.

## 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][Added]: Extract getCommandProperties to parsers-common

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

Test Plan: yarn test react-native-codegen

Reviewed By: cipolleschi

Differential Revision: D46437431

Pulled By: rshest

fbshipit-source-id: 578b94b9d9fec90ac91fa2a56c707abc46b05b99
2023-06-05 05:11:19 -07:00
Blake Friedman 41d5f4bce2 Prevent DEBUG React Native builds idling out (#37681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37681

User who run their applications using `npx react-native ios` have the application going into the
background if there is inactivity on the device. This is common for users developing on device (why touch
the device if you're tweaking background colours, etc...).

If the application is build with Xcode directly, this is already managed.  This change prevents the idle
timer from running in DEBUG builds.

## Changelog:
[iOS][Fixed] - Debug builds from cli disable idle to stop application going into background

Reviewed By: cipolleschi

Differential Revision: D46427401

fbshipit-source-id: 45969cd506a1b76bde3be81d27808bf0e792a817
2023-06-05 03:00:32 -07:00
Aymane Missouri 805604d1e3 use TripleEqual instead of doubleEqual when comparing two string (#37673)
Summary:
It is generally recommended to use "===" instead of "==" when comparing two strings

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

Test Plan:
## Changelog:
[Internal] [Changed] - use TripleEqual instead of doubleEqual when comparing two string

Reviewed By: cipolleschi

Differential Revision: D46434681

Pulled By: cortinico

fbshipit-source-id: 70522a28799699854d2a4ab814e34ce796082025
2023-06-05 02:19:26 -07:00
Nicola Corti 7a1229ea0f Backport Hermes release fix on main (#37685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37685

I'm backporting this comming `60a452b4853dc5651c465867344904dd6fc86703`
from the release branch of 0.72-stable to main which fixes this issue
in the Android NDK:
https://github.com/android/ndk/issues/1740#issuecomment-1198438260

Changelog:
[Internal] [Changed] - Backport Hermes release fix on `main`

Reviewed By: mdvacca

Differential Revision: D46398346

fbshipit-source-id: 593ca9523cb223e7c2d9fe6cccc1abb3ed331203
2023-06-05 02:18:38 -07:00