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

2927 Коммитов

Автор SHA1 Сообщение Дата
Samuel Susla 71c7e80bfd Add RTL support
Summary:
Changelog: [internal]

layoutDirectionPass down layoutDirection from `RCTSurfacePresenter` down to `YogaLayutableShadowNode`.

In `ParagraphShadowNode`, we propagate layoutDirection from yoga node to `TextAttributes.layoutDirection`.

Reviewed By: shergin

Differential Revision: D20420041

fbshipit-source-id: 86e01d31ea9415acb8579c44c470cac870ec1b8f
2020-03-17 14:09:28 -07:00
Samuel Susla 1f4535c175 Fix state.padding being out of sync with safe area view
Summary:
Changelog: [Internal]

# Problem

SafeAreaView is getting reused, its previous `safeAreaInsets` is top: 44, bottom: 34 so `safeAreaInsetsDidChange` doesn't get called because it doesn't change. Therefore state gets never updates because `safeAreaInsetsDidChange` is never called.

# Solution

Update state whenever a new state is assigned.

Reviewed By: shergin

Differential Revision: D20444198

fbshipit-source-id: 75d1458450c70d74647df4962ddad88d5f6a38d2
2020-03-16 02:43:29 -07:00
Samuel Susla c774cb8ec5 Remove unwanted animations
Summary:
Changelog: [internal]

# Problem
Assigning `CALayer.contents` implicitly animates the difference. As we keep `UIView` in recycle pool between usages, they keep their previous state. This was causing animation of border when the views were being reused.

# Solution
Wrapping application of mutations in `CATTransaction`.

Reviewed By: shergin

Differential Revision: D20442045

fbshipit-source-id: 214d6c422f23f399dec46b5bf1a38a7b64758160
2020-03-16 02:43:29 -07:00
Valentin Shergin 65d6f5afbb Fabric: Removing taking zIndex into account in hit-testing algorithm
Summary:
Now we have `zIndex` feature implemented in the Core, we don't need to take `view.layer.zIndex` into account when we do hit-testing, so now we don't need to sort *all subviews* on *all levels of hierarchy* every time we process touch down event.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20425987

fbshipit-source-id: 025bd968ae948b9b0a4188845efc0de950fb5cdf
2020-03-15 20:52:12 -07:00
Valentin Shergin efa74c4c23 Fabric: Removing applying `zIndex` to `layout.zIndex` on iOS mounting layer
Summary:
Now we have `zIndex` feature implemented in the Core, we don't need to have it implemented on the mounting layer.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20432156

fbshipit-source-id: f77b96919bab21b6628472b9fe58c5f4e3233318
2020-03-15 20:52:12 -07:00
generatedunixname89002005287564 1dc82a89d7 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D20383094

