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

3388 Коммитов

Автор SHA1 Сообщение Дата
Oleg Lokhvitsky ad21ad2559 Fix stale separator props and expose CellRenderer refs
Reviewed By: sahrens

Differential Revision: D5554920

fbshipit-source-id: 4b6ebc88603afeb642b2860c6069f28cb415d8be
2017-08-08 17:01:39 -07:00
dlowder-salesforce d9db3bc4bf Fishhook needs to support Apple TV
Summary:
**Motivation**

Fix compile error in Apple TV caused by RCTWebSocket using fishhook library.

**Test plan**

objc-tvos Travis tests are currently breaking, this should fix it.
Closes https://github.com/facebook/react-native/pull/15416

Differential Revision: D5587637

Pulled By: hramos

fbshipit-source-id: f05e765d7044650caf6d500fe21249e3fdc4f181
2017-08-08 16:06:08 -07:00
Emil Sjolander 878b7e42fa fishhook nwlog_legacy_v to avoid log spam on websocket reconnect
Reviewed By: mmmulani, javache

Differential Revision: D5570896

fbshipit-source-id: be98f500434bd2a0113b9abca20c9f21102c09d1
2017-08-08 08:20:08 -07:00
James Reggio 8d757e5ad7 Export `Animated.Node` for ease of type checking
Summary:
At present, there's no uniform way of determining whether you've received an Animated value node which can be attached to an animated prop.

You can attempt to use `instanceof Animated.Value`, but this fails for interpolated values. You can use `instanceof Animated.Interpolation`, but this fails for the values that are returned from the math functions (e.g., `Animated.Add`).

This commit exposes the base type from which all of these value nodes derive. As such, it is now possible to do the following:

```js
import React, { Component, PropTypes } from 'react';
import { Animated } from 'react-native';

class Widget extends Component {
  static propTypes = {
    progress: PropTypes.instanceOf(Animated.Node).isRequired,
  }
  // ...
}
```

Unnecessary for cosmetic change.
Closes https://github.com/facebook/react-native/pull/14688

Differential Revision: D5581539

Pulled By: shergin

fbshipit-source-id: 98f40e63a463241c7f91c72391c26c3b4153e4cd
2017-08-07 22:06:53 -07:00
Gant Laborde 2161f92aaf Add pertinent info for fresh flatlisters
Summary:
I just worked with a fellow dev who was switching to flatlist and ended up pretty surprised at the performance drop.  The measurement had an exponential bridge saturation, causing flatlist to lose to a scrollview!

We knew something was up, but a little note in the docs would have helped.
Closes https://github.com/facebook/react-native/pull/15400

Differential Revision: D5579483

Pulled By: sahrens

fbshipit-source-id: 2cc2488b6332db4f4d644c67f180088d3a5874a8
2017-08-07 17:58:42 -07:00
Pieter De Baets 16e96a5647 Remove unused RCTWebSocketObserverProtocol
Reviewed By: fromcelticpark

Differential Revision: D5573570

fbshipit-source-id: 18ea817b0308c8ac42a8c8a091bc24f77b23cfbb
2017-08-07 07:33:41 -07:00
Sebastian Lund 72dae519d0 Expose didCloseWithCode in RCTReconnectingWebSocket
Summary: Expose didCloseWithCode in RCTReconnectingWebSocket in order to get notified when the reconnecting websocket is closed by the end-point.

Reviewed By: javache

Differential Revision: D5573394

fbshipit-source-id: 78bffeb98c6bf32b059194fc07ffc1f0a7bf4aae
2017-08-07 07:04:36 -07:00
Pieter De Baets 220034c4d4 Configure requiresMainQueueSetup for core modules
Reviewed By: fkgozali

Differential Revision: D5528305

fbshipit-source-id: f17cad933685be09784b2246f44baf252bfa5a26
2017-08-07 07:04:36 -07:00
Jake Murzy 614dd077b3 add `pinchEnabled` prop to ScrollView
Summary:
When false, ScrollView disables use of pinch gestures to zoom in and out. This allows ScrollView's pinch gesture responder to be disabled to only allow zooming programmatically. The default value is ~false~ true.

**Test Plan**
Tested that pinch gesture responder is disabled when pinchEnabled=false.

/cc  nicklockwood sahrens

🍺
Closes https://github.com/facebook/react-native/pull/10037

Differential Revision: D5491953

