Commit Graph

2472 Commits

Author SHA1 Message Date
Laguana 7dbc8051e5 Fix symbolication outside of chrome debugging
Summary:
When debugging in VScode or nucleide using a nodejs environment rather than chrome, the JS sources are made to appear as if they exist on disk, rather than coming from a `http://` url. Prior to this change the packager would see these file paths and not know how to handle them.

Since all the application JS will be part of a bundle file, we can switch out the path to the bundle on the filesystem with paths to the bundle served by the packager, and things will work just as though it was debugging in chrome. We stop the replacement once we reach an internal module (`vm.js` in the case of both nucleide and VSCode) since that is the point when the execution switches from inside the app to the surrounding debugging environment.

I've verified that this fixes redbox stack trace symbolication in VSCode, and from my understanding of nucleide's debugging environment it should also work there without requiring any changes.
Closes https://github.com/facebook/react-native/pull/9906

Differential Revision: D3887166

Pulled By: davidaurelio

fbshipit-source-id: e3a6704f30e0fd045ad836bba51f6e20d9854c30
2016-09-19 10:58:40 -07:00
Damien 644b93dc11 Add very basic usage example for android toast
Summary:
Currently, it's hard to find out that it's very easy to use android toasts. The example is very complex and hard to grasp for a beginner. So, I propose to add an easy to understand example.

I'm sure the syntax of this PR is not really correct, it's just a start to show the kind of thing I propose.
Closes https://github.com/facebook/react-native/pull/9859

Differential Revision: D3886274

Pulled By: donyu

fbshipit-source-id: 15e693f5ddb1efea0fc6b7accfa688fd5f99a100
2016-09-19 06:43:54 -07:00
Pieter De Baets 145109fc6d Remove additional JSON encoding for native->JS communication
Reviewed By: mhorowitz

Differential Revision: D3857323

fbshipit-source-id: 4386cc107b8a1425ecb7297b0f659f6c47f01a78
2016-09-19 04:44:12 -07:00
Janic Duplessis 6565929358 Add support for animated events
Summary:
This adds support for `Animated.event` driven natively. This is WIP and would like feedback on how this is implemented.

At the moment, it works by providing a mapping between a view tag, an event name, an event path and an animated value when a view has a prop with a `AnimatedEvent` object. Then we can hook into `EventDispatcher`, check for events that target our view + event name and update the animated value using the event path.

For now it works with the onScroll event but it should be generic enough to work with anything.
Closes https://github.com/facebook/react-native/pull/9253

Differential Revision: D3759844

Pulled By: foghina

fbshipit-source-id: 86989c705847955bd65e6cf5a7d572ec7ccd3eb4
2016-09-19 04:14:01 -07:00
Gaëtan Renaudeau 19d0429a76 Expose getNode() on component created with createAnimatedComponent
Summary:
see also: eb3360b02a (commitcomment-19042340)

commit eb3360b02a recently break some third libraries that was (weakly) relying on traversing `animatedNode.refs.node` to get the original node of the decorated (animated) component (at least 2 libs: gl-react-native and react-native-material-kit).
Instead of now doing `animatedNode._component` (that might later break again), getNode() is a more 'public' solution for these third party.

as you expose a way to create an animated component (`createAnimatedComponent`) you sometimes still want a way to get the reference.
That way, third party components can continue providing some extra native methods to the animated version.
Closes https://github.com/facebook/react-native/pull/9944

Differential Revision: D3885973

Pulled By: foghina

fbshipit-source-id: 43ffdbfe7f9c52f5a1689e6a9a4052d4973f5c5f
2016-09-19 03:58:28 -07:00
Eric Vicenti a36ccf227d Clean up unused mock for NavigationRootContainer
Reviewed By: fkgozali

Differential Revision: D3859089

fbshipit-source-id: 265488e88c09aed59c465aa9c3b93e84937659d4
2016-09-18 17:58:38 -07:00
Muhammad Raihan Muhaimin 9ee815f6b5 Added name of the file with camera roll pictures
Summary:
Added name parameter when delivering the camera roll images using react native CameraRoll library. Based on http://stackoverflow.com/questions/37283976/react-native-get-photo-name-from-camera-roll-ios
Closes https://github.com/facebook/react-native/pull/9961