fbshipit-source-id: 1dc497a98fd3b5962542735c5243d7ac9cd40da3
2020-03-11 21:41:04 -07:00
Andy Himberger 0c2db3256f timing fix for RCTCxxBridge.executeApplicationScript (#25991)
Summary:
In one of our test apps (actually on Mac not iOS, but same code) we very consistently crash in RCTCxxBridge.executeApplicationScript when js debugging, due to a timing issue where another thread has reset _reactInstance in between the null check on self->_reactInstance and usage of it on these lines:

```
    } else if (self->_reactInstance) {
      self->_reactInstance->loadScriptFromString(std::make_unique<NSDataBigString>(script),

```
The thread doing the reset is doing so switching the executorClass to WebSocketExecutor.
In the scenario we crash, the packager has a bundle ready and quickly returns it, though its a 34MB string being passed to NSDataBigString which must be taking long enough for the other thread to get a chance to reset.

## Changelog

[iOS] [Fixed] - Fix crash in RCTCxxBridge.executeApplicationScript
Pull Request resolved: https://github.com/facebook/react-native/pull/25991

Test Plan: Ran apple code path in normal from bundle file and js debugging scenarios.

Reviewed By: shergin

Differential Revision: D19186065

Pulled By: hramos

fbshipit-source-id: ae1d4b5b50b7fb33b74aba21addc2978e917479f
2020-03-10 18:15:42 -07:00
Valentin Shergin 0d6d58656a Fabric: EmptyLayoutMetrics does not contain invalid values anymore
Summary:
Before this change, fields of EmptyLayoutMetrics have some "invalid" values to allow us to compare equal them individually and get `false`. Turned out that having invalid values there might break some serialization layers, which is no good.
This change fixes that and adds explicit check for EmptyLayoutMetrics before running a comparison of individual fields.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D20324881

fbshipit-source-id: ab8e2a402f6bdfb393fc9b6789decb526fa94dfa
2020-03-10 17:00:41 -07:00
Samuel Susla cd0e4ecd7b Fix scrollView state contentOffset not being in sync with scrollView contentOffset
Summary:
Changelog: [Internal]

# Problem
`scrollView.state.contentOffset` was not in sync with actual `contentOffset` in case `contentOffset` is changed programatically.

# Solution
Add a flag `_isUserTriggeredScrolling` that indicates whether the current scroll is triggered by user or not. In case it isn't, update state.

Reviewed By: shergin

Differential Revision: D20098161

fbshipit-source-id: 021d916e7a45a24095a47bb8f84d1102226b672a
2020-03-10 12:47:20 -07:00
Adam Ernst 0c7bd388f0 Rename get_debug_preprocessor_flags
Summary:
The new name is get_preprocessor_flags_for_build_mode.

Changelog: [Internal]

Reviewed By: d16r

Differential Revision: D20351718

fbshipit-source-id: 67628ce81e7244f0f72af2d00d92842a649ff619
2020-03-09 18:28:27 -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
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
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
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
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 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
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
Samuel Susla b40f0562f5 Rename measure to measureContent and pass it LayoutContext
Summary:
In order to build dynamic text sizing, `LayoutableShadowNode::measure` needs to accept `LayoutContext`

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D20184598

fbshipit-source-id: 8928b59d51948caf3654f40049212a89a91dceb6
2020-03-03 04:14:04 -08:00
Tom Underhill f4de45800f PlatformColor implementations for iOS and Android (#27908)
Summary:
This Pull Request implements the PlatformColor proposal discussed at https://github.com/react-native-community/discussions-and-proposals/issues/126.   The changes include implementations for iOS and Android as well as a PlatformColorExample page in RNTester.

Every native platform has the concept of system defined colors. Instead of specifying a concrete color value the app developer can choose a system color that varies in appearance depending on a system theme settings such Light or Dark mode, accessibility settings such as a High Contrast mode, and even its context within the app such as the traits of a containing view or window.

The proposal is to add true platform color support to react-native by extending the Flow type `ColorValue` with platform specific color type information for each platform and to provide a convenience function, `PlatformColor()`, for instantiating platform specific ColorValue objects.

`PlatformColor(name [, name ...])` where `name` is a system color name on a given platform.  If `name` does not resolve to a color for any reason, the next `name` in the argument list will be resolved and so on.   If none of the names resolve, a RedBox error occurs.  This allows a latest platform color to be used, but if running on an older platform it will fallback to a previous version.
 The function returns a `ColorValue`.

On iOS the values of `name` is one of the iOS [UI Element](https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors) or [Standard Color](https://developer.apple.com/documentation/uikit/uicolor/standard_colors) names such as `labelColor` or `systemFillColor`.

On Android the `name` values are the same [app resource](https://developer.android.com/guide/topics/resources/providing-resources) path strings that can be expressed in XML:
XML Resource:
`@ [<package_name>:]<resource_type>/<resource_name>`
Style reference from current theme:
`?[<package_name>:][<resource_type>/]<resource_name>`
For example:
- `?android:colorError`
- `?android:attr/colorError`
- `?attr/colorPrimary`
- `?colorPrimaryDark`
- `android:color/holo_purple`
- `color/catalyst_redbox_background`

On iOS another type of system dynamic color can be created using the `IOSDynamicColor({dark: <color>, light:<color>})` method.   The arguments are a tuple containing custom colors for light and dark themes. Such dynamic colors are useful for branding colors or other app specific colors that still respond automatically to system setting changes.

Example: `<View style={{ backgroundColor: IOSDynamicColor({light: 'black', dark: 'white'}) }}/>`

Other platforms could create platform specific functions similar to `IOSDynamicColor` per the needs of those platforms.   For example, macOS has a similar dynamic color type that could be implemented via a `MacDynamicColor`.   On Windows custom brushes that tint or otherwise modify a system brush could be created using a platform specific method.

## Changelog

[General] [Added] - Added PlatformColor implementations for iOS and Android
Pull Request resolved: https://github.com/facebook/react-native/pull/27908

Test Plan:
The changes have been tested using the RNTester test app for iOS and Android.   On iOS a set of XCTestCase's were added to the Unit Tests.

<img width="924" alt="PlatformColor-ios-android" src="https://user-images.githubusercontent.com/30053638/73472497-ff183a80-433f-11ea-90d8-2b04338bbe79.png">

In addition `PlatformColor` support has been added to other out-of-tree platforms such as macOS and Windows has been implemented using these changes:

react-native for macOS branch: https://github.com/microsoft/react-native/compare/master...tom-un:tomun/platformcolors

react-native for Windows branch: https://github.com/microsoft/react-native-windows/compare/master...tom-un:tomun/platformcolors

iOS
|Light|Dark|
|{F229354502}|{F229354515}|

Android
|Light|Dark|
|{F230114392}|{F230114490}|

{F230122700}

Reviewed By: hramos

Differential Revision: D19837753

Pulled By: TheSavior

fbshipit-source-id: 82ca70d40802f3b24591bfd4b94b61f3c38ba829
2020-03-02 15:12:09 -08:00
Mihai 06b8b15b0a Fix Image component crashing when uri is null (#28061)
Summary:
This fixes https://github.com/facebook/react-native/issues/28060 with a fix similar to f940e7c4a6

## Changelog

[iOS] [Fixed] - Fix Image component crashing when uri is null
Pull Request resolved: https://github.com/facebook/react-native/pull/28061

Test Plan:
Run an app on iOS that renders `<Image source={{ uri: null }} />`. It should not crash.
![error](https://user-images.githubusercontent.com/4928274/74492398-6bb23e00-4ed7-11ea-8482-664e1786bba8.png)

Reviewed By: sammy-SC

Differential Revision: D20080680

Pulled By: PeteTheHeat

fbshipit-source-id: 119766a4d7eb6804ffd668418a1f158a712a4fe0
2020-02-28 13:36:45 -08:00
Kevin Gozali 30822e3923 make RN infra labels public
Summary:
Internal build target labeling.

Changelog: [Internal]

Reviewed By: zlern2k

Differential Revision: D20152676

fbshipit-source-id: 89615a0b3a6f3994b18f2c07b86d0ae93e052327
2020-02-28 12:46:49 -08:00
Arjan Zuidema 0a9cc34dd8 Added userInterfaceStyle prop to ActionSheetmanager to override user interface style for iOS 13 (#26401)
Summary:
Support to override actionsheet and share interface style to match your app. For example, when your app has it's own theming you want to match the stying on actionsheet and the share menu.

## Changelog

[iOS] [Added] - Added userInterfaceStyle for ActionSheetIOS and Share to override user interface style on IOS 13
Pull Request resolved: https://github.com/facebook/react-native/pull/26401

Test Plan:
Set dark style
![dark](https://user-images.githubusercontent.com/30040390/64685321-12a53080-d487-11e9-8846-f2ef89e114a2.jpg)
Set light style
![light](https://user-images.githubusercontent.com/30040390/64685322-12a53080-d487-11e9-9dfd-1e07b9fe0ce2.jpg)

Differential Revision: D17314080

Pulled By: hramos

fbshipit-source-id: f84278ca99ba20347d17e27295f661d6690fa68c
2020-02-28 00:08:54 -08:00
Mo Gorhom 576ddfb3a8 Dark mode support for RCTPerfMonitor (#28130)
Summary:
Hi There 👋,

While I'm developing on iOS with dark appearance enabled, i notice that `Pref Monitor` view doesn't support dark mode yet, so here is the PR to fix it :)

## Changelog

[iOS] [Fixed] - Fix Pref Monitor in dark appearance
Pull Request resolved: https://github.com/facebook/react-native/pull/28130

Test Plan:
Run any React Native app on iOS > Turn on dark appearance
### Before
![Before](https://user-images.githubusercontent.com/4061838/74872974-8b75b600-535e-11ea-8550-763a598547ec.png)
### After
![After](https://user-images.githubusercontent.com/4061838/74872978-8ca6e300-535e-11ea-9862-4d3014e849f7.png)

Reviewed By: RSNara

Differential Revision: D20080019

Pulled By: PeteTheHeat

fbshipit-source-id: 9365daa3f7193a11760bc1372b8de2c3896def5c
2020-02-27 17:31:23 -08:00
Ramanpreet Nara 6a9a76e420 Make RCTDevLoadingView TurboModule-compatible
Summary:
This is a redo of D16969764, with a few extensions.

## Changes
1. Move `RCTDevLoadingView.{h,m}` to `CoreModuels/RCTDevLoadingView.{h,mm}`
2. Extract ObjC API of `RCTDevLodingView` into `RCTDevLoadingViewProtocol` in `ReactInternal`.
3. Create API `RCTDevLoadingViewSetEnabled.h` in `ReactInternal` to enable/disable `RCTDevLoadingView`

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18642554

fbshipit-source-id: 6b62e27e128d98254b7a6d018399ec1c06e274fc
2020-02-27 17:06:13 -08:00
Valentin Shergin 041ce53002 Proper `nativeID` prop type in `UIView+React` category implementation
Summary:
`nativeId` type is `NSString`, not `NSNumber`. The `.h` file already has the proper type but `.mm` had a wrong one.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D20135465

fbshipit-source-id: e5f9fbf4940d3883334c910f96f0aa850a069d8c
2020-02-27 13:05:22 -08:00
Valentin Shergin 6589b64518 Codemod: Clang-format for all files in `React/Fabric` directory
Summary:
We are moving towards 100%-prettified files. That's another step when we apply Clang Format for `React/Fabric`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20112417

fbshipit-source-id: 020d818e5cb8e2f509c5276738c8f252f6817a56
2020-02-26 21:31:12 -08:00
Tommy Nguyen d0a32c2011 iOS: Make RCTKeyWindow multi-window aware and add UIScene support to RCTRedBox (#28147)
Summary:
`RCTRedBox` doesn't appear in apps implementing `UISceneDelegate`.

## Changelog

[iOS] [Changed] - `RCTKeyWindow()` is now multi-window aware
[iOS] [Fixed] - `RCTRedBox` doesn't appear in apps implementing `UISceneDelegate`
Pull Request resolved: https://github.com/facebook/react-native/pull/28147

Test Plan:
- Trigger an error in RNTester
- Trigger an error in an app implementing `UISceneDelegate`

![Simulator Screen Shot - iPhone 11 Pro Max - 2020-02-21 at 14 17 54](https://user-images.githubusercontent.com/4123478/75037702-14066a80-54b5-11ea-9373-b56b467be845.png)

Reviewed By: PeteTheHeat

Differential Revision: D20036399

Pulled By: hramos

fbshipit-source-id: 07d83e985b02296f930114e3c7100c2077e82300
2020-02-26 19:55:14 -08:00
Tommy Nguyen 74b667dbc2 iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)
Summary:
Attaches the loading view to a `UIScene` in apps using the new Scenes API (iOS 13+).

## Changelog

[iOS] [Fixed] - Fix RCTDevLoadingView not showing up with UIScene
Pull Request resolved: https://github.com/facebook/react-native/pull/27916

Test Plan:
Create a new app based on UIScene and integrate React Native.

| Before | After  |
|:------:|:------:|
 | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485717-eccfe800-43a3-11ea-96fd-f7077a348345.png"> | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485749-f9ecd700-43a3-11ea-8a18-2e2185e62e78.png"> |

Reviewed By: PeteTheHeat

Differential Revision: D20104655

Pulled By: hramos

fbshipit-source-id: 86c1902c00f791fd23f75ea7562b44c92e719c5e
2020-02-26 19:06:02 -08:00
Samuel Susla f936b65883 Creating new state should now correctly increment state revision
Summary:
Changelog: [Internal]

# Problem

Calling `UIManager::updateState` does not increment state revision because it calls `ConcreteComponentDescriptor::createState` which creates new state with state revision 1.

# How did this propagate?

This error propagated itself in TextInput when trying to input a value, you would be only allowed to type in 1 character.

Reviewed By: JoshuaGross

Differential Revision: D20072844

fbshipit-source-id: 37b8173307e1d91d6e9c41b5ff2e185dde31cc38
2020-02-26 03:32:19 -08:00
Samuel Susla af5ecb2916 Fix layer.mask not being reset after recycle
Summary:
Changelog: [Internal]

If `layer.mask` was set and the view got reused without having a different `layer.mask`, this value would persist between reuses.

I also added a call to `super finalizeUpdates` as it is best practice to call super, the parent class right now doesn't do anything but in the future we might add there some default logic.

Reviewed By: shergin

Differential Revision: D20030174

fbshipit-source-id: c90be3f4e9a8f3814000f177a3d50061f5aa120c
2020-02-25 07:04:58 -08:00
Logan Daniels 10c13fd811 Move requiresMainQueueSetup to the right implementation in RCTDevSettings
Summary: Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D20068813

fbshipit-source-id: fcf522ae2a075ba396d074cbf59f1ecc016b7c90
2020-02-24 15:14:09 -08:00
Rachel Nabors c0d8c1db90 Updating the URLs to point at new domain name reactnative.dev
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code

CHANGELOG:
[INTERNAL]

Reviewed By: hramos

Differential Revision: D20072842

fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
2020-02-24 13:09:11 -08:00
Varun Patel 8c10147ed5 Revert D20008608: iOS: Fix RCTDevLoadingView not showing up with UIScene
Differential Revision:
D20008608

Original commit changeset: ce59fd0b000d

fbshipit-source-id: aff385a9586de92c4033f994839617ba675ff365
2020-02-21 19:04:14 -08:00
Saumya Mukul 1e7ed81d16 Prevent modal dismissal with swipe gestures
Summary:
(Fixing the problems in this diff https://our.intern.facebook.com/intern/diff/D19836548/)

iOS 13 introduced interactive dismissal for modals https://medium.com/hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e.
This breaks react modals. We're disabling this feature for react modals
Changelog: [iOS][Fixed]  Prevent interactive dismissal for non-fullscreen modals

Reviewed By: shergin

Differential Revision: D19880343

fbshipit-source-id: e2ad82db3dd827812824862f432d549c865216b9
2020-02-20 17:31:38 -08:00
Tommy Nguyen 8ce27df08a iOS: Fix RCTDevLoadingView not showing up with UIScene (#27916)
Summary:
Attaches the loading view to a `UIScene` in apps using the new Scenes API (iOS 13+).

## Changelog

[iOS] [Fixed] - Fix RCTDevLoadingView not showing up with UIScene
Pull Request resolved: https://github.com/facebook/react-native/pull/27916

Test Plan:
Create a new app based on UIScene and integrate React Native.

| Before | After  |
|:------:|:------:|
 | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485717-eccfe800-43a3-11ea-96fd-f7077a348345.png"> | <img width="453" alt="image" src="https://user-images.githubusercontent.com/4123478/73485749-f9ecd700-43a3-11ea-8a18-2e2185e62e78.png"> |

Reviewed By: cpojer

Differential Revision: D20008608

Pulled By: hramos

fbshipit-source-id: ce59fd0b000d7dee51985a5533d9b5791687f592
2020-02-20 15:38:16 -08:00
Sharon Gong aebf54aee4 Add localized accessibility strings to React Core pod (#27995)
Summary:
The accessibility roles and states description strings are not able to be localized on iOS platform. Those strings are exposed to the end users so it should be localized. This PR is to add localized strings as a resource bundle to the React Core Pod so that any React Native app integrating the React Native dependencies using CocoaPods can get the localized accessibility roles and states description.

## Changelog

[iOS] [Added] - Add localized accessibility strings to React Core pod
Pull Request resolved: https://github.com/facebook/react-native/pull/27995

Test Plan: Verified with RNTester app.

Differential Revision: D19975587

Pulled By: PeteTheHeat

fbshipit-source-id: f8eb4e25194f0cd603c98a6221ec87503a2826ed
2020-02-20 14:31:03 -08:00
Janette Cheng a793ed7598 Unbreak the build
Summary:
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

fbshipit-source-id: 316b879368503114ea1af16276643301601bcca8
2020-02-20 08:30:46 -08:00
Logan Daniels adf87dd7ed Implement requiresMainQueueSetup in RCTDevSettings.mm
Summary: Changelog: [Fixed] Implement requiresMainQueueSetup in RCTDevSettings

Reviewed By: PeteTheHeat, RSNara

Differential Revision: D19944271

fbshipit-source-id: 5163a5de2aab6ec2bb130589191a2b66d1b30c18
2020-02-18 13:59:28 -08:00
Rick Hanlon cb749f1c52 LogBox - Revert back to RedBox window strategy
Summary: This diff reverts the iOS LogBox module back to the UIWindow strategy used by Redbox.

Reviewed By: sammy-SC

Differential Revision: D19941390

fbshipit-source-id: 4aea09137ea9e8bfc166a733272647a79102bf35
2020-02-18 06:19:44 -08:00
Samuel Susla cebc2c9d3e Do not switch queues if not necessary
Summary:
Changelog: [Internal]

Switching queue here is not necessary if we are already on the main queue.

 This is important for Fabric SSTs, otherwise images are missing.

Reviewed By: shergin

Differential Revision: D19907908

fbshipit-source-id: 52e82484afc8e2f591d0c5cc126952990d992e96
2020-02-18 03:40:51 -08:00
Peter Argany 824e171117 Refactor HotModuleReloadClient setup call from bridge to RCTDevSettings
Summary:
This refactors some logic which sets up HMRClient in JS. The logic should live in RCTDevSettings, so it is shared in bridge/bridgeless mode.

This also means the logic will be compiled out when `RCT_DEV_MENU` is false.

Reviewed By: RSNara

Differential Revision: D19563629

fbshipit-source-id: 5c2553be9fd686a2a178f03bb5eed7a82cbadb1b
2020-02-13 12:27:47 -08:00
Shu Lin 66f89e2e36 Revert D19836548: Prevent modal dismissal with swipe gestures
Differential Revision:
D19836548

Original commit changeset: 2b8c80b86356

fbshipit-source-id: c8118f671e2a5e4d2b2f32a704b0cdc227d5c6c5
2020-02-12 10:41:40 -08:00
Josh Leibsly ca431c2179 Remove product/platform/infra layers from ios supermodules
Summary:
Context: https://fb.workplace.com/groups/2116332615111503/permalink/2773825422695549/

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review
allow-large-files
allow_many_files

Differential Revision:
D19858113
Ninja: master broken

fbshipit-source-id: d9e531f9579bfe7ef87097f0d50512722eb1de5e
2020-02-12 10:25:27 -08:00
Saumya Mukul 7e8a18840f Prevent modal dismissal with swipe gestures
Summary:
iOS 13 introduced interactive dismissal for modals https://medium.com/hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e.

This breaks react modals. We're disabling this feature for react modals

Changelog: [iOS][Fixed]  Prevent interactive dismissal for non-fullscreen modals

Reviewed By: shergin

Differential Revision: D19836548

fbshipit-source-id: 2b8c80b863569af48ff1c2cf74658393b1b583fd
2020-02-11 13:09:22 -08:00
Rick Hanlon 6ba2aeefa8 LogBox - Deallocate _rootViewController to release surface reference and break cycle
Summary:
This def breaks a reference cycle in logbox causing a memory leak in development.

Changelog: [iOS] [Fix] LogBox - Fix dependency cycle

Reviewed By: PeteTheHeat

Differential Revision: D19768068

fbshipit-source-id: 518b9c66499aa092465a9213f955965bffeebd88
2020-02-11 06:58:15 -08:00
Samuel Susla 291a2ffea2 Change behaviour of view command setTextAndSelection
Summary:
Changelog: [Internal]

When I was originally implementing this view command (D19471025), I misunderstood the desired behaviour.

The text parameter isn't meant to change text in the specified `select` but it is supposed to override text of entire text input.

Reviewed By: shergin

Differential Revision: D19793484

fbshipit-source-id: 64ba36ddfa27ac5a0adf48495cb4e985a429e005
2020-02-10 04:25:01 -08:00