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

19589 Коммитов

Автор SHA1 Сообщение Дата
Chad Smith f0dd701045 upgrade detox to 15.4.4
Summary:
Upgrade detox version to avoid a crash, per https://github.com/wix/Detox/issues/1947#issuecomment-596547229.

Changelog: [Internal] Upgrade Detox to 15.4.4.

Reviewed By: TheSavior

Differential Revision: D20344541

fbshipit-source-id: a7a3d97b858dbbb13a796dbc3c5c0c47f3ffe556
2020-03-09 14:13:28 -07:00
Rick Hanlon 69126069fc LogBox - Handle invalid requires
Summary:
This diff updates the errors thrown by Metro for invalid requires, and fixed a bug in Fast Refresh that was failing to handle errors returned by metro. The net result is that invalid requires are displayed as syntax errors with code frames.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20107057

fbshipit-source-id: 59f77aa1da620d2c619a7cc45d90f40ef8b54448
2020-03-09 06:02:07 -07:00
Samuel Susla f96dc274d1 FindNodeAtPoint now accounts for scrollView offset
Summary:
Changelog: [internal]
FindNodeAtPoint was not taking transform into account.

Reviewed By: JoshuaGross

Differential Revision: D20288026

fbshipit-source-id: a8ff09bc265de983e42610c5d23837a2000f9dd2
2020-03-09 05:57:20 -07:00
Samuel Susla d6484fa180 Add TextKind trait to ParagraphShadowNode and TextInputShadowNode
Summary:
Adds `TextKind` trait to Paragraph and TextInput shadow nodes.

Later on it could cause confusion why they do not have this trait.

Changelog: [Internal]

Reviewed By: shergin, mdvacca

Differential Revision: D20254008

fbshipit-source-id: 56fb264fa4fe38a5f00f080558cdc7992fd51fea
2020-03-09 05:51:27 -07:00
Samuel Susla 138ade0117 Add transform*rect and transform*size operators
Summary:
Adding 2 `transform*rect` and `transform*size` operations.
Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D20304247

fbshipit-source-id: 7bde67c96a21ce15e9da0464bcfccc61ab8fe13d
2020-03-09 04:56:39 -07:00
Valentin Shergin d0871d0a9a Clang format for all React Native files
Summary:
Buckle up, this enables clang-format prettifier for all files in React Native opensource repo.

Changelog: [Internal] Clang-format codemod.

Reviewed By: mdvacca

Differential Revision: D20331210

fbshipit-source-id: 8da0f94700be0c35bfd399e0c48f1706de04f5b1
2020-03-08 23:01:17 -07:00
Valentin Shergin a426c8dc77 Fabric: Using `(un)wrapManagedObject` in TextLayoutManager
Summary:
Investigating a crash, I spend half of an hour staring at `__bridge`, `__bridge_retained`, `CFRelease` and etc trying to understand is there a bug or not. Even if I think there was no bug there, it should not be this way. We have a nice abstraction around that madness we should use to make the code obvious.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20260917