Differential Revision: D3883582

Pulled By: majak

fbshipit-source-id: 5bfd1eb0601b3ce2ef1cdb4485060661d2fbad32
2016-09-17 20:43:42 -07:00
Pieter De Baets 95cce07baf Support invoking method that returns result and flushes call queue
Reviewed By: mhorowitz

Differential Revision: D3870879

fbshipit-source-id: bc8f70d9866dfc25468c9072c209cc6842b98575
2016-09-16 06:28:48 -07:00
leeight 5d35df8afa Add missing return, FIX #9886
Summary:
cc sahrens

FIX #9886
Closes https://github.com/facebook/react-native/pull/9938

Differential Revision: D3875766

Pulled By: sahrens

fbshipit-source-id: c3eb7f8203db80403de3b789eea907651bc333da
2016-09-15 22:43:36 -07:00
Spencer Ahrens 3b5e4cc593 Fix InteractionManager promise issue with some OSS setups
Reviewed By: yungsters

Differential Revision: D3860551

fbshipit-source-id: 731ba758e28ce24f12ca80f7be0f962e6929ee2c
2016-09-15 15:13:35 -07:00
Janic Duplessis d0d1712851 Reverted commit D3827366
Summary:
This adds support for sticky headers on Android. The implementation if based primarily on the iOS one (https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L272) and adds some stuff that was missing to be able to handle z-index, view clipping, view hierarchy optimization and touch handling properly.

Some notable changes:
- Add `ChildDrawingOrderDelegate` interface to allow changing the `ViewGroup` drawing order using `ViewGroup#getChildDrawingOrder`. This is used to change the content view drawing order to make sure headers are drawn over the other cells. Right now I'm only reversing the drawing order as drawing only the header views last added a lot of complexity especially because of view clipping and I don't think it should cause issues.

- Add `collapsableChildren` prop that works like `collapsable` but applies to every child of the view. This is needed to be able to reference sticky headers by their indices otherwise some subviews can get optimized out and break indexes.
Closes https://github.com/facebook/react-native/pull/9456

Differential Revision: D3827366

Pulled By: fred2028

fbshipit-source-id: d346068734c5b987518794ab23e13914ed13b5c4
2016-09-15 12:13:39 -07:00
Janic Duplessis 0e8b75b22c Implement ScrollView sticky headers on Android
Summary:
This adds support for sticky headers on Android. The implementation if based primarily on the iOS one (https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L272) and adds some stuff that was missing to be able to handle z-index, view clipping, view hierarchy optimization and touch handling properly.

Some notable changes:
- Add `ChildDrawingOrderDelegate` interface to allow changing the `ViewGroup` drawing order using `ViewGroup#getChildDrawingOrder`. This is used to change the content view drawing order to make sure headers are drawn over the other cells. Right now I'm only reversing the drawing order as drawing only the header views last added a lot of complexity especially because of view clipping and I don't think it should cause issues.

- Add `collapsableChildren` prop that works like `collapsable` but applies to every child of the view. This is needed to be able to reference sticky headers by their indices otherwise some subviews can get optimized out and break indexes.
Closes https://github.com/facebook/react-native/pull/9456

Differential Revision: D3827366

fbshipit-source-id: cab044cfdbe2ccb98e1ecd3e02ed3ceaa253eb78
2016-09-14 20:43:29 -07:00
leeight 3182b608fc Fix invalid package name and Remove unsupported prop in Image.android.js
Summary:
1. `textfrescosupport` -> `text.frescosupport`
2. `defaultImageSrc`, `imageTag` and `progressHandlerRegistered` looks like never exists in `ReactImageManager.java`
Closes https://github.com/facebook/react-native/pull/9885

Differential Revision: D3864980

