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

730 Коммитов

Автор SHA1 Сообщение Дата
Ken Tominaga 398595e074 Remove iOS 11 version check (#32151)
Summary:
This pull request aims to remove iOS 11 version check which is no longer needed.

The minimum iOS deployment target for React Native is `iOS 11` but we still have iOS 11 version check like below.

```
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
        if (available(iOS 11.0, *)) {
```

> React Native apps may target iOS 11.0 and Android 5.0 (API 21) or newer.

ref: https://github.com/facebook/react-native#-requirements

------

If there is a team motivation to remove the deprecated methods and classes before iOS 10, I can continue the work in this pull request or in the continuing pull requests.

We have deprecated warnings for these in the project.

- `UIUserNotificationSettings`
- `UILocalNotification`
- `topLayoutGuide` and `bottomLayoutGuide`
- `automaticallyAdjustsScrollViewInsets`

## Changelog

[iOS] [Changed] - Remove iOS 11 version check

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

Reviewed By: sammy-SC

Differential Revision: D30877917

Pulled By: yungsters

fbshipit-source-id: d903ea5d557beeb65ef87bfce572e4db3532b3c5
2021-09-22 10:37:09 -07:00
Samuel Susla 3d83ca0331 Ship initial max size on iOS
Summary:
changelog: [internal]

Ship initial max size on iOS

Reviewed By: fkgozali

Differential Revision: D30990650

fbshipit-source-id: cf8f202ee862145a6fa9f173c2073096f86015e3
2021-09-21 08:23:08 -07:00
Pieter De Baets 6025611bd0 Use real propsParserContext in LayoutAnimation
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D31053819

fbshipit-source-id: 8ec21012500f3bfc7e8aea018b5ca72323da2d9e
2021-09-21 04:24:28 -07:00
Samuel Susla 6c66cef8ec Show warning if TTRC flag may clipped
Summary: changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D31016886

fbshipit-source-id: 26b5b97382936141ae7ef69fb1701d9822df5e8c
2021-09-17 14:23:54 -07:00
Samuel Susla d2cc91bcc3 Add a way to simulate memory access to ImageProps in LayoutAnimations
Summary:
changelog: [internal]

I'm chasing down a crash in LayoutAnimations, it would help me to simulate the memory access which causes the crash to learn where the bad memory is coming from.

Reviewed By: RSNara

Differential Revision: D30776840

fbshipit-source-id: 1e97fac28ba2df37ba3e47ec2c110043c3823e70
2021-09-12 08:56:32 -07:00
Samuel Susla 24b961b6f7 Add option to crash the app if component descriptor is missing in LayoutAnimations
Summary:
changelog: [internal]

Add a log behind feature flag to learn more about missing component descriptor.

Component descriptor should never be missing, that's a state of program that is impossible as far as I can tell. This logic was introduced in D22216030 (6342e6e3f1) and I think it is just cover the real cause of crashes in LA on iOS.

Reviewed By: RSNara

Differential Revision: D30765947

fbshipit-source-id: 6843384e02529de2f024c59c61ae21b8682ac371
2021-09-11 00:26:27 -07:00
Samuel Susla ae4068d63c Add option to skip invalidated key frames
Summary:
changelog: [internal]

Maybe invalid keyframe animation shouldn't be queued. This adds a fix behind feature flag to verify if it fixes iOS crashes.

Reviewed By: RSNara

Differential Revision: D30730005

fbshipit-source-id: 8a2bb54c449449a95d14d51a1a78bfaccad61877
2021-09-09 11:57:24 -07:00
Samuel Susla 4f0671b409 Clean up Layout Animation initialisation
Summary:
changelog: [internal]

No need for ivar here.

Reviewed By: sshic

Differential Revision: D30726786

fbshipit-source-id: ba8f71c9f182c1afbfd5118adc15a098d9f56027
2021-09-07 02:49:22 -07:00
Samuel Susla 66deb8a9c0 Pass surfaceId to PropsParserContext when created though native animated
Summary:
changelog: [internal]

Pass surfaceId to PropsParserContext instead of placeholder -1.

Reviewed By: RSNara

Differential Revision: D30667846

fbshipit-source-id: bed98ad6c829c1346d8eb9e68d7beeb6696d6c4a
2021-09-01 10:27:31 -07:00
Samuel Susla 53c6494615 Remount children in scrollView if layout changes
Summary: changelog: [internal]

Reviewed By: hramos

Differential Revision: D30603617

fbshipit-source-id: bc189d4a0a997202e6b2cd5314b997395bcdf7b2
2021-08-29 09:32:21 -07:00
Steven Bell ddf9a63acb fix typos in comments (#32061)
Summary:
Fixed some typos in the code comments.

## Changelog

[Internal] [Fixed] - Fixed typo in the comments

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

Test Plan: N/A

Reviewed By: javache

Differential Revision: D30482511

Pulled By: cortinico

fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2
2021-08-24 07:21:56 -07:00
Jimmy Zhang d756d4394d Add support for AccessibilityValue
Summary:
Changelog:
[Fabric][iOS] Add support for AccessibilityState

Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue

Reviewed By: sammy-SC

Differential Revision: D30452786

fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3
2021-08-24 05:18:46 -07:00
Jimmy Zhang 11f8d9c7cd Add support for the UIAccessibilityTraitsTabBar
Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar

Reviewed By: yungsters

Differential Revision: D30490752

fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3
2021-08-24 02:31:17 -07:00
Dmitry Rykun 9187e20752 Selection prop is applied for TextInput when component is mounting
Summary:
Changelog: [Internal]
TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set.

Reviewed By: sammy-SC

Differential Revision: D30045271

fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904
2021-08-23 10:07:57 -07:00
Dmitry Rykun 8434177722 Added Selection prop to TextInputProps
Summary:
Changelog: [iOS][Added]
1. Added new primitive type "Selection" to C++
2. Added property "selection" to TextInputProps
3. Added parser for that

Reviewed By: sammy-SC

Differential Revision: D30043256

fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7
2021-08-23 06:04:01 -07:00
Samuel Susla c2b971d6d4 Set initial maximum surface size to viewport size
Summary:
Changelog: [internal]

There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size.

Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly.

Reviewed By: fkgozali

Differential Revision: D30402207

fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb
2021-08-20 05:42:21 -07:00
Samuel Susla b7616242aa Remove redundant includes
Summary:
changelog: internal

Removing unused headers. Fewer headers = faster compilation

Reviewed By: p-sun

Differential Revision: D30398600

fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed
2021-08-20 03:02:02 -07:00
Joshua Gross 175b1ea636 Pass PropsParserContext to prop parsing layer
Summary: Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D29921232

fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f
2021-07-28 20:18:20 -07:00
Samuel Susla f592ad0509 Attempt to fix undefined instance handle in EventTarget
Summary:
changelog: [internal]

Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it.

Reviewed By: JoshuaGross

Differential Revision: D29969189

fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2
2021-07-28 14:45:12 -07:00
Samuel Susla c2ba8864f9 Remove redundant warnings for RCTMountingManager
Summary:
Changelog: [internal]

The warnings are in-actionable for product engineers.

Reviewed By: JoshuaGross

Differential Revision: D29911438

fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f
2021-07-27 12:25:31 -07:00
Samuel Susla c5f8c31435 Implement View.removeClippedSubviews prop
Summary:
Changelog: [internal]

Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is

Reviewed By: JoshuaGross

Differential Revision: D29906458

fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea
2021-07-27 03:04:15 -07:00
Samuel Susla 7b1e6f5077 Remove gating for on demand view mounting
Summary:
Changelog: [internal]

This feature has shipped. I remove gating here.

Reviewed By: mdvacca

Differential Revision: D29906460

fbshipit-source-id: 23433cfd4d618633b135d8c858ce6cf90cfe9fa1
2021-07-26 14:23:05 -07:00
Samuel Susla b0e39b2ed9 Maintain cursor position when text changes in text input
Summary:
Changelog: [internal]

Cursor position needs to be calculated when attributed string changes.

Reviewed By: JoshuaGross

Differential Revision: D29786190

fbshipit-source-id: 99a42dc4d7c84e77c40f75bf4a9108d010bb1792
2021-07-20 15:14:48 -07:00
Luna Wei cddb97ad18 Remove Picker from OSS (#31772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31772

Changelog:[General][Removed] - Remove Picker iOS code

Reviewed By: p-sun

Differential Revision: D29124724

fbshipit-source-id: d3b3a409961cf04e2cd079a91986d30e3166dcda
2021-07-08 13:23:49 -07:00
Justin Huntington bc1e602e0c Add ScrollView.automaticallyAdjustsScrollIndicatorInsets prop (on iOS) (#29809)
Summary:
iOS 13 added a new property to `UIScrollView`: `automaticallyAdjustsScrollIndicatorInsets`, which is `YES` by default.  The property changes the meaning of the `scrollIndicatorInsets` property.  When `YES`, any such insets are **in addition to** whatever insets would be applied by the device's safe area.  When `NO`, the iOS <13 behavior is restored, which is for such insets to not account for safe area.

In other words, this effects ScrollViews that underlay the device's safe area (i.e. under the notch).  When `YES`, the OS "automatically" insets the scroll indicators, when `NO` it does not.

There are two problems with the default `YES` setting:

1. It means applying `scrollIndicatorInsets` to a `ScrollView` has a different effect on iOS 13 versus iOS 12.
2. It limits developers' control over `scrollIndicatorInsets`.  Since negative insets are not supported, if the insets the OS chooses are too large for your app, you cannot fix it.

Further explanation & sample code is available in issue https://github.com/facebook/react-native/issues/28140 .

This change sets the default for this property to `NO`, making the behavior consistent across iOS versions, and allowing developers full control.

## 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] - ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+

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

Test Plan:
Updated the RNTester example to explain what to expect. Also removed the `pageScreen` modal example for now as mentioned in my Github comment.

{F628636466}

Here are screenshots of the demo app (from the original bug) before (with safe area applied to insets) & after (without safe area applied to insets):

![before](https://user-images.githubusercontent.com/428831/91644197-ea03a700-ea07-11ea-9489-be27820930eb.png)

![after](https://user-images.githubusercontent.com/428831/91644200-eff98800-ea07-11ea-8788-daf1e783639d.png)

Reviewed By: p-sun

Differential Revision: D28229603

Pulled By: lunaleaps

fbshipit-source-id: 2e774ae150b1dc41680b8b7886c7ceac8808136a
2021-07-07 20:23:36 -07:00
Samuel Susla b52950bda2 Apply correct text attributes in TextInput.setTextAndSelection
Summary:
Changelog: [internal]

Make sure correct text attributes are used inside of view command.

Reviewed By: sshic

Differential Revision: D29585943

fbshipit-source-id: 4748c843ff586f1dd42f3a89460afb624f9b371a
2021-07-07 07:11:03 -07:00
Samuel Susla 3bce393766 Clean up enable_state_scroll_data_race_ios experiment
Summary:
Changelog: [internal]

Clean up the experiment.

Reviewed By: JoshuaGross

Differential Revision: D29547129

fbshipit-source-id: 08ecbf5d362385b9d287348c7a4a508ca24a42bf
2021-07-05 14:14:47 -07:00
Samuel Susla fa3697bd9e Back out "Add option to disable sending scroll events to Paper"
Summary:
Changelog: [internal]

Original commit changeset: fa4d8944ad6b

Not sending onScroll events events to Paper has no effect.

Reviewed By: mdvacca

Differential Revision: D29229662

fbshipit-source-id: b84a2614bfd42c64ca67ca6a1cd9d0a815c11ad0
2021-06-23 02:02:03 -07:00
Samuel Susla f175ff5c04 Remove feature flag for async event beat v2
Summary:
Changelog: [internal]

AsynchronousEventBeatV2 is shipped. Let's remove gating.

Reviewed By: fkgozali

Differential Revision: D29261752

fbshipit-source-id: 844cfc494c077e36945a7fa65f9368c2165d5c8c
2021-06-22 06:21:09 -07:00
Samuel Susla 9ca460f064 Take RTL into account in scrollTo view command
Summary:
Changelog: [internal]

ScrollView's `scrollTo` command doesn't work in RTL. It sets the offset from left of the screen instead of right. This diff fixes this for Fabric only.

Reviewed By: JoshuaGross

Differential Revision: D29164056

fbshipit-source-id: f685d3e013f474f9b445112333d8f5ad7ed36ea7
2021-06-16 11:04:13 -07:00
Samuel Susla 741b4d4421 Remove RuntimeScheduler from SchedulerToolbox
Summary:
Changelog: [internal]

Remove `RuntimeScheduler` from `SchedulerToolbox` and all of its uses.
`RuntimeScheduler` needs to be allocated before `Scheduler` and therefore its presence in the toolbox is redundant.

Reviewed By: JoshuaGross

Differential Revision: D29134769

fbshipit-source-id: fa00c5dcc4b565d6941e6d742c6aefade37b31c4
2021-06-15 17:35:32 -07:00
Samuel Susla d540f88df8 Initialise RuntimeScheduler before bundle is executed
Summary:
Changelog: [internal]

RuntimeScheduler can be accessed before any Fabric surface is rendered. Therefore, it needs to be created and installed in the runtime at the start up of the runtime.

Reviewed By: JoshuaGross

Differential Revision: D29091848

fbshipit-source-id: ff75ef8c4882550795e5d4a258355b651cb0e637
2021-06-14 10:52:09 -07:00
Samuel Susla 592e92fc90 Fix missing space when using iOS's autocomplete
Summary:
Changelog: [internal]

Using keyboard's autocomplete did not insert space at the end of the word.

Reviewed By: fkgozali

Differential Revision: D29085654

fbshipit-source-id: 35fee726ea7d2030fdfa64300e045a303ea98ce9
2021-06-13 04:36:32 -07:00
Samuel Susla a5b92f34c4 Resign text input as first responder in prepareForRecycle
Summary:
Changelog: [internal]

To prevent wrong TextInput becoming first responder, force a resign when preparing for a reuse.

Reviewed By: JoshuaGross

Differential Revision: D29085923

fbshipit-source-id: 246cdf0628f914c3928cc9c7499d029b77684f2c
2021-06-12 12:26:27 -07:00
Joshua Gross f2e0b2f45f Fix crash in PreAllocation optimization
Summary:
PreAllocation currently always happens at revision 0 (after ShadowNode creation), and all CREATE mutations are triggered for ShadowNodes at revision 1 or higher (since CREATE mutations are generated by the differ, it means that all ShadowNodes have revision 1 or higher when CompleteRoot is called). This means that between PreAllocation and CREATE, we /always/ expect at least one clone.

It is possible for a node to be "non-view-forming" at revision 0, causing view preallocation to be skipped, and "view-forming" at revision 1 (causing the CREATE mutation to be thrown away, since all CREATE mutations of revision 0 or 1 are thrown away). This causes a crash. It is extremely marginal, but there are repros in the wild.

Thus, I'm introducing one new UIManager and Scheduler delegate method that allows the mounting layer to be notified of clones. If a clone from rev 0->1 results in a node going from non-view-forming to view-forming, we can preallocate then, as well.

This resolves this crash, and allows us to keep experimenting safely with this View PreAllocation optimization. I believe all edge-cases are accounted for.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D29043426

fbshipit-source-id: dff11d3140ded1cbb02a5518a3aeb52dc812cc50
2021-06-10 15:50:14 -07:00
Shuhao Zhang f3b8d4976f Bug fix: <TextInput> content is reset when emoji is entered at the max length
Summary:
When maxLength is defined in <TextInput>, if the last character at max length is an emoji, the content of the input is cleared:

{F620865178} {F620865237}

Related Github issues:

https://github.com/facebook/react-native/issues/10929
https://github.com/facebook/react-native/issues/10964

## Root cause:

When NSString was created, unicode characters were 16-bit long, so Objective-C considers every unicode character as 16-bit. However, unicode was later extended to more than 16bit, for example, emojis, which causes NSString substring method cuts off at the wrong position.

Example:

```
NSString *s = @"abc{emoji:1f601}";
NSInteger len = s.length; //length is 5 (as {emoji:1f601} occupies two 16-bit characters)
NSString *s3 = [s substringToIndex: 3]; //s3 is "abc"
NSString *s4 = [s substringToIndex: 4]; //s4 is null!
```

If string s, "abc{emoji:1f601}", is entered in <TextInput>, which has max length 4, it will truncate the string to the first 4 characters, "cutting" the emoji in half which causes encoding error and returns null. The text input is cleared.

## Solution:

If the character at max length is longer than 16-bit, truncate the character BEFORE it instead. In the previous example, truncate till index 3 instead of 4. The end result will be "abc" and the emoji is dropped.

## Changelog:

[iOS] [Fixed] - <TextInput> content is reset when emoji is entered at the max length

Reviewed By: p-sun

Differential Revision: D28821909

fbshipit-source-id: 4720d864970b554160ed5388f65b352ce95a6199
2021-06-04 13:40:42 -07:00
Samuel Susla 80ceedc0d8 Wire shouldYield flag to a feature flag
Summary:
Changelog: [internal]

Add a feature flag to enable yielding in RuntimeScheduler

Reviewed By: JoshuaGross

Differential Revision: D28903226

fbshipit-source-id: c361ca144a2d531e8aa671bc8875bce075e13a2c
2021-06-04 12:08:52 -07:00
Samuel Susla a18a2de4b4 Fix crash in ~Pointer by not retaining LayoutManager beyond the runtime
Summary:
Changelog: [internal]

This is a life cycle issue where LayoutManager outlives the runtime. To fix this, we need to destroy `_accessibilityProvider` before the runtime. The way to do it is to destroy it inside `prepareForReuse` which is guaranteed to be called before runtime is destroyed.

Reviewed By: JoshuaGross

Differential Revision: D28898257

fbshipit-source-id: 9d2c0b9cebd9889caa4328f9ee7f005928bbf55a
2021-06-04 11:53:18 -07:00
Samuel Susla 0ee8e292a4 Fix for ScrollView race condition between C++ state update and onScroll
Summary:
Changelog: [internal]

There is a possibility of race between updating scrollview's state and virtualised list asking for layout of individual cells.
To make sure the race doesn't happen, state must be updated before dispatching onScroll event.

Android has implemented a different mechanism to tackle this issue in D28558380 (b161241db2).

Reviewed By: JoshuaGross

Differential Revision: D28642737

fbshipit-source-id: 33874beac69fc5a66eeb7f459fd89cd0b00dafcf
2021-05-26 03:32:03 -07:00
Samuel Susla 3a9e14e8a9 Add synchronous access to the runtime to RuntimeScheduler
Summary:
Changelog: [internal]

Introduces synchronous access to the runtime from RuntimeScheduler.
At the moment, this is not used anywhere.

In case RuntimeScheduler isn't defined (controlled by MC), falls back to RuntimeExecutor.

Reviewed By: mdvacca

Differential Revision: D28024380

fbshipit-source-id: 90be36dd390202540ed51940a4396040f043cd90
2021-05-25 07:42:06 -07:00
Andrei Shikov faaeb778df Parse accessibilityAction props into object
Summary:
Android was using rawProps received from JS, so no updates needed.
Updated iOS callsite to use the name of the action.

Changelog:
[General][Fixed] - Parse accessibilityAction props into object instead of string

Reviewed By: mdvacca

Differential Revision: D28614407

fbshipit-source-id: 209134f8fac65ca8516039e10ea502e57d52a7a7
2021-05-24 10:27:27 -07:00
Samuel Susla 4bec099f7e Add option to disable sending scroll events to Paper
Summary:
Changelog: [internal]

Originally added in D17814260 (ffc7ec992c) to make parallax effect work in Dating.

This diff hides it behind a flag so we can properly evaluate what's the cost of sending scroll events to Paper.

Reviewed By: JoshuaGross

Differential Revision: D28608283

fbshipit-source-id: fa4d8944ad6b5e767363e231942f13fec9d18cb5
2021-05-22 12:19:05 -07:00
Samuel Susla 118489f6e5 Make LeakChecker available on Android
Summary:
Changelog: [internal]

Extend LeakChecker so it is available on Android (or any other platform as it is completely in C++ now).

Reviewed By: JoshuaGross

Differential Revision: D28600243

fbshipit-source-id: c77a003e3ffc6171e61c998508c9f34f10bb65ca
2021-05-21 10:39:43 -07:00
Samuel Susla e173bbe3bb Fix on demand mounting in RTL
Summary:
Changelog: [internal]

When calculating on demand views, RTL layout needs to be considered.

Reviewed By: JoshuaGross

Differential Revision: D28510293

fbshipit-source-id: 5e7b08fcc5c55fa1a978024a9bfedda705ce1702
2021-05-18 10:02:19 -07:00
Samuel Susla 9b3c12dc87 Funnel All Fabric calls to RuntimeExecutor to RuntimeScheduler
Summary:
Changelog: [internal]

This diff moves all calls to RuntimeExecutor to RuntimeScheduler. The calls are still immediately dispatched. Timing of events will not change.

The goal of this diff is to prepare infrastructure for Concurrent Mode.

Reviewed By: JoshuaGross

Differential Revision: D27937665

fbshipit-source-id: 434d78c95ccf23d8da41186d0dae91bff4eda384
2021-05-13 08:03:29 -07:00
Samuel Susla 83e5cdd369 Fix accessibility when entire text node is a link
Summary:
Changelog: [internal]

Fix accessibility when entire text node is a link

Reviewed By: JoshuaGross

Differential Revision: D28325749

fbshipit-source-id: 9ac68b802f13d028b5cdb6cae7bdae5f4924fc07
2021-05-11 01:23:04 -07:00
Kevin Gozali ab45509d75 iOS: adding a few warning/enforcement for the new architecture
Summary:
In the full bridgeless, the following aren't allowed:
* using legacy view manager interop layer (won't support long term, but still needed today, so just warn)
* initializing any subclass of RCTViewManager (won't support long term, but still used by legacy interop layer)
* initializing RCTUIManager (fabric UIManager should be the only one used)

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D28111530

fbshipit-source-id: 4f5eab600c6c7896d51861545b7f878c25248e44
2021-05-03 21:31:19 -07:00
Paige Sun 0932a0d775 iOS: 2/5 Remove use of bridge from Modal by dismissing with visible prop
Summary: Changelog: [Fabric][iOS][Fix] Remove use of bridge from Modal by dismissing Modal with visible prop

Reviewed By: sammy-SC

Differential Revision: D28074326

fbshipit-source-id: 0278bfb031db802b59429c553ac62d83838f4cc9
2021-05-02 15:42:49 -07:00
Samuel Susla ad2f1caf9a Clean up optimized_hit_testing_ios
Summary:
Changelog: [internal]

Clean up the experiment

Reviewed By: JoshuaGross

Differential Revision: D27996499

fbshipit-source-id: 3c9598846b3800eef86d039580e6a12e7273e798
2021-04-30 06:11:55 -07:00
Joshua Gross a249065503 Pass "blockNativeResponder" param to RCTMountingManager
Summary:
From looking at other implementations of setJSResponder, we need the MountingManager to have access to "blocksNativeResponder" param, but do not need to pass that through to individual views (see also Android implementation).

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D28066257

fbshipit-source-id: e1420431478fd27d2e1463e291a0bbc600d3f0a6
2021-04-29 09:29:45 -07:00
Samuel Susla c3d765883a Fix frames for in text links
Summary:
Changelog: [internal]

`accessibilityFrame` needs to take scrolling position into account. To fix that, we calculate the position dynamically.

Reviewed By: mdvacca

Differential Revision: D28056789

fbshipit-source-id: 3247b3e6fd64934e99563de83d163f657828e933
2021-04-28 14:50:14 -07:00
Samuel Susla 1b592631a7 Prevent redundant dispatches onto RuntimeExecutor queue in AsynchronousEventBeat::induce
Summary:
Changelog: [internal]

Current implementation of `AsynchronousEventBeat` dispatches lambdas through `RuntimeExecutor` regardless if it has done so previously.

So if `AsynchronousEventBeat::induce` is called 30 times, it will dispatch 30 lambdas.

In `AsynchronousEventBeatV2`, we make sure only single lambda is dispatched to `RuntimeExecutor` at a time.

Reviewed By: mdvacca

Differential Revision: D27940300

fbshipit-source-id: 2bad25c86315c1712b4a1da8c1d4702734cec70f
2021-04-24 03:21:09 -07:00
Paige Sun d90253da36 iOS: Fix InputAccessoryView disappearing when inputAccessoryViewID exists
Summary:
InputAccessoryView disappears on Fabric (not Paper) when the text prop changes.

Changelog: [Fabric] [iOS] Fix InputAccessoryView disappearing when inputAccessoryViewID exists

Differential Revision: D27721549

fbshipit-source-id: 163dfcf0a8d5226453f4de356650a6ba82bee10b
2021-04-20 12:50:25 -07:00
Joshua Gross ff47b0eecd Mounting: log more information in iOS-only REMOVE assert
Summary:
Log a little more information in the iOS-only assert checking that the REMOVE index is correct.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27632457

fbshipit-source-id: 56e668dc2f22841e3cf3d838ba605d63cc7c1bad
2021-04-14 10:34:57 -07:00
Samuel Susla 976a305412 Remove clean up resources when the app is backgrounded experiment
Summary:
Changelog: [internal]

Experiment didn't move any metrics. Let's get rid of it.

Reviewed By: mdvacca

Differential Revision: D27588183

fbshipit-source-id: 55404a3d756971ee34d4a86acd1027ed077692c0
2021-04-07 17:01:04 -07:00
Samuel Susla 1739ab5ec2 Use C++17 feature - structured bindings
Summary:
Changelog: [internal]

Trying out C++ 17 feature: structured bindings.

Reviewed By: PeteTheHeat

Differential Revision: D27462634

fbshipit-source-id: 336f771e9579124f429ec648ee418f7ac52cd6a3
2021-04-06 02:14:18 -07:00
Samuel Susla e42ffdd859 Add support for text copy to Paragraph component
Summary:
Changelog: [internal]

Add support for copying text. The implementation is copied over from old React Native renderer.

Reviewed By: JoshuaGross

Differential Revision: D27502474

fbshipit-source-id: 0d0df583f1adc584ca47e987f06bf78c32386fcc
2021-04-01 10:43:52 -07:00
Peter Argany 4efdf264d1 Introducing RCTWeakViewHolder [4/n]
Summary:
Problem: In paper, there is a handy API called `[uiManager viewForReactTag:]`. Fabric does not have this mapping. The Fabric interop layer still relies on this Paper mapping.

Solution: As a workaround, re-create this mapping in the Fabric interop layer. Therefore, whenever Fabric interop layer asks a paper view manager to create a view, store a weak reference to the view in a `NSMapTable`. NSMapTable allows us to customize the strong/weak relationship. I've added a comment explaining that `RCTWeakViewHolder` only needs to be used for this special circumstance.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27438899

fbshipit-source-id: 94663ef06479a8c863ce58b0f36d42109fa1c4f3
2021-03-31 16:39:02 -07:00
Joshua Gross 70608eed1e Clean up Paragraph Cxx/iOS code after D27238439
Summary:
In my haste to get out D27238439 (aca0f418ba), parts of it are sloppy. Nothing critical and no known bugs, but we should clean up the commented code, and add back these asserts.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27266288

fbshipit-source-id: f242c26401dfc8851cb1ee0ef8911d19d9c1d9ae
2021-03-23 15:02:50 -07:00
Joshua Gross aca0f418ba Change State references to TextLayoutManager to a weak_ptr (ParagraphState)
Summary:
TextLayoutManager indirectly holds ShadowNodes, which could hold onto TextLayoutManager via a shared_ptr; so we probably have some reference cycles here.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27238439

fbshipit-source-id: b0b65cc451891e75bafddb7a08aa34ddf86d6a35
2021-03-22 19:29:32 -07:00
Peter Argany ac7ba3ea16 Fix leak checker crash in bridgeless mode
Summary:
Fast follow to D26727461 (34d189ae09), in bridgeless mode, `_contextContainer` doesn't have bridge, so avoid setting up `garbageCollectionTrigger`.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27173725

fbshipit-source-id: 5530c43638c17fb03e065c11667786efe9f3ef11
2021-03-18 18:29:38 -07:00
Samuel Susla 729c6d2f41 Fix accessibilityElement accessibility frame
Summary:
Changelog: [internal]

`accessibilityElement.accessibilityFrame` returns CGRect in screen's coordinate space. Screen coordinate space changes whenever user scrolls. Therefore they have to be computed whenever on demand rather than precomputed.

Reviewed By: mdvacca

Differential Revision: D27118793

fbshipit-source-id: c48a2b9fc3f25b6ae797104371a2627193f4f79a
2021-03-18 06:56:00 -07:00
Peter Argany 4079c0454b Update paper interop lists
Summary:
Picker was migrated off of the paper compatibility layer last year (see T75217510 and stack ending in D23663596 (8f45db3b9e))

WebView was deleted from RN repo a few months back.

This diffs removes both of these native components from tooling surrounding the Fabric-Paper compat layer.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D27099989

fbshipit-source-id: b6ce994fd28c4765db802cc80e8e66aec4e7a47f
2021-03-17 15:39:47 -07:00
Samuel Susla 145110b8d4 Add support for GIFs
Summary:
Changelog: [internal]

Add support or GIFs in Fabric. This reuses Paper's `RCTUIImageViewAnimated`.

Reviewed By: fkgozali

Differential Revision: D27115321

fbshipit-source-id: c512e395b5c71701b25abf745be74b51b21df5b2
2021-03-17 14:22:40 -07:00
Samuel Susla 34d189ae09 Introducing Leak Checker
Summary:
Changelog: [internal]

Introducing LeakChecker. A tool that checks if all native components have been cleaned up when surface is stopped.

**Known shortcomings**:
- LeakChecker is only enabled in debug builds and the existence of leaks is logged to console.
- For now, Leak Checker looks at N-1 screen. This is intentional as there is a known limitation of React that doesn't free up all shadow nodes when surface is stopped. Because of this, the use of LeakChecker is not intuitive and I'll work with React team to try to work around this.
- It doesn't help locating the leak, it only informs that leak is present. I'll be looking into ways to help locate the leak.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D26727461

fbshipit-source-id: 8350190b99f24642f8e15a3c2e1d79cfaa810d3d
2021-03-17 02:57:37 -07:00
Joshua Gross 9c1926051e Pass `blockNativeResponder` param to setIsJSResponder
Summary:
The non-Fabric API has a `blockNativeResponder` param in setJSResponder. Make sure to pass that along in Fabric.

On Android this allows us to respect the flag and do the same thing non-Fabric was doing if `blockNativeResponder` is false. It's not clear yet what the impact is on iOS.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27058806

fbshipit-source-id: aa5074fa46191d78f5292a93d9040ab4bb58ca66
2021-03-15 18:37:36 -07:00
Samuel Susla 23cf99544c Introduce RCTInstallNativeComponentRegistryBinding
Summary:
Changelog: [internal]

Creates new function `RCTInstallNativeComponentRegistryBinding` which can be called during JS setup to register JS function `__nativeComponentRegistry__hasComponent`.

Note: This diff doesn't call `RCTInstallNativeComponentRegistryBinding`.

Reviewed By: shergin

Differential Revision: D26946176

fbshipit-source-id: 0625b8dd6090bc9e08baa38ba60b9cbe48268184
2021-03-15 03:39:13 -07:00
Samuel Susla 56e0309b78 Send onDismiss event when Modal is dismissed
Summary:
Changelog: [internal]

"onDismiss" event wasn't called in Fabric. This diff adds it.
Paper implementation of Modal uses `RCTEventEmitter` instead of callback to deliver the event. To align better with Paper, Fabric will follow this pattern.

Reviewed By: shergin

Differential Revision: D26911312

fbshipit-source-id: b0de619c5a02c3378d1f7ac3ce1b705bb5fb634d
2021-03-10 05:47:47 -08:00
Samuel Susla 311d2fb0c5 Disable swipe down gesture in Modal component
Summary:
Changelog: [internal]

Paper implementation prevents swipe to dismiss gesture in Modal.

https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTModalHostViewController.m?commit=9d1f344633fb&lines=25-30

This diff implements the same in Fabric.

Reviewed By: ShikaSD

Differential Revision: D26910753

fbshipit-source-id: cb036ce0a9cd57c7d549a1a58eb941d8e64f2468
2021-03-09 11:55:30 -08:00
Valentin Shergin 913c958751 Fabric: Fixed a crash caused by calling `[RCTFabricSurface start]` off the main thread
Summary:
We need to register a root view component here synchronously because right after we start a surface, it can initiate an update that can query the root component.

This fixes an issue in Fabric Surface caused by a data race between registration of root component and concurrent call to `constraintLayout` on the main thread.
This how it happens:
1. We call `startSurface` on some background thread;
2. As a result `[RCTFabricSurface start]` schedules a lambda to the main thread that will register a root component.
3. Meanwhile some other code on the main thread changes the layout and requests the relayout of a surface.
4. Because the surface is already running, the `constraintLayout` method works as expected and schedules a mutation instruction that changes the size of the root component.
5. The mutation instruction is being delivered synchronously on the main thread and fails because the root component was not yet registered. Boom.

For now, it's not fully clear how to solve this problem properly. I suspect that the good solution would be to shift the responsibility of registering a root component to the MountingCoordinator side (so, we will have an explicit instruction prescribing creating and registering the root component). This will probably be a quite invasive change though.

For now, I think it's fine to make the block synchronous to avoid the race.

Reviewed By: mdvacca

Differential Revision: D26802418

fbshipit-source-id: d49484c90d1ac61ac595caf486562fc6f4843e2f
2021-03-04 09:31:23 -08:00
Samuel Susla 542c7cc357 Pass layoutDirection to surface handler
Summary:
Changelog: [internal]

During transition to SurfaceHandler, layoutDirection got lost. This diff adds it back.

Reviewed By: JoshuaGross

Differential Revision: D26775873

fbshipit-source-id: 9b638b4c2a41eb887312b968a2e113c5fcd7463d
2021-03-04 02:19:00 -08:00
Joshua Gross b08362ade5 Send unix timestamp for touch events instead of systemUptime
Summary:
We want to be able to instrument touch processing delays in JS, which does not have access to systemUptime; therefore we want a UNIX timestamp, which JS has access to and can compare to the touch time.

It only matters that there is relative consistency between multiple touch events in JS, which is still the case; so this should have no impact on product code.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26705430

fbshipit-source-id: 2acd52ae5873a44edf1e0cb126a9a6c87203d8fa
2021-02-28 15:18:51 -08:00
Valentin Shergin 013b39f32c Fabric: Using `SurfaceHandler` on iOS
Summary:
(This is the second version of the diff that includes additional checkes and syncronization around `start` and `stop` methods).

This diff migrates iOS renderer to using SurfaceHandler directly instead of calling Scheduler methods.

Major changes:
* RCTFabricSurface only stores a SurfaceHandler and platform-specific parts (such as a UIView instance and TouchHandler); all other pieces of state are stored in SurfaceHandler object.
* All the state changes initiated from RCTFabricSurface are performed via calling corresponding methods on SurfaceHandler (bypassing RCTSurfacePresenter, RCTScheduler, Scheduler, and UIManager).
* Every RCTSurfaceHandler is responsible for observing `UIContentSizeCategoryDidChangeNotification` and communicating the change down to SurfaceHandler. (Besides code simplifications it's more correct because on iOS the DPI actually depends on a particular UIScreen/UIWindow associated with UIView and *not* global for the whole app.)

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: ShikaSD

Differential Revision: D26614577

fbshipit-source-id: 428f4c4cc1ca46cd97be0413e9279e29a54807f6
2021-02-24 08:29:35 -08:00
Samuel Susla e5921f7f38 Fix horizontal scrolling in RTL scripts
Summary:
Changelog: [internal]

Fabric's scrollView now supports horizontal scroll view.

Reviewed By: JoshuaGross

Differential Revision: D26608231

fbshipit-source-id: 176a7802fa580247d12657e08780805daacd8357
2021-02-24 06:29:51 -08:00
Samuel Susla d20b5e1481 Check for nullptr to prevent crash
Summary:
Changelog: [internal]

Prevent crash when casting of state to `ImageShadowNode::ConcreteState` fails. This doesn't fix root cause of the problem but stops the app from crashing.

Reviewed By: JoshuaGross

Differential Revision: D26604807

fbshipit-source-id: 17a2ead56ac68e560070ed4defd364a9d1dfd1e8
2021-02-23 10:13:24 -08:00
Valentin Shergin 0bb459b149 Back out "Fabric: Using `SurfaceHandler` on iOS"
Summary:
This is a backout of D24290778 (33d6091cac).
The original diff causes T85097896 and probably T85069775. For now I am going to unland this, and then I will re-land this after the cut with a fix.

Original commit changeset: 62b600c3f1b2
Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26515027

fbshipit-source-id: 057663b092e6b1d74db83c40d656b2ae142bd622
2021-02-18 12:41:27 -08:00
Valentin Shergin 95116dbe6d Fabric: Correct implementation of RCTUITextContentTypeFromString for <TextInput contentType>
Summary:
Previous implementation was now correct because it assumed that all the constant values are aligned between RN and UIKit.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D26476566

fbshipit-source-id: 07bbe14d887d446bae34f448f5e62c3075fb0979
2021-02-17 09:53:37 -08:00
Peter Argany d9064703fe Fix CMD+R reloading in bridgeless mode
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D26412253

fbshipit-source-id: 6be41120f598bbac841a6b42fafe3bb47e3f8a46
2021-02-12 10:06:39 -08:00
Valentin Shergin 33d6091cac Fabric: Using `SurfaceHandler` on iOS
Summary:
This diff migrates iOS renderer to using SurfaceHandler directly instead of calling Scheduler methods.

Major changes:
* RCTFabricSurface only stores a SurfaceHandler and platform-specific parts (such as a UIView instance and TouchHandler); all other pieces of state are stored in SurfaceHandler object.
* All the state changes initiated from RCTFabricSurface are performed via calling corresponding methods on SurfaceHandler (bypassing RCTSurfacePresenter, RCTScheduler, Scheduler, and UIManager).
* Every RCTSurfaceHandler is responsible for observing `UIContentSizeCategoryDidChangeNotification` and communicating the change down to SurfaceHandler. (Besides code simplifications it's more correct because on iOS the DPI actually depends on a particular UIScreen/UIWindow associated with UIView and *not* global for the whole app.)

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24290778

fbshipit-source-id: 62b600c3f1b2e66a7513481404af941ef8b78bec
2021-02-09 08:10:43 -08:00
Samuel Susla 5c202cafd6 Simplify content mode conversion
Summary:
Changelog: [internal]

To avoid typecasting, let's return `UIViewContentMode`. This way we get rid of a condition to check if contentMode is repeat.

Reviewed By: JoshuaGross

Differential Revision: D26252431

fbshipit-source-id: 94ef7af1a76f13c91b696d57ceecc2453bbc9d8d
2021-02-09 04:03:48 -08:00
Valentin Shergin fc24bb4af0 Fabric: Support for `setIsJSResponder`, all the native changes
Summary:
This is a Fabric-compliant implementation of `JSResponder` feature. To make it work e2e we also need to update FabricRenderer in React repository. But before we can do this, we need to ship the native changes.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D24630027

fbshipit-source-id: 70c30e1250b554d83862956b536714704093072f
2021-02-04 13:16:29 -08:00
Samuel Susla 33b600236a Simplify ModalHostView plugin setup
Summary:
Changelog: [internal]

Provide a default plugin function that provides core `RCTModalHostViewComponentView`. This makes for easier setup for standalone app migration.

Reviewed By: JoshuaGross, shergin

Differential Revision: D26150091

fbshipit-source-id: d39723b99c590d1a33fb7b628f809aa12b2f7589
2021-02-04 03:46:00 -08:00
Samuel Susla 76a1db4b20 Fix Jest e2e by exposing accessibilityLabel in RCTParagraphComponentView
Summary: Changelog: [internal]

Reviewed By: shergin

Differential Revision: D26225118

fbshipit-source-id: 28e7292663ba8faf5d11f04da754dbec33efee90
2021-02-03 12:22:07 -08:00
Valentin Shergin 1ee87e1f97 Fabric: Simplifying the integration among RCTSurfacePresenter, RCTMountingManager, and RCTFabricSurface
Summary:
Changes:
* RCTMountingManager got two dedicated methods that designate some external view as a Surface viewport;
* The wiring between views now happens right in `start` and `stop` methods (because there is no reason to do it later); now it's symmetrical and straightforward;
* A couple of Surface legacy statuses were removed; they are not used and do not convey useful information anyway.
Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26095434

fbshipit-source-id: 37828e093a40a1ad22ad78f110c18a8f27781ba7
2021-02-01 11:41:16 -08:00
Valentin Shergin a8fbe7269f Fabric: Setting mountingOverrideDelegate for MountingCoordinator directly
Summary:
Before this change, `mountingOverrideDelegate` was proxied via `Scheduler::startSurface` and `ShadowTree::ShadowTree` constructor down to `MountingCordinator`. Now we set it on the `MountingCoordinator` directly.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26049076

fbshipit-source-id: 7f1ecf2c8b6f264a7e59d19881464fe529c53d30
2021-01-26 14:58:22 -08:00
Valentin Shergin 75a678ddb2 Fabric: `RCTParagraphComponentView` now respects the `accessible` property
Summary:
In RN, a <Text> node can be marked "not-accessible" by specifying `accessible=false`. This diff implements this for Fabric.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24386225

fbshipit-source-id: 576f4cbe1916e90034f8c9f06f19cea1992e7abd
2021-01-25 21:11:44 -08:00
Valentin Shergin 92da2c1779 Fabric: Fixed <ScrollView> jumps during overscroll gesture
Summary:
Normally, UIScrollView adjust `contentOffset` inside `setContentSize` to prevent over-scroll. In most cases, it works fine but in a case when the ScrollView is in the middle of user interaction the over-scroll is perfectly acceptable. So, to work around this issue we disable `setContentOffset` when we update `contentSize` and the gesture interaction is in progress.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26001133

fbshipit-source-id: 19b67289b2c142facd4f516a740180c87f90bc2d
2021-01-22 08:53:45 -08:00
Samuel Susla 768ecc2906 Implement ScrollView.indicatorStyle
Summary: Changelog: [internal]

Differential Revision: D25996218

fbshipit-source-id: 38b521b0ac52635a2c6341450592e6dd27be00f4
2021-01-21 09:59:40 -08:00
Samuel Susla fa728b27e6 Implement ScrollView.scrollIndicatorInsets
Summary: Changelog: [internal]

Reviewed By: shergin

Differential Revision: D25996025

fbshipit-source-id: 3528914af278dcbe522e247660b8afc19628eb6e
2021-01-21 09:59:40 -08:00
Samuel Susla 8695980e1e Add experiment to clean up resources when the app is backgrounded
Summary:
Changelog: [internal]

Setup an experiment to measure impact of releasing resources when the app enters background.

Reviewed By: JoshuaGross, shergin

Differential Revision: D25952690

fbshipit-source-id: acfaa4a1689cc03c6020fdee62d3594859c9da3d
2021-01-20 10:08:13 -08:00
Andres Suarez 0f4f917663 Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861683

fbshipit-source-id: 616afca13ae64c76421053ce49286035e0687e36
2021-01-09 22:11:00 -08:00
Joshua Gross e3a05c9e3e iOS implementation of sendAccessibilityEvent
Summary:
This is the iOS native implementation of sendAccessibilityEvent for Fabric.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25857401

fbshipit-source-id: e57d2e7fd45052bcf05cee7d0cb6c55ee974f358
2021-01-08 18:10:59 -08:00
Samuel Susla a9bc3853f0 Cancel touches if surface touch handler can be prevented | second try
Summary:
Changelog: [internal]

Previous implementation, (D25684453 (eba31d2858)) which was backed out, had a bug that caused assert to fail. It was restarting internal state `RCTSurfaceTouchHandler` and lead to inconsistency.
This is because touch event is a state machine and before "moved" is called, touch event had to "began". With internal state being restarted, that wasn't the case.

In the previous implementation the internal state was incorrectly restarted because I thought touches would not longer receive touch events after declaring that UIGestureRecogniser shouldn't be recognised simultaneously.

In this diff I take a different approach. Instead of restarting the internal state, the recogniser is first disabled and then enabled again. This cancels any ongoing touches instead of manual cleanup.

### Other approaches

In the UIViewController, we could listen to `viewWillDisappear` message and cancel any ongoing touches on the surface. This would work as well (it would prevent Pressable components from being highlighted during interactive view controller dismissal) however we would need to expose existence of `RCTTouchHandler` to the view controller. This approach is also discouraged in D15734129 (36307d87e1).

Reviewed By: shergin

Differential Revision: D25685536

fbshipit-source-id: ad226c82e73f841c1ebd9b92738847cc5cdc21d1
2020-12-27 03:26:03 -08:00
Valentin Shergin f379b1e583 Fabric: Shipping `updateStateWithAutorepeat` as the only way to update a state
Summary:
This replaces the internal core implementation of `setState` with the new `updateStateWithAutorepeat` which is now the only option.
In short, `updateStateWithAutorepeat` works as `setState` with the following features:
* The state update might be performed several times until it succeeds.
* The callback is being called on every retry with actual previous data provided (can be different on every call).
* In case of a static value is provided (simple case, not lambda, the only case on Android for now), the same *new*/provided value will be used for all state updates. In this case, the state update cannot fail.
* If a callback is provided, the update operation can be canceled via returning `nullptr` from the callback.

This diff removes all mentions of the previous state update approach from the core; some other leftovers will be removed separatly.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25695600

fbshipit-source-id: 14b3d4bad7ee69e024a9b0b9fc018f7d58bf060c
2020-12-23 21:49:44 -08:00
Valentin Shergin e7c41ec5fb Back out "Use ConcreteStateTeller in RCTInputAccessoryComponentView"
Summary:
Original commit changeset: a3324b5df6e6
ConcreteStateTeller is being replaced with a new built-in state autorepeat mechanism.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25687697

fbshipit-source-id: 849bb8b6c244b17a49b5fe140346d90a9a7e52ff
2020-12-23 10:09:25 -08:00
Valentin Shergin 6675b61404 Back out "Use ConcreteStateTeller in RCTLegacyViewManagerInteropComponentView"
Summary:
Original commit changeset: 4c0d7b249175

ConcreteStateTeller is being replaced with a new built-in state autorepeat mechanism.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25687698

fbshipit-source-id: b7eac808db1acdc7ef3297313ac352162bdccd5b
2020-12-23 10:09:25 -08:00
Valentin Shergin a0beb3a437 Back out "Use ConcreteStateTeller in RCTModalHostViewComponentView"
Summary:
Original commit changeset: b82301e5db48

ConcreteStateTeller is being replaced with a new built-in state autorepeat mechanism.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25687694

fbshipit-source-id: 17a737d394cb7f460b239be421466981bc46f995
2020-12-23 10:09:24 -08:00
Valentin Shergin b426cbccb4 Back out "Use ConcreteStateTeller in RCTTextInputComponentView"
Summary:
Original commit changeset: 2b82e2d43cc6
ConcreteStateTeller is being replaced with a new built-in state autorepeat mechanism.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25687699

fbshipit-source-id: d318155509b00064e29fc32efe893151a9723fd5
2020-12-23 10:09:24 -08:00
Valentin Shergin 016905333a Back out "Use ConcreteStateTeller in RCTScrollViewComponentView"
Summary:
ConcreteStateTeller is being replaced with a new built-in state autorepeat mechanism.

Original commit changeset: 8c777ae1264c

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25687695

fbshipit-source-id: 334cb6c7497270c040e4aec262a30441bc7529ce
2020-12-23 10:09:24 -08:00
Samuel Susla eba31d2858 Back out "Cancel touches if surface touch handler can be prevented"
Summary:
Changelog: [internal]

Causes assert in `_updateTouches` to be fired.
Original commit changeset: 9e3cd4135138

Reviewed By: motiz88

Differential Revision: D25684453

fbshipit-source-id: a5394c622712e7b1c1c57cd663c2bba9161da333
2020-12-22 13:58:49 -08:00