Commit Graph

6529 Commits

Author SHA1 Message Date
Shawn Wilsher 856f9e9fed Add `--version` to `local-cli/cli.js`
Summary:
[Buck](https://buckbuild.com) has a concept of a versioned tool.  In order to
properly use RN with Buck, the `cli.js` script should return the proper version
when passed `--version`.

Reviewed By: astreet

Differential Revision: D3197207

fb-gh-sync-id: 12ea35587cf492eb89d7dd102e93bdd26bc813c0
fbshipit-source-id: 12ea35587cf492eb89d7dd102e93bdd26bc813c0
2016-04-29 09:25:32 -07:00
Dave Miller 850befa3cd Remove unused code
Reviewed By: davidaurelio

Differential Revision: D3240927

fb-gh-sync-id: b9ecb5269026314905a22eae3b32fd546574c5ef
fbshipit-source-id: b9ecb5269026314905a22eae3b32fd546574c5ef
2016-04-29 08:48:19 -07:00
Erem Zeit 2b191bfab7 Update docs for creating an android native view
Summary:
Doc changes only.  Updating example code to reflect the new requirements discussed in this [issue](https://github.com/facebook/react-native/issues/4605).

In short, in the JS code that registers your new native view, you need to explicitly include the `propTypes` that come default for views or else you get an error.
Closes https://github.com/facebook/react-native/pull/7281

Differential Revision: D3240654

Pulled By: mkonicek

fb-gh-sync-id: f7571ce7435c5b241a17af2822e7e350ce3186cb
fbshipit-source-id: f7571ce7435c5b241a17af2822e7e350ce3186cb
2016-04-29 08:16:23 -07:00
Kudo Chien 708443e50c Add biideal app to showcase
Summary:
Add biideal app to showcase which is my first RN app.
Closes https://github.com/facebook/react-native/pull/7263

Differential Revision: D3240862

Pulled By: mkonicek

fb-gh-sync-id: ba76bc19382f22f03516c02c4e01d48c53ee70f4
fbshipit-source-id: ba76bc19382f22f03516c02c4e01d48c53ee70f4
2016-04-29 07:37:20 -07:00
Charles Dick 24b2990467 Capture heap from the dev menu
Reviewed By: foghina

Differential Revision: D3229856

fb-gh-sync-id: c6321cfb309c93572a51bba625d63246a75f0254
fbshipit-source-id: c6321cfb309c93572a51bba625d63246a75f0254
2016-04-29 07:35:22 -07:00
alvaromb 84e696867b Added badge icon number and alert action
Summary:
Added support for setting an optional badge icon number and alert action when using local notifications.
Closes https://github.com/facebook/react-native/pull/2931

Differential Revision: D3212448

Pulled By: mkonicek

fb-gh-sync-id: 063efcdd259b2a43f39812f57a71e8489ab33653
fbshipit-source-id: 063efcdd259b2a43f39812f57a71e8489ab33653
2016-04-29 05:37:27 -07:00
Martin Konicek 12caa363a1 Remove 'react-native link'
Summary:
`react-native link` was an early experiment, [rnpm](https://github.com/rnpm/rnpm) does this much better. After merging this PR we should merge rnpm so that `react-native link` works again :)

grabbou Kureev Just making some space here :)

This reverts 4e5a2bc079.

**Test Plan**

e2e tests on Travis and CircleCI
Closes https://github.com/facebook/react-native/pull/7290

Differential Revision: D3240702

Pulled By: mkonicek

fb-gh-sync-id: 6aac83fac599ba3db0dd0a7ac48653ebabd93491
fbshipit-source-id: 6aac83fac599ba3db0dd0a7ac48653ebabd93491
2016-04-29 05:27:28 -07:00
Jagdeep Nagpal 3d0d426d46 Renamed --flavor to --variant
Summary:
This small update to runAndroid.js which renames --flavor to --variant.
~~`react-native run-android --flavor=staging`~~

~~doesn't work as it needs build type as well~~

~~so at present it needs to be like this~~

~~`react-native run-android --flavor=stagingDebug`~~

~~it looks messy, instead if we want to use the original spec then Debug must be concatenated to the end all the time as run-android was speced to trigger only debug builds~~
Closes https://github.com/facebook/react-native/pull/7036

Differential Revision: D3240692

Pulled By: mkonicek

fb-gh-sync-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581
fbshipit-source-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581
2016-04-29 05:18:24 -07:00
Jean Regisser 0045e07928 Updated iOS native UI component events documentation
Summary:
Documentation on iOS about triggering events from native components was outdated.

Let me know what you think.
Closes https://github.com/facebook/react-native/pull/6739

Differential Revision: D3240665

Pulled By: mkonicek

fb-gh-sync-id: f62d52bebd58aae6f93388734338ef74ae536ec5
fbshipit-source-id: f62d52bebd58aae6f93388734338ef74ae536ec5
2016-04-29 05:11:59 -07:00
Konstantin Raev f99786cc89 Made SandCastle run the same Instrumentation Tests that are open sourced and are running on CI
Reviewed By: mkonicek

Differential Revision: D3229774

fb-gh-sync-id: 48239e8898eb011ad767bf102aa65025351363c6
fbshipit-source-id: 48239e8898eb011ad767bf102aa65025351363c6
2016-04-29 05:11:59 -07:00
Sokovikov 58876d5a03 fix border style without borderRadius
Summary:
closes #6721 closes #3159
before(without borderRadius)
![bug](https://cloud.githubusercontent.com/assets/1488195/14235087/fcf79f8a-f9eb-11e5-9d44-7ab1d131be24.jpg)

after
![fix](https://cloud.githubusercontent.com/assets/1488195/14235067/8cf128b4-f9eb-11e5-8170-ad3a146d6104.jpg)
Closes https://github.com/facebook/react-native/pull/6789

Differential Revision: D3240657

Pulled By: mkonicek

fb-gh-sync-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
fbshipit-source-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
2016-04-29 04:53:29 -07:00
David Aurelio 8375778496 Upgrade node-haste to 2.10.1
Reviewed By: bestander

Differential Revision: D3238180

fb-gh-sync-id: 06d62a5855864301a5480e349cfec2c0a2d5b79f
fbshipit-source-id: 06d62a5855864301a5480e349cfec2c0a2d5b79f
2016-04-29 04:44:32 -07:00
Janic Duplessis 891b87e7fb Launch the packager with `react-native run-android` on Windows
Summary:
Adds support for launching the packager in a new window on Windows.

**Test plan (required)**

Tested that the packager is launched in a completely independent process. This means that exiting the `react-native run-android` command should not close the packager window and it should exit properly when completed even if the packager window is still opened. Pretty much made sure it behaves exactly like on mac.

Also tested that an error in the packager will not close the window immediately to show the error stack trace.
Closes https://github.com/facebook/react-native/pull/7129

Differential Revision: D3240628

Pulled By: mkonicek

fb-gh-sync-id: 007582250536481d2b2376f9a201f8f415fc1080
fbshipit-source-id: 007582250536481d2b2376f9a201f8f415fc1080
2016-04-29 04:14:22 -07:00
Dave Miller 3a5457cd7c Add support for setChildren
Summary: This adds support for UIManager.setChildren on Android like D2757388 added for iOS.

Reviewed By: andreicoman11

Differential Revision: D3235369

fb-gh-sync-id: b538556ec4abdb606f9be26d1b74734046bca0cd
fbshipit-source-id: b538556ec4abdb606f9be26d1b74734046bca0cd
2016-04-29 04:03:24 -07:00
Kudo Chien 3f0207d7b5 Fix textShadowOffset error without width or height
Summary:
textShadowOffset design is `ReactPropTypes.shape({width: ReactPropTypes.number, height: ReactPropTypes.number})`, so either width or height is optional.
Unfortunately, in Android implementation, it is my bad not handling optional case and lead to an exception.
Thanks kohver for reporting [this issue](https://github.com/facebook/react-native/pull/4975#issuecomment-213006641)

**Test plan (required)**

*Before this fix*
1. Modify TextExample.android.js to `<Text style={{fontSize: 20, textShadowOffset: {height: 10}, textShadowRadius: 1, textShadowColor: '#00cccc'}}>` which really raise a redbox.

*After this fix*
1. Test original TextExample.android.js textShadowOffset works well.
2. Modify TextExample.android.js to `<Text style={{fontSize: 20, textShadowOffset: {height: 10}, textShadowRadius: 1, textShadowColor: '#00cccc'}}>` which works well without redbox.
Closes https://github.com/facebook/react-native/pull/7119

Differential Revision: D3240607

Pulled By: mkonicek

fb-gh-sync-id: b13221ae1586594890b0f4aa644ace7c0d5d6c58
fbshipit-source-id: b13221ae1586594890b0f4aa644ace7c0d5d6c58
2016-04-29 03:50:29 -07:00
Joshua Pinter 5e5cbda682 Show default `activeOpacity` value in docs.
Summary:
Useful to know what the default value without having to dig into the library code.
Closes https://github.com/facebook/react-native/pull/7247

Differential Revision: D3228728

Pulled By: mkonicek

fb-gh-sync-id: 433ca41d5395bbfb0c4887641a9e8b99c87b5e2b
fbshipit-source-id: 433ca41d5395bbfb0c4887641a9e8b99c87b5e2b
2016-04-29 03:45:26 -07:00
Alex Ledak cea37b460f Add 'New Music' app to showcase
Summary: Closes https://github.com/facebook/react-native/pull/7285

Differential Revision: D3240438

fb-gh-sync-id: 02304618215c46197fa5d7547ffdb950502bcf28
fbshipit-source-id: 02304618215c46197fa5d7547ffdb950502bcf28
2016-04-29 01:18:29 -07:00
Jesse Sessler 2bb1c263db Modal Animation Types
Summary:
Currently the Modal component uses the slide up / down animation for presenting and hiding the Modal with no options. This PR gives users a choice to use a fade in / out animation or the current slide animation (slide is the default). Android and iOS.

![](http://g.recordit.co/nfJSg487Ox.gif)  ![](http://g.recordit.co/QHGDuUFbPy.gif)

I've updated the UIExplorer and documentation.

![image](https://cloud.githubusercontent.com/assets/4265163/14743130/0bd8282c-086e-11e6-93eb-3d344431337d.png)

Thanks!
Closes https://github.com/facebook/react-native/pull/7156

Differential Revision: D3237809

Pulled By: javache

fb-gh-sync-id: 813e56ada8b19990dc5018527dc3a81b2c8b349a
fbshipit-source-id: 813e56ada8b19990dc5018527dc3a81b2c8b349a
2016-04-28 16:00:32 -07:00
Philipp von Weitershausen b5f14ea8f1 Make XMLHttpRequest and XMLHttpRequest.upload proper EventTargets
Summary:
So far, XHR only supports a few `onfoo` event handlers, not the entier `EventTarget` interface (`addEventListener`, `removeEventListener`). It also doesn't support the `upload` object on Android -- for no good reason. Even if we don't send any events there yet, there's no reason we have to break consuming code that wants to register an event handler there. This PR rectifies all that.

Fortunately, adding proper `EventTarget` support is very easy thanks to `event-target-shim`. We already use it in our WebSocket implementation. It transparently handles the `addEventListener('foo', ...)` as well as `onfoo` APIs, so when you dispatch an event on the event target, the right handlers will be invoked. The event object is wrapped so that `event.target` is set properly. Basically, it's a super easy way to make us conform to the spec.

Also added a bit of polish here and there, using ES2015 class property goodness to consolidate a lot of Flow property definitions with the corresponding property initializers.

**T
Closes https://github.com/facebook/react-native/pull/7017

Reviewed By: fkgozali

Differential Revision: D3202021

Pulled By: martinbigio

fb-gh-sync-id: 2b007682074356c75c774fab337672918b6c4355
fbshipit-source-id: 2b007682074356c75c774fab337672918b6c4355
2016-04-28 15:59:26 -07:00
Michael Ortiz 13acd7ed7e Reverted commit D3234404
Summary:
**Motivation**: Arc drawing has been broken on Android for some time. dgladkov submitted a PR, which ended up having a bug and was never merged. This PR should fix that bug as well as provide screenshots to prove it works.

**Reproducing the Bug:** dgladkov made a simple test app which helps to illustrate the bug. The repo can be found [here](https://github.com/dgladkov/RNArtArcDrawingBug). The demo app illustrates that on iOS, wedges are drawn correctly, but Android only draws full circles. [Direct Link to iOS Before](https://github.com/dgladkov/RNArtArcDrawingBug/blob/master/images/ios.png). [Direct Link to Android Before](https://github.com/dgladkov/RNArtArcDrawingBug/blob/master/images/android.png).

**Proof The Bug is Fixed:** [Here is a direct link to Android After pic.](http://i.imgur.com/9dTU2Xn.png) You can see the wedges match the iOS Before screenshot.

**What went wrong:** dgladkov's solution relied on Java's modulus, which in fact, implements modulus in a non-standard way. Modulus should a
Closes https://github.com/facebook/react-native/pull/7049

Differential Revision: D3234404

Pulled By: spicyj

fb-gh-sync-id: 6b85eb42389da6c344ec9723c7f81f61473246b0
fbshipit-source-id: 6b85eb42389da6c344ec9723c7f81f61473246b0
2016-04-28 15:48:26 -07:00
Pieter De Baets 26d0ce929f Error handling for concrete JS executor
Reviewed By: adamjernst

Differential Revision: D3235189

fb-gh-sync-id: a6d545a6b0b388c52305e2936371776d579460cd
fbshipit-source-id: a6d545a6b0b388c52305e2936371776d579460cd
2016-04-28 13:42:30 -07:00
Bruno Barbieri 41e89b4129 fontFamily, fontStyle and fontWeight support for TextInput
Summary:
fontFamily, fontWeight and fontStyle properties are being ignored for TextInput.

There's an additional issue that happens when you add secureTextEntry={true}  it overrides the current font preferences (because it defaults to monospace) so we have to reapply it.
Master right now:

![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png)

Demo after the fix:

![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif)
Closes https://github.com/facebook/react-native/pull/6564

Differential Revision: D3081623

Pulled By: bestander

fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
2016-04-28 13:22:22 -07:00
Jean Regisser 037e9ba945 Fixed unable to open red box stack frame in editor when running on iOS device
Summary:
Hi,

I noticed touching stack frames from the red box when running from an iOS device wouldn't open my editor (was working fine from the simulator).
Here's a fix.

Let me know if everything looks correct.

Thanks,
Closes https://github.com/facebook/react-native/pull/7088

Differential Revision: D3235102

Pulled By: javache

fb-gh-sync-id: 06e6c3f9164e987ea9bf71d16fe360dc37036c8d
fbshipit-source-id: 06e6c3f9164e987ea9bf71d16fe360dc37036c8d
2016-04-28 11:39:18 -07:00
David Aurelio e6bafca39e Improve constant inlining, add `process.platform`
Reviewed By: bestander

Differential Revision: D3235716

fb-gh-sync-id: f9019ec0042827e409fa84ba74f4c426ccad1519
fbshipit-source-id: f9019ec0042827e409fa84ba74f4c426ccad1519
2016-04-28 11:23:21 -07:00
Nathan Spaun 4e05d00f0d Prefetch images in Group mall and reactions icons
Reviewed By: ericvicenti

Differential Revision: D3227821

fb-gh-sync-id: b7a8c3e6e82604b98ec0d25eaab0c3b4c95bd683
fbshipit-source-id: b7a8c3e6e82604b98ec0d25eaab0c3b4c95bd683
2016-04-28 11:12:21 -07:00
Nick Lockwood 8cfa6b6ea6 Deprecated customDirectEventTypes, and removed from RCTScrollViewManager
Summary: Using customDirectEventTypes or customBubblingEventTypes causes a viewmanager to be initialized at app start. This diff deprecates those methods and removes their usage from RCTScrollViewManager.

Reviewed By: majak

Differential Revision: D3218973

fb-gh-sync-id: 295bef3be9623b49b0cdcbf8a56e10d9b28126d9
fbshipit-source-id: 295bef3be9623b49b0cdcbf8a56e10d9b28126d9
2016-04-28 07:44:19 -07:00
Pieter De Baets b2c8281316 Remove ImmediateImplementation, always use globals
Summary: We always define these globals in InitializeJavaScriptAppEngine, so the fallback mechanism here is never required as far as I can tell.

Reviewed By: davidaurelio

Differential Revision: D3235061

fb-gh-sync-id: 92007f87c84073e32bfa946df8ee81083f6842ec
fbshipit-source-id: 92007f87c84073e32bfa946df8ee81083f6842ec
2016-04-28 07:06:20 -07:00
Pieter De Baets c7eb47fd8c Enable console.debug
Summary: Apparently what we're using for console.trace is not really the same as what Chrome does (we don't log a stacktrace). Add `console.debug` with the same functionality as `console.trace`, just so we don't crash between browser and local execution.

Reviewed By: davidaurelio

Differential Revision: D3235053

fb-gh-sync-id: 4bed17ac8aa4c8c100f15cf0aabbc25101c913c1
fbshipit-source-id: 4bed17ac8aa4c8c100f15cf0aabbc25101c913c1
2016-04-28 07:02:29 -07:00
Pieter De Baets e195bf9495 Fix RCTJavaScriptContextCreatedNotification
Summary: The notification was previously sent from a block that only existed if RCT_DEV. This makes us always send this notification.

Reviewed By: majak

Differential Revision: D3235070

fb-gh-sync-id: bf3488d439bc2253fd12cbb10f670f54bb37eb6e
fbshipit-source-id: bf3488d439bc2253fd12cbb10f670f54bb37eb6e
2016-04-28 06:59:21 -07:00
David Aurelio e3c18c3990 Upgrade to node-haste@2.10.0 and allow to specify extra node modules
Summary: This upgrades to node-haste@2.10.0 and allows to expose folders as additional node modules from rn-cli.config.js

Reviewed By: bestander

Differential Revision: D3232595

fb-gh-sync-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
fbshipit-source-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
2016-04-28 06:33:27 -07:00
Pieter De Baets feda8ce2ee Clean up RCTEventDispatcher code
Reviewed By: majak

Differential Revision: D3175583

fb-gh-sync-id: c751c9dc79edfd9cb6073a2ff5dd743a03334bc4
fbshipit-source-id: c751c9dc79edfd9cb6073a2ff5dd743a03334bc4
2016-04-28 05:48:21 -07:00
Charles Dick f6d9a9097f Add heap snapshot to fbandroid JSC
Reviewed By: michalgr

Differential Revision: D3168026

fb-gh-sync-id: 123c9caa1ae7792cfa93590de4832b76c8178edb
fbshipit-source-id: 123c9caa1ae7792cfa93590de4832b76c8178edb
2016-04-28 05:31:19 -07:00
David Aurelio 8c1b773e4d Show columns in redboxes
Reviewed By: foghina

Differential Revision: D3229814

fb-gh-sync-id: 0e1c3692e0780287d5e31dbd24fa3145eb0882ec
fbshipit-source-id: 0e1c3692e0780287d5e31dbd24fa3145eb0882ec
2016-04-28 03:58:23 -07:00
Thomas Leplus f323b02eff Fix ClassCastException
Summary: Closes https://github.com/facebook/react-native/pull/7225

Differential Revision: D3234878

Pulled By: dmmiller

fb-gh-sync-id: 00f36f3c45e3492026729175e393812879149773
fbshipit-source-id: 00f36f3c45e3492026729175e393812879149773
2016-04-28 03:19:19 -07:00
Michael Ortiz 1af47603cf Fix ReactNativeART arc drawing on Android
Summary:
**Motivation**: Arc drawing has been broken on Android for some time. dgladkov submitted a PR, which ended up having a bug and was never merged. This PR should fix that bug as well as provide screenshots to prove it works.

**Reproducing the Bug:** dgladkov made a simple test app which helps to illustrate the bug. The repo can be found [here](https://github.com/dgladkov/RNArtArcDrawingBug). The demo app illustrates that on iOS, wedges are drawn correctly, but Android only draws full circles. [Direct Link to iOS Before](https://github.com/dgladkov/RNArtArcDrawingBug/blob/master/images/ios.png). [Direct Link to Android Before](https://github.com/dgladkov/RNArtArcDrawingBug/blob/master/images/android.png).

**Proof The Bug is Fixed:** [Here is a direct link to Android After pic.](http://i.imgur.com/9dTU2Xn.png) You can see the wedges match the iOS Before screenshot.

**What went wrong:** dgladkov's solution relied on Java's modulus, which in fact, implements modulus in a non-standard way. Modulus should a
Closes https://github.com/facebook/react-native/pull/7049

Differential Revision: D3234404

Pulled By: spicyj

fb-gh-sync-id: 4974b818dc49d9d16f2483c49b462c459a8bb479
fbshipit-source-id: 4974b818dc49d9d16f2483c49b462c459a8bb479
2016-04-27 22:18:27 -07:00
Christoph Pojer d363b1f2e2 Update Jest APIs on fbsource
Reviewed By: javache

Differential Revision: D3229435

fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
2016-04-27 19:16:32 -07:00
Howard Yeh 192ab663b7 Fix 302 ImageLoader caching problem on iOS
Summary:
+ Fixes https://github.com/facebook/react-native/issues/5616
+ Bug RNPlay Demo: https://rnplay.org/apps/Eg2goQ

Test demo loads a Tumblr avatar image using a URL that 301 to a CDN. Try to edit and save the file to trigger image reloads.

The 302 image request succeeds the first time:

<img width="318" alt="screen shot 2016-04-27 at 9 37 03 am" src="https://cloud.githubusercontent.com/assets/50120/14860038/b2c04e8a-0c5b-11e6-9edf-78309048368b.png">

But it fails for subsequent loads. You should see:

<img width="307" alt="screen shot 2016-04-27 at 9 37 22 am" src="https://cloud.githubusercontent.com/assets/50120/14860048/b756e170-0c5b-11e6-9031-8f3cca8f2994.png">

+ The first image is a 302, only succeeds to load the first time.
+ The second image in the column adds a nonce as request parameter to render caching ineffective (but still a 302), and the problem doesn't occur.
+ The last image is the canonical url location (200).

Although NSURLSession hand
Closes https://github.com/facebook/react-native/pull/7262

Differential Revision: D3231702

Pulled By: javache

fb-gh-sync-id: 364fcf9819188c63310768411d49e6431b2a01d3
fbshipit-source-id: 364fcf9819188c63310768411d49e6431b2a01d3
2016-04-27 14:40:30 -07:00
Philipp von Weitershausen 8891f22f88 Fix WebSocket compatibility with event-target-shim ^1.0.5
Summary:
event-target-shim versions before 1.1.0 do not support taking an array for `EventTarget`. react-native requires `^1.0.5`, so this fixes compatibility with those earlier versions.

**Test Plan:** ran WebSocket UIExplorer example with earlier version of event-target-shim.
Closes https://github.com/facebook/react-native/pull/7261

Differential Revision: D3230881

Pulled By: martinbigio

fb-gh-sync-id: 6a22d58841a4b401a200fece64d13a70043fb09a
fbshipit-source-id: 6a22d58841a4b401a200fece64d13a70043fb09a
2016-04-27 12:26:23 -07:00
Dave Miller 57c40d9a6f Fix crash caused by accessibility being turned on and using a Modal
Summary: When the ModalHostView is added as a child of whatever view holds it, if accessibility is turned on, Android will walk up to the root and then walk all children of the child and verify that they are indeed children of the root.  Since ModalHostView actually adds its children to a new ReactDialogViewGroup which has the Dialog as a parent, there is a disagreement about the tree deep in the bowels of View when it performs that walk.  The trick is to stop from adding the children of the ModalHostView when walking for accessibility.  The accessibility of those children views are properly handled by the hosting Dialog.

Reviewed By: andreicoman11

Differential Revision: D3230033

fb-gh-sync-id: 1e5ac334c996b1d5f50c75ded60805d8b871477a
fbshipit-source-id: 1e5ac334c996b1d5f50c75ded60805d8b871477a
2016-04-27 10:16:25 -07:00
Alexander Blom 9a3a082225 Make polyfills and globals lazy
Summary:
This avoids requiring things that may never be used at all by the application such as WebSocket or Geolocation. It also stops us from asking for native modules
before we actually start the application enabling us to potentially be more lazy in the future.

Reviewed By: davidaurelio

Differential Revision: D3212802

fb-gh-sync-id: 70cf0d1a85f39fedc47758e5eb5df789a511bc9b
fbshipit-source-id: 70cf0d1a85f39fedc47758e5eb5df789a511bc9b
2016-04-27 09:57:20 -07:00
Nick Lockwood 9547a98a68 Fixed deadlock during app startup
Summary:
Now that we support initializing the bridge off the main thread, some of the assumptions in the bridge setup process are no longer safe.

In particular we were assuming that the JS executor and injected modules could always be synchronously initialized within bridge init, but that is only safe if those modules don't need to be set up on the main thread.

The setup for those modules was sync-dispatching to the main thread if bridge init happened on a background thread, and this lead to a deadlock under certain circumstances.

Reviewed By: javache

Differential Revision: D3224162

fb-gh-sync-id: 7319b70f541a46ef932cfe4f776e7e192f3ce1e8
fbshipit-source-id: 7319b70f541a46ef932cfe4f776e7e192f3ce1e8
2016-04-27 09:09:23 -07:00
Andy Street 6a2603745e Fix build break of react native exopackage apps
Reviewed By: lexs

Differential Revision: D3229733

fb-gh-sync-id: e74a2d4fbbdf019f898f87a05bdbd31b4e233463
fbshipit-source-id: e74a2d4fbbdf019f898f87a05bdbd31b4e233463
2016-04-27 08:02:24 -07:00
Andy Street 50d8d46733 Add ability to expose sync hooks from Java to JS
Summary:
This only works for the new cxx bridge (hopefully open sourcing soon!).

This diff allows Java native modules to expose synchronous hooks to JS via the ReactSyncHook annotation. The methods will appear in JS on the native module object (e.g. you would do `require('UIManager').mySyncHook('foo');`) which allows us to enforce that required native modules are installed at build time. In order to support remote debugging, both the args and return type must be JSON serializable (so that we can go back across to the device to resolve synchronous hooks).

Follow ups will be integration tests, adding support for return types besides void, and adding support for remote debugging.

Reviewed By: mhorowitz

Differential Revision: D3218794

fb-gh-sync-id: 7e3366a8254276f5a55eb806287419287ca9182b
fbshipit-source-id: 7e3366a8254276f5a55eb806287419287ca9182b
2016-04-27 07:51:28 -07:00
Pieter De Baets 171c7230b1 Simplify message passing in JSC-executor
Reviewed By: tadeuzagallo

Differential Revision: D3179792

fb-gh-sync-id: 96b7c91209ccac745e0f64def0095efd6b1184ed
fbshipit-source-id: 96b7c91209ccac745e0f64def0095efd6b1184ed
2016-04-27 06:35:27 -07:00
Felix Oghina fb76154b42 handle null args array in proxy invocation handler
Reviewed By: astreet

Differential Revision: D3212837

fb-gh-sync-id: 1a66de68cc13758a41514e4bef6808b818b9682e
fbshipit-source-id: 1a66de68cc13758a41514e4bef6808b818b9682e
2016-04-27 02:28:19 -07:00
sunnylqm 131970dc5a Android Support Repository -> Local Maven repository for Support Libr…
Summary: Closes https://github.com/facebook/react-native/pull/7249

Differential Revision: D3229302

fb-gh-sync-id: 83596604c1c1546249babb421898aa5bd9c7e5c1
fbshipit-source-id: 83596604c1c1546249babb421898aa5bd9c7e5c1
2016-04-27 01:29:28 -07:00
Alex Kotliarskyi 8295d27a90 Fix usage of react-native cli inside package.json scripts
Summary:
IIRC we made `wrong-react-native` to warn people in case they installed `react-native` globally (instead of `react-native-cli` what the guide suggests). To do that we added `bin` entry to React Native's `package.json` that points to `local-cli/wrong-react-native.js`

However, this means that if we have a project that uses `react-native` package and has call to `react-native` CLI inside its package.json, npm will execute *local* override (which just prints a confusing in this context error message).

In fact, the template we generate with `react-native init` has `react-native start` as `start` script, which makes it useless. Let's fix it by making `wrong-react-native` script smarter – it can detect that it has been executed from local `node_modules` and run the actual CLI.

cc vjeux ide
Closes https://github.com/facebook/react-native/pull/7243

Differential Revision: D3226645

Pulled By: frantic

fb-gh-sync-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
fbshipit-source-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
2016-04-26 15:42:35 -07:00
Spencer Ahrens b5d9bf0fb2 merge InteractionManager stuff back into PanResponder
Reviewed By: bestander

Differential Revision: D3224519

fb-gh-sync-id: d041214b68fedfdd6b01aa2b710b02381c29dcfa
fbshipit-source-id: d041214b68fedfdd6b01aa2b710b02381c29dcfa
2016-04-26 13:19:22 -07:00
Steven Luscher dad39eb502 Move `Number` polyfills into the `/polyfills/` directory
Reviewed By: vjeux

Differential Revision: D3223317

fb-gh-sync-id: a49a14f217b27d6542b65c4780c557e73da2443f
fbshipit-source-id: a49a14f217b27d6542b65c4780c557e73da2443f
2016-04-26 11:24:42 -07:00
Konstantin Raev 2eef115161 Revert "Add subviewStyle prop to NavigationHeader"
Summary:
This reverts commit 1dc82a9e5f.

Breaks OSS tests
Closes https://github.com/facebook/react-native/pull/7232

Differential Revision: D3223972

Pulled By: bestander

fb-gh-sync-id: fea7ec4a1c13d328a7bbda9fcd3f201a7007081e
fbshipit-source-id: fea7ec4a1c13d328a7bbda9fcd3f201a7007081e
2016-04-26 06:10:24 -07:00