fbshipit-source-id: 48a85563c60b6853c505177558520f5e48f4eb03
2016-09-14 13:43:48 -07:00
Emil Sjolander a6e1e33a50 Reverted commit D3855801
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 3c365f9e6ef612fd9d9caaaa8c650e9702176e77
2016-09-14 11:28:34 -07:00
Emil Sjolander 1f9c9ecb4b BREAKING - Fix unconstraint sizing in main axis
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 6077b0bcb68fe5ddd4aa22926acab40ff4d83949
2016-09-14 09:14:02 -07:00
Satyajit Sahoo 3e153b2a5b Remove react-native.js.flow
Summary:
We've enabled getters in .flowconfig, so Flow will now understand react-native.js. We no longer need to maintain a separate file for Flow.

cc bestander
Closes https://github.com/facebook/react-native/pull/9892

Differential Revision: D3862560

Pulled By: bestander

fbshipit-source-id: 9efb66bc885dbac80c18b4b5e3cf5362495928a9
2016-09-14 02:58:40 -07:00
Spike Brehm 157febcd54 Point to airbnb/react-native-maps
Summary:
We've moved https://github.com/lelandrichardson/react-native-maps to
https://github.com/airbnb/react-native-maps. Update the docs to reflect
the change.

to: lelandrichardson
Closes https://github.com/facebook/react-native/pull/9873

Differential Revision: D3855581

fbshipit-source-id: b4a2dd3a9125878694e9b7a7aecdc4c90961a185
2016-09-13 01:13:45 -07:00
Atticus White 2e4ab9ff70 Bugfix - Only add valid IOSPicker items.
Summary:
Fixes https://github.com/facebook/react-native/issues/9216.

As nickzuber describes in #9216, conditional `Picker.Item` elements will lead to exceptions downstream when the `Picker` attempts to construct the collection of items.

[In the picker source](a2fb703bbb/Libraries/Components/Picker/PickerIOS.ios.js (L48-L53)) we can see that `child.props` is accessed when `child` has the potential to be an invalid `React` element.

```js
ReactChildren.forEach(props.children, function (child, index) {
  if (child.props.value === props.selectedValue) {
    selectedIndex = index;
  }
  items.push({value: child.props.value, label: child.props.label});
});
```

This change ensures the incoming element is valid

