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

6976 Коммитов

Автор SHA1 Сообщение Дата
Zachinquarantine 6075d64acf Remove the isTVOS check (#34071)
Summary:
Removes the `isTVOS` check, which just duplicated and returned the `isTV` check anyway.

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

[General] [Removed] - Remove deprecated `isTVOS` constant.

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

Test Plan: Run against CI, and apply changes as needed.

Reviewed By: cipolleschi

Differential Revision: D37434978

Pulled By: cortinico

fbshipit-source-id: 2b38253125251b0ce28cf10c88471d8f16704999
2022-06-27 02:30:10 -07:00
Pieter Vanderwerff 66c6a75650 Suppress missing annotations in xplat/js
Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.

Reviewed By: bradzacher

Differential Revision: D37388949

fbshipit-source-id: cdcbc98035ce9b6994842005ea46df42de54f9b8
2022-06-23 16:54:29 -07:00
Pieter Vanderwerff c940eb0c49 Add LTI annotations to function params in xplat/js [manually-modified]
Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predicatable.

Reviewed By: bradzacher

Differential Revision: D37363351

fbshipit-source-id: a9d3df7db6f9d094ac2ce81aae1f3ab4f62b243a
2022-06-22 23:01:55 -07:00
Pieter Vanderwerff e7a4dbcefc Add LTI annotations to function params in xplat/js [1/2]
Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predicatable.

Reviewed By: evanyeung

Differential Revision: D37353648

fbshipit-source-id: e5a0c685ced85a8ff353d578b373f836b376bb28
2022-06-22 21:36:52 -07:00
Pieter Vanderwerff d96744e277 Add LTI annotations to function params in xplat/js [2/2]
Summary: Add annotations to function parameters required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predicatable.

Reviewed By: evanyeung

Differential Revision: D37360113

fbshipit-source-id: 870bcfe680542b3861fefbaf372db0ae8b32cbf3
2022-06-22 18:46:51 -07:00
Luis Santana 68f3a42fc7 bump RTC-Folly to 2021.07.22 (#33841)
Summary:
Bumping RTC-Folly version used to address CVE-2022-24440.

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

[General][Security] - Bump RTC-Folly to 2021-07-22

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

Reviewed By: Andjeliko, philIip

Differential Revision: D36425598

Pulled By: cortinico

fbshipit-source-id: d38c5f020dbecf794b10f12ed2da30e1825071af
2022-06-21 12:36:43 -07:00
Tim Yung e5c5dcd9e2 RN: Rewrite EventEmitter
Summary:
Rewrites `EventEmitter` as a simple, type-safe abstraction with a minimal interface.

The public interface of `EventEmitter` is unchanged. This rewrite was made possible only after deprecating and removing public methods that imposed restrictions on implementation details (e.g. deleting `removeListener`).

However, this includes a subtle breaking change that makes it behave the same as `EventEmitter` in Node.js and `EventTarget` in the DOM. The set of listeners being notified by `emit` will no longer be influenced by changes made during the course of notifying the existing listeners.

Changelog:
[General][Changed] - `EventEmitter#emit` now freezes the set of listeners before iterating over them, meaning listeners that are added or removed will not affect that iteration.

Reviewed By: javache

Differential Revision: D22153962

fbshipit-source-id: 81b87113590dee0296eff61374bf732171855453
2022-06-18 08:23:32 -07:00
Kacie Bawiec 4bb551d018 Back out "TalkBack support for ScrollView accessibility announcements (list and grid) - Javascript Only Changes"
Summary:
Original commit changeset: 3765213c5d8b

Original Phabricator Diff: D37189197 (2d5882132f)

Changelog: [Internal]

Reviewed By: bvanderhoof

Differential Revision: D37260990

fbshipit-source-id: bfcb10f2d5a2a1427b72a10ef380df194b041ba0
2022-06-17 22:08:57 -07:00
fabriziobertoglio1987 2d5882132f TalkBack support for ScrollView accessibility announcements (list and grid) - Javascript Only Changes (#33180)
Summary:
This is the Javascript-only changes from D34518929 (dd6325bafe), split out for push safety. Original summary and test plan below:

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

Pulled By: blavalla

fbshipit-source-id: 3765213c5d8bfde56e0e5f155cdd899c368512e7
2022-06-17 17:59:51 -07:00
David 5854b11bf9 Add ability to pass ItemSeparatorComponent as React Element (#32748)
Summary:
Currently `ListHeaderComponent` & `ListFooterComponent` allow to use React Componetn & Elemelen

```tsx
<FlatList
  ListHeaderComponent={<View />} // valid
  ListHeaderComponent={View}     // valid
/>
```

But when you try to pass `ItemSeparatorComponent` as React Element it will throw an error

```tsx
<FlatList
  ItemSeparatorComponent={View}     // ok
  ItemSeparatorComponent={<View />} /* not valid:
    Error: Element type is invalid: expected a string (for built-in components) or a class/function
    (for composite components) but got: object.
    Check the render method of `CellRenderer`.
  */
/>
```

So, this PR adds this ability

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

[General] [Changed] - Add ability to pass `ItemSeparatorComponent` as React Element

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

Test Plan: ...

Reviewed By: lyahdav

Differential Revision: D37227719

Pulled By: cortinico

fbshipit-source-id: 1c4943fa9d42bf5e61fbd999d1f5be46b51ecb14
2022-06-17 16:28:03 -07:00
Ramanpreet Nara 4967e50989 Make LogBox render through SurfaceRegistry
Summary:
LogBox was using AppRegistry to render on to the screen. Switch LogBox over to using SurfaceRegistry instead.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D37223641

fbshipit-source-id: 59001ad290c1e2c2f14828d38a96f48bd1ab39ca
2022-06-17 04:34:59 -07:00
Jack Worden 56051caac5 Back out "React Native sync for revisions d300ceb...256aefb"
Summary:
Original commit changeset: 4c0afc95abe8

Original Phabricator Diff: D37155957 (d1321d88bd)

See attached UBN task for more details, I am reverting the whole diff now while investigating the root cause.

Changelog:
[General][Changed] - Revert "React Native sync for revisions d300ceb...256aefb"

jest_e2e[run_all_tests]

=== update
klein did a bisect for S276290, it seems Original Phabricator Diff: D37155957 (d1321d88bd) is the blame diff.
jackworden also has verified backout can fix it for both ios and android.

Reviewed By: ahujap-fb, kacieb

Differential Revision: D37205394

fbshipit-source-id: 600e6593532da064631c016aace317932f290c67
2022-06-17 03:13:14 -07:00
Ramanpreet Nara 83f13e15c6 Bridgeless mode: Stop register JSTimers as callable JavaScript module
Summary:
We do not need to register JSTimers as a callable JavaScript module in bridgeless mode.

How we know bridgeless mode doesn't use JSTimers: [xbgs JSTimers](https://fburl.com/code/clbz47j5)

## Details: iOS
JSTimers is only called into [by RCTCxxBridge](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/xplat/js/react-native-github/React/CxxBridge/RCTCxxBridge.mm?lines=1471), and [RCTTiming.mm, which uses the RCTBridge](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/xplat/js/react-native-github/React/CoreModules/RCTTiming.mm?lines=23%2C241%2C264). RCTBridge is unavailable in bridgeless mode.

## Details: Android
JSTimers is only called into [by TimingModule, inside its BridgeTimerExecutor](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java?lines=31%2C40%2C49). This BridgeTimerExecutor is [passed to TimingModule's JavaTimerManager](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java?lines=61-66).

The Bridgeless React instance on Android **does not** use this TimingModule, or this BridgeTimerExecutor. Instead, the Bridgeless React instance [creates its own JavaTimerManager](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/fbandroid/java/com/facebook/venice/ReactInstance.java?lines=118-123), [in C++](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/fbandroid/java/com/facebook/venice/ReactInstance.java?lines=117%2C121%2C382), that [implements the callTimers APIs in C++](https://www.internalfb.com/code/fbsource/[88911d726fb4413765903c32a9077cd662ee7b6e]/fbandroid/java/com/facebook/venice/jni/JJSTimerExecutor.cpp?lines=18-22). Therefore, in Bridgeless mode, the React instance calls into TimerManager to execute timers, whereas in Bridge mode, TimingModule calls into JSTimers to call timers. Hence, JSTimers should also not be used in bridgeless mode.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D37208873

fbshipit-source-id: ef6ebe0e8a9fcbcc1f8403ed40ff94ec00b2beac
2022-06-16 17:59:40 -07:00
Rick Hanlon d1321d88bd React Native sync for revisions d300ceb...256aefb
Summary:
This sync includes the following changes:
- **[5cc2487e0](https://github.com/facebook/react/commit/5cc2487e0 )**: bump versions for next release ([#24725](https://github.com/facebook/react/pull/24725)) //<Josh Story>//
- **[54f17e490](https://github.com/facebook/react/commit/54f17e490 )**: [Transition Tracing] Fix Cache and Transitions Pop Order ([#24719](https://github.com/facebook/react/pull/24719)) //<Luna Ruan>//
- **[7cf8dfd94](https://github.com/facebook/react/commit/7cf8dfd94 )**: [Transition Tracing] Create/Process Marker Complete Callback ([#24700](https://github.com/facebook/react/pull/24700)) //<Luna Ruan>//
- **[327e4a1f9](https://github.com/facebook/react/commit/327e4a1f9 )**: [Follow-up] Land enableClientRenderFallbackOnTextMismatch //<Andrew Clark>//
- **[a8c9cb18b](https://github.com/facebook/react/commit/a8c9cb18b )**: Land enableSuspenseLayoutEffectSemantics flag ([#24713](https://github.com/facebook/react/pull/24713)) //<Andrew Clark>//
- **[a8555c308](https://github.com/facebook/react/commit/a8555c308 )**: [Transition Tracing] Add Tracing Marker Stack ([#24661](https://github.com/facebook/react/pull/24661)) //<Luna Ruan>//
- **[8186b1937](https://github.com/facebook/react/commit/8186b1937 )**: Check for infinite update loops even if unmounted ([#24697](https://github.com/facebook/react/pull/24697)) //<Andrew Clark>//
- **[060505e9d](https://github.com/facebook/react/commit/060505e9d )**: Fix misapplying prod error opt-out ([#24688](https://github.com/facebook/react/pull/24688)) //<Josh Story>//
- **[47944142f](https://github.com/facebook/react/commit/47944142f )**: `now` isn't part of the react-reconciler config anymore ([#24689](https://github.com/facebook/react/pull/24689)) //<Mathieu Dutour>//
- **[b34552352](https://github.com/facebook/react/commit/b34552352 )**: [Fizz] Support abort reasons ([#24680](https://github.com/facebook/react/pull/24680)) //<Josh Story>//
- **[79f54c16d](https://github.com/facebook/react/commit/79f54c16d )**: Bugfix: Revealing a hidden update ([#24685](https://github.com/facebook/react/pull/24685)) //<Andrew Clark>//
- **[7e8a020a4](https://github.com/facebook/react/commit/7e8a020a4 )**: Remove extra Server Context argument ([#24683](https://github.com/facebook/react/pull/24683)) //<Sebastian Markbåge>//
- **[4f29ba1cc](https://github.com/facebook/react/commit/4f29ba1cc )**: support errorInfo in onRecoverableError ([#24591](https://github.com/facebook/react/pull/24591)) //<Josh Story>//
- **[1cd90d2cc](https://github.com/facebook/react/commit/1cd90d2cc )**: Refactor of interleaved ("concurrent") update queue ([#24663](https://github.com/facebook/react/pull/24663)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions d300ceb...256aefb

jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D37155957

fbshipit-source-id: 4c0afc95abe8fa13c3803584922c8dc0059ff562
2022-06-15 12:23:01 -07:00
Ruslan Latypov c78babac39 fixing more imports
Summary: Some files relying on -include_pch and therefore they miss Foundation.h and UIKit.h includes. This diff is fixing missing imports

Reviewed By: rmaz

Differential Revision: D37140239

fbshipit-source-id: bc57921e0c8365e0e9a5a571d607ba40ff1b31f3
2022-06-14 13:37:04 -07:00
Supreet Singh 9eb2826f9b Response headers to image - iOS (#33880)
Summary:
Please see this issue https://github.com/facebook/react-native/issues/33034 for details on the problem solved by this PR.

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

[CATEGORY] [TYPE] - Message
[ios] [changed] - HTTP Response headers added to the error object passed to JS code.

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

Test Plan:
Tested:
(All tests done on images in rn-tester app, which is a part of this repo)
1. onError method in case image has an HTTP Error
2. onError method in case of non http error (DNS error)
3. Successful image load

Reviewed By: cortinico

Differential Revision: D37066159

Pulled By: cipolleschi

fbshipit-source-id: 546f7678fa0321fe6c6fbef55288715cb6ddc2fd
2022-06-10 04:17:22 -07:00
Kacie Bawiec 8ced165e53 Make Text use Android's "auto" focus by default instead of setting focus to true
Summary:
[A recent fix](https://github.com/facebook/react-native/pull/33076) to Android to set focusable to true when accessible is true, and this caused several components not to work correctly.

This JS change essentially reverts the default back to Text not being focusable unless it is explicitly set. Android's "auto" behavior is better than setting `accessible=true`, and it's also the behavior React Native has had since accessibility on Android was implemented.

# Wall of Text Explanation

Explanation From Brett's comment [here](https://www.internalfb.com/diff/D35908559?dst_version_fbid=700876567897063&transaction_fbid=477905564133412)

blavalla

Generally speaking, "accessible" in react native maps to "focusable" in Android views, and the default value for "focusabe" for a TextView (and actually all views) is "auto" not "false".  The difference here is that "false" is telling the system to explicitly disallow focus on this element, where as "auto" is telling the system that it's up to whatever service is trying to focus to determine if it should or not.

In the case of text, Talkback generally does default to focusing on Text when it's set to "auto", though it also does try to combine this text together with other not-explicitly focusable siblings and roll the focus up to some common ancestor element.

In the case of TetraButton here, I would expect the default behavior would be that the text is "auto" focusable, so Talkback would combine the text here with the parent <TetraPressable> (which is explicitly focusable via accessible="true").

...

[This diff](https://github.com/facebook/react-native/pull/33076) was to fix the issue with "disabled" not properly announcing on text views, which was commonly occuring due to the description-combining feature described above. Basically, when Talkback decides to combine not-explicitly-focusable elements together, it ignores properties like "disabled", "selected", etc. so when combined only the text is transferred.

The "fix" here was to make sure that if disabled was set, that an element was always explicitly focusable so that it wouldn't be eligible to be combined with others. I think that as a general concept makes sense, but the fix actually surfaced an issue that is likely a much older bug.

This line in <Text>
```
accessible={accessible !== false}
```

Is basically always setting accessible="true" unless it's explicitly set to false, and has been in there for years. It was likely added to force text to be accessible by default for iOS.  But until [this diff](https://github.com/facebook/react-native/pull/33076) this line was basically a no-op for Android, since setting accessible="true" on text would do nothing at all.

[This diff](https://github.com/facebook/react-native/pull/33076)  changed this so that setting accessible="true" worked how you'd expect, by making the view explicitly focusable, which was necessary for the disabled behavior to work properly. But that means that now by default all text views are explicitly focusable on both iOS and Android, and this there is likely many components that were built that don't expect this to be the case.

It doesn't seem like the right fix here is to revert this behavior to its previous state, as it wasn't working how anyone would expect it to if they looked at the code, and it seems like we were relying on some fairly undocumented behavior of Talkback to get it to work how we wanted. If we truly only wanted accessible="true" to be set on all TextViews for iOS, we should be explicit about it and do a platform check before setting that property. If we didn't want this to be iOS-specific, then everything is now actually working as originally intended.

For reference, this is the diff that introduced the default-accessible text - https://www.internalfb.com/diff/D1561326, and the description makes it clear that this was only tested on iOS, and the behavior was explicitly trying to map to iOS norms such as not allowing nested accessible elements.

Changelog:
[Android][Fixed] Make Text not focusable by default

Reviewed By: ryancat

Differential Revision: D36991394

fbshipit-source-id: c45d2ada72bb2d6ffeee6947d676a07fb8899449
2022-06-09 13:27:09 -07:00
luoxuhai 47bd78f64f Added userInterfaceStyle to Alert to override user interface style for iOS 13+ (#33553)
Summary:
Support to override Alert interface style to match your app. For example, You want to change the style on the alert.

## 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] - Add userInterfaceStyle to Alert to override user interface style for iOS 13+

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

Test Plan:
**`userInterfaceStyle: 'light'`:**
<img width="320" src="https://user-images.githubusercontent.com/37284154/161358408-50dbf0a5-ae46-458e-a075-8595cce1b046.png"  />

**`userInterfaceStyle: 'dark'`:**
<img width="320" src="https://user-images.githubusercontent.com/37284154/161358326-bc54effb-1635-43df-97e0-522328713259.PNG"  />

Reviewed By: philIip

Differential Revision: D35371697

Pulled By: ryancat

fbshipit-source-id: 597c1a97ca94571abada2b5fb97cb2adcb5337f5
2022-06-08 18:28:16 -07:00
Genki Kondo d8c25ca1b6 Use initial value of natively driven nodes on renders
Summary:
D36902220 (a04195167b) changed Animated to only use value of natively driven nodes on initial render.

However, there remained a case where we could end up with a race condition between Fabric prop update (via SurfaceMountingManager.updateProps) and Animated (via NativeAnimatedNodesManager.runUpdates), when an animation on a node that was created natively is triggered close to render (such as in componentDidUpdate). This happens as Animated and Fabric aren't synchronized, and at the platform level, they do not know each other's state.

Say we have two items, where opacity is used to indicate whether the item is selected. On initial render, A's opacity is set to 1, and animated sets opacity to 1; B's opacity is set to 0, and animated sets opacity to 0. When B is selected (and causes A and B to rerender), A's opacity is now set to null, and animated sets opacity to 0; B's opacity is also now set to null, and animated sets opacity to 1. A's props have changed, and thus the default opacity value of 1 is applied via Fabric, but Animated also sets the opacity to 0 - either may end up being the value visible to the user due to the nondeterministic order of Fabric update props and Animated. This is what is causing T122469354.

This diff addresses this edge case by using the initial prop values for native animated nodes, for subsequent renders, to ensure that values of native animated nodes do not impact rerenders.

This diff also fixes a bug in OCAnimation where translateX/Y values of 0 in transition will result in render props containing translateX/Y instead of transform, resulting in potentially incorrect pressability bounds.

Changelog:
[Internal][Fixed] - Only use initial value of natively driven nodes on render

Reviewed By: JoshuaGross, javache

Differential Revision: D36958882

fbshipit-source-id: 10be2ad91b645fa4b8a4a12808e9299da33aaf7d
2022-06-07 20:02:57 -07:00
Christian Ruink b869680c11 Fixing onEndReachedThreshold === 0 not firing onEndReached function on Android.
Summary:
Changelog:
[Android][Fix] - When `onEndReachedThreshold` is set to 0 `onEndReached` function on `VirtualizedList` properly fires once the user scrolls to the bottom of the list.

Reviewed By: genkikondo

Differential Revision: D36488189

fbshipit-source-id: b95f3291f2957273280696d8840c1e000d669380
2022-06-07 16:22:12 -07:00
Vincent Riemer 21a4c1f6d6 Add dispatch of pointerover/pointerout events
Summary: Changelog: [iOS][Internal] - Add dispatching of pointerover/pointerout events

Reviewed By: lunaleaps

Differential Revision: D36718156

fbshipit-source-id: c2fee2332ac52e617db938e321e3b38fd5c35ad3
2022-06-07 16:08:50 -07:00
Zolboobayar Gantumur 8a2be3e143 Add `READ_VOICEMAIL` and `WRITE_VOICEMAIL` permissions (#33965)
Summary:
This PR adds `READ_VOICEMAIL` and `WRITE_VOICEMAIL` permissions to the PermissionsAndroid library. Resolves https://github.com/facebook/react-native/issues/33922.

https://developer.android.com/reference/android/Manifest.permission#READ_VOICEMAIL
https://developer.android.com/reference/android/Manifest.permission#WRITE_VOICEMAIL

## 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] [Added] - Add READ_VOICEMAIL and WRITE_VOICEMAIL permissions to PermisionsAndroid library.

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

Test Plan:
```
PermissionsAndroid.READ_VOICEMAIL === 'com.android.voicemail.permission.READ_VOICEMAIL'
PermissionsAndroid.WRITE_VOICEMAIL === 'com.android.voicemail.permission.WRITE_VOICEMAIL'
```

Reviewed By: kacieb

Differential Revision: D36933524

Pulled By: cortinico

fbshipit-source-id: f5283d526aeb68c2724654e22ae16c8c3f69f740
2022-06-06 11:37:34 -07:00
Rick Hanlon 118cf68914 React Native sync for revisions bd4784c...d300ceb
Summary:
This sync includes the following changes:
- **[dd4950c90](https://github.com/facebook/react/commit/dd4950c90 )**: [Flight] Implement useId hook ([#24172](https://github.com/facebook/react/pull/24172)) //<Josh Story>//
- **[26a5b3c7f](https://github.com/facebook/react/commit/26a5b3c7f )**: Explicitly set `highWaterMark` to 0 for `ReadableStream` ([#24641](https://github.com/facebook/react/pull/24641)) //<Josh Larson>//
- **[aec575914](https://github.com/facebook/react/commit/aec575914 )**: [Fizz] Send errors down to client ([#24551](https://github.com/facebook/react/pull/24551)) //<Josh Story>//
- **[a2766387e](https://github.com/facebook/react/commit/a2766387e )**: [Fizz] Improve text separator byte efficiency ([#24630](https://github.com/facebook/react/pull/24630)) //<Josh Story>//
- **[f7860538a](https://github.com/facebook/react/commit/f7860538a )**: Fix typo in useSyncExternalStore main entry point error ([#24631](https://github.com/facebook/react/pull/24631)) //<François Chalifour>//
- **[1bed20731](https://github.com/facebook/react/commit/1bed20731 )**: Add a module map option to the Webpack Flight Client ([#24629](https://github.com/facebook/react/pull/24629)) //<Sebastian Markbåge>//
- **[b2763d3ea](https://github.com/facebook/react/commit/b2763d3ea )**: Move hydration code out of normal Suspense path ([#24532](https://github.com/facebook/react/pull/24532)) //<Andrew Clark>//
- **[357a61324](https://github.com/facebook/react/commit/357a61324 )**: [DevTools][Transition Tracing] Added support for Suspense Boundaries ([#23365](https://github.com/facebook/react/pull/23365)) //<Luna Ruan>//
- **[2c8a1452b](https://github.com/facebook/react/commit/2c8a1452b )**: Fix ignored setState in Safari when iframe is touched ([#24459](https://github.com/facebook/react/pull/24459)) //<dan>//
- **[62662633d](https://github.com/facebook/react/commit/62662633d )**: Remove enableFlipOffscreenUnhideOrder ([#24545](https://github.com/facebook/react/pull/24545)) //<Ricky>//
- **[34da5aa69](https://github.com/facebook/react/commit/34da5aa69 )**: Only treat updates to lazy as a new mount in legacy mode ([#24530](https://github.com/facebook/react/pull/24530)) //<Ricky>//
- **[46a6d77e3](https://github.com/facebook/react/commit/46a6d77e3 )**: Unify JSResourceReference Interfaces ([#24507](https://github.com/facebook/react/pull/24507)) //<Timothy Yung>//
- **[6cbf0f7fa](https://github.com/facebook/react/commit/6cbf0f7fa )**: Fork ReactSymbols ([#24484](https://github.com/facebook/react/pull/24484)) //<Ricky>//
- **[a10a9a6b5](https://github.com/facebook/react/commit/a10a9a6b5 )**: Add test for hiding children after layout destroy ([#24483](https://github.com/facebook/react/pull/24483)) //<Ricky>//
- **[b4eb0ad71](https://github.com/facebook/react/commit/b4eb0ad71 )**: Do not replay erroring beginWork with invokeGuardedCallback when suspended or previously errored ([#24480](https://github.com/facebook/react/pull/24480)) //<Josh Story>//
- **[99eef9e2d](https://github.com/facebook/react/commit/99eef9e2d )**: Hide children of Offscreen after destroy effects ([#24446](https://github.com/facebook/react/pull/24446)) //<Ricky>//
- **[ce1386028](https://github.com/facebook/react/commit/ce1386028 )**: Remove enablePersistentOffscreenHostContainer flag ([#24460](https://github.com/facebook/react/pull/24460)) //<Andrew Clark>//
- **[72b7462fe](https://github.com/facebook/react/commit/72b7462fe )**: Bump local package.json versions for 18.1 release ([#24447](https://github.com/facebook/react/pull/24447)) //<Andrew Clark>//
- **[22edb9f77](https://github.com/facebook/react/commit/22edb9f77 )**: React `version` field should match package.json ([#24445](https://github.com/facebook/react/pull/24445)) //<Andrew Clark>//
- **[6bf3deef5](https://github.com/facebook/react/commit/6bf3deef5 )**: Upgrade react-shallow-renderer to support react 18 ([#24442](https://github.com/facebook/react/pull/24442)) //<Michael サイトー 中村 Bashurov>//

Changelog:
[General][Changed] - React Native sync for revisions bd4784c...d300ceb

jest_e2e[run_all_tests]

Reviewed By: cortinico, kacieb

Differential Revision: D36874368

fbshipit-source-id: c0ee015f4ef2fa56e57f7a1f6bc37dd05c949877
2022-06-06 10:58:29 -07:00
Paige Sun 5ed6ac1f25 Protect _handlers in RCTNetworking with mutex even if RCTNetworking has been deallocated
Summary:
Changelog:
[iOS][Fixed][Internal] - Protect handlers in RCTNetworking with mutex even if RCTNetworking has been deallocated

# The Logview
We get this error in LogView: `Unhandled JS Exception: Error: Exception in HostFunction: mutex lock failed: Invalid argument`, which is an C++ std::error. "This typically happens when .lock() is called on a mutex that is not yet constructed, or has already been destructed."

# Hypothesis of issue
The LogView says the line that throws this softerror is [RCTNetworking.ios.js](8bd3edec88/Libraries/Network/RCTNetworking.ios.js (L87)).

Inside RCTNetworking, there's only [one mutex and only one line where is is being used](8bd3edec88/Libraries/Network/RCTNetworking.mm (L207-L215)
), to protect the _handlers array.

My guess is that RCTNetworking was deallocated, which made `_handlersLock` nil, so it resulted in this error when we tried to lock it.

# This diff

* Add `std::lock_guard<std::mutex> lock(_handlersLock);` to `invalidate()`
* Move `_handlersLock` logic to its own method instead of using a lambda. If `self` is being deallocated, I would guess that this method (`[self prioritizedHandlers]`) would return nil.

Referencing this for correct ways to use lock_guard with mutex: https://devblogs.microsoft.com/oldnewthing/20210709-00/?p=105425

Reviewed By: fkgozali

Differential Revision: D36886233

fbshipit-source-id: 60246f4d9bbc1d834497e4fb8a61d9c0e9623510
2022-06-05 11:02:11 -07:00
Genki Kondo a04195167b Only use value of natively driven nodes on initial render
Summary:
D36612758 (40f4c662bc) attempted to remove the check that the animated node was native when fetching animated prop values for render, in order to fix an issue that arises when a node is converted to native before the initial call to render to mount the component, where the initial value is not applied.

However, this causes issues for cases where we call setValue on an animated node soon after render, such as on componentDidUpdate. setValue first updates the animated node value on JS side, then calls the native API setAnimatedNodeValue. The problem is that the next render will then use these updated values in the style props (because we removed the check for native in D36612758 (40f4c662bc)), resulting in a diff in props. Since Animated and Fabric aren't synchronized, there's a race condition between SurfaceMountingManager.updateProps and NativeAnimatedNodesManager.runUpdates

To allow proper rendering of initial values of native animated nodes, and mitigate the issue when calling setValue on an animated node soon after render, during initial render we use the initial values of both native and non-native driven nodes, and on subsequent renders we only use the initial values of non-native driven nodes.

An alternative considered was to add internal state to the nodes themselves (AnimatedProps, AnimatedStyle), but keeping it in sync with the component state is not easy/clean as AnimatedProps can be recreated and reattached at any time for a mounted component.

Changelog:
[Internal][Fixed] - Only use value of natively driven nodes on initial render

Reviewed By: JoshuaGross

Differential Revision: D36902220

fbshipit-source-id: c20f711aa97d18a2ed549b5f90c6296bf19bb327
2022-06-03 13:33:50 -07:00
Antoine Doubovetzky dbcada0391 fire: (FileReader) remove unused _subscriptions attribute (#33946)
Summary:
I was reading source code, and I noticed the _subscriptions attribute (and the _clearSubscriptions method) of the FileReader is not used.

## 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] [Changed] - Remove unused _subscriptions attribute in FileReader

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

Test Plan: I checked that flow and jest are still green as I can't think about another way.

Reviewed By: lunaleaps

Differential Revision: D36807828

Pulled By: cortinico

fbshipit-source-id: 9bb599bbc7b79d2b4c010ba84cc8777e29b974ca
2022-06-01 17:13:11 -07:00
Jérémy Barbet 927b43d47c typo for the automaticallyAdjustKeyboardInsets description (#33948)
Summary:
Minor typo change

## Changelog

[iOS] [Fixed] - Typo in the documation for the `automaticallyAdjustKeyboardInsets` prop

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

Test Plan: Read the paragraph, solid.

Reviewed By: kacieb

Differential Revision: D36810184

Pulled By: cortinico

fbshipit-source-id: af586beb4eb3fd4337d2df8612d39c6abb0a37bf
2022-06-01 13:25:20 -07:00
vincent-paing 0a854c7c8b feat: Add permission introduced in Android 13 (#33471)
Summary:
Android 13 introduces two new permission,
- [NEARBY_WIFI_DEVICES](https://developer.android.com/about/versions/13/features/nearby-wifi-devices-permission) for scanning nearby wifi devices.
- [POST_NOTIFICATIONS](https://developer.android.com/about/versions/13/changes/notification-permission) for posting notifications.

This PR adds all the new permission (as of this PR creation) in Android 13.

## Changelog

[Android] [Added] - Add POST_NOTIFICATIONS, NEARBY_WIFI_DEVICES permission

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

Test Plan:
```
PermissionsAndroid.POST_NOTIFICATIONS === 'android.permission.POST_NOTIFICATIONS'
PermissionsAndroid.NEARBY_WIFI_DEVICES === 'android.permission.NEARBY_WIFI_DEVICES'
```

Reviewed By: cortinico

Differential Revision: D35080683

Pulled By: GijsWeterings

fbshipit-source-id: cd5ba7f519feb77f939d5076ef414a01357329ab
2022-06-01 09:11:39 -07:00
Jordan Brown 6064fd0600 Presuppress xplat and upgrade to 0.178.1
Summary:
This diff upgrades xplat to 0.178.1 and pre-suppresses errors from turning on constrained writes.

To generate this diff I:
* Modified every `env_mode=constrain_writes` to `env_mode=ssa` and made a commit (this is so our upgrade script will work)
* Ran   scripts/flow/upgrade.sh 0.178.1 to upgrade all the flowconfigs to 178.1 and suppress new-env errors
* Modified arvr/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project arvr`
* Modified xplat/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project xplat`
* Unstacked from the commit in point 1

Reviewed By: SamChou19815

Differential Revision: D36676019

fbshipit-source-id: c3032f18ed838afc327f00de563e7f20713bdc26
2022-05-26 12:59:52 -07:00
Eric Hartzog 0ef73f2a82 Restore early return to NativeAnimatedHelper.flushQueue
Summary:
Brings back a small performance win of avoiding starting/stopping a batch if the queue is empty.

## Background

This was attempted previously but it happened to expose a single frame animation visual regression in VR.

1. First added in D36298399 (55ee8ce0c4), reverted in D36378363
2. Added in a different form in D36338606 (35e2a63b8d), reverted in D36479089 (a4690d054f)
3. Root cause of the visual regressions introduced was fixed in D36612758 (40f4c662bc)

Now that we've fixed the root cause of the visual regression, this is safe to restore.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D36670591

fbshipit-source-id: 42b6bc9c7764484f2dbb9edb122780a91b7393b4
2022-05-25 16:35:11 -07:00
Ramanpreet Nara 40a86b0650 Add more information to JavaScript module not registered as callable error message
Summary:
When a JavaScript module is not registered as callable, the bridge will throw an error. Let's clean up the error message so that it's more helpful.

Now, it logs the number of registered callable JavaScript modules, as well as the list of callable JavaScript modules.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D36646936

fbshipit-source-id: 62d091cda35e296ef9e569b444cd5b6f09b8bc54
2022-05-25 13:21:08 -07:00
Genki Kondo 40f4c662bc Set correct initial value for AnimatedComponent for styles backed by native animated nodes
Summary:
In AnimatedComponent.render, we get the initial values of any styles backed by AnimatedNode, but ONLY for non-native animations. Thus, if convert an animated node to native before the call to render to mount the component, we will end up not applying the initial value until after the component is mounted. This may result in a visible flicker as the expected value is applied some time after the component is mounted and visible.
- Without native driver: BaseViewManager.setTransform called during view preallocation (ViewManager.createViewInstance)
- With native driver: BaseViewManager.setTransform called during MountingManager.updateProps (called from PropsAnimatedNode.updateView)

This diff removes the isNative check in AnimatedStyle and AnimatedProps when traversing style props. This shouldn't be a problem:
- Created as non-native, animated with JS driver
  - This diff does not affect this scenario
- Created as non-native, animated with native driver
  - Initial value is applied correctly on render/mount. On subsequent renders, the outdated value from JS side will not apply on the platform view as it has not changed.
- Created as native, animated with native driver
  - Initial value is applied correctly on render/mount. On subsequent renders, the outdated value from JS side will not apply on the platform view as it has not changed.

Changelog:
[Internal][Fixed] - Set correct initial value for AnimatedComponent for styles backed by native animated nodes

Reviewed By: JoshuaGross, javache

Differential Revision: D36612758

fbshipit-source-id: 922d6534c605b3eb0a1d9476753111b726f138f2
2022-05-25 10:33:17 -07:00
Joshua Gross 87d3ac3762 Use setImmediate instead of setTimeout in Animated queue debounce
Summary:
setImmediate will result in these debounced/queued operations being sent to native immediately at the end of a ReactJS render loop instead of in the next tick, which could result in more fluid animations.

I verified with logs that batching still occurs.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D36521717

fbshipit-source-id: 4f94e26503d4e6e40f52a4120ae407044af0c451
2022-05-23 16:54:58 -07:00
Pieter De Baets 406a474e52 Correctly batch AnimatedColor updates
Summary:
Call `setWaitingForIdentifier` before we do any `setValue` calls to make sure we execute them together (and only call start/finish batch once). Only calll `updateAnimatedNodeConfig` conditionally when we changed nativeColor.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D36517302

fbshipit-source-id: ecbae2d1df69e4456620c58a922275406e22a2f8
2022-05-23 07:57:42 -07:00
Pieter De Baets 7e646361ee Avoid start/finishOperationBatch when using singleOp Animated experiment
Summary:
Splitting these changes of from D36482630, which is a minor improvement to the singleOp experiment. Since we call start/finish already on the native side, we don't need to repeat it from JS.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D36541700

fbshipit-source-id: 7d61669710faca3153be557fb2d214011eda87c5
2022-05-23 07:57:42 -07:00
Pieter De Baets 168ec03b0f Move ReactNativeTestTools-test to github
Summary: Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D36546209

fbshipit-source-id: 33f7e896e2a3b77dfa1384d0a70ef684dd57a445
2022-05-23 06:15:08 -07:00
Blair Vanderhoof bc7b5c3011 Fix issue with RTL locales and zoomScale
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. Set the value to 1 instead when negative.

Differential Revision: D36499121

fbshipit-source-id: f82812ca00ae4162fbff617df8c716a4964b3a8f
2022-05-20 21:49:34 -07:00
Genki Kondo 73191edb72 Add optional configs to constructors for AnimatedValue/ValueXY/Color
Summary:
There are use cases of needing to setValue multiple times per second (for example, using PanResponder to update a slider component).

This requires the use of the native driver for perf reasons as using the JS driver will cause a rerender. Currently, the only way to make an animated node native is via setting useNativeDriver: true on an animation config. For example:
```
Animated.timing(animatedValue,
{
  toValue: newValue,
  duration: 0,
  useNativeDriver: true
}).start();
```

To avoid needing to call the above, add a useNativeDriver param to the constructor. When set to true, the node will be made native immediately.

```
const animatedValue = new Animated.Value(0, useNativeDriver);
...
animatedValue.setValue(newValue);
```

Note that, like with useNativeDriver in the animation config, once a node is made native, it cannot be reverted to JS-only.

 ---

As an aside, PanResponder uses JS-side events, and thus we cannot use Animated.event with native driver; we instead need to setValue on a native AnimatedValue. A much more thorough explanation is in D34564598.

 ---

Changelog:
[General][Added] - [Animated] Add useNativeDriver as a param for setValue

Reviewed By: JoshuaGross

Differential Revision: D36459457

fbshipit-source-id: 284148a6d16537429efeab8b07184019990909cd
2022-05-20 10:42:40 -07:00
Pieter De Baets d7dd1789ff Improve type-safety of NativeAnimated with singleOpBatching
Summary:
Improve the types of `queueOperation` so flow can assert that the parameters match.

Also in the case of `singleOpBatching == false`, nativeOps is just an alias of NativeModule so there's no overhead.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D36482617

fbshipit-source-id: e000d11b04166cd7a069af024b9c2cc226efa701
2022-05-20 07:26:15 -07:00
Kevin Gozali 4ec75b1797 Import dispatchCommand utility from the right Renderer module
Summary:
With the new architecture, this module should be using the implementation from ReactFabric instead. However, given the ReactNative module had side effects (like registering `RCTEventEmitter`), let's import from ReactFabric only in the latest "new architecture" mode.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D36535626

fbshipit-source-id: 6758b671df9a47607d8caf4a021ac73410f4c6e9
2022-05-19 20:54:48 -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
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
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
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 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
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
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
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