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