```diff
ReactChildren.forEach(props.children, function (child, index) {
+ if (!React.isValidElement(child)) {
+   return;
+ }
  if (child.props.value === props.selectedValue) {
    selectedIndex = index;
  }
  items.
Closes https://github.com/facebook/react-native/pull/9243

Differential Revision: D3847514

Pulled By: spicyj

fbshipit-source-id: f46fbd4b0f81de7a92e1ca3e60b5ed15a9cbbf78
2016-09-10 21:43:37 -07:00
Pieter De Baets 5f381fd357 Move buildStyleInterpolator-test to open-source, remove unused files
Reviewed By: bestander

Differential Revision: D3820939

fbshipit-source-id: 2ff114326642b522f162c6cce7853c8b3f0c138b
2016-09-09 10:58:59 -07:00
Pieter De Baets 53eaf9062d Replace local copy of TimerMixin with module from npm.
Reviewed By: spicyj, davidaurelio

Differential Revision: D3819543

fbshipit-source-id: 69d68a7653fce05a31cbfd61e48878b7a0a2ab51
2016-09-09 10:13:41 -07:00
leeight 6efe8e1d81 ViewPagerAndroid: FIX folly::toJson: JSON object value was a NaN or INF
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

Under certain scenario, `PageScrollEvent.offset` was initialized to `NaN`, which cause `folly::toJson` failed, and FIX #9750

<e71ecb2c4d/core/java/com/android/internal/widget/ViewPager.java (L1689)>

![image](https://cloud.githubusercontent.com/assets/104052/18266416/2a01f882-744d-11e6-86c4-3a2de3a1ca25.png)

**Test plan (required)**

<http://stackoverflow.com/questions/39327429/reactnative-viewpagerandroid-rcteventemitter>
Closes https://github.com/facebook/react-native/pull/9755

Differential Revision: D3841674

Pulled By: andreicoman11

fbshipit-source-id: d4cd9f4b2f61daad9005a098161ad7f75555345d
2016-09-09 08:58:46 -07:00
yunfeng 8ebe66d0e3 Added the PushFromLeft animation to Navigator
Summary:
Added the  PushFromLeft animation to Navigator
Closes https://github.com/facebook/react-native/pull/8911

Differential Revision: D3841403

Pulled By: mkonicek

fbshipit-source-id: d8e388e507270a24be0b85cb5974d34f9aa1c6fa
2016-09-09 06:28:34 -07:00
Pieter De Baets 4b8688926b Revert "Remove RCTLog from prod builds"
Reviewed By: lexs

Differential Revision: D3836952

fbshipit-source-id: 71327cdaa63b2641c225170b158edde4b14024b4
2016-09-09 05:43:35 -07:00
Rob Hogan 384ebac28a Docs - explain how to access the geolocation API
Summary:
Explain that, unlike other APIs, geolocation follows the browser spec and is exposed through `navigator.geolocation` rather than as an `react-native` export.

This can be inferred from the example code but isn't otherwise stated in the docs. See also https://github.com/facebook/react-native/pull/9793
Closes https://github.com/facebook/react-native/pull/9810

Differential Revision: D3841341

Pulled By: javache

fbshipit-source-id: b1423e8bf7fb78c788f5cdc5630a4a948b8178c6
2016-09-09 05:43:35 -07:00
Adam Comella b6735f3391 Enable developers to force Fresco to resize an image
Summary:
Here's a little background. Resizing is inferior to scaling. See http://frescolib.org/docs/resizing-rotating.html#_

Currently, React Native has a heuristic to use resize when the image is likely to be from the device's camera. However, there may be other cases where a developer wants to use resize. For example, when the developer knows they'll be downloading a large image from a service but the image will be rendered at a small size on the device.

This change adds a `resizeMethod` prop to the `Image` component so developers can choose how Fresco resizes the image. The options are 'auto', 'resize', or 'scale'. When 'auto' is specified, a heuristic is used to choose between 'resize' and 'scale'. The default value is 'auto'.

**Test plan (required)**

In a small test app, verified that the `resizeMethod` prop properly influences the mechanism that is used to resize the image (e.g. resize or scale).

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

Differential Revision: D3841322

Pulled By: foghina

fbshipit-source-id: 6c78b5c75ea73053aa10386afd4cbff45f5b8ffe
2016-09-09 05:13:53 -07:00
Jacob Parker 9e6e573e19 NavigatorIOS System Icon Support
Summary:
Continuation on #3959 (started by cancan101). Rebased to latest master, adds support for left system icon, fixes issues mentioned in previous PR.

<img width="432" alt="screen shot 2016-09-05 at 13 54 41" src="https://cloud.githubusercontent.com/assets/7275322/18248478/5b7aa25c-7370-11e6-8c51-01a2b7fd1030.png">
Closes https://github.com/facebook/react-native/pull/9742

Differential Revision: D3836850

Pulled By: javache

fbshipit-source-id: ef9f6e42211ed18bf5f3dc1eb7a8b1318d939674
2016-09-08 17:58:50 -07:00
Andrew Grewell 7b18b2c409 check if this._navBar has immediatelyRefresh method
Summary:
`Navigator` throws an error if using a custom `NavigationBar` component that does not have a `immediatelyRefresh` method present.
Closes https://github.com/facebook/react-native/pull/9438

Differential Revision: D3838928

Pulled By: mkonicek

fbshipit-source-id: 74d62ef09e179f457a4b14f8537dfaf0d4697322
2016-09-08 17:28:57 -07:00
Dmitry Petukhov 6b42d5c952 Updating Websocket readyState in case of websocketFailed event
Summary:
Fix for https://github.com/facebook/react-native/issues/9465

We are building a react-native based application which extensively uses WebSockets. The Android app crashes right after waking up being in suspended mode for a coupe of days and throws an exception:

"Cannot send a message. Unknown WebSocket id 1"

Before calling WebSocket.send(...) method from WebSocket.js we always check its readyState. I believe the problem is caused by not updating readyState if case of 'websocketFailed' event. this.close() cause the current used websocket ID to be removed from mWebSocketConnections HashMap (WebSocketModule.java), but readyState stays the same.
Closes https://github.com/facebook/react-native/pull/9487

Differential Revision: D3838675

Pulled By: mkonicek

fbshipit-source-id: e833cef9f1b94c6f7236077241cacf5a56f5824b
2016-09-08 17:13:45 -07:00
Ron Heft b0c13ebe02 Allow PhotoKit to download photos from iCloud
Summary:
Resolves #7081 by allowing iCloud to download photos not stored on the device.

**Test plan (required)**

1. Verified existing photos stored on the device still display.
2. Deleted my iCloud photo library from my phone and verified the image downloads and displays.
Closes https://github.com/facebook/react-native/pull/9530

Differential Revision: D3838470

Pulled By: mkonicek

fbshipit-source-id: 810830a4246714b6e166e4411f3fa848b1f1b71c
2016-09-08 16:28:35 -07:00
James Ide ad24bcf7cc Remove guard that we used in iOS 7 to avoid a JS crash
Summary:
JSC on iOS 8 and above includes TypedArrays so there's no need for the guard statement anymore since React Native officially does not support iOS 7 moving forward.
Closes https://github.com/facebook/react-native/pull/9780

Differential Revision: D3834979

Pulled By: mkonicek

fbshipit-source-id: 6e28a47702d6e3d604fedb9d2d00fe1c539a6926
2016-09-08 07:43:52 -07:00
Tobias Ritzau 3eb4bae138 Disables munging in animated to make dynamic dispatch work for private methods
Reviewed By: javache

Differential Revision: D3828458

fbshipit-source-id: 0170b199e4dc33df1d836de7475900dd95c4d2e7
2016-09-08 05:44:08 -07:00
Tobias Ritzau 3ff4ee961c Fix bad type specification in animated
Reviewed By: javache

Differential Revision: D3828502

fbshipit-source-id: 8270b00053d25f72d50f79f895ea77981e3000bb
2016-09-08 04:43:28 -07:00
Pieter De Baets 99e0267c25 Cleanup and document native module configuration
Summary: Get rid of the old behaviour of JSON encoding in `nativeRequireModuleConfig` and consistently use the same names for function types "async/promise/sync"

Reviewed By: lexs

Differential Revision: D3819348

fbshipit-source-id: fc798a5abcaf6a3ef9d95bd8654afa7825c83967
2016-09-08 04:13:51 -07:00
Anton Kuznetsov efd8b10135 Brings accessibilityLabel into PickerAndroid
Summary:
Hi!

I found problem with accessibilityLabel on PickerAndroid.
There's no value in content-desc attribute while accessibilityLabel is correct.
I found that accessibilityLabel is not propagated into native components via
native props.

This PR brings accessibilityLabel for PickerAndroid.

Without this solution my appium tests fails, for example:

My code:
```jsx
<Picker
    style={this.props.style}
    selectedValue={this.props.value}
    onValueChange={this.onChange}
    disabled={this.props.disabled}
    accessibilityLabel="select_wineType">
    // Chilren
