Commit Graph
28604 Commits
Author SHA1 Message Date
David Vacca e17c4a2ac9 Enable 'allWarningsAsErrors' for CI android build (#38969)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38969

As we migrate java to kotlin I noticed that we've introduced few warnings here and there.
In this diff I'm enabling allWarningsAsErrors in the CI

The reasoning is that we are just starting with Kotlin and I believe we should enable 'allWarningsAsErrors' for CI android builds to make sure the codebase grow healthy, this will also help us to cleanup apis. e.g. create APIs for
deprecated java APIs.

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D48239603

fbshipit-source-id: dd7a5df98cea82bf9bab6b26c4b1baa9f743ccbf
2023-08-11 14:31:05 -07:00
Luna Wei 824c1c6d07 Math.floor the top, bottom values of an item in a VirtualizedList (#38962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38962

Changelog: [General][Changed] Math.floor the top and bottom dimensions of a cell item when determining viewability.

Reviewed By: NickGerleman

Differential Revision: D48212402

fbshipit-source-id: 0ba7d5c218477c257a4504391940d916e4832f91
2023-08-11 13:57:21 -07:00
Luna Wei ed0f60f017 RNTester: Remove extra padding on RNTesterPage affecting e2e test (#38938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38938

Changelog: [Internal] - Remove padding in RNTesterPage

Reviewed By: makovkastar

Differential Revision: D48205648

fbshipit-source-id: edc036144e256d3838cdb3741266bf9c93aa5a71
2023-08-11 13:57:21 -07:00
Eric Rozell 68c7cfe62d Fixes regression of prop parsing for elevation (#38959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38959

When refactoring ViewProps in D47492635, `elevation` prop parsing was dropped. This restores it.

## Changelog:
[General] [Fixed] - Fabric regression for elevation prop in Android

Reviewed By: sammy-SC, mdvacca

Differential Revision: D48269510

fbshipit-source-id: 91867a6689857d0f07cf464ea6e5d6e7cee1af54
2023-08-11 12:44:05 -07:00
Vincent Riemer 7cd69962d0 Refactor conditional event emitting to the C++ layer (#38674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38674

Changelog: [Internal] - Refactor conditional pointer event emitting to the C++ layer

Some background: early on in the implementation of Pointer Events a concern was brought up that events related to hovering pointers could saturate the JS thread if they were fired all the time unconditionally, so as a mitigation we would check in native to see if listeners in the tree were listening for those events and only fire them if there were listeners.

Now since we're going to be moving some of the event derivation logic to the C++ layer we need to receive all the events — but recreate the conditional firing in the C++ layer so we can still avoid saturating the JS thread. That's what this diff does.

The only change I see being potentially contraversial is the fact that I needed a way to turn an `EventTarget` (the only information I receive regarding which node the event is firing on) to its cooresponding `ShadowNode` which I did in the method `GetShadowNodeFromEventTarget`. It essentially does the exact same thing the `getNodeFromInternalInstanceHandle` method in `ReactNativePublicCompat.js`, but in C++ against the JSI API. I don't know if there's a better way to do this but this was the best one I came up with that actually works.

Reviewed By: NickGerleman

Differential Revision: D47852371

fbshipit-source-id: 6c00c2fcfdfd49314c96d044d36272e028e074ff
2023-08-11 12:23:22 -07:00
Rob Hogan 86968c1104 Use modern timers in monorepo Jest tests (#38955)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38955

Jest introduced "modern" timers based on `sinon/fake-timers` in Jest 26 ([release announcement](https://jestjs.io/blog/2020/05/05/jest-26#new-fake-timers)), and they became the default in Jest 27, in May 2021.

Modern timers have more capabilities - they were introduced with support for `queueMicrotask`, mocking `Date`, etc., and they've continued to receive more attention from the Jest team since - they're now much more comprehensive and more configurable than legacy timers.

Importantly, because they're not based on Jest mocks, they're not affected in surprising ways by eg `jest.resetAllMocks()` (a particularly confusing side-effect when fake timers are enabled globally, as in our setup).

This migrates RN's own tests and config to modern fake timers, or real timers where that's more appropriate.

NOTE: In cases where non-trivial changes to the tests are required, four test files are individually opted-in to `legacyFakeTimers` with a `TODO(legacy-fake-timers)`. I'll open these up for community contributions to fix.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48189907

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

Differential Revision: D48271626

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

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

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

Reviewed By: cipolleschi

Differential Revision: D48263910

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

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

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

Reviewed By: cipolleschi

Differential Revision: D48263891

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

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

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

Reviewed By: mdvacca

Differential Revision: D48233147

fbshipit-source-id: afd12e5377d2d88c53cef4e6913b5c49b3da5bbb
2023-08-11 08:34:37 -07:00
Riccardo Cipolleschi 4dbf5dca7a Remove StaticLibraries job of RNTester as they are duplicated
Summary:
Removing the `test_ios_rntester` jobs for the following config:
- (OldArch, JSC, StaticLibraries)
- (OldArch, Hermes, StaticLibraries)

As this job just test that this configuration can be built and we have two other jobs (`test_ios-Hermes` and `test_ios-JSC`) which builds the same configs (so the test is duplicated) and they run unit and integration tests on top of these.

bypass-github-export-checks

## Changelog:
[Internal] - Remove duplicated `test_ios_rntester` jobs

Reviewed By: cortinico

Differential Revision: D48264664

fbshipit-source-id: 6dbf0edb9aba9ca8340b7c722b4f5c189c961577
2023-08-11 06:20:39 -07:00
tarunrajput acaf667433 migrate MyNativeViewManager to kotlin (#38916)
Summary:
Migrate MyNativeViewManager 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 MyNativeViewManager to kotlin

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

Test Plan: Verify RN Tester runs with `yarn android`

Reviewed By: cortinico, NickGerleman

Differential Revision: D48221141

Pulled By: mdvacca

fbshipit-source-id: 1cc5dc4346f265883e79893b69f0da5e8c632f2a
2023-08-11 05:58:23 -07:00
Nicola Corti 41af21b42d Fix warnings for Gradle 9 (#38927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38927

I've done a pass and fixed most of the warnings for Gradle 9:
- project.buildDir is deprecated in favor of project.layout.buildDirectory
- I've updated 3rd party Gradle Plugins that we depend on

There are still two warnings which are outside of our control:
1. One is inside AGP and will be fixed with AGP 8.2 - Source https://issuetracker.google.com/issues/279306626
2. Another one is inside nexus-publish and should ideally be fixed by 2.0 https://github.com/gradle/gradle/issues/25206 Will bump the release once it's out

Changelog:
[Internal] [Changed] - Fix warnings for Gradle 9

Reviewed By: mdvacca

Differential Revision: D48231760

fbshipit-source-id: 27d704324ea33cfc8aa0164fa437b80aab425960
2023-08-11 04:58:19 -07:00
Riccardo Cipolleschi 494312991a Remove Xcode - hermes integration test
Summary:
Removing this job as the e2e test does basically the same work and run some e2e tests on top of that.

bypass-github-export-checks

## Changelog:
[Internal] - Remove Xcode<-->Hermes integration as it is dupicated by the e2e_ios

Reviewed By: cortinico

Differential Revision: D48229891

fbshipit-source-id: dbc8ef0f62c8839773232d5b07385b1006c601ce
2023-08-11 03:39:16 -07:00
Riccardo Cipolleschi 8fa584f1e6 Fix Main by removing the last setup_artifacts (#38943)
Summary:
CircleCI is broken because we deleted a command but forgot to remove one last usage of it.

bypass-github-export-checks

## Changelog:

[Internal] - Remove last usage of setup_artifacts

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

Test Plan: CircleCI is green

Reviewed By: Andjeliko, rshest, GijsWeterings

Differential Revision: D48263252

Pulled By: cipolleschi

fbshipit-source-id: 2f169952479389e476dfab0f88474c759728d3b4
2023-08-11 03:28:18 -07:00
Nicola Corti c79e30b313 Remove setup_artifacts as unnecessary (#38901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38901

This step is really necessary or if the folders will be created on the fly.

Changelog:
[Internal] [Changed] - Remove setup_artifacts as unnecessary

Reviewed By: mdvacca

Differential Revision: D48197595

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

Convert external-artifacts Gradle file to Kotlin DSL

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

Reviewed By: cipolleschi

Differential Revision: D48187571

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

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

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D48244308

fbshipit-source-id: d0a090d92c4c7276fdeea7fb1275900e5e0d3617
2023-08-10 20:02:46 -07:00
Tim Yung 30e2345b26 Pressability: Replace cancelable Change w/ blockNativeResponder
Summary:
{D47225928} introduced a bug affecting `TextInput` on iOS that prevented native text editing capabilities. This reverts the change to a previous incarnation of the diff where javache created a new `blockNativeResponder` option instead of piggybacking off the existing `cancelable` option.

Changelog:
[iOS][Changed] - Restored `cancelable` option in `Pressability` configuration to not block native responder, and instead introduced a new optional `blockNativeResponder` boolean option to accomplish the same thing.

Reviewed By: mdvacca

Differential Revision: D48246530

fbshipit-source-id: 8a406d462cce0e5e5a108607e1ac1d3203ea229c
2023-08-10 17:53:58 -07:00
Arushi Kesarwani 01b9b509cf ReactHostInterface & ReactHost refactoring (#38826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38826

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

changelog: [internal] internal

allow-large-files

Reviewed By: cortinico

Differential Revision: D48054716

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

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

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D48238321

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

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D48234859

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

Fix compilation warnings in JSPointerDispatcherTest.kt

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48213629

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

Fix few warnings in  SimpleViewPropertyTest

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48206413

fbshipit-source-id: f398e035624200cb6fc327568cf85e015ad83d76
2023-08-10 16:22:40 -07:00
David Vacca 9e51f59211 Increate androidx dependency versions to latest ones (#38904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38904

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D48201237

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

Rename jSBundleLoader -> jsBundleLoader

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051752

fbshipit-source-id: 4443e9fc1801e3a0794b9dfad677318e897d5400
2023-08-10 15:14:13 -07:00
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