Commit Graph

3657 Commits

Author SHA1 Message Date
garlic-rice-with-butter 6e1db1f1ee Change doc link to point to AnimatedValueXY
Summary:
Currently goes to the same page

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Online doc was not helpful because the link kept going to the wrong page. Someone told me to make a pull request

Documentation change
Go to original link https://facebook.github.io/react-native/docs/animated.html#animatedvaluexy
See that it does not have any info on valuexy

Go to https://facebook.github.io/react-native/releases/next/docs/animatedvaluexy.html
See that the page loads and has information about valuexy

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/16999

Differential Revision: D6467512

Pulled By: shergin

fbshipit-source-id: 69887e34446c3ea57ad831ed870be4e1a8a7a514
2017-12-01 23:32:35 -08:00
Alexey Lang dfebcb70a5 Don't set global.performance to undefined if it was initialized already
Reviewed By: gaearon

Differential Revision: D6448731

fbshipit-source-id: 8c8c6ff393e452c863f54c83c2e4394fd535dfc5
2017-12-01 02:46:18 -08:00
Edgar Aroutiounian 554e873f58 Implement deletion of asset-library files
Summary:
WIP: Starting point insofar as I'm not sure if there should be an Android equivalent.

My application needs me to delete photos from the photos in iOS.

I have tested this in my application and it works, have a screenshot from iOS asking as well and it does successfully delete the photos from the global Photos app.

Related to https://github.com/facebook/react-native/issues/15253, it kind of continues using the deprecated assets-library framework, but that does need (and will be an bigger and bigger issue coming up) of assets-library URLs being used.

I also assume RN prefers error handling at the JS level? Are the URLs starting with `asset-library`, etc.
Closes https://github.com/facebook/react-native/pull/15481

Differential Revision: D6438016

Pulled By: hramos

fbshipit-source-id: 47512140f62f458c14ad2ade2b358846e168c964
2017-11-29 12:18:08 -08:00
Edgar Aroutiounian 2e424fb113 Generalize ActionSheetManager items URL
Summary:
Not ready but want to start conversation.  (i.e. not sure if to change key name to `urls` from `url`)

I want to be able to share more than 1 image at a time, the current code only lets one use one url, but the API allows for much more.

Some places already make this an issue:

https://github.com/EstebanFuentealba/react-native-share/issues/85

And I also need to be able to email/send on iMessage, etc with multiple URL resources.
Closes https://github.com/facebook/react-native/pull/15475

Differential Revision: D6437807

Pulled By: hramos

fbshipit-source-id: 336c696c5633c0080904ca9306a38120e27f9173
2017-11-29 12:01:48 -08:00
Spencer Ahrens c6fe101cdc export SeparatorsObj type for re-use in ListItems etc.
Differential Revision: D6354300

fbshipit-source-id: 3fd4c86ef1d190fb544f2c6fccb638ffe3ced378
2017-11-29 10:53:51 -08:00
Brian Vaughn cd938d731c React sync for revisions 2d23a45...9491dee
Reviewed By: flarnie

Differential Revision: D6436328

fbshipit-source-id: 370b862c23c9804bd6df72812d08baceaebfca78
2017-11-29 10:16:58 -08:00
Chris Lewis 22a1419900 Fix $FlowFixMe in Flatlist
Summary:
$FlowFixMe suppressed type validation on _listRef. Add appropriate typing to let Flow succeed when $FlowFixMe is removed.

Not sure what this project's philosophy around ref types is. In some places I've seen them annotated as any rather than trying to get a more granular type to match. I'm open to suggestions.

`yarn flow`

[INTERNAL] [ENHANCEMENT] [FlatList.js] - Remove $FlowFixMe from FlatList
Closes https://github.com/facebook/react-native/pull/16882

Differential Revision: D6386479

Pulled By: hramos

fbshipit-source-id: bed14f2c7071525cb46425ab14214771de0277f3
2017-11-29 09:15:50 -08:00
Christoph Nakazawa 654fed46f4 Rename metro-bundler to metro
Reviewed By: davidaurelio

Differential Revision: D6413420