</Picker>
```

```sh
✖  Error: element (~select_wineType) still not visible after 5000ms
```
Because xml of this view is (look into content-desc of Spinner):
```xml
<android.widget.Spinner index="0" text="" class="android.widget.Spinner" package="com.hello_github" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="true" long-clickable="false" password=
Closes https://github.com/facebook/react-native/pull/8873

Differential Revision: D3831691

Pulled By: spicyj

fbshipit-source-id: a494f22cb8be8cd6964981fe7ef7d9ff3773bcce
2016-09-07 16:58:30 -07:00
Mehdi Mulani de3457f31d Allow <Modal /> to be presented in different orientations
Reviewed By: javache

Differential Revision: D3760002

fbshipit-source-id: 01f5c246fb0fc041ec2d63b4ef80de858fb6fdf2
2016-09-07 13:10:11 -07:00
Spencer Ahrens 6fb149596a Use Batchinator in WindowedListView
Summary: Cleans things up and also defers rendering rows if there is an interaction happening.

Reviewed By: achen1

Differential Revision: D3817231

fbshipit-source-id: fd08d0ca7cb6c203178f27bfc5a0f55469135c3a
2016-09-06 22:43:27 -07:00
Spencer Ahrens 322c160fb1 Add some stall stuff as settings to native animated example
Reviewed By: fkgozali