Pulled By: shergin

fbshipit-source-id: eae16f92ec616e415b4ddacfccb84c697582daf9
2017-08-06 23:55:16 -07:00
Tina J ec74a9696a Set alertTitle in UILocalNotification
Summary:
Currently, since the alertTitle is not set in UILocalNotification, the notification displays just the notification body with no title. This commit sets the alertTitle for local notifications.

Issue: #14699

- In a sample RN app, created a component and added the following code to componentDidMount():
`PushNotificationIOS.scheduleLocalNotification({
     fireDate: new Date(Date.now() + (30 * 1000)).toISOString(),
     alertTitle: 'Incoming Message',
     alertBody: 'Test message',
     soundName: 'default'
 })`

- On running the app, the notification appears with both body and title once the component is mounted.

![settitle_fix](https://user-images.githubusercontent.com/4279549/28995873-f62c9866-7a11-11e7-9f29-95dba50ef40b.jpg)
Closes https://github.com/facebook/react-native/pull/15381

Differential Revision: D5572606

Pulled By: shergin

fbshipit-source-id: ce5d98ed595eedf51ac3da7dfd94de52cf80be3d
2017-08-06 20:22:21 -07:00
Hector Ramos 5be8c4af26 Cleanup stray markdown files, update contributing guidelines
Summary:
Several changes here. The `Text.md` and `PixelRatio.md` files were appended to the autodocs during site generation. This seemed excessive for just two files, so I've just merged the content into the autodocs themselves. It should help us simplify the website generation process in the future.

I've also merged IssueGuidelines.md and PullRequestGuidelines.md into the Contribution/Maintainers guidelines to improve their visibility.

Finally, I renamed Help to Community in the nav bar.

Ran the website locally, and verified every page rendered as expected: the Community page, Contributing page, Maintainers page.
Closes https://github.com/facebook/react-native/pull/15374

Differential Revision: D5567400

Pulled By: hramos

fbshipit-source-id: e06056edb12c9a17319fe1af46b2ef3a2e1b5854
2017-08-04 16:18:01 -07:00
Maxime Goovaerts 546a43bda0 Expose offset parameters for ToastAndroid
Reviewed By: brosenfeld

Differential Revision: D5560628

fbshipit-source-id: b1457493e8429958fbd7bc9c490cffaa33b4a95a
2017-08-04 09:07:21 -07:00
Pieter De Baets e697ed75d1 Report native warnings to YellowBox
Reviewed By: fkgozali

Differential Revision: D5553601

fbshipit-source-id: b80f019b11d02865a17a25cbff61edf65173cd84
2017-08-04 07:56:14 -07:00
glevi@fb.com f0f1b12d9e @allow-large-files [Flow] Deploy v0.52.0 to xplat
Reviewed By: samwgoldman

Differential Revision: D5548893

fbshipit-source-id: b772423f11ff53f85a29b002226c5581c073f9ff
2017-08-03 08:06:58 -07:00
Luy Tran ccb0899658 add setNativeProps to SectionList
Summary:
```js
componentDidMount() {
  this._list.setNativeProps({scrollEnabled: false})
}

render() {
  const sections = [
    {key: 'foo', data: [{name: 'Jone Doe', key: 'a'}, {name: 'Susan Briz', key: 'b'}],
    {key: 'bar', data: [{name: 'David Mark', key: 'c'}, {name: 'Daniel Campbell', key: 'd'}]
  ]

  return (
    <SectionList
      ref={c => (this._list = c)}
      sections={sections}
      renderItem={({item}) => <Text>{item.name}<Text>}
    />
  )
}
```
Closes https://github.com/facebook/react-native/pull/15328

Differential Revision: D5546636

Pulled By: javache

fbshipit-source-id: 25aec067879be1571db5c3a09b5f0952826220ac
2017-08-02 17:43:40 -07:00
Dmitry Patsura 30d5b9dbf5 RCTNavigatorManager - drop unneeded error callback
Summary:
Hey!

So, I was interested to contibure, and started from todo

Thank
Closes https://github.com/facebook/react-native/pull/14823

Differential Revision: D5546610

Pulled By: javache

fbshipit-source-id: 58e1b67786cbafa20399ac12dde9fcc3920abe94
2017-08-02 10:23:42 -07:00
Luke Rhodes cb1b1e58b3 Fixes unintended side effects caused by #14684
Summary:
I had fixed this locally but hadn't updated the original pull request, sorry. This commit is working for us in production.
Closes https://github.com/facebook/react-native/pull/14900

Differential Revision: D5539787

Pulled By: hramos

fbshipit-source-id: 6c826ada4a7f36607c65508ced6c9dce32002f74
2017-08-01 14:10:31 -07:00
Adlai Holler 114b0801ce RCTImage: Use C atomics instead of OSAtomic
Summary:
The next in my series of :atom: migrations.
Closes https://github.com/facebook/react-native/pull/15278

Differential Revision: D5526468

Pulled By: javache

fbshipit-source-id: 91511c69bc37a6f1382bcf0b0dd847adf10fd43a
2017-08-01 02:51:03 -07:00
Adam Miskiewicz 1954438533 Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView
Summary:
In iOS11, Apple added a new layout feature called "Safe Areas" (this blog post talks a bit about it: https://www.bignerdranch.com/blog/wwdc-2017-large-titles-and-safe-area-layout-guides/).

UIScrollView is one component that is affected by this change in Apple's API. When the `contentInsetAdjustmentBehavior` is set to `automatic`, for example, it will adjust the insets (and override any manually set insets) automatically based on whether or not there's a UINavigationBar, a UITabBar, a visible status bar, etc on the screen. Frustratingly, Apple decided to default to `Automatic` for this behavior, which will cause any apps that set contentInset/contentContainerStyle padding to have their values offset by, at the very least, the size of the status bar, when they compile their app for iOS 11. Here's more information about this behavior: https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior?language=objc

Mostly, this is a really straightforward change -- it simply adds a new iOS-only prop to ScrollView that allows setting `contentInsetAdjustmentBehavior`. But I did decide to default the behavior to `never`, so that it mimics the behavior we've seen in iOS < 11. I think it's good to keep something as crucial as scrollview content insets non-magical, and also keep it behaving similarly between platforms.
Closes https://github.com/facebook/react-native/pull/15023

Reviewed By: javache

Differential Revision: D5517552

Pulled By: hramos

fbshipit-source-id: c9ce4bf331b3d243228268d826fdd4dcee99981d
2017-07-31 12:23:34 -07:00
Pieter De Baets cb313569e5 Increase information logged to MessageQueue.spy
Reviewed By: dulinriley

Differential Revision: D5517734

fbshipit-source-id: de7ba08130d229882256bcb1496d6efc708bdce7
2017-07-31 06:16:41 -07:00
Adlai Holler 0f440130b6 Standardize project indentation settings on 2 spaces
Summary:
Hi React Native folks! Love your work!

To make contributing easier, this sets the indentation settings of all the Xcode projects to 2 spaces to match their contents.
Closes https://github.com/facebook/react-native/pull/15275

Differential Revision: D5526462

Pulled By: javache

fbshipit-source-id: cbf0a8a87a1dbe31fceed2f0fffc53839cc06e59
2017-07-31 05:20:03 -07:00
Adlai Holler 52d546caa2 CameraRoll: Use C atomic instead of OSAtomic
Summary:
The last in my series of :atom: migrations. More to come!
Closes https://github.com/facebook/react-native/pull/15279

Differential Revision: D5526467

Pulled By: javache

fbshipit-source-id: 02b37387c8c47af9ffe42b938ddcf17eb15b916f
2017-07-31 03:35:28 -07:00
Alexis Jacquelin 688c74693b Fix misspelling UIKit
Summary: Closes https://github.com/facebook/react-native/pull/15240

Differential Revision: D5524387

Pulled By: shergin

fbshipit-source-id: a35f40d24fd59c7a07b10504f1f64825da864b5d
2017-07-29 08:04:52 -07:00
Garrett McCullough 404d74bd1e update docs for Transforms
Summary:
Documentation change only.

Filled out the Transforms docs a little more to indicate which props are now deprecated and to provide some guidance on the transform array since some values are expected to be strings and some are numbers

http://facebook.github.io/react-native/docs/transforms.html
Closes https://github.com/facebook/react-native/pull/15261

Differential Revision: D5518925

Pulled By: hramos

fbshipit-source-id: 9aacf2c23e85573e150feb8c34e8bed54ad565d5
2017-07-28 12:49:01 -07:00
Tim Wang 0e93f4fa29 Fix SectionList examples in documentation
Summary:
Document to change http://facebook.github.io/react-native/releases/next/docs/sectionlist.html

This example is not documented incorrectly.

According to Flow-type in the [source code](https://github.com/facebook/react-native/blob/master/Libraries/Lists/SectionList.js#L25-L52) the `title` is not required and the `renderItem` method takes wrong `item.title` for rendering in example. See https://github.com/facebook/react-native/pull/15234#issuecomment-318555336

![screen shot 2017-07-28 at 12 24 03 pm](https://user-images.githubusercontent.com/8013313/28702472-b72d160a-738f-11e7-96ba-dcd7e8ce4ff2.png)
Closes https://github.com/facebook/react-native/pull/15234

Differential Revision: D5518721

Pulled By: hramos

fbshipit-source-id: 4effe3778aac09a0807acc8a002e588ea2d723f9
2017-07-28 12:49:01 -07:00
Jiajie Zhu bca825ee50 deprecate some usage of NetInfo
Reviewed By: wwjholmes

Differential Revision: D5493891

fbshipit-source-id: f86f034294f3fd07a535d2856ca6c7d4e2eb7824
2017-07-28 09:38:58 -07:00
Pieter De Baets 6ad5e2fa7c Breaking - Remove AdSupportIOS
Summary: We're focusing the React Native core on a set of high quality essential components and will be removing any modules that do not belong in that set. If you're currently using AdSuppportIOS, it will remain available in the react-native-deprecated-modules archive. There's also alternative implementations such as https://github.com/ptomasroos/react-native-idfa/.

Reviewed By: hramos

Differential Revision: D5388632

fbshipit-source-id: ce6204512b61242a0ba8c731836f3b3b7239b4b0
2017-07-26 13:32:41 -07:00
Saad Ismail 560bab17e1 Revert D5441491: [react-native][PR] Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView
Differential Revision: D5441491

fbshipit-source-id: 0ae920c6c020f41ee0fde38e57b735f87b26d4a9
2017-07-26 13:32:41 -07:00
Philipp von Weitershausen ed903099b4 Add blob implementation with WebSocket integration
Summary:
This is the first PR from a series of PRs grabbou and me will make to add blob support to React Native. The next PR will include blob support for XMLHttpRequest.

I'd like to get this merged with minimal changes to preserve the attribution. My next PR can contain bigger changes.

Blobs are used to transfer binary data between server and client. Currently React Native lacks a way to deal with binary data. The only thing that comes close is uploading files through a URI.

Current workarounds to transfer binary data includes encoding and decoding them to base64 and and transferring them as string, which is not ideal, since it increases the payload size and the whole payload needs to be sent via the bridge every time changes are made.

The PR adds a way to deal with blobs via a new native module. The blob is constructed on the native side and the data never needs to pass through the bridge. Currently the only way to create a blob is to receive a blob from the server via websocket.

The PR is largely a direct port of https://github.com/silklabs/silk/tree/master/react-native-blobs by philikon into RN (with changes to integrate with RN), and attributed as such.

> **Note:** This is a breaking change for all people running iOS without CocoaPods. You will have to manually add `RCTBlob.xcodeproj` to your `Libraries` and then, add it to Build Phases. Just follow the process of manual linking. We'll also need to document this process in the release notes.

Related discussion - https://github.com/facebook/react-native/issues/11103

- `Image` can't show image when `URL.createObjectURL` is used with large images on Android

The websocket integration can be tested via a simple server,

```js
const fs = require('fs');
const http = require('http');

const WebSocketServer = require('ws').Server;

const wss = new WebSocketServer({
  server: http.createServer().listen(7232),
});

wss.on('connection', (ws) => {
  ws.on('message', (d) => {
    console.log(d);
  });

  ws.send(fs.readFileSync('./some-file'));
});
```

Then on the client,

```js
var ws = new WebSocket('ws://localhost:7232');

ws.binaryType = 'blob';

ws.onerror = (error) => {
  console.error(error);
};

ws.onmessage = (e) => {
  console.log(e.data);
  ws.send(e.data);
};
```

cc brentvatne ide
Closes https://github.com/facebook/react-native/pull/11417

Reviewed By: sahrens

Differential Revision: D5188484

Pulled By: javache

fbshipit-source-id: 6afcbc4d19aa7a27b0dc9d52701ba400e7d7e98f
2017-07-26 08:23:20 -07:00
jooddang 91493f6b9d Update Modal.js
Summary:
you don't need curly bracket. `{}`

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15198

Differential Revision: D5497867

Pulled By: javache

fbshipit-source-id: a09f06aabc6ea16f0b0eec12bf910ffcab804eb0
2017-07-26 07:18:44 -07:00
Joey Baker d53d121956 Docs: fix typo in deeplinking docs
Summary:
Just a small typo in the docs, the suggested code uses a variable that doesn't exist and leads to a compile error.
Closes https://github.com/facebook/react-native/pull/15196

Differential Revision: D5490031

Pulled By: javache

fbshipit-source-id: cb1e15b22f0d8f282afb3943fb4f5d0dc5dad9e7
2017-07-26 07:18:44 -07:00
amin roosta f7579381cc Fix typo
Summary: Closes https://github.com/facebook/react-native/pull/15208

Differential Revision: D5497862

Pulled By: javache

fbshipit-source-id: c4ace0deebf339aad037675fc32210b1a9c316eb
2017-07-26 07:08:51 -07:00
Kody Greenbaum 26764d4179 Revert D5470356: [react-native] Increase information logged to MessageQueue.spy
Differential Revision: D5470356

fbshipit-source-id: 27b247ac3c538f801c1f9a86f74fb3098064e92e
2017-07-25 11:53:20 -07:00
Adam Miskiewicz 6e28b39d78 Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView
Summary:
In iOS11, Apple added a new layout feature called "Safe Areas" (this blog post talks a bit about it: https://www.bignerdranch.com/blog/wwdc-2017-large-titles-and-safe-area-layout-guides/).

UIScrollView is one component that is affected by this change in Apple's API. When the `contentInsetAdjustmentBehavior` is set to `automatic`, for example, it will adjust the insets (and override any manually set insets) automatically based on whether or not there's a UINavigationBar, a UITabBar, a visible status bar, etc on the screen. Frustratingly, Apple decided to default to `Automatic` for this behavior, which will cause any apps that set contentInset/contentContainerStyle padding to have their values offset by, at the very least, the size of the status bar, when they compile their app for iOS 11. Here's more information about this behavior: https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior?language=objc

Mostly, this is a really straightforward change -- it simply adds a new iOS-only prop to ScrollView that allows setting `contentInsetAdjustmentBehavior`. But I did decide to default the behavior to `never`, so that it mimics the behavior we've seen in iOS < 11. I think it's good to keep something as crucial as scrollview content insets non-magical, and also keep it behaving similarly between platforms.
Closes https://github.com/facebook/react-native/pull/15023

Differential Revision: D5441491

Pulled By: shergin

fbshipit-source-id: 7b56ea290f7f6eca5f1d996ff8488f40b866c2e6
2017-07-25 10:28:42 -07:00
Pieter De Baets f445ac8ef1 Increase information logged to MessageQueue.spy
Reviewed By: dulinriley

Differential Revision: D5470356

fbshipit-source-id: 663dfa4e0c8cc5292e27f607111fc35a565a0bd8
2017-07-25 08:01:28 -07:00
Pieter De Baets ec14db1abc Cleanup ifdef's in JSCExecutor
Reviewed By: kathryngray

Differential Revision: D5433407

fbshipit-source-id: 104e8e5589d9c5e09c6702992eac3db2e6b4ab1a
2017-07-25 05:02:03 -07:00
Pieter De Baets ca9e26cecd Mark non-extern strings static
Reviewed By: shergin

Differential Revision: D5479934

fbshipit-source-id: 2dcf873f44c4847e838d0fae10ecd754d43be262
2017-07-25 04:49:46 -07:00
Aleksei Androsov 6555f9bee8 Fix photo orientation from ImagePickerIOS
Summary:
Original PR: https://github.com/facebook/react-native/pull/12249

ImagePickerIOS saves photos to ImageStoreManager without meta information. So photo has wrong orientation.

**Test plan**
1. Take the 2 photos (in landspape and portrait orientation) with this code:
```
ImagePickerIOS.openCameraDialog(
  {},
  (uri) => CameraRoll.saveToCameraRoll(uri),
  () => {}
);
```
2. Ensure that photos in Photos app have right orientation.
Closes https://github.com/facebook/react-native/pull/15060

Differential Revision: D5487595

Pulled By: shergin

fbshipit-source-id: ce1a47f4d5ba33e03070f318f3d6a8dd0df5ab88
2017-07-24 21:51:51 -07:00
Spencer Ahrens eec58237ce gets Relay/Classic/Compat building
Reviewed By: fkgozali

Differential Revision: D5482765

fbshipit-source-id: 0a7c2b8d99256352f09b6510ec8ca1631425e232
2017-07-24 21:39:00 -07:00
Adam Comella fc38fe1736 DEPRECATION: Make NetInfo API cross platform and expose whether connection is 2g/3g/4g
Summary:
This change intends to fix 2 issues with the NetInfo API:
  - The NetInfo API is currently platform-specific. It returns completely different values on iOS and Android.
  - The NetInfo API currently doesn't expose a way to determine whether the connection is 2g, 3g, or 4g.

The NetInfo API currently just exposes a string-based enum representing the connectivity type. The string values are different between iOS and Andorid. Because of this design, it's not obvious how to achieve the goals of this change without making a breaking change. Consequently, this change deprecates the old NetInfo APIs and introduces new ones. Specifically, these are the API changes:
  - The `fetch` method is deprecated in favor of `getConnection`
  - The `change` event is deprecated in favor of the `connectionchange` event.
  - `getConnection`/`connectionchange` use a new set of enum values compared to `fetch`/`change`. See the documentation for the new values.
    - On iOS, `cell` is now known as `cellular`. It's worth pointing out this one in particular because the old and new names are so similar. The rest of the iOS values have remained the same.
    - Some of the Android enum values have been removed without a replacement (e.g. `DUMMY`, `MOBILE_DUN`, `MOBILE_HIPRI`, `MOBILE_MMS`, `MOBILE_SUPL`, `VPN`). If desirable, we could find a way to expose these in the new API. For example, we could have a `platformValue` key that exposes the platform's enum values directly (like the old `fetch` API did).

`getConnection` and `connectionchange` each expose an object which has 2 keys conveying a `ConnectionType` (e.g. wifi, cellular) and an `EffectiveConnectionType` (e.g. 2g, 3g). These enums and their values are taken directly from the W3C's Network Information API spec (https://wicg.github.io/netinfo/). Copying the W3C's API will make it easy to expose a `navigation.connection` polyfill, if we want, in the future. Additionally, because the new APIs expose an object instead of a string, it's easier to extend the APIs in the future by adding keys to the object without causing a breaking change.

Note that the W3C's spec doesn't have an "unknown" value for `EffectiveConnectionType`. I chose to introduce this non-standard value because it's possible for the current implementation to not have an `effectiveConnectionType` and I figured it was worth representing this possibility explicitly with "unknown" instead of implicitly with `null`.

**Test Plan (required)**

Verified that the methods (`fetch` and `getConnection`) and the events (`change` and `connectionchange`) return the correct data on iOS and Android when connected to a wifi network and a 4G cellular network. Verified that switching networks causes the event to fire with the correct information. Verified that the old APIs (`fetch' and 'change') emit a deprecation warning when used. My team is using a similar patch in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/14618

Differential Revision: D5459593

Pulled By: shergin

fbshipit-source-id: f1e6c5d572bb3e2669fbd4ba7d0fbb106525280e
2017-07-24 15:50:53 -07:00
Eric Rozell 59105f6b1e Adds hook for platform-specific View props
Summary:
Platforms that plug in to react-native may require additional props that are specific to those platforms. For example, already in react-native there are props that are specific to Android (`accessibilityComponentType`, `needsOffscreenAlphaCompositing`, etc.), props that are specific to iOS (`accessibilityTraits`, `shouldRasterizeIOS`, etc.) and props that are specific to tvOS (`isTVSelectable`, `tvParallaxProperties`, etc.).

I need to add properties to `react-native-windows`, and I'd prefer not to override the entire `ViewPropTypes` file as it is a risk that things in react-native-windows fall out of sync with react-native.

Fixes #15173

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15175

Differential Revision: D5481444

Pulled By: hramos

fbshipit-source-id: 3da08716d03ccdf317ec447536eea3699dd7a760
2017-07-24 12:26:58 -07:00
Jason Gaare f7043699b0 Use Apple's significant-change API (for iOS 11 UX)
Summary:
In the yet-to-be-released iOS 11, Apple has changed the way they notify the user of location services. (You can watch their session from WWDC about all the changes [here](https://developer.apple.com/videos/play/wwdc2017/713/).)

The current implementation of `RCTLocationObserver` uses the standard location services from Apple. When the user has granted `Always` location permission and the application uses the background location service, the user is presented with the *_Blue Bar of Shame_* (for more information check out [this blog post](https://blog.set.gl/ios-11-location-permissions-and-avoiding-the-blue-bar-of-shame-1cee6cd93bbe)):

![image](https://user-images.githubusercontent.com/15896334/28285133-281e425c-6af9-11e7-9177-61b879ab593c.png)

* Added `useSignificantChanges` boolean to the options passed.

* Added `_usingSignificantChanges` boolean based on user options. If `true`, then the CLLocationManager will use functions `startMonitoringSignificantLocationChanges`/ `stopMonitoringSignificantLocationChanges` rather than the standard location services.
* Changed method signature of `beginLocationUpdatesWithDesiredAccuracy` to include `useSignificantChanges` flag
* Added check for new `NSLocationAlwaysAndWhenInUseUsageDescription`

All unit tests passed.

Tested in simulator and on device, toggling `useSignificantChanges` option when calling `watchPosition`. Results were as expected. **When `TRUE`, the _Blue Bar of Shame_ was not present.**

Changes do not affect Android and location services still work as expected on Android.

* Change is for iOS only
* Using a different API will have different accuracy results. Adding `useSignificantChanges` as an option was by design so apps that want to have most accurate and most frequent update can still use standard location services.
Closes https://github.com/facebook/react-native/pull/15062

Differential Revision: D5443331

Pulled By: javache

fbshipit-source-id: 0cf5b6cd831c5a7c8c25a5ddc2e410a9aa989bf4
2017-07-24 11:23:10 -07:00
Taylor Kline 64899c08f3 Identify keyboardDismissMode platform-specific options
Summary:
Similar to `TextInput`'s `returnKeyType`, comments allow to see at a glance which options are cross-platform and which are not.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14780

Differential Revision: D5480895

Pulled By: hramos

fbshipit-source-id: c38337def920678d29c8322e52b54f57e80cb95b
2017-07-24 11:23:10 -07:00
Isaac Odhiambo 3683ff8d95 Update DrawerLayoutAndroid.android.js
Summary:
Currently in the documentation is not clear on how to use the `openDrawer` and `closeDrawer` methods. There is no mention of the requirement to use refs in order to access the Drawer. This should make it clear on how to do the above.
Closes https://github.com/facebook/react-native/pull/13961

Differential Revision: D5479993

Pulled By: hramos

fbshipit-source-id: 4d29f695fbaf097d47f75b345b9998f61156f467
2017-07-24 08:16:25 -07:00
Alex Dvornikov 9342f25d5f Inline requires in JSTimers
Reviewed By: javache

Differential Revision: D5466322

fbshipit-source-id: 0bcc71e19cdb48d95b5e35ae2f720d46baf9bb50
2017-07-24 07:20:34 -07:00
Alex Dvornikov 5da7629b44 Clean up property defines in InitializeCore
Reviewed By: javache

Differential Revision: D5472176

fbshipit-source-id: feb81bd9ee04eb7e54d51524c367b10b385b33ae
2017-07-24 07:20:34 -07:00
Alex Dvornikov 0736f5d190 Make Set and Map initialization lazy
Reviewed By: javache

Differential Revision: D5461810

fbshipit-source-id: 6f22528bac4dd6e073e98a093e02d84114d0706a
2017-07-24 07:20:33 -07:00
Pieter De Baets cb12080179 Replace exported method registration with statically allocated struct
Reviewed By: fromcelticpark

Differential Revision: D5389383

fbshipit-source-id: 9eb29b254b616574966b43ad24aa880d44589652
2017-07-24 07:01:53 -07:00
Pieter De Baets db3df3400a Breaking - make RCTDeviceEventEmitter warnings fatal
Reviewed By: davidaurelio

Differential Revision: D5469832

fbshipit-source-id: 1eb4ad3a2b3e1fa10d75e42d1d2f7baa291cb6f4
2017-07-24 03:47:59 -07:00
Tomas Reimers 3eae3df5d1 Add docs for onMomentumScrollBegin
Summary:
<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15158

Differential Revision: D5479401

Pulled By: shergin

fbshipit-source-id: d4864e1630a36deb1a227c1b6242255ac1f788e6
2017-07-24 01:17:30 -07:00