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

2665 Коммитов

Автор SHA1 Сообщение Дата
Tom Underhill 2436bc9fb0 Added `export EXTRA_PACKAGER_ARGS="--reactNativePath $SRCROOT/../"` to Run Script step in RNTester-macOS and RNTester-tvOS targets to match RNTester (ios) target.
Added CGSize non-zero test in -[RCTView displayLayer:] to prevent assert in UIGraphicsEndImageContext().
2019-06-12 14:20:34 -07:00
Tom Underhill 232c1b9c5d Fix RCTBaseTextInputView.m to build for tvOS under.
Fix to React.xcodeproj/project.pbxproj to include JSCExecutorFactory.mm in tvOS target.
Fix to package.json/yarn.lock to update detox to 12.2.0 so that it works in macOS Mojave and later.
Fix to scripts/react-native-xcode.sh so that ip.txt is not written for mac RNTester builds.
2019-06-10 16:27:50 -07:00
Lorenzo Sciandra 06fffc2042 [0.60.0-rc.1] Bump version numbers 2019-06-10 12:30:15 +01:00
Eric Lewis eb73dbe24e Fix Xcode 11 build (#25146)
Summary:
Fixes build in Xcode 11 beta, the signature for `__unused` was changed. This adds a new check for the new style.

## Changelog

[iOS] [Fixed] - Xcode 11 beta build
Pull Request resolved: https://github.com/facebook/react-native/pull/25146

Differential Revision: D15628404

Pulled By: cpojer

fbshipit-source-id: 781a188a0e1562a3316fbe62920b12b03a44e4a7
2019-06-07 15:12:03 +01:00
Sharon Gong bcc9fcf1c7 Fix accessibilityActions accessors (#25134)
Summary:
The accessibilityActions accessors  in UIView+React.m are not aligned with the property declaration in the header file.

## Changelog

[General] [Fixed] - Fix accessibilityActions accessors
Pull Request resolved: https://github.com/facebook/react-native/pull/25134

Differential Revision: D15621848

Pulled By: cpojer

fbshipit-source-id: f344689292ae7988e46d0d4263980306d364366b
2019-06-07 15:11:56 +01:00
Héctor Ramos 55332afb29 [0.60.0-rc.0] Bump version numbers 2019-05-30 08:29:45 -07:00
Héctor Ramos 29496ede07 Revert "[0.60.0-rc.0] Bump version numbers"
This reverts commit f4508a6765.
2019-05-30 08:23:24 -07:00
Mike Grabowski f4508a6765 [0.60.0-rc.0] Bump version numbers 2019-05-30 13:34:40 +02:00
REDMOND\acoates 2e64c10da8 merge master 2019-05-28 13:08:40 -07:00
Héctor Ramos ea460d6d3e Revert "[0.60.0-rc.0] Bump version numbers"
This reverts commit edb749f283.
2019-05-28 07:39:11 -07:00
Tom Underhill 0804147ad7
Changed the showsVerticalScrollIndicator and showsHorizontalScrollIndicator default values on macOS to match iOS and Android. (#77)
Updated RNTesters filter text field to use mac semantic colors.
2019-05-23 11:47:57 -07:00
Mike Grabowski edb749f283 [0.60.0-rc.0] Bump version numbers 2019-05-22 22:29:43 +02:00
Tom Underhill d8ce49375b
Fix a crash that can occur in UIGraphicsEndImageContext if UIGraphics… (#71)
* Fix a crash that can occur in UIGraphicsEndImageContext if UIGraphicsBeginImageContextWithOptions is called with a 0 width or 0 height.

* Added comments

* Reverted RCTUIKit changes, added nonzero size checkes in RCTBorderDrawing.m
2019-05-21 20:46:51 -07:00
Samuel Susla d4ff5ed258 Don't return empty string for `accessibilityLabel` for RCTView
Summary:
In case `RCTView` had no subviews, `RCTRecursiveAccessibilityLabel` was returning an empty string rather than nil.

I've noticed that https://fburl.com/i95iynxi returns empty string as well. Shall we change it there as well?

Reviewed By: shergin

Differential Revision: D15337865

fbshipit-source-id: 8e38a88321f3dcfdf35a38d43fdbe4f5118796f1
2019-05-20 01:40:52 -07:00
Sharon Gong 14b4668947 Extended Accessibility Actions Support (#24695)
Summary:
This is a reconstitution of #24190. It extends accessibility actions to include both a name and user facing label. These extensions support both standard and custom actions.

We've also added actions support on Android, and added examples to RNTester showing how both standard and custom accessibility actions are used.

## Changelog

[general] [changed] - Enhanced accessibility actions support
Pull Request resolved: https://github.com/facebook/react-native/pull/24695

Differential Revision: D15391408

Pulled By: cpojer

fbshipit-source-id: 5ed48004d46d9887da53baea7fdcd0e7e15c5739
2019-05-20 01:32:53 -07:00
Lucas Bento 4ea6204111 Do not run packager in Release mode (#24929)
Summary:
This PR fixes a regression introduced on [3273d23](3273d23a26 (diff-883359f85083d00b7266ec2acebcca9f)) that removed #23938.

It also adds the check for `React` and `React-tvOS` targets.

## Changelog

[IOS] [FIXED] - Do not run packager in Release mode
Pull Request resolved: https://github.com/facebook/react-native/pull/24929

Differential Revision: D15391692

Pulled By: cpojer

fbshipit-source-id: c2e524108be3bf1e45b0d0ff7cddd9785b51a60f
2019-05-20 00:58:23 -07:00
Valentin Shergin f02feb8d38 Fabric: Codegen for PullToRefresh component
Summary:
Straightforward.
Rick, I rename some stuff, I hope you are cool with that.

Reviewed By: mdvacca

Differential Revision: D15403306

fbshipit-source-id: 1dbd34060052a9bd39ed4211010f14b76fffcde6
2019-05-19 17:44:40 -07:00
Valentin Shergin e8b2145263 Fabric: Standard PullToRefresh component
Summary: This is implementation of standard PullToRefresh component that uses standard iOS component and modern integration approach.

Reviewed By: mdvacca

Differential Revision: D15403308

fbshipit-source-id: 5c877f7c18af9f5ac40e15a4ba44118614ba80bc
2019-05-19 17:44:40 -07:00
Valentin Shergin de47b47b7c Fabric: findScrollViewComponentViewForView was moved to RCTScrollViewComponentView
Summary: This way we can reuse this code in other RCTScrollViewComponentView-satellite components, especially in standard pull-to-refresh component.

Reviewed By: mdvacca

Differential Revision: D15403307

fbshipit-source-id: 5999f851f22db0f358887e1a86d610e163adcb1d
2019-05-19 17:44:40 -07:00
Kyle Fang 5d3d3987d8 - fix crash on performance logger (#24821)
Summary:
Fix Issue https://github.com/facebook/react-native/issues/24820

It's caused by `_labelsForTags` and `RCTPLTag` being out of sync, the crash might only be one of the issues that this bug was causing.

## Changelog

[iOS] [Fixed] - fix crash on performance logger
Pull Request resolved: https://github.com/facebook/react-native/pull/24821

Differential Revision: D15407291

Pulled By: PeteTheHeat

fbshipit-source-id: c8d2a047fceb9cec981c48fe5181d1b4cbf0976c
2019-05-18 08:36:15 -07:00
Valentin Shergin 64db98febf Fabric: Improvements in RCTScrollViewComponentView
Summary:
This diff contains two changes:
* The actual UIScrollView is now mounted inside the component as `contentView` which mostly means that border-props will properly affect the layout of the scroll view (the scroll view will be laid out inside borders, not on top of those). And that also simplifies the code.
* Now the component view exposes the actual scroll view, its delegate splitter, and the container view defining a single interface for all possible integration that can be done with the Scroll View Component.

Reviewed By: mdvacca

Differential Revision: D15397283

fbshipit-source-id: 35e860b8bf55fbd4d0a5f4116f79e4507df79098
2019-05-17 20:04:15 -07:00
Valentin Shergin a982decb84 Fabric: Stopping messing with `clipToBounds` in RCTViewComponentView
Summary:
There was a reason why it exists: on iOS if you want to implement a view with rounded corners with a non-transparent background you need to set `clipToBounds = YES` to enabling clipping because besides drawing borders we need to clip the background otherwise it will "stick out".
There were a bunch of problems with this implementation and approach:
* It's overshooting. It applies `clipToBounds` no matter which border-radius is and no matter is there a background or not. So, it's kinda heuristic implementation and it's totally unexpected behavior sometimes.
* The previous problems can lead to performance problems as well (clipping requires additional work to do for CoreGraphics/GPU).
* The border-radius that we assigned to contentView is incorrect because it does not take border-width into account.
* This functionality only applies to non-null `contentView` which is a rear and custom case in which that can always be done manually for components that require that for some reason.

Reviewed By: mdvacca

Differential Revision: D15397282

fbshipit-source-id: 1599882ca8e591a9c4edb4d2b845bbf3d147bfce
2019-05-17 20:04:14 -07:00
Rick Hanlon 7927437a6d Switch Slider onSlidingComplete event to a non-bubbling event on iOS to match Android
Summary:
## Overview

This diff switches the RCTSlider onSlidingComplete event on iOS from a bubbling event to a direct (non-bubbling) event to match the non-bubbling type on android.

Note that in this case these seems like a bug. I will still explain the motivation and reasoning as this will come up in future diffs.

## Changelog
[Slider][BREAKING] Switch Slider onSlidingComplete event to a non-bubbling event on iOS to match Android

## Motivation:

The motivation here is that when we codgen the view configs, we'll need to unify all of the events and props across platforms for components that have the same name on iOS and Android.

In this case, the view configs (below) conflict for onSlidingComplete. On iOS this is under bubblingEventTypes, on Android this is under directEventTypes. We have code [here](https://fburl.com/3s1dahm2) in the react native renderer which ensures an event is not listed as both.

```
// iOS
const SliderViewConfig = {
  bubblingEventTypes: {
    onSlidingComplete: {
      phasedRegistrationNames: {
        captured: 'onChangeCapture',
        bubbled: 'onChange'
      }
    }
  },

  directEventTypes: {
    // None
  },

  validAttributes: {
    // ...
  }
};
```
```
// Android
const SliderViewConfig = {
  bubblingEventTypes: {
    // None
  },

  directEventTypes: {
    onSlidingComplete: {
      registrationName: 'onEventDirect'
    }
  },

  validAttributes: {
    // ...
  }
};
```

## Solutions
There are three solutions to this issue:
1. Don't generate view configs
2. Rename the component on one platform
3. Make a breaking change in the event behavior on one platform to make it consistent across both platforms

Here we've chosen option #3

Reviewed By: TheSavior

Differential Revision: D15322304

fbshipit-source-id: ff1ab86efe9e2bc50fd3f7619e6760ab5c1c5090
2019-05-16 10:51:07 -07:00
Kevin Gozali 8662d9d3b0 TM iOS: Added backward-compatible ObjC invalidation logic
Summary:
Some ObjC NativeModules conform to `RCTInvalidating` protocol and implements `invalidate` method. This is typically used to clean things up during bridge teardown or reload. In TurboModule system the invalidate method can be replaced by pure destructors, but for backward compatibility, we call existing invalidate method on each module during teardown.

This also cleans up all existing LongLivedObject's.

Reviewed By: mdvacca, RSNara

Differential Revision: D15365655

fbshipit-source-id: 802844b39b5b7adb54970ea541f4d744bbf9e480
2019-05-15 17:36:05 -07:00
Tom Underhill dd28949a9c RCTWebViewManager.m was missing from the macOS target (#70)
* Workaround crash during layout on macOS when a large number of flex
layouts are being performed, such as during a window resize.

* WebViewManager.m was accidentally removed from the macOS target during the last merge of RN .58.  Restore it.
2019-05-15 15:51:44 -07:00
RCiesielczuk cd2f8c567b Introduce TurboModule Setup Metric (#24732)
Summary:
With the introduction of TurboModules, it would be beneficial to measure the setup time of these modules, as we currently have it in place for NativeModules.

The instantiation of the TMs occurs in the `RCTTurboModuleManager`. In order to successfully measure the time it took to setup the module, we need to ensure that we don't take into account cached modules. As such, we need to:

1. Check if module is in `_turboModuleCache`
  a. Start mark for `RCTPLTurboModuleSetup` tag if not found
2. Get the TM via `[self provideTurboModule:]`
3. Check if module is in `_turboModuleCache`
   a. Stop mark for `RCTPLTurboModuleSetup` if we did not find module in cache prior to **step 2** and if it's now present in the cache.
   b. Notify about setup time if the above is true.
4. Return TM

## Changelog

[iOS] [Added] - Gain insights on the the turbo module setup times by observing `RCTDidSetupModuleNotification`. The userInfo dictionary will contain the module name and setup time in milliseconds. These values can be extracted via `RCTDidSetupModuleNotificationModuleNameKey` and `RCTDidSetupModuleNotificationSetupTimeKey`.
Pull Request resolved: https://github.com/facebook/react-native/pull/24732

Differential Revision: D15362088

Pulled By: RSNara

fbshipit-source-id: e6a8044e4aba5a12ae63e9c7dbf707a17ec00180
2019-05-15 15:28:10 -07:00
Valentin Shergin bcc1d999a8 Fabric: Introducing RNGenericDelegateSplitter
Summary: Future improvements in RCTScrollViewComponentView require ability to have multiple listeners of UIScrollViewDelegate (e.g. PullToRefresh component needs it), therefore we need a splitter to support it.

Reviewed By: JoshuaGross

Differential Revision: D15345301

fbshipit-source-id: 62bb50c4fdd4fa64ece5d7cc6ddc76367c84c4b3
2019-05-15 10:30:29 -07:00
Valentin Shergin 197c644f7a Fabric: Make measuring ScrollView::contentOffset-aware
Summary:
This is the final piece of change that makes measuring (`LayoutableShadowNode::getRelativeLayoutMetrics()`) take ScrollView content offset into account (on iOS).

It works pretty simply: at the end of scrolling (or zooming) action ScrollView updates the state which later can be used for computing `transform` which measuring uses to adjust values in LaoutMetrics.

Reviewed By: mdvacca

Differential Revision: D15323688

fbshipit-source-id: fdf86c6cd9bdfd56caddd4b39bdd1185760b9f94
2019-05-15 10:30:29 -07:00
Valentin Shergin cd231da27a Fabric: Migrate ScrollView from LocalData to State
Summary: Seems we need this now to enable future improvements in ScrollView such as correct measure, pull-to-refresh and so on.

Reviewed By: mdvacca

Differential Revision: D15323687

fbshipit-source-id: fae37431ccbbf2faec9c84752396153689b873ef
2019-05-15 10:30:29 -07:00
Valentin Shergin b241bc2d0b Fabric: Removing `MainQueueExecutor`
Summary: We don't need it anymore because we don't use folly::Future.

Reviewed By: JoshuaGross

Differential Revision: D15344961

fbshipit-source-id: a368e600d69e6879f6a98b4a997de85c71186e92
2019-05-14 19:52:17 -07:00
Andrew Coates (REDMOND) 7300f9ae75 merge master 2019-05-13 21:34:06 -07:00
Christopher Hogan 3d88c120e4 fb 0.59.0 merged and running for Mac platform 2019-05-13 17:39:35 -07:00
zhongwuzw 2cdf9694b5 Fixes ScrollView centerContent not work in some cases (#24817)
Summary:
The bug description can see https://github.com/facebook/react-native/issues/24688, we add `contentView` size check before center the content, because in some cases, the contentView's size not yet be calculated, in those cases, we don't adjust the `contentOffset`.

cc. cpojer .

[iOS] [Fixed] - Fixes ScrollView centerContent not work in some cases
Pull Request resolved: https://github.com/facebook/react-native/pull/24817

Differential Revision: D15322502

Pulled By: sahrens

fbshipit-source-id: e2081f13e9f2e8597a379a9db1607451ea496909
2019-05-13 13:03:26 -07:00
Valentin Shergin ddce74388a Revert D15242046: [RN] Fabric: Removing references to MessageQueueThread in RCTSurfacePresenter
Differential Revision:
D15242046

Original commit changeset: 88a3e3c629d7

fbshipit-source-id: b1820e506a7701bbcc24a9310848d4bcb6658d1c
2019-05-12 10:59:28 -07:00
Valentin Shergin 184073813e Fabric: Making `YogaStylableProps.yogaStyle` protected
Summary: `YogaStylableProps.yogaStyle` is designed to be consumed by Yoga only. Making it `protected` allows us to avoid confusion and misuse of this props.

Reviewed By: JoshuaGross

Differential Revision: D15296474

fbshipit-source-id: cf9e416afee99fb426d72765557b34d303a63dbe
2019-05-10 15:34:25 -07:00
Valentin Shergin 16499c1086 Fabric: Removing of all unnececery nil checks in RCTMountingManager
Summary: We needed that in the very beginning when diffing algorithm produces mount instructions for <Text> nodes which don't have ComponentView representation, so we simply silence those error here. That's not the case anymore, so we don't need those ugly checks.

Reviewed By: JoshuaGross

Differential Revision: D15296473

fbshipit-source-id: ea3717062056907e5395776fe95e3d581d3e9b09
2019-05-10 15:34:24 -07:00
Valentin Shergin 9e3856fd99 Fabric: Fixed threading issues in RCTSurfacePresenter
Summary: RCTComponentViewRegistry is not a thread-safe class and must be accessed only from the main thread.

Reviewed By: JoshuaGross

Differential Revision: D15296475

fbshipit-source-id: 67192abd6290191f3b8119972efc41cec48a793a
2019-05-10 15:34:24 -07:00
Christopher Hogan 4539cda451 ios building, linking, running for RNTester 2019-05-10 13:08:31 -07:00
Valentin Shergin 1d985b5e6e Fabric: Removing leftovers from previous implementation of view preallocation infra
Summary: Now it's implementled differently (see -[RCTComponentViewRegistry preallocateViewComponents]), so this code is not being used.

Reviewed By: mdvacca

Differential Revision: D15242045

fbshipit-source-id: c02eceb978cf1eae778f84a73456e7156ccf503b
2019-05-09 15:49:18 -07:00
Valentin Shergin 8c0ba25f19 Fabric: Storing ImageLoader (instead of ImageManager) in ContextConteiner
Summary:
ImageLoader is an actual external dependency, not a ImageManager.
That change allows to remove dependency on ImageManager from SurfacePresenter and make some other code simpler.

Reviewed By: mdvacca

Differential Revision: D15242047

fbshipit-source-id: 8622d15b8fdb5c3a7e25091adf7be1108f87ecd5
2019-05-09 15:49:18 -07:00
Valentin Shergin 656c415f76 Fabric: Removing references to MessageQueueThread in RCTSurfacePresenter
Summary: The particular meaningful piece of code that diff removes was added as (successful) attempt to fix an issue which was lately fixed by D14868547.

Reviewed By: mdvacca

Differential Revision: D15242046

fbshipit-source-id: 88a3e3c629d7c5f84c402b03e45034644147fec4
2019-05-09 15:49:18 -07:00
Valentin Shergin c60d9f8c15 Fabric: Fixed memory leak happened between RCTSurfacePresenter and RCTBridge
Summary: RCTBridge does not need to retain RCTSurfacePresenter, so we enforce that using `OBJC_ASSOCIATION_ASSIGN`.

Reviewed By: mdvacca

Differential Revision: D15273325

fbshipit-source-id: f223192ff5f781d9e905b004907739a36882bb63
2019-05-09 10:56:43 -07:00
Janic Duplessis 4e215b20a3 Fix event ordering when combining coalescable and non-coalescable events (#24693)
Summary:
Fixes an issue introduced in https://github.com/facebook/react-native/pull/15894 that can cause events to be dispatched out of order.

Also reverted `viewTag` moved to optional property as it didn't actually work and makes code more complex.

[iOS] [Fixed] - Fix event ordering when combining coalescable and non-coalescable events
Pull Request resolved: https://github.com/facebook/react-native/pull/24693

Differential Revision: D15279513

Pulled By: shergin

fbshipit-source-id: 3c64aba6d644ea9564572e6de8330b59b51cf4a9
2019-05-09 10:36:56 -07:00
Tom Underhill a1a6e4862d
Added canBecomeKeyView override to RCTScrollView (#60) 2019-05-09 09:14:48 -07:00
licd 3163479e0f add nonnull/nullable for swift (#24729)
Summary:
add nonnull/nullable for swift

[iOS] [Changed] - add nonnull/nullable for swift
Pull Request resolved: https://github.com/facebook/react-native/pull/24729

Differential Revision: D15273046

Pulled By: shergin

fbshipit-source-id: 5603007e5aa01d54064da349666a4e4d998b5471
2019-05-08 18:21:26 -07:00
Tom Underhill 5cd5862348
Add RCTSRWebSocket.h to the Copy Headers phase. (#61) 2019-05-08 10:18:42 -07:00
Janic Duplessis 9261035c2b Move accessibility props to UIView+React (#24743)
Summary:
React Native Gesture Handler uses a `RCTViewManager` subclass to manage `UIControl` so the cast to set accessibility props is not safe. This moves the accessibility props we set to `UIView+React` so they can be used safely on any `UIView`.

![image](https://user-images.githubusercontent.com/2677334/57042641-46e42700-6c33-11e9-9a97-76661ad5d14d.png)

[General] [Fixed] - Move accessibility props to UIView+React
Pull Request resolved: https://github.com/facebook/react-native/pull/24743

Differential Revision: D15258062

Pulled By: cpojer

fbshipit-source-id: 4a25b79407e5cb7b3b368c7506161e989794bb26
2019-05-08 03:48:03 -07:00
Valentin Shergin b5d0b6fc2a Fabric: Fixed parsing of `backfaceVisibility` prop
Summary: I have noticed that `backfaceVisibility` example crashes (because actual value is a string/enum, not a boolean), so I fixed it.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D15219261

fbshipit-source-id: 27f76cd10903794d597adacb9da7300a42813f8e
2019-05-06 17:06:41 -07:00
Valentin Shergin a6d4bceca4 Fabric: Removing `-[RCTSurfacePresenter bridge_DO_NOT_USE]`
Summary: Luckly, it's not being used anymore.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D15219260

fbshipit-source-id: 4baf2ae0a58fe7f515a7570dafe400305c17c6b7
2019-05-06 17:06:41 -07:00
Valentin Shergin 0f2a09d1f6 Fabric: MountingCoordinator - the new way to ensure ordering of mount transaction
Summary:
TBD.
This thing fixes flickering during appearing of Fabric screens on iOS.

Reviewed By: mdvacca

Differential Revision: D15116079

fbshipit-source-id: 95ed0ba94667cad67fe4317025128d01b34f69c5
2019-05-03 15:11:35 -07:00
Michał Pierzchała 49d26eb0c4 cleanup RedBox message and stack output (#24662)
Summary:
Cleanup RedBox messages and stack traces. This PR consists of 2 changes (I'm good with splitting them up if you'd like):

- [general] filter out some of the internal callsites from the symbolicated stack (I thought about using monospace font for title with code frame, but it looks weird)
- [ios][android] strip ANSI characters (coming from colored Babel code frame) from the error message

I think it's ok to strip it inside native handlers so we can still have a colorful code frame in the terminal output.

**JS Code frame:**

|before|after|
|--|--|
|<img width="400" alt="Screenshot 2019-04-30 at 12 32 05" src="https://user-images.githubusercontent.com/5106466/56956590-ef678d80-6b44-11e9-9019-6801f050ab0d.png">|<img width="400" alt="Screenshot 2019-04-30 at 12 52 43" src="https://user-images.githubusercontent.com/5106466/56957302-f42d4100-6b46-11e9-869b-ea9c7ce5b90f.png">|

|before|after|
|--|--|
|![image](https://user-images.githubusercontent.com/5106466/56959472-c8618980-6b4d-11e9-84be-6261d8375f4a.png)|![image](https://user-images.githubusercontent.com/5106466/56959463-bc75c780-6b4d-11e9-9d8b-25ffe46c87cf.png)|

**Filtered stack traces:**

|before|after|
|--|--|
|<img width="50%" alt="Screenshot 2019-04-30 at 12 27 21" src="https://user-images.githubusercontent.com/5106466/56956641-0908d500-6b45-11e9-8cdc-8c2a34a071e5.png"><img width="50%" alt="Screenshot 2019-04-30 at 12 27 28" src="https://user-images.githubusercontent.com/5106466/56956642-0908d500-6b45-11e9-921c-fabfb8515cc0.png">|<img width="100%" alt="Screenshot 2019-04-30 at 12 26 55" src="https://user-images.githubusercontent.com/5106466/56956650-0efeb600-6b45-11e9-9f5f-f10dd69580d1.png">|

There's still a lot of places that are hard to read, but I think this is a good start towards more readable errors.

cc cpojer

[General][Changed] - Cleanup RedBox message and stack output
Pull Request resolved: https://github.com/facebook/react-native/pull/24662

Differential Revision: D15147571

Pulled By: cpojer

fbshipit-source-id: 1de4e521af988fa7fc709b6accd0ddd984388e72
2019-04-30 07:35:14 -07:00
zhongwuzw 3c125e867f Call designated initializer for SurfaceHostingProxyRootView (#24368)
Summary:
1. Call designated initializer for SurfaceHostingProxyRootView.
2. Make super class designated initializer `-initWithSurface:sizeMeasureMode:` `NS_UNAVAILABLE`.

cc. shergin

[iOS] [Fixed] - Call designated initializer for SurfaceHostingProxyRootView
Pull Request resolved: https://github.com/facebook/react-native/pull/24368

Differential Revision: D15144991

Pulled By: shergin

fbshipit-source-id: c999ac64c766242ceff157b0d9600190c1f3add8
2019-04-29 21:41:55 -07:00
Valentin Shergin a0523da53d Fabric: Moving RNWrapManagedObject to `react/utils` module
Summary: Apparently we can/should not have in RCTConversions because it creates unnecessary dependency to core iOS module.

Reviewed By: mdvacca

Differential Revision: D15055325

fbshipit-source-id: 507f5a40c03b5c261967de4504297d31ecd02783
2019-04-29 21:21:11 -07:00
Harry Nguyen e7e1a93d8a Fix exception when attempt to load image from file system (#24457)
Summary:
When trying to load image using method "RCTImageFromLocalAssetURL", if URL's path in file system representation return null (in my case, imageUrl is base64 format returned from server so it's always null) then method "stringWithUTF8String" will raise an exception.

[iOS] [Fixed] - Fix exception when attempt to load image from file system
Pull Request resolved: https://github.com/facebook/react-native/pull/24457

Differential Revision: D15123680

Pulled By: shergin

fbshipit-source-id: bc34b3d7c79a8f9157729c4cf0486507c3c15ddf
2019-04-29 10:23:02 -07:00
zhongwuzw f75d47c915 Fixes SafeAreaView when set emulateUnlessSupported on safeArea supported devices (#24615)
Summary:
On safeArea supported devices like `iPhoneX`, we need to forbid invalidate `safeAreaInsets` when set `emulateUnlessSupported` prop, otherwise `SafeAreaView` would broken.

cc. cpojer shergin .

Before:
![before](https://user-images.githubusercontent.com/5061845/56792861-33088180-683d-11e9-8183-a1c8a5c9cb37.gif)

After:
![after](https://user-images.githubusercontent.com/5061845/56792867-38fe6280-683d-11e9-9b4d-01848b42a9b0.gif)

[iOS] [Fixed] - Fixes SafeAreaView when set emulateUnlessSupported on safeArea supported devices
Pull Request resolved: https://github.com/facebook/react-native/pull/24615

Differential Revision: D15122211

Pulled By: cpojer

fbshipit-source-id: 8a1c3f2aedbde707d8d6c8f36c97e6424585dc59
2019-04-29 10:02:58 -07:00
zhongwuzw ffa3b0d4d6 Add convert compatible of NSString for bridge message data (#24630)
Summary:
Fixes https://twitter.com/estevao_lucas/status/1117572702083190785?s=215 in #24626 . Now we try to convert any id to `NSString`, not throw error.

cc. cpojer .

[iOS] [Fixed] - Add convert compatible of NSString for bridge message data
Pull Request resolved: https://github.com/facebook/react-native/pull/24630

Differential Revision: D15120205

Pulled By: cpojer

fbshipit-source-id: 4849a8e941410b292f971608a9cdb38c11502445
2019-04-29 06:36:41 -07:00
Estevão Lucas ca9a55e28b Remove `accessibilityTraits` prop (accessibility) (#24643)
Summary:
`accessibilityTraits` and `accessibilityComponentType` were removed on #24344. This PR removes `accessibilityTraits` prop from Fabric as well.

[General] [Removed] - Remove `accessibilityTraits` prop from Fabric.
Pull Request resolved: https://github.com/facebook/react-native/pull/24643

Differential Revision: D15120193

Pulled By: cpojer

fbshipit-source-id: 98440ac447569c26205fc38b93ce2591ccf1a3cf
2019-04-29 03:17:58 -07:00
Marc Mulcahy 1aeac1c625 Additional Accessibility Roles and States (#24095)
Summary:
Assistive technologies use the accessibility role of a component to tell the disabled user what the component is, and provide hints about how to use it. Many important roles do not have analog AccessibilityTraits on iOS. This PR adds many critical roles, such as editabletext, checkbox, menu, and switch to name a few.

Accessibility states are used to convey the current state of a component. This PR adds several critical states such as checked, unchecked, on and off.

[general] [change] - Adds critical accessibility roles and states.
Pull Request resolved: https://github.com/facebook/react-native/pull/24095

Differential Revision: D15079245

Pulled By: cpojer

fbshipit-source-id: 941b30eb8f5d565597e5ea3a04687d9809cbe372
2019-04-25 06:13:07 -07:00
Spencer Ahrens c87de765f6 don't throttle below 16ms
Summary: For some reason the scroll events are sometimes generated with highly irregular spacing, some coming less than a millisecond apart. For interactions that must track scrolling exactly, this can cause them to glitch. With a scroll throttle of less than 17 ms, the intention is clear that the UI should be updated in sync with the scroll view so we shouldn't drop any events.

Reviewed By: PeteTheHeat

Differential Revision: D15068841

fbshipit-source-id: 730e7cb29cc3ddae66f37cf7392e02e0cc9d7844
2019-04-24 17:04:58 -07:00
zhongwuzw e9adbb58ba Adding nonnull macro to component event (#24523)
Summary:
We don't accept any nil parameters, so let compiler check it~

cc. janicduplessis cpojer

[iOS] [Fixed] - Adding nonnull macro to component event
Pull Request resolved: https://github.com/facebook/react-native/pull/24523

Differential Revision: D15022399

Pulled By: shergin

fbshipit-source-id: 8165d49c62d69404aac7ea0ba4291e397d962617
2019-04-24 08:16:01 -07:00
Ram N a6fb3d3a35 Check for image in local assets also in sync image calls
Reviewed By: PeteTheHeat

Differential Revision: D14660673

fbshipit-source-id: 7ed58331b5c61777dc084fa2cf9a460761d723c2
2019-04-23 19:09:06 -07:00
Mehdi Mulani 2c0af4b317 Add react_recursiveDescription to UIView and debugging to RCTScrollView
Summary:
@public
RCTScrollView sometimes asserts with another contentView set. While this doesn't crash, it'd be good to know what's causing the assert. This will add a recursive description of the contentView.

Changelog: [iOS] [Changed] RCTScrollView: added debugging to help fix assert

Reviewed By: PeteTheHeat

Differential Revision: D15049869

fbshipit-source-id: 5431de7764881922327c6c0a3bdd392668396b58
2019-04-23 14:58:19 -07:00
David Aurelio 54af7fc645 `YGStyle`: wrap all fields into accessors
Summary:
@public

In order to encapsulate property access on `YGStyle`, as a first measure we wrap all fields with accessors.

This will e.g. enable dynamic property storage and instrumentation in the future.

All accessors have a `const` version that allows direct access via `const&`. For mutation, bit fields are wrapped with a custom reference object.

This style allows for the least amount of changes in client code. Property access simply needs appended parens, eg `style.direction` becomes `style.direction`.

Reviewed By: shergin

Differential Revision: D14999096

fbshipit-source-id: fbf29f7ddab520513d4618f5e70094c4f6330b30
2019-04-23 08:12:35 -07:00
Christopher Hogan fedfabcecb facebook 59.0 merge- with conflicts 2019-04-22 10:37:26 -07:00
Valentin Shergin b4044e5b1b Fabric: Fixed overlapping border radii
Summary:
UAs must adjust border radius values to fit a content box:
>>> Corner curves must not overlap: When the sum of any two adjacent border radii exceeds the size of the border box, UAs must proportionally reduce the used values of all border radii until none of them overlap.

This diff implements that.

Reviewed By: mdvacca

Differential Revision: D15028325

fbshipit-source-id: 368232ffa2fa0409d13759bbbe7fe10f8474c400
2019-04-22 09:04:54 -07:00
Valentin Shergin 94969edf7c Fabric: Say hello to `MountingTransactionSynchronizer`
Summary:
ShadowTree commits happen concurrently with limited synchronization that only ensures the correctness of the commit from ShadowTree perspective.
At the same time artifacts of the commit () needs to be delivered (also concurrently) to the proper thread and executed in order (not-concurrently). To achieve this we need some synchronization mechanism on the receiving  (mounting) side. This class implements this process.

Practically, this diff fixes a problem with glitching UI during the very first render of Fabric screen.

Reviewed By: JoshuaGross

Differential Revision: D15021794

fbshipit-source-id: 62982425300c515e92b91e1e660b45455a5446e9
2019-04-20 10:53:16 -07:00
Valentin Shergin af0daaf583 Fabric: Introducing MountingTransaction
Summary:
`MountingTransaction` encapsulates all artifacts of `ShadowTree` commit, particularly list of mutations and meta-data.
We will rely on this heavily in the coming diffs.

Reviewed By: JoshuaGross

Differential Revision: D15021795

fbshipit-source-id: 811da7afd7b929a34a81aa66566193d46bbc34f8
2019-04-20 10:53:16 -07:00
Valentin Shergin 832164169d Fabric: Unification of registration process of `ComponentView`s and `ComponentDescriptor`s
Summary:
Registries, providers, providers of registries, registres of providers. All that can be really confusing, but that represents best the constraints and desires that we have:
* We need to be able to register components on-the-fly (so we need a mechanism that will propagate changes);
* We don't want to register ComponentDescriptors separately from ComponentView classes;
* C++ not always gives us abstractions that we want (e.g. pointers to constructors).

After the change, we can remove the whole Buck target that has a bunch of handwritten boilerplate code.

There is a still room for polish and removing some concepts, types or classes but this diff is already huge.

Reviewed By: JoshuaGross

Differential Revision: D14983906

fbshipit-source-id: ce536ebea0c905059c7a4d644dc25233e2809761
2019-04-17 22:44:20 -07:00
Valentin Shergin 00eab3d6fb Fabric: Introducing ComponentDescriptorProvider
Summary:
ComponentDescriptorProvider represents unified way to create a particular descriptor.
Now all ComponentViews (which support RCTComponentViewProtocol) expose a `ComponentDescriptorProvider` which will allow creating and registering ComponentDescriptor instances for all visual components automatically as a part of ComponentView registration process.
Don't panic, everything is still being as explicit as it always was, no magic involved; we just will have only one registration step instead of two parallel.

That also opens a way to register components on the fly.

Reviewed By: JoshuaGross

Differential Revision: D14963488

fbshipit-source-id: 9e9d9166fabaf7b30b35b8647faa6e3a19cd2435
2019-04-17 22:44:20 -07:00
James Treanor 31850df116 Fix nullability warnings in RCTExceptionsManager (#24467)
Summary:
There are a number of nullability warnings in `RCTExceptionsManager` when building React Native for iOS with Xcode 10.2. This resolves them without changing the existing behavior.

See the warnings here:

![image](https://user-images.githubusercontent.com/1773641/56201323-89551380-6038-11e9-9998-b6a8d3d28f36.png)

[iOS] [Fixed] - Fix nullability warnings in RCTExceptionsManager
Pull Request resolved: https://github.com/facebook/react-native/pull/24467

Differential Revision: D14973485

Pulled By: cpojer

fbshipit-source-id: 2fac9f067ac9418397c3913760a2403f9a2cc147
2019-04-17 08:36:14 -07:00
Valentin Shergin ba199eade5 Fabric: Marking RCTViewComponentView's methods from RCTComponentViewProtocol as `NS_REQUIRES_SUPER`
Summary: If some class or category override/implement one of those methods, it implies that subclasses must call super for them. `NS_REQUIRES_SUPER` allows to enforce this constraint.

Reviewed By: JoshuaGross

Differential Revision: D14896804

fbshipit-source-id: a481f16e1f7ab901d70deb6486f2ca1cf19dd8d7
2019-04-16 07:35:08 -07:00
Valentin Shergin 6392894e59 Fabric: Using `finalizeUpdates:` in RCTViewComponentView
Summary:
Previously we could call `invalidateLayer` twice during a mounting transaction (one for update-props, one for update-layout-metrics), that was sub-optimal.
Now, with `finalizeUpdates:` we can do it only once. That should save us some CPU cycles.

Reviewed By: JoshuaGross

Differential Revision: D14896802

fbshipit-source-id: b6572fb2a4fa48a12b1d1c29144cd7c67f6cff80
2019-04-16 07:35:08 -07:00
Valentin Shergin f4fd1831da Fabric: `RNWrapManagedObject` and `RNUnwrapManagedObject` helpers
Summary: We use this pattern already and seems we use it more. Those two functions introduce a "semantical" wrappers for this context, so now there is no need to think which exact `__bridge ***` qualifier we should use, so it's much less error-prone.

Reviewed By: JoshuaGross

Differential Revision: D14896800

fbshipit-source-id: 85b86bfcefdad5aff0375e7172769df86c001506
2019-04-16 07:35:08 -07:00
Valentin Shergin c79db53a9a Fabric: Introducing `-[RCTComponentViewProtocol finalizeUpdates:]`
Summary:
The new method is being called right after all update methods were called for a particular component view.
It is useful for performing updates that require knowledge of several independent aspects of the compound mounting change (e.g. props *and* layout constraints).

Reviewed By: JoshuaGross

Differential Revision: D14896801

fbshipit-source-id: 485d8c97d81d7a2ad7a7afc209094c328da6ef3c
2019-04-16 07:35:07 -07:00
Valentin Shergin 184cfd5594 Fabric: Bunch of small changes in ContextContainer
Summary:
So, changes:
* Correctness checks only in debug mode (codesize win?);
* `registerInstance` marked as const (because it's thread safe);
* ContextContainer::Shared also enforces constness;
* Using faster better::map;
* Using shared/RW mutex instead of regular one;
* SharedContextContainer got removed.

Reviewed By: sahrens

Differential Revision: D14920284

fbshipit-source-id: f0f8d970e7fae79a1abe3bc32827db9fd2d17e13
2019-04-16 07:35:07 -07:00
Taylor123 faaa92bb04 disable momentum scrolling for horizontal ScrollView (#24045)
Summary:
Would like feedback from the community as this may not be the best solution for all

I would like to restrict (or paginate) the fling of a horizontal ScrollView when `snapToInterval` is set. This is not currently possible with `pagingEnabled`, since the pagination works only when items are the entire width of the ScrollView.

This implementation simply restricts the predicted `targetOffset` found from the `x` velocity and replaces it with the offset when the pan gesture ended.

To get pagination working, I may paginate based on the interval by calculating the offset delta from the beginning of the gesture to current offset and restricting the scrolling behavior to the `snapToInterval`. If this is preferred, I can update this PR or make a new one, but wanted to start a discussion since it seems like there are many in the community that would like this feature  #21302 .

[General] [Added] - add prop `disableIntervalMomentum` to disable the predictive scrolling behavior of horizontal ScrollViews
Pull Request resolved: https://github.com/facebook/react-native/pull/24045

Differential Revision: D14939754

Pulled By: sahrens

fbshipit-source-id: 26be19c47dfb8eed4d7e6035df53a77451e23081
2019-04-15 14:40:44 -07:00
Kevin Gozali 642fafffd8 RNTester: Support RCTCxxBridgeDelegate
Summary: This is to prepare for custom JS runtime binding installation. Note: AppDelegate needs to become .mm

Reviewed By: cpojer

Differential Revision: D14932538

fbshipit-source-id: 30f32223cc405d0cace9e3076b5a2a1d8cc9e3b2
2019-04-15 12:25:47 -07:00
Estevão Lucas f70e58f355 - remove accessibilityComponentType and accessibilityTraits props (a11y) (#24344)
Summary:
Closes: https://github.com/facebook/react-native/issues/24016

React Native 0.57 introduced cross-platform `accessibilityRole` and `accessibilityStates` props in order to replace `accessibilityComponentType` (for android) and `accessibilityTraits` (for iOS). With #24095 `accessibilityRole` and `accessibilityStates` will increase, receiving more options, which seems to be a good moment to remove deprecated props.

Remove deprecated `accessibilityComponentType` and `accessibilityTraits` props.

[General] [Removed] - Remove accessibilityComponentType and accessibilityTraits props
Pull Request resolved: https://github.com/facebook/react-native/pull/24344

Reviewed By: rickhanlonii

Differential Revision: D14842214

Pulled By: cpojer

fbshipit-source-id: 279945e503d8a23bfee7a49d42f5db490c5f6069
2019-04-15 10:53:50 -07:00
Lucas Bento 3273d23a26 Specify correct terminal to start the packager (#24436)
Summary:
This PR specifies the correct terminal to start the Metro bundler as stated in https://github.com/react-native-community/cli/issues/303.

[iOS] [Changed] - Start the packager on the correct terminal.
Pull Request resolved: https://github.com/facebook/react-native/pull/24436

Differential Revision: D14932703

Pulled By: cpojer

fbshipit-source-id: 4c9b5a380ff4f4767acbeb6872e11e03df5b160c
2019-04-15 02:14:38 -07:00
Valentin Shergin 792585fd48 Fabric: ContextContainer was moved to `utils` module
Summary: That allows avoiding circular deps and unnecessary deps on uimanager module.

Reviewed By: PeteTheHeat

Differential Revision: D14917227

fbshipit-source-id: fe7962ee528aa659d8bd23e3e46627722551d995
2019-04-12 15:14:48 -07:00
Spencer Ahrens b1f1c5375c avoid startup deadlock with dispatch_async's
Summary:
There are cases where native modules will try to reference other native modules during startup, which can causes a deadlock on `RCTModuleData::_instanceLock`.

My system was in a state where the deadlock would repro 100% so I could actually debug it a bit, but really this whole system is very fragile and needs to die in a fire.

I tried a recursive lock and it was not sufficient - there are definitely issues with multiple threads invoking at the same time and then calling `RCTUnsafeExecuteOnMainQueueSync`...

Reviewed By: fkgozali

Differential Revision: D14863583

fbshipit-source-id: 8c0d062353595a4ed3871aa9135950bc57983907
2019-04-12 12:25:10 -07:00
Valentin Shergin 00243c580f Fabric: Farewell MountItem classes
Summary:
This diff replaces all MountItem classes with a bunch of static C functions that do the same job as classes did.
Seems, originally we overestimated the complexity of MountItem classes and that they ended up being notably trivial. Now, maintaining that even longer would mean paying for abstractions and allocations that we don't really need and writing a lot of tedious code.
Besides that, the one particular change that will be introduced in the coming diffs is not particularly fit very well in the existing class-based model.

This change also should save us many hundreds of allocations and atomic counters bumps, so maybe we can get a millisecond-or-two win.

This diff does not introduce any practical behavioral/logical changes in the mounting layer.

Reviewed By: mdvacca

Differential Revision: D14893764

fbshipit-source-id: 6f1247923ae36f29c12a7d358e2d496cf6c3e298
2019-04-12 09:32:55 -07:00
Héctor Ramos 335c39c895 Back out OSS-only change from D14811733 and fix regression in open source iOS tests
Summary: The changes made in D14811733 introduced a regression in React Native's open source iOS tests.

Reviewed By: fkgozali

Differential Revision: D14895096

fbshipit-source-id: 4307b094e3bc94e9f703b0271a95a9b318bcd49a
2019-04-11 12:57:15 -07:00
zhongwuzw 1da1e8c6f3 Enhance search of directories when load local asset image (#23857)
Summary:
Currently, `RCTLocalAssetImageLoader` only support directory of `Library` and `App bundle`, actually, we need to support other directories like `tmp` or `Documents`. Otherwise, the local image load in `tmp` or `Documents` would be handled by `NSURLSession`, we don't need that.

<img width="405" alt="image" src="https://user-images.githubusercontent.com/5061845/54188126-0ba66100-44ea-11e9-9a7b-0f721100e9be.png">

[iOS] [Fixed] - Enhance search of directories when load local asset image
Pull Request resolved: https://github.com/facebook/react-native/pull/23857

Differential Revision: D14894136

Pulled By: shergin

fbshipit-source-id: 26361cd952a423467be9af9a84a80100d868776b
2019-04-11 11:43:06 -07:00
Ryan Donnelly 33b55cccca Calculate Correct Window Dimensions for iOS (#19932)
Summary:
Fixes: #16152

[iOS] [Fixed] - Pass back correct dimensions for application window in Dimensions module
Pull Request resolved: https://github.com/facebook/react-native/pull/19932

Reviewed By: cpojer

Differential Revision: D14312906

Pulled By: PeteTheHeat

fbshipit-source-id: aacb729c89862267465eefc3534c48d9d4b5d746
2019-04-10 14:25:14 -07:00
Kevin Gozali 417adf526f Fabric iOS: allow using fallback component for unsupported ones
Summary:
This allows an unsupported component to be rendered as a "unimplemented view" for better visualization of which component is missing. It is off by default, but configurable in the component factory.

For now, the layout simply follows regular <View />, which means the width/height etc is based on the react component styling. The side effect is that components with 0 height/width won't show up at all.

Reviewed By: mdvacca

Differential Revision: D14869656

fbshipit-source-id: f31e012fb7dc1c64fcc431ea5aa45079a23a618e
2019-04-10 11:04:23 -07:00
Kevin Gozali 6aa896896f Fabric iOS: ask the bridge to queue async callback for the RuntimeExecutor
Summary:
In the case where the first rootView we load enables Fabric, the UIManagerBinding ended up calling AppRegistry (JS) too early, before the bridge was fully ready. This means AppRegistry wasn't set up yet, causing redbox.

To fix this, RuntimeExecutor impl should ask the bridge to queue the callback instead of asking the MessageQueueThread directly. MessageQueueThread only works well IFF the bridge is alive, but it has no knowledge about whether the bridge is alive or not. To support this, we add `invokeAsync` impl to the RCTCxxBridge.

Reviewed By: JoshuaGross

Differential Revision: D14868547

fbshipit-source-id: 3b3f2b9150e930b4a2c71012242305241fc6dbed
2019-04-10 11:04:23 -07:00
acoates-ms 8fec294664
Remove a bunch of jsc files that should have been removed with 58 (#44)
* Remove a bunch of jsc files that should have been removed with 58

* more build fix

* Put back JSI JSCRuntime build switch

* Put back jni changes

* fix build

* Remove unneeded build logic
2019-04-10 10:38:16 -07:00
Gunnar Kudrjavets 0c0aff295b Wipe out -DRCTLOG_ENABLED=0
Summary:
The root cause comes down to the fact that historically `-DFOO=0` and `-DFOO=1` patterns have been used when it comes to preprocessor definitions and various engineers use `#ifdef FOO` and `#if FOO` interchangeably. That results in an incorrect pattern because the real evaluation is following:

- `FOO` not defined:  `#if FOO` = `FALSE`, `#ifdef FOO` = `FALSE`.
- `-DFOO=0`: `#if FOO` = `FALSE`, `#ifdef FOO` = `TRUE`.
- `-DFOO=1`: `#if FOO` = `TRUE`, `#ifdef FOO` = `TRUE`.

Reviewed By: aditya7fb

Differential Revision: D14811733

fbshipit-source-id: a7fedc56ab0ce8eedcb48bda783739a4c1eecf81
2019-04-09 20:08:14 -07:00
Will Holen 094f221a0c Move JSI source files into a separate directory
Summary: This will simplify updating the JSI API from upstream in the future.

Reviewed By: mhorowitz

Differential Revision: D14762674

fbshipit-source-id: fa4a86f08425943e301da4ef3df9893ebaa1493e
2019-04-09 11:44:32 -07:00
Spencer Ahrens 7b59c5a47e More iOS animation fixes
Summary:
Main change is to the property diffing - we now use the last known props set on the view rather than the default props to compute the diff. This requires exposing a `getProps` method on all view components which should be fine I think.

I also realized that in more complex animations with multiple nodes, the node that the animation starts on might not be connected to a view, so we don't know if it's fabric just based on that, so we have to do a recursive search through the children to find if there are any that are associated with a fabric view to decide we should start the animation immediately. Unfortunately there can still be a timing gap here since the animated API is async and the uimanager API is sync - I'll need to change the animated API to be sync to completely fix this.

Reviewed By: shergin

Differential Revision: D14732028

fbshipit-source-id: 882c056b0b63aa576f8e42439be405cf7fb3147a
2019-04-08 09:15:14 -07:00
acoates-ms ed4b234db6
Cleanup dead files from cmake script (#39) 2019-04-06 14:46:39 -07:00
Christoph Nakazawa 6ca438a7f4 Move iOS WebView files to FB internal
Summary: This moves the iOS WebView files to be fb internal which completes the removal of WebView from React Native open source as part of the Lean Core effort.

Reviewed By: TheSavior

Differential Revision: D14630076

fbshipit-source-id: 7bc11d6c1470bb748c823c86cbb8b5ee94b508ff
2019-04-04 15:46:00 -07:00
Tom Underhill a50d2476b6
Prevent race where devSettings property is called before bridge is do… (#35)
* Prevent race where devSettings property is called before bridge is done initializing and can cause a second bridge to be created.

* Changed klass to devSettingsClass
2019-04-03 17:14:18 -07:00
Craig_Martin 6f4239b37c Add scrollToOverflowEnabled prop to ScrollView (#24296)
Summary:
ScrollView's scrollTo behavior on iOS was recently changed to limit the offset to the content size plus any content inset (see #23427). This departure from the old behavior created UI issues for anyone that is using the over-scroll ability for the purpose of positioning elements at specific coordinates on the screen. Examples include using this behavior to position TextInputs above the virtual keyboard programmatically when focused or moving drop down elements positioned near the bottom of the content toward the top of the screen when selected to show a larger absolutely positioned item list. Default behavior does not change and this is an "opt-in" type of prop to re-enable the old behavior.

[iOS] [Added] - Added scrollToOverflowEnabled prop to ScrollView
Pull Request resolved: https://github.com/facebook/react-native/pull/24296

Differential Revision: D14762619

Pulled By: cpojer

fbshipit-source-id: d2a552b5cb321d52e8ea4116327bf9ec647a3aae
2019-04-03 16:21:08 -07:00
Nurzhan Bakibayev f00d1b8518 Change default Inspector Proxy port to 8081
Summary: Change default Inspector Proxy port to 8081

Reviewed By: cwdick

Differential Revision: D14745974

fbshipit-source-id: f4b3b158f55c6f5f1b3d9cc2528c5ddb59774a8b
2019-04-03 08:39:08 -07:00
Kevin Gozali 71a8944b39 TM iOS: Use weak_ptr to pass around Instance to avoid unreleased refs
Summary:
There is a timing issue when reloading the bridge (in dev mode) and the tear down of the TurboModules. This causes `Instance` to never get freed, hence the "bridge" isn't cleaning up properly. The side effect can be bogus error saying that it's unable to find a module.

To address this, JSCallInvoker should just take in weak_ptr<Instance>.

Reviewed By: RSNara

Differential Revision: D14739181

fbshipit-source-id: f9f2a55486debaeb28d3d293df3cf1d3f6b9a031
2019-04-02 18:11:18 -07:00
Christopher Hogan 5851151d09 update imports to get tvOS building 2019-04-01 17:06:47 -07:00
Joshua Gross 1b51cd488a Fix retain cycle in RCTDevMenu
Summary: A retain-cycle regression was added by D14162776 and detected here: T41208740. Fix should be trivial.

Reviewed By: shergin

Differential Revision: D14709784

fbshipit-source-id: bad6ab31a5170e9320c4432cbd20d02ec6164f38
2019-04-01 13:45:09 -07:00
Junhui Park fe9d21f6fa Fix setting the contentOffset value when refresh ends (#24191)
Summary:
It closes #24170.
I opened the issue yesterday, and I think I found the way how to resolve it. So, I'm opening this PR directly without any comment on the issue.

In the `endRefreshProgrammatically` of `RCTRefreshControl.m`, the comment says that " The contentOffset of the scrollview MUST be greater than 0". However, if the `contentInset` prop is set for the `FlatList`, I think `contentOffset` can be a negative value after refreshing and should be greater than `-contentInset.top`.

As I reported the bug in that issue, If I am using `contentInset` prop to the `FlatList`, making `contentOffset` value be always 0 when refreshing ends causes something wrong situation.

[iOS] [Fixed] - Fix setting the contnetOffset when refreshing ends
Pull Request resolved: https://github.com/facebook/react-native/pull/24191

Differential Revision: D14710987

Pulled By: sahrens

fbshipit-source-id: 03f06df9a93a2a46a7cc0b56269091778805917e
2019-04-01 12:54:36 -07:00