fbshipit-source-id: f13184b8157de2c3aeaa7f2647becc175f62cdbb
2017-11-29 03:35:29 -08:00
Yujie Liu d1fc8ef3a3 Fix embeddedBundleURL update situation
Reviewed By: zahanm

Differential Revision: D6432397

fbshipit-source-id: 163319c3c02976bcb49be3f0a54ce2928d0395f3
2017-11-28 19:46:20 -08:00
Álvaro Medina Ballester 0c8a3e4f79 closes #13034 Fixes the ScrollViewMock methods
Summary:
Solves https://github.com/facebook/react-native/issues/13034

Now the `ScrollView` mock has all the methods available.

React Native tests pass.

To test this specific part of the code,

```sh
$ react-native init Test
$ cd Test/
$ yarn add react-navigation
```

Then, add a simple project that uses `react-navigation`:

```js
import React from 'react';
import { Text } from 'react-native';
import { StackNavigator } from 'react-navigation';

class HomeScreen extends React.Component {
  static navigationOptions = {
    title: 'Welcome',
  };
  render() {
    return <Text>Hello, Navigation!</Text>;
  }
}

const SimpleApp = StackNavigator({
  Home: { screen: HomeScreen },
});

export default SimpleApp
```

Run the default render tests:

```js
$ npm run test
```
Closes https://github.com/facebook/react-native/pull/13048

Differential Revision: D4746028

Pulled By: shergin

fbshipit-source-id: cb1791978d15be7f5d14b7b22979388066ad6caa
2017-11-28 12:32:37 -08:00
David Detlefs 05e862d48d Add Systrace-based telemetry to Hermes GC.
Reviewed By: amnn

Differential Revision: D6393879

fbshipit-source-id: d35a4647d000356dc99bce3187acc50d3a69ddeb
2017-11-23 15:15:54 -08:00
Leland Richardson b6f1a6085f Increase prepare js timeout
Summary:
We run into this timeout virtually every live-reload now, which I believe is just a function of the size of our React Native code base. Looking at the code, right now the prepare JS call is run and retried 3 times, with a wait/timeout of 1s each. On android, it's done 3 times with a wait/timeout of 5s on each. For consistency, I've updated it to be the same timeout as on android. Trying this with our project, we no longer get red-boxes when we live-reload for the first time.

I've run this on our project locally, and it fixed the issue. It's a very simple change, so I don't believe any additional testing should be needed.

[IOS][BUGFIX][RCTWebsocketExecutor] - Increased timeout to prevent false-positive redbox during development of large RN code base
Closes https://github.com/facebook/react-native/pull/16794

Differential Revision: D6387545

Pulled By: shergin

fbshipit-source-id: c6e58fb82e072c01f9e1277a58d2640d6140a8c7
2017-11-21 14:01:20 -08:00
Adam Ernst 9180d4eb82 Make RCTPackagerConnection a singleton
Reviewed By: fromcelticpark

Differential Revision: D6361741

fbshipit-source-id: 96e92dff5dd3d7aa1f7555442b0eba90e7dbf47c
2017-11-20 18:36:27 -08:00
Brian Vaughn c91d87213e Replace fburl.com link with public fb.me link
Summary:
Follow up from [this comment](1b22d49ae8 (commitcomment-25699227)).
Closes https://github.com/facebook/react-native/pull/16892

Differential Revision: D6374118

Pulled By: bvaughn

fbshipit-source-id: e692985d6736986acc073fa036d413121ce51f41
2017-11-20 13:56:15 -08:00
Héctor Ramos 79e24ede40 Migrate additional docs to the new format
Summary:
[DOCS]
Closes https://github.com/facebook/react-native/pull/16874

Differential Revision: D6375515

Pulled By: hramos

fbshipit-source-id: 64359b45a37c7b478919121573ca04dbb1ce6609
2017-11-20 13:16:12 -08:00
Kevin Brown 0ff576081b Corrected types of page_info return value in documentation.
Summary:
I was confused by the current documentation, as it was requesting me to pass the previously received `end_cursor` into the next fetch but it was declared as a boolean. I checked in the debugger and it's just mislabeled in the docs, so this PR fixes the docs.

I tried to push this change back in #15472 but wasn't able to undo the borked rebase, so I'm submitting a new PR.

This is a change to documentation only.

