Commit Graph
28549 Commits
Author SHA1 Message Date
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
Nick Gerleman f965da97f3 Add experimental_layoutConformance prop (#38746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38746

This adds a view prop which controls the layout conformance of it and its transitive children (including non-view ShadowNodes).

The implementation here is to traverse down before layout, updating any context-specific configuration.

Normally at the time of layout, unchanged child ShadowNodes are already sealed. These must be mutated already if layout results change, and we do this today via Yoga node clone callback, where Yoga clones nodes where it will do layout work (but not all of them).

We down-propagate configuration, but can terminate if we observe an already sealed node whose values match those of our current context, since any nodes under must also follow the same contexts (or any nested contexts of the sealed node).  This means that calling `layoutTree()` on a mostly clean ShadowTree will cause configuration to not traverse most nodes.

`Errata` and `PointScaleFactor` (DPI) are threaded to each Node's per-node config. The same values are retained when Yoga nodes are cloned (by cloning the ShadowNode). Since these are set before the first layout, config setting should only ever dirty layout [when layout-effecting values change](https://www.internalfb.com/code/fbsource/[1c95e981c740]/xplat/yoga/yoga/YGConfig.cpp?lines=13).

The prop is prefixed with `experimental` because we are likely to make more breaking conformance fixes in the strict mode, and I'm not sure this is the final API yet. I was previously looking at a context-like component which is more challenging to implement.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: rozele, sammy-SC

Differential Revision: D47940100

fbshipit-source-id: f72e1c73f537e0312c2bba19ae8c2e882c82aced
2023-08-07 19:37:41 -07:00
Nick Gerleman 0e69050612 Use right edge of ScrollView viewport for scrollMetrics.offset in RTL
Summary:
The offset we record should be the one closest to the reference zero-point in the coordinate space. This makes scroller offset reference match the cell reference we keep in D47978631.

Changelog:
[General][Fixed] - Use right edge of ScrollView viewport for `scrollMetrics.offset` in RTL

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D48132236

fbshipit-source-id: 3307081e5e859f1b4afbc15a84c5be1b33915206
2023-08-07 19:36:07 -07:00
Sam Zhou c0c450793e Add missing constants to fallback implementation of ToastAndroid (#38803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38803

The d.ts file says these constant must exist, but they only exist in the android implementation. This diff stops lying and adds some dummy constants, so that the type will match-up.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48085126

fbshipit-source-id: 8d5332a71b9b3c1925abeec9e47630a07abf8b86
2023-08-07 18:50:44 -07:00
Nicola Corti 2bf59c764a Downscale and move to a prebuilt-image analyze code/pr (#38819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38819

The jobs for `analyze_pr` and `analyze_code` are currently running on Android's Docker container on a XL instance. This is costly. As those jobs are relatively small, not on the critical path, and need the Android container only for `java`, I've moved the to the node-broswers CI executor:
https://circleci.com/developer/images/image/cimg/node

Changelog:
[Internal] [Changed] - Downscale and move to a prebuilt-image analyze code/pr

Reviewed By: cipolleschi

Differential Revision: D48116159

fbshipit-source-id: a12782b810fb225ab6916a35054a891e73f3a717
2023-08-07 12:06:02 -07:00
Nicola Corti 8a4452068f Do not import java Collections from Kotlin (#38822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38822

We should not attempt to import `java.util.Collections` in a Kotlin file
as we should use the Kotlin's equivalent class instead.

Changelog:
[Internal] [Changed] - Do not import java Collections from Kotlin

Reviewed By: cipolleschi

Differential Revision: D48117940

fbshipit-source-id: f1a972f1d3867ee4dd788c3cf34c1b931a8082d8
2023-08-07 11:36:55 -07:00
Nicola Corti b7b69c589c Enable Kotlin for RN Tester (#38820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38820

This is needed if we want to allow users to write Kotlin code inside RN Tester

Changelog:
[Internal] [Changed] - Enable Kotlin for RN Tester

Reviewed By: mdvacca, cipolleschi

Differential Revision: D48117203

fbshipit-source-id: c4a69cca95dfed936d85a45dd91f1518cfe1726f
2023-08-07 10:31:04 -07:00
Samuel Susla 00b7177729 Add more systrace data to UIManager (#38789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38789

changelog: [internal]

Add more data to completeSurface, createNode and cloneNode.
Add systrace annotation to UIManager::updateState

Reviewed By: rshest

Differential Revision: D48066599

fbshipit-source-id: 0f13221639f9d1eef94456799e3bd1df3cb23a0e
2023-08-07 10:10:26 -07:00
Samuel Susla d1a2c346a7 Remove systrace from recursive function (#38790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38790

changelog: [internal]

Remove systrace from recursive function. This causes visual noise in perf tooling.

Reviewed By: rshest

Differential Revision: D48066562

fbshipit-source-id: 98739477f712c428e09cd9f5c06b399830f8f533
2023-08-07 10:10:26 -07:00
Nicola Corti 2e5483e303 Add missing libreact_utils.so inside RNGP pickFirst (#38818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38818

When building the template test on CircleCI, I've noticed we fire a warnign for `libreact_utils.so` as we're missing a pickFirst directive.
You can see an example of the warning here:
https://app.circleci.com/pipelines/github/facebook/react-native/28853/workflows/f1808b5e-fb40-4165-8885-694f88037f9f/jobs/904972

This fixes it by adding `libreact_utils.so` to the `pickFirst` list.

Changelog:
[Internal] [Changed] - Add missing `libreact_utils.so` inside RNGP pickFirst

Reviewed By: cipolleschi

Differential Revision: D48115852

fbshipit-source-id: 02e8b3172aea84360d06a1a12400fe7bc99859e5
2023-08-07 09:48:32 -07:00
Nicola Corti bb4ca899b1 Fix caching paths for Gradle after the monorepo migration (#38821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38821

I've just realized that the caching of 3rd party native dependencies is broken for Android, so we re-download them every time. This fixes it by specifying the correct paths where the zip files are stored.

Changelog:
[Internal] [Changed] - Fix caching paths for Gradle after the monorepo migration

Reviewed By: cipolleschi

Differential Revision: D48116655

fbshipit-source-id: 5a8ba65ef9b006be197b135f8dbf60372483f726
2023-08-07 09:40:58 -07:00
Nicola Corti 1982c4722f Attempt to enable the Gradle Daemon for CI (#38814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38814

This change enables the Gradle Daemon on CI.
We noticed some flakyness with the Daemon disabled, so we'll give it a try with the daemon enabled which is the default for Gradle.

Changelog:
[Internal] [Changed] - Enable the Gradle Daemon for CI

Reviewed By: cipolleschi

Differential Revision: D48112363

fbshipit-source-id: 4a7f9bbaad33935a97e4e0ea28ea8f2f22c67d0f
2023-08-07 09:31:35 -07:00
Moti Zilberman 408dd81fb6 Remove unused inlineRequires params from BabelTransformer API (#38771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38771

Changelog: [Internal]

Metro has been passing `inlineRequires: false` to Babel transformers for the last 5 years (D9636747), as the inline requires transform had been hoisted into the transform worker. Here we clean up the unused code paths in React Native's implementations of the Metro Babel transformer API, and the unused properties in the API itself.

Reviewed By: GijsWeterings

Differential Revision: D48034441

fbshipit-source-id: d24a793962942a3c87461ffbade847ea749dac95
2023-08-07 09:17:43 -07:00
Nicola Corti a2e30dcf98 Back out "Update Switch.d.ts" (#38812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38812

Original commit changeset: 25b22a97a3c0

Original Phabricator Diff: D47800523

Changelog:
[Internal] [Changed] - Back out "[react-native][PR] Update Switch.d.ts"

Reviewed By: cipolleschi

Differential Revision: D48111573

fbshipit-source-id: de86d95c8fb75d58feec6c751c0c49a9cfcf6af5
2023-08-07 08:25:55 -07:00
szymonrybczak 3e828691dd Build iOS app in New Architecture when running E2E tests. (#38813)
Summary:
Right now we're building by default Android app in New Architecture, so to align this behaviour between platforms - I added `RCT_NEW_ARCH_ENABLED=1` when installing Pods when running E2E tests, to also build iOS app in New Arch.

## Changelog:

[IOS] [CHANGED] - Build iOS app in New Architecture when running E2E tests.

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

Test Plan: App in `test_e2e_ios` job should build in New Architecture

Reviewed By: dmytrorykun

Differential Revision: D48112814

Pulled By: cipolleschi

fbshipit-source-id: f709fe23f7c3ff65f3e39acb304581c4ec0fdea8
2023-08-07 07:01:03 -07:00
Kyaw Thura ccd191d79a - Extract the content into handleEventHandler (#38805)
Summary:
Part of https://github.com/facebook/react-native/issues/34872
> Extract the content of the if branches that handle the EventHandlers ([Flow](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L131-L151), [TypeScript](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/components/events.js#L150-L171)) into a handleEventHandler function in parsers-commons.js. This will take a name, a typeAnnotation, a parser and a findEventArgumentsAndType function as parameters. Use the switch based approach from TypeScript.

## Changelog:

[Internal][Changed]: Extract the content into handleEventHandler

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

Test Plan: `yarn test react-native-codegen`

Reviewed By: rshest

Differential Revision: D48100350

Pulled By: cipolleschi

fbshipit-source-id: 5de6deacd50e87ea0ec96147fff7c14ba55e5368
2023-08-07 03:41:39 -07:00
Intl Scheduler f9a63ec005 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907936782579
Sandcastle Job Instance ID: 22517999147218333
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48105058

fbshipit-source-id: 8074437fc9e807157da5c6593b09497121f21a88
2023-08-06 20:38:18 -07:00
Sam Zhou 589aea0abf Adjust typing of PlatformColorValueTypes to prepare for Flow multiplatform support (#38804)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38804

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48081150

fbshipit-source-id: a25f04c59ee2ae733ae6efa24d6c5be7c5d414da
2023-08-05 12:01:26 -07:00
Sam Zhou 7709aadbd8 Rename examples in react-native that only has one of ios/android implementation (#38801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38801

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D48075375

fbshipit-source-id: ac51efdb380d394f710ec8bc3ed8b098176d3cc8
2023-08-04 17:46:15 -07:00
Pieter Vanderwerff 66990248a7 Deploy 0.214.0 to xplat (#38802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38802

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D48075406

fbshipit-source-id: 1fa5c717c593ded754948ba073d9312bc9a3d2ee
2023-08-04 13:54:15 -07:00
Intl Scheduler d3de9789ab translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907935234055
Sandcastle Job Instance ID: 18014399520897041
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48076012

fbshipit-source-id: 392c1d5c3e27dcadf15b03f483c064dd7b6d5775
2023-08-04 11:45:29 -07:00
Nicola Corti 19e23e4196 Back out "Enable Kotlin for RN Tester" (#38796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38796

Original commit changeset: 63c820b3b968

Original Phabricator Diff: D48066316

Reviewed By: mdvacca

Differential Revision: D48071950

fbshipit-source-id: f388b4bb26fcfba3051041931aa6a9f89cb24ac0
2023-08-04 11:26:56 -07:00
Nick Gerleman 3d5204cd34 Add MC to disable onScroll requiring scrollEventThrottle on iOS. (#38742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38742

If you try to add an `onScroll` event listener on iOS, you will get a warning that you must additionally add a `scrollEventThrottle`, otherwise you will only receive a single event throughout the duration of the gesturing.

Values under 17ms are unthrottled, so it is common to see components passing magic values `16` and `0.0001` to ask for full events.

This behavior is inconsistent with Android, Web, and Windows.

This change runs an experiment on iOS to continuously fire scroll events to users of `onScroll` without `scrollEventThrottle`. Because there are warnings already, I think this case will be rare, and any code written for Android will already have to be written to be compatible with it.

I intentionally left the warning in for now, so that folks don't add new code relying on this QE while it is being tested.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D47975260

fbshipit-source-id: 8f182c5514cc557e1804586e8cbc68fc54502d83
2023-08-04 11:23:45 -07:00
Nick Gerleman 9eec875a17 ListMetricAggregator UTs - cell measurement (#38735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38735

UTs around cell measurement results through `getCellMetrics` and `getCellMetricsApprox`. For each orientation, validate basic scenarios for approximation, cached measurement, or measurement by user-provided `getItemLayout`.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D47978630

fbshipit-source-id: 4c9ba6a60599848034f4f23cde3497dd4c2b8788
2023-08-04 10:37:57 -07:00
Nick Gerleman f3b2d2c759 ListMetricAggregator UTs - statistics collection (#38740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38740

UTs around ListMetricsAggregator APIs which calculate statistics (average length, max measured index).

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D47978636

fbshipit-source-id: fe83a1fed939fca3d59ecca32945825d3c112739
2023-08-04 10:37:57 -07:00
Nick Gerleman ace0a80dea Fixup contentLength invalidation logic (#38733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38733

I was working under the assumption that Fabric fired layout events bottom up, but it actually fires them top-down, in constrast to Paper.

Previous invalidation logic wasn't quite correct when fired bottom-up. This corrects the logic by:
1. Deriving direction based on initial event ordering
2. Use last cached contentLength if we are on Fabric (top-down)
3. Use future contentLength if we are on Paper (bottom-up)

Changelog:
[General][Fixed] - Fixup contentLength invalidation logic

Reviewed By: rozele

Differential Revision: D47978638

fbshipit-source-id: 3446d08aa34397b4e6bd9924dad0eba36a12a115
2023-08-04 10:37:57 -07:00
Nick Gerleman 5596f1c25b Right align scrollToIndex in RTL (#38737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38737

This fixes up behavior on Android so that `scrollToIndex` aligns the right edge of the cell of the given index to the right edge of the scrollview viewport. We do not incorporate RTL on iOS which inverts x/y coordinates from scroller (but not layout).

Changelog:
[General][Fixed] - Right align scrollToIndex in RTL

Reviewed By: lenaic

Differential Revision: D47978637

fbshipit-source-id: 7786b5d97efaced318018409e2c7577a3d8f7402
2023-08-04 10:37:57 -07:00
Nick Gerleman 7319a28d22 Return right edge in RTL Cell metrics (#38734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38734

Returned measurements from the measurements cache in RTL calculate offset as distance from the left edge of the cell to the right edge of the content, when it should instead be the distance from the right edge of the cell (the logical beginning).

Changelog:
[General][Fixed] - Return right edge in RTL cell metrics

Reviewed By: lenaic

Differential Revision: D47978631

fbshipit-source-id: b0db4e9aff676c5bee81d4491f901a6bbc38e4bf
2023-08-04 10:37:57 -07:00
Sam Zhou 599a2e30c6 Actually parse .js.flow files with hermes-parser (#38774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38774

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D48047348

fbshipit-source-id: a2627766ffd73ff702880b8533f0051bcda22414
2023-08-04 09:23:21 -07:00
Facebook Community BotandFacebook Community Bot 305dd4bfe5 Re-sync with internal repository (#38794)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-08-04 17:22:07 +01:00