fbshipit-source-id: 2b511ebf46a78950c4720e749099134aed1dd890
2020-03-08 21:31:54 -07:00
Jon Thysell (JAUNTY) 460c698e5f Fix MSVC build break in VS 2019 (#28253)
Summary:
Updating react-native-windows to build with Visual Studio 2019 and the v142 toolset.

## Changelog

[Internal] [Fixed] - Fix MSVC build break in VS 2019
Pull Request resolved: https://github.com/facebook/react-native/pull/28253

Test Plan: No real change, only adding a missing include for `stdexcept`.

Reviewed By: cpojer

Differential Revision: D20321273

Pulled By: shergin

fbshipit-source-id: ffe8b4d3a96ce4ed1db303020d77a806637e88bc
2020-03-08 21:18:48 -07:00
David Vacca c3d0729550 Fix rendering of TextInput in Catalyst App
Summary:
This diff fixes the rendering of the TextInput RNTester examples in catalyst app.
The root cause of the bug is that we were parsing the props of the text using the TextAttributeProps class, this is incorrect because TextAttributeProps is a holder of the C++ TextAttributes and not TextProps, but the name is confusing.
As a consecuence there was some mistmaches of types during parsing and that was throwing an exception in some examples.

I created the task T63643819 to refactor these classes to make this cleaner.
I'll be working on T63643819 next week, now I want to unblock this bug.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D20320969

fbshipit-source-id: 7b47546ba4f34df2a7fa151ab200823ea2eeb696
2020-03-06 23:07:32 -08:00
Valentin Shergin 6530c90267 Fabric: Fixing a crash in RCTParagraphComponentView
Summary:
We don't know why exactly it happens but (seemingly) sometime Paragraph component receives an empty State object. This causes a crash because of unchecked access to an instance variable.
This diff introduces an assert in DEBUG mode and the check for prod.

Why is this happens? Hard to say, probably `layout()` method (which updates `State`) is not being called on ShadowNode. Why? One explanation can be that Yoga skips some subtree during layout because it starts from "visibility: hidden" component. We need to investigate it more and figure out what exactly going on and what should we need to improve besides the check. That's why we have an assertion.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20260512

fbshipit-source-id: 4772855f41c6694be2ed6c0a19da40332d2bb8db
2020-03-06 20:06:32 -08:00
Joshua Gross c18cc76e58 Comparison of AttributedString false more often than true in TextInput, resulting in janky editing behavior
Summary:
Instead of comparing the entire AttributedString, compare just the strings and the TextAttributes of Fragments.

Concretely what I'm seeing is that the Frame of the associated parent ShadowViews are changing very frequently, making it impossible to actually modify the TextInput in some cases. However, we shouldn't forcibly reset the content of the TextInput if the frame of the parent is changing and not the actual child contents.

Changelog: [Internal] Fabric TextInput bug fix

Reviewed By: shergin

Differential Revision: D20319359

fbshipit-source-id: 2f51f521ad76fff9da6f6c8b5e795f03c33e496f
2020-03-06 19:37:27 -08:00
Logan Daniels 074a2fab74 Update measurements for Footer in VirtualizedList when the footer's onLayout is called
Summary:
When any list cell that may contain nested VirtualizedLists is laid out, it's possible that the offset of any child lists relative to the outermost list has changed. We need to tell these children to re-measure themselves relative to that outermost list, so that their viewability calculations are correct.

We already do this for regular list cells -- we just need to extend that logic to any child lists that may live in the ListFooterComponent.

Changelog: [General] [Fixed] - Fix viewability calculations for nested VirtualizedLists inside of a parent list's FooterComponent

Differential Revision: D20310961

fbshipit-source-id: 4bfcfb95c87329f2ee337d5499e5c7162ba692e8
2020-03-06 15:51:33 -08:00
David Vacca acbf9e18ea Deprecate method UIManagerModule.resolveRootTagFromReactTag
Summary:
In this diff I'm doing the following:
- Deprecating the method UIManagerModule.resolveRootTagFromReactTag
- Removing the callsites to the method UIManagerModule.resolveRootTagFromReactTag
- Refactoring the callsites in order to keep the same behavior for rootTags
- Throwing an exception if this method was being called with a non rootTag
- Controlling this change of behavior with a MC

This is possible because long time ago we refactored all the callsites to this method to ensure we only use rootTag. I'm making extra steps to make sure this deprecation is safe and we don't break production if this method was being called with a non Root Tag.

changelog: [Android][Deprecated] We are deprecating the method UIManagerModule.resolveRootTagFromReactTag, this will not be supported in the next version of RN

Reviewed By: fkgozali

Differential Revision: D20309166

fbshipit-source-id: 8b89ba889313ae03ed543f402b68f1bb4064ca68
2020-03-06 13:29:01 -08:00
Ramanpreet Nara fe5ac2c3f9 Fix method signature
Summary:
All `NSNumber *` arguments of NativeModules need to be marked with `__nonnull`. Otherwise, when TurboModules are disabled, we run into a RedBox.

Changelog:
[iOS][Fixed] - Fix RCTDevLoadingView RedBox on Reload

Reviewed By: PeteTheHeat

Differential Revision: D20292188

fbshipit-source-id: a8a5d0b2070575d7728b6308b129196242671fe6
2020-03-06 12:44:56 -08:00
Joshua Gross 83c76c257c Fix T61647031 - color comparison causing TextAttribute color to not update ParagraphState
Summary:
As documented in T61647031, Text colors were sometimes not being updated because the ParagraphState was not always updating with a new AttributedString.

Turns out, it's because the equality comparator for Color had not been implemented, and so State was not being set in some cases.

The confusing part is that now color comparisons return true **more often** than before (if you're comparing two smart pointers of opaque data without a custom comparator, in theory I assume they're comparing pointer values and returning false way more often... but maybe my understanding is off). This distracted us for a while in finding an other ~fairly simple solution.

We should keep this in mind if we experience other, similar issues with text attributes not updating.

Changelog: [Internal] Fabric

Reviewed By: mdvacca

Differential Revision: D20300307

fbshipit-source-id: 13d86495f4c4ef8a0219fec66d39a49b4f7e6c2a
2020-03-06 12:39:34 -08:00
Daniel Sainati 1beef1e18d deploy 120 to xplat
Summary:
Changelog: [Internal]

bypass-lint
allow-large-files

Reviewed By: mroch

Differential Revision: D20290164

fbshipit-source-id: 6f8633b1a8685b0551757fc4841b82eab77525c5
2020-03-06 11:09:08 -08:00
Christoph Nakazawa 78de0865cf Adjust React error messages to obfuscate imports
Summary:
Similar to the previous diff in this stack, I'm adjusting the React files we use to make sure require and import statements don't get extracted by Jest. Right now Jest extracts them, and when it looks up dependencies in reverse it just ignores the ones that don't exist.

Corresponding React PR (to make sure this change doesn't get reverted during the next sync): https://github.com/facebook/react/pull/18222

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D20282829

fbshipit-source-id: 5ff6a64d31672dd29243d020e8174797a44d9267
2020-03-06 03:57:40 -08:00
Riley Dulin 48001c597e Add call to collectGarbage for JSIExecutor::handleMemoryPressure
Summary:
Someone pointed out in this Github issue: https://github.com/facebook/react-native/issues/27532
that the memory pressure warning from Android was being ignored, when it can easily
be used to start a garbage collection on the JS runtime.

Changelog: [Internal] Add a memory pressure handler for jsi::Runtime

Reviewed By: mhorowitz

Differential Revision: D20072943

fbshipit-source-id: 869a14068aa02bd378e8b26d8c18b76a5d0f7bc0
2020-03-05 18:15:38 -08:00
Valentin Shergin 22fdb8bb05 Fabric: Fixed UI jankiness caused by changes in flattening
Summary:
It's not clear why exactly but seems in some cases, for some views the hierarchical relationship between views is required (when it should not be conceptually). Turning this feature off for Android for now.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D20292833

fbshipit-source-id: 1aab8468cedeb5c1440a95944be7eca3216e0db0
2020-03-05 17:29:08 -08:00
Logan Daniels b85cb0cf7a Back out "Moving towards UIWindowScene support"
Summary:
Original commit changeset: ae2a4478e2e7

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D20289851

fbshipit-source-id: 1167ce8f5135411b80630b523c91c10e2b7eece1
2020-03-05 15:58:44 -08:00
Logan Daniels f4538e5777 Back out "UIViewController-based status bar management"
Summary:
Original commit changeset: 9ae1384ee20a

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D20289822

fbshipit-source-id: 0db9d99bea458e150d33b3407c256b862dedb9c1
2020-03-05 15:58:43 -08:00
Jesse Katsumata fbd09b1797 Image: remove unused ImageProps (#28151)
Summary:
I noticed that there was a `height` and `width` props in `Image` component, but those props are not being used in `RCTImageView`(ios) or `ReactImageView`(android).

## Changelog

[GENERAL] [Removed] - Remove Unused ImageProp
Pull Request resolved: https://github.com/facebook/react-native/pull/28151

Test Plan: Start a new React Native Project, and use `Image` component with `width` and `height` props and verify that it does not display the image on both iOS and Android

Reviewed By: shergin

Differential Revision: D20197126

Pulled By: TheSavior

fbshipit-source-id: 186119448826659d7c01c7c8a271157228169c30
2020-03-05 13:33:08 -08:00
Logan Daniels c203ec00e5 Add flow types for ReactTestRenderer
Summary: Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20260771

fbshipit-source-id: 3935e546ebbc65a1baa9d0a25cff47753f6bc590
2020-03-05 12:01:18 -08:00
generatedunixname89002005287564 d1018e0414 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D20278397

fbshipit-source-id: 2188283cd01d0d9d9d5b3995bd8d3f1fd687ad55
2020-03-05 08:27:36 -08:00
Joshua Gross 43e6d9acd7 TextInput should respect previous props, paddingHorizontal, and paddingVertical
Summary:
Of course if props aren't changing, rawProps won't have paddings anymore and so padding gets reset.

Also, make sure we pay attention to paddingVertical and paddingHorizontal styles.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20269583

fbshipit-source-id: 2903fd0f7e6178f506109467d9a8f67b6d013a25
2020-03-04 20:01:24 -08:00
Joshua Gross 782e06a059 LogBox: do less work in production when LogBox shouldn't even be running
Summary:
Do we need this? Is it possible for any of these codepaths to execute in production? If so, it would be nice to avoid NPEs or even scheduling work on the UI thread.

Maybe we want to add soft exception logging for if these paths are called?

Changelog: [Internal] make sure LogBox does even less work when it's not hooked up

Reviewed By: rickhanlonii

Differential Revision: D20156812

fbshipit-source-id: ba9faedcb3b0951e6913724ca99549dc2d16237e
2020-03-04 19:38:24 -08:00
grabbou e1de7a5e65 chore: Bump CLI to latest (#28227)
Summary:
Bump CLI to the latest version.

CC: alloy thymikee

Changelog:
[Internal] Bump CLI version

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

Reviewed By: cpojer

Differential Revision: D20256386

Pulled By: hramos

fbshipit-source-id: a3cc46536b1e9f2f7a6a947b11ee0aaed25a25d6
2020-03-04 19:32:12 -08:00
Michael Yoon (LAX) 0a17a4fe56 fix android TextInput transitions
Summary:
On Android, when changing the props on TextInput component, there are cases where behavior is incorrect.

ex: there were two other PR requests to fix the following issues:
1) TextInput doesnt respect the autoCapitalize prop when keyboardType is set to "default"
2) Password visibility is broken

But those PRs ended up breaking a transition from phone-pad to default

Root cause
- The issue is that the bits that Android defines to store the InputType flags are reused.
- For example, the previous issue: TYPE_TEXT_FLAG_CAP_WORDS and TYPE_NUMBER_FLAG_DECIMAL are both using 0x00002000 bit. So when switching input types from phone-pad to default (text), it is not known if this bit should be cleared. It could have been set for capitalize or for indicating the num pad should be generic.

the solution is to always unset the TYPE_CLASS flags before setting the keyboardType so the user has the correct keyboard.

Changelog: [Fixed] TextInput transition from phone-pad to default

Reviewed By: JoshuaGross

Differential Revision: D20263334

fbshipit-source-id: 0b283fbd6314bf10b90f760917447d2439aaa147
2020-03-04 17:41:50 -08:00
Will Holen f1a9ca04f6 Support CDP returnByValue in Hermes Inspector
Summary:
This adds support for 'returnByValue' in Runtime.evaluate invocations.
If the result of the evaluation can't be serialized to JSON, the results
are undefined.

ChangeLog: [Internal] - Hermes Inspector now supports 'returnByValue' in CDP Runtime.evaluate calls

[Facebook]
This is change was made to support debug completion in VSCode for ReactVR.

Reviewed By: ArchDev

Differential Revision: D19961115

fbshipit-source-id: d20af82b35d6bde88ab74b5c5a4c07415122c142
2020-03-04 16:28:45 -08:00
Ramanpreet Nara 7ec9af0fcf Temporarily add logs in TM initialization
Summary:
Marketplace eagerly initializes a few NativeModules. These NativeModules are TurboModule compatible, and the device/user is in the TurboModule test. So these NativeModuels should be returned from the TurboModule system. However, for some reason, we end up doing a lookup on the `NativeModuleRegistry` for these NativeModules.

This means that either:
1. The TurboModuleManager isn't attached to the CatalystInstance
2. The TurboModuleManager returned null from getModule.

These logs will help us get to the bottom of what's going on.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D20260150

fbshipit-source-id: bb554ead412ad3b0fa7502b77f575365608ebc98
2020-03-04 15:06:55 -08:00
Héctor Ramos 3a9fc7cbcf Configure no-response bot (#28202)
Summary:
Add configuration for [no-response bot](https://probot.github.io/apps/no-response/). This will make it so that issues tagged with the "Needs: Author Feedback" are closed after 21 days of inactivity. More importantly, it will make it so that the label is removed whenever the original author of the issue adds a comment.
## Changelog

[Internal] - N/A
Pull Request resolved: https://github.com/facebook/react-native/pull/28202

Test Plan: Verified no-response is enabled for this repository.

Reviewed By: cpojer

Differential Revision: D20256358

Pulled By: hramos

fbshipit-source-id: 51a11e868081afced9ee26640393f08501a8f103
2020-03-04 15:01:28 -08:00
radex 80e6d672f3 UIViewController-based status bar management (#25919)
Summary:
{emoji:26a0} This is a follow up to https://github.com/facebook/react-native/issues/25425 -- which isn't merged yet… See 2a286257a6..125aedbedc for actual diff

Currently, StatusBar native module manages the status bar on iOS globally, using `UIApplication.` APIs. This is bad because:

- those APIs have been deprecated for 4 years
- Apple really, really wants you to have an explicitly defined view controller, and control the status bar there
- it [breaks external native components](https://github.com/facebook/react-native/issues/25181#issuecomment-506792819)
- it's [not compatible with iPadOS 13 multi window support](https://github.com/facebook/react-native/issues/25181#issuecomment-506690818)

for those reasons I we should transition towards view controller-based status bar management.

With that, there is a need to introduce a default React Native root view controller, so I added `RCTRootViewController`. Using it is completely opt-in and there is no breaking change here. However I believe this should be a part of the template for new RN iOS apps.

Additionally, I added `RCTRootViewControllerProtocol` with hooks needed for RCTStatusBarManager to control the status bar. This means apps that want to have total control over their view controller can still opt in to react native VC-based status bar by conforming their root view controller to this protocol.

## Changelog

[iOS] [Added] - Added `RCTRootViewController` and `RCTRootViewControllerProtocol`
[iOS] [Fixed] - `UIViewControllerBasedStatusBarAppearance=YES` no longer triggers an error as long as you use `RCTRootViewController`
[iOS] [Fixed] - Status bar style is now correctly changed in multi-window iPadOS 13 apps if you use `RCTRootViewController` and set `UIViewControllerBasedStatusBarAppearance=YES`
Pull Request resolved: https://github.com/facebook/react-native/pull/25919

Test Plan: - Open RNTester → StatusBar → and check that no features broke

Reviewed By: fkgozali

Differential Revision: D16957766

Pulled By: hramos

fbshipit-source-id: 9ae1384ee20a06933053c4404b8237810f1e7c2c
2020-03-04 14:25:12 -08:00
radex b58e176af0 Moving towards UIWindowScene support (#28058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/28058

I'm taking the first step towards supporting iOS 13 UIScene APIs and modernizing React Native not to assume an app only has a single window. See discussion here: https://github.com/facebook/react-native/issues/25181#issuecomment-505612941

The approach I'm taking is to take advantage of `RootTagContext` and passing it to NativeModules so that they can identify correctly which window they refer to. Here I'm just laying groundwork.

- [x] `Alert` and `ActionSheetIOS` take an optional `rootTag` argument that will cause them to appear on the correct window
- [x] `StatusBar` methods also have `rootTag` argument added, but it's not fully hooked up on the native side — this turns out to require some more work, see: https://github.com/facebook/react-native/issues/25181#issuecomment-506690818
- [x] `setNetworkActivityIndicatorVisible` is deprecated in iOS 13
- [x] `RCTPerfMonitor`, `RCTProfile` no longer assume `UIApplicationDelegate` has a `window` property (no longer the best practice) — they now just render on the key window

Next steps: Add VC-based status bar management (if I get the OK on https://github.com/facebook/react-native/issues/25181#issuecomment-506690818 ), add multiple window demo to RNTester, deprecate Dimensions in favor of a layout context, consider adding hook-based APIs for native modules such as Alert that automatically know which rootTag to pass

## Changelog

[Internal] [Changed] - Modernize Modal to use RootTagContext
[iOS] [Changed] - `Alert`, `ActionSheetIOS`, `StatusBar` methods now take an optional `surface` argument (for future iPadOS 13 support)
[iOS] [Changed] - RCTPresentedViewController now takes a nullable `window` arg
[Internal] [Changed] - Do not assume `UIApplicationDelegate` has a `window` property
Pull Request resolved: https://github.com/facebook/react-native/pull/25425

Test Plan:
- Open RNTester and:
- go to Modal and check if it still works
- Alert → see if works
- ACtionSheetIOS → see if it works
- StatusBar → see if it works
- Share → see if it works

Reviewed By: PeteTheHeat

Differential Revision: D16957751

Pulled By: hramos

fbshipit-source-id: ae2a4478e2e7f8d2be3022c9c4861561ec244a26
2020-03-04 14:25:12 -08:00
Samuel Susla fcec815368 Fix what updateState in ScrollView when called from reactSmoothScrollTo
Summary:
Changelog: [Internal]

# Problem

Fabric didn't know about content offset, even though `reactSmoothScrollTo` calls `updateStateOnScroll`, the value of content offset is {0, 0}.

# Fix

Call `updateStateOnScroll` from `reactSmoothScrollTo` with where the scroll view is going to be rather than where it is.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D20248959

fbshipit-source-id: b1da645576dd5e8dce29e7e1d90ab232e0df9fd5
2020-03-04 14:20:05 -08:00
Samuel Susla 4f908a569a Fix HorizontalScrollView not reporting its contentOffset
Summary:
# Problem

HorizontalScrollView was not reporting its `contentOffset` to Fabric, therefore `measure`  was returning wrong value.

# Solution

Copy over implementation of `updateState` from scrollView. I noticed that there is a lot of duplication between the two classes, that's why I decided to duplicate `updateState` as well.

Changelog: [Internal]

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D20247552

fbshipit-source-id: 48b1eb0c11198a32531effe55301f8d554e92130
2020-03-04 14:11:06 -08:00
Joshua Gross d892bb889b Add more specific error messages for different lifecycle problems
Summary:
Currently the error messages lead users to assume that all problems are because we're trying to use the ReactContext too early; it could be because we're using it too late, after it's been destroyed. Because of D17944723, it could be because we're accessing too late, after teardown.

Changelog: [Internal] making some error messages more specific and helpful

Reviewed By: mdvacca

Differential Revision: D20251909

fbshipit-source-id: e236d57e4d7d9c778d41de95160c242bcd69b3c9
2020-03-04 12:44:18 -08:00
Valentin Shergin 4f3e3f8cc1 Fabric: Tweaking view flattening algorithm to rely on new traits instead of `LayoutableShadowNode::isLayoutOnly()`
Summary: Now, following the previous diff, we remove `LayoutableShadowNode::isLayoutOnly()` and change the view flattening algorithm to rely on two new traits. See the previous diff to learn more about how it works.

Reviewed By: sammy-SC

Differential Revision: D20212252

fbshipit-source-id: 87a07e8bb17b2e66e5703f107dc35ca7a8e49634
2020-03-04 12:33:03 -08:00
Valentin Shergin b5117bf6ea Fabric: New two ShadowNode Traits: FormsStackingContext & FormsView
Summary:
This diff introduces two new `ShadowNodeTrait`s that we will use in the future in the new (slightly tweaked) view-flattening algorithm. (Note: this diff does not enable the new flattening, it's just preparation.)
The idea is that we split the notion of `isLayoutOnlyView` into two traits:
* `FormsView`: `ShadowNode`s with this trait must be represented as `ShadowView`s. Normal "visible" ShadowNodes will have this trait, but "layout only views" in old nomenclature will not.
* `FormsStackingContext`: `ShadowNode`s with this thread not only must be represented as `ShadowView`s but also have to form a "stacking context" which means that their children must be mounted as `ShadowView`'s children.

Our implementation does not exactly follow W3C spec in terms of sets of props that create the stacking context (because of historical reasons and mobile specifics) but ideologically it's the same. We start from the very conservative implementation where only views with background-color and borders do not form stacking context and then we probably extend that to more props.

Most importantly for us now, we will enforce the absence of ``FormsStackingContext` for `ParagraphShadowNode` and the presence of `FormsView` for `TextShadowNode` on Android where it's essential for mounting layer.

Read more about stacking context here: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20212253

fbshipit-source-id: 0fbaee214ce2c5886cb0232843a2a3c7bb20655d
2020-03-04 12:33:03 -08:00
Tim Yung fc45530ded Pressability: Restore Press In Delay
Summary:
During the development of `Pressability`, I removed the default "press in delay" in order to minimize differences between `Touchable` (as used by `TouchableWithoutFeedback`) and `Pressability`. However, it was a bug that `TouchableWithoutFeedback` zero'd out the default press delay.

This restores the original "press in delay". This will make it so that when users swipe over a pressable element in a scroll view, the scroll view will have time to cancel the touch and prevent a press in behavior (visual jank).

Changelog:
[General] [Changed] - Increase default `delayPressIn` value for `Pressability` to 130ms.

Reviewed By: TheSavior

Differential Revision: D20176152

fbshipit-source-id: 5d6481395ee501bcab20ab98cb46a6be2c423ddf
2020-03-04 11:06:48 -08:00
Michel Weststrate fbb94a30bc Bump FlipperKit version on iOS to be compatible with react-native-fli… (#28225)
Summary:
This diff updated FlipperKit to be compatible with the latest react-native-flipper version.

## Changelog

(nothing changes compared to what is already in the changelog for RN 0.62.0)

[iOS][Fixed] - Upgraded FlipperKit to 0.32.2 to ensure compatibility with latest `react-native-flipper`
Pull Request resolved: https://github.com/facebook/react-native/pull/28225

Test Plan:
Tested by upgrading the ReactNativeFlipperExample (https://github.com/facebook/flipper/tree/master/react-native/ReactNativeFlipperExample) to RN 0.62.0-rc.3 and verified the example plugin works. (In D20221558)

![Screen Shot 2020-03-04 at 11 26 52](https://user-images.githubusercontent.com/1820292/75875163-18167e80-5e0b-11ea-8a7d-504bb27757db.png)

Reviewed By: priteshrnandgaonkar

Differential Revision: D20249666

Pulled By: mweststrate

fbshipit-source-id: 71a61c4249f8b767c7767d5c6133436c9bc9cf26
2020-03-04 11:06:47 -08:00
generatedunixname89002005287564 6aa7030ce8 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D20245569

fbshipit-source-id: 2fede4cfd7e0291aa6718d510bfe14ee175134df
2020-03-04 06:08:57 -08:00
Samuel Susla 899b314ca2 Back out "Pass layoutContext to Yoga's MeasureCallback"
Summary:
Passing `layoutContext` to yoga crashes fb4a-64. Until I have a solution let's back this out.

Original commit changeset: 9df7da4bef8c

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D20246917

fbshipit-source-id: 220744fde9f74e8157fc0714c63639b01152e4ab
2020-03-04 05:01:54 -08:00
Samuel Susla 3ee1e5312a Back out "Rename measure to measureContent and pass it LayoutContext"
Summary:
Original commit changeset: 8928b59d5194

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D20246918

fbshipit-source-id: 0b9142d9bc4774a07304769126411a34cc8c33c5
2020-03-04 05:01:53 -08:00
Samuel Susla 74034ba23a Back out "Font size in Text now respects preferredContentSizeCategory"
Summary:
Original commit changeset: 3965a127069a

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D20246919

fbshipit-source-id: d2238f279f44ac4394557949c8f148f08a60647e
2020-03-04 05:01:53 -08:00
Valentin Shergin 0baac1ccfc Fabric: Improvements in Diffing test (`messWithLayotableOnlyFlag`)
Summary:
Now we tweak more props in order to prepare for new flattening algorithm.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D20212254

fbshipit-source-id: 7391155072f93046e78fbecf4bb4b42cb1caacdc
2020-03-03 23:35:25 -08:00
Valentin Shergin 903bf2de21 Fabric: Removing `const` qualifier from AccessibilityProps fields
Summary:
This is a part of migration staterted in D19390813.
There is no need to have those as const. The whole *Props object is usually const (and when it's not, props should not be too).
Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20212255

fbshipit-source-id: 87f3d8e7a94c6626bd9b0fc304f75e915dd73d4c
2020-03-03 23:35:25 -08:00
Valentin Shergin b8c17dd7c0 Revert D19965405: Fabric: Small improvements in Differentiator/TinyMap
Differential Revision:
D19965405

Original commit changeset: 92eedf38d55b

fbshipit-source-id: 92073ca877899e2a607f283275f0d7c894dd4720
2020-03-03 16:39:31 -08:00
Vojtech Novak 884c86ae02 change onRefresh flow typing (#28167)
Summary:
I propose this change because we (and a lot of other people, I'd guess) pass an `async` function as a parameter to `onRefresh`. Because the `async` function returns a `promise`, flow is reporting an error. I think the type checking here can be relaxed either all the way to `any` (because RN does not care here what we return) or to `void | Promise<void>` to account for async functions.

looking at fb7b2d3533 (diff-a9c5687ae65236ba3e7f34bfdcdec81d) seems like the second is preferred

## Changelog

[General] [changed] - relax RefreshControl's onRefresh flow typing
Pull Request resolved: https://github.com/facebook/react-native/pull/28167

Test Plan: * flow passes

Reviewed By: hramos

Differential Revision: D20196529

Pulled By: TheSavior

fbshipit-source-id: bb5a314bcfb5fb9c8ab71eccb449f1322aeebacb
2020-03-03 16:00:52 -08:00
Samuel Susla 58347677f9 Back out "UIManager.findNodeAtPoint now returns shadowNode instead of instanceHandle"
Summary:
Original commit changeset: bd2a1bcd26ab

changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20196869

fbshipit-source-id: 53235dc3475d79f9e3545c9aa42171f23137be5a
2020-03-03 04:22:00 -08:00
Samuel Susla 08dda02347 Font size in Text now respects preferredContentSizeCategory
Summary:
Changelog: [Internal]

Use LayoutContext to pass `fontSizeMultiplier` down to ParagrapShadowNode.

Reviewed By: shergin

Differential Revision: D20184596

fbshipit-source-id: 3965a127069a21328ed19cb3f9732f0a2d1c4d58
2020-03-03 04:14:04 -08:00