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

474 Коммитов

Автор SHA1 Сообщение Дата
Sam Zhou 0c4c6ca319 Add annotations to unannotated variable declarations [manually-modified]
Reviewed By: panagosg7

Differential Revision: D35948108

fbshipit-source-id: 7d286c9dd66dbd25281e2d831691f8bb34504b5d
2022-04-27 19:15:55 -07:00
Nicola Corti c11785b90d Update the hermesc output to be inside the $buildDir
Summary:
Currently, we build Hermes by specifying the Cmake flag `-B ./hermes`. That means
that the output out the build is going to be placed along side the source code.

This is fine, as long as the user doesn't use the `REACT_NATIVE_OVERRIDE_HERMES_DIR`,
which is used inside the Hermes CI. In that case, the source location of Hermes can be
changed, leading to scenarios where `hermesc` can't be found.

Here I'm changing the flag to be `-B $buildDir/hermes`. Therefore the build output
will always be located within the `./ReactAndroid/hermes-engine/build` folder.
This is a more robust solution as the build output will be encapsulated within the
`build/` folder.

Changelog:i
[Internal] [Changed] - Update the hermesc output to be inside the $buildDir

Reviewed By: cipolleschi

Differential Revision: D35964402

fbshipit-source-id: aa7e0775b282897d5a99c1c46265884d19c5f289
2022-04-27 09:41:11 -07:00
Riccardo Cipolleschi ecf3293985 Back out "Remove AsyncStorage from rn-tester and fix InternalSettings Example"
Summary:
This diff breaks the RNTester app at runtime and it prevents us from cutting RN 0.69.

Original commit changeset: a879787d8683

Original Phabricator Diff: D35435562 (f4c4f446e4)

## Changelog
[General][Fixed] - Revert change which breaks RNTester

Reviewed By: cortinico, kacieb

Differential Revision: D35936298

fbshipit-source-id: c4ec92002fde9c1de691bcda17ebc5d0747914f6
2022-04-27 01:10:18 -07:00
Kacie Bawiec ca5e3b1dc9 Fix sendAccessibilityEvent_unstable Example in RNTester
Summary:
# First issue - incorrect ref
In this example, `AccessibilityInfo.setAccessibilityFocus_unstable` is being called on the Button ref. This fails because Button is not a HostComponent and does not accept a forwarded ref.

Since the button needs to be focused in order to click on it, I don't think the intention of this example actually makes sense. Since even if it worked, it would just reset the focus in the same place.

Instead, I alter this to set accessibility focus on the preceding Text element, which makes it more clear that setAccessibilityFocus is working.

# Second Issue - focus after closing Alert doesn't work
I am not sure why this is the case, but removing the alert causes focus to work correctly. i'm guessing the set focus command is conflicting with Alert's default resetting focus behavior.

# Minor Fix
I also quickly cleaned this up to be a function component because class components make refs more confusing (to me).

Changelog:
[Genera] Fix sendAccessibilityEvent_unstable Example in RNTester

Reviewed By: p-sun

Differential Revision: D35725018

fbshipit-source-id: f5a1dbbcf2635f038c41db9ef2a0b31389d2c745
2022-04-26 12:44:42 -07:00
Nicola Corti e51e19ecc1 Add event listeners to Scheduler
Summary:
Minimal set of changes to intercept events in external modules. Current intended use-case is for Reanimated to handle events for the Animated properties.

Changelog: [Added] Add listeners to allow intercepting events in C++ core.

Reviewed By: cipolleschi

Differential Revision: D35312534

fbshipit-source-id: ec924b57fd0c0dabf7be7b886dbef23bf3170d6c
2022-04-26 05:11:05 -07:00
Chaoshuai Lu d70d7fd0b3 Adopt UIGraphicsImageRenderer API
Summary:
Apple suggested to this new API on iOS 10+.

> // Any new bitmap drawing code is encouraged to use UIGraphicsImageRenderer in lieu of this API.

WWDC18 Reference: https://developer.apple.com/videos/play/wwdc2018/219/
> Use UIGraphicsImageRenderer to create and draw to an image buffer
Supports Wide Color, unlike UIGraphicsBeginImageContext()
Combine with UIImageView for efficient offscreen rendering

Per https://nshipster.com/image-resizing/#performance-benchmarks, the new API runs even faster than the C version, probably due to more smart context reuses/management.

Changelog:
[iOS][Changed] - Adopt UIGraphicsImageRenderer API

Reviewed By: philIip

Differential Revision: D35699584

