Commit Graph

28675 Commits

Author SHA1 Message Date
Riccardo Cipolleschi
4deb29ae1b Make prettier ignore generated folders (#39076)
Summary:
This change introduce the `.prettierignore` file to skip some generated folders.
Prettier was checking that the JS files inside the Pods/ and the sdks/ folders were properly formatted.
However, we don't control those folders.

Running prettier in those folders was taking extra 10s to 30s on average, some time we can now save.

## Changelog:

[Internal] - Make prettier skip generated folders

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

Test Plan:
Tested locally

| Before | After |
| --- | --- |
| <img width="593" alt="Screenshot 2023-08-18 at 11 28 51" src="https://github.com/facebook/react-native/assets/11162307/65eb773b-1966-49cd-bd51-6310fe48cf3b"> | <img width="515" alt="Screenshot 2023-08-18 at 11 29 09" src="https://github.com/facebook/react-native/assets/11162307/969ff9e4-f05b-43bf-9a95-7b37dea7d3d0"> |

Reviewed By: christophpurrer

Differential Revision: D48466583

Pulled By: cipolleschi

fbshipit-source-id: 60a4335af2c337c6d3d143d8d5b56d4a41073feb
2023-08-18 08:42:13 -07:00
Tim Yung
ffc9ff066a RN: Enforce Manifest Constraints w/ ESLint (#39064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39064

Creates a new lint rule that enforces the following constraints:

- `react-native/monorepo` cannot have `dependencies`.
- `react-native` cannot have `devDependencies`.

This also includes a lengthy comment in the rule definition explaining why these constraints exist, so that future contributors can make an informed decision when reconsidering these constraints.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D48448633

fbshipit-source-id: 26b0d74b9120ddfd2a6a72bb91f86a98c8d679ef
2023-08-18 07:48:56 -07:00
Moti Zilberman
be469c1b86 Resolve absolute paths of Babel presets/plugins in Node build config (#39079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39079

Changelog: [Internal]

The Babel config for Node packages in the RN repo, added in D47760330 / D48312463, relies on [name normalization](https://babeljs.io/docs/options#name-normalization) to resolve the Babel presets and plugins that it references. This works for OSS but can cause other integrations to fail to resolve the packages, depending on the details of how they're installed. Here we eagerly resolve the packages when constructing the Babel config.

Reviewed By: huntie

Differential Revision: D48469386

fbshipit-source-id: d9c15883169e30984d93fc6a5d9544752db5d2c8
2023-08-18 07:32:46 -07:00
Riccardo Cipolleschi
641be98b1e Split Config.yml to run jobs selectively (#39042)
Summary:
Right now, every PR runs the whole test suite. For example, a changelog PR, will run all the tests. As of last month, that meant quite a few $s per single run.

With this PR, we are going to leverage dynamic configuration and file filtering to create a config.yml on the flight, depending on the files changed by the commit/pr.

They way it works is the following:
- It starts a setup workflow in CircleCI.
- This workflow fetch the list of files that have been changed in the current commit.
- It executes a bunch of filtering and computation to understand which tests makes sense to run.
- It creates a config on the flight to run those.
- It continue the pipeline on that config.

Currently, the way it works is the following:
- If a `.md` file has been modified => run nothing
- If only files in the `ReactAndroid` folder are modified => run tests for android only
- If only files in the `React` folder are modified or `ruby` files are modified => run only iOS tests
- If only js files, not in the scripts folder are modified => run only JS tests
- if only files in the e2e folder are modified => run only e2e tests
- else => run everything.

Of course, we can play and modify those filters t make sure that they reflect the work and the tests to the best we can.

bypass-github-exports-checks

## Changelog:
[Internal] - Split circleci config and run test selectively.

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

Test Plan:
- [X] Tested on the local branch for general sanity check.
- [X] Import it in fbsource
- [x] Create a stacked diff which changes only a md file => verify that no tests are run.
- [x] Create a stacked diff which changes only files in ReactAndroid => verify that only android tests run.
- [x] Create a stacked diff which changes only files in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only ruby files => verify that only iOS tests run.
- [x] Create a stacked diff which changes ruby files and file in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only files JS not in the script folder => verify that JS tests run.
- [x] Create a stacked diff which changes only JS files in the script folder => verify that the whole suite starts.
- [x] Create a stacked diff which changes only files in the E2E folder => verify that only E2E files runs.
- [x] Trigger a nightly pipeline => verify that parameters are passed to the generated config.

Reviewed By: NickGerleman

Differential Revision: D48394437

Pulled By: cipolleschi

fbshipit-source-id: 771f3e68daa8318d2b73dd91ce85a41488110c04
2023-08-18 07:22:22 -07:00
Stewart Sum
3dbb759506 Convert Java tests for JSDebuggerWebSocketClient to Kotlin (#38941)
Summary:
Migrate Java tests to Kotlin for the JSDebuggerWebSocketClient class.

## Changelog:

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Update Java tests to Kotlin for the referenced file

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

Test Plan: All unit tests passed.

Reviewed By: mdvacca, rshest

Differential Revision: D48354172

Pulled By: cortinico

fbshipit-source-id: e8d3c98216b4e2c3ff462433c7e37d628d06f0c6
2023-08-18 05:22:09 -07:00
Riccardo Cipolleschi
c326ec0475 Add retry mechanism to test_e2e_android to reduce flakyness (#39068)
Summary:
We figured that android e2e tests are a bit flakier than needed. This change add a retry mechanism to rerun the tests up to 3 times in order to try and reduce the flakyness there.

## Changelog:

[Internal] - Add retry to Android e2e tests

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

Test Plan: CircleCI stays green

Reviewed By: cortinico

Differential Revision: D48463517

Pulled By: cipolleschi

fbshipit-source-id: cdf3dca047dce89cc5d2dccc9b847283b93bbd36
2023-08-18 04:08:56 -07:00
Nicola Corti
606e14552d Set android.suppressUnsupportedCompileSdk=34 for the root project
Summary:
Android is currently raising a warning as we're using AGP 8.1 with SDK 34.
I'm suppressing this warning that we can remove once we bump to AGP 8.2

Changelog:
[Internal] [Changed] - Set android.suppressUnsupportedCompileSdk=34 for the root project

Reviewed By: mdvacca

Differential Revision: D48437747

fbshipit-source-id: 6d2ed5f4f021052934206fd9149c048cdd5350df
2023-08-18 03:07:41 -07:00
Alex Hunt
c82cf64a22 Move metro-inspector-proxy into dev-middleware (#39045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39045

## Context

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

## Changes

- Relocates `metro-inspector-proxy` source from the Metro repo into the React Native repo as part of the `react-native/dev-middleware` package.
    - Drops the `runInspectorProxy` entry point.
- Attaches the Inspector Proxy to the `createDevMiddleware()` API as the new integration point for this functionality.
- Documents migrated endpoints + usage of `createDevMiddleware()` in README.

Changelog: [Internal]
Metro changelog: None (`metro-inspector-proxy` is now an internal component of `react-native`, covered in the [release notes for 0.78.1](https://github.com/facebook/metro/releases/tag/v0.78.1))

Reviewed By: motiz88, blakef

Differential Revision: D48066213

fbshipit-source-id: 3fbef5d881f6f451cb5955dcbbc362c53347437e
2023-08-18 01:38:10 -07:00
Nick Gerleman
2ec920e65f Bump protobufjs
Summary:
Update to 6.11.4 and 7.2.4 to address alert for CVE-2023-36665

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48382181

fbshipit-source-id: 32f00d968e6383efb448cd41cb3fa659723ecf3a
2023-08-18 00:09:03 -07:00
Nick Gerleman
5d47bad74f Fix segfault calling YGJNILogFunc (#39051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39051

X-link: https://github.com/facebook/yoga/pull/1344

`YGJNILogFunc` has a bug where it uses a `va_list` to determine the length of a printf string, then reuses the same `va_list` later after it has already been iterated through. Even if no arguments are present, this may cause a crash looking something like:

```
C  [libsystem_platform.dylib+0xf12]  _platform_strlen+0x12
C  [libsystem_c.dylib+0x31bf]  __vfprintf+0x1339
C  [libsystem_c.dylib+0x307ce]  _vsnprintf+0x100
C  [libsystem_c.dylib+0x6965]  vsnprintf+0x44
C  [libyoga.dylib+0x5161]  YGJNILogFunc(YGConfig*, YGNode*, YGLogLevel, void*, char const*, __va_list_tag*)+0x59
```

Fixing this fixes crashing unit tests which are not explicitly disabled.

Reviewed By: yungsters

Differential Revision: D48388548

fbshipit-source-id: 492e7a89aeb5f9d15485ce31641875a295356bef
2023-08-18 00:07:51 -07:00
Evan Charlton
04fb0122b2 feat(rn-tester): Improve the Modal tester (#38977)
Summary:
## Summary:

The modal tester in the sandbox was lacking a bit of functionality that the Modal component exposes -- especially on Android. This change revamps the Modal page to more-closely resemble the API documentation by exposing all of the options, and annotating which ones are reserved for the different platforms.

Additionally, this change puts the modal controls into the created modal itself. This allows the user to more-easily test what happens if the props change during the lifespan of the modal (related PR: https://github.com/facebook/react-native/issues/38947).

 ## 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] - Revamp Modal tester in rn-tester

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

Test Plan:
| Control page | Modal (with `transparent=true` on Android) |
|:--:|:--:|
| ![image](https://github.com/facebook/react-native/assets/418560/ef49cb94-14d8-4ebe-ade5-699b8e67ba5c) | ![image](https://github.com/facebook/react-native/assets/418560/d4bb6ef5-7d8c-4d5f-b4d8-37b8d736b19a) |

Reviewed By: yungsters

Differential Revision: D48414351

Pulled By: NickGerleman

fbshipit-source-id: 54bece639f4c64132dfb21c54c91d46972f5a335
2023-08-17 23:58:28 -07:00
Saad Najmi
3eeee11d7a Guard JSGlobalContextSetInspectable behind a compile time check for Xcode 14.3+ (#39037)
Summary:
An earlier [change](8b1bf058c4) I made (that huntie resubmitted) only works on Xcode 14.3+ (See more info [here](https://github.com/react-native-community/discussions-and-proposals/discussions/687)). This change adds the appropriate compiler checks so that the change is compatible with Xcode 14.2 and earlier, and therefore cherry-pickable to 0.71 and 0.72.

The check works by checking if iOS 16.4+ is defined, which is the closest proxy I could find for "Is this Xcode 14.3".

## Changelog:

[IOS] [CHANGED] - Guard `JSGlobalContextSetInspectable` behind a compile time check for Xcode 14.3+

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

Test Plan: I can't actually test on Xcode 14.2 (it won't launch on my MacBook 😢), but I made a similar [PR](https://github.com/microsoft/react-native-macos/pull/1848) in React Native macOS, whose CI checks run against Xcode 14.2 and I'm getting passing checks there.

Reviewed By: huntie

Differential Revision: D48414196

Pulled By: NickGerleman

fbshipit-source-id: ba10a6505dd11d982cc56c02bf9f7dcdc104bbec
2023-08-17 22:04:44 -07:00
Nick Gerleman
c522837d9e ListMetricAggregator UTs - contentLength caching (#38738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38738

UTs about returned cached content length and cached content length requirement in RTL.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D47978634

fbshipit-source-id: 509b2b60cae4a8755745710fb5872da27c8ce7a3
2023-08-17 21:31:31 -07:00
Nick Gerleman
298d297e54 Null out ListMetricsAggregator contentLength on orientation change (#38937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38937

It is a logic error to query for list metrics when a valid list content length has not yet been observed.

An invariant is meant to catch this if it happens, but a non-default orientation causes us to zero out a value which is null, and our null check does not catch this, and we return a nonsense value.

Change from zeroing out the field to nulling it out instead.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D48251645

fbshipit-source-id: 5c7e16f694db4ddb0d37b6092de2e75ee8d6c7d3
2023-08-17 21:31:31 -07:00
Lynden Kuwada
9f47b6af71 Revert D48140317: delete unused RCTSurfaceHostingView selectors
Differential Revision:
D48140317

Original commit changeset: 930c79b3828e

Original Phabricator Diff: D48140317

fbshipit-source-id: b1a16b9c08dc2ee19aa39b63c9234fbf9fa81c35
2023-08-17 18:23:57 -07:00
Phillip Pan
f2b102485f Back out "remove RCTSurfaceSizeMeasureMode from public contract of RCTSurfaceHostingProxyRootView"
Summary:
Original commit changeset: c3240ad4c1e6

Original Phabricator Diff: D48140102

Changelog: [Internal]

i suck

bypass-github-export-checks

Reviewed By: makovkastar

Differential Revision: D48449490

fbshipit-source-id: e398726dda8b8f08ab55326c1f210b3b01b09dc5
2023-08-17 17:27:58 -07:00
Phillip Pan
8548eb5d2a delete unused RCTSurfaceHostingView selectors (#38869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38869

## Changelog:

[iOS][Breaking]- After [#38866](https://github.com/facebook/react-native/pull/38866) and [#38868](https://github.com/facebook/react-native/pull/38868), these are not needed anymore. instead of depending on the host view and overriding `createSurfaceWithBridge:` in a subclass create a specialized surface, we just rely on composition instead and provide a surface to the hosting view.

Reviewed By: mdvacca, cipolleschi

Differential Revision: D48140317

fbshipit-source-id: 930c79b3828e0197c5dd2841875b830fc211e2a6
2023-08-17 16:59:44 -07:00
Zeya Peng
915e9bd227 executeMount: declare ternary fallback value beforehand (#38991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38991

Changelog: [Internal]

Reviewed By: jlhe97, sammy-SC

Differential Revision: D48198573

fbshipit-source-id: 222beb27f4648750877fd6b42904b7b3eab5c9ce
2023-08-17 13:48:51 -07:00
Xin Chen
17f957aadd Update startup perf api to accept undefined/null values (#38323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38323

This change makes the returned values from `performance.reactNativeStartupTiming` to accept null or undefined. This is done as some platforms may not have certain startup timing information, and as a default value, it's discussed that null/undefined is better than zero.

- Use `unorderedMap` instead of custom timing object for the C++ native module return value
- Use `std::nan` as initialized value for unset doubles
- Update examples to reflect the latest changes

Changelog:
[General][Internal] - Make the return values for `reactNativeStartupTiming` possible to be null or undefined

Reviewed By: mdvacca

Differential Revision: D43885535

fbshipit-source-id: f35292f2e9cdf98750d0d80b9e3bcdcddc560fb7
2023-08-17 12:35:57 -07:00
Thiago Brezinski
4a48fd2bb5 Convert ReactPropConstantsTest to Kotlin (#39005)
Summary:
Converts ReactPropConstantsTest to Kotlin, as requested in 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] - Convert ReactPropConstantsTest to Kotlin
[INTERNAL] [CHANGED] - Add null-check to ViewManagersPropertyCache.java

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

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

Reviewed By: mdvacca, rshest

Differential Revision: D48430460

Pulled By: cortinico

fbshipit-source-id: cc425f14bf15ec6e5a334c631d52ca962d06a2a9
2023-08-17 11:02:29 -07:00
Fábio Henriques
10feddcf03 Convert MatrixMathHelperTest to Kotlin (#39046)
Summary:
This PR converts `MatrixMathHelperTest.java` to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/38825).

## Changelog:

[INTERNAL] [CHANGED] - Convert MatrixMathHelperTest to Kotlin

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

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

Reviewed By: mdvacca

Differential Revision: D48430157

Pulled By: cortinico

fbshipit-source-id: d371e6958a561797ffd8f9e14382a144f82f105e
2023-08-17 10:35:58 -07:00
Intl Scheduler
d1e2cbb4b3 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940152907
Sandcastle Job Instance ID: 1024566126
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48431884

fbshipit-source-id: e6eb7f6002121abe6c7dea907b55fce4875d1bf7
2023-08-17 06:09:52 -07:00
Phillip Pan
8b4a3533e8 delete unused RCTSurfaceHostingProxyRootView initializers (#38868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38868

## Changelog:

[iOS][Breaking] - After [#38864](https://github.com/facebook/react-native/pull/38864), these are not needed anymore. there's some logic with the bridge, but since we're treating new arch as one piece moving forward, i don't really think they're that important. plus that logic is like really old.

Reviewed By: mdvacca

Differential Revision: D48140101

fbshipit-source-id: 0137becbfca493589d20f9ac8abace2b4c908ddd
2023-08-17 01:52:48 -07:00
Arushi Kesarwani
aafbe7a458 Fixing getSurfaceHandler() to package in ReactSurface (#39029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39029

Reducing visibility of `getSurfaceHandler()` in ReactSurface

changelog: [internal] internal

Reviewed By: luluwu2032

Differential Revision: D48376643

fbshipit-source-id: 6e0873372d96435cc5a3b8baa54b1b592e7327c4
2023-08-16 21:23:56 -07:00
Arushi Kesarwani
8fa19abd71 Refactor ReactSurfaceImpl.detach() (#39050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39050

Adding `detach()` to the interface `ReactSurface`

changelog: [internal] internal

Reviewed By: mdvacca

Differential Revision: D48377508

fbshipit-source-id: 210bd39ae96f0bce4d929afbc985811fe0cc0aa2
2023-08-16 17:46:24 -07:00
Phillip Pan
0d83c1a668 remove RCTSurfaceSizeMeasureMode from public contract of RCTSurfaceHostingProxyRootView (#38866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38866

## Changelog:

[iOS][Breaking] - Remove sizeMeasureMode argument from RCTSurfaceHostingProxyRootView constructor

All callsites to `initWithSurface:sizeMeasureMode:moduleRegistry` pass down `RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact`. since that's the case, let's simplify the constructor since `initWithSurface:` passes that value by default.

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D48140102

fbshipit-source-id: c3240ad4c1e650397844837e4a071ff7bd26ee15
2023-08-16 17:33:32 -07:00
Nick Gerleman
65b7680720 Fix bad comparison in RCTScrollViewComponentView RTL (#39030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39030

D29164056 fixed `scrollTo` coordinate space in RTL, but D38499666 regressed it by adding a comparison before the RTL conversion happens.

This makes `scrollTo` no-op if we are scrolling from the beginning to the end of the list, since the end of the list is `x: 0` in cartesian coordinates, and the start of the list is `x: 0` in flow-relative coordinates.

Do coordinate conversion before the early exit check.

Changelog:
[iOS][Fixed] - Fix bad comparison in RCTScrollViewComponentView RTL

Reviewed By: rshest

Differential Revision: D48378414

fbshipit-source-id: 14b0b9bb3b22828c290bbbc93b907d8c0e264995
2023-08-16 16:35:52 -07:00
Phillip Pan
676676c954 kill RCTFabricSurfaceHostingProxyRootView (#38864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38864

## Changelog:

[iOS][Breaking] - Deleting RCTFabricSurfaceHostingProxyRootView

We currently have 3 different container view classes in new architecture: `RCTFabricSurfaceHostingProxyRootView`, `RCTSurfaceHostingProxyRootView`, and `RCTSurfaceHostingView`. it's a little complicated for the current use case, so there's an opportunity to simplify.

in this PR, i get rid of `RCTFabricSurfaceHostingProxyRootView` by relying on the composable behavior of surface and host views instead of existing internal reflection logic that depends on inheritance. these are cleaned up in D48140101 and D48140317.

i checked GH search and no one is really using this in a fundamental way.

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D48139820

fbshipit-source-id: 068b994a8b068a4107397f1862356b8fa1da961f
2023-08-16 13:34:54 -07:00
Kolin Krewinkel
02408e1df2 Override canScrollHorizontally() to expose when scrolling is disabled
Summary:
**Context**
We have a bug where a ReactHorizontalScrollView is set to scrollEnabled = false. However, it still has a "scrollable width." When other components evaluate how to handle touches, they assume this view wants it...but `onInterceptTouch()` will return NO. To fix this in the most generic way and without making the other code aware of this class, I'm overriding `View.canScrollHorizontally()`.

**Notes**
- I also considered making the other code invoke onInterceptTouch(), but I don't want to have non-OS code invoking that and messing up state. The order of the input events matters.
- The [docs explicitly state](https://developer.android.com/reference/android/view/View#canScrollHorizontally(int)) "this is without regard to whether the view is enabled or not, or if it will scroll in response to user input or not"
  - I'm not so sure this is useful.
  - Other Android OS classes disregard it. :)
    - https://cs.android.com/android/platform/superproject/+/master:packages/apps/Messaging/src/com/android/messaging/ui/PagingAwareViewPager.java;l=91?q=%20canScrollHorizontally%5C(&start=21
    - https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/src/com/android/systemui/qs/NonInterceptingScrollView.java;l=107?q=canScrollHorizontal

Reviewed By: NickGerleman

Differential Revision: D48343681

fbshipit-source-id: 4e133bc5509f68efdf510115f26aa56cfa115d94
2023-08-16 13:28:17 -07:00
Xin Chen
c8a479c641 Update example description to help understand them better (#38797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38797

Changelog:
[Internal] - Refactor description to performance comparison examples in RNTester

Reviewed By: christophpurrer

Differential Revision: D47892300

fbshipit-source-id: 8006cbef9f30472adc54ebf0f87a8b52c840a824
2023-08-16 13:27:40 -07:00
giolaq
35b913017b Migrated UIManagerModuleConstantsTest.java to UIManagerModuleConstant… (#38994)
Summary:
This PR converts UIManagerModuleConstantsTest.java into Kotlin as requested in [https://github.com/facebook/react-native/issues/38825](https://github.com/facebook/react-native/issues/38825)

## Changelog:

[INTERNAL] [CHANGED] - Convert to UIManagerModuleConstantsTest.java to UIManagerModuleConstantsText.kt

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

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

<img width="1297" alt="Screenshot 2023-08-14 at 17 43 14" src="https://github.com/facebook/react-native/assets/2865799/13a9c2b0-3f47-48da-b663-87e2cb652c69">

Reviewed By: mdvacca, rshest

Differential Revision: D48387980

Pulled By: cortinico

fbshipit-source-id: d5ab3f9a4ada2d0442daecb6c893458d9baa7558
2023-08-16 12:16:03 -07:00
Sam Zhou
0a0ce8403e Also parse js.flow files with hermes-parser (#39048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39048

Similar to D48047348, we should also use hermes-parser to parse .js.flow files to support newer Flow syntax.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48398780

fbshipit-source-id: 280ac546493361c4421449f86bf3f735b93a18e8
2023-08-16 11:27:13 -07:00
Samuel Susla
492c9d1041 Fix condition to detect use of Paper renderer in TextInput on Android
Summary:
changelog: [internal]

In D47993140 I removed FabricViewStateManager but made a mistake during refactoring in one of the conditions that detects if we are in paper or fabric.. This fixes it.

Reviewed By: cipolleschi

Differential Revision: D48390478

fbshipit-source-id: ff6e728f3eaae755b2200e9cd8edd3acdc4708aa
2023-08-16 10:07:33 -07:00
Riccardo Cipolleschi
e7f6f079cb Implement retry mechanism during yarn installation (#39020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39020

Sometimes yarn fails to intall, we are implementing a retry mechanism

## Changelog:
[Internal] - Add retry mechanism in template jobs.

Reviewed By: cortinico

Differential Revision: D48234860

fbshipit-source-id: ece3c40051ff143837ed79db2390fbb599fa8ae2
2023-08-16 08:31:44 -07:00
Riccardo Cipolleschi
623f44c7ce Revert D48118162: Split CircleCI config
Differential Revision:
D48118162

Original commit changeset: 73c8071a7e80

Original Phabricator Diff: D48118162

fbshipit-source-id: f070601c8631a9b91bb298ce94a9eb7cee13e059
2023-08-16 05:46:52 -07:00
Intl Scheduler
61255a3013 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940106395
Sandcastle Job Instance ID: 4503600647715906
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48391625

fbshipit-source-id: 30cd0bc7e26fa433a690d465c97c125b751e97f5
2023-08-16 05:38:06 -07:00
Rubén Norte
0ba9808c88 Fix NullPointerException when reporting mounts for mount hooks (#39022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39022

Fixes a possible NullPointerException thrown when trying to access the binding after the instance has been destroyed to report mounts.

I added a check for the mount item just in case 😅

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D48355738

fbshipit-source-id: 401d2e0a52b0764ed89498ecc0176d160226e509
2023-08-16 04:38:47 -07:00
Riccardo Cipolleschi
67f8d4014e Split CircleCI config (#38793)
Summary:
Right now, every PR runs the whole test suite. For example, a changelog PR, will run all the tests. As of last month, that meant quite a few $s per single run.

With this PR, we are going to leverage dynamic configuration and file filtering to create a config.yml on the flight, depending on the files changed by the commit/pr.

They way it works is the following:
- It starts a setup workflow in CircleCI.
- This workflow fetch the list of files that have been changed in the current commit.
- It executes a bunch of filtering and computation to understand which tests makes sense to run.
- It creates a config on the flight to run those.
- It continue the pipeline on that config.

Currently, the way it works is the following:
- If a `.md` file has been modified => run nothing
- If only files in the `ReactAndroid` folder are modified => run tests for android only
- If only files in the `React` folder are modified or `ruby` files are modified => run only iOS tests
- If only js files, not in the scripts folder are modified => run only JS tests
- if only files in the e2e folder are modified => run only e2e tests
- else => run everything.

Of course, we can play and modify those filters t make sure that they reflect the work and the tests to the best we can.

bypass-github-export-checks

## Changelog:

[Internal] - Split circleci config and run test selectively.

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

Test Plan:
- [X] Tested on the local branch for general sanity check.
- [X] Import it in fbsource
- [x] Create a stacked diff which changes only a md file => verify that no tests are run.
- [x] Create a stacked diff which changes only files in ReactAndroid => verify that only android tests run.
- [x] Create a stacked diff which changes only files in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only ruby files => verify that only iOS tests run.
- [x] Create a stacked diff which changes ruby files and file in React => verify that only iOS tests run.
- [x] Create a stacked diff which changes only files JS not in the script folder => verify that JS tests run.
- [x] Create a stacked diff which changes only JS files in the script folder => verify that the whole suite starts.
- [x] Create a stacked diff which changes only files in the E2E folder => verify that only E2E files runs.
- [x] Trigger a nightly pipeline => verify that parameters are passed to the generated config.

Reviewed By: rshest

Differential Revision: D48118162

Pulled By: cipolleschi

fbshipit-source-id: 73c8071a7e80cd930fe538f77d7bb5de75f22ab7
2023-08-16 04:30:54 -07:00
Nick Gerleman
be2bb51c70 ListMetricAggregator UTs - cell offset APIs (#38732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38732

Unit tests for cell offset APIs. Mostly the same as previous UTs for VirtualizedList a layer higher.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D47978633

fbshipit-source-id: 8cb8a2e8125bc7370eabf9f01a3f7529043171c2
2023-08-15 21:56:25 -07:00
Nick Gerleman
966f97acdc ListMetricAggregator UTs - cached measurement adjustment after layout changes (#38936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38936

Unit tests that validate we continue to return correct measurement results through the lifetime of the list when cells are unmounted, or layout of the list shifts.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D47978632

fbshipit-source-id: b700fafb699e8820de6825f0ead1ef02c6d8f168
2023-08-15 21:56:25 -07:00
Xin Chen
50638714f5 Add init react runtime start time in performance API (#38858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38858

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

This diff adds the two extra markers `initializeRuntimeStart` and `initializeRuntimeEnd` to the startup performance API. The runtime start time matches the existing android marker `GET_REACT_INSTANCE_MANAGER_START`, which is the first marker we have on the RN android app.

Changelog:
[Android][Added] - Add `performance.reactNativeStartupTiming.initializeRuntimeStart` and `performance.reactNativeStartupTiming.initializeRuntimeEnd` API

Reviewed By: rshest

Differential Revision: D47941110

fbshipit-source-id: d7e65f822f1c60a46dccacc8fd5bba84174f9f31
2023-08-15 18:51:07 -07:00
Vincent Viego
a4da5da42e Only execute expired tasks once per batched event group (#39013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39013

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D48210131

fbshipit-source-id: 1410aab2f70b75e71fd8a6ace8f4653682daaf90
2023-08-15 18:31:31 -07:00
Vincent Viego
8cfd80f52c Default to AsynchronousBatched priority (#39011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39011

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D48210134

fbshipit-source-id: aac2aec11c35dd6a47bc8fd4bf74f2fa00ab3d7e
2023-08-15 18:31:31 -07:00
Tim Yung
a99c9764aa Flow: Cleanup Platform Suffix Ignore Patterns (#39028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39028

The regular expressions that we use to ignore other platform suffixes are wrong or unnecessarily complicated.

This diff cleans them up to be idiomatic regular expressions without any extra constructs.

Changelog:
[Internal]

Reviewed By: samwgoldman

Differential Revision: D48377329

fbshipit-source-id: e6d6c36b3dd6f524cc28a3cfb2938abb06dd8ab6
2023-08-15 18:29:00 -07:00
Tim Yung
e637a3385b JS: Upgrade to v8-compile-cache@^2.4.0 & eslint@^8.23.1 (#39012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39012

Upgrades many of our projects to `v8-compile-cache@^2.4.0`, which includes [zertosh/v8-compile-cache#45](https://github.com/zertosh/v8-compile-cache/pull/45). This fixes a very opaque segmentation fault when `v8-compile-cache` is used on Apple Silicon with mixed architecture modes.

This also upgrades our projects to `eslint@^2.3.1`, which no longer has the dependency on an outdated version of `v8-compile-cache`.

Changelog:
[Internal]

Reviewed By: zertosh, NickGerleman

Differential Revision: D48336030

fbshipit-source-id: afa73d1f00bff826a8b76fa09949b9d35a97905b
2023-08-15 15:49:33 -07:00
Yasin Çidem
66d6384d4d Kotlinify ReactTextInputPropertyTest class (#38981)
Summary:
This PR converts ReactTextInputPropertyTest.java to Kotlin. https://github.com/facebook/react-native/issues/38825
## Changelog:
[INTERNAL] [CHANGED] - Kotlinify ReactTextInputPropertyTest.java
<!-- 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/38981

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

### Screenshot
<img width="40%" alt="image" src="https://github.com/facebook/react-native/assets/13544246/456622f0-2260-47c3-ada7-725c59ecbc09">

### FYI:

ae88aef12c/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.java (L385)

**testSelection** function removed because selection prop removed from ReactTextInputManager.java 84a1cacfa5

Reviewed By: yungsters

Differential Revision: D48351651

Pulled By: cortinico

fbshipit-source-id: 750668dbc409f08827eff1f11886b3d12c3b240c
2023-08-15 15:20:40 -07:00
Vincent Riemer
894b88307f Adjust RawPropsPropNameLength's type to account for increased number of props (#39008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39008

Changelog: [Internal] - Adjust RawPropsPropNameLength's type to account for increased number of props

While investigating why we needed to back out D48288752 I discovered that the root cause was that the `items_` vector in `RawProsKeyMap` was now a size greater than 255 which becomes an issue because `items_`'s indices are statically cast to `RawPropsPropNameLength` (previously alias to `uint8_t`).

This diff updates `RawPropsPropNameLength` to be an alias to `uint16_t` so the current issue is resolved as well as adding an assert to ensure (however unlikely) that this happens again.

Reviewed By: rozele

Differential Revision: D48331909

fbshipit-source-id: f6bc3e4825f2f293d79d8cd90c40ced7cba0e3c5
2023-08-15 14:15:01 -07:00
Arushi Kesarwani
b012027962 Remove Flipper jobs from CircleCI (#38911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38911

Flipper is going to be deprecated in 0.73. So we can decide to remove the CircleCI tests that run Flipper:

- test_ios_template-NewArch-Debug-WithFlipper-Hermes-StaticLibraries
- test_ios_template-NewArch-Debug-WithFlipper-JSC-StaticLibraries
- test_ios_template-OldArch-Debug-WithFlipper-JSC-StaticLibraries

Changelog:

[Internal] [Changed] - Remove Flipper jobs from Circle CI

Reviewed By: cipolleschi

Differential Revision: D48209184

fbshipit-source-id: f43613d17093c4cc883409d4f083c577da924b78
2023-08-15 13:52:57 -07:00
David Vacca
3b43d56f38 Ez refactor in NetworkingModule (#38970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38970

Ez refactor in NetworkingModule to remove to lint warns

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D48275729

fbshipit-source-id: a0fb66ebeeee1b8360bd6ab3d3be6c8626f2faab
2023-08-15 12:26:12 -07:00
Riccardo Cipolleschi
540c41be91 Publish dSYM to Maven when doing a release (#38992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38992

This Diff publishes the Hermes dSYMs to Maven while doing a release.
These were missing and so the Stack traces can't be fully symbolicated when a crash occurs.

## Changelog:
[Internal] - Publish dSYM to Maven

Reviewed By: cortinico

Differential Revision: D48309198

fbshipit-source-id: a5514e544587daadd0a0d7614f25a30fccd16a5b
2023-08-15 03:48:47 -07:00