Commit Graph

1425 Commits

Author SHA1 Message Date
Harry Moreno 4386a3664d Note onSubmitEditing is invalid with multiline={true}
Summary: Repeat onSubmitEditing is invalid if mutliline is set to true. Closer to the method's documentation.
Closes https://github.com/facebook/react-native/pull/4008

Reviewed By: svcscm

Differential Revision: D2639710

Pulled By: nicklockwood

fb-gh-sync-id: b7a169f0d21ac53f092278bdd32ee2d79779aa14
2015-11-10 17:34:45 -08:00
Tadeu Zagallo b907f40957 Fix breakages when upgrading to babel 6
Reviewed By: vjeux

Differential Revision: D2628092

fb-gh-sync-id: 077a3572fe8b261d390be2bdc32d9d06c2b80a01
2015-11-10 10:56:48 -08:00
Nick Lockwood 2eb8068cf1 Improved and generalized image thumbnail decoding logic
Reviewed By: jspahrsummers

Differential Revision: D2631934

fb-gh-sync-id: 3ddea328dcb0fc84b9d7b20708324f0b515f1b7f
2015-11-10 05:04:34 -08:00
Pieter De Baets 4b78ed2123 Fix reference to mustfix in RCTLog
Reviewed By: vjeux

Differential Revision: D2631344

fb-gh-sync-id: 29d4aef4c736adf255907351005ede4388d52707
2015-11-10 04:51:30 -08:00
Philipp von Weitershausen d7c8b4478b Make InteractionManager.runAfterInteractions() return a Promise
Summary: In accordance with the unwritten rule that any API that takes a callback should also return a promise, I've changed `InteractionManager.runAfterInteractions()` to do just that.