[DOCS] [BUGFIX] [Libraries/CameralRoll/CameraRoll.js] - Corrected return type in the documentation for the `start_cursor` and `end_cursor` values.
Closes https://github.com/facebook/react-native/pull/16830

Differential Revision: D6371585

Pulled By: hramos

fbshipit-source-id: 5038041e95a04ea4c2de8d2b535a8a4e019289f6
2017-11-19 17:45:55 -08:00
Nathan Brown 44c16499fd Mention <ImageBackground> when error is thrown
Summary:
Improve the error message shown when you try to nest components in an
`<Image>` component by referencing the `<ImageBackground>` component.

It would be helpful if the error message displayed when you try to nest components in an `<Image>` component mentioned the `<ImageBackground>` component. Especially since this component is not yet well documented.

[IOS][MINOR][Libraries/Image/Image.ios.js] - Surfaced `<ImageBackground>` in error message
[ANDROID][MINOR][Libraries/Image/Image.android.js] - Surfaced `<ImageBackground>` in error message
Closes https://github.com/facebook/react-native/pull/16880

Differential Revision: D6369396

Pulled By: shergin

fbshipit-source-id: c4ae4dbb77d0fce6cbd7a42d1957d16112b24549
2017-11-18 17:27:58 -08:00
Brian Vaughn 1b22d49ae8 renderApplication() supports async initial render
Reviewed By: sahrens

Differential Revision: D6339469

fbshipit-source-id: d832de936c50edcdc6953b72b5ad18ce1b652187
2017-11-17 13:33:03 -08:00
Rafael Oleza 231c7a0304 Add end to end Delta support to Android devices
Reviewed By: davidaurelio

Differential Revision: D6338677

fbshipit-source-id: 8fa8f618bf8d6cb2291ce4405093cad23bd47fc3
2017-11-17 07:47:38 -08:00
Logan Daniels d19d137cc1 Fix minimumViewTime in ViewabilityHelper
Reviewed By: sahrens

Differential Revision: D6350352

fbshipit-source-id: e909600875156127eb3144726981ab62e0015e6e
2017-11-16 20:15:46 -08:00
Héctor Ramos 64d80b13db Migrate to new documentation format
Summary:
Now that the Component and API docs are no longer auto-generated, we need to consolidate on a new format for our jsdoc comments. Any help from the community will be appreciated.

In this initial pull request, we'll be tackling the following docs:

- `AccessibilityInfo`, an API doc.
- `ActivityIndicator`, a Component doc.
- `View`, a Component doc.

This top comment will serve as a style guide, and when in doubt, please refer to the individual commits in this PR.

Each commit should update a single component or API, along with any relevant markdown files.

- Documentation in the JavaScript source files should be succinct. Any verbosity should be moved over to the markdown docs in the website...
- ...by adding a link to the relevant method/prop on the website to every comment block.
- Avoid markdown style links in JavaScript source files, opt for plain old URIs.

Let code document itself:

- If a method is Flow typed, the comment block does not need to repeat this information.
- If a param can be one of several values, and the type definition is easily determined from the code, the values should not be repeated in the comment block. Again, move this to the markdown doc if not present already.
Closes https://github.com/facebook/react-native/pull/16790

Differential Revision: D6353840

Pulled By: hramos

fbshipit-source-id: 9712c459acc33092aae9909f3dd0b58a00b26afc
2017-11-16 17:04:45 -08:00
Ashok Menon 52e3ae9063 Unify Systrace native hook argument passing.
Reviewed By: javache

Differential Revision: D6316024

fbshipit-source-id: c1b315fac2c3cf8558d0c9eb0eb2c7d3efe5c64f
2017-11-16 08:01:06 -08:00
Brian Vaughn c7f37074ac React sync for revisions 589c0a2...2d23a45
Reviewed By: acdlite

Differential Revision: D6328351

fbshipit-source-id: 88dc0f6ec9947e4a908c21f3a3df46bca5a7fdbc
2017-11-15 09:16:18 -08:00
Naman Goel da047966e4 Improve types for React Native styles.
Reviewed By: TheSavior

Differential Revision: D6226807

