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

649 Коммитов

Автор SHA1 Сообщение Дата
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