```js
  InteractionManager.runAfterInteractions(() => {
    ...
  });
```
can become
```js
  InteractionManager.runAfterInteractions().then(() => {
    ...
  });
```
(but doesn't have to). Most importantly, though, this change enables code like
```js
  doSomeUIStuff();
  await InteractionManager.runAfterInteractions();
  doSomeNonUIStuff();
```
which is nice.

Note: Because returning a `Promise` means the callback argument is now optional, the behaviour of the API is slightly changed, though not in a backwards-incompatible way (unless a consumer is in some way relying on the exception, but that would be insane).
Closes https://github.com/facebook/react-native/pull/3788

Reviewed By: vjeux

Differential Revision: D2634693

Pulled By: josephsavona

fb-gh-sync-id: 7315120963be23cf69d777e940b2750d32ae47a8
2015-11-09 20:14:26 -08:00
Pieter De Baets 478a712d20 Ensure exceptions from route generation are reported
Reviewed By: swarr

Differential Revision: D2631395

fb-gh-sync-id: cf59a290a4b447122c36ec20176b563a38bee630
2015-11-09 09:13:27 -08:00
Nick Lockwood 3c04bfcf53 Added support for #rgba and #rrggbbaa colors
Summary: public

Added support for #rgba and #rrggbbaa colors, which are now officially recognized in the css spec, and supported by WebKit:

http://trac.webkit.org/changeset/192023

Reviewed By: davidaurelio

Differential Revision: D2631386

fb-gh-sync-id: 207a14f77f94bac8088568dc1bbe2bb29f0176c3
2015-11-09 08:02:46 -08:00
Andrei Coman 86c1375c1a Fix test id test case
Differential Revision: D2631505

fb-gh-sync-id: a7a21f114e521ca4ffff9fe9f8408cda70ad5ff3
2015-11-09 06:32:28 -08:00
Ben Alpert 2db10e3e72 Fix open source
Summary: Unfortunately ReactTestUtils requires ReactDOM (for renderIntoDocument), and ReactTestUtils is required by ReactNative. This worked internally because we already shimmed ReactDOM for Relay; now we shim it externally too, at least until we figure out a better solution for this in React.

public

Reviewed By: vjeux

Differential Revision: D2629811

fb-gh-sync-id: 94aac2c4eda39d039fdcedd88295e7afb0f5c5b2
2015-11-07 11:41:20 -08:00
Hedger Wang 1f0566f55f clean up navigator when it's unmounted.
Summary: public

We've noticed that some of the navigator functions are called after the navigator
being unmounted. This diff adds the checks to protect the navigator from throwing
error when it's calling function after be unmounted.

Reviewed By: fkgozali

Differential Revision: D2629484

fb-gh-sync-id: 1cbee02b1a8d2a5d285e7d76f382d2599ed8caed
2015-11-06 23:41:26 -08:00
Ben Alpert bbee3c6f60 Update core libraries for React 0.14 final
Summary: All minor changes since we were already on the beta: most notable is that destructors are required in pooling to help prevent memory leaks.

public

Reviewed By: sebmarkbage

Differential Revision: D2608692

fb-gh-sync-id: acdad38768f7f48c0f0e7e44cbff6f0db316f4ca
2015-11-06 19:52:34 -08:00
Natthu Bharambe cce9ba864f Command line flags to start RN apps in web executor mode.
Reviewed By: frantic

Differential Revision: D2613142

fb-gh-sync-id: fadcea3d23825420c0412f2e4d8d51c70b0f08ed
2015-11-06 14:53:28 -08:00
Adrov Igor b6340ee2b0 implement android maxlength prop
Summary: Fixes https://github.com/facebook/react-native/issues/3864
But I don't sure that this code is correct.

But it works and works same as in iOS.
Closes https://github.com/facebook/react-native/pull/3873

Reviewed By: mikearmstrong001

Differential Revision: D2626122

Pulled By: andreicoman11

fb-gh-sync-id: 316915c99b218ed5f32ca90fd72ce9810571383a
2015-11-06 13:25:34 -08:00
Alexander Blom 527d11ce01 Support progress in ProgressBarAndroid
Differential Revision: D2626321

fb-gh-sync-id: a358a1db8c8f3b4a41dc9a600ee691e6e60310f3
2015-11-06 12:08:29 -08:00
Ken Wheeler e6372719ea Fixes #3846
Summary: This fixes a  leak in regards to web sockets, detailed in #3846 . The connection state constants referenced the class rather than the instance and were coming back undefined.

cc brentvatne stephenelliot
Closes https://github.com/facebook/react-native/pull/3896

Reviewed By: svcscm

Differential Revision: D2626399

Pulled By: vjeux

fb-gh-sync-id: f42670003b68ed5b86f078d7ed74c2695f30fc69
2015-11-06 11:24:29 -08:00
Nick Lockwood 7779e06a7f Added rich text input support
Summary: public

It is now possible to display and edit rich text inside a multiline `<textInput>` by nesting a `<Text>` node inside it.

Note that this doesn't yet provide everything needed to build a full rich text editor (as there is no facility to capture or control the selected text range, or insert/remove text) but it does make it possible to apply token-based styling to text as the user types.

See the 'Attributed text' example in the UIExplorer > TextInput demo for details.

Reviewed By: javache

Differential Revision: D2622493

fb-gh-sync-id: b6bc9a46005322c806934541966460edccb59e70
2015-11-06 07:26:27 -08:00
Alex Krolick 84d1c17dae document that CameraRoll is not implemented on Android
Summary: The CameraRoll API shows up "unsuffixed" in the API list in the docs, so it is confusing to find that it is unimplemented on Android.
Closes https://github.com/facebook/react-native/pull/3901

Reviewed By: svcscm

Differential Revision: D2625837

Pulled By: mkonicek

fb-gh-sync-id: 4e5c00d260a30840a12fd9be0409c354d2052642
2015-11-06 06:31:31 -08:00
Alexander Blom a797be6ffd Support 'color' attribute in ProgressBarAndroid
Differential Revision: D2625690

fb-gh-sync-id: 34ef656be7ce3304add3fae3e697c6b39b866af1
2015-11-06 02:34:32 -08:00
Alex Kotliarskyi 10b599c343 Load assets from same folder as JS bundle
Summary: Fixes #3679, see https://github.com/facebook/react-native/issues/3679

The idea is to always load images from the same folder that we loaded JS bundle.

This doesn't change the current behavior, since `imageNamed:` inferred the
absolute path to the image from app's bundle, but now we make it explicit.

The benefit for OTA updates implementations is that they can simply ask RN
to load js from some `~/Documents/<build-id>/main.jsbundle` folder and RN will
look for images in `~/Documents/<build-id>/assets/`.

Note that for Android we will have to come out with a different plan, since
in prod we load images from built-in resources.

public

Reviewed By: vjeux

Differential Revision: D2616995

fb-gh-sync-id: 2906c62380280ecb987525edf9a0e3e727a1008b
2015-11-05 12:53:26 -08:00
Pieter De Baets 0c83407dd2 Simplify logging exceptions from JS to native
Reviewed By: vjeux

Differential Revision: D2615559

fb-gh-sync-id: ee931b3691251c8b6276699c6f927e47d8e8fd97
2015-11-05 12:51:47 -08:00
Nick Lockwood 8db1e1262e Attempt to fix RCTImageLoader crash
Reviewed By: jspahrsummers

Differential Revision: D2620944

fb-gh-sync-id: 39896c8aa6f162df5769afdd0f947acf4bb5cb76
2015-11-05 09:09:29 -08:00
Patrick O'Meara b3cfc598ce allowFontScaling false changing lineHeight
Summary: * allowFontScaling false was still changing lineHeight as if it were true

fixes #2783
Closes https://github.com/facebook/react-native/pull/3840

Reviewed By: svcscm

Differential Revision: D2615710

Pulled By: nicklockwood

fb-gh-sync-id: 7e4205c58967640762deb5837ecaa2dde236782c
2015-11-05 09:02:22 -08:00
Pawel Sienkowski 4e1f2f4e0f Fixed: Move out setupDevtools call from renderApplication function
Reviewed By: sahrens

Differential Revision: D2620876

fb-gh-sync-id: 8971a1c523c06966dd11280e19272429aa3f9c8d
2015-11-05 08:50:29 -08:00
Andrei Coman e3b6104810 Fix ViewPager warning
Differential Revision: D2620741

fb-gh-sync-id: 9f35e94efb25c689661bf2775a7d0624b3c586f4
2015-11-05 05:06:33 -08:00
Nick Lockwood 11df4cb08c Fixed display of alerts on top of modal window
Reviewed By: javache

Differential Revision: D2616170

fb-gh-sync-id: f72f728008099fff6fc966d7a2ce4c0d27a4fefd
2015-11-05 03:54:31 -08:00
Brent Vatne 0da2004e88 Expose additional private modules
Summary: - TextInputState as TextInput.State
- Touchable
- flattenStyle as StyleSheet.flatten
- ReactNativeART as ART

Original discussion in #1821
Closes https://github.com/facebook/react-native/pull/3308

Reviewed By: sebmarkbage

Differential Revision: D2527152

Pulled By: javache

fb-gh-sync-id: 19d4ef9d4c0e6587b9f0793e1ca624aebb034f3b
2015-11-05 03:35:18 -08:00
Dave Sibiski 7af752403e Implements `blurOnSubmit`
Summary: The default value (to retain current behavior) is set to `true`. Setting the value to `false` will prevent the textField from blurring but still fire the `onSubmitEditing` callback. However, the `onEndEditing` callback will not be fired.

Addresses issue: https://github.com/facebook/react-native/issues/2129
Closes https://github.com/facebook/react-native/pull/2149

Reviewed By: svcscm

Differential Revision: D2619822

Pulled By: nicklockwood

fb-gh-sync-id: 9a61152892f4afb5c6c53e7b38dffae13bc7e13f
2015-11-04 21:05:42 -08:00
Christoph Pojer 7041a22bd0 Update jest to 0.7.1
Reviewed By: frantic

Differential Revision: D2614935

fb-gh-sync-id: 64cc4fb439f0c53f0eb0588c22e0291813a7e334
2015-11-04 14:42:13 -08:00
Spencer Ahrens a4f7aa4853 make onEndReached a little more robust
Summary: public

Now if you scroll up out of the end threshold and then back down into it,
onEndReached will get triggered again.  This closes https://github.com/facebook/react-native/issues/1967

This also resets onEndReached when the data source changes.  This would fix
issues where the data source changes and onEndReached should fire again since
the new data may have more pages, whereas the old data had reached the end and
stopped.

Reviewed By: jingc

Differential Revision: D2610799

fb-gh-sync-id: f6cef513a42d4765514bf4bc55d9e31a760117f1
2015-11-04 11:32:28 -08:00
Josh Berdine c357943dfb Only make backgroundColor opaque if non-nil
Summary: public

Do not set a default backgroundColor of white when top-level RCTShadowText has
backgroundColor == nil.

Reviewed By: nicklockwood

Differential Revision: D2605636

fb-gh-sync-id: f2076d302e7ed574f7804080ccc80db1c9b9401c
2015-11-04 08:55:36 -08:00
Josh Berdine 6b9e4ec4b2 Mimic opacity style of nested Text nodes using alpha color component
Summary: public

Added opacity property to RCTShadowText, and use it to adjust the alpha
color component of nested text nodes when collapsing the RCTShadowText tree
into an NSAttributedString.  The opacity is propagated down the tree,
multiplying the aggregate with the current node's opacity at each step.  Also,
foreground and background colors are propagated down the tree so that in case
a node has an opacity style but no colors, the ancestor's colors can be used
when adjusting the alpha components.

Reviewed By: nicklockwood

Differential Revision: D2600402

fb-gh-sync-id: 2adb7b598b0a73c984bb2edaab545c02ab911c6b
2015-11-04 08:55:30 -08:00
Pieter De Baets 0a290e22da Exporting a synchronous UIWebView to JS
Summary: public

Original github title:  Exported a callback for native webview delegate method shouldStartLoadWithRequest

We have a requirement in our app, to open in mobile Safari, any http:// and https:// links displayed in a web view. Our web view is not full screen and is loaded with an HTML string from the backend. Displaying external content in that web view is outside of the scope of our app, so we open them in mobile Safari.

I've forked the WebView component and added a callback property, shouldStartLoadWithRequest, and modified the RCTWebView implementation of `webView:shouldStartLoadWithRequest:navigationType:`
to check if the shouldStartLoadWithRequest property is set.

If the property is set, `webView:shouldStartLoadWithRequest:navigationType:` passes the URL & navigationType to the callback. The callback is then able to ignore the request, redirect it, open a full screen web view to display the URL content, or even deep link to another app with LinkingIOS.openURL().

Original author: PJ Cabrera <pj.cabrera@gmail.com>
Closes https://github.com/facebook/react-native/pull/3643

Reviewed By: nicklockwood

Differential Revision: D2600371

fb-gh-sync-id: 14dfdb3df442d899d9f2af831bbc8d695faefa33
2015-11-04 08:44:29 -08:00
Jean Regisser 1e52ef23e7 Fix retain cyles in RCTNetworkTask when used with RCTFileRequestHandler and RCTDataRequestHandler
Summary: Hi,

While implementing my own `RCTURLRequestHandler` I came across retain cycles in `RCTNetworkTask` when used with `RCTFileRequestHandler` and `RCTDataRequestHandler`.

The `NSBlockOperation` used in `RCTFileRequestHandler` and `RCTDataRequestHandler` could never be dealloc'ed because of a retain cycle.
And then the second issue was that those blocks were also strongly capturing the passed delegate which in this case is the `RCTNetworkTask` itself and then since the task was storing the block as a `requestToken`, the task could never be dealloc'ed as well.

Here are my proposed fixes. Let me know what you think.
Closes https://github.com/facebook/react-native/pull/3884

Reviewed By: svcscm

Differential Revision: D2615353

Pulled By: nicklockwood

fb-gh-sync-id: a73cbecffbebea75aaeb23d39f04a0d87602926f
2015-11-04 07:16:26 -08:00
Nick Lockwood d799558db5 Fix Groups text input
Reviewed By: javache

Differential Revision: D2590712

fb-gh-sync-id: 453e20970460c703230547d8fd649383ba7d4c4a
2015-11-04 04:09:27 -08:00
Hedger Wang 4763f89efa update NavigationContext API.
Summary: 1. Add a new api `top` which returns the root navigator of a nested navigator.
2. Remove the param `context` from the method `addListener` because it's not used and not necessary.

public

Reviewed By: fkgozali

Differential Revision: D2613852

fb-gh-sync-id: 0d5544422ff0be7875824989a4fbefbef9aac986
2015-11-03 19:08:31 -08:00
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
aleclarsoniv 5dd3b88a81 Use 'visibleLength' if 'contentLength' is less
Summary: This prevents the 'distanceFromEnd' from being negative when 'offset' is zero, for example.
Closes https://github.com/facebook/react-native/pull/3074

Reviewed By: svcscm

Differential Revision: D2610771

Pulled By: sahrens

fb-gh-sync-id: f878f1c1b865063294013c3bb96b90831877d372
2015-11-03 10:13:28 -08:00
Pawel Sienkowski 9bfadb7e1e Revert moving out setupDevtools call
Reviewed By: menglu

Differential Revision: D2609340

fb-gh-sync-id: 3b27b3e18805660bd19ae705916ce4e51120f7f3
2015-11-02 18:34:25 -08:00
Pawel Sienkowski 7021918fe5 Move out setupDevtools call from renderApplication function
Reviewed By: frantic

Differential Revision: D2600393

fb-gh-sync-id: edac2fa3281314fb02a0951c342c2c1ae9b0441a
2015-11-02 15:37:38 -08:00
Pieter De Baets 15c53f7563 Fix ReferenceImages resolving for `buck test`
Reviewed By: nicklockwood

Differential Revision: D2605694

fb-gh-sync-id: 90e65974c73405d482476c9eb2ddf1377f9a1401
2015-11-02 11:02:29 -08:00
Spencer Ahrens 99158f0d5a Better error message for RawText outside <Text>
Summary: public

Native iOS has a good error message, but it's in native which makes
things a little harder to track down (can't use Chrome debugger as easily).

Android has no special handling, so a cryptic "Trying to add unknown view tag..."
redbox would come up.

This puts the error handling in JS so it's shared on all platforms and can be
debugged more easily in Chrome.

Reviewed By: vjeux

Differential Revision: D2606064

fb-gh-sync-id: 5295a44a028c7be79d60dbaf0b5d59fd0a56fdde
2015-11-02 10:51:44 -08:00
Dave Sibiski 6c7c845145 Implements `onKeyPress`
Summary: - When a key is pressed, it's `key value` is passed as an argument to the callback handler.
 - For `Enter` and `Backspace` keys, I'm using their `key value` as defined [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Key_values). As per JonasJonny & brentvatne's [suggestion](https://github.com/facebook/react-native/issues/1882#issuecomment-123485883).

- Example
```javascript
 _handleKeyPress: function(e) {
      console.log(e.nativeEvent.key);
  },

  render: function() {
    return (
      <View style={styles.container}>
        <TextInput
            style={{width: 150, height: 25, borderWidth: 0.5}}
            onKeyPress={this._handleKeyPress}
        />
        <TextInput
            style={{width: 150, height: 100, borderWidth: 0.5}}
            onKeyPress={this._handleKeyPress}
            multiline={true}
        />
      </View>
    );
  }
```
- Implements [shouldChangeCharactersInRange](https://developer.apple.com/library/prerelease/ios/documentat
Closes https://github.com/facebook/react-native/pull/2082

Reviewed By: javache

Differential Revision: D2280460

Pulled By: nicklockwood

fb-gh-sync-id: 1f824f80649043dc2520c089e2531d428d799405
2015-11-02 09:15:31 -08:00
Tadeu Zagallo ccd90e25c1 Convert remaining uses of alloc] init] to new]
Summary: public

We moved to using `new` instead of `alloc] init` but there was still some calls
left.

Reviewed By: javache

Differential Revision: D2604679

fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808
2015-11-02 08:03:17 -08:00
Tadeu Zagallo 23f7c3acd9 Reenable JS calls to systrace on reload
Summary: public

After reloading the JS side of the profiler wasn't being reenabled.

Reviewed By: javache

Differential Revision: D2602258

fb-gh-sync-id: 5de8afb829e9fa8225600e2b0ff9e00313ac1d4c
2015-11-02 05:35:35 -08:00
Tadeu Zagallo d33e84dde5 Use nativeTrace(Begin|End)Section directly from BridgeProfiling
Summary: public

Call the native bindings explicitly from BridgeProfiling instead of polyfill'ing `console.profile` with
a function that has a different signature.

Reviewed By: vjeux

Differential Revision: D2602313

fb-gh-sync-id: 9295eff9458f2caa35b7e982c0f7c06dbe65fd09
2015-10-31 16:43:28 -07:00
Pieter De Baets 6ab2719bff Make <Modal> visible by default
Summary: Make <Modal> visible by default and fix the scenario where we present a modal immediately when adding it to the view hierarchy.

Closes #3724
Closes #2952

public

Reviewed By: nicklockwood

Differential Revision: D2595938

fb-gh-sync-id: 1571790d36fe486f1fbbed9f2d66f1e6add73d91
2015-10-30 17:09:27 -07:00
aleclarsoniv 97f9aa842c Add 'onMoveShouldSetResponderCapture' to 'propTypes'
Summary: Closes https://github.com/facebook/react-native/pull/3777

Reviewed By: svcscm

Differential Revision: D2602708

Pulled By: javache

fb-gh-sync-id: 8259ffd4cdd3d0c052e94ac50a9020d6da59ded7
2015-10-30 16:38:27 -07:00
Alexey Lang 9fe36beec9 Log JSBundleRequireTime and JSAppRequireTime.
Reviewed By: javache

Differential Revision: D2590707

fb-gh-sync-id: 4c306342b5725aaaac1d8fa0257ef860e446b0d4
2015-10-30 12:06:29 -07:00
Hedger Wang a33fe94dac build nested navigation context based on the hierarchy of navigators.
Reviewed By: zjj010104

Differential Revision: D2598388

fb-gh-sync-id: 9655bcc86021678984e2a29df20ad2496a1762d1
2015-10-30 11:09:28 -07:00
Naomi Jacobs 854689dcfa Add fetch's clone function to Request and Response prototypes
Summary: Fetch includes a cloning function that was not included in the React Native fetch.js. This adds it in so that cloning is available on responses from fetch calls in React Native. The code is taken directly from [fetch](https://github.com/github/fetch/blob/master/fetch.js) on Github.

<img width="601" alt="screen shot 2015-10-22 at 11 50 53 am" src="https://cloud.githubusercontent.com/assets/11564650/10675101/304ebe5a-78b3-11e5-9d6b-24ea6d9fb998.png">

<img width="596" alt="screen shot 2015-10-22 at 12 20 08 pm" src="https://cloud.githubusercontent.com/assets/11564650/10675834/4abaf4ee-78b7-11e5-9d34-436290b64b30.png">
Closes https://github.com/facebook/react-native/pull/3614

Reviewed By: svcscm

Differential Revision: D2600517

Pulled By: sahrens

fb-gh-sync-id: d70c5c58e923d997f93bb5aa2d1d90e95d5a75f2
2015-10-30 10:57:33 -07:00
Nick Lockwood 0d14d0f1ce Improved SliderIOS
Summary: public

* No longer sends events when not observing valueChanged.
* Snaps to step value while dragging.
* Added additional example to UIExplorer.

Reviewed By: javache

Differential Revision: D2595594

fb-gh-sync-id: 1e92427d2ab2e71e4eb4a9a7a75cd0f5f4a3a529
2015-10-30 09:13:26 -07:00
Ivan Sorokin e409e20d2b Step support for SliderIOS
Summary: Add step support to SliderIOS
Closes https://github.com/facebook/react-native/pull/3746

Reviewed By: svcscm

Differential Revision: D2595360

Pulled By: nicklockwood

fb-gh-sync-id: 4adf8bcdf46c709776d779244ba3de2b40eb27d6
2015-10-30 07:18:28 -07:00
Oleg Lokhvitsky 26e3bf97d3 Revert D2590497
Reviewed By: pvulgaris

Differential Revision: D2597148

fb-gh-sync-id: a8b6e7c3a90a8a1eaefc996d6243c4a171df37c8
2015-10-29 14:35:32 -07:00
Alex Kotliarskyi 9a93a3cba4 Use pre-bundled elements inspector
Reviewed By: spicyj

Differential Revision: D2588448

fb-gh-sync-id: 278631c1de78cac2bfd9950809feddbe3f630ad0
2015-10-29 11:21:32 -07:00
Andr3wHur5t 22cc044a67 Added support for toggling POI visibility on iOS map view.
Summary: Adds support for toggling points of interests visibility on iOS map view; resolving #3244
Closes https://github.com/facebook/react-native/pull/3631

Reviewed By: svcscm

Differential Revision: D2575148

Pulled By: nicklockwood

fb-gh-sync-id: 0d0ee9d3b4726aa40bc439bc2f36d1db4cae1147
2015-10-29 11:02:25 -07:00
Martin Konicek 8167f40163 Document that WebView is iOS-only until we open source the Android implementation
Summary: The absence of docs can be confusing:
https://twitter.com/40_thieves/status/659500246632939520

public

Reviewed By: davidaurelio

Differential Revision: D2595809

fb-gh-sync-id: b741263782ad579bb40e94a383992dca3a6e8040
2015-10-29 10:09:34 -07:00
Bhuwan Khattar 47b124436f require InitializeJavaScriptAppEngine in bundle
Reviewed By: martinbigio

Differential Revision: D2582794

fb-gh-sync-id: d6cfdda81f556ef0cefb2e9dc58f5978b651bd5b
2015-10-28 21:09:24 -07:00
David Aurelio 40f513aa71 Bring back D2570057 (previously backed out) + fixes
Reviewed By: nicklockwood

Differential Revision: D2590604

fb-gh-sync-id: 63a0e0c6afda740f22aacb3f469d411f236fa16b
2015-10-28 18:44:26 -07:00
Hedger Wang 064de3b338 Replace Navigator with AdsManagerNavigator - step 1
Reviewed By: fkgozali

Differential Revision: D2585102

fb-gh-sync-id: 6f0d51d755e0926f7c6f4d411a026cebf49333a2
2015-10-28 18:27:26 -07:00
Krzysztof Magiera dea4c2ca8e Use onLayout in listview instead of calling measure for every scroll event.
Reviewed By: sahrens

Differential Revision: D2590497

fb-gh-sync-id: 42a8f97dcb43b3a59ba3f0a008fb363f8e8c7200
2015-10-28 12:43:29 -07:00
Spencer Ahrens a2d58203b8 Fix AsyncStorage error multiplexing
Reviewed By: nicklockwood

Differential Revision: D2590231

fb-gh-sync-id: 399a783a474367855d526e0b2604d0f862594102
2015-10-28 12:03:26 -07:00
David Aurelio 4ac898fceb Backout D2570057
Reviewed By: kmagiera

Differential Revision: D2590341

fb-gh-sync-id: 8a6073de3ef2a6e87b785a2bb252468a37c081cf
2015-10-28 08:28:25 -07:00
Manuel Nakamurakare 7d4f5a5c47 added property to sliderIOS to be able to disable it
Summary: added a new property named 'disable' to SliderIOS
this property prevents the user from being able to slide the slider
Closes https://github.com/facebook/react-native/pull/3730

Reviewed By: svcscm

Differential Revision: D2590154

Pulled By: javache

fb-gh-sync-id: b8a9c82c1b05eb813d9b81180cb1083b3f1852ac
2015-10-28 05:48:28 -07:00
Hedger Wang ae58fe221b Stop handling animation once Navigator is unmounted.
Summary: public
Navigator subscribes to its internal animation spring that may still
asks navigator to re-render after being unmounted.

This diff clears the listeners of its animation spring once navigator
is unmounted.

Reviewed By: zjj010104

Differential Revision: D2588434

fb-gh-sync-id: 2b3ee65d3a6c3d45e5c6904d1dc65ac5a3e4534a
2015-10-27 18:30:24 -07:00
Nick Lockwood b9e4f0ddd6 Merged the JS implementations of AsyncStorage, as there seem to be no significant differences.
Reviewed By: sahrens

Differential Revision: D2585257

fb-gh-sync-id: a1c930a675f40b4cd1b3ebe4dffb316747376522
2015-10-27 10:03:03 -07:00
Satyajit Sahoo c45bb3e9c9 Don't throw runtime exception if WebSocket is already closed
Summary: Refer #3364
Closes https://github.com/facebook/react-native/pull/3706

Reviewed By: svcscm

Differential Revision: D2585455

Pulled By: mkonicek

fb-gh-sync-id: fecd5e46c59a79a109aad97a49c9ea016e82d669
2015-10-27 08:36:27 -07:00
Martin Kralik 8989ff925d nil instead of empty `RCTViewManagerUIBlock` block
Summary: There is no point in returning empty block here. It's a tiny bit wasteful and prevents us from knowing if there are any UI updates.

Depends on D2571122 (not really).

public

Reviewed By: jspahrsummers

Differential Revision: D2571137

fb-gh-sync-id: 4a872f33f05eaf2d858009aa04ea89feaa23576c
2015-10-27 05:09:31 -07:00
Pawel Sienkowski 46803f0617 Size flexibility modes for RCTRootView
Reviewed By: javache

Differential Revision: D2526355

fb-gh-sync-id: 095a43bc01f883fdfdad3a086a35682c20c05597
2015-10-26 15:41:29 -07:00
Alexey Lang f87d2e15bd Support log extras
Reviewed By: javache

Differential Revision: D2580869

fb-gh-sync-id: bd24c976aef09243cd11b408d0f37997e400d238
2015-10-26 15:37:29 -07:00
Jeff Morrison d4eb8201f1 Deploy Flow 0.18.1 to fbobjc
Reviewed By: gabelevi

Differential Revision: D2575778

fb-gh-sync-id: 2cf610959db6a493d1813455b17f66bc997a9ef3
2015-10-26 15:36:14 -07:00
Nick Lockwood cae4761006 Use arrays for module method data
Summary: public

Use arrays instead of dictionaries for encoding module method information.

This further reduces UIExplorer startup JSON from 16104 bytes to 14119 (12% reduction)

Reviewed By: javache

Differential Revision: D2570057

fb-gh-sync-id: 4a53a9ead4365a136e7caeb650375733e1c24c0e
2015-10-23 10:16:26 -07:00
Nick Lockwood b0b9a56ef8 Fixed ActivityIndicatorIOS layout
Summary: public

This has been broken for a while. The styles in the JS were being set on the container instead of the activity view itself.

Also, due to the way frames were set directly on layer properties instead of the view, resizing didn't work properly because the UIImageView inside the UIActivityView was not being realligned when the bounds changed. This also caused problems for other controls such as maps, where it was fixed with a method override, but the simpler solution is just to set the view center and bounds directly.

Before: {F23631143}
After: {F23631144}

Reviewed By: javache, tadeuzagallo

Differential Revision: D2575156

fb-gh-sync-id: e82e56d36648e7c924df77da1750e03037b5d5be
2015-10-23 09:13:24 -07:00
James Ide 6ec4d65aec Set up the RN JS environment before requiring other modules
Summary: Set up the polyfills for console and process before initializing other modules. Some modules do work (e.g. call `invariant`) when they are first required, so requiring the DefaultInjection module at the beginning ensures we have a consistent JS environment.
Closes https://github.com/facebook/react-native/pull/3526

Reviewed By: spicyj

Differential Revision: D2560340

Pulled By: frantic

fb-gh-sync-id: 44c743e3212ff1dcdbe0169041dfd3ea8f1a54f7
2015-10-22 15:48:28 -07:00
Nick Lockwood ae5de54f00 Reduced module config data
Summary: public

We're sending a lot of module config data when the app first starts, and much of this is redundant.

UIExplorer current sends 19061 bytes of module config JSON. This diff reduces that to 16104 (15% saving) by stripping modules that have no methods or constants, and removing method types unless method is async.

Reviewed By: tadeuzagallo, javache

Differential Revision: D2570010

fb-gh-sync-id: 8c0abbd1cdee3264b37a4f52e852008caaffb9c5
2015-10-22 05:53:26 -07:00
Charles Marsh 66717d802b Allow for styling of ToolbarAndroid's overflow icon
Summary: Fixes #2858.

Here's a screenshot of the custom overflow icon in action:
<img width="638" alt="overflow" src="https://cloud.githubusercontent.com/assets/1309177/10567090/693e395a-75ae-11e5-84cd-20b19149c620.png">
Closes https://github.com/facebook/react-native/pull/3497

Reviewed By: svcscm

Differential Revision: D2559787

Pulled By: foghina

fb-gh-sync-id: f188711ec094af3fa307722527f22aefff722e64
2015-10-22 04:43:25 -07:00
Jesse Ruder 56fef9b622 Allow duplicate keys in FormData
Summary: Right now `FormData` doesn't allow duplicate keys and uses the last value set for a duplicate key. I tested this in Chrome:
```
var formData = new FormData();
formData.append('key', 'value1');
formData.append('key', 'value2');

var request = new XMLHttpRequest();
request.open("POST", serverUrl);
request.send(formData);
```
and the request has both 'value1' and 'value2'.

I removed the duplicate key check in `FormData`. If people want to build appending or disallow duplicate keys, they can build either on top of this.
Closes https://github.com/facebook/react-native/pull/3556

Reviewed By: svcscm

Differential Revision: D2566999

Pulled By: nicklockwood

fb-gh-sync-id: 580e52e69376ebe9693e39a386cc540802b6d94f
2015-10-21 15:18:40 -07:00
Nick Lockwood 666833d2d2 Fixed RCTImageStoreManager bug
Reviewed By: tadeuzagallo

Differential Revision: D2565154

fb-gh-sync-id: a9b6df27e4c54d5c3a9ad42dc5b821729d445c9e
2015-10-21 13:19:28 -07:00
Oliver (Cunpu) Bo 4036eca570 Fix pixelated image in storyline
Reviewed By: seanxiao

Differential Revision: D2563069

fb-gh-sync-id: 86fa47801c34669b7b0c2826e0e776717f5605dc
2015-10-21 12:45:29 -07:00
Nick Lockwood a859d9e931 Fixed ActionSheetIOS on iOS 9 SDK
Summary: public

UIActionSheet no longer works on iPad when building with the iOS 9 SDK, as reported here: https://github.com/facebook/react-native/issues/3498

This diff implements an alernative code path that uses UIAlertController instead when its available.

Also added `anchor` support for action sheets (previously only supported for share sheet).

Reviewed By: javache

Differential Revision: D2560068

fb-gh-sync-id: feda20f6f1fee5e2ba624761fbeb812e23d96fff
2015-10-21 12:21:28 -07:00
Stephen Keep 852eba2a91 Documentation Update
Summary: The first change is to remove the word 'Hybrid' to a lot of javascript developers the word Hybrid is normally referred to as a webview app (such as Cordova) and this may cause confusion.

The second change is to refer to the property within Navigator that allows a scene to be presented from the bottom of the screen (like a modal).
Closes https://github.com/facebook/react-native/pull/3173

Reviewed By: svcscm

Differential Revision: D2561886

Pulled By: javache

fb-gh-sync-id: e37e5d06869ffadc152abaf304f77c93b81f71a3
2015-10-21 07:02:25 -07:00
Hedger Wang 06a154e061 Fix Js error in Navigator
Summary: public

In Navigator, there are several places that mutate `this.state.presentedIndex`
with the express `this.state.presentedIndex = destIndex` instead of calling
`this.setState`, which creates the problem that not all internal states are
updated within the same React update cycle.

One of the symptoms is that over-swiping within the Navigator may throw JS error
due to `this.state.sceneConfigStack` and `this.state.presentedIndex` are not both
updated.

The workaround is to bypass the over-swiping gesture to avoid JS error.

Reviewed By: ericvicenti

Differential Revision: D2557140

fb-gh-sync-id: 1e5c9047ed17c04a63e2a568118848b00723fb1d
2015-10-20 11:04:23 -07:00
Nick Lockwood 1d6d1189f0 Improved threading for image loader
Summary: public

The image loader was previously returning on the main thread, which could lead to poor performance due to various call sites doing further image processing (resizing, cropping, etc.) directly in the completion block.

This diff modifies the loader to return on a background thread (the same one used to load the image), and updates the call sites to dispatch to the explicit thread they need.

Reviewed By: javache

Differential Revision: D2549774

fb-gh-sync-id: fed73b7c163fdf67ff65bae72ab1986327e75815
2015-10-20 05:02:23 -07:00
Justin Spahr-Summers 123516d556 Reload RCTImageView when it's displaying the default image
Summary: public

If the frame is set, or the image view moves to a window, we should attempt to load the "real" image. The sizing logic shouldn't kick in if we're only displaying the default image.

Resolves https://github.com/facebook/react-native/issues/3460.

Reviewed By: tadeuzagallo

Differential Revision: D2555316

fb-gh-sync-id: c0c13070ee080bad2b30ca01d9d5173bead406e3
2015-10-19 10:26:24 -07:00
Hedger Wang 73b80773ba supports event capturing and bubbling phases in Navigation context.
Summary: Adds the API that enables the navigation events capturing and bubbling which is the feature
that is enabled if the nested navigation contexts is created by the navigator.

This would allow developer to observe or reconcile navigation events within the navigation tree.

public

./Libraries/FBReactKit/jest

Reviewed By: zjj010104

Differential Revision: D2546451

fb-gh-sync-id: dfc9d16defaa563b9e80fd751a20570f6e524b74
2015-10-19 10:06:22 -07:00
Nick Lockwood 1076f4a172 Added RCTDataRequestHandler
Summary: public

Added RCTDataRequestHandler, which is responsible for loading data URLs. This moves the logic for data URL handling out of RCTImageDownloader (no longer needed) and into the RCTNetwork library, where it makes more sense.

This also means that it is now possible to load data URLs via XHR, and use them for purposes other than just images.

Reviewed By: javache

Differential Revision: D2540964

fb-gh-sync-id: 4f0418bd6b9186f047cc8297276bb970795af104
2015-10-19 09:07:06 -07:00
Joe Noon 607527c0d4 (upstream) Prevent SocketRocket killing the connection before notifying of final messages
Summary: wrap NSStreamEventEndEncountered in dispatch_async _workQueue per upstream:
https://github.com/square/SocketRocket/pull/294

CLA completed
Closes https://github.com/facebook/react-native/pull/3493

Reviewed By: svcscm

Differential Revision: D2554892

Pulled By: javache

fb-gh-sync-id: 347a37eb95b20b7e92b985b6908e15462672e83c
2015-10-19 06:47:22 -07:00
Pieter De Baets 59e670e453 Fix a warning about SnapshotView
Reviewed By: majak

Differential Revision: D2553669

fb-gh-sync-id: 2a2b47f9cf7a75403e4e2541b32a4b141b3d08be
2015-10-19 06:10:22 -07:00
Nick Lockwood 16a48ae0c3 Fixed "Unrecognized request token" red box
Summary: public

There was a race condition issue in RCTDownLoadTask whereby the request handler would sometimes call one of the delegate methods before setup was complete, causing an error to be logged because the request token had not been set, and causing te request to fail because the class was not yet set up.

This diff fixes that issue by adding an explicit `start` method to RCTDownloadTask, and changing the setup order to allow for the request to call back immediately without this being treated as an error.

Reviewed By: tadeuzagallo

Differential Revision: D2553628

fb-gh-sync-id: 5ca4e791574a632ccbf2e873e28ac88bffdf851d
2015-10-17 09:34:23 -07:00
Hedger Wang a2524bac33 Support nested navigation context.
Reviewed By: fkgozali

Differential Revision: D2525434

fb-gh-sync-id: 18e7d672b2cbadc318a207c8812f38d8669bad30
2015-10-17 04:25:26 -07:00
Adam Terlson da250671e5 Add support for cancelAllLocalNotifications
Summary: Closes https://github.com/facebook/react-native/pull/2980

Reviewed By: svcscm

Differential Revision: D2550080

Pulled By: javache

fb-gh-sync-id: 76a7088f4f86191b02e6c176e4a8a7bc85f90835
2015-10-16 10:57:25 -07:00
Frédéric Sagnes 4a3857ef1d Use JSStringCreateWithUTF8CString and skip NSString decoding when loading the bundle
Summary: public

Benchmarking our startup path has shown we spend a lot of time decoding strings (iPhone 4S / iPhone 5):

* reading a 2MB JS bundle: 35ms / 15ms
* decoding is to an `NSString`: 186ms / 78ms
* transforming that to a `JSString`: 29ms / 10ms

Instead of going through an `NSString` transformation, we generate a null-terminated bundle (0.1ms / 0.05ms to copy the data) and use `JSStringCreateWithUTF8CString` (121ms / 53ms) to generate the string. That makes decoding 70% faster.

Reviewed By: javache

Differential Revision: D2541140

fb-gh-sync-id: 09a016b8edfd46a9b62682c76705564d2024e75e
2015-10-16 08:11:25 -07:00
Krzysztof Magiera 8e2ec64763 Use RecyclerViewBackedScrollView in groups feed on Android.
Differential Revision: D2549975

fb-gh-sync-id: 98689a58a69ce8425c695acf74701509816821ae
2015-10-16 07:45:22 -07:00
Krzysztof Magiera 0ed3048e39 Add deprecated transform props to View prop type definition.
Differential Revision: D2549973

fb-gh-sync-id: 96b5233fe4ed003760746d8cdb7f0496a67c63be
2015-10-16 07:30:26 -07:00
Bill Glover 8fb9cc8fc1 Fix 16 linter warnings in Examples/
Summary: Partially fixes #3316 by addressing 16 linter warnings:
 - Strings should be singlequote
 - Missing semicolon

Travis build jobs 1.1 through 1.4 complete successfully. 1.5 fails through what appears to be an unrelated issue on master.
Closes https://github.com/facebook/react-native/pull/3332

Reviewed By: @​svcscm

Differential Revision: D2531718

Pulled By: @javache

fb-gh-sync-id: ca22fbeac5fe3b4f725775a72f21b6dd7a75d94b
2015-10-16 04:03:23 -07:00
Jihyun Yu 79e33078f2 Fix minor typos on documentation
Summary: Closes https://github.com/facebook/react-native/pull/2742

Reviewed By: @​svcscm

Differential Revision: D2549690

Pulled By: @javache

fb-gh-sync-id: 84cb3aa78c2c75bae24a8cc7c1b96e219c9a0552
2015-10-16 03:49:25 -07:00
Krzysztof Magiera f47e8ac6a1 Instrumentation test for native listview component.
Differential Revision: D2549707

fb-gh-sync-id: c9ff379383853c198274778e99a72b313d9dbda9
2015-10-16 03:41:18 -07:00
Ben Alpert 84df87ef64 Fix React warnings
Reviewed By: @sebmarkbage

Differential Revision: D2548854

fb-gh-sync-id: 9ace9ce57641e2dcaae997358e6404044d871f82
2015-10-16 03:41:14 -07:00
James Ide c38d7fab97 `isInteraction` option to keep InteractionManager unblocked
Summary: Adds a new option to animation configs so that animations can be marked as non-interactions. This solves the "loading indicator problem" where an animated loading screen would deadlock as it waits for all interactions to complete.

As for the API, what we really want long term is better scheduling. This needs to be built at the runtime level (into the RN bridge) and take care of things like priority donation that are probably overkill right now. Basically this API is a medium-term fix and I won't be upset if it gets replaced with a finer-grained scheduler.
Closes https://github.com/facebook/react-native/pull/3433

Reviewed By: @​svcscm

Differential Revision: D2545300

Pulled By: @vjeux

fb-gh-sync-id: c1216bf69bfbbbae00c76c4697183fe96a6a01dd
2015-10-15 09:22:33 -07:00
Krzysztof Magiera 1e52b8297c Wrapper for android RecyclerView to be used by ListView.js
Differential Revision: D2545291

fb-gh-sync-id: 5d745939f6d63aea4cd9bba2f55e68336efc1e9a
2015-10-15 09:22:31 -07:00
Michal Aichinger d0e40c581d Fixes a path in touchableHandlerResponderGrant method when touchableGetPressRectOffset method is not present.
Summary: Current code is checking presence of touchableGetPressRectOffset method but fails immediately on trying to get 'left' value of null.
Closes https://github.com/facebook/react-native/pull/3438

Reviewed By: @​svcscm

Differential Revision: D2545068

Pulled By: @javache

fb-gh-sync-id: d16cb46af1fc6eae02f56b2096c2169ce475e022
2015-10-15 09:22:29 -07:00
Harry Wolff 1b94586fe6 Add documentation for making PushNotificationIOS events work,
Summary: I was just implementing push notifications for my iOS app and was very confused why the `register` event wasn't working.

[Eventually I ran across this tutorial](https://medium.com/@​DannyvanderJagt/how-to-use-push-notifications-in-react-native-41e8b14aadae) that explained that I needed to update my AppDelegate to make that event work.

I've updated the documentation to include that note within the actual file.
Closes https://github.com/facebook/react-native/pull/3390

Reviewed By: @​svcscm

Differential Revision: D2537853

Pulled By: @javache

fb-gh-sync-id: 1e8860173c38f6b2d7f9d273019f201e4cc9c0f2
2015-10-14 09:09:26 -07:00
Yuri Zarubin 45644aab35 Check that WS connection is open before closing it on failed. Fixes #3346
Summary: Check that the WS state is set to OPEN before trying to close it when the ```websocketFailed``` event fires. Otherwise the app throws an error at the Android level.

Fixes #3346
Closes https://github.com/facebook/react-native/pull/3347

Reviewed By: @​svcscm

Differential Revision: D2535807

Pulled By: @mkonicek

fb-gh-sync-id: bb70c551ea2e582cfaa80139a265dbbca6d990d2
2015-10-14 08:46:12 -07:00
Dave Miller 19e11232fe Move SnapshotView to SnapshotViewIOS and create an unimplemented android version
Reviewed By: @andreicoman11

Differential Revision: D2536373

fb-gh-sync-id: 0f671e8198175a15540b74d54e53eee941aa0c1b
2015-10-13 11:48:38 -07:00
Nick Lockwood a92f107712 Added RCTFileRequestHandler
Summary: @​public

We previously discovered that using an NSURLSessionDataTask to load local files is noticably less efficient than using regular filesystem methods.

This diff adds RCTFileRequestHandler as a replacement for RCTHTTPRequestHandler when loading local files. This reduces loading time when loading local files via XMLHttpRequest, as well as improving the performance for some image load requests.

Reviewed By: @javache

Differential Revision: D2531710

fb-gh-sync-id: 259714baac131784de494d24939f42ad52bff41a
2015-10-13 08:14:28 -07:00
Andy Street 28f6eba22d Make removeClippedSubviews default to true on ListView/RecyclingListView
Reviewed By: @satishsampath

Differential Revision: D2536046

fb-gh-sync-id: 7e0b4442bb0b3705bba3b5f7bdf873fb348a83f6
2015-10-13 08:06:26 -07:00
Andy Street e0b2c2e34e Batch native method calls in 5ms increments
Reviewed By: @mkonicek

Differential Revision: D2535803

fb-gh-sync-id: 8363a83d6966cfa4c2ea46358b10e4139333329f
2015-10-13 08:03:41 -07:00
Quentin Adam c73ceff914 Corrected computation of RCText element height with padding
Summary: Corrected computation of RCText element height with padding (padding was counted twice).
See also issue #2466.
Closes https://github.com/facebook/react-native/pull/2838

Reviewed By: @​svcscm

Differential Revision: D2535924

Pulled By: @nicklockwood

fb-gh-sync-id: b9527803c0a5a6eed1db7e37c98b628750ab2045
2015-10-13 06:44:32 -07:00
Nick Lockwood 5b425278bb Removed references to isStatic from the codebase
Summary: @​public

The legacy 'isStatic' property for image sources is no longer used anywhere in our codebase, but was still being generated by the packager and referenced in the JS in various places.

This diff removes all the remaining references.

Reviewed By: @frantic

Differential Revision: D2531263

fb-gh-sync-id: 0bba0bb8473b1baa908ef7507cbf6d83efb0d9ee
2015-10-13 06:44:30 -07:00
Tadeu Zagallo baf5b7b4d5 De-batch native->js calls and react updates
Summary: @​public

Take a step back and de-batch the bridge calls so we can have better profiling data and a better starting point to work on future optimisations. Also gave a 10~15% win on first render.

Reviewed By: @javache

Differential Revision: D2493674

fb-gh-sync-id: 05165fdd00645bdf43e844bb0c4300a2f63e7038
2015-10-13 06:44:25 -07:00
Nick Lockwood 261100d9d0 Fix data url support
Reviewed By: @tadeuzagallo

Differential Revision: D2535768

fb-gh-sync-id: 537ecc462e4a8a9e807ccad28a715419f4d5f355
2015-10-13 06:44:23 -07:00
Alex Kotliarskyi 393ead59dc Always return `scale` from resolveAssetSource
Reviewed By: @nicklockwood

Differential Revision: D2532565

fb-gh-sync-id: 113b8318a8f1a9b0dac4fab389a98ddd51d00e17
2015-10-13 06:44:16 -07:00
Jiajie Zhu aacd2d90a4 fix watchPosition keep updating location
Reviewed By: @nicklockwood

Differential Revision: D2519624

fb-gh-sync-id: 7366c5ac9e06082448b9fbba3c616aaf8e4183f9
2015-10-12 11:56:45 -07:00
Christopher Chedeau da359c312a Fix jest test that runs the polyfill 10 times
Summary: @​public

jest is running the polyfill multiple times on the same environment (cc @cpojer, need to fix that!). By default jest doesn't have XMLHttpRequest polyfilled so it'll define a property with writable to be false. It'll fatal the second time it tries to override XMLHttpRequest.

The hacky workaround is to make properties that do not exist with writable: true. But the long term fix would be to make jest stop running the polyfill multiple times.

Reviewed By: @javache

Differential Revision: D2532019

fb-gh-sync-id: a82abf69541781a64a0744798c736f90833e28cb
2015-10-12 11:52:28 -07:00
Alex Kotliarskyi 62d0586e59 Rely only on scriptURL when loading images
Reviewed By: @foghina

Differential Revision: D2527119

fb-gh-sync-id: e2a9618f729a2ec03b1959fa13fae46620cc379e
2015-10-12 11:36:26 -07:00
Ben Alpert 5e33dbcfcc Move stuff out of vendor/react_contrib/
Summary: This was a confusing place for them. BoundingDimensions, Position, and Touchable were only used in Touchable; StaticContainer I moved to Libraries/Components.

@​public

Reviewed By: @vjeux

Differential Revision: D2530730

fb-gh-sync-id: e636a6b7259c2bd3ab52c82ebd59a6c66c9e7e7a
2015-10-12 11:18:30 -07:00
Christopher cab3bd6e86 Add note for iOS9 url scheme changes
Summary: Closes https://github.com/facebook/react-native/pull/3354

Reviewed By: @​svcscm

Differential Revision: D2531433

Pulled By: @javache

fb-gh-sync-id: a7d280f6f8d3e6fa723c6518110ca344f9583ddd
2015-10-12 08:04:24 -07:00
Nick Lockwood 799168929c Unify XCAsset handling logic
Summary: @​public

This diff unifies the logic for detecting when images refer to XCAsset files into a single function (RCTXCAssetNameForURL) and uses it for both +[RCTConvert UIImage:] and RCTImageLoader.

I've also tightened the definition of XCAssets so that it only applies to images inside .car files, not any image inside the main bundle. This avoids using the +[UIImage imageNamed:] when not strictly necessary, which is desirable since that method is not thread-safe, and has undocumented caching behavior that is difficult to reason about.

Reviewed By: @javache

Differential Revision: D2526400

fb-gh-sync-id: 7199c2a44f1d55ff236d2c38a0a9368739b993d5
2015-10-12 04:15:27 -07:00
Emmanouil Konstantinidis c16c3f9814 Fix typo - Remove duplicated "to have"
Summary: Closes https://github.com/facebook/react-native/pull/3015

Reviewed By: @​svcscm

Differential Revision: D2530576

Pulled By: @vjeux

fb-gh-sync-id: e7df3706f3c733e8de32c1f123d951b488133e8a
2015-10-11 21:14:54 -07:00
Christopher 53403423ca - Fix response variable from getCurrentReachability
Summary: Fixes #3333 and #2802
Closes https://github.com/facebook/react-native/pull/3345

Reviewed By: @​svcscm

Differential Revision: D2530744

Pulled By: @vjeux

fb-gh-sync-id: 521cbe482f3811339b21cf68ba2269d2b5286e82
2015-10-11 19:42:24 -07:00
James Ide 2c7de35dee Export per-platform NavigatorNavigationBarStyles for consistent styling
Summary: This allows for the iOS-style navigation bar on Android and vice versa in order to simplify design. It is entirely optional in that NavigationBars will continue to defauly to their platform-specific style, but you can override it with the `navigationStyles` prop:

```js
<Navigator.NavigationBar
  navigationStyles={Navigator.NavigationBar.StylesIOS}
/>
```

Fixes #2995.
Closes https://github.com/facebook/react-native/pull/3028

Reviewed By: @​svcscm

Differential Revision: D2527902

Pulled By: @ericvicenti

fb-gh-sync-id: c7b1bfac200b5e03fc0d9dfb8acc8b916c825595
2015-10-10 15:32:46 -07:00
Jiajie Zhu c86966c150 fix breadcrumb icon offset
Reviewed By: @fkgozali

Differential Revision: D2528804

fb-gh-sync-id: 6ed9e9ce330ecc147c3fb8217c7b1b0986c862fe
2015-10-09 17:53:26 -07:00
Ian MacLeod c612d830bb Preserve original global properties when polyfilling them
Summary: Fixes #934.
Closes https://github.com/facebook/react-native/pull/3293

Reviewed By: @​svcscm

Differential Revision: D2525598

Pulled By: @vjeux

fb-gh-sync-id: 90672550f723a183897456dc9512851bfa34807a
2015-10-09 14:41:23 -07:00
Sebastian Markbage 17da325bb4 Add List of Common Cases to AttributePayload Benchmark
Summary: The most common cases is either that nothing changed or that only one part of
an array changed.

@​public

Reviewed By: @spicyj

Differential Revision: D2516385

fb-gh-sync-id: 0cd09b95ebac37ee1b575025d23ae2f2e6e2fb47
2015-10-09 14:31:23 -07:00
Ben Alpert ab6f375c66 Log React warnings internally, fix warnings in Android tests
Reviewed By: @javache

Differential Revision: D2517993

fb-gh-sync-id: c91a42a0abe4037b72c4497a5dc8b52a922fbf98
2015-10-09 09:33:24 -07:00
Pieter De Baets 67a69906e7 Allow image extensions when loading from asset catalogs
Reviewed By: @nicklockwood

Differential Revision: D2526258

fb-gh-sync-id: 01ccbddcfe8dc98ae5eeac1a066fbc1e69d6f087
2015-10-09 07:55:26 -07:00
Brent Vatne 1fd2e176ae Fix broken code block and make the example nicer
Summary: @​kmagiera @mkonicek - made a mistake while updating it, removed the `margin` style for some reason on the inner Text (it was 1am, ¯\_(ツ)_/¯). This also makes the example nicer looking - style the navigation with a white background, center the text in the main content view.

![](http://url.brentvatne.ca/16xXe.png)
![](http://url.brentvatne.ca/1a4Jt.png)
Closes https://github.com/facebook/react-native/pull/2682

Reviewed By: @​svcscm

Differential Revision: D2454465

Pulled By: @mkonicek

fb-gh-sync-id: 2fa17366b34ae31c490d37791ad693c17ac3f128
2015-10-08 14:01:52 -07:00
Nick Lockwood 91e6c98ecd Implemented inline image support for <Text>
Summary: @​public

This diff implements inline image support for <Text> nodes. Images are specified using <Image> tags, however all properties of the image are currently ignored apart from the source (including width/height styles).

Images are loaded asyncronously, and will trigger a text re-layout when they have loaded.

Reviewed By: @javache

Differential Revision: D2507725

fb-gh-sync-id: 59d0696d00a1bc531915cc35242a16b2dec96e85
2015-10-08 11:56:25 -07:00
gabe@fb.com 08ec89d2e6 Fix errors in preparation for v0.17.0
Reviewed By: @jeffmo

Differential Revision: D2512681

fb-gh-sync-id: dedf465af43cf3c8839fa960c5f1a2c2648e4e1e
2015-10-07 12:03:20 -07:00
Kyle Corbitt 381e2acd18 Document NativeMethodsMixin
Summary: This is related to the discussion in #3155.

I've documented the methods in this mixin, and pointed to other appropriate documentation where necessary as well.

I didn't end up adding any examples. I wanted to add a `focus()`/`blur()` example to the UIExplorer app, but the app seems to be broken on master at the moment (`Requiring unknown module "event-target-shim"`) and I didn't bother trying to fix it. I think the last thing necessary for making the usage of these methods clear is an example of calling one or more of them on a `ref` or view captured in some other way. However, `setNativeProps` is well documented in the "Direct Manipulation" guide, which I link to from this page, so by extension it should be possible to figure out the functionality of the other methods.

cc @mkonicek @​astreet
Closes https://github.com/facebook/react-native/pull/3238

Reviewed By: @​svcscm

Differential Revision: D2517187

Pulled By: @mkonicek

fb-gh-sync-id: 4e68b2bc44ace83f06ae2e364ca0c23a7c461b20
2015-10-07 09:43:22 -07:00
Satyajit Sahoo f4857a6d42 Implement WebSocket module for Android. Fixes #2837
Summary: The JavaScript code for Android is same as the iOS counterpart, I just added few new lines and used arrow functions instead of binding `this`.
Closes https://github.com/facebook/react-native/pull/2839

Reviewed By: @​svcscm, @vjeux

Differential Revision: D2498703

Pulled By: @mkonicek

fb-gh-sync-id: 3fe958dd5af0efba00df07515f8e33b5d87eb05b
2015-10-07 08:36:22 -07:00
Martin Konicek 0a419650ce Open source ViewPagerAndroid
Reviewed By: @foghina

Differential Revision: D2513014

fb-gh-sync-id: d9bb668d76939ad85b657233c8b7beac9b244fab
2015-10-06 20:01:21 -07:00
Sebastian Markbage 6244fd003d Refactor Attribute Processing (Step 3)
Reviewed By: @spicyj

Differential Revision: D2514193

fb-gh-sync-id: 8ba55014e8d052c69d8e1def327284ec974d6837
2015-10-06 15:36:32 -07:00
Sebastian Markbage 2ea3b93784 Add warning to setNativeProps and Animated for non-nested styles
Summary: These were accidentally supported because they were merged at a lower
level. That's an implementation detail. setNativeProps should still
normalize the API.

I fixed some callers.

Setting props the normal way used to ignore these. Unfortunately we can't
warn for those cases because lots of extra props are spread. (The classic
transferPropsTo issue.)

@​public

Reviewed By: @vjeux

Differential Revision: D2514228

fb-gh-sync-id: 00ed6073827dc1924da20f3d80cbdf68d8a8a8fc
2015-10-06 15:36:23 -07:00
Spencer Ahrens 36cbe74f99 introduce universal switch
Reviewed By: @vjeux, @mkonicek

Differential Revision: D2441456

fb-gh-sync-id: c4050ec86f30234ea29c38205d668157bde65a35
2015-10-06 10:29:22 -07:00
Felix Oghina 8f7748748e Revert [React Native] Refactor Attribute Processing (Step 3)
Reviewed By: @kmagiera, @mikearmstrong001

Differential Revision: D2512548

fb-gh-sync-id: bcae3a8c85bfcfa468f2128288a25f406d78cf08
2015-10-06 10:29:18 -07:00
Sebastian Markbage ac5b7548d2 Refactor Attribute Processing (Step 3)
Summary: Decouple processStyle from the main reconciliation. It is now a process
extension to the style attribute `transform`. This effectively decouples a
large portion of special cases and helper dependencies from the reconciler.

The transform attribute becomes translated into the transformMatrix attribute on
the native side so this becomes a little weird in that I have to special case
it. I don't think it is worth while having a general solution for this so I
intend to rename the native attribute to `transform` and just have it accept the
resolved transform. Then I can remove the special cases.

The next step is generalizing the flattenStyle function and optimizing it.

@​public

Reviewed By: @vjeux

Differential Revision: D2460465

fb-gh-sync-id: 243e7fd77d282b401bc2c028aec8d57f24522a8e
2015-10-06 10:28:41 -07:00
Sebastian Markbage 8e3ce0ff98 Refactor Attribute Processing (Step 2)
Summary: Move the ViewAttributes and StyleAttributes configuration into the
Components library since they're coupled and change with the
native component configuration.

This also decouples StyleAttributes from the reconciler by adding it
to the ReactViewAttributes.

To do that, I refactored the property diffing to allow for recursive
configurations. Now an attribute configuration can be a nested object,
a custom configuration (diff/process) or true.

The requireNativeComponent path incorrectly gets its attributes set up
on the root validAttributes instead of the nested style object.
So I also have to add the nested form. Effectively these currently allow
these attributes on props or nested.

@​public

Reviewed By: @vjeux

Differential Revision: D2456842

fb-gh-sync-id: cd5405bd8316c2fcb016d06c61244ce7719c26c0
2015-10-06 10:28:35 -07:00
Sebastian Markbage 6c5024ec58 Refactor Attribute Processing (Step 1)
Summary: Concolidate the creation of the "update payload" into
ReactNativeAttributePayload which now has a create
and a diff version. The create version can be used by
both mountComponent and setNativeProps. This means that
diffRawProperties moves into ReactNativeAttributePayload.

Instead of storing previousFlattenedStyle as memoized
state in the component tree, I recalculate it every
time. This allows better use of the generational GC.
However, it is still probably a fairly expensive
technique so I will follow it up with a diff that
walks both nested array trees to do the diffing in a
follow up.

This is the first diff of several steps.

@​public

Reviewed By: @vjeux

Differential Revision: D2440644

fb-gh-sync-id: 1d0da4f6e2bf716f33e119df947c044abb918471
2015-10-06 10:28:27 -07:00
Madelaine Boyd 62e8ddc205 Revert g90f63f5c6fbbadd3ce6486e65d6fe6f967f56db6: [RN] add allTime vs. perBatch UIManager stats
fb-gh-sync-id: cef98420bcb8e708196bd5e162fa5dc4003b4fa2
2015-10-05 17:34:23 -07:00
Spencer Ahrens 340229303f add allTime vs. perBatch UIManager stats
Summary: @​public

UIManagerStatTracker now provides allTime and perBatch stats so it's easy to see
how bit each batch is.

Reviewed By: @vjeux

Differential Revision: D2506218

fb-gh-sync-id: 635556185245d2bd6cb149497ea60b503b2523ce
2015-10-05 14:19:08 -07:00
Spencer Ahrens b0bdd4e45d Fix ListView bug where onEndReached wouldn't trigger initially
Summary: @​public

Sometimes we want to load a very small number of rows initially and want the
onEndReached callback to be called immediately to trigger more data to be
loaded without waiting for the  user to scroll at all.  This diff makes that
happen by also checking on mount instead of only when scrolling.

Reviewed By: @vjeux

Differential Revision: D2507184

fb-gh-sync-id: ea8e47667d00387a935a426dd45afe978fd6d8cd
2015-10-05 13:49:00 -07:00
Andrei Coman 166a96bcee Fix keyboardShouldPersistTaps default value
Reviewed By: @astreet

Differential Revision: D2507878
2015-10-05 10:25:21 -07:00
Pieter De Baets babdeb33ba Make processColor more efficient
Reviewed By: @nicklockwood, @vjeux

Differential Revision: D2507684
2015-10-05 10:15:34 -07:00
Pieter De Baets 7c1b6b0fb6 Vendor tinycolor; strip unnecessary components
Reviewed By: @vjeux

Differential Revision: D2503048
2015-10-05 04:41:26 -07:00
Dral 95a4f441e0 Silently (warning) fail when <Image> source has empty uri
Summary: fixes #3127
Closes https://github.com/facebook/react-native/pull/3185

Reviewed By: @​svcscm

Differential Revision: D2507588

Pulled By: @nicklockwood
2015-10-05 04:08:24 -07:00
Dral 463b072dac Support hex values in outputRange
Summary: 1. Should I add an example of this to the UIExplorer Animation example?

2. Should I support mixing hex and rgba values in outputRange? It is possible with this implementation, but may cause confusion
Closes https://github.com/facebook/react-native/pull/3177

Reviewed By: @​svcscm

Differential Revision: D2506947

Pulled By: @vjeux
2015-10-04 14:37:59 -07:00
Dral a9b8ca027c Clear timeouts on unmount in TouchableMixin
Summary: Fixes #1152
Closes https://github.com/facebook/react-native/pull/3176

Reviewed By: @​svcscm

Differential Revision: D2506385

Pulled By: @vjeux
2015-10-03 11:49:27 -07:00
James Ide c649211147 Add unit tests to flattenStyle
Summary: The StyleSheet merging algorithm was modeled after `Object.assign` and the native spread operator. This diff converts `flattenStyle` to actually use `Object.assign`.
Closes https://github.com/facebook/react-native/pull/3048

Reviewed By: @​svcscm

Differential Revision: D2506387

Pulled By: @vjeux
2015-10-03 10:17:23 -07:00
Christopher Chedeau 6f84ccf51a Fix tests related to event-target-shim
Summary: @​public

Jest has an issue where if you export `Symbol` it crashes badly. Since event-target-shim does that, it breaks everything. Mocking that module fixes the issue until @cpojer comes back from vacation and fixes the bug in Jest itself.

Reviewed By: @jingc

Differential Revision: D2503562
2015-10-02 12:36:23 -07:00
Dave Miller b8c42f7f6f Introduce SnapshotView which wraps Renderable content and will verify the snapshot
Reviewed By: @javache

Differential Revision: D2493722
2015-10-02 12:15:24 -07:00
Alex Kotliarskyi de736227fa Add packager-managed assets support to NavigatorIOS
Reviewed By: @vjeux

Differential Revision: D2500520
2015-10-02 12:02:29 -07:00
Kushal Dave 1d77645a53 Set scrollsToTop = NO for UITextViews
Summary: Complete the work from 853d5b2221 by also fixing the placeholder view.
Closes https://github.com/facebook/react-native/pull/3129

Reviewed By: @​svcscm

Differential Revision: D2499753

Pulled By: @vjeux
2015-10-02 10:18:31 -07:00
Martin Konicek c15fd8f22c Add link to docs for React addons
Reviewed By: @javache

Differential Revision: D2502770
2015-10-02 08:29:17 -07:00
Harry Moreno b1c8e490e0 Add docs for View BorderWidth
Summary: Closes https://github.com/facebook/react-native/pull/3133

Reviewed By: @​svcscm

Differential Revision: D2502503

Pulled By: @mkonicek
2015-10-02 04:13:24 -07:00
leeyeh 626b551ff2 Implement EventTarget interface for WebSocket.
Summary: close #2583Closes https://github.com/facebook/react-native/pull/2599

Reviewed By: @​svcscm

Differential Revision: D2498641

Pulled By: @vjeux
2015-10-01 17:59:29 -07:00
Sebastian Markbage 14d2b0e147 Add benchmark for attribute diffing
Summary: Benchmark for testing the attribute diffing algorithm.

@​public

Reviewed By: @vjeux

Differential Revision: D2498078
2015-10-01 15:05:38 -07:00
Christopher Chedeau de717a8379 Polyfill Number.EPSILON and Number.MIN/MAX_SAFE_INTEGER
Summary: Those three properties have been ratified as ES6 but are not yet implementd in JSCore. This polyfills them.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON

@​public

Reviewed By: @sahrens

Differential Revision: D2497528
2015-10-01 15:05:33 -07:00
Tadeu Zagallo d96748492f Fix ReactPerf markers in Systrace
Reviewed By: @spicyj

Differential Revision: D2468107
2015-10-01 15:05:28 -07:00
Pieter De Baets f3a6466fcd Check if test runner is of right type before accessing its internals
Summary: I previously added this check to make the test complete waits until all teardown completed but if you're running tests with any other executor than the JSC one, this would crash.

@​public

Reviewed By: @jspahrsummers

Differential Revision: D2493967
2015-10-01 04:22:24 -07:00
Harry Moreno 90fc8a30dd Format Code in TextInput Comment
Summary: * wrap code snippet in TextInput Comment in backticks ```
* unless there is a way to omit portions of comments from reaching the
docs this is less confusingCloses https://github.com/facebook/react-native/pull/3085

Reviewed By: @​svcscm

Differential Revision: D2495630

Pulled By: @frantic
2015-09-30 21:02:44 -07:00
Danny van der Jagt 200b81172e Fix for IOS 8
Summary: **Problem**
Using push notifications in IOS 8 will throw this error:
`registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.`
The problem is that the check is running on compile instead of runtime.

**Solution**
If have changed the compile if statement to a runtime if statement. The fix is tested on: IOS 7.1 and 8.* and everything is working now.
This solution is also discussed in: https://github.com/facebook/react-native/issues/1613 and it was part of  https://github.com/facebook/react-native/pull/1979. (is being separated to keep things moving)

Please let me know what you think.Closes https://github.com/facebook/react-native/pull/2332

Reviewed By: @​svcscm

Differential Revision: D2490987

Pulled By: @ericvicenti
2015-09-30 21:02:31 -07:00
Magnus Bergman 6068c07e98 Fix dead link in PushNotificationIOS docs.
Summary: Closes https://github.com/facebook/react-native/pull/3117

Reviewed By: @​svcscm

Differential Revision: D2495539

Pulled By: @frantic
2015-09-30 15:40:27 -07:00
Justin Spahr-Summers a4ef7abebb Wait to clear RCTImageView.image until definitively removed from window
Summary: When `RCTImageView` is removed from the view hierarchy, it clears out its `image` to save memory. This makes sense, except that it gets removed from the window (view hierarchy) even when becoming the child of another view.

This fixes the logic so that it only clears out the image if the view hasn't been moved somewhere else within one frame.

@​public

Reviewed By: @javache

Differential Revision: D2493849
2015-09-30 09:40:30 -07:00
Felix Oghină 5ca5ec7688 add remote image support to toolbar
Differential Revision: D2493627
2015-09-30 09:21:27 -07:00
Kevin Gozali 5b2099f87f added QPL for main interactions
Reviewed By: @amirrosenfeld

Differential Revision: D2488420
2015-09-29 22:25:23 -07:00
Pieter De Baets 9076b71ac3 Use bundleForClass instead of mainBundle to find resources
Reviewed By: @jspahrsummers

Differential Revision: D2485109
2015-09-29 10:36:23 -07:00
Tadeu Zagallo 4c74f01b85 Move immediates to React batchedUpdates
Reviewed By: @jspahrsummers

Differential Revision: D2484935
2015-09-29 09:22:06 -07:00
Yinan Na 9ef24d8cc8 RC Fix storyline cannot open bug (iOS 7)
Reviewed By: @jingc

Differential Revision: D2486832
2015-09-29 09:21:55 -07:00
Alex Kotliarskyi f07dd70051 Managed assets support for RCTConvert
Reviewed By: @nicklockwood

Differential Revision: D2443130
2015-09-29 09:21:39 -07:00
James Ide 92109b8a0c Explanation of Modal's purpose in hybrid apps
Summary: Explained that Modal is for hybrid apps and suggest using a top-level Navigator in pure RN apps.
Closes https://github.com/facebook/react-native/pull/2663

Reviewed By: @​svcscm

Differential Revision: D2483626

Pulled By: @sahrens
2015-09-27 23:48:22 -07:00
Jiajie Zhu 0fb3d8de83 revert D2372548 to fix initial app state issue
Reviewed By: @hedgerwang

Differential Revision: D2480492
2015-09-25 13:25:26 -07:00
Olivier Notteghem 3f213e37d3 Fix scrollTo() method to pass integer as opposed to float
Reviewed By: @​nspaun

Differential Revision: D2480775
2015-09-25 13:01:25 -07:00
Justin Spahr-Summers 3bbfab545a Log when RCTImageView reloads and when assets are scaled
Summary: This sort of logging helped me identify issues with reloading images too frequently (and for trivial reasons), so leaving it in might be useful for future optimization work, or for anyone building apps using these components.

@​public

Reviewed By: @alexeylang

Differential Revision: D2475613
2015-09-25 02:29:25 -07:00
Krzysztof Magiera 6c3fb77f30 Static type check for int params + migrate colorInt to just int.
Differential Revision: D2475618

committer: Service User <svcscm@fb.com>
2015-09-24 08:20:14 -07:00
Jason Brown 74f467b00a Add skewX and skewY to the transform style options
Summary: Closes https://github.com/facebook/react-native/pull/2652

Reviewed By: @​trunkagent, @​svcscm

Differential Revision: D2437758

Pulled By: @vjeux
2015-09-24 08:19:59 -07:00
Hedger Wang 200d9af315 Add method `stopPropagation` and `stop` to NavigationEvent
Summary: @​public

Add method `stopPropagation` and `stop` to NavigationEvent so we can stop event easily once event bubbling and capturing is supported.

Reviewed By: @fkgozali

Differential Revision: D2471903
2015-09-24 08:19:52 -07:00
Jordan Byron 4c366d0bcb Remove duplicate PanResponderExample and update docs
Summary: While looking at the [pan responder docs](https://facebook.github.io/react-native/docs/panresponder.html#working-example) I noticed they linked to `ResponderExample` rather than `PanResponderExample` and that `ResponderExample ` defined `NavigatorIOSExample` which was odd. This PR just kills `ResponderExample` and updates the link in the docs. :bowtie:
Closes https://github.com/facebook/react-native/pull/1743

Reviewed By: @​svcscm

Differential Revision: D2468010

Pulled By: @vjeux
2015-09-23 19:29:35 -07:00
Alex Kotliarskyi 390649ab4e Support tintColor for managed image assets
Reviewed By: @nicklockwood

Differential Revision: D2443089
2015-09-23 19:29:30 -07:00
Alex Kotliarskyi 34d57afc32 Handle errors that are not `Error` instances
Reviewed By: @sahrens

Differential Revision: D1799587
2015-09-23 19:29:19 -07:00
Elia Grady 88b101bb3e Fixed typo
Summary: _setRenderSceneToHarwareTextureAndroid was changed to _setRenderSceneToHardwareTextureAndroid.
Closes https://github.com/facebook/react-native/pull/2869

Reviewed By: @​svcscm

Differential Revision: D2472438

Pulled By: @vjeux
2015-09-23 19:29:14 -07:00
Andrei Coman d1e316fce3 Remove text input warnings
Reviewed By: @mkonicek

Differential Revision: D2471396
2015-09-23 19:29:04 -07:00
Hedger Wang b2049e3ccb Hierarchical event bubbling - 1
Reviewed By: @fkgozali

Differential Revision: D2469495
2015-09-23 19:28:56 -07:00
Frédéric Sagnes d26d4708b0 Implement cancellation for RCTAssetsLibraryImageLoader
Reviewed By: @tadeuzagallo

Differential Revision: D2471253
2015-09-23 12:09:31 -07:00
rxb dcf245a9a2 Definable distance pagination for ScrollView
Summary: This is an enhancement for ScrollView that adds the ability to paginate based on a width other than the width of the ScrollView itself. This is a fairly common pattern used on apps like Facebook, App Store, and Twitter to scroll through a horizontal set of cards or icons:

![img_8726 2](https://cloud.githubusercontent.com/assets/451050/8017899/39f9f47c-0bd2-11e5-9c1d-889452f20cf7.PNG) ![img_8727 2](https://cloud.githubusercontent.com/assets/451050/8017898/39f962dc-0bd2-11e5-98b4-461ac0f7f21b.PNG)  ![img_8728 2](https://cloud.githubusercontent.com/assets/451050/8017900/39fd91a4-0bd2-11e5-8786-4cf0316295a0.PNG)

After trying to accomplish this only with JS, it appears that attempting to take over an in-progress native scroll animation with JS is always going to result in some amount of jankiness and jumping.

This pull request uses `scrollViewWillEndDragging` in RCTScrollView.m to adjust `targetContentOffset` based on two new optional props added to ScrollView. `snapToInterval` sets the multiple that the
Closes https://github.com/facebook/react-native/pull/1532

Reviewed By: @​svcscm, @​trunkagent

Differential Revision: D2443701

Pulled By: @vjeux
2015-09-23 11:47:25 -07:00
alvaromb b9ef384f74 Updated TouchableHighlight docs
Summary: ``onlyChild`` restriction is implemented in ``TouchableHighlight``, not ``TouchableOpacity``.
Closes https://github.com/facebook/react-native/pull/2542

Reviewed By: @​svcscm

Differential Revision: D2471539

Pulled By: @vjeux
2015-09-23 11:25:34 -07:00
Brent Vatne 118cf51522 Fix PanResponder example code
Summary: Fixes this:

![](http://url.brentvatne.ca/VwLF.png)
Closes https://github.com/facebook/react-native/pull/1464

Reviewed By: @​svcscm

Differential Revision: D2471541

Pulled By: @vjeux
2015-09-23 11:25:27 -07:00
Justin Spahr-Summers bcd2ef5dfc Improve RCTImageView resizing logic
Summary: @​public

It's less important to reload for downscaling than upscaling, so increase the threshold in that direction. Also, this now considers each dimension separately, and a big enough change either way should result in a reload.

Finally, this considers both the current image size and the inflight target size, so we don't reload if either is already good.

Reviewed By: @tadeuzagallo

Differential Revision: D2470911
2015-09-23 07:32:30 -07:00
Justin Spahr-Summers de85bcab0b Cancel previous calls to -[RCTImageView reloadImage] to prevent extra work
Reviewed By: @tadeuzagallo

Differential Revision: D2470902
2015-09-23 07:32:23 -07:00
James Ide 3b68869fc8 Add scrollWithoutAnimationTo to Android
Summary: `ScrollView.scrollWithoutAnimationTo` is supported on iOS but not Android. This is an existing API, and this diff adds Android support.

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

Reviewed By: @​svcscm

Differential Revision: D2452630

Pulled By: @mkonicek
2015-09-23 05:58:27 -07:00
Amir Rosenfeld 8a638d8e58 move qpl to oss
Reviewed By: @mkonicek

Differential Revision: D2465929
2015-09-22 17:33:28 -07:00
Alex Coco 12a0045412 Fix typo in cloneWithRows comments
Summary: `s/informatoin/information/`
Closes https://github.com/facebook/react-native/pull/2532

Reviewed By: @​svcscm

Differential Revision: D2469067

Pulled By: @vjeux
2015-09-22 17:02:27 -07:00
Jan Kassens 9486642322 Prop routeMapper of Navigator.NavigationBar is required
Summary: The component will crash if the prop is not provided. This helps with a better
error message in the console output.
Closes https://github.com/facebook/react-native/pull/2894

Reviewed By: @​svcscm

Differential Revision: D2461752

Pulled By: @ericvicenti
2015-09-22 14:44:28 -07:00
Colin Parsons 972ae4c186 fix minor grammar and typo errors in comments
Summary: comments only. no code modified.
Closes https://github.com/facebook/react-native/pull/2038

Reviewed By: @​svcscm

Differential Revision: D2468021

Pulled By: @vjeux
2015-09-22 14:41:28 -07:00
Tamara Woodson 4447bff976 Fix minor grammatical error in documentation
Summary: No code changes; comments/documentation only.
Closes https://github.com/facebook/react-native/pull/2083

Reviewed By: @​svcscm

Differential Revision: D2468024

Pulled By: @vjeux
2015-09-22 14:25:25 -07:00
Christopher Chedeau f7ff980876 Merge pull request #1416 from dalinaum/fix-warning
[Cosmetic] Fix some lint warnings
2015-09-22 14:06:41 -07:00
Joel Arvidsson 7f76f08a11 Better feature detection for FormData/FileReader/Blob
Summary: This PR bumps fetch to 0.9.0, the latest release and fixes broken feature detection originating in that self is not referring to `window.self` but an empty object. Assigning that object to window.self or GLOBAL won't work in the chrome dev tools because of CORS restrictions. This is a pragmatic solution but maybe not ideal.

Background to the problem can be read here: https://github.com/facebook/react-native/issues/2376
Closes https://github.com/facebook/react-native/pull/2587

Reviewed By: @​trunkagent, @​svcscm

Differential Revision: D2438341

Pulled By: @vjeux
2015-09-22 13:53:24 -07:00
Christopher Chedeau a50b4ea7b9 Initial web implementation
Summary: @​public

This diff does a couple of things:
- Move all the code in a src/ folder
- Move bezier.js in the Animated folder
- Rename Animated.js into AnimatedImplementation.js and adds two entry points: AnimatedReactNative.js and AnimatedWeb.js
- Implement very dumb polyfills for flattenStyle, Set and InteractionManager
- Import my work in progress demo.html file to make sure that the code is actually working.

Everything is not working correctly:
- It calls forceUpdate on every frame and doesn't use bindings because setNativeProps is not implemented
- None of the style: {transform} are working because React web doesn't know about the array notation for transform
- The demo need more work

Reviewed By: @sahrens

Differential Revision: D2464277
2015-09-22 11:58:37 -07:00
Yusef Napora 2f9bd1f62f App Extension support
Summary: This adds workarounds for the code that was preventing React from compiling when linked against an iOS App Extension target.

Some iOS APIs are unavailable to App Extensions, and Xcode's static analysis will catch attempts to use methods that have been flagged as unavailable.

React currently uses two APIs that are off limits to extensions: `[UIApplication sharedApplication]` and `[UIAlertView initWith ...]`.

This commit adds a helper function to `RCTUtils.[hm]` called `RCTRunningInAppExtension()`, which returns `YES` if, at runtime, it can be determined that we're running in an app extension (by checking whether the path to `[NSBundle mainBundle]` has the `"appex"` path extension).

It also adds a `RCTSharedApplication()` function, which will return `nil` if running in an App Extension. If running in an App, `RCTSharedApplication()` calls `sharedApplication` by calling `performSelector:` on the `UIApplication` class.  This passes the static analysis check, and, in my opinion, obeys the "spirit of th
Closes https://github.com/facebook/react-native/pull/1895

Reviewed By: @​svcscm

Differential Revision: D2224128

Pulled By: @nicklockwood
2015-09-22 10:46:26 -07:00
Jason Als f762a55abd Wrong function name
Summary: RippleAndroid is actually Ripple
Closes https://github.com/facebook/react-native/pull/2710

Reviewed By: @​svcscm

Differential Revision: D2452607

Pulled By: @mkonicek
2015-09-21 09:00:34 -07:00
Christoph Pojer fa01b2e4cb Codemod tests to use top-level-requires
Reviewed By: @DmitrySoshnikov

Differential Revision: D2456250
2015-09-19 15:41:29 -07:00
Jeff Morrison 2bbdbc704d React native fixups
Reviewed By: @gabelevi

Differential Revision: D2456130
2015-09-18 10:36:24 -07:00
alantrrs c6495531fb Fix typo on example code
Summary: Closes https://github.com/facebook/react-native/pull/2828

Reviewed By: @​svcscm

Differential Revision: D2457233

Pulled By: @foghina
2015-09-18 10:32:32 -07:00
ChristianHersevoort b6cb0e1246 Fixed typo in TouchableNativeFeedback docs
Summary: Closes https://github.com/facebook/react-native/pull/2843

Reviewed By: @​svcscm

Differential Revision: D2457197

Pulled By: @foghina
2015-09-18 10:32:25 -07:00
James Ide 4fd03ba21a Finish up the work to send through the error cookie
Summary: - Includes the error cookie with soft exceptions as well since they too can be updated (requires tiny Android change too)
- Passes the error cookie through instead of leaving it unused
Closes https://github.com/facebook/react-native/pull/2198

Reviewed By: @​svcscm

Differential Revision: D2455391

Pulled By: @sahrens
2015-09-17 18:15:27 -07:00
Hedger Wang 1fd27dae5e Fix crash on RC while toggling object status.
Reviewed By: @​chaceliang

Differential Revision: D2454891
2015-09-17 17:20:51 -07:00
Alexsander Akers 9a2d05d9b2 Move color processing to JS
Reviewed By: @vjeux

Differential Revision: D2346353
2015-09-17 17:20:45 -07:00
Felix Oghină 6078a4f865 add docs to BackAndroid so they show up in the website
Summary: Fix github issue #2777

@​public

Reviewed By: @andreicoman11

Differential Revision: D2452599
2015-09-17 17:20:32 -07:00
Hedger Wang bab9bfec3a Fix crash on RC while toggling object status.
Reviewed By: @​chaceliang

Differential Revision: D2446382
2015-09-16 15:35:35 -07:00
Martin Konicek 674abf1955 Flexbox docs
Summary: Documenting this as it wasn't obvious the defaults were different:
https://github.com/facebook/react-native/issues/2724

@​public

Reviewed By: @vjeux

Differential Revision: D2450283
2015-09-16 15:23:01 -07:00
facebook-github-bot-6 0d09f22dbf Get back 100% in sync with fb codebase 2015-09-16 10:30:53 -07:00
Nick Lockwood 0044b3c2c3 Added logic to detect text encoding for downloaded data
Summary: @​public

RCTNetworking currently relies on network responses to include an accurate text encoding, otherwise it is unable to convert the response data to text unless it's encoded as UTF8.

See: https://github.com/facebook/react-native/issues/1780#issuecomment-139334294 for details.

This diff makes use of a new feature in iOS8 to detect the encoding of the text authomatically

Reviewed By: @sahrens

Differential Revision: D2443446
2015-09-16 10:25:06 -07:00
Sebastian Markbage 890c2193d0 Kill old transform propTypes/attributes
Summary: I can't find anywhere these are being used by the bridge / native
views anymore. I don't think they work anymore. ART has a similar
API but uses a different code path.

We might as well clean this up. Makes it easier to reason about.

@​public

Reviewed By: @vjeux

Differential Revision: D2445353
2015-09-16 10:25:01 -07:00
Christopher Chedeau fa042eda50 Update TransformPropTypes.js 2015-09-16 10:24:43 -07:00
Christopher Chedeau be966f5a25 Testing import script
Summary: Closes https://github.com/facebook/react-native/pull/2622

Reviewed By: @​trunkagent, @​svcscm

Differential Revision: D2427801

Pulled By: @vjeux
2015-09-15 18:25:31 -07:00
Eric Vicenti c962251900 Fix crash when touch terminates without active gesture
Summary: When the touch gets terminated, it is not guaranteed that there is an active gesture. It looks like this was causing crashes

@​public

Reviewed By: @​chaceliang

Differential Revision: D2441469
2015-09-15 13:12:05 -07:00
Spencer Ahrens 4dca06b238 UIManagerStatTracker
Reviewed By: @astreet

Differential Revision: D2442406
2015-09-15 13:11:58 -07:00
Param Aggarwal f35fbc2a14 Fixes consistent crash on iPad with iOS 8 while sharing.
Summary: (Fixes #1890, #2395, #2604.)

Usage:
```
ActionSheetIOS.showShareActionSheetWithOptions({
  anchor: React.findNodeHandle(this.refs.share),
  message: "React Native",
  url: "https://github.com/facebook/react-native"
}, (e)=>{ console.log('shared'); }, (e)=>{console.log('dismissed'); });
```

Screenshot on iPad with iOS 8:

<img width="324" alt="screen shot 2015-09-09 at 8 50 26 am" src="https://cloud.githubusercontent.com/assets/543981/9752590/df5cd324-56cf-11e5-892b-92a6c98f3d39.png">

If the `anchor` is not specified, it will centre the popup on screen without arrows:

![centered](https://cloud.githubusercontent.com/assets/543981/9752612/10c87c6a-56d0-11e5-8c59-fcbf64a36f9c.png)

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

Reviewed By: @nicklockwood

Differential Revision: D2439533

Pulled By: @javache
2015-09-15 11:35:26 -07:00
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00
Andrei Coman eb48759675 Add License headers to .js files
Differential Revision: D2438967

committer: Service User <svcscm@fb.com>
2015-09-14 07:40:31 -07:00
Dorota Kapturkiewicz d7ee28e079 fix ToastAndroid
Differential Revision: D2433671

committer: Service User <svcscm@fb.com>
2015-09-11 07:50:29 -07:00
Yamill Vallecillo f8f75ff612 Navigator.NavigationBar Landscape Fix
Summary: NavigationBar items are fixed to Portrait when Device is in Landscape.

This supplements that fix by removing the `width` properties and just using `left` and `right` positioning respectively.

<strong>Before:</strong>

![ios simulator screen shot sep 8 2015 1 27 02 pm](https://cloud.githubusercontent.com/assets/755943/9743817/3e6b858a-5636-11e5-80e8-81e62b46c46e.png)

<strong>After:</strong>

![ios simulator screen shot sep 8 2015 1 29 21 pm](https://cloud.githubusercontent.com/assets/755943/9743822/43e7d4b4-5636-11e5-8e1c-9f13bdc492b2.png)

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

Reviewed By: @vjeux

Differential Revision: D2426942

Pulled By: @ericvicenti
2015-09-10 14:00:26 -07:00
Nick Lockwood 33036b1f01 Fixed DatePickerIOS onChange event
Reviewed By: @javache

Differential Revision: D2429598
2015-09-10 10:10:26 -07:00
Bill Fisher 493cb35966 Fix flow typing of TimingAnimationConfig
Summary: @​public
Make the flow type of TimingAnimationConfig and TimingAnimation the same as SpringAnimationConfig and SpringAnimation.
This is a more accurate flow type as both are multiplexed through maybeVectorAnim().

Reviewed By: @sahrens

Differential Revision: D2410166
2015-09-09 23:55:30 -07:00
Alex Kotliarskyi ce47e56b7b Attach platform to asset url
Summary: Depends on D2420548

Reviewed By: @martinbigio

Differential Revision: D2421696
2015-09-09 11:25:26 -07:00
Dorota Kapturkiewicz 4a4f087a9c move Toast to oss
Summary: Importing JS changes to fbobjc which should be maintained as a source of truth
for React Native JS files. For more details about this change, please refer to
the original diff in fbandroid repo: D2410797

Reviewed By: @andreicoman11

Differential Revision: D2424679
2015-09-09 11:25:22 -07:00
Christopher Chedeau a9607901e2 Updates from Tue 8 Sep 2015-09-08 16:54:44 -07:00
Chace Liang c971aae676 [RN][Accessibility] typo in onAccessibilityTap 2015-09-08 10:40:28 -08:00
Nacho Lopez Sais 551815c1cf Adapted changes from android repo for TextInput numberOfLines 2015-09-08 10:25:13 -08:00
Nick Lockwood 56d25bbbdd Moved CameraRoll-related classes into CameraRoll folder instead of Image
Summary:
The CameraRoll-related APIs were mixed in with the Image classes due to legacy coupling issues. Now that the APIs have been decoupled, it makes more sense for the CameraRoll classes to live in a separate library.

This will be a breaking change for apps using the CameraRoll or related APIs. Fix is to add the RCTCameraRoll lib to your project.
2015-09-08 09:48:19 -08:00
Nick Lockwood 2061899224 Fixed networker crash due to threading bug 2015-09-08 04:03:04 -08:00
Nick Lockwood ad0c97f25b Fixed PickerIOS onChange event 2015-09-08 03:34:33 -08:00
Spencer Ahrens 1f6f60582d [RN] Prevent reloading library photos on every animation frame 2015-09-06 17:16:10 -08:00
Gabe Levi 874f39bf7f [Flow] Clean up react-native for Flow v0.15.0 2015-09-04 16:51:18 -08:00
Nick Lockwood e4110456ab Changed RCTImageLoader to always return a UIImage
Summary:
GIF images are currently loaded as a CAKeyframeAnimation, however returning this animation directly from RCTImageLoader was dangerous, as any code that expected a UIImage would crash.

This diff changes RCTGIFImageLoader to return a UIImage of the first frame, with the keyframe animation attached as an associated object. This way, code that is not expecting an animation will still work correctly.
2015-09-04 05:10:34 -08:00
Aaron Chiu 3c4adeb2e7 [ReactNative][SyncDiff] Hook in the Dialog.onDismiss to JS 2015-09-04 04:09:25 -08:00
Pieter De Baets 9b1f6c9e30 Make RCTTestRunner wait for JS context to deallocate 2015-09-04 03:24:16 -08:00
Spencer Ahrens cc1a9fa3f3 [RN] Document Animated.js 2015-09-03 19:25:41 -08:00
Spencer Ahrens fdeb6a842a [RN] New AnimationExample 2015-09-03 12:52:56 -08:00
Chace Liang 836e4c03fc [RN][Accessibility] Expose accessibilityTraits and accessibilityComponentType props to Touchable* component 2015-09-03 12:16:21 -08:00
Spencer Ahrens d7b13fb32b Updates from Thu Sep 3rd. 2015-09-03 12:55:40 -07:00
Alex Akers 8187d1f0ec Update image loader plugins 2015-09-03 06:06:19 -08:00
Nick Lockwood aa62a5e4e0 Send layout events on shadow queue
Summary:
We currently wait until after views have been updated on the main thread before sending layout events. This means that any code that relies on those events to update the UI will lag the atual layout by at least one frame.

This changes the RCTUIManager to send the event immediately after layout has occured on the shadow thread. This noticably improves the respinsiveness of the layout example in UIExplorer, which now updates the dimension labels immediately instead of waiting until after the layout animation has completed.
2015-09-03 03:42:26 -08:00
Oliver (Cunpu) Bo f28255ea3e Support "file://" in RCTImageLoader 2015-09-02 16:37:33 -08:00
Alex Akers 36444a65c7 Add pluggable image processing system 2015-09-02 08:31:34 -08:00
Nick Lockwood 848839858b Added mechanism for directly mapping JS event handlers to blocks
Summary:
Currently, the system for mapping JS event handlers to blocks is quite clean on the JS side, but is clunky on the native side. The event property is passed as a boolean, which can then be checked by the native side, and if true, the native side is supposed to send an event via the event dispatcher.

This diff adds the facility to declare the property as a block instead. This means that the event side can simply call the block, and it will automatically send the event. Because the blocks for bubbling and direct events are named differently, we can also use this to generate the event registration data and get rid of the arrays of event names.

The name of the event is inferred from the property name, which means that the property for an event called "load" must be called `onLoad` or the mapping won't work. This can be optionally remapped to a different property name on the view itself if necessary, e.g.

  RCT_REMAP_VIEW_PROPERTY(onLoad, loadEventBlock, RCTDirectEventBlock)

If you don't want to use this mechanism then for now it is still possible to declare the property as a BOOL instead and use the old mechanism (this approach is now deprecated however, and may eventually be removed altogether).
2015-09-02 06:11:24 -08:00
Spencer Ahrens 4379aa00de [RN] Use default param for elastic bounciness 2015-09-01 20:38:50 -08:00
Hedger Wang 36dfd402b2 [madman] Supports `onLayout` for `AdsManagerTouchableHighlight`.
Summary:
Supports `onLayout` for Touchable*` by piping onLayout
through to the native component inside since only native components support
it by default.
2015-09-01 10:22:47 -08:00
Marius Butuc 3cd9187a26 Fix LinkingIOS docs typo
Summary:
And yes, just agreed to the Contributor License Agreement (CLA). 👍
Closes https://github.com/facebook/react-native/pull/2483
Github Author: Marius Butuc <marius@shopify.com>
2015-09-01 08:09:45 -08:00
James Ide 853d5b2221 [TextInput] Set scrollsToTop = NO for UITextViews
Summary:
Now that UITextViews have a delegate, they consume the "tap to scroll to top" gesture. This diff restores the original behavior of letting the top-level scroll view (if any) scroll to top instead.

I tried exposing scrollsToTop as a prop and was semi-successful in that I could turn scroll-to-top on and off for the top-level scroll view scroll, but the text view itself would never scroll to top. So instead of exposing it as a prop, this diff sets scrollsToTop always to NO, which is how TextInput behaved previously.

Closes https://github.com/facebook/react-native/pull/2333
Github Author: James Ide <ide@jameside.com>
2015-09-01 02:40:15 -08:00
Nathan Spaun 1ff22b7b9c Adding jest tests to groups rn 2015-08-31 17:35:47 -08:00
Spencer Ahrens 465f539057 Updates from Mon Aug 31st. 2015-08-31 16:31:41 -07:00
Spencer Ahrens 9ad2c322c0 [RN] improve elastic easing
Summary:
1) Makes params more intuitive (only one now, bounciness, which maps intuitively to number of oscillations).
2) Satisfies boundary conditions (f(0) = 0, f(1) = 1) so animation actually goes where you tell it (before it would finish at a random location depending on the input params).
3) Simple test to verify boundary conditions.
2015-08-31 13:39:00 -08:00
Spencer Ahrens 94ae886060 [RN] add clarifying Android-only comment to Portal 2015-08-31 11:10:45 -08:00
Felix Oghina 53fc5624e4 [reactnative] send platform arg with all packager requests 2015-08-29 06:36:18 -08:00
Nick Lockwood fa6bc1c3cd Fixed WebView example 2015-08-27 14:08:17 -08:00
Eric Vicenti 99bd57aef2 [ReactNative] Improve error handling with missing bridge callback
Summary:
This will throw an error message with the problematic callback module/method. Previously we would get an invariant in this case when we try to access `callback.apply` later in the method.
2015-08-27 11:02:58 -08:00
Andrei Coman 8ec1a180df [ReactNative][SyncDiff] Add more items to react-native target 2015-08-27 06:31:30 -08:00
Alex Kotliarskyi c7b1509615 [react-native] Fix tests and re-enable CI 2015-08-26 20:58:24 -08:00
Alex Kotliarskyi 5b25f208c5 [ReactNative] Teach flow how to deal with images 2015-08-26 18:26:09 -08:00
Andy Street a9115bcbb3 [ReactNative][SyncDiff] Add parameter to allow turning on/off off screen rendering for alpha compositing 2015-08-26 15:15:36 -08:00
Martin Konicek 590156a360 More updates from Wed 26 Aug 2015-08-26 18:52:03 +01:00
Andrei Coman f2da308928 [ReactNative] Add unimplemented views for some components 2015-08-26 05:47:12 -08:00
Martin Konicek 5526533f51 Updates from Wed 26 Aug 2015-08-26 14:04:01 +01:00
Andrei Coman a8f11d7115 [ReactNative] Add TouchableNativeFeedback to OSS 2015-08-26 01:31:52 -08:00
Andy Street 162d12cfa4 [ReactNative][SyncDiff] Allow renderToHardwareTextureAndroid to be used outside of setNativeProps 2015-08-25 16:55:51 -08:00
Andy Street 504fa60168 [ReactNative][SyncDiff] AutoSync 2015-08-25 14:54:10 -08:00
Martin Konicek da7ac11c53 Updates from Tue 25 Aug 2015-08-25 19:21:59 +01:00
Alexey Lang 2d2252cd50 Use native initialAppState to init app_state for AppStateIOS. 2015-08-25 09:32:28 -08:00
Martin Konicek 5f8c0613fe [ReactNative] Temporarily disable flow in TabBarItemIOS 2015-08-25 07:16:35 -08:00
Nick Lockwood 65a3c07cfe Fixed tab bar icon scale
Summary:
TabBarItemIOS supports setting the scale for base64-encoded images using an optional scale parameter, however this was broken due to the JS code only passing the uri, not the whole source object, to the native side.

(See: https://github.com/facebook/react-native/issues/2413)
2015-08-25 05:26:14 -08:00
Tadeu Zagallo fe0143eb20 [ReactNative] Update JS profiler to be compatible with Android
Summary:
Use nativeTraceBeginSection and nativeTraceEndSection with a more dynamic signature
to be compatible with Android.
2015-08-25 02:25:29 -08:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Tim Yung af8a6a44b2 RN: Expose React.unstable_batchedUpdates
Summary:
Per @spicyj in facebook/relay#127, this exposes `unstable_batchedUpdates` in React Native the same way it is exposed in `ReactDOM`.
2015-08-21 15:24:56 -08:00
Alex Kotliarskyi 8d07df4a22 [ReactNative] Unbreak debugger 2015-08-21 11:20:17 -07:00
Dorota Kapturkiewicz f128269da7 [ReactNative] make radiobutton work with accessibility 2015-08-21 07:23:04 -07:00
Bill Fisher debca6d24f [ReactNative] Pass events through to touchable handlers
Summary:
We want to be able to access the touch data within our components' event handlers, so we need to thread the event object all the way through to them.
2015-08-21 03:03:32 -07:00
Harrison Harnisch 46c6cde947 UI CPU and memory utilization graphs in Chrome debugging mode
Summary:
Chrome debugging UI is currently only showing connection state and logs in the console, leaving room for plenty of interesting information.

I've pushed the UI (using the same convention set by FPS -- UI/JS) CPU and memory utilization data over the debug Websocket and tapped into the existing stream of JS calls that get ran in V8.

The number of JS calls in a time interval is counted for all sub calls in a batch
https://github.com/hharnisc/react-native/blob/master/packager/debugger.html#L150

The last 5 batches of JS calls are displayed in a list format.

<img width="951" alt="screen shot 2015-07-19 at 7 34 00 pm" src="https://cloud.githubusercontent.com/assets/1388079/8769257/edc42f70-2e4d-11e5-8813-e86ef530a446.png">

Charts are created with [Chart.JS](https://github.com/nnnick/Chart.js) (MIT licensed).
Closes https://github.com/facebook/react-native/pull/2050
Github Author: Harrison Harnisch <hharnisc@gmail.com>
2015-08-21 02:11:45 -07:00
Eric Vicenti 6f17dba39b [ReactNative] Remove POPAnimation
Summary:
Thanks to @vjeux' work on Animated, we have transitioned away from POPAnimation entirely
2015-08-20 22:24:28 -07:00
Emily Janzer 4b28a847e6 [android] fix crash if breadcrumb refs don't exist 2015-08-20 19:08:16 -07:00
Andy Street a0168a8c62 [ReactNative] [SyncDiff] Create new non-coalesceable event for when native should take the responder lock 2015-08-20 13:56:23 -07:00
Spencer Ahrens 5f91d404e1 [RN] Fix Animated tests 2015-08-20 10:28:49 -07:00
Dorota Kapturkiewicz ed9b8c8b3b [ReactNative] Disable accessibility of RootView when dialog appears. Apply it for AdsManager. 2015-08-20 10:16:13 -07:00
Dorota Kapturkiewicz b888e8db40 [ReactNative] make sending accessibility events from JS possible and fix dialog 2015-08-20 08:41:22 -07:00
Tadeu Zagallo 81fdf3e532 [ReactNative] Change RCTProfile API to be compatible with systrace 2015-08-20 00:47:23 -07:00
Christopher Chedeau 16ddb1962a [ReactNative] Remove warning for <Image source={require('./image.jpg')} />
Summary:
require('./image.jpg') returns a number and therefore the propType is wrong. Adding it to the propType to fix the warning and dealing with flow which is completely broken for this.
2015-08-19 22:53:25 -07:00
Spencer Ahrens 059e605e49 [RN] Mark some internal animated stuff as protected 2015-08-19 21:16:38 -07:00
Ben Alpert 0f3ea9fb8c [ReactNative] Fix switching to null event listener 2015-08-19 15:02:25 -07:00
Nick Lockwood 26c4be62c8 Fixed test flakiness due to a race condition with RCTRedBox
Summary:
The test runner relied on checking the current error message in the RCTRedbox, which is a singleton (yay, shared mutable state!). This lead to some tests that worked individually but failed when run together due to error messages in RCTRedBox left over from previous tests.

I've replaced the call to -[RCTRedBox currentErrorMessage] by injecting a custom logging function to intercept the errors at source, which is a much more reliable solution.
2015-08-19 03:41:31 -07:00
Krzysztof Magiera 67746fea2f [ReactNative] Use FbHttp for handling http requests from React Native. 2015-08-18 09:12:40 -07:00
Natthu Bharambe a4e64196bc Update `GLOBAL.process` instead of over-writing during initialization. 2015-08-17 16:47:10 -07:00
Ben Alpert 65692b7235 [ReactNative] Don't redbox for React warnings when not using Chrome executor 2015-08-17 16:02:10 -07:00
Nick Lockwood 8d1e02b8bd Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
Mike Armstrong bce7b9c638 generalise handling of uniforms and samplers 2015-08-17 07:13:17 -07:00
Pieter De Baets 261f9434e5 Avoid dispatch_async in RCTRootView when bridge has already started
Summary:
There's no good reason for initialProperties to be mutable after the RCTRootView has been created. Passing it in through the constructor means we can skip one dispatch_async.
2015-08-17 05:34:25 -07:00
Ludo Fardel 8460db57bc Make flow check async 2015-08-17 03:13:16 -07:00
Alexsander Akers 91c8362176 Rename RCTReachability to RCTNetInfo 2015-08-14 08:20:01 -08:00
Nick Lockwood 3f5fcadbd5 Fix null values in network requests 2015-08-14 05:16:02 -08:00
Alexsander Akers 0f14933948 Enable transparent modal presentation with <Modal />
Summary:
Enable transparent modal backgrounds using `UIModalPresentationCustom` modal presentation style.
2015-08-14 04:47:12 -08:00
Alexsander Akers dc01ecbc98 Remove now useless comment 2015-08-14 04:46:26 -08:00
Dorota Kapturkiewicz a2c51b3b28 [ReactNative] expose importantForAccessibility to JS 2015-08-14 03:28:22 -08:00