Commit Graph

28578 Commits

Author SHA1 Message Date
Vincent Riemer 37fee66680 Add initial Pointer Capture API implementation (#38505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38505

Changelog: [Internal] - Add initial Pointer Capture API implementation

This diff introduces the first baseline implementation of pointer capturing through intercepting/modifying Pointer Events in flight through the `PointerEventsProcessor` class.

Firstly: This adds and exposes the imperative methods `setPointerCapture`, `releasePointerCapture`, and `hasPointerCapture` which is added to the host `ReadOnlyElement` ref API. These methods are used to manage/query the `pendingPointerCaptureTargetOverrides_` map as [defined in the spec](https://www.w3.org/TR/pointerevents/#setting-pointer-capture).

The code is fairly self-explainatory when it comes to retargeting the events in `PointerEventsProcessor::interceptPointerEvent` but when it comes to firing the `gotPointerCapture` and `lostPointerCapture` events those are handled in `PointerEventsProcessor::processPendingPointerCapture` and is a fairly direct implementation of [the spec's pseudocode](https://www.w3.org/TR/pointerevents/#process-pending-pointer-capture).

Finally at the end of `interceptPointerEvent` I've included the basics of implicit pointer capture *release* as per [the spec](https://www.w3.org/TR/pointerevents/#implicit-release-of-pointer-capture) (note that implicit pointer capture is not yet implemented).

Reviewed By: rozele

Differential Revision: D47533366

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

## Changelog:
[Internal] -

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

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

Reviewed By: rubennorte

Differential Revision: D48232883

fbshipit-source-id: 164dc464ab7f89e993d83a4562906e033aabb3b7
2023-08-10 14:43:29 -07:00
Arushi Kesarwani 85eb2c95da Downscale build_hermesc_linux to large (#38905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38905

For the `build_hermesc_linux` job we don't need xlarge resources.

The current average usage for `build_hermesc_linux` is around 25%.

We can also downscale to medium in few days if this scales well.

**Insights Dashboard :**

`build_hermesc_linux`

{F1067213827}

Changelog:
[Internal] [Changed] - Downscale build_hermesc_linux job to Large

Reviewed By: cipolleschi

Differential Revision: D48200659

fbshipit-source-id: 2642d5d527e9e55cfe5c4498ea00c25915bbc883
2023-08-10 11:49:38 -07:00
Alex Hunt e1998806b7 Migrate cli-plugin-metro into repo (#38795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38795

## Context

RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641

## Changes

Inits new package `react-native/community-cli-plugin`. This migrates [`react-native-community/cli-plugin-metro`](https://github.com/react-native-community/cli/tree/main/packages/cli-plugin-metro) into the React Native repo, to enable faster iteration by the React Native core team. Specifically:

- This package contains several `metro` dependencies, which when removed from CLI will no longer require us to ship new CLI releases to get Metro patches and features to users.
- This package contains the `start`, `bundle`, and `ram-bundle` commands (central to the React Native development experience), for which we have incoming debugging-related changes.
- This package now **only** exports commands to be attached via a RN CLI plugin. With this move, we're aiming to **internalise** the default implementations of these dev commands within React Native — other RN CLI plugins can continue to override these, but must do so wholesale. (See also the recent fix for this: https://github.com/react-native-community/cli/pull/1999.)

In V15:
- (Microsoft feedback) Re-export  `unstable_buildBundleWithConfig`, marking as unstable. This gives us a time buffer to consider how we repackage this functionality in future.

The package source has been converted from TypeScript to Flow, with a number of new `flow-typed/` defs added to meet type coverage requirements.

## To dos

- For now, we aren't removing the existing [`react-native-community/cli-plugin-metro`](https://github.com/react-native-community/cli/tree/main/packages/cli-plugin-metro) source — until later PRs consolidate this move by changing dependencies in the `react-native` package.
- **Exported API is reduced!**: I'm working with szymonrybczak to decouple references from RN CLI packages https://github.com/react-native-community/cli/pull/2021.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46801501

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

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

## Changelog:

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

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

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

Reviewed By: cortinico

Differential Revision: D48192154

Pulled By: rshest

fbshipit-source-id: 57a38a22a0e216a33603438355bde0013c014fbf
2023-08-10 11:23:06 -07:00
Riccardo Cipolleschi ad18f811fe Mitigate flakiness in iOS (#38894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38894

This diff introduces a script `run_with_retry` that we can apply to single commands in order to mitigate the flakiness.

This can be useful when networking is involved, to retry installing some dependencies, or for example with some e2e/integration tests.

The diff applies this rerun to the iOS tests so we mitigate failures in CI.

## Changelog:
[Internal] - Add script to retry CI steps and mitigate iOS flakyness.

Reviewed By: cortinico

Differential Revision: D48189365

fbshipit-source-id: a0e115754bcdb8f8353bb5f070163f8cf8f7c9cf
2023-08-10 09:25:44 -07:00
Riccardo Cipolleschi c5ce508eea Delete unused parameter (#38893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38893

This Parameter was false and never set to true. Also, we don't know what that code does and it was not used for more than a year.

## Changelog:
[Internal] - Removing not executed code.

Reviewed By: cortinico, dmytrorykun

Differential Revision: D48189139

fbshipit-source-id: 6a4000f677958aaefadec40d531acb37c98e3ef8
2023-08-10 09:25:44 -07:00
Nicola Corti 0c483d309c Introduce a build_android step (#38848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38848

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

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

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

Reviewed By: mdvacca

Differential Revision: D48148418

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

Rename jSEngineInstance -> jsEngineInstance

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051751

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

Rename jSMainModulePath -> jsMainModulePath

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48051753

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

Rename BridgelessReactPackage to CoreReactPackage

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48050452

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

Make BridgelessReactPackage package only

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D48050454

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

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

the goal is to hide this class from the API

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D48050453

fbshipit-source-id: 54ac042d491a7b8fe83e543c94e0d06bd9b88cda
2023-08-09 23:30:01 -07:00
Nicola Corti 28dd1bbe0f Enable local caching for Gradle (#38882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38882

This turns on local caching for Gradle builds.
From now on, some of the tasks of the build will be cached inside the `.gradle` folder.

This will benefit 'clean builds' and builds happening after branch/context switch.
CI will also benefit from this improvement as we're storing the cache folder on CircleCI.

After this we'll have to follow-up and enabling `Cacheable` on each of our task as
they're currently all disabled.

Changelog:
[Internal] [Changed] - Enable local caching for Gradle

Reviewed By: mdvacca

Differential Revision: D48187656

fbshipit-source-id: 25734ed692a69874721e86c50498b075af0fda19
2023-08-09 17:32:43 -07:00
Xin Chen c2c7462705 Add perf comparison example with set state in effect (#38798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38798

Changelog:
[General][Internal] - Add example to compare perf with set state in unnecessary effect.

Reviewed By: rshest

Differential Revision: D47857125

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

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

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

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

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

Reviewed By: mdvacca

Differential Revision: D48199157

fbshipit-source-id: ba3be6a0ca959ac4e1240e8feb99b8274e4e2b46
2023-08-09 14:33:00 -07:00
Nicola Corti fedbb7202c Do not store Hermes debug symbols on CircleCI (#38902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38902

As now we distribute libraries on Maven Central,
users should be able to use those instead of having to download them from the
React Native CI automatically.

This is already available since React Native 0.71, so we can probably remove this extra step.

Changelog:
[Internal] [Changed] - Do not store Hermes debug symbols on CircleCI

Reviewed By: mdvacca

Differential Revision: D48197732

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

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

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

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

Reviewed By: cortinico, NickGerleman

Differential Revision: D48171953

Pulled By: mdvacca

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

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

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48168983

fbshipit-source-id: ac37235715578af6e28da2e219c6a942bfafca2a
2023-08-09 11:56:44 -07:00
David Vacca da6a7a0c7c Upgrade ANDROIDX TEST VERSION to 1.4.0
Summary:
Upgrade ANDROIDX TEST VERSION to 1.4.0

This is necessary to be able to use androidx.test:core in the next diffs
changelog: [internal] internal

Reviewed By: cortinico, NickGerleman

Differential Revision: D48176680

fbshipit-source-id: 93e0ba68b2eb37ba783a9faa7d9b56425b225ae7
2023-08-09 11:56:44 -07:00
David Vacca 161d645e16 Sort scripts in package.json (#38861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38861

I'm just sorting the scripts in package.json to make it easier to consume

changelog: [internal] internal

Reviewed By: cortinico, NickGerleman

Differential Revision: D48161535

fbshipit-source-id: 473af009b05fe8bf264975245f508926f8f8dae3
2023-08-09 11:56:44 -07:00
David Vacca ba16de1f5e Simplify testing RN Android in OSS (#38862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38862

Simplify testing RN Android in OSS

changelog: [internal] internal

Reviewed By: cortinico, NickGerleman

Differential Revision: D48161533

fbshipit-source-id: 0ded18d8a6149d2e36c327edc436d35ec35184d2
2023-08-09 11:56:44 -07:00
David Vacca 0f244a627a Simplify building RN Android in OSS (#38863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38863

I created a simple way to build RN Android using yarn:

changelog: [internal] internal

Reviewed By: cortinico, NickGerleman

Differential Revision: D48160016

fbshipit-source-id: 5157f0e717f48b32f2a6db0680c02975d9bd7a43
2023-08-09 11:56:44 -07:00
Lorenzo Sciandra ddcbc786dc fix(releases): re-add the file for RN release versioning (#38887)
Summary:
For some reason when my PR https://github.com/facebook/react-native/pull/38666 got imported the renaming of `bump-oss-version` to `trigger-react-native-release` changed into just removing the bump-oss-version: https://github.com/facebook/react-native/commit/c956a1bd6cd1ea88d87497e65a2837dc75b9933b

which is, ofc, not ideal.
This PR simply readds it.

## 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] [FIXED] - re-add the file for RN release versioning

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D48190224

Pulled By: cortinico

fbshipit-source-id: 2bd6cb19daa9c08a51f555e050142f626216bdb4
2023-08-09 10:15:18 -07:00
Riccardo Cipolleschi e480f89ae3 Store publishing log when publishing a new version of React Native fails (#38846)
Summary:
This change adds a step to store the publishing logs as artifacts when the publishing fails, so that we can analyze what happened without relaunching the job

## Changelog:

[Internal] - Add step to upload publishing logs

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

Test Plan: CircleCI stays green

Reviewed By: cortinico

Differential Revision: D48183313

Pulled By: cipolleschi

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

Convert flipper-integartion Gradle file to Kotlin DSL

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

Reviewed By: luluwu2032

Differential Revision: D48187572

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

## Changelog:

[Internal][Changed]: Convert JSPointerDispatcherTest to Kotlin

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

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

## Screenshot of Tests passing locally:

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

Reviewed By: rshest

Differential Revision: D48189629

Pulled By: cortinico

fbshipit-source-id: 92d869f690457986413bcae33a15225aa6e006be
2023-08-09 10:05:14 -07:00
Ruslan Shestopalyuk 51faa1863f More robust handling of errors when trying to load JS bundle
Summary:
## Changelog:
[Internal] -

When trying to load JS bundle, there were conditions under which it could just silently fail, not giving much to start with when troubleshooting.

It was relying on Folly internals to handle the error, and depending on the context it could either throw an exception or just silently exit the process if exceptions are not enabled in Folly.

This diff makes this error handling more explicit, with a clear error message in the log.

Reviewed By: NickGerleman

Differential Revision: D48147690

fbshipit-source-id: 1bb08ad17a880989e829c281fe25ee0d4a385d59
2023-08-09 09:29:32 -07:00
Nicola Corti 0a84952ce5 Cleanup the commitlies code (#38889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38889

As we don't really use the commitlies code in CircleCI, I'm cleaning up some of the code used to publish artifacts to the user.

Changelog:
[Internal] [Changed] - Cleanup the commitlies code

Reviewed By: cipolleschi

Differential Revision: D48189398

fbshipit-source-id: c4591ee290eba49224322d44a32052ff292ccbed
2023-08-09 09:23:14 -07:00
Riccardo Cipolleschi 5140d6438d Generate .xcode.env.local at pod install time (#38879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38879

When creating a new app for iOS, you need to have Node installed properly and in the right paths in order for Xcode to pick it up.

Xcode, by default, looks into the following folders for executables:
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/appleinternal/bin:
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:
- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec
- /Applications/Xcodefb.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/appleinternal/bin
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin
- /Applications/Xcode.app/Contents/Developer/usr/bin
- /Applications/Xcode.app/Contents/Developer/usr/local/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin

If `node` is not in one of them, our JS codegen scripts will fail to run. However, as soon as we run some scripts in Xcode, it is too late to properly look for node.

We already had a cocoapod step, running before the build phase, which was creating the `.xode.env` file, setting `NODE_BINARY` to `$(command -v node)`. Unfortunately, when executed by Xcode, that's too late too.

This change creates an `.xcode.env.local` file with the `$(command -v node)` command expanded, so I user can start working locally and quickly.

We had multiple reports and issues related to this configuration online. For example:
- https://www.reddit.com/r/reactnative/comments/15jpj0a/is_there_a_react_native_version_that_just_works/?utm_source=share&utm_medium=web2x&context=3

Note: we cannot automatically create simlinks to node in `/usr/local/bin` as it requires `sudo`.

## Changelog:
[Internal] - Generate `.xcode.env.local` to simplify the creation of an app.

Reviewed By: rshest

Differential Revision: D48111724

fbshipit-source-id: 49cc6375bd80458d69adbc343ead6c4408805eee
2023-08-09 08:38:22 -07:00
Riccardo Cipolleschi e14d27c714 Fix build android in nightlies (#38881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38881

From this [message on discord](https://discord.com/channels/514829729862516747/514832058955202561/1138776351919312986), we broke nightlies yesterday.

## Changelog:
[Internal] - Fix Nightlies

Reviewed By: cortinico

Differential Revision: D48187350

fbshipit-source-id: 0ce051f79185d3abec76de3cfcfeecd91d2f2e9c
2023-08-09 06:30:49 -07:00
Lulu Wu 72b9516cea Enable partial media picking in Marketplace (#38880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38880

Users who interact with your app on Android 14 devices can now grant partial access to their visual media library (Photos/Videos) when an app requests any visual media permissions (READ_MEDIA_IMAGES or READ_MEDIA_VIDEO) introduced in Android 13 (API level 33).

This diff allow enable the partial access via "READ_MEDIA_VISUAL_USER_SELECTED" in Marketplace photo picker

For Android 14 this diff request partial media access plus the normal access, there will be two return cases:
- READ_MEDIA_VISUAL_USER_SELECTED is granted, READ_MEDIA_IMAGES and READ_MEDIA_VIDEO will be denied automatically, there is no need to check the later ones
- READ_MEDIA_VISUAL_USER_SELECTED is denied, then check READ_MEDIA_IMAGES and READ_MEDIA_VIDEO

Changelog:
[Android][Changed] - Enable partial media picking in Marketplace

Reviewed By: NickGerleman

Differential Revision: D48171193

fbshipit-source-id: 644f6c691f9c2c25f981ba2c255044f62b97299d
2023-08-09 06:07:28 -07:00
Riccardo Cipolleschi 494916ec9c Add Caching to e2e tests to save time (#38842)
Summary:
The iOS e2e testing is not caching the cocoapods properly. With this change, we are adding the cache to save some time.

## Changelog:

[Internal] - Add caching to iOS e2e jobs

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

Test Plan:
CircleCI stays green; the job that is using the cache runs faster.

| BEFORE | AFTER |
| --- | --- |
| <img width="554" alt="Screenshot 2023-08-09 at 09 38 48" src="https://github.com/facebook/react-native/assets/11162307/5f175d5d-7dd2-4a55-acab-2063356d2a71"> | <img width="555" alt="Screenshot 2023-08-09 at 09 39 03" src="https://github.com/facebook/react-native/assets/11162307/7058b1eb-6d94-4659-a220-da2f81a9e833"> |

Reviewed By: rshest

Differential Revision: D48183742

Pulled By: cipolleschi

fbshipit-source-id: d55f492751535e4c84b09bb57173ebc2319e02b4
2023-08-09 04:57:04 -07:00
Lorenzo Sciandra c956a1bd6c chore(releases): improve bump oss script to allow less human errors (#38666)
Summary:
One of the limitations of the existing flow for the release crew is that they need to manually remember to publish all the other packages in the monorepo ahead of a new patch release - this PR modifies the logic for the bump-oss-version script (and makes it available via yarn) so that it will not run if:
* there are git changes lying around
* if some of the packages need a new release

it required a bit of refactoring to extract some portions of the logic from the bump-all-package-versions script, but I think the end result is pretty decent.

## Changelog:

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

Pick one each for the category and type tags:

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

[INTERNAL] [CHANGED] - improve bump oss script to allow less human errors

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

Test Plan:
* checkout this branch
* comment L54 of bump-oss-version.js (to remove the check on the branch name)
* run `yarn bump-all-updated-packages`, verify that it works and that it detects that some packages have unreleased code
* run `yarn bump-oss-version -t asd -v asd` (the "fake" parameters are needed to pass the yargs check), verify that it will throw an error because it finds a package that has unreleased code

Reviewed By: mdvacca

Differential Revision: D48156963

Pulled By: cortinico

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

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[INTERNAL] [CHANGED] - Convert to SimpleViewPropertyTest Kotlin

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

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

Reviewed By: NickGerleman

Differential Revision: D48171939

Pulled By: mdvacca

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

Differential Revision: D48178204

fbshipit-source-id: 057881c7aaa207066d6d21b31a24b6d97a3c24ae
2023-08-08 18:17:11 -07:00
Ellis Tsung d6ff5c6d5b Pass hitSlop prop into TextInput Pressability config (#38857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38857

`hitSlop` must be passed into the `usePressability` hook in order for it to take effect. It's a no-op if no hit slop is present

Changelog:
    [Internal][Fixed] - Propagate hit slop prop to TextInput pressability config

Reviewed By: NickGerleman

Differential Revision: D48124538

fbshipit-source-id: a910fdcec55e67d37c84facca297428556ef777e
2023-08-08 17:30:11 -07:00
Xin Chen a8962ce970 Refactor code structure to make it easier for adding new examples (#38799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38799

Refactor the performance comparison examples to make it easier to add new ones.

Changelog:
[General][Internal] - Code refactor

Reviewed By: rshest

Differential Revision: D47857126

fbshipit-source-id: fc8ffbcc94a23b896a53f599161f3bf6e9c2eaad
2023-08-08 15:13:28 -07:00
Arushi Kesarwani 93d9248e02 Downscale test_js_prev_lts to large (#38855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38855

For the `test_js_prev_lts` job we don't need xlarge resources.

The current average usage for `test_js_prev_lts` is around 25%.

We can also downscale to medium in few days if this scales well.

**Insights Dashboard:**

`test_js_prev_lts`

{F1065747013}

Changelog:
[Internal] [Changed] - Downscale test_js_prev_lts job to Large

Reviewed By: cortinico, cipolleschi

Differential Revision: D48125886

fbshipit-source-id: 521fac38a1d699e576bc1ce5a3a29a47bc284e76
2023-08-08 12:51:25 -07:00
David Vacca fc85b60db8 Update documnetation of TurboModule.invalidate() (#38854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38854

Update documnetation of TurboModule.invalidate()

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48130527

fbshipit-source-id: 0ebedaad603beba646f9ad4f047492e88b5f54a0
2023-08-08 12:36:22 -07:00
Siddarth Kumar 1d8727966d add emitBuildEventSchema to parser commons (#38810)
Summary:
[Codegen 119] This PR introduces `emitBuildEventSchema` to parser commons 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 `emitBuildEventSchema` to parser commons and update usages.

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

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

## Screenshot of test passing locally:

<img width="1047" alt="Screenshot 2023-08-07 at 8 03 49 AM" src="https://github.com/facebook/react-native/assets/64726664/ab87f004-d9f8-4b5f-800b-0e724430301f">

Reviewed By: rshest

Differential Revision: D48155051

Pulled By: cipolleschi

fbshipit-source-id: a3db3f4783d60681b366a871b1d2ee32eb864bc0
2023-08-08 11:52:26 -07:00
Nicola Corti e563f0f3fc Use version catalog to consolidate versions for JVM dependencies (#38836)
Summary:
As we had version numbers scattered all over the places, I'm consolidating them to use a version catalog: https://docs.gradle.org/current/userguide/platforms.html

## Changelog:

[INTERNAL] - Use version catalog to consolidate versions for JVM dependencies

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D48150285

Pulled By: cortinico

fbshipit-source-id: 83a1867aace5395d9a10fadd6c6ab11c31fa14b5
2023-08-08 11:37:43 -07:00
Burak Güner 639b4892b4 ImageResizeModeTest.java => ImageResizeModeTest.kt (#38844)
Summary:
This PR converts ImageResizeModeTest into Kotlin as requested in https://github.com/facebook/react-native/issues/38825 .

## Changelog:

[INTERNAL] [CHANGED] - Convert  to ImageResizeModeTest Kotlin

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

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

Reviewed By: rshest

Differential Revision: D48154896

Pulled By: cortinico

fbshipit-source-id: df131a4f3f9190af8d7b77e625e050f02824ad07
2023-08-08 11:33:36 -07:00
David 3660b7cf73 ☂️ BaseViewManagerTest.java => BaseViewManagerTest.kt (#38841)
Summary:
Issue: https://github.com/facebook/react-native/issues/38825#issuecomment-1669202200

## Changelog:

[GENERAL] [CHANGED] - `BaseViewManagerTest.java` => `BaseViewManagerTest.kt`

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

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

Reviewed By: cortinico

Differential Revision: D48153909

Pulled By: rshest

fbshipit-source-id: cac20a64b72b77c23edb2e20b65717c1a425a08a
2023-08-08 11:21:19 -07:00
Arushi Kesarwani 8cb4a52761 Downscale test_js & find_and_publish_bumped_packages jobs to large (#38827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38827

For the `test_js` and `find_and_publish_bumped_packages` jobs we don't need xlarge resources.

The current average usage for `test_js` and `find_and_publish_bumped_packages` is around 25%.

We can also downscale to medium in few days if this scales well.

**Insights Dashboard:**

`test_js`

{F1065742668}

`find_and_publish_bumped_packages`

{F1065742888}

Changelog:
[Internal] [Changed] - Downscale test_js and find_and_publish_bumped_packages` jobs to Large

Reviewed By: cortinico

Differential Revision: D48125531

fbshipit-source-id: 004c2306fd224a5798a6b084fb75a79896695b15
2023-08-08 11:18:17 -07:00
tarunrajput 4343144c81 Migrate CustomLineHeightSpanTest to kotlin (#38847)
Summary:
Migrate `CustomLineHeightSpanTest` to kotlin as part of ☂️ 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] - Migrate CustomLineHeightSpanTest to kotlin

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

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

Reviewed By: rshest

Differential Revision: D48155397

Pulled By: cortinico

fbshipit-source-id: bbaa7d08a84c609bc64b48a08e1b91078ce6ef23
2023-08-08 10:49:15 -07:00
Intl Scheduler 798811cbeb translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907937645695
Sandcastle Job Instance ID: 31525198404545727
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48150098

fbshipit-source-id: 57f6890962bfa7c03000eece13e9d80c775fa9d0
2023-08-08 05:31:14 -07:00
Nicola Corti 501c80b724 Build only arm64 when building PRs. All archs for nightlies and releases. (#38816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38816

To save resources, we should build only arm64 for PRs and commits to mains.
Our Android ABIs are really similar and we should just build the most popular. For nightlies/releases
instead we'll have to build all the archs.

Changelog:
[Internal] [Changed] - Build only arm64 when building PRs. All archs for nightlies and releases.

Reviewed By: cipolleschi

Differential Revision: D48112361

fbshipit-source-id: 69e172a4ea69f844b344a9fc6ac4ee0471b40c36
2023-08-08 03:53:05 -07:00
Intl Scheduler 2f886ba95c translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907937543126
Sandcastle Job Instance ID: 22517999148323898
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48146361

fbshipit-source-id: ecd68640881e032dc9bfab9d01c26a14e6be6b13
2023-08-08 01:54:23 -07:00
Nicola Corti 30fb164325 Downscale Test Android Template jobs to Large (#38815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38815

For the template jobs, we don't need xlarge resources but we can probably use medium.
I've checked on the Insights dashboard and the average usage is at 25%

Changelog:
[Internal] [Changed] - Downscale Test Android Template jobs to Large

Reviewed By: cipolleschi

Differential Revision: D48112362

fbshipit-source-id: 3745a90d12b96818430264be43ae2672bb05d436
2023-08-08 01:48:12 -07:00