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

15140 Коммитов

Автор SHA1 Сообщение Дата
David Vacca 10ce6c3e11 Refactor types used during yoga meassure calls
Summary: This diff refactors the types used when Yoga requires to measure the size of a View in C++

Reviewed By: shergin

Differential Revision: D13124086

fbshipit-source-id: 89dfe80bb41b4fb2eaba84af630d52ef2509b1e1
2018-11-25 17:20:59 -08:00
David Vacca 0357d0de64 Ensure thread safety in the exeuction of RuntimeExecutor
Summary: This diff ensures thread safety for operations invoked by the runtime executor

Reviewed By: shergin

Differential Revision: D13136340

fbshipit-source-id: 119092dff29b37f39d4bcdcc34f1c34d638b7e07
2018-11-25 17:20:59 -08:00
David Aurelio f2894e58cf Data types for marker API
Summary:
@public

Adds types for a marker API in Yoga.

This will allow us to register callbacks that Yoga can use to log performance data without hard-coding the backend system for that.

Reviewed By: SidharthGuglani

Differential Revision: D13118830

fbshipit-source-id: b42a42c609f0cf66212186f7f20ee572522d59e3
2018-11-24 16:26:30 -08:00
Le Xu c3dea894bd Back out "[react-native][PR] [flow-strict] Flow strict StatusBar"
Summary:
Original commit changeset: 27f69c6df3a8

This reverts D13103971

Differential Revision: D13185679