fbshipit-source-id: b64a77383e6e685f4017c47fc9a5095ed63b062c
2017-11-14 13:18:33 -08:00
Wei Yeh 58edf024a1 Fix typo in SafeArea documentation
Reviewed By: shergin

Differential Revision: D6316656

fbshipit-source-id: 12d37f9d8ad2481b7f6685c8d675ce84234bd814
2017-11-14 10:32:15 -08:00
Kevin Gozali 28d5d6baf1 Fix asset resolver url handling
Summary:
1. file:// may get prepended to an http:// source URL during dev mode, making an invalid URL
2. the logic to detect `isLoadedFromFileSystem()` should've checked for file:// protocol to not get confused by http:// URL

Reviewed By: zahanm

Differential Revision: D6307187

fbshipit-source-id: e7e7a41bf721dd0601b0c1877e278e1e435ef5e2
2017-11-12 23:01:40 -08:00
Chris Zheng 266ab7a006 Pass scriptURL to RCTTestRunner
Summary:
Pass scriptURL to RCTTestRunner.
If the scriptURL passed to RCTTestRunner is not nil, then RCTTestRunner will use it.
else, RCTTestRunner will use whatever it has before.

Differential Revision: D6215186

fbshipit-source-id: c3a5643021d60579fc8e60a69de150f6a4a39237
2017-11-12 13:36:22 -08:00
Wenjing Wang d79e245d19 AMA changes to support disk cache
Reviewed By: fred2028

Differential Revision: D6295287

fbshipit-source-id: 70ae7dfba2edb36e758ad0e22916015038108d36
2017-11-12 13:03:41 -08:00
Valentin Shergin aa83b5a0ca Introducing RCTSurfaceBackedComponent
Summary:
RCTSurfaceBackedComponent is ComponentKit component represents a React Native Surface created
(and stored in the state) with given `bridge`, `moduleName`, and `properties`.

Differential Revision: D6217103

fbshipit-source-id: 2849f68e1975562cd47851bda232e389705b4229
2017-11-11 21:25:47 -08:00
Valentin Shergin e75bd87a76 Introducing RCTSurfaceHostingComponent
Summary: RCTSurfaceHostingComponent is ComponentKit component represents given Surface instance.

Differential Revision: D6217104

fbshipit-source-id: 50805d97e744de24a188bc97b33de4709e785aae
2017-11-11 21:25:47 -08:00
Caleb Meredith eb0d6470e5 Flow 0.59 xplat/js deploy
Reviewed By: avikchaudhuri

Differential Revision: D6300238

fbshipit-source-id: a6839fa2a9bbc50c3832a3f5b1cac2a6d2bd96b7
2017-11-10 21:15:48 -08:00
Brian Solon 58c3bc4901 Fix typo in Image.android.js & Image.ios.js
Summary:
Fixing a typo.

N/A

[IOS] [MINOR] [Image] - Fixed a typo in an error message
[ANDROID] [MINOR] [Image] - Fixed a typo in an error message
Closes https://github.com/facebook/react-native/pull/16777

Differential Revision: D6295564

Pulled By: shergin

fbshipit-source-id: eb6274701b6406f26b9eda1c35632cb2ce0392d7
2017-11-09 22:30:24 -08:00
Yujie Liu a329e968fc resolve iOS assets from embedded bundle path for iOS platform
Reviewed By: zahanm

Differential Revision: D6193907