Differential Revision: D3817885

fbshipit-source-id: 047f806411982aafdf7420eebadff063f56fee69
2016-09-06 19:58:35 -07:00
Janic Duplessis e26c135746 Add support for DiffClamp node
Summary:
Add native support on iOS and Android for `Animated.diffClamp` that was added in #9419.

**Test plan**
Tested that it works properly using the native animations UIExplorer example.
Closes https://github.com/facebook/react-native/pull/9691

Differential Revision: D3813440

fbshipit-source-id: 48a3ecddf3708fa44b408954d3d8133ec8537f21
2016-09-06 15:43:35 -07:00
Janic Duplessis 6d978c3c8b Add support for extrapolation
Summary:
Adds support for the `extrapolate` parameter on the native interpolation node. This is pretty much a 1 to 1 port of the JS implementation.

**Test plan**
Tested by adding the `extrapolate` parameter in the native animated UIExplorer example.
Closes https://github.com/facebook/react-native/pull/9366

Differential Revision: D3824154

fbshipit-source-id: 2ef593af827a8bd3d7b8ab2d53abbdc9516c6022
2016-09-06 15:28:38 -07:00
Spencer Ahrens 5eaef1c631 Introduce Batchinator
Reviewed By: devknoll

Differential Revision: D3796349

fbshipit-source-id: 2e23a2361a612107596cf6381e67252238e970bf
2016-09-06 14:43:46 -07:00
Gabe Levi 85a6f011b6 Deploy v0.32.0
Reviewed By: jeffmo

Differential Revision: D3821852

fbshipit-source-id: 01fd16707cba860a830d682a2af2bdd542605abf
2016-09-06 13:43:47 -07:00
Ian MacLeod 4f89fa9cf3 registration error event
Summary:
This is an updated version of #2336 and #7694.

 ---

This adds a `registrationError` event that is emitted by `PushNotificationIOS` whenever an application receives a registration error from APNS (APNS service failure, running on simulator, etc).  This event fires to the exclusion of the `register` event (and vice versa).

**How to use**

Add the following to your `AppDelegate.m`:

```obj-c
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
  [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];
}
```

And register an event handler for the event:

```js
PushNotificationIOS.addEventListener('registrationError', function({ message, code }) {
  // Complete your registration process in error.
});
```

**Test plan**

Added support for this event (and `register`) to UIExplorer as a proof of concept.  Navigating to the push notifications example on a simulator is an easy way to reproduce this e
Closes https://github.com/facebook/react-native/pull/9650

Differential Revision: D3822142

Pulled By: javache

fbshipit-source-id: a15ed8941b74dc3eed2c44c658deccbcaf39ce3d
2016-09-06 11:13:40 -07:00
Pieter De Baets 3efe95d989 Fix images not reloading after memory warning
Reviewed By: mmmulani

Differential Revision: D3816779

fbshipit-source-id: edccb41a38fff3b2c143ffb3cbe0a7001ee16331
2016-09-06 09:28:35 -07:00
rh389 6e216d2034 Include CSSLayout.h consistently with other project includes
Summary:
Include CSSLayout headers in the same way as other project headers, ie `#import <CSSLayout/CSSLayout.h>` becomes `#import "CSSLayout.h"`. CSSLayout is not a framework or system dependency, so shouldn't (AFAIK) be included with angle brackets. Doing so breaks framework builds, such as when RN is used as a pod in a swift project.

In combination with https://github.com/facebook/css-layout/pull/217 this fixes https://github.com/facebook/react-native/issues/9014 (specifically swift cocoapods projects). There is then no need for a separate CSSLayout pod subspec.

