Граф коммитов

24813 Коммитов

Автор SHA1 Сообщение Дата
Joshua Gross 0fc42fd35c Add detail to Fabric perf logs (median, average, max)
Summary:
I'm finding it useful to keep track of a few additional numbers when doing perf analysis in Fabric.

Also making it easier to enable just these perf logs without all of the other verbose Fabric logs.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D36500518

fbshipit-source-id: e57e1e75131c5d59da876d1decb96d4da386f025
2022-05-19 18:55:56 -07:00
Joshua Gross 4fc0630faa Animated MegaOp: fix `removeAnimatedEventFromView` call
Summary:
We were calling the wrong operation from the MegaOp which caused indices to become offset. Trivial fix.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D36482822

fbshipit-source-id: 83ebc37a8773f0277db4caff9d3e7c9c91931ddb
2022-05-19 18:55:56 -07:00
Vincent Riemer 291f26c5c0 Fill out w3c pointer event types
Summary: Changelog: [Internal] Fill out w3c PointerEvent flow types

Reviewed By: yungsters

Differential Revision: D36296044

fbshipit-source-id: f1c184fd6486fa72077e5b80d2335919af0fc145
2022-05-19 18:48:24 -07:00
Franco Meloni ca8174e15f Create script to automatically set CLANG_CXX_LANGUAGE_STANDARD on the client project (#33863)
Summary:
Currently this [section](https://reactnative.dev/docs/next/new-architecture-app-intro#ios-enable-c17-language-feature-support) of the Playbook tells us to set CLANG_CXX_LANGUAGE_STANDARD = "c++17" in the main app target for the new architecture to work.
Would be nice to be able to automate that instead

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Cocoapods function to add the `CLANG_CXX_LANGUAGE_STANDARD` to all the targets if needed

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

Test Plan:
I've created some unit tests for the newly added function.
I've executed pod install and the ruby tests locally.

Reviewed By: cipolleschi

Differential Revision: D36484366

Pulled By: f-meloni

fbshipit-source-id: 553b092e747bef11d82195619ae1058985fdc325
2022-05-19 14:57:04 -07:00
Pieter De Baets baada4e299 Remove shadowview copy in setIsJSResponder
Summary:
Noticed we were copying ShadowView, where a reference should suffice.

Changelog: [Internal]

Reviewed By: appden

Differential Revision: D36455200

fbshipit-source-id: 2cd3cf66b9e5ec05bce9ce1d739fbed66f3a6d89
2022-05-19 11:48:02 -07:00
Riccardo Cipolleschi 05aaba9514 Align Codegen between iOS and Android (#33864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33864

This Diff aligns the way in which iOS and Android codegen the modules and components.
Android takes all the JS in the project root folder and creates components starting from there.
iOS used to required to specify a specific path for each component, within a JSON field called `libraries`. This Diff let iOS work in the same way as android does

**Backward compatibility:** This diff still support the old way for iOS, but we are deprecating it.

## Changelog
[iOS][Added] - Support codegen from a single folder

Reviewed By: cortinico

Differential Revision: D36473005

fbshipit-source-id: 1e8cf0f9764f529c02e948984c74d1982a84030b
2022-05-19 05:52:40 -07:00
Pieter De Baets 1c1fbce2d1 Fix embarrassing typo in Animated
Summary:
Which idiot wrote this? Oh yeah, I did.

This was introduced in D36109810 (bf405d7083) so hasn't been around too long luckily.

Changelog: [Internal]

Reviewed By: cortinico, GijsWeterings

Differential Revision: D36480272

fbshipit-source-id: b0fbb6b820185185359c6c75f77f2921dc892b02
2022-05-19 05:33:09 -07:00
Nicola Corti 5bb0caf858 Fix `test_windows` by passing the correct platform to the Metro Virtual FS (#33870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33870

I'm fixing a broken CI on master for `test_windows` as `metro-memory-fs` doesn't
automatically recognize the platform but needs to have it passed in input.
It was currently failing to parse a `C:\...` path. This fixes it.

Changelog:
[Internal] [Changed] - Fix `test_windows` by passing the correct platform to the Metro Virtual FS

Reviewed By: cipolleschi

Differential Revision: D36507564

fbshipit-source-id: 39dfd7e9ce492d126fbb513a70ec5a60965c61fd
2022-05-19 03:29:56 -07:00
Nicola Corti c19bc0b6a2 Do not fail if -javadoc.jar are missing in the final NPM package (#33869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33869

When I disabled the Javadoc pubblication as it was failing on CI,
I forgot to turn off the verification that the -javadoc artifact is included
inside the NPM package. This caused `build_npm_package-1` to fail on main.
I'm fixing it here.

Changelog:
[Internal] [Fixed] - Do not fail if -javadoc.jar are missing in the final NPM package

Reviewed By: cipolleschi

Differential Revision: D36507320

fbshipit-source-id: 3836de5212de91bb44e0e586564b46114ca346b4
2022-05-19 02:48:39 -07:00
Sam Zhou e584fd16a1 Revert D36417372: Enable constrain writes
Differential Revision:
D36417372 (f6d119b572)

Original commit changeset: 24c2219cf636

Original Phabricator Diff: D36417372 (f6d119b572)

fbshipit-source-id: 8aeb64dcac8f6c3efe30b81bb807c560c58db3fa
2022-05-18 22:48:28 -07:00
Sam Zhou f6d119b572 Enable constrain writes
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D36417372

fbshipit-source-id: 24c2219cf636753ed6fb456331d39c0f398dd107
2022-05-18 15:06:48 -07:00
Blair Vanderhoof 82b268f884 Revert D36468390: Fix negative zoomScale in RTL
Differential Revision:
D36468390 (2f491bfa9f)

Original commit changeset: f18244f1421f

Original Phabricator Diff: D36468390 (2f491bfa9f)

fbshipit-source-id: 925a7b811aaeefb0cda20493365c1e12cab66ee0
2022-05-18 14:44:46 -07:00
Nicola Corti dadcfcae95 Disable Javadoc publishing as it's currently failing on CI
Summary:
I'm disabling the publishing of Javadoc as it's currently failing on CI.
The failure is happening due to a concurrency problem during the Kotlin
documentation generation.

As we don't have much Javadoc to export, I'm removing this for now.

Changelog:
[Internal] [Fixed] - Disable Javadoc publishing as it's currently failing on CI

Reviewed By: cipolleschi

Differential Revision: D36481215

fbshipit-source-id: 6f875932013f80779151f75e20d25ba3b71de074
2022-05-18 11:48:16 -07:00
Pieter De Baets a4690d054f Disable early return in NativeAnimatedHelper.flushQueue
Summary:
This is the same issue as https://www.internalfb.com/diff/D36298399 (55ee8ce0c4) which was reverted earlier this week.

Changelog: [Internal]

Differential Revision: D36479089

fbshipit-source-id: 2bce05882a558db0c3464ec4a2b05eee36a3048a
2022-05-18 10:36:03 -07:00
Brent Kelly 763dc52387 refactor: Updating template to support dark mode StatusBar on Android (#33561)
Summary:
This PR adds a `backgroundColor` prop to the `StatusBar` in the starter template so that Dark Mode is correctly demonstrated when running on Android.

**Before**

StatusBar in starter app on Android would remain the same color no matter what the current device color scheme was.

<img width="300" alt="Screenshot 2022-04-04 at 09 30 54" src="https://user-images.githubusercontent.com/5814579/161505272-88b57e86-3ada-4bf5-beef-a1f5a1661eaa.png"><img width="300" alt="Screenshot 2022-04-04 at 09 31 12" src="https://user-images.githubusercontent.com/5814579/161505278-c2da0421-83ab-4e03-9f04-718f5503ed36.png">

**After**

StatusBar in starter app on Android correctly reacts to the color scheme.

<img width="300" alt="Screenshot 2022-04-04 at 09 29 41" src="https://user-images.githubusercontent.com/5814579/161505014-af3b255b-650b-435f-9e37-2f604d5f0310.png"><img width="300" alt="Screenshot 2022-04-04 at 09 29 22" src="https://user-images.githubusercontent.com/5814579/161505011-55ae4ffe-bfd0-449c-a6c1-0d2b8d3aee59.png">

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Changed] - Demonstrating Dark Mode correctly in the `StatusBar` for the starter template App.

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

Test Plan: This was a very simple change that I was able to verify in a newly generated RN project by copying the `backgroundColor` prop across. See screenshots above.

Reviewed By: christophpurrer

Differential Revision: D36018771

Pulled By: kacieb

fbshipit-source-id: c037cb19478affaa9c5485ebd9babf728cced1d6
2022-05-18 09:39:12 -07:00
Pieter De Baets 5451f890a1 Cache method IDs in JavaTurboModule
Summary:
Codegen a static field for every caller of `invokeJavaMethod` to cache the jmethodID that should be used for the method, which saves us a string-based name lookup at invocation time.

Changelog: [internal]

Reviewed By: genkikondo

Differential Revision: D36376056

fbshipit-source-id: 298430746a8f25a5337aba05b56876ba789e2344
2022-05-18 09:12:10 -07:00
Pieter De Baets d1541f169f Use fbjni boxed values for Java turbomodule arg conversion
Summary:
Simplify argument and result conversion by using existing fbjni helpers (which will cache class and method ID lookups already)

Changelog: [internal]

Reviewed By: RSNara

Differential Revision: D36312751

fbshipit-source-id: 16713642b2c5fb4c2b6447c30652d91ddbd88224
2022-05-18 09:12:10 -07:00
Pieter De Baets fced96bf52 Fix non-touch event dispatching not being blocked by pointer-events
Summary: Changelog: [Android][Fixed] Scroll views would still receive scroll events when nested in a view with `pointer-events: "none"`

Differential Revision: D36423921

fbshipit-source-id: 87b8a236e15dda7b648b6fc649187e95a9a2cc42
2022-05-18 08:35:16 -07:00
Franco Meloni 7b703eb78b Cache .git to improve checkout time (#33845)
Summary:
Caching the .git to speed up the checkout.

https://circleci.com/docs/2.0/caching/#source-caching

<img width="1429" alt="Screenshot 2022-05-17 at 11 11 54" src="https://user-images.githubusercontent.com/17830956/168787771-5501b113-674e-4d43-b93f-90bf46882c14.png">

This doesn't work on the machines that use a docker executor

<img width="1426" alt="Screenshot 2022-05-17 at 12 17 14" src="https://user-images.githubusercontent.com/17830956/168789017-538a6d04-c53d-4ac7-ba12-0eccff397675.png">

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Infrastructure] - Cache .git to improve checkout time

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

Test Plan: Run the change on Circle

Reviewed By: hramos, cortinico

Differential Revision: D36443844

Pulled By: f-meloni

fbshipit-source-id: 7b07e177f4527ed5956f03ad622838f20ad64950
2022-05-18 07:43:51 -07:00
Pieter De Baets 56e9aa369f Avoid emitting mountitems for default values
Summary:
Noticed that we emit a large amount of (admittedly cheap) mountitems as part of node creation for values that are all zero (e.g. padding, overflowinset), which we can assume to be already initialised with these values on the native side.

There's a further opportunity to do this for State as well, as ReactImageComponentState exports just empty maps to Java.

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D36345402

fbshipit-source-id: 8d776ca124bdb9e1cd4de57a04e2785a9a0f918c
2022-05-18 05:44:11 -07:00
Riccardo Cipolleschi 8a8c33aab9 Move fabric setup to a separate file (#33818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33818

This Diff moves the fabric setup from the `react_native_pods` script to its own `fabric` file.

It also introduces tests for the file and some test utilities.

## Changelog
[iOS][Changed] - Move fabric setup to its own file

Reviewed By: cortinico, dmitryrykun

Differential Revision: D36344911

fbshipit-source-id: 586186684be2c0080f247390f26145f2defa9e97
2022-05-18 02:57:35 -07:00
Blair Vanderhoof 2f491bfa9f Fix negative zoomScale in RTL
Summary:
Changelog:
[iOS][Fixed] - When in an RTL locale on iOS, e.nativeEvent.zoomScale is -1. This seems to cause erratic blank spaces that don't recover as you scroll. Taking Math.abs of the value fixes it. Blame: D36169686 (13a72e0ccc)

Differential Revision: D36468390

fbshipit-source-id: f18244f1421fc1ccbb0d1035df8a7c6de10ccf62
2022-05-17 21:50:25 -07:00
Joshua Gross 35e2a63b8d Batch Animated calls into one JSI call per frame
Summary:
We introduce a few optimizations:

(1) Previous diff: We defer calling any NativeAnimatedModule methods by waiting 1ms before flushing the queue, and debouncing until no flush is requested. Practically, this just means that we'll call NativeAnimatedModule methods N times at once, at the end of a render loop, instead of N times smeared throughout the render loop.
(2) Additionally, instead of calling N methods, we create multi-operation argument buffer and call a single NativeAnimatedModule API, which should essentially throttle NativeAnimatedModule API calls to once-ish per frame. On the native side, this also reduces a lot of overhead associated with scheduling work on the UI thread (we schedule 1 function to run on the UI thread and perform N operations, as opposed to scheduling N functions to run on the UI thread).

TODO:
- implement stubs for iOS
- write gating code so this can be properly tested in VR and in fb4a

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D36338606

fbshipit-source-id: 29ac949b53b874683128a76525586c22def3143b
2022-05-17 16:42:41 -07:00
Joshua Gross 29a91babd4 Delay Animated operations by at most 1ms (one render loop) to batch all operations and execute at once
Summary:
Because of the disconnect between the ReactJS render loop and Animated nodes, we don't know when a render loop begins or ends. Historically we haven't cared about that much,
but now for perf reasons we're attempting to batch them. Scheduling a function to execute at the end of the runloop and canceling until nothing interrupts it achieves that.

Impact seems fairly minimal and this should work everywhere (android, ios, etc) but we may want to gate the behavior as it *could* change things in surprising ways.

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D36338621

fbshipit-source-id: 48e52a1b2e2bcfb3ef13d3abd38d735967356de7
2022-05-17 16:42:41 -07:00
Nicola Corti afb0307036 Setup a toplevel downloadAll task (#33852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33852

Similarly to buildAll and cleanAll, I'm creating a downloadlAll task
which is aligning the behavior of the download task we're doing on CIs.

I've also updated the Offline Cache as we're now storing a bigger set of dependencies.

Changelog:
[Internal] [Changed] - Setup a toplevel downloadAll task

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D36441728

fbshipit-source-id: f847b5e665c64e0b4b93d984bbc1b64c00a3b4f7
2022-05-17 15:31:48 -07:00
Nicola Corti 7c82cc3095 Add a note about React/React-Native versioning
Summary:
I'm adding a readme inside the ./Libraries/Renderer folder
to explain how React and React Native are aligned.

Changelog:
[Internal] [Changed] - Add a note about React/React-Native versioning

Reviewed By: cipolleschi

Differential Revision: D36445819

fbshipit-source-id: cf1b071b9996bcc8222deab2e9458f014766f2a9
2022-05-17 14:49:00 -07:00
Franco Meloni b331229b06 Remove build_ios and use only test_ios (#33837)
Summary:
build_ios is a subset of test_ios.
The Hermes cache takes 20-30 minutes to be downloaded and unarchived, that is the slowest part of both the jobs and that was duplicated.
This means that if we remove build_ios we save a lot of time, and the CI is still covering the build and the testing of the code.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] - Remove build_ios and use only test_ios

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

Test Plan: Checked on CircleCI

Reviewed By: cipolleschi

Differential Revision: D36437775

Pulled By: f-meloni

fbshipit-source-id: 53adf77e3511963d2dbfadf26122fd70b0de1113
2022-05-17 04:02:19 -07:00
Hetan Thakkar 2fb107c9a6 Fixed Textinput not properly handling padding and paddingVertical in style props (#33564)
Summary:
Fixes https://github.com/facebook/react-native/issues/33562 #21720. Earlier this [`paddingTop`](d5da70e17e/Libraries/Components/TextInput/TextInput.js (L1367)) used to override the  `paddingTop` of `padding` and `paddingVertical` of the style props. Using `Stylesheet.flatten` will solve this problem.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Fixed paddingTop not being applied when using padding and paddingVertical in multiline textinput

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

Reviewed By: christophpurrer, cortinico

Differential Revision: D36018667

Pulled By: kacieb

fbshipit-source-id: 0af0ed8ea536ec4e813325b1cf93c7cb2481eb07
2022-05-17 03:26:34 -07:00
Nicola Corti d51534ae01 Fix broken AndroidConfigurationTest.kt on main
Summary:
The bump of AGP to 7.2 caused the tests inside `AndroidConfigurationTest.kt` to fail.

As we're now running `buildAll` both on Sandcastle and on CircleCI, this is now failing
on both CIs. The issue is that AGP 7.2 change the way to introspect resValues and
requires now to specify a type when querying for a value. I'm updating the tests here.

Changelog:
[Internal] [Fixed] - Fix broken AndroidConfigurationTest.kt on main

Reviewed By: cipolleschi

Differential Revision: D36437875

fbshipit-source-id: 58f457a78eae861e86808e58c23f5d04fb196d45
2022-05-17 02:04:05 -07:00
Tianyu Li d5a6bee35f Assign the right oncall with best guess to miscellaneous xplat test modules
Summary:
We try to remove the use test_ownership_2020 oncall, which was created to enforce oncall field in test module. This diff stack tries its best to guess who the right oncall is for these "unowned" tests.

If you don't think this belongs to you, please
1. Either re-assign to another team to your best knowledge
2. Or delete the test

Every test should have an owner!

Differential Revision: D36404812

fbshipit-source-id: daf57e860d3700928ae4518897d87247a672eae4
2022-05-16 18:46:04 -07:00
Pieter De Baets 7c5d9ccb46 Fix NativeAnimatedNodesManager registering event listener multiple times
Summary:
Noticed that (LockFree)EventDispatcherImpl had NativeAnimatedNodesManager as a listener 100+ times, as listener registration can happen multiple times from Animated node creation. Since listener management on event dispatcher is thread-safe, we can avoid the thread hop for this.

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D36316102

fbshipit-source-id: f2f417b69885def87f88460d8b1e0b35b66726cb
2022-05-16 14:06:58 -07:00
Genki Kondo 57d3b9e2ca Modify VirtualizeUtils.elementsThatOverlapOffsets to use binary search
Summary:
elementsThatOverlapOffsets was quite inefficient as it was doing a linear scan over all items without an early out for each input offset.

The number of items can be large, so we'd want to use binary search here.
Before: O(MN), where M is the # offsets and N is the # items
After: O(MlogN)

As a utility method, elementsThatOverlapOffsets should not be responsible for checking that the offsets are in increasing order

'binary-search' dep added via https://www.internalfb.com/intern/wiki/React_Native/Building_Product_Experiences/Third_Party_Packages_(npm)/

Changelog:
[Internal] - Modify VirtualizeUtils.elementsThatOverlapOffsets to use binary search

Reviewed By: javache

Differential Revision: D36292326

fbshipit-source-id: 5f22eb5533b69e2ebe5c1cb34e4f82605838f0a7
2022-05-16 13:14:35 -07:00
Nicola Corti 4994b8b5de Setup a top level buildAll Gradle task (#33838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33838

The idea behind this diff is to set a top level `buildAll` task that will be responsible
of invoking all the tasks we want to verify both in the internal and in the external CI.

This should ideally remove the breakages of the External CI happening from internal changes.

Changelog:
[Internal] [Changed] - Setup a top level buildAll Gradle task

Reviewed By: cipolleschi

Differential Revision: D36376384

fbshipit-source-id: d810b59577340628bb49562bfedf28440bd0f792
2022-05-16 09:27:54 -07:00
Ken Tominaga c73e021a4b Remove iOS 11 deprecation warnings around SafeArea (#32851)
Summary:
We don't have to check or emulate the safe area for iOS 11 above. I deleted the unnecessary check for the safe area.

This is a continuation pull request of these iOS 11 availability check.
* [Remove iOS 11 version check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32151 · facebook/react-native](https://github.com/facebook/react-native/pull/32151)
* [Remove iOS 11 availability check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32488 · facebook/react-native](https://github.com/facebook/react-native/pull/32488)

-----

- Stop using layout guide (`topLayoutGuide`, `bottomLayoutGuide`)
- Refactor `RCTSafeAreaView`
- Delete `emulateUnlessSupported` property

Docs PR: https://github.com/facebook/react-native-website/pull/2919

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Removed] - Remove `emulateUnlessSupported`

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

Reviewed By: philIip, sammy-SC

Differential Revision: D33586023

Pulled By: cortinico

fbshipit-source-id: 75fc1037141f71d9340c7b875a6bf86f9cfd6a02
2022-05-16 09:27:43 -07:00
Dulmandakh c274456e5b Bump Android Gradle Plugin to 7.2.0 (#33817)
Summary:
Bump Android Gradle Plugin to 7.2.0 (May 2022), which supported by latest Android Studio (Chipmunk). See https://developer.android.com/studio/releases/gradle-plugin#7-2-0

## Changelog

[Android] [Changed] - Bump Android Gradle Plugin to 7.2.0

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

Test Plan: Everything builds and runs as expected

Reviewed By: hramos

Differential Revision: D36379964

Pulled By: cortinico

fbshipit-source-id: ea35cbea0b1a27bceafddd06ed91711d74e281e9
2022-05-16 07:25:03 -07:00
Nicola Corti bf71f10473 Add issue templates for New Architecture (#33832)
Summary:
I'm adding a new Issue Template for New Architecture issues + I've added a contact entry for the Working Group.

## Changelog

[Internal] - Add issue templates for New Architecture

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

Test Plan:
Tested this here
https://github.com/cortinico/react-native/issues/new/choose

Reviewed By: hramos

Differential Revision: D36376737

Pulled By: cortinico

fbshipit-source-id: b8561a7faf0bb99c033686a92bb2d88e443333c2
2022-05-16 04:28:50 -07:00
Xin Chen a093fe5f2f Queue the event for preallocated but not mounted view to dispatch later
Summary:
This diff fixed an edge case that event dispatching is failed after pre-allocation of a view and before the view is mounted.

When a cached image is loaded, we will dispatch the event to JS immediately. This is could happen after the view is created during pre-allocation phase, when the event emitter is not instantiated yet. In that case, we will see [an error](https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java#L927) and the event will effectively be ignored.

To fix that we introduced a queue in this diff for those events. They will be dispatched in order when the view is mounted and the event emitter is non-null.

Changelog:
[Android][Fixed] - Fixed an edge case that event dispatching is failed after pre-allocation of a view and before the view is mounted.

Reviewed By: mullender

Differential Revision: D36331914

fbshipit-source-id: cd065b0b36978cb5f0aac793d8d16f07a48f0881
2022-05-13 18:40:17 -07:00
Héctor Ramos 644fe430fd iOS: Use pre-built hermesc if available (#33827)
Summary:
Use pre-built hermesc if available by generating a ImportHermesc.cmake file that points to the hermesc binary. Recent `react-native` releases should have hermesc available in sdks/hermesc.

Hermes build scripts have been updated to support a `HERMES_OVERRIDE_HERMESC_PATH` envvar which can point to this generated ImportHermesc.cmake file.

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

Changelog:
[iOS] [Changed] - Use pre-built HermesC if available in current React Native release

Reviewed By: cortinico

Differential Revision: D36024615

fbshipit-source-id: 476569f73309f9bd142f28cb02d1f7d57b6cbc6a
2022-05-13 14:43:14 -07:00
Joshua Gross bd2d0b28bd Patch loophole that caused some Animated instructions to be executed out of order
Summary:
This patches a loophole in the logic that caused some operations to execute immediately and some to be deferred, even within the same render loop. This caused the non-queued operations to be executed out of order. Instead, if an operation is created and a queued exists, we just push the operation to the end of the queue so ordering is preserved.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D36379125

fbshipit-source-id: d9f63f4d47d8453d51add61763b7b9c74ffe9d88
2022-05-13 13:32:02 -07:00
Héctor Ramos 12f6081865 Circle CI: Cache Hermes dirs in iOS jobs (#33828)
Summary:
Avoid re-building Hermes if a cache hit is found for the required Hermes version.

Cache sdks/hermes and sdks/hermesc in Circle CI iOS jobs: `test_ios_rntester`, `build_ios`, and `test_ios`.

`test_ios_rntester` "Install CocoaPod Dependencies" step reduced from 37m40s to 3m35s.

`test_ios` "Generate RNTesterPods workspace" step reduced from 36m54s to 1m34s.

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

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D36365596

fbshipit-source-id: b5b6fe639f18b1724f80ab61c2262659c4987ff6
2022-05-13 12:51:09 -07:00
Derek Thurn e2dd2e2a6e Allows a Typeface object to be added to ReactFontManager
Summary:
Currently on Android, React Native can only accept font resource IDs which it internally converts into Typeface objects. This change allows ReactFontManager to be passed a Typeface at runtime to enable e.g. downloading fonts on demand.

Changelog:
[Android][Added] - Ability to pass a Typeface object to ReactFontManager in addition to a font resource ID

Reviewed By: makovkastar

Differential Revision: D36138123

fbshipit-source-id: b314e8c7fc28174b5caa017076b6eb3d4f6dbaa8
2022-05-13 12:42:32 -07:00
Héctor Ramos 5dae5936fc Hermes: Add tests for hermes-utils.js
Summary:
Add test coverage for the new `scripts/hermes/hermes-utils.js` consolidated Hermes scripts.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D36334652

fbshipit-source-id: e9570d1232c21e36da4e6be8c67d80f4ec224326
2022-05-13 11:29:08 -07:00
Tommy Nguyen 494b73cb33 fix: remove unactionable warning when on 'Paper' (#33830)
Summary:
We are currently seeing warning `Native Component 'X' that calls codegenNativeComponent was not code generated at build time. Please check its definition.` even though we have not opted into Fabric. This warning is not actionable and is just noisy.

See also discussion: https://github.com/reactwg/react-native-releases/discussions/21#discussioncomment-2657180

## Changelog

[General] [Fixed] - Remove unactionable warning about `codegenNativeComponent` when on 'Paper'

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

Test Plan: n/a

Reviewed By: dmitryrykun

Differential Revision: D36377844

Pulled By: cortinico

fbshipit-source-id: 23c9f9dbf0ce1cea60c5dc8caa02d0dc53bd635d
2022-05-13 11:23:21 -07:00
Franco Meloni e3a0eea969 Remove with_brew_cache_span from Circle's config (#33831)
Summary:
The machines have on their env `HOMEBREW_NO_AUTO_UPDATE=1`, hence I believe that `with_brew_cache_span` is not needed anymore.

If this works it should save the cache downloading and unarchiving time

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] - Remove with_brew_cache_span from Circle's config

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

Reviewed By: cortinico

Differential Revision: D36374646

Pulled By: f-meloni

fbshipit-source-id: 0e6a35bb2c2dfe44e340e95a1b5e158389a3dfe9
2022-05-13 10:51:41 -07:00
Pieter De Baets 75fb346e74 Revert D36298399: Check queue size before starting Animated batch
Differential Revision:
D36298399 (55ee8ce0c4)

Original commit changeset: b43c07994ba2

Original Phabricator Diff: D36298399 (55ee8ce0c4)

fbshipit-source-id: 20989b3e22beb6f991aad44b89d96c2946d3e39b
2022-05-13 09:19:24 -07:00
Dulmandakh 99e7373dd2 Bump Gradle to 7.4.2 (#33823)
Summary:
Bump Gradle to 7.4.2

## Changelog

[Android] [Changed] - Bump Gradle to 7.4.2

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

Test Plan: Everything builds and runs as expected.

Reviewed By: sshic

Differential Revision: D36350288

Pulled By: cortinico

fbshipit-source-id: e883d53d170439054a58dfcf31568fb33cadd042
2022-05-13 07:26:00 -07:00
Franco Meloni 0c7543df92 Delete simulators in background on CircleCI (#33822)
Summary:
Instead of wait for Circle to delete the simulators, we can do it in background and save 40 seconds

Changelog:
[Internal] - Delete iOS simulators in background

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

Reviewed By: cortinico

Differential Revision: D36348573

Pulled By: f-meloni

fbshipit-source-id: 89d9e7caddb44e085734e74f417687ee031dd67b
2022-05-13 07:15:15 -07:00
Pieter De Baets 3337add547 Pass string by ref in TurboModule lookup path
Summary:
Avoid unnecessary string copies

Changelog: [internal]

Reviewed By: nlutsenko

Differential Revision: D36312750

fbshipit-source-id: caf0985f988eb497de3be3c0526809593b01a9e2
2022-05-13 07:12:48 -07:00
Pieter De Baets 51e029ec3c Simplify ViewManagerOnDemandReactPackage.getViewManagerNames to return Collection
Summary:
This way we can avoid unnecessary ArrayList copies.

Changelog: [Android][Changed] Generalized the return type of ViewManagerOnDemandReactPackage.getViewManagerNames

Reviewed By: nlutsenko

Differential Revision: D36131516

fbshipit-source-id: 6a42c76cadbcce4c3720875d80062e1ee237bc2f
2022-05-13 06:50:04 -07:00
Héctor Ramos d7921f0504 Hermes: Use prepare-hermes-for-build in Circle CI (#33811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33811

Use `scripts/hermes/prepare-hermes-for-build.js` in Circle CI, eliminating redundant steps in the `prepare_hermes_workspace` Circle CI job.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D36335122

fbshipit-source-id: b7e8c7aeb2aac5afaf37677cd3ac949ac3f96de1
2022-05-13 00:08:04 -07:00