fbshipit-source-id: 7a1e2109d5e121fb396c1014f4ed0a892211b0cc
2022-04-22 17:02:51 -07:00
Luna Wei 6958bbb28c Fix up lint errors under react-native-github (#33622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33622

Changelog: [Internal] Clean up eslint errors

Reviewed By: yungsters

Differential Revision: D35599445

fbshipit-source-id: bbb9061a3cf9df32daacad9a9b44eba94d3ce48c
2022-04-22 16:25:25 -07:00
Nicola Corti aeac6ab677 Gradle: extend the algoritm to find hermesc paths.
Summary:
This diff extends the Gradle algo used to search for `hermesc`.
Currently we look into `node_modules/hermes-engine/%OS-BIN%/hermesc`

With this change the algo will look into:
- A user provided path to hermesc
- Built from source version of hermesc (for users of New Architecture)
- Bundled version of hermesc inside react-native
- hermesc from the hermes-engine NPM package

I've added tests for the new algo. I also realized our tests were broken
(since they stopped running on CI), I fixed them as well.

Changelog:
[Android] [Changed] - Gradle: extend the algoritm to find hermesc paths

Reviewed By: ShikaSD

Differential Revision: D35649911

fbshipit-source-id: d4bcbe06a6bfa8d98b91c1612fc28b300de91661
2022-04-21 07:19:28 -07:00
Riccardo Cipolleschi 8ac8439e0d Prepare AppDelegate to enable Concurrent Root on iOS (#33671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33671

With React 18, we now need to allow users on Fabric to opt-in for Concurrent Root.

This commit adds a new method that can be customized in the AppDelegate to turn the feature on and off.
The flag is passed as an initialProps to the rootView.

## Changelog:
[iOS][Added] - Prepare a method in the AppDelegate to control the concurrentRoot.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D35757833

fbshipit-source-id: 192cf74c796554cba39366aa90c53c191f960c20
2022-04-21 06:59:17 -07:00
Riccardo Cipolleschi 705c6f57d6 Export REACT_NATIVE_PATH and fix find-node-for-xcode.sh fallback behavior (#33674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33674

## Issue
In D35317070 (0480f56c5b) we introduced a way to configuring the Xcode environment via he `.xcode.env`, falling back to the old `find-node-for-xcode.sh` behavior in case of a misconfiguration.

Unfortunately, there were an issue with the new architecture for which the pods were not able to locate the `find-node-for-xcode.sh`, crashing while building the new architecture.

## Solution
This Diff solves the issue in two steps:
1. it exposes to the project the REACT_NATIVE_PATH like Android does here: D35451821 (f8d7e0a968)
2. it leverages this new variables to reach the script

## Changelog
[iOS][Changed] - Fixed the fallback behavior when the `.xcode.env` file is missing, actually using the old `find-node-for-xcode.sh` script

Reviewed By: dmitryrykun

Differential Revision: D35779165

fbshipit-source-id: 393ef9a0b98d32d9cf226f7d109fdefd772e5120
2022-04-21 06:59:17 -07:00
Héctor Ramos c6daadcab4 Bump CocoaPods to 1.11.3 and Ruby to 2.7.5 in tests/cache (#33654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33654

In D35116757 (2c87b7466e) we bumped the Circle CI macOS executor to use the Xcode 13.3.0 machine image, which has CocoaPods 1.11.3 installed. The RNTester Gemfile and CocoaPods cache is updated to reflect this change.

In D35116757 (2c87b7466e) the Ruby version was bumped to 2.7.5, so we update the Sandcastle tests to reflect this change as well.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D35679327

fbshipit-source-id: e6b5f9af13e95d335e0f89ebd7e1778a56bba601
2022-04-20 15:13:49 -07:00
Nicola Corti d7b64b8d4b Expose an API to enable Concurrent Root on Android (#33645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33645

With React 18, we now need to allow users on Fabric to opt-in for Concurrent Root.

This commit adds a new method that can be called on the ReactActivityDelegate
that can be used to set the `concurrentRoot` flag on the `initialProps` on the Render.

Changelog:
[Android] [Added] - Expose an API to enable Concurrent Root on Android

Reviewed By: mdvacca

Differential Revision: D35614879

fbshipit-source-id: 2de83e8115d3748c0346cdec6f31b2ab1f899478
2022-04-20 08:03:21 -07:00
Moti Zilberman a12959546a Revert D34518929: TalkBack support for ScrollView accessibility announcements (list and grid)
Differential Revision:
D34518929 (dd6325bafe)

Original commit changeset: 410a05263a56

Original Phabricator Diff: D34518929 (dd6325bafe)

fbshipit-source-id: 114d0910970c5f5caefb98c378722faba283f2a1
2022-04-20 06:48:19 -07:00
fabriziobertoglio1987 dd6325bafe TalkBack support for ScrollView accessibility announcements (list and grid) (#33180)
Summary:
This issue fixes [30977][17] . The Pull Request was previously published by [intergalacticspacehighway][13] with [31666][19].
The solution consists of:
1. Adding Javascript logic in the [FlatList][14], SectionList, VirtualizedList components to provide accessibility information (row and column position) for each cell in the method [renderItem][20] as a fourth parameter [accessibilityCollectionItem][21]. The information is saved on the native side in the AccessibilityNodeInfo and announced by TalkBack when changing row, column, or page ([video example][12]). The prop accessibilityCollectionItem is available in the View component which wraps each FlatList cell.
2. Adding Java logic in [ReactScrollView.java][16] and HorizontalScrollView to announce pages with TalkBack when scrolling up/down. The missing AOSP logic in [ScrollView.java][10] (see also the [GridView][11] example) is responsible for announcing Page Scrolling with TalkBack.

Relevant Links:
x [Additional notes on this PR][18]
x [discussion on the additional container View around each FlatList cell][22]
x [commit adding prop getCellsInItemCount to VirtualizedList][23]

## Changelog

[Android] [Added] - Accessibility announcement for list and grid in FlatList

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

Test Plan:
[1]. TalkBack announces pages and cells with Horizontal Flatlist in the Paper Renderer ([link][1])
[2]. TalkBack announces pages and cells with Vertical Flatlist in the Paper Renderer ([link][2])
[3]. `FlatList numColumns={undefined}` Should not trigger Runtime Error NoSuchKey exception columnCount when enabling TalkBack. ([link][3])
[4]. TalkBack announces pages and cells with Nested Horizontal Flatlist in the rn-tester app ([link][4])

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050452894
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050462465
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1032340879
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050618308
[10]:1ac46f932e/core/java/android/widget/AdapterView.java (L1027-L1029) "GridView.java method responsible for calling setFromIndex and setToIndex"
[11]:https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1042518901 "test case on Android GridView"
[12]:https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050452894 "TalkBack announces pages and cells with Horizontal Flatlist in the Paper Renderer"
[13]:https://github.com/intergalacticspacehighway "github intergalacticspacehighway"
[14]:80acf523a4/Libraries/Lists/FlatList.js (L617-L636) "FlatList accessibilityCollectionItem"
[16]:5706bd7d3e/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java (L183-L184) "logic added to ReactScrollView.java"
[17]: https://github.com/facebook/react-native/issues/30977
[18]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6
[19]: https://github.com/facebook/react-native/pull/31666
[20]: https://reactnative.dev/docs/next/flatlist#required-renderitem "FlatList renderItem documentation"
[21]: 75147359c5 "commit that introduces fourth param accessibilityCollectionItem in callback renderItem"
[22]: https://github.com/facebook/react-native/pull/33180#discussion_r826748664 "discussion on the additional container View around each FlatList cell"
[23]: d50fd1a681 "commit adding prop getCellsInItemCount to VirtualizedList"

Reviewed By: kacieb

Differential Revision: D34518929

Pulled By: blavalla

fbshipit-source-id: 410a05263a56162bf505a4cad957b24005ed65ed
2022-04-19 19:45:10 -07:00
J.T. Yim f4c4f446e4 Remove AsyncStorage from rn-tester and fix InternalSettings Example
Summary:
Changelog:
[**General**][**Removed**] - Removed AsyncStorage usage from RNTester

As part of the "Lean Core" efforts (see https://github.com/react-native-community/discussions-and-proposals/issues/6) to remove outdated and/or unused components (status: https://gist.github.com/Simek/88a9f1a014a47c37f4fce3738864d2e1), this diff removes usage of the deprecated AsyncStorage API from RNTester.

RNTester is intended as a reference to showcase various components and APIs. The implications of the replacement of AsyncStorage in RNTester with in-memory management of state is a tradeoff of persistance to a lighter weight implementation and user predictable behavior.

1. Removed AsyncStorage from rn-tester
  - removed Navigation and bookmark persisting from reducer
  - moved JS Stalls and tracking to application state with context and reducer
2. Fixed InternalSettings Example bugs

Reviewed By: lunaleaps

Differential Revision: D35435562

fbshipit-source-id: a879787d8683a1c452e5b6b75a9e01f3ceadfe5d
2022-04-19 15:34:40 -07:00
Vincent Riemer 32c704c30f Add gated option to use w3c pointer events for Pressibility's hover callbacks
Summary: Changelog: [Internal] - Add gated option to use w3c pointer events for Pressibility's hover callbacks

Reviewed By: p-sun

Differential Revision: D35596600

fbshipit-source-id: f9e4b71497efd0dbb09dbc1872694fc93a6e1f2e
2022-04-18 15:47:55 -07:00
Vincent Riemer 64034f3976 Put W3C PointerEvents RNTester examples behind a feature flag
Summary: Changelog: [Internal] - Put W3C PointerEvents RNTester examples behind a feature flag

Reviewed By: lunaleaps, p-sun

Differential Revision: D35684411

fbshipit-source-id: c69c12c5ed7ee7acc925d4ca8932e8bd8b6d4eee
2022-04-18 15:47:55 -07:00
Luna Wei de09bd3b84 Dispatch enter/leave for ancestor hit path
Summary: Changelog: [Internal] - Fix pointer event dispatch to also fire enter/leave for ancestors in the hit path. Compared the event order with web on the RNTester W3C pointer example

Reviewed By: appden

Differential Revision: D35403076

fbshipit-source-id: 726e45e49a901b1d97ad3e20f5898701fd1f763b
2022-04-11 17:17:10 -07:00
Riccardo Cipolleschi 0480f56c5b Introduce .xcode.env configuration file to source `node` (#33546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33546

This Diff does 2 things:
1. Removes all the remnant of the `find-node.sh` script. This allows React Native to stay agnostic from any other node manager
2. Introduces a way for the developers to specify which `node` executable they want to use, through a simple `.env` file.

## Changelog
[iOS][Changed] - This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used.

Reviewed By: cortinico

Differential Revision: D35317070

fbshipit-source-id: 4b400ba56aa2d574db563fa67b2008e1ddde1c59
2022-04-11 02:50:57 -07:00
Vincent Riemer 179c24e255 Emit touch-equivalent W3C pointer events on iOS
Summary: Changelog: [Internal] Emit touch-equivalent W3C pointer events on iOS

Reviewed By: lunaleaps

Differential Revision: D35295104

fbshipit-source-id: 1c1d5a4159bbfed92df151f7e12a4973ec44e970
2022-04-07 14:07:58 -07:00
Vincent Riemer cf2d05c4fe Add W3CPointerEvent example to RNTester iOS
Summary: Changelog: [Internal] Add W3CPointerEvent example to RNTester iOS

Reviewed By: kacieb

Differential Revision: D35220349

fbshipit-source-id: 240fe78c32a0cb4190fdc1e8395577b5f94b8f07
2022-04-07 14:07:58 -07:00
Nicola Corti 4befd2a29c Improve support for Android users on M1 machine (#33588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33588

Currently users on M1 machine can't use the New Architecture correctly as they will get build failures when building the native code.

This Diff fixes it by automatically recognizing the host architecture and switching to NDK 24 if user is runnign on `aarch64`

Changelog:
[Android] [Fixed] - Improve support for Android users on M1 machine

Reviewed By: mdvacca

Differential Revision: D35468252

fbshipit-source-id: b73f5262b9408f04f3ae4fd26458a4d17c1ec29a
2022-04-07 10:55:32 -07:00
Chris Olszewski daa105aba5 Fixup typo in pfh labels
Summary:
Now that the PFH node has been renamed this updates the pfh label.

Produced via `xbgs -l -e '"pfh:ReactNative_CommonInfrastructurePlaceholde"' | xargs sed -i 's/"pfh:ReactNative_CommonInfrastructurePlaceholde"/"pfh:ReactNative_CommonInfrastructurePlaceholder"/'`

Reviewed By: jkeljo

Differential Revision: D35374087

fbshipit-source-id: 61590f69de5a69ec3b8a0478f6dd43409de3c70b
2022-04-05 12:15:05 -07:00
Pieter De Baets 6e5cefe604 Codemod arvr to use onPointer* instead of onEnter/onExit/onMove
Summary: Changelog: [Internal] Improve experimental support for pointer event dispatching support in JS

Reviewed By: mdvacca

Differential Revision: D35216647

fbshipit-source-id: 212f038115e4713097db05847a9638efe0a25bed
2022-04-05 07:11:10 -07:00
Héctor Ramos 72dfc2725c Print logs to differentiate JSC and Hermes builds
Summary:
Print logs during `pod install` to clarify when Hermes is being used with RNTester and/or iOS React Native apps.

This changeset should not result in any change to the behavior of `pod install`, other than adding logs to CocoaPods' stdout.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D35294993

fbshipit-source-id: 55b6115d9f49c311c34ad3cb07346b2f97adcbf9
2022-04-02 00:02:11 -07:00
Luna Wei 4ce3914727 Add absolute child example to RNTester - W3CPointerEvents
Summary: Changelog: [Internal] Add another example for testing out the pointer events spec

Reviewed By: vincentriemer

Differential Revision: D35116565

fbshipit-source-id: 5f0cfeb871ae55071549c2289782401807f55515
2022-03-30 19:12:42 -07:00
Luna Wei 50070ec7c6 Add W3CPointerEvent example to RNTester Android
Summary:
Changelog: [Internal]
Add an example demonstrating pointer events

Reviewed By: vincentriemer

Differential Revision: D34422438

fbshipit-source-id: da378b4aaae8548f1114c1b23351527db6a6db69
2022-03-30 19:12:42 -07:00
Chris Olszewski ceae48c0f7 Add pfh labels to targets
Summary:
While it would be better to be able to do all of the ownership metadata at the Buck macro level, that proved to be more work than expected.

This diff adds the corresponding pfh label to all targets in `xplat/js/react-native-github` that have a Supermodule label. Once the migration is complete the Supermodules labels will be able to be removed.

Reviewed By: cortinico

Differential Revision: D35221544

fbshipit-source-id: d87d5e266dfb5e6ee087251dc34dff5db299bbaf
2022-03-30 14:37:03 -07:00
Chris Olszewski 75edd288cb Backout feature args
Reviewed By: jkeljo

Differential Revision: D35203884

fbshipit-source-id: 87d50b138aaa3dd16a24b5ff2795910c3644d418
2022-03-30 06:53:44 -07:00
fabriziobertoglio1987 7b5b114d57 Making links independently focusable by Talkback (#33215)
Summary:
This issue fixes [32004][23]. The Pull Request was previously published by [blavalla][10] with [31757][24].
>This is a follow-up on [D23553222 (b352e2da81)][18], which made links functional by using [Talkback's Links menu][1]. We don't often use this as the sole access point for links due to it being more difficult for users to navigate to and easy for users to miss if they don't listen to the full description, including the hint text that announces that links are available.
The Implementation of the functionality consists of:

Retrieving the accessibility links and triggering the TalkBack Focus over the Text
1. nested Text components with accessibilityRole link are saved as [ReactClickableSpan][17] instances in Android native [TextView][20] ([more info][19])
1. If the TextView contains any [ClickableSpans][15] (which are [nested Text][14] components with role link), set a view tag and reset the accessibility delegate.
3. Obtain each link description, start, end, and position relative to the parent Text (id) from the Span as an [AccessibilityLink][16]
4. Use the [AccessibilityLink][16]  to display TalkBack focus over the link with the `getVirtualViewAt` method (more [info][13])

Implementing ExploreByTouchHelper to detect touches over links and to display TalkBack rectangle around them.
1. ReactAccessibilityDelegate inherits from [ExploreByTouchHelper][12]
2. If the [ReactTextView][21] has an accessibility delegate, trigger ExploreByTouchHelper method [dispatchHoverEvent][22]
3.  Implements the methods `getVirtualViewAt` and `onPopulateBoundsForVirtualView`.
     The two methods implements the following functionalities  (more [info][13]):
    * detecting the TalkBack onPress/focus on nested Text with accessibilityRole="link"
    * displaying TalkBack rectangle around nested Text with accessibilityRole="link"

## Changelog

[Android] [Added] - Make links independently focusable by Talkback

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

Test Plan:
[1]. User Interacts with links through TalkBack default accessibility menu ([link][1])
[2]. The nested link becomes the next focusable element after the parent element that contains it. ([link][2])
[3]. Testing accessibility examples in pr branch ([link][3])
[4]. Testing accessibility android examples in pr branch ([link][4])
[7]. TalkBack focus moves through links in the correct order from top to bottom (PR Branch with [link.id][25]) ([link to video test][7]) ([discussion][26])
[8]. TalkBack focus does not move through links in the correct order from top to bottom (PR Branch without [link.id][25]) ([link to video test][8]) ([discussion][26])

Test on main branch
[5]. Testing accessibility examples in main branch ([link][5])
[6]. Testing accessibility android examples in main branch ([link][6])

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1045593386
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1045593164
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054900872
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054918634
[5]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054888278
[6]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054891828
[7]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1060073165
[8]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1060098381

[10]: https://github.com/blavalla "blavalla github profile"
[12]: 1ac46f932e/core/java/com/android/internal/widget/ExploreByTouchHelper.java (L48) "com/android/internal/widget/ExploreByTouchHelper.java#L48"
[13]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1046384200 "explanation of getVirtualViewAt and onPopulateBoundsForVirtualView"
[14]: 1ac46f932e/core/java/android/text/Spannable.java (L3) "core/java/android/text/Spannable.java#L3"
[15]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java (L70-L71) "react/views/text/ReactTextViewManager.java#L70-L71"
[16]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java (L680-L685) "react/uimanager/ReactAccessibilityDelegate.java#L680-L685"
[17]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java (L126-L129) "react/views/text/TextLayoutManager.java#L126-L129"
[18]: b352e2da81
[19]: https://github.com/facebook/react-native/issues/30375#issuecomment-781494859 "explanation on how nested Text are converted to Android Spans"
[20]: 1ac46f932e/core/java/android/widget/TextView.java (L214-L220) "core/java/android/widget/TextView.java#L214-L220"
[21]: 485cf6118b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java (L577) "dispatchHoverEvent in ReactTextView"
[22]: 1ac46f932e/core/java/com/android/internal/widget/ExploreByTouchHelper.java (L120-L138) "dispatchHoverEvent in ExploreByTouchHelper"
[23]: https://github.com/facebook/react-native/issues/32004
[24]: https://github.com/facebook/react-native/pull/31757
[25]: 485cf6118b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java (L648) "setting link.id in the AccessibilityLink constructor"
[26]: 485cf6118b (r820014411) "comment on role of link.id"

Reviewed By: blavalla

Differential Revision: D34687371

Pulled By: philIip

fbshipit-source-id: 8e63c70e9318ad8d27317bd68497705e595dea0f
2022-03-29 13:36:24 -07:00
CodemodService Bot 590ffad018 Annotate targets with feature xplat/js/react-native-github/ReactCommon/react/renderer/mapbuffer/BUCK -> xplat/js/tools/metro/packages/metro-runtime/src/polyfills/BUCK
Reviewed By: jkeljo

Differential Revision: D35178571

fbshipit-source-id: b8b6fcd49459e37152c02db8c7a6cfed167248a9
2022-03-28 13:22:38 -07:00
Genki Kondo 19cf70266e VirtualizedList optimization - avoid lambda creation in CellRenderer onLayout prop
Summary:
Problem:
All CellRenderers rerender every time the containing VirtualizedList is rerendered. This is due to the following:
- Lambda is created for each CellRenderer's onLayout prop on every VirtualizedList render (fixed in this diff)
- CellRenderer's parentProps prop changes on every VirtualizedList render

Changelog:
[Internal] - VirtualizedList optimization - avoid lambda creation in CellRenderer onLayout prop

Reviewed By: javache

Differential Revision: D35061321

fbshipit-source-id: ab16bda8418b692f1edb4bce87e25c34f6252b56
2022-03-24 08:28:01 -07:00
Héctor Ramos 12ad1fffe8 Build Hermes from source by default on iOS
Summary:
Remove BUILD_HERMES_SOURCE gate and default to building Hermes from source on iOS when Hermes is enabled.

Changelog:
[iOS][Changed] - When Hermes is enabled, the Hermes Engine will be built from source instead of using the pre-built `hermes-engine` CocoaPod.

Reviewed By: cortinico

Differential Revision: D34911987

fbshipit-source-id: 9d6d49498a23f6dae0b97c9f80c689b654db11bd
2022-03-23 16:53:47 -07:00
Nicola Corti 4d91f40fbd Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package. (#33467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33467

We can now change the `hermes-engine` dependency to be consumed by the `react-native` NPM package
and not anymore from the standalone `hermes-engine`. This will allow for a better stability
as the `hermes-engine` and the `react-native` were built from source at the same instant in time.

Changelog:
[Android] [Changed] - Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package.

Reviewed By: hramos

Differential Revision: D34213795

fbshipit-source-id: 29e54b37db0103f72e9983976ef9147fe69116e7
2022-03-23 04:50:12 -07:00
Pieter Vanderwerff 83ab3615c5 Land suppressions ahead of 0.174.1 release [v2]
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D35035872

fbshipit-source-id: 74daf0685e976459119061a3fca467277f0dc4ac
2022-03-22 11:42:16 -07:00
Nicola Corti 5b1ac6fb3b Use `findByName` instead of `named` when applying Gradle task dependencies
Summary:
When using Android Studio, an active ABI gets selected which is resulting in failing to open the project as some of the tasks can't be found. I'm fixing this.

Changelog:
[Internal] [Changed] - Use `findByName` instead of `named` when applying Gradle task dependencies

Reviewed By: ShikaSD

Differential Revision: D35044870

fbshipit-source-id: 44bfaee320bce84c992610325c13daf71934a38b
2022-03-22 04:48:52 -07:00
Abishek Sethuraman ecc63daf4b Revert D35016384: Land suppressions ahead of 0.174.1 release
Differential Revision:
D35016384 (2fab97fde5)

Original commit changeset: 78ab1b4822c0

Original Phabricator Diff: D35016384 (2fab97fde5)

fbshipit-source-id: 82d9672798fdb77313a35be40d0c0aebb0cace64
2022-03-21 15:24:39 -07:00
Pieter Vanderwerff 2fab97fde5 Land suppressions ahead of 0.174.1 release
Summary: Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D35016384

fbshipit-source-id: 78ab1b4822c0a3aeab63d615b81b6063a883fe54
2022-03-21 14:24:38 -07:00
Phillip Pan c71e6efbcd bump iOS and tvOS from 11.0 to 12.4 in pbxproj
Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

Reviewed By: sammy-SC

Differential Revision: D34548360

fbshipit-source-id: e1a90fd6c1fc6b680ea6e53b7434fd7f5c3d6ee4
2022-03-16 21:08:01 -07:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Andrei Shikov cd60ffdb62 Bump Flipper-Glog to 0.5.0.4
Summary:
Updates Flipper-Glog to address failing assertion in `mutex.h`

Changelog: [iOS][Updated] - Updated Flipper-Glog to 0.5.0.4

Reviewed By: bvanderhoof

Differential Revision: D34935757

fbshipit-source-id: 6e2dc5bf5608eb0d4cd89418fe1e04b8780bca16
2022-03-16 15:30:58 -07:00
Genki Kondo 67af1b8218 Add RNTester example for nested text
Summary:
Existing RNTester examples for text did not contain a case where text with color was nested inside of another with text at both ends. This would have caught T113767991

Changelog:
[Internal] - Add RNTester example for nested text

Reviewed By: mdvacca

Differential Revision: D34874080

fbshipit-source-id: cda91cde9c7449abb677ae9fa936a61e396ffbd3
2022-03-15 12:06:58 -07:00
Ken Tominaga f001d091b1 Add scripts to debug the `rn-tester` project easier (#33386)
Summary:
This pull request simplifies and makes it easy to debug the `rn-tester` project and switch configurations within the project.

- `yarn start` : Start packager
- `yarn install-android-jsc` : Build with `installJscDebug`.
- `yarn install-android-hermes` : Build with `installHermesDebug`.
- `yarn clean-android` : Clean up the Android build files.
- `yarn setup-ios-jsc` : Install dependencies to use JSC.
- `yarn setup-ios-hermes` : Install dependencies to use Hermes.
- `yarn clean-ios` : Clean up the build files and Pods.

## 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] [Changed] - Add scripts to debug `rn-tester` easier

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

Test Plan:
<details><summary>Log</summary>
<p>

```sh
// packages/rn-tester

$ yarn setup-ios-jsc

yarn run v1.22.17
$ yarn install && bundle install && bundle exec pod install
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
success Already up-to-date.
Using rexml 3.2.5
Using CFPropertyList 3.0.5
Using concurrent-ruby 1.1.9
Using i18n 1.9.1
Using minitest 5.15.0
Using tzinfo 2.0.4
Using zeitwerk 2.5.4
Using activesupport 6.1.4.4
Using public_suffix 4.0.6
Using addressable 2.8.0
Using httpclient 2.8.3
Using json 2.6.1
Using algoliasearch 1.27.5
Using atomos 0.1.3
Using bundler 2.1.4
Using claide 1.1.0
Using fuzzy_match 2.0.4
Using nap 1.1.0
Using netrc 0.11.0
Using ffi 1.15.5
Using ethon 0.15.0
Using typhoeus 1.4.0
Using cocoapods-core 1.11.2
Using cocoapods-deintegrate 1.0.5
Using cocoapods-downloader 1.5.1
Using cocoapods-plugins 1.0.0
Using cocoapods-search 1.0.1
Using cocoapods-trunk 1.6.0
Using cocoapods-try 1.2.0
Using colored2 3.1.2
Using escape 0.0.4
Using fourflusher 2.3.1
Using gh_inspector 1.1.3
Using molinillo 0.8.0
Using ruby-macho 2.5.1
Using nanaimo 0.3.0
Using xcodeproj 1.21.0
Using cocoapods 1.11.2
Bundle complete! 2 Gemfile dependencies, 38 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Building RNTester with Fabric enabled.
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Building RNTester with Fabric enabled.
[Codegen] Skipping React-Codegen podspec generation.
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Building RNTester with Fabric enabled.
[Codegen] Skipping React-Codegen podspec generation.
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Analyzing dependencies
[Codegen] Found FBReactNativeSpec
[Codegen] Found rncore
[Codegen] Found ScreenshotmanagerSpec
Downloading dependencies
Installing FBLazyVector 1000.0.0
Installing FBReactNativeSpec 1000.0.0
Installing RCTRequired 1000.0.0
Installing RCTTypeSafety 1000.0.0
Installing React 1000.0.0
Installing React-Core 1000.0.0
Installing React-CoreModules 1000.0.0
Installing React-Fabric 1000.0.0
Installing React-RCTActionSheet 1000.0.0
Installing React-RCTAnimation 1000.0.0
Installing React-RCTBlob 1000.0.0
Installing React-RCTFabric 1000.0.0
Installing React-RCTImage 1000.0.0
Installing React-RCTLinking 1000.0.0
Installing React-RCTNetwork 1000.0.0
Installing React-RCTPushNotification 1000.0.0
Installing React-RCTSettings 1000.0.0
Installing React-RCTTest 1000.0.0
Installing React-RCTText 1000.0.0
Installing React-RCTVibration 1000.0.0
Installing React-callinvoker 1000.0.0
Installing React-cxxreact 1000.0.0
Installing React-graphics 1000.0.0
Installing React-jsi 1000.0.0
Installing React-jsiexecutor 1000.0.0
Installing React-jsinspector 1000.0.0
Installing React-logger 1000.0.0
Installing React-perflogger 1000.0.0
Installing React-rncore 1000.0.0
Installing React-runtimeexecutor 1000.0.0
Installing ReactCommon 1000.0.0
Installing Yoga 1.14.0
Generating Pods project
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig
React-Core
Integrating client project
Pod installation complete! There are 65 dependencies from the Podfile and 53 total pods installed.
  Done in 8.68s.
```

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D34835086

Pulled By: cortinico

fbshipit-source-id: 83649f42e8ac77efd8617601e18f15bfcf8f1f61
2022-03-15 07:10:21 -07:00
Andrei Shikov 5d5addd661 Separate folly into runtime + folly_futures specific for hermes inspector
Summary:
Rearranges folly_futures configuration into a static library only required for `hermes-inspector` + `folly_runtime` which merges `folly_json` and mutex-related implementations `folly_futures` was used for. As `hermes-executor-debug` is removed by `vmCleanup` configurations later, it allows to shave additional 300KB from the release APK size.

Changelog: [Internal] - Rearrange folly build to reduce APK size

Reviewed By: cortinico

Differential Revision: D34342514

fbshipit-source-id: b646680343e6b9a7674019506b87b96f6007caf2
2022-03-13 15:15:21 -07:00
Gabriel Donadel Dall'Agnol 64ebe5bbdd feat: Add dismissActionSheet method to ActionSheetIOS (#33189)
Summary:
This PR adds a `dismissActionSheet` method to `ActionSheetIOS` in order to allow dismissing an ActionSheet programmatically. This is especially useful in apps where a user has the ability to open an ActionSheet and then open a push notification that will redirect them to another screen which usually leads to scenarios where the presented ActionSheet has no relation with the current screen.

#### TODO
- [ ]  Submit react-native-website PR updating ActionSheetIOS documentation.

## Changelog

[iOS] [Added] - Add dismissActionSheet method to ActionSheetIOS

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

Test Plan:
1. Open the RNTester app and navigate to the ActionSheetIOS page
2. Test `dismissActionSheet` through the `Show Action Sheet and automatically dismiss it` example

https://user-images.githubusercontent.com/11707729/155867546-c6770a49-9b09-45e3-a6b1-4f7645d67dbf.mov

Reviewed By: lunaleaps

Differential Revision: D34518952

Pulled By: cortinico

fbshipit-source-id: 912a9b83ee078f791b42efddf5abb7e1cd09d520
2022-03-11 16:33:17 -08:00
Scott Kyle 6a9497dbbb Move some classes to new bridging library (#33413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33413

This moves `CallbackWrapper` and `LongLivedObject` into a new "bridging" library. This library is mostly intended for use by the native module system, but can also be used separately to "bridge" native and JS interfaces through higher-level (and safer) abstractions than relying JSI alone.

Changelog:
Internal

Reviewed By: christophpurrer

Differential Revision: D34723341

fbshipit-source-id: 7ca8fa815537152f8163920513b90313540477e3
2022-03-11 12:47:51 -08:00
Kudo Chien a6c2846b37 Fix ios build error when use_frameworks is on and fabric is off (v2) (#33409)
Summary:
alternative solution for https://github.com/facebook/react-native/issues/33379

> when `use_frameworks!` is on, there are errors like:
> ```
> 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
> #import <FBReactNativeSpec/FBReactNativeSpec.h>
> ```
> this error may come from from https://github.com/facebook/react-native/commit/f7e4c07c84b6 regression.
>
> when `use_frameworks!` is on, xcode will search headers from framework directories, the correct imports would be `#import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h>` (xcode will transform dash to underscore, so it is `React_Codegen` but not `React-Codegen`). in the other hand, when `use_frameworks!` is off, the correct import is `#import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>`.
>
>
> this fix is specific for old architecture (fabric is off).
>
> when fabric is on, there are other errors from duplicated headers when copying to build folder. [the reason is that framework build would try to flatten headers](https://mkonrad.net/2015/03/29/xcode-static-libraries-preserving-header-directory-structure.html). we have `primitives.h` in different folders and they would be flattened into `React_Fabric.framework/Headers`. to be honest, i don't know how to deal with the problem in the meantime,  maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

in this alternative fix, i try to add `React-Codegen/React_Codegen.framework/Headers` into header search paths and make original `#import <FBReactNativeSpec/FBReactNativeSpec.h>` reachable.

[this change](7a0398c331) in the pr is just a workaround to solve breaking in latest main branch and this is not important to the `use_frameworks!` fix at all. this breaking was coming from 1804951595.

## Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile `use_frameworks!` is on and Fabric is off

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

Test Plan:
verify with rn-tester
1. change `fabric_enabled` to false in `packages/rn-tester/Podfile`
2. `USE_FRAMEWORKS=1 pod install`
3. build rn-tester in xcode

Reviewed By: dmitryrykun

Differential Revision: D34817041

Pulled By: cortinico

fbshipit-source-id: 4d1a610e99a807793eb3f64461e0d735c0a9ca9c
2022-03-11 09:08:07 -08:00
Mike Hardy 2a5265dff7 fix(ios, flipper): update flipper sub-pods to support macCatalyst (#33406)
Summary:
Flipper-DoubleConversion and Flipper-Glog iOS pods received a build optimization
a few versions back that pre-compiled the pods and references the xcframework slices

Unfortunately, the pre-compile did not include macCatalyst slices, so this disabled support
for flipper on macOS for react-native >0.65

lblasa has re-compiled the pods with the macCatalyst slices added

See https://github.com/facebook/flipper/issues/3117

## 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] - update Flipper pods to support re-enable macCatalyst

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

Test Plan:
- [ ] The Flipper repo has a react-native test that appeared to work with these versions, CI should work here
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on arm64
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on x86_64 mac
- [ ] Prove there is no regression, a flipper-enabled build test should work for real device iOS target
- [ ] To prove the issue is resolved, a build should be attempted for a macCatalyst target, and it should work.

Reviewed By: cortinico

Differential Revision: D34789654

Pulled By: lblasa

fbshipit-source-id: 466803dd07b5820220512b7d7d760b94b8aa65f7
2022-03-11 02:47:27 -08:00
caioagiani 8200063ac6 fix: typos (#33040)
Summary:
Fix typos in:

- `Libraries/Renderer/implementations/ReactFabric-dev.js`: transfered -> **transferred**
- `Libraries/Renderer/implementations/ReactNativeRenderer-dev.js`: transfered -> **transferred**
- `ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java`: remainderLenght -> **remainderLength**
- `ReactAndroid/src/main/jni/first-party/yogajni/jni/ScopedGlobalRef.h`: Transfering -> **Transferring**
- `ReactCommon/react/renderer/graphics/Transform.h`:  tranformation -> **transformation**
- `packages/rn-tester/js/examples/ToastAndroid/ToastAndroidExample.android.js`: occured -> **occurred**

## 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] [Fixed] - fix typos

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

Test Plan: Considering this only changes code comments, I don’t think this pull request needs a test plan.

Reviewed By: cortinico, pasqualeanatriello

Differential Revision: D34003812

Pulled By: dmitryrykun

fbshipit-source-id: 5c8699f8efcc4354854190a9aade30dbc5c90fdb
2022-03-08 03:58:58 -08:00
Diego Pasquali 7b05b091fd Integrated iOS-only `accessibilityLanguage` prop (#33090)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/30891

This PR is going to add an `accessibilityLanguage` prop to all the available components. This props is currently working only on iOS and should follow the [guidelines of the relative configuration](https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage).

I'm in no way an expert on native programming (especially Objective-C) so I'm open to changes / improvements 🙂

## 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] - Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS.

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

Test Plan:
This has been tested using both the Simulator, checking for the `Language` attribute, and using a physical device with the Voice Over enabled.

<img width="1083" alt="Screenshot 2022-02-11 at 13 17 32" src="https://user-images.githubusercontent.com/5963683/153590415-65fcb4ff-8f31-4a0f-90e5-8eb1aae6aa3d.png">

Reviewed By: philIip

Differential Revision: D34523608

Pulled By: rh389

fbshipit-source-id: b5d77fc0b3d76ea8ed8f30c8385459ba98122ff6
2022-03-07 09:43:30 -08:00