fbshipit-source-id: 09c76a5c3d6a7777a9a823c21bfcc0fe344bc83e
2017-11-09 19:02:55 -08:00
Douglas 45185947ee Fix tvOS compile issues; enable TVEventHandler in Modal (fix #15389)
Summary:
**Motivation**

Fix an issue (#15389) where `TVEventHandler` would not work when a modal was visible.  The solution adds the gesture recognizers from the native `RCTTVRemoteHandler` to the native modal view (except for the menu button recognizer, which still needs special handling in modals).  This PR also fixes some breakages in compiling React Native for tvOS.

**Test plan**

Compilation fixes should enable tvOS compile test to pass in Travis CI.

The modal fix can be tested with the following component, modified from the original source in #15389 .

``` javascript
import React, { Component } from 'react';
import ReactNative from 'ReactNative';
import {
    Text,
    View,
    StyleSheet,
    TouchableHighlight,
    TVEventHandler,
    Modal,
} from 'react-native';

export default class Events extends Component {

    constructor(props) {
        super(props);

        this.state = {
            modalVisible: false,
        };
        this._tvEventHandler = new TVEventHandler();
    }

    _enableTVEventHandler() {
        this._tvEventHandler.enable(this, (cmp, evt) => {
            const myTag = ReactNative.findNodeHandle(cmp);
            console.log('Event.js TVEventHandler: ', evt.eventType);
            // if (evt.eventType !== 'blur' && evt.eventType !== 'focus') {
            //  console.log('Event.js TVEventHandler: ', evt.eventType);
            // }
        });
    }

    _disableTVEventHandler() {
        if (this._tvEventHandler) {
            this._tvEventHandler.disable();
            delete this._tvEventHandler;
        }
    }

    componentDidMount() {
        this._enableTVEventHandler();
    }

    componentWillUnmount() {
        this._disableTVEventHandler();
    }

    _renderRow() {
        return (
            <View style={styles.row}>
                {
                    Array.from({ length: 7 }).map((_, index) => {
                        return (
                            <TouchableHighlight
                                key={index}
                                onPress={() => { this.setState({ modalVisible: !this.state.modalVisible }); }}
                            >
                                <View style={styles.item}>
                                    <Text style={styles.itemText}>{ index }</Text>
                                </View>
                            </TouchableHighlight>
                        );
                    })
                }
            </View>
        );
    }

    onTVEvent(cmp, evt) {
      console.log('Modal.js TVEventHandler: ', evt.eventType);
    }

    hideModal() {
      this.setState({
        modalVisible: false
      });
    }

    render() {
        return (
            <View style={styles.container}>
                <Modal visible={this.state.modalVisible}
                       onRequestClose={() => this.hideModal()}>
                    <View style={styles.modal}>
                        { this._renderRow() }
                        { this._renderRow() }
                    </View>
                </Modal>
                { this._renderRow() }
                { this._renderRow() }
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: 'darkslategrey',
    },
    row: {
        flexDirection: 'row',
        padding: 30,
    },
    item: {
        width: 200,
        height: 100,
        borderColor: 'cyan',
        borderWidth: 2,
        margin: 30,
        alignItems: 'center',
        justifyContent: 'center',
    },
    itemText: {
        fontSize: 40,
        color: 'cyan',
    },
    modal: {
        flex: 1,
        backgroundColor: 'steelblue',
    },
});
```
**Release Notes**

After this change, the `onRequestClose` property will be required for a `Modal` in Apple TV.
Closes https://github.com/facebook/react-native/pull/16076

Differential Revision: D6288801

Pulled By: hramos

fbshipit-source-id: 446ae94a060387324aa9e528bd93cdabc9b5b37f
2017-11-09 13:54:54 -08:00
Alexey Lang 1f40c95076 Fix sections that come from React Fiber
Reviewed By: fkgozali

Differential Revision: D6235187

fbshipit-source-id: 55a49da9d81204f7a6199420beca1b096f7ea212
2017-11-09 13:05:07 -08:00
Jessica Cao 780938170b Backed out changeset eadb184eacdf
Reviewed By: fkgozali, hramos

Differential Revision: D6287083

fbshipit-source-id: 43c6e43a9d5411e71f51824f9443559b4e0a47e2
2017-11-09 12:57:14 -08:00
James Isaac 820cfa1f3b Refine StyleSheet Flow types
Summary:
Nice addition of the recent Flow types for style props in 9c29ee1504, however I think there are some slight issues in the definition.

`type Styles = {[key: string]: Object}` makes sense, as it's referring to the set of named style groups a user creates a `StyleSheet` from, e.g.

```javascript
const styles: StyleSheet = StyleSheet.create({
  container: {
    height: 20
  },
  text: {
    color: '#999',
    fontSize: 12,
  },
}: Styles)
```

However `type StyleValue = {[key: string]: Object}` doesn't make sense.  You actually want only the `Object` portion of that definition, presuming it's meant to be used like below:

```javascript
type MyTextProps = {
  style: StyleProp,
}

<MyText style={{ color: '#999', fontSize: 12 }}>Hello</Text>
```

 ---

I've also added `void` to the `StyleValue`, as undefined seems to be handled fine, and can be a useful shorthand in JSX.

 ---

And finally, I've allowed nesting of style prop arrays, by making StyleProp self-referencing, as RN seems to flatten those without issue.  This can be important if you're passing in a style prop quite high up the component tree, and sticking it in an array with other styles at several points while it's passed down.

N/A (These types aren't referenced anywhere else)

[INTERNAL] [MINOR] [StyleSheet] - Refine Flow types
Closes https://github.com/facebook/react-native/pull/16741

Reviewed By: frantic

Differential Revision: D6278010

Pulled By: TheSavior

fbshipit-source-id: 0170a233ab71d29f445786f5e695463f9730db3a
2017-11-09 11:58:15 -08:00
Erik Behrends 354e1cb508 Fix missing return in example
Summary:
Found this minor issue while reading the docs.

n/a

 [DOCS] [BUGFIX] [Libraries/Text/Text.js] - Add return to example
Closes https://github.com/facebook/react-native/pull/16752

Differential Revision: D6274215

Pulled By: hramos

fbshipit-source-id: ef735eb9179ab69d2ed1bc4a8b5e921d42d88fb0
2017-11-08 12:17:44 -08:00
Yujie Liu 1d6ce2311f Rename scaledAssetURLScript function to scaledAssetURLNearBundle
Reviewed By: zahanm

Differential Revision: D6272905

fbshipit-source-id: bff661fcadd73a5400cea422a8a5ac5db34717a8
2017-11-08 12:17:44 -08:00
Alex Dvornikov 963c61d4d5 Rename BundleFetcher to SegmentFetcher
Reviewed By: jeanlauliac

Differential Revision: D6271908

fbshipit-source-id: ed1259148ac5ca44789166e22d519a7a21f4cfd9
2017-11-08 07:46:26 -08:00
Miguel Jimenez Esun 16bbd908e7 Update Jest to 21.3.0-beta.8
Reviewed By: davidaurelio

Differential Revision: D6221784

fbshipit-source-id: 189e895378635dd21d14d6fb1f93510a52c90742
2017-11-08 07:03:30 -08:00
Yujie Liu b0193b098c Rename bundleUrl to jsbundleURL
Reviewed By: fkgozali

Differential Revision: D6236921

fbshipit-source-id: f1018836465ba6cf21679fe9d21c18eec762199d
2017-11-07 17:46:17 -08:00
Garrett McCullough cb6ec7c321 improve docs for KeyboardAvoidingView
Summary:
The documentation for `KeyboardAvoidingView` was pretty thin. Tried to fill it out more and corrected a couple words.

n/a

[DOCS] [ENHANCEMENT] [KeyboardAvoidingView] - Improve the documentation for the props for KeyboardAvoidingView

* **Who does this affect**: Users that are manually calling the methods on KeyboardingAvoidingView.
* **How to migrate**: Add an underscore before the name of the method
* **Why make this breaking change**: These methods are not meant to be public. For example, the exposed `onLayout` function is not a prop that accepts a function like is typical of the rest of React Native but is the internal method that is called when the component's onLayout is triggered.
* **Severity (number of people affected x effort)**: Low
Closes https://github.com/facebook/react-native/pull/16479

Differential Revision: D6261005

Pulled By: hramos

fbshipit-source-id: 7e0bcfb0e7cb6bb419964bd0b02cf52c9347c608
2017-11-07 11:57:22 -08:00
Dmitry Zakharov 1b71e03932 Make RN Events registered disregarding ViewManager use pattern.
Reviewed By: fromcelticpark

Differential Revision: D6260009

fbshipit-source-id: f3d00162f8473976264ebef040d01163950f2170
2017-11-07 11:32:34 -08:00
Adriano Melo e906525e84 Docs: Add example to CheckBox documentation
Summary:
I find it easier to understand the behavior of a component when there is a simple example showing its usage. I recently used the CheckBox component and noticed that it doesn't have a code example. This PR adds an example to the CheckBox documentation.

N/A

[DOCS][ENHANCEMENT][CheckBox] - Added example to documentation
Closes https://github.com/facebook/react-native/pull/16489

Differential Revision: D6260998

Pulled By: hramos

fbshipit-source-id: 7c6f9677741a4c0483eb1f5405cd05f8bbdd83aa
2017-11-07 11:06:44 -08:00
Adriano Melo 45ed142596 Docs: Improve BackHandler documentation (addEventListener and removeEventListener)
Summary:
This commit adds documentation to two methods of BackHandler API, addEventListener and removeEventListener. Despite being a simple change, it helps to keep the documentation consistent.

I have tested the `./website` locally, the changes look similar to some other components such as `NetInfo`.

[DOCS][ENHANCEMENT][BackHandler] - Improve BackHandler documentation (addEventListener and removeEventListener)
Closes https://github.com/facebook/react-native/pull/16618

Differential Revision: D6260935

Pulled By: hramos

fbshipit-source-id: ab04a9fca89ddaa1925844b5754caf1c355a9329
2017-11-07 10:53:59 -08:00
Chris Lewis 1c04ceeb4b Check against integer overflow in RCTNetworking decodeTextData
Summary:
It's currently possible to crash React Native on iOS when using XMLHTTPRequest with onreadystatechange by having the server send a bunch of bad unicode (we found the problem when a bad deploy caused this to happen).

This is due to an integer overflow when handling carryover data in decodeTextData.

Create Express server with mock endpoint:

```js
var express = require('express');
var app = express();

app.get('/', function(req, res) {
  res.writeHead(200, {'content-type': 'text/plain; charset=utf-8'});
  res.flushHeaders();
  res.write(new Buffer(Array(4097).join(0x48).concat(0xC2)));
  res.write(new Buffer([0xA9]));
  res.end();
});

app.listen(3000);
```

Create React Native application which tries to hit the endpoint:

```js
export default class App extends Component<{}> {
  componentDidMount() {
    const xhr = new XMLHttpRequest()
    xhr.open('get', 'http://localhost:3000', true);
    xhr.onreadystatechange = function () {
      if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
        console.warn(xhr.responseText);
      }
    };
    xhr.send();
  }

  render() {
    return null;
  }
}
```

Observe that the application crashes when running master and doesn't when including the changes from this pull request.

[IOS] [BUGFIX] [RCTNetworking] - |Check against integer overflow when parsing response|
Closes https://github.com/facebook/react-native/pull/16286

Differential Revision: D6060975

Pulled By: hramos

fbshipit-source-id: 650e401a3bc033725078ea064f8fbca5441f9db5
2017-11-07 08:08:41 -08:00
Omri Gindi a6465d1c17 Backed out changeset 322626be193e
Reviewed By: wutalman

Differential Revision: D6258856

fbshipit-source-id: 392dc91f87148c70817f13858a7fcd368f028b2d
2017-11-07 04:53:40 -08:00
William Li 26038f50bb Export YellowBox API
Summary:
Allow end users to access the YellowBox API so that warnings can be properly ignored via the API first introduced in a974c140db. Based on that API, you should be able to do the following:

```
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: ...']);
```

However, if you actually try this today, it results in a broken import error.

Verified using an expo instance. First tried without the YellowBox import, observed a failure to import. Then I added the import statement, and observed no warning on my device.

```
import React from 'react';
import { StyleSheet, Text, View, YellowBox } from 'react-native';

YellowBox.ignoreWarnings(['hey']);

export default class App extends React.Component {
  render() {
    console.warn('hey!');
    return (
      <View style={styles.container}>
        <Text>Open up App.js to start working on your app!</Text>
        <Text>Changes you make will automatically reload.</Text>
        <Text>Shake your phone to open the developer menu.</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
```

[GENERAL] [ENHANCEMENT] [YellowBox] - Export YellowBox API so warnings can be ignored using a non-deprecated API.
Closes https://github.com/facebook/react-native/pull/16709

Differential Revision: D6254819

Pulled By: hramos

fbshipit-source-id: ff92f32e4dedfb01f6902f54fabc62eb64468554
2017-11-06 17:44:37 -08:00
Jessica Cao 2be3ae1ff2 Add ?Fbt to flow type for the title & message props
Differential Revision: D6253195

fbshipit-source-id: eadb185eacdf341393d73357beab22bed1d0169e
2017-11-06 16:24:22 -08:00