Tests run on the RN project in isolation (with changes inside `CSSLayout` itself also applied) and against a dummy swift project with RN included as a pod.

NB: This effectively reverts https://github.com/facebook/react-native/pull/9015 and may break non-swift cocoapods projects unless https://github.com/facebook/css-layout/pull/217 is merged and synced first.

Update: As discussed with alloy and emilsjolander, wrap these imports in a preprocess
Closes https://github.com/facebook/react-native/pull/9544

Differential Revision: D3821791

Pulled By: javache

fbshipit-source-id: d27ac8be9ce560d03479b43d3db740cd196c24da
2016-09-06 09:13:39 -07:00
sheparddw 4f004fa3e5 ActionSheetIOS - Pass URL, not file contents to UIActivityViewController for file URLs.
Summary:
Currently, when sharing local files, the file contents are being sent as NSData causing the file to never be attached when sharing via Email or via Airdrop, being renamed to something obscure such as (null)-257D026032E9-1.data
Simply passing the Local File URL to UIActivityViewController instead of the file contents resolves this issue.
More info on this issue: https://github.com/facebook/react-native/issues/8442
Closes https://github.com/facebook/react-native/pull/9693

Differential Revision: D3821142

Pulled By: javache

fbshipit-source-id: a06128db88d24cf5565169f321365ace43ab89fe
2016-09-06 04:43:36 -07:00
Pieter De Baets a1f31d12fd Log timer identifiers in systrace
Reviewed By: davidaurelio

Differential Revision: D3819518

fbshipit-source-id: 98e9ed4af93c9c02f4bb8d9152b19556566b81f1
2016-09-06 03:59:02 -07:00
Pieter De Baets 66ce1297c2 Flow-ify and cleanup JSTimers
Reviewed By: davidaurelio

Differential Revision: D3819511

fbshipit-source-id: 849133d013b026c3f95e988664f252bc35c65122
2016-09-06 03:59:01 -07:00
Adam Comella 9304df3e3d For file uploads, don't stomp on developer's Content-Type header
Summary:
Currently when doing a file upload, the Content-Type header gets set to whatever MIME type iOS computed for the file. The Content-Type header the developer provided never takes precedence.

For example, when uploading an image, iOS might determine that the MIME type is "image/jpeg" and so this would be the Content-Type of the HTTP request. But the developer might need the Content-Type to be "application/octet-stream". With this change, if the developer provides a Content-Type header, it will not be overriden.

There is only one exception to this rule which is for "multipart" requests. In this case, the developer's Content-Type header is always ignored. This is because the Content-Type header needs to contain the boundary string and that information is not available to the developer in JavaScript.

This change makes iOS's behavior more consistent with Android's.

**Test plan (required)**

In a small test app, verified that the developer's Content-Type header takes precedence when it's provided. Verif
Closes https://github.com/facebook/react-native/pull/9651

Differential Revision: D3820001

Pulled By: mkonicek

fbshipit-source-id: fdb8871f88a0d0db1ae59f75bb62b896fe69542d
2016-09-05 14:58:40 -07:00
Pierre-Yves Desnoues 86db1b53b5 Update Switch.js docs - tintColor changes border
Summary:
Update documentation for Switch as it's not a background color that is displayed when the switch off, but juste the border (the background remains transparent)
Closes https://github.com/facebook/react-native/pull/9707

Differential Revision: D3819887

Pulled By: mkonicek

fbshipit-source-id: 218fd20deaded5260cc51e815b559f3cbbb3f752
2016-09-05 13:43:37 -07:00
Janic Duplessis 3c1b69c1a9 Add TextInput controlled selection prop on Android
Summary:
Android PR for TextInput selection, based on the iOS implementation in #8958.

** Test plan **
Tested using the text selection example in UIExplorer.
Closes https://github.com/facebook/react-native/pull/8962

Differential Revision: D3819285

Pulled By: andreicoman11

fbshipit-source-id: 9a2408af2a8b694258c88ab5c46322830c71452a
2016-09-05 07:13:46 -07:00