fbshipit-source-id: 0de9da31bd75786c7978e2c3860486ac37420342
2018-11-23 12:15:28 -08:00
Nick Novitski 4514041b44 - Resolve two gradle deprecation warnings (#22360)
Summary:
> Configure project :ReactAndroid
> The Task.leftShift(Closure) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

> Task :ReactAndroid:buildReactNdkLib
> A problem was found with the configuration of task ':ReactAndroid:buildReactNdkLib'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
> - File '[...]/react-native/ReactAndroid/src/main/jni/react' specified for property '$1' is not a file.
Pull Request resolved: https://github.com/facebook/react-native/pull/22360

Differential Revision: D13176269

Pulled By: hramos

fbshipit-source-id: cf6d498049b955d3920d356f2d68f3bc43008c56
2018-11-22 18:36:59 -08:00
Rafael Oleza 3355c52467 Bump metro version in React Native
Summary: This is the tweak on the release process of metro: after publishing D13075199 and releasing a new version of Metro, this diff upgrades it in RN along with its yarn.lock file. This should allow us to publish new versions of metro without breaking the RN sanity scripts (or disable them).

Reviewed By: hramos

Differential Revision: D13084224

fbshipit-source-id: 19781ae142db11d7dd8b6ca4303366f7ccb32dcc
2018-11-22 12:27:10 -08:00
Rafael Oleza 98546e9b19 Use real flow types from metro
Summary: Stop ignoring `metro` folder from RN and use their flowtypes correctly

Reviewed By: hramos

Differential Revision: D13085169

fbshipit-source-id: f285223afb7e89ac2c63e53d36be2f3645fa6761
2018-11-22 12:27:10 -08:00
David Aurelio 8f283b93ea `YGNodeComputeFlexBasisForChildren`: remove output param
Summary:
@public

`YGNodeComputeFlexBasisForChildren` was using an output parameter (`float&`) that is always initialised to `0.0f`.
Here, we move the initialisation inside `YGNodeComputeFlexBasisForChildren`, and simply return the result.

Reviewed By: astreet

Differential Revision: D13167509

fbshipit-source-id: cbea20e2deb82ec75a1c158b16c94f4a3e5e4c99
2018-11-22 08:08:47 -08:00
David Aurelio c34ad17c94 Pass enums by value
Summary:
@public

passes all enum values by value, not by reference.

Reviewed By: astreet

Differential Revision: D13156390

fbshipit-source-id: 56aea66c16ab3325594f67b9017afa18a678d281
2018-11-22 08:08:47 -08:00
David Aurelio 64d162e7c6 Dealloc JNI implementation experiment
Summary:
@public

Remove ability to configure Yoga to run with/without JNI fast calls on dalvik / art.
This switches to always run with fast calls.

Reviewed By: astreet

Differential Revision: D13144652

fbshipit-source-id: 091aab0cd1290d46346323d3e26a11dd0bb17187
2018-11-22 04:01:21 -08:00
David Aurelio f8ff6bd4e8 Pass primitives by value
Summary:
@public

Passes all `float`, `bool`, etc. by value, not by reference.

Reviewed By: astreet

Differential Revision: D13153500

fbshipit-source-id: 95529bc2efcff144044e2c25087915b2b7ede179
2018-11-22 03:50:30 -08:00
Amir Shalem 3337a1db55 Add getUndefined() method to obtain the undefined value
Summary:
Add getUndefined() method to obtain the undefined value.
This would allow to obtain the Yoga undefined value in runtime, and not just in compile time

Reviewed By: davidaurelio

Differential Revision: D13136972

fbshipit-source-id: aa198aa1ea65bb6b7302abeba6f9f5d483a45ff3
2018-11-22 02:35:36 -08:00
Valentin Shergin ecc7012179 Fabric: Fixed `AttributedString::operator==`
Summary: Trivial and shameful erratum.

Reviewed By: mdvacca

Differential Revision: D13166689

fbshipit-source-id: 75128299502bbc9ff5458c4381e7833aa451dd04
2018-11-22 00:54:03 -08:00
Radovan Šmitala 02a3517d0b Fix allocating Buffer in early commit (#22379)
Summary:
Commit d9c2cdae41 brings compatibility with Node 10, but replaced allocating buffer incorrectly.
dulmandakh made two comments and shows how to do it based on NodeJS documentation https://nodejs.org/api/buffer.html#buffer_new_buffer_size

This PR just fixes that commit.
Pull Request resolved: https://github.com/facebook/react-native/pull/22379

Differential Revision: D13166867

Pulled By: hramos

fbshipit-source-id: 207528739889c044021a4b97ef94c33d56de3e89
2018-11-22 00:50:03 -08:00
Kudo Chien 0a293a014b Fix ReactAndroid build break. (#22377)
Summary:
During C++ build, we need the libjsc.so.
  But arm64-v8a and x86_64 libjsc.so are in different path and this error raised:

    Android NDK: ERROR:/home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/Android.mk:jsc: LOCAL_SRC_FILES points to a missing file
    /opt/ndk/android-ndk-r17c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
    Android NDK: Check that /home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/arm64-v8a/libjsc.so exists  or that its path is correct

  The commit moves prebuilt libjsc.so into
  ReactAndroid/src/main/jni/third-party/jsc/jni and let ndkbuild script find the prebuilt libjsc.so.
  For AAR packaging, modify the jniLibs so that gradle android library plugin could find the prebuilt libjsc.so as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/22377

Differential Revision: D13166556

Pulled By: hramos

fbshipit-source-id: 61daaede7defbc66491a3e2f20058e7d248ba13e
2018-11-21 21:34:36 -08:00
Valentin Shergin 9c961331dd Fabric: `ParagraphShadowNode::updateLocalDataIfNeeded()`
Summary: Now we don't update `LocalData` for `ParagraphShadowNode` if the attributed string hasn't changed.

Reviewed By: mdvacca

Differential Revision: D13160128

fbshipit-source-id: 6ffe76ad187452fa37ba36a132b885cbcedfd1d3
2018-11-21 17:16:49 -08:00
Valentin Shergin 7e57755cea Fabric: `UIManager::getRelativeLayoutMetrics`
Summary: This method is underlying infra for all `measure`-like methods exposed to JavaScript.

Reviewed By: mdvacca

Differential Revision: D13036553

fbshipit-source-id: cb5135f1db97ec8144b31a24ee4fb9f5d61f0df1
2018-11-21 17:16:48 -08:00
Valentin Shergin f8be867cd8 Fabric: Sharing a pointer to ShadowTreeRegister with UIManager
Summary: The diff adds a pointer to ShadowTreeRegistry to UIManager which enables the possibility of implementing ShadowTree mutating and inspecting methods like `setNativeProps` and `getRelativeLayoutMetrics`.

Reviewed By: mdvacca

Differential Revision: D13036549

fbshipit-source-id: 5ed1252d84c8dd895fe0e6e8cc71afbaa9dab4b7
2018-11-21 17:16:48 -08:00
Valentin Shergin b4fa1fa0c6 Fabric: Introducing ShadowTreeRegistry
Summary:
Why do we need a dedicated registry class?
* We need to simplify registry-related logic in Scheduler.
* We need to couple threading aspect of the registry with the registry itself, otherwise it's not clear why exactly we acquire the mutex. We also should not acquire the mutex in a per-method way (as we did before), because it's incorrect and misleading (only lines that access the registry should by protected).
* We need to have a way to share the registry with other classes (e.g. UIManager) without passing a reference to the whole Scheduler.

Reviewed By: mdvacca

Differential Revision: D13036550

fbshipit-source-id: 644da910e823666c586834a3da2b4cdcb90eebb2
2018-11-21 17:16:48 -08:00
Valentin Shergin 71208f05f4 Fabric: Getting rid of leftovers in Scheduler
Summary: Trivial. Those are not used.

Reviewed By: fkgozali

Differential Revision: D13017883

fbshipit-source-id: cf285e537eb85c8fca6852f7c03a5ef661b85757
2018-11-21 17:16:48 -08:00
Valentin Shergin 9eec2c33e6 Fabric: LayoutableShadowNode::getRelativeLayoutMetrics()
Summary:
The generic method that returns relative (to some specified node) layout metrics.
We need this as a building block to implement `UIManager.measure*()` methods family.

Reviewed By: mdvacca

Differential Revision: D12932549

fbshipit-source-id: 79064551d32b0cd40e72dc87d0ed194e3779ba29
2018-11-21 17:16:48 -08:00
Valentin Shergin 3ecf4eaccb Fabric: ShadowNode::backtrackAncestors(...)
Summary:
We have to have a way to backtrack a pointer to a parent node and this is generalized version of that.
This is the first naive implementations of the algorithm. We will invest in optimizing this later.

Reviewed By: mdvacca

Differential Revision: D12920856

fbshipit-source-id: 9facb4e16a0b5608feb6747df3804952025ef093
2018-11-21 17:16:48 -08:00
Lee Howes 1f32b5d1da then to thenValue changes to allow deletion of value-taking continuation form of then
Summary: Future::then taking a value-taking function is deprecated and being deleted. This cleans up a few more callsites.

Reviewed By: yfeldblum, shergin

Differential Revision: D13163277

fbshipit-source-id: 98d1f78c5b34ca34603cc24d79157a4718573576
2018-11-21 17:12:19 -08:00
mottox2 3649a503cf Flow TouchableNativeFeedback.android.js (#22176)
Summary:
Related to #22100

Turn Flow strict mode on for Libraries/Components/Touchable/TouchableNativeFeedback.android.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/22176

Reviewed By: TheSavior

Differential Revision: D13033239

Pulled By: RSNara

fbshipit-source-id: 57e89ce16040e6238e01e0437327db943a5f2581
2018-11-21 14:45:15 -08:00
Yu Watanabe 6fa997dd63 Flow strict StatusBar (#22282)
Summary:
Related to #22100

`Libraries/Components/StatusBar/StatusBar.js`
Enhance StatusBar with mergePropsStack and _defaultProps.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][StatusBar.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22282

Reviewed By: TheSavior

Differential Revision: D13103971

Pulled By: RSNara

fbshipit-source-id: 27f69c6df3a8a7792fcd595c0ff362943ccab8ca
2018-11-21 14:42:09 -08:00
Tnarita0000 c127000a7d Flow strict-local in TimePickerAndroid.android.js (#22188)
Summary:
Related to #22100 . I had this issue before(#22154 & #22172).

Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22188

Reviewed By: TheSavior

Differential Revision: D12972356

Pulled By: RSNara

fbshipit-source-id: 838604a791dfdc86bacf8b49f6c399920a3f57bc
2018-11-21 14:42:09 -08:00
Yosuke Saito fb4825a2c6 Flow strict ScrollResponder (#22181)
Summary:
Related to #22100

Enhance Flow types for Libraries/Components/ScrollResponder.js
Pull Request resolved: https://github.com/facebook/react-native/pull/22181

Reviewed By: TheSavior

Differential Revision: D13032699

Pulled By: RSNara

fbshipit-source-id: ca0ce178a96008a71016d033ee1154ad807d6599
2018-11-21 14:42:09 -08:00
Thomas BARRAS a97d104b44 Flow strict TouchableHighlight (#22173)
Summary:
Related to #22100

Enhance Flow types for TouchableOpacity specifying underlay functions and TvParallaxPropertiesType.
I had to export and enhance TvParallaxPropertiesType from TVViewPropTypes file. This does not break this other PR also using this exported type. #22146

There is still some work to do in order to turn flow to strict mode.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableHighlight.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export and enhance type
Pull Request resolved: https://github.com/facebook/react-native/pull/22173

Differential Revision: D13033441

Pulled By: RSNara

fbshipit-source-id: 26a38970923dc7e6c02c03da5d08483a3f1fbd36
2018-11-21 14:36:33 -08:00
gengjiawen f22473e9e9 Fix jsc regression.Fixes #22274 (#22293)
Summary:
My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295.
Kudo plz review.

![image](https://user-images.githubusercontent.com/3759816/48561684-758f6f00-e92b-11e8-905b-e394f72349f7.png)
Pull Request resolved: https://github.com/facebook/react-native/pull/22293

Differential Revision: D13153931

Pulled By: hramos

fbshipit-source-id: 8a6efa0cd8abbff359f082d5ea7713933b6e7ac6
2018-11-21 14:36:33 -08:00
Ramanpreet Nara da0b139b56 Improve Flow types
Summary:
Some of the flow types were incomplete. So, I referenced the code in  `~/fbsource/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/textinput/` and in `~/fbsource/xplat/js/react-native-github/Libraries/Text/TextInput/` to make the flow types more specific.

I also fixed internal breakages. To avoid having to sprinkle `$FlowFixMe`s everywhere, I had to refactor some types, and some code.

Reviewed By: TheSavior

Differential Revision: D13121871

fbshipit-source-id: 9796aafc861544baf52d7ade823ab1be2d3f12d1
2018-11-21 14:33:48 -08:00
Thomas BARRAS 35a65cd704 Flow strict TextInput (#22250)
Summary:
Related to #22100

Enhance TextInput with callback event types.
This is a first draft and I will need more help on this one. Flow checks are successful now but I am not sure types are accurate though.
Moreover I find my separation approach kind of dirty for callback event types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextInput.js] - Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.android.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.ios.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [XHRExampleFetch.js] - Fixing Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22250

Reviewed By: TheSavior

Differential Revision: D13104820

Pulled By: RSNara

fbshipit-source-id: 3fbb98d0ec2b62be676f71ae1053933d9c78485e
2018-11-21 14:33:48 -08:00
Thomas BARRAS 79274979b7 Flow strict TextProps (#22122)
Summary:
Related to #22100

Turn on Flow strict mode for TextProps.
I used ResponseHandlers type definition defined in Text.js.

I wanted to move ResponseHandlers type to TextProps and reuse it inside the file.
I know I could use $Shape<> to maybe keys but how do I elegantly maybe every values ?
Unless having a straightforward solution, I found it clearer to copy paste these types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextProps.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22122

Reviewed By: TheSavior

Differential Revision: D13055759

Pulled By: RSNara

fbshipit-source-id: 230b43c7c94d7f82f5727ad11541b0cb98bc5e3a
2018-11-21 14:27:25 -08:00
Thomas BARRAS 45c51835d6 Flow strict TouchableBounce (#22197)
Summary:
Related to #22100

Enhance TouchableBounce with press event types, callback and hitslop types.

There is still some work to do in order to turn flow to strict mode. (requireNativeComponent and render function)

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableBounce.js] - Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22197

Reviewed By: TheSavior

Differential Revision: D13032452

Pulled By: RSNara

fbshipit-source-id: b21140722ce924698aa15323602e2e3fc663dbb6
2018-11-21 14:24:55 -08:00
Kevin Gozali aad83cc238 iOS TM: RCTEnableJSINativeModule => RCTEnableTurboModule
Summary: Leftover name change from previous codemod.

Reviewed By: shergin

Differential Revision: D13117615

fbshipit-source-id: 2584a2a90d3db6ed9a9e9cb8727c51da34f0927c
2018-11-20 01:20:59 -08:00
Adam Comella 70826dbafc iOS: Support inline view truncation (#21456)
Summary:
If text is truncated and an inline view appears after the truncation point, the user should not see the inline view. Instead, we have a bug such that the inline view is always visible at the end of the visible text.

This commit fixes this by marking the inline view as hidden if it appears after the truncation point.

This appears to be a regression. React Native used to have logic similar to what this commit is adding: 1e2a924ba6/Libraries/Text/RCTShadowText.m (L186-L192)

**Before fix**

Inline view (blue square) is visible even though it appears after the truncation point:

![image](https://user-images.githubusercontent.com/199935/46382038-d3a71200-c65d-11e8-8179-2ce4aad8d010.png)

The full text being rendered was:

```
<Text numberOfLines={1}>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna
  <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</Text>
```

**After fix**

Inline view is properly truncated:

![image](https://user-images.githubusercontent.com/199935/46382067-fdf8cf80-c65d-11e8-84ea-e2b71c229dae.png)

**Test Plan**

Tested that the inline view is hidden if it appears after the truncation point when `numberOfLines` is 1 and 2. Similarly, verified that the inline view is visible if it appears before the truncation point.

**Release Notes**

[IOS] [BUGFIX] [Text] - Fix case where inline view is visible even though it should have been truncated

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21456

Differential Revision: D10182991

Pulled By: shergin

fbshipit-source-id: a5bddddb1bb8672b61d4feaa04013a92c8224155
2018-11-20 00:11:56 -08:00
gazoudoudou 27cfba2882 Remove useless additionnal blur call (#22156)
Summary:
I noticed that the _onBlur method was not exactly similar to the _onFocus one in the TextInput component.

After digging, I found that the blurTextInput method in the TextInputState.js file was call twice in a raw instead of once when the textinput component should blur.

By removing this line, I fix this unecessary multiple call.
Pull Request resolved: https://github.com/facebook/react-native/pull/22156

Reviewed By: TheSavior

Differential Revision: D13105396

Pulled By: RSNara

fbshipit-source-id: 8e83461d8b288d8ee4047bc4a33c4480e193c349
2018-11-19 18:53:56 -08:00
Victor Calvello 55994f5900 Replace global.alert use to fix eslint warnings (#22184)
Summary:
Replaces `alert` with `Alert.alert` to fix eslint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22184

Reviewed By: TheSavior

Differential Revision: D13105636

Pulled By: RSNara

fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
2018-11-19 18:10:33 -08:00
Karan Thakkar 1fa56a0ac4 Rename requiresMainThreadSetup -> requiresMainQueueSetup in code comment (#22328)
Summary:
Update reference to property in code comment in `RCTBridgeModule`. There is no such thing as `requiresMainThreadSetup` in the codebase. Its called `requiresMainQueueSetup` now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22328

Differential Revision: D13115352

Pulled By: shergin

fbshipit-source-id: 511d627388b51029821c4b1ddf4caac30e573040
2018-11-17 21:43:07 -08:00
Valentin Shergin 346c9d5f2c Surface: Using screen size as a default maximum size of Fabric Surface
Summary: That's a temporary change that useful only while we don't have deeper/proper intergration with UIKit's navigation infra.

Reviewed By: mdvacca

Differential Revision: D13104172

fbshipit-source-id: 024e71e04470d56d2c5e9b3f6c3392555ce50b63
2018-11-17 11:43:25 -08:00
empyrical bea3bb6956 DrawerLayoutAndroid: Convert to ES6 class (#21980)
Summary:
This pull requests converts `DrawerLayoutAndroid` from a `createReactClass`-based component to an ES6 class component, removing its use of `NativeMethodsMixin` and `prop-types` in the process.

Unfortunately this couldn't be moved over to a full `forwardRef` to the native component, because it has the methods `openDrawer` and `closeDrawer` as part of its API, and they can't be called directly on the native component. A `createRef`-based ref to the native component can be accessed from the `nativeRef` property of a `DrawerLayoutAndroid` instance if a native ref is needed.

The Flow types for callbacks have also been filled out.
Pull Request resolved: https://github.com/facebook/react-native/pull/21980

Reviewed By: TheSavior

Differential Revision: D12901951

Pulled By: RSNara

fbshipit-source-id: d35fa5f11b1059f49b466b52abeec902db1d22f7
2018-11-17 03:24:28 -08:00
David Vacca 7b2030bcea Fix padding for Text Views in Fabric
Summary: This diff extends Text View to support not only paddingLeft, paddingRight, etc but also padding props.

Reviewed By: shergin

Differential Revision: D13111433

fbshipit-source-id: 3b0efe8468f20a5ffaf31e3f1f180e96a5409865
2018-11-17 02:27:20 -08:00
David Vacca 8367fa9644 Implement layout constraint when measuring text
Summary: This diff adds support for layout constraint when measuring text

Reviewed By: shergin

Differential Revision: D13111434

fbshipit-source-id: 0c8689e9ac8ce2281b03386f275d2a8e034f88d8
2018-11-17 02:27:20 -08:00
David Vacca 2dbe769c5a NIT remove unnecessary cast in measure
Summary: Trivial clean up of unnecessary cast in measure methods

Reviewed By: shergin

Differential Revision: D13108542

fbshipit-source-id: 93661f2f5322a790f2d578e6897b89cd1e205c3d
2018-11-17 02:27:20 -08:00
David Vacca dcf72ff88c Change font size default from 12 to 14
Summary: trivial change of the default font size from 12 to 14 to make it backward compatible with current version of RN

Reviewed By: shergin

Differential Revision: D13108543

fbshipit-source-id: e5e384c4459f2c87ee9589c4e00a0ab5d0c8a06a
2018-11-17 02:27:20 -08:00
David Vacca d3a7325abd Fix scrolling with multiple fingers in RN Fabric scrollView
Summary: Scrolling with multiple fingers produced a redbox in Fabric

Reviewed By: shergin

Differential Revision: D13108544

fbshipit-source-id: 7b70b3f55f325448191adc48c782f2014b502ad6
2018-11-17 02:27:19 -08:00
David Vacca 74f6575f35 Cleanup old Fabric methods from ReactShadowNodeImpl
Summary: These methods and variables were used by Android implementation of Fabric, these are not used anymore.

Reviewed By: shergin

Differential Revision: D13108547

fbshipit-source-id: d169eb58ba20f3bfe117a124f0494ff3a4fb5dce
2018-11-17 02:27:19 -08:00
Valentin Shergin 560652cfe8 Fabric: Proper implementation `-[RCTSurfaceTouchHandler reset]`
Summary:
Apparently, if a gesture recognizer got 'reset', OS does not call `touchesCancelled:` method, so we have to do it manually.
To implement this we have to split `_dispatchTouches:eventType:` into two methods: the first converts Objective-C touches to C++ touches, the second consumes that. We have to do this because during reset we don't have a collection of UIKit touches.

Reviewed By: mdvacca

Differential Revision: D13072807

fbshipit-source-id: 677e2febf9f96dcdfaadfadf5b9ab3893f93e796
2018-11-16 18:44:36 -08:00
Valentin Shergin 868406dbec Fabric: Using non-mutating `at` instead of `[]` for `-[RCTSurfaceTouchHandler _activeTouches]`
Summary: Every C++ engineer (except me several months ago) knows that `operator []` can mutate the collection (Yeah! Don't ask), so this is especially dangerous if your hash function is broken (see the previous diff).

Reviewed By: mdvacca

Differential Revision: D13072805

fbshipit-source-id: 4436a8ff12fb27a57bfb6ee0ff986d7a9a825549
2018-11-16 18:44:35 -08:00
Valentin Shergin 1de79e12e1 Fabric: Fixed bug in RCTSurfaceTouchHandler::PointerHasher
Summary:
Without this fix the PointerHasher hashed not a pointer, but an address where the pointer is stored, which is obviously incorrect.
The incorrect hash function compromised the whole `_activeTouches` caused many issues with logically invalid invariants (e.g. removing element from the collection silently didn't work).

Reviewed By: mdvacca

Differential Revision: D13072804

fbshipit-source-id: d68289e940fe21e2df08a31439619b7e2fe0fa13
2018-11-16 18:44:35 -08:00
Jason Hu 8911353c47 create api to allow clients to present a client credential for authentication (#22316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22316

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

In order for TLS Mutual Auth to work for webviews, the caller must present a credential. Expose a setter that can be called to set a credential.

Reviewed By: RSNara

Differential Revision: D13095969

fbshipit-source-id: d136556a0030f799651d574b6e47ce38295b108e
2018-11-16 18:44:35 -08:00