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

5406 Коммитов

Автор SHA1 Сообщение Дата
Kevin Gozali abf612aecd iOS - clean up weakproxy gating
Summary: The proper weakproxy usage should be enabled by default from now on.

Reviewed By: PeteTheHeat

Differential Revision: D17866448

fbshipit-source-id: da404a41fd1136d7feebfc7591fa2965a65c4c6b
2019-10-10 21:06:45 -07:00
Moti Zilberman cf4d45ec2b Remove framesToPop from YellowBox
Summary: Removes the use of `framesToPop` to manage frame skipping in YellowBox and replaces it with support for the `collapse` field populated by Metro's [`customizeFrame`](https://github.com/facebook/metro/pull/435) config option. `framesToPop` is a deprecated mechanism which will be removed in the future.

Reviewed By: bvaughn

Differential Revision: D17857057

fbshipit-source-id: 120383ba4aad877b7ca79c7cf9d5b7579a490577
2019-10-10 11:59:52 -07:00
Ashok Menon df96de78bb Back out D17720575 -- D17724498
Summary: This stack caused FB4A builds to start failing, complaining about `RCTImageApple`.

Reviewed By: RSNara

Differential Revision: D17855088

fbshipit-source-id: 21ecedc3725dde65fab20f414d07b32c3548447c
2019-10-10 09:41:33 -07:00
Martin Sherburn bfd01552af Fix TimingAnimation rounding error issue (Take 2)
Summary:
This fixes a bug where the frames array can contain a duplicate entry at the end.
For example, suppose the duration is 1000.0 then it would create an array with the following:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1,
  1 ]
```

With this change, it now generates the following array:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1 ]
```

Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop.

Reviewed By: dimach1977

Differential Revision: D17828204

fbshipit-source-id: 4483303de852071436cf9a82e50296baf3392329
2019-10-10 06:00:49 -07:00
Pavel Jacko b61583a780 Elements no longer focusable on tvOS (#26775)
Summary:
This PR fixes broken focus on tvOS due to `isTVSelectable` and `tvParallaxProperties` not being available in validAttributes definition object of ReactNativeViewViewConfig

## Changelog

[ios] [Fixed] - elements no longer focusable on tvOS
Pull Request resolved: https://github.com/facebook/react-native/pull/26775

Test Plan:
```
import React from 'react';
import {
    StyleSheet,
    View,
    Text,
    TouchableOpacity
} from 'react-native';

const parallax = {
    enabled: true,
    shiftDistanceY: 2,
    shiftDistanceX: 2,
    tiltAngle: 0.05,
    pressMagnification: 1,
    magnification: 1.1,
};

const Button: () => React$Node = () => (
    <TouchableOpacity style={styles.buttonx} tvParallaxProperties={parallax}>
        <Text>
Touchable Button
        </Text>
    </TouchableOpacity>
);

const App: () => React$Node = () => (
    <View style={styles.wrapper}>
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
        <Button />
    </View>
);

const styles = StyleSheet.create({
    buttonx: {
        backgroundColor: 'red',
        height: 100,
        width: 500
    },
    wrapper: {
        justifyContent: 'center',
        flex: 1,
        alignItems: 'center'
    }
});

export default App;
```

![Oct-08-2019 12-11-19](https://user-images.githubusercontent.com/4638697/66459930-3d7aa880-ea76-11e9-9b94-686094dc8667.gif)

Differential Revision: D17845058

Pulled By: TheSavior

fbshipit-source-id: b6c71d370efd6cf7763ab3a98bbfe1630f789821
2019-10-09 17:49:41 -07:00
Ramanpreet Nara 60321a78ad Make RCTAlertManager TurboModule-compatible
Summary: See title.

Reviewed By: PeteTheHeat

Differential Revision: D17722913

fbshipit-source-id: cb78b9ea1bf497d27b19255e48809850e698ba0d
2019-10-09 12:34:00 -07:00
Ramanpreet Nara a7d2f0dc33 Make RCTLocalAssetImageLoader and RCTGIFImageDecoder TurboModule-compatible
Summary: Couldn't make RCTImageEditingManager and RCTImageStoreManager TurboModule-compatible because their specs live in fb-internal code. I will tackle them in a subsequent diff. See T54946472.

Reviewed By: PeteTheHeat

Differential Revision: D17720574

fbshipit-source-id: 5d634da475522565f874020301de8e74ff73aa8d
2019-10-09 12:33:59 -07:00
Ramanpreet Nara 3aa8a40659 Move RCTImage NativeModules back to RCTImage
Summary: In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`.

Reviewed By: PeteTheHeat

Differential Revision: D17720575

fbshipit-source-id: 44b07cfa07cbb2b87254132810f86974edc7edab
2019-10-09 12:33:59 -07:00
Rick Hanlon 90a9d59679 Partial React Sync
Summary:
This diff is a partial sync of React into React Native.

## Source
The source branch is from my fork [here](https://github.com/facebook/react/compare/master...rickhanlonii:react-native-partial-sync-october-9?expand=1)

This branch is created from D17456249 which partially synced Dan's branch [here](https://github.com/facebook/react/compare/master...gaearon:partsync).

To create my branch, I forked from Dan's branch and added two commits from these PRs:

- Joshua's PR to improve view config errors https://github.com/facebook/react/pull/16879
- Eli's PR to remove setNativeProps warning https://github.com/facebook/react/pull/17045

Reviewed By: gaearon

Differential Revision: D17828989

fbshipit-source-id: 75c99737f2dec4889d7d453bbdebaeb47656b5ce
2019-10-09 09:37:03 -07:00
Rick Hanlon 2fbcdad09c Revert TextInput back to old setNativeProps API
Summary: Reverts D14176217 so we can do the partial React sync in the next diff which removes this API

Reviewed By: TheSavior

Differential Revision: D17828977

fbshipit-source-id: 7dd98c19890aeee0a153746ce65fd3b148b4ca7b
2019-10-09 09:37:02 -07:00
Moti Zilberman a483f802fd Remove framesToPop from bridge
Summary: Removes the use of `framesToPop` from method wrappers in the RN bridge.

Reviewed By: rubennorte

Differential Revision: D17764986

fbshipit-source-id: f2fac0c33a9a7c821bb920fa65b92a4672150a38
2019-10-09 05:48:15 -07:00
Dmitri Svetlanov 5e938077f8 Back out "Fix TimingAnimation rounding error issue"
Summary: Original commit changeset: deba5d5a08ae

Differential Revision: D17813959

fbshipit-source-id: bcd2076bc8f50e835dec3dccf6bd68a41cb8a5ec
2019-10-08 12:33:43 -07:00
Martin Sherburn 77b6e26538 Fix TimingAnimation rounding error issue
Summary:
This fixes a bug where the frames array can contain a duplicate entry at the end.
For example, suppose the duration is 1000.0 then it would create an array with the following:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1,
  1 ]
```

With this change, it now generates the following array:

```
[ 0,
  0.0010119824303159884,
  0.00391003997863186,
  0.00851330482578147,
  0.01466951184383165,
  0.022249135687575607,
  0.03114100006836614,
  0.041248932923769244,
  0.05248918022066495,
  0.06478838042267626,
  0.07808196049642172,
  0.09231285402599128,
  0.1074304693764467,
  0.12338985513375342,
  0.14015102395653428,
  0.15767840628626964,
  0.17594041329987542,
  0.1949090949486824,
  0.21455988464815853,
  0.23487142789035506,
  0.25582549864491233,
  0.27740701626433145,
  0.2996041891505173,
  0.3224088345090182,
  0.34581696665965683,
  0.36982983491413496,
  0.394455794287552,
  0.4197139228812336,
  0.44564199741037275,
  0.4723190090623474,
  0.5000000572130084,
  0.5276809909376533,
  0.5543580025896278,
  0.5802860771187669,
  0.6055442057124484,
  0.6301701650858652,
  0.6541830333403433,
  0.6775911654909819,
  0.7003958108494828,
  0.7225929837356684,
  0.7441745013550876,
  0.7651285721096447,
  0.785440115351841,
  0.8050909050513173,
  0.8240595867001241,
  0.84232159371373,
  0.8598489760434653,
  0.876610144866246,
  0.8925695306235529,
  0.9076871459740083,
  0.9219180395035779,
  0.9352116195773232,
  0.9475108197793346,
  0.9587510670762303,
  0.9688589999316335,
  0.9777508643124241,
  0.9853304881561681,
  0.9914866951742183,
  0.996089960021368,
  0.9989880175696839,
  1 ]
```

Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop.

Reviewed By: sahrens

Differential Revision: D17738602

fbshipit-source-id: deba5d5a08ae842e2a9e2b75f2e25e14f3700518
2019-10-08 06:22:28 -07:00
Eli White d576a5bcc0 Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0
Summary:
If you passed
```
contentInset: { bottom: 10 }
```

then it wouldn't go into the if case and it could try to call `setOffset` with `undefined`. `setOffset` requires a number.

Changelog:
[Fix][ScrollView] ScrollView contentInset top now defaults to 0 in expected situations

Reviewed By: JoshuaGross

Differential Revision: D17796155

fbshipit-source-id: 951dbbb0de1052f64a6835963e8bbc564990c120
2019-10-07 15:31:54 -07:00
Eli White 15be1448f7 Remove unused scrollResponderHandleTerminate from ScrollView
Summary:
This function doesn't exist on the scroll responder so this prop is being set to undefined.

As this is an event, not setting the prop just means that nothing will listen to the event.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D17795678

fbshipit-source-id: 73f2c125e0868e19258b43e3a053447be3f5e768
2019-10-07 15:31:54 -07:00
Ramanpreet Nara 021a63d4da Ensure internal builds don't use plugin stubs
Summary: We generate a stub for plugin system, so that TurboModules can work in OSS. Unless the `RN_DISABLE_OSS_PLUGIN_HEADER` define is seet, TurboModules will use the plugin stub. Therefore, for internal builds, we should set this define.

Reviewed By: fkgozali, mdvacca

Differential Revision: D17789993

fbshipit-source-id: a93735738513457236adb3064b80601053c95dd3
2019-10-07 14:55:39 -07:00
Samuel Susla 9cefc96e43 Remove redundant props from Picker
Summary: Props are being ignored on native side, let's get rid of them.

Reviewed By: TheSavior

Differential Revision: D17765185

fbshipit-source-id: d3625dd25d2e41a49e701d54fe9a7b74cd47786c
2019-10-07 11:34:50 -07:00
Oleksandr Melnykov 3560093115 Add setNativeValue command to ReactSwitchManager
Summary: Fabric doesn't support setNativeProps, so we have to use commands instead to set the value of the native component.

Reviewed By: JoshuaGross

Differential Revision: D17736274

fbshipit-source-id: 18c47365926c3c2cfc3551f4b5b6cc72e4162367
2019-10-07 03:54:09 -07:00
Samuel Susla 07fd3125c8 Migrate MVP SafeAreaView to Fabric
Reviewed By: shergin

Differential Revision: D17736209

fbshipit-source-id: e70c309f2599cdcb8f234d96915546032b71d223
2019-10-04 07:07:36 -07:00
Adam Ernst a45e6a8b5f React Native supermodule
Summary: #nocancel

Reviewed By: fkgozali

Differential Revision: D17747685

fbshipit-source-id: 9bad072d3549959528612c2f0329799853d4b675
2019-10-03 15:43:38 -07:00
Eli White 21f1cce148 Remove unused code
Summary:
There are some unused imports and variables. This was flagged by running
```
$ js1 lint --only "no-unused-vars: [1, {vars: 'all', args: 'none', ignoreRestSiblings: true}]" ~/fbsource/xplat/js/react-native-github --only "react/jsx-uses-vars" --only "react/jsx-uses-react" --fast
```

Changelog:
Internal

Reviewed By: zackargyle, JoshuaGross

Differential Revision: D17724836

fbshipit-source-id: 2b6a44f55c878d659c9c23f5878ba34f21f8bb69
2019-10-03 14:33:59 -07:00
Ramanpreet Nara d7864d20d5 Mark plugin function definitions used
Summary: We need to mark the OSS plugin functions with `__attribute__((used))`, so that the compiler doesn't strip them out.

Reviewed By: fkgozali

Differential Revision: D17742818

fbshipit-source-id: df8055286cace850cea21bb6f09eb5ee6b587c0e
2019-10-03 13:06:06 -07:00
luancurti d66931987a Fix platform ios get version type (#26639)
Summary:
Fix flow type platform ios get version

## Changelog

[INTERNAL] [FIXED] - Fix flow type platform ios get version

## Test Plan
Pull Request resolved: https://github.com/facebook/react-native/pull/26639

Differential Revision: D17743074

Pulled By: TheSavior

fbshipit-source-id: de97c612dbf615a8ede1905cb158f258c9ce5737
2019-10-03 12:29:47 -07:00
Oleksandr Melnykov d0dd1aed29 Integrate AndroidSwitch into Fabric on Android
Summary:
In this diff we integrate the Switch component on Android in Fabric. Since the component has a custom measure function, we need to write some C++ to call the measure method in Java.

The component isn't fully functional yet (setNativeProps isn't supported in Fabric) and has some problems with measuring itself. I will fix the component in the next diffs in this stack.

Reviewed By: JoshuaGross

Differential Revision: D17571258

fbshipit-source-id: be4e201495b9b197ddec44ee3484357bfb6225a8
2019-10-03 03:15:20 -07:00
Luna Wei ea1e8bbd34 Add queryCache to ImageLoader native module
Summary:
[iOS] [Added] - Add definition for `queryCache` in ImageLoader

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17714521

fbshipit-source-id: 722cc17a2ebb03e72d7c080dfc4d0aa6d7440e85
2019-10-02 14:05:12 -07:00
Luna Wei 40667a8147 Add prefetchImage to ImageLoader native module
Summary:
[iOS] [Added] - Add `prefetchImage` to ImageLoader native module.

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17714519

fbshipit-source-id: 0a50f640cf0c5668a11dd5d40553c257ebbd9d2b
2019-10-02 14:05:12 -07:00
Luna Wei db20260b03 Add getSizeWithHeaders to ImageLoader turbomodule
Summary:
Define getSizeWithHeaders in ImageLoader native module.

This diff is related to moving RCTImageViewManager's commands to a native module, ImageLoader.
See it's usage here: D17704091

Reviewed By: TheSavior

Differential Revision: D17693907

fbshipit-source-id: 3c2d7b19ac68ead831e780c4ee23e3ed0643be3a
2019-10-02 14:05:12 -07:00
Eli White da8ae011bb Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null
Summary:
We are seeing these errors in prod:

```
TypeError: Cannot read property '_nativeTag' of null

at
ReactNativeFiberHostComponent.prototype.measureLayout(ReactNativeRenderer-prod.fb.js:1594)
ScrollResponderMixin.scrollResponderScrollNativeHandleToKeyboard(ScrollResponder.js:557)
```

This error is coming from these lines: 69c38e5a63/Libraries/Components/ScrollResponder.js (L563-L567)

Either `nodeHandle` is null or `this.getInnerViewRef()`. If `nodeHandle` was null, we'd get an error that we can't call `measureLayout` on null. So `this.getInnerViewRef()` must be null.

In the React Native Renderer this error of `_nativeTag of null` is coming from this line: db8afe4f63/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js (L84)

Which means indeed `this.getInnerViewRef()` is null.

So adding a null check here which is what we do at all the other product callsites of `measureLayout`. Flow should have caught this, but because ScrollView is one of the only components left using mixins (ScrollResponder), `this.getInnerViewRef` is typed as `any` instead of what it should be:

```
?React.ElementRef<Class<ReactNative.NativeComponent<mixed>>>
```

If `scrollResponder` was typed correctly then Flow would have caught this.

Changelog:
[Fixed] Exception in scrollResponderScrollNativeHandleToKeyboard when ref is null

Reviewed By: mmmulani

Differential Revision: D17717150

fbshipit-source-id: d7bc4c897ad259fb588e8100f37ccfb8a5d07874
2019-10-02 11:28:50 -07:00
Ramanpreet Nara 48653a2a63 Make RCTBridgingToOptionalVec understand kCFNull
Summary:
When converting an array into a Vec, we should also check whether the array pointer is `kCFNull`.

In TurboModules, when an object's property is mapped to null, we simply do not insert that property into the corresponding `NSDictionary`. This causes the `NSDictionary` lookup to return `nil`. In the legacy infra, it looks like we may insert `kCFNull` into the `NSDictionary`, which will cause the lookup to return `kCFNull`.

Reviewed By: fkgozali

Differential Revision: D17716785

fbshipit-source-id: 62ffbe14aec7040edd6b3ce687769a285b14b5a1
2019-10-02 11:01:59 -07:00
Gunnar Kudrjavets b53d3d80f9 Fix free page calculations on iOS
Summary:
[iOS] [Fixed] - Fix how the amount of free memory is calculated to mimic the logic Apple uses.

For example, see https://opensource.apple.com/source/system_cmds/system_cmds-805.250.2/vm_stat.tproj/vm_stat.c.auto.html for how `vm_stat` does it:

```
sspstat("Pages free:", (uint64_t) (vm_stat.free_count - vm_stat.speculative_count));
```

Reviewed By: shergin

Differential Revision: D17671714

fbshipit-source-id: 18ef31e17a0527a9bef7a408922cd687260866db
2019-10-01 12:06:44 -07:00
Ramanpreet Nara 601981a67d Make CameraRoll NativeModules TurboModule-compatible
Summary:
Aside from RCTCameraRollManager, this diff makes the following NativeModules TurboModule-compatible:
- RCTAssetsLibraryRequestHandler
- RCTImagePickerManager
- RCTPhotoLibraryImageLoader

I couldn't convert CameraRollManager to a TurboModule because its NativeMoudle spec is located in fb-internal code. We should probably just move all these NativeModules outside of react-native-github. See: T54882565.

Reviewed By: PeteTheHeat

Differential Revision: D17678033

fbshipit-source-id: 4d10b7b1ad4e167bb9e46ff2bfd1559a5092e201
2019-10-01 11:15:09 -07:00
Ramanpreet Nara 3908702de9 Make RCTFileReaderModule and RCTBlobManager TurboModule-compatible
Summary: Make RCTFileReaderModule and RCTBlobModule TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D17583286

fbshipit-source-id: 4cab350aadce00c03a6c631a6b57e86f35484d2f
2019-10-01 11:15:09 -07:00
Ramanpreet Nara bf063f425f Make RCTSettingsManager TurboModule-compatible
Summary: Make RCTSettingsManager TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D17581374

fbshipit-source-id: 22ec6237ea8b504ff826d0fe7b3db2fabfee9f80
2019-10-01 11:15:08 -07:00
Ramanpreet Nara 789e9fbff0 Make RCTVibration TurboModule-compatible
Summary: Making RCTVibration TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D17581373

fbshipit-source-id: a7aa2d12e7251d332c855435c2f0d83d87f0d2ac
2019-10-01 11:15:08 -07:00
Ramanpreet Nara 101125f891 Make RCTActionSheetManager TurboModule-compatible
Summary: RCTActionSheetManager is now hooked up to the NativeModule codegen. It's also TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D16966007

fbshipit-source-id: 8fdd32cf9fa09ccda9f38513bb0ac9896f8af1b0
2019-09-30 14:32:21 -07:00
Rick Hanlon 7e49a632c2 Send fast refresh stats
Summary: Report fast refreshes to the native module that handles reporting

Reviewed By: cpojer

Differential Revision: D17528523

fbshipit-source-id: 6f8a0b72a18c2d08ab160dc8b6621fce5420a473
2019-09-30 07:03:51 -07:00
Rick Hanlon 2d95668aa8 Add fastRefresh to NativeDevSettings
Summary: This diff adds a method to call whenever a fast refresh happens. Right now this is only useful for reporting.

Reviewed By: cpojer

Differential Revision: D17528033

fbshipit-source-id: 17e82abe7a3e2bab6829de5adecda853fe5335c5
2019-09-30 07:03:51 -07:00
Rick Hanlon 4cea628e0c Add reloadWithReason to Fast Refresh
Summary: This diff adds reload reasons to Fast Refresh. This will help us understand why, for internal Facebook users, Fast Refresh is bailing out to a full reload so that we can improve it for everyone.

Reviewed By: cpojer

Differential Revision: D17499348

fbshipit-source-id: b6e73dc3f396c8531a0872f5572a13928450bb3b
2019-09-30 07:03:51 -07:00
Rick Hanlon 549cac63cb Add reloadWithReason to DevSettings
Summary:
This diff adds reloadWithReason to the NativeDevSettings and updates the exposed DevSettings.reload method to send to it if it's available (setting an 'uncategorized' reason if one isn't set.

[General][Feature] Update DevSettings.reload to accept a reason

Reviewed By: RSNara

Differential Revision: D17499343

fbshipit-source-id: e8c9724800f93d3b9a5d2a8fe9f689d51947d39b
2019-09-30 07:03:50 -07:00
Roshan Gautam 9caf99162d Fixes button partially showing when parent view height is 0 (#26435)
Summary:
When the parent view that wraps a button has height 0, the button is still shown partially because of the padding given for text inside Button component for iOS. Here is the issue raised for that:
https://github.com/facebook/react-native/issues/26421

Probably, we should not hard code these values, rather provide a way to provide custom style ? This is my first PR so not making big change. :D

## Changelog

[iOS] [Fixed] - Give margin instead of padding to text in Button component
Pull Request resolved: https://github.com/facebook/react-native/pull/26435

Test Plan:
When using this block of code,
```
<View style={{height:0}}>
    <Button title="There is an issue"></Button>
</View>
```
Before:
<img width="284" alt="image" src="https://user-images.githubusercontent.com/5866078/64905271-6c129700-d6f5-11e9-86c1-c301eb8123f3.png">

After:
<img width="283" alt="image" src="https://user-images.githubusercontent.com/5866078/64905284-8cdaec80-d6f5-11e9-9589-28d8d01c8ba1.png">

Differential Revision: D17661181

Pulled By: cpojer

fbshipit-source-id: 62b04123d9edb4d760bd54d96ae0615c1ccff7ab
2019-09-29 19:35:17 -07:00
Pablo Espinosa e1d89fbd9d Added Warning message Linking API with Phones in iOS Simulator (#26607)
Summary:
This PR, tries to fix the problem at https://github.com/facebook/react-native/issues/26554

## Changelog
iOS Fixed - Now it will show a warning when trying to use it inside a simulator, instead of throwing a red screen error.

## Notes
Docs PR opened as well at: https://github.com/facebook/react-native-website/pull/1295
<img width="418" alt="image" src="https://user-images.githubusercontent.com/12865914/65734976-532ebc00-e0cd-11e9-8e8c-2b4a5a7b8aea.png">
Pull Request resolved: https://github.com/facebook/react-native/pull/26607

Differential Revision: D17661091

Pulled By: cpojer

fbshipit-source-id: 3d660f25546374adfa3436e2954c9c27750039b7
2019-09-29 19:01:13 -07:00
Miguel Alatzar 0a282c42b4 Include transform in OUTER_PROPS (#26611)
Summary:
Without `transform` in `OUTER_PROPS`, the refresh control component would not include `transform: {scaleY: -1}` in its style and so pulling down, rather than up, on a scroll view would trigger a refresh.

Fixes https://github.com/facebook/react-native/issues/26181

## Changelog
[Android] [Fixed] - Fixed issue with refresh control not working properly on an inverted ScrollView
Pull Request resolved: https://github.com/facebook/react-native/pull/26611

Test Plan: Updated unit test in splitLayoutProps-test.js.

Differential Revision: D17661079

Pulled By: cpojer

fbshipit-source-id: 747da27b11c3ca59b7f639f393ae5ac137f5490a
2019-09-29 18:49:45 -07:00
vasilich 9a2bc71064 Export props type for TextInput component (#26622)
Summary:
Fix for issue https://github.com/facebook/react-native/issues/26263

## Changelog

[JavaScript] [Fixed] - Added an export for TextInput props type
Pull Request resolved: https://github.com/facebook/react-native/pull/26622

Test Plan: This PR does not change user interface

Differential Revision: D17661069

Pulled By: cpojer

fbshipit-source-id: 7a8e0159de9dc9e775eae349d0f1e743155e56db
2019-09-29 18:39:20 -07:00
Dulmandakh 8c099b5f53 add ACCESS_BACKGROUND_LOCATION to PermissionsAndroid (#26562)
Summary:
This PR adds ACCESS_BACKGROUND_LOCATION to PermissionsAndroid. Fixes https://github.com/facebook/react-native/issues/26541

## Changelog

[Android] [Changed] - add ACCESS_BACKGROUND_LOCATION to PermissionsAndroid
Pull Request resolved: https://github.com/facebook/react-native/pull/26562

Test Plan:
```javascript
PermissionsAndroid.ACCESS_BACKGROUND_LOCATION === 'android.permission.ACCESS_BACKGROUND_LOCATION'
```

Differential Revision: D17660062

Pulled By: cpojer

fbshipit-source-id: 3133504c6065ffb2f46e4dff14d2d662348e0987
2019-09-29 17:45:27 -07:00
Luna Wei 06d3031281 Native changes for ImageLoader native module
Summary:
Split changes from D17587836
Native changes for ImageLoader native module

Reviewed By: TheSavior

Differential Revision: D17607364

fbshipit-source-id: 451e24d4cf3c982b64bd6196addacef4cb967d1b
2019-09-26 17:37:38 -07:00
Eli White a2aa008b33 Remove unused flow suppressions
Summary: I'm trying to clean up core files and finding suppressions that aren't needed. Bulk removing them.

Reviewed By: cpojer

Differential Revision: D17586683

fbshipit-source-id: fc289bd70b0c928b49a75015ecb5aebe8ab4f1da
2019-09-26 08:16:24 -07:00
Eli White c0029be953 Update ReactNativeTypes from PR to React
Summary:
I upstreamed the changes to this file from previous commits to React in this (unlanded) PR: https://github.com/facebook/react/pull/16898#issuecomment-535248721

I had to make some additional changes to be able to make Flow pass there. Bringing those changes back to FBSource as well. Having this change made here will make the next sync easier as we won't have to deal with conflicts then.

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D17586781

fbshipit-source-id: 4be8376d0af4fb5d63410afaaf5bb0005d992981
2019-09-26 08:16:24 -07:00
Eli White 79e08f3c15 Add Flowtests for HostComponent
Summary:
`HostComponent` is built specifically to differentiate from `ReactNative.NativeComponent`. These tests should ensure that is the case, and help it stay that way.

I also expect these tests to be duplicated to DefinitelyTyped to help the team working on the TypeScript types ensure they have things modeled correctly.

Reviewed By: cpojer

Differential Revision: D17580120

fbshipit-source-id: c14eb18507cbee1b308beeff0092607e18706171
2019-09-26 08:16:23 -07:00
Eli White bcc58bce02 Strengthen flowtype of measureLayout
Summary:
MeasureLayout requires either a reactTag or a ref to a host component. Now that we have a type for Host Components we can be more differentiating here.

Also, because Object is treated as `any` in flow, the type was allowing the return from findNodeHandle or a ref itself be passed, even though both of those are nullable.

This change explicitly requires checking for null before calling the function which is consistent with the behavior of the implementation of measureLayout.

Changelog:
[Changed] Flowtype for measureLayout now disallows null as reactTag

Reviewed By: cpojer

Differential Revision: D17579300

fbshipit-source-id: af062fcd9dfc40eab42e5c5452af2ff653d0888e
2019-09-26 08:16:23 -07:00
Logan Daniels 1bfd15ccb6 Re-land stack of D17563110: codemod xplat/js
Summary:
The stack of D17563110 was reverted because it triggered a failing OTA job that wasn't caught at land time.

Fixing the issue by reverting the change to `Route.js` and re-landing the rest of the diff.

Differential Revision: D17564219

fbshipit-source-id: 166b50a163ce8ae226de224882a98c40652e29ac
2019-09-25 14:47:02 -07:00