Commit Graph

4565 Commits

Author SHA1 Message Date
Satyajit Sahoo 1b766ddd2c Add a script for making releases easier 2016-01-05 16:59:43 +00:00
Martin Konicek 6af7ae55b1 [global-cli] react-native init [--debug|verbose]
`npm install` prints a lot of junk like gyp warnings
and the rest of the output is not super useful for
tracking progress.

Supress the output by default, show the output with
--debug, and show verbose output with --verbose.
2016-01-05 16:51:28 +00:00
Justin Spahr-Summers a5d82c2823 Add context executor API for sync hooks
Summary:
public

This exposes a proper API for adding synchronous callbacks to JS, as an optional feature of the executor.

This is based on nicklockwood's work in D2764492, but avoids refactoring bridge/executor interactions for the time being, since we agree on this API and can move the actual callsites around later.

Reviewed By: nicklockwood

Differential Revision: D2799506

fb-gh-sync-id: af209d9a0be927f3404205feb16e59745cc37aec
2016-01-05 08:00:38 -08:00
Andy Street 1c1d7006c2 Remove extra JSUnprotect call
Summary:
public
Value doesn't protect it's value, so it shouldn't be unprotecting them in its destructor.

I'm also pretty sure we don't need to Protect the exception while it's on the stack according to the JSValueProtect docs: https://developer.apple.com/library/mac/documentation/JavaScriptCore/Reference/JSValueRef_header_reference/index.html#//apple_ref/c/func/JSValueProtect

Reviewed By: lexs

Differential Revision: D2779255

fb-gh-sync-id: 7d5df34639c8e7c41e92d3b8d652b93443d194a1
2016-01-05 04:58:29 -08:00
Konstantin Raev 3507bc61a5 added branch to ignore for CI tests
Summary:
every push to gh-pages renders an error in tests https://circleci.com/gh/facebook/react-native/995?utm_campaign=build-failed&utm_medium=email&utm_source=notification
Closes https://github.com/facebook/react-native/pull/5109

Reviewed By: svcscm

Differential Revision: D2802873

Pulled By: androidtrunkagent

fb-gh-sync-id: 8043f47ccfce322ae26ac5e85604bcc2c79d9cb4
2016-01-05 03:45:28 -08:00
Michelle Todd 1dc5dca604 Rename methods in RCTPushNotificationManager so app store doesn't warn
Summary:
Including RCTPushNotificationManager is required for local notifications, which don't require a Push Notifications entitlement on your provisioning profile. However, if you don't have the entitlement, the app store warns you when you push an app build that contains `application:didRegisterForRemoteNotificationsWithDeviceToken:`, even if it isn't being called. This renames the methods so they have different names from the ones on UIApplication so the app store doesn't warn about them.
Closes https://github.com/facebook/react-native/pull/4897

Reviewed By: spicyj

Differential Revision: D2780533

Pulled By: nicklockwood

fb-gh-sync-id: 1a688f1ebd3cc9f86ba340ce453fdbfb46949839
2016-01-05 02:43:29 -08:00
Fada Chen ee82bad3f7 revert D2779079
Reviewed By: zjj010104

Differential Revision: D2802728

fb-gh-sync-id: 9e09f00d1d7facd2091fe60eee8565c4bf599b1d
2016-01-05 00:41:31 -08:00
Fada Chen 18cdead76b revert D2773664
Reviewed By: dwitte

Differential Revision: D2802582

fb-gh-sync-id: 39d59be297f0f23e6a4e40175ad30284766349cb
2016-01-04 23:52:51 -08:00
Ben Alpert 27ac04742a Open-source ART for Android
Summary:
This is already open-source on iOS, albeit badly documented. Now Android too!

Tested in open source by adding a `import com.facebook.react.ARTPackage;` and `.addPackage(new ARTPackage())` to UIExplorerActivity.java, running

```
./gradlew :Examples:UIExplorer:android:app:installDebug
```

and copying VectorWidget into the UIExplorer JS code as described in http://browniefed.com/blog/2015/05/03/getting-react-art-running-on-react-native/.

public

Reviewed By: foghina

Differential Revision: D2700481

fb-gh-sync-id: 2a5308b022869ecc1868a46dbecf397581ddbe04
2016-01-04 18:59:58 -08:00
James Ide 27d102258b Merge pull request #3802 from exponentjs/node-5
[Node 5] Run Travis CI tests with Node 5 and npm 3
2016-01-04 16:53:50 -08:00
James Ide 84adb6c8cc [Node 5] Run Travis CI tests with Node 5 and npm 3
Updates the Travis CI environment to install Node 5.
2016-01-04 15:57:38 -08:00
Martin Konicek d87d127402 [global-cli] Fix npm start
Before releasing new react-native-cli, need to look into
suppressing output from 'npm install', added in
5da0e135b6
2016-01-04 23:37:44 +00:00
James Ide 7100df0062 Move react-transform-hmr dep to "dependencies"
Summary:
It is required from the RN app JS, so it needs to be in prod dependencies.

cc martinbigio
Closes https://github.com/facebook/react-native/pull/5091

Reviewed By: svcscm

Differential Revision: D2798891

Pulled By: martinbigio

fb-gh-sync-id: 976ccf4d96338c8e3d7e457710559be51c4f7405
2016-01-04 15:15:43 -08:00
James Zhang a6bca4041b Fix AlertIOS Examples
Summary:
This fixes the examples that are out of date.
Closes https://github.com/facebook/react-native/pull/5116

Reviewed By: svcscm

Differential Revision: D2800319

Pulled By: androidtrunkagent

fb-gh-sync-id: da1810c6146950be4be670fc69b9da32fb266303
2016-01-04 13:38:33 -08:00
Felix Oghina 4866ec2767 crash gracefully on fatal js errors (take two)
Reviewed By: AaaChiuuu

Differential Revision: D2773513

fb-gh-sync-id: f8e50ad12e808caf1d85c6c7859c04fcabdaaeae
2016-01-04 13:18:54 -08:00
Martín Bigio f2bdb79782 Make HMR server send full list modules that changed
Summary:
public

Before this diff we were only accepting the module that was modified but the user. This works fine as long as the user doesn't modify the dependencies a module has but once he starts doing so the HMR runtime may fail when updating modules' code because they might might a few dependencies. For instance, if the user changes the `src` a `Image` has to reference an image (using the new asset system) that wasn't on the original bundle the user will get a red box. This diff addresses this by diffing the modules the app currently has with the new ones it should have and including all of them on the HMR update. Note this diffing is only done when the we realize the module that was modified changed it's dependencies so there's no additional overhead on this change.

Reviewed By: vjeux

Differential Revision: D2796325

fb-gh-sync-id: cac95f2e995310634c221bbbb09d9f3e7bc03e8d
2016-01-04 13:02:27 -08:00
Andy Street ba2fcd39d1 WebWorkers: Add JSLoader API for loading script from assets with AssetLoader reference
Summary:
public

Adds the ability to load files from assets without threading through an AssetManager. After the bridge is unforked, we should move to passing through an Environment object instead.

Reviewed By: lexs

Differential Revision: D2779079

fb-gh-sync-id: 82b47ecdf48b724076d87f4879ec40601e21e6bc
2016-01-04 12:08:29 -08:00
Andy Street 42e5b2a5bc WebWorkers: Add MessageQueueThreadRegistry
Summary:
public

It is helpful to be able to access the current MessageQueueThread like you would the current Looper. I would do this exactly as Looper does it, but we have forked implementations of MQT for the native bridge and MQT is an interface that can't hold private members.

Reviewed By: lexs

Differential Revision: D2779072

fb-gh-sync-id: 0ff841d8c490b971697c8e5d45f9c0a57668376b
2016-01-04 12:01:33 -08:00
Martín Bigio 8c9c7e6286 Introduce transforms pipeline
Summary:
public

This diff introduces an internal transforms pipeline that integrates with the external one. This has been a feature we've been looking to implement for a long time to use babel instead of `replace` with regexps on many parts of the packager.

Also, to split the bundle we'll need to run one transform. Internally for Facebook we can run the system-import transform altogether withe the other ones. For OSS we offer `transformer.js` which people can use out of the box if they're writing ES6 code. For those people, `transformer.js` will also run the internal transforms`. However they might want to tune the transforms, or even write the code on another language that compiles to Javascript and use a complete different transformer. On those cases we'll need to run the external transforms first and pipe the output through the internal transforms. Note that the order it's important as the internal transforms assume the code is written in JS, though the original code could be on other scripting languages (CoffeeScript, TypeScript, etc).

Reviewed By: davidaurelio

Differential Revision: D2725109

fb-gh-sync-id: d764e209c78743419c4cb97068495c771372ab90
2016-01-04 11:32:42 -08:00
Tadeu Zagallo 89ae0e040d Expose flow events to JS + add JS -> Native flows
Summary:
public

Expose JS hooks to create flow events in systrace (the nice arrows to show async work flow) +
add support to the showing all the work enqueued from the JS thread as added in D2743733

Depends on D2743733

Reviewed By: jspahrsummers

Differential Revision: D2773664

fb-gh-sync-id: 4a8854b17b4741b882f5f2cc425e4237a5e4b3eb
2016-01-04 11:11:48 -08:00
Nick Lockwood ed4478a4ff Refactor hot loading implementation on iOS
Reviewed By: milend

Differential Revision: D2795580

fb-gh-sync-id: ad33ba152e40b622b10bfa0122afd6edc28a11bf
2016-01-04 10:40:32 -08:00
Martín Bigio 54f2586735 Improve error message when devserver is not running
Summary:
public

If Hot Loading is enabled bu the packager server is not running, as the user updates files he'll see red boxes caused by the HMR runtime. The error those red boxes show is pretty weird for the end user. Lets improve the feedback we give!.

Reviewed By: vjeux

Differential Revision: D2795534

fb-gh-sync-id: dcc39e6682e0603bf10d0f5e623433262b745660
2016-01-04 09:56:30 -08:00
Janic Duplessis 44f7a00e95 Cross platform PullToRefreshView component
Summary:
Both iOS and Android currently support some sort of native pull to refresh control but the API was very different. I tried implementing a component based on PullToRefreshViewAndroid but that works on both platforms.

I liked the idea of wrapping the ListView or ScrollView with the PullToRefreshView component and allow styling the refresh view with platform specific props if needed. I also like the fact that 'refreshing' is a controlled prop so there is no need to keep a ref to the component or to the stopRefreshing function.

It is a pretty rough start so I'm looking for feedback and ideas to improve on the API before cleaning up everything.

On iOS we could probably deprecate the onRefreshStart property of the ScrollView and implement the native stuff in a PullToRefreshViewManager. We could then add props to customize the look of the UIRefreshControl (tintColor). We could also deprecate the Android only component and remove it later.
Closes https://github.com/facebook/react-native/pull/4915

Reviewed By: svcscm

Differential Revision: D2799246

Pulled By: nicklockwood

fb-gh-sync-id: 75872c12143ddbc05cc91900ab4612e477ca5765
2016-01-04 08:00:29 -08:00
Katrina Nova 86af597c2e Update NavigatorIOS.ios.js
Summary:
Allow props passed to the route object to overwrite props passed to the navigator.
Closes https://github.com/facebook/react-native/pull/5101

Reviewed By: svcscm

Differential Revision: D2799379

Pulled By: androidtrunkagent

fb-gh-sync-id: 147b6ba4b309657f03d7bda38f8958c4599c38c3
2016-01-04 07:42:31 -08:00
Satyajit Sahoo 68147cf39c Update references to `image!` to use require syntax
Summary: Closes https://github.com/facebook/react-native/pull/5089

Reviewed By: svcscm

Differential Revision: D2798548

Pulled By: androidtrunkagent

fb-gh-sync-id: 9e561fcfc103102d4c4bfbebc463eadb2fdd561a
2016-01-04 07:41:27 -08:00
Jason Brown b8aac8b77a Implement draggable annotations on MapView. Closes #2512
Summary: Closes https://github.com/facebook/react-native/pull/4441

Reviewed By: svcscm

Differential Revision: D2707897

Pulled By: nicklockwood

fb-gh-sync-id: 6f67f711c1ec1f821d03b9b1ea5cc39859d28fd1
2016-01-04 06:38:30 -08:00
Nick Lockwood 64edddadcc Fixed race condition in RCTModuleData.methodQueue
Summary:
public
The implementation of the `methodQueue` lazy initializer in `RCTModuleData` could result in the queue being set twice, because calling `methodQueue` for a module that hasn't been instantiated would call `RCTModuleData.instance` to create the module, which itself calls `methodQueue`.

It's not clear if this was causing a bug, but it may be related to an occasional bug where the `RCTViewManager.methodQueue` returns nil.

Reviewed By: majak

Differential Revision: D2783320

fb-gh-sync-id: 9194da0fd7392f63825da1f5c450363dd300b635
2016-01-04 06:24:28 -08:00
Adam Miskiewicz 46609cf7f0 Merge pull request #5108 from le0pard/patch-1
Add RWpodPlayer as showcase for React Native apps
2016-01-04 09:20:29 -05:00
Satyajit Sahoo 6e6de56957 Merge pull request #5104 from lvwang2002/master
Update showcase.js
2016-01-04 19:22:15 +05:30
Alexey Vasiliev c91f9ce576 Add RWpodPlayer as showcase for React Native apps 2016-01-04 15:13:13 +02:00
Mike Armstrong 40d9918f5d Fix systrace use in OSS
Reviewed By: bestander

Differential Revision: D2799222

fb-gh-sync-id: 8002c7f94eedffdf05bb134ced14809a78757bb0
2016-01-04 05:12:28 -08:00
Jed Lau 52220a96f9 Export method to get current status bar height
Summary:
Addresses #2515 .
Closes https://github.com/facebook/react-native/pull/5039

Reviewed By: svcscm

Differential Revision: D2799224

Pulled By: nicklockwood

fb-gh-sync-id: 8f0a0f229a1588b1033b0121868c1f82e4dc6684
2016-01-04 04:31:26 -08:00
Mike Armstrong e42c6d4446 Flows between RN Threads
Reviewed By: tadeuzagallo

Differential Revision: D2743733

fb-gh-sync-id: df4ae69a3501a37e08286857a8d4be3cd27c0ac3
2016-01-04 02:16:31 -08:00
lvwang2002 2af06b3c08 Update showcase.js
all the function of android version made by react native
the function of search of iOS version made by react native.
2016-01-04 12:34:57 +08:00
Satyajit Sahoo cdad5c047a Merge pull request #5087 from qbig/add-doc-new-contributor-task
added easy tasks to README for new contributors
2016-01-03 12:27:32 +05:30
Jay Salvat e62471b7c3 Fix pop method to properly refresh the navigatorBar
Summary:
When using nativator.pop() the navigatorBar doesn't refresh properly if we change navigationBarHidden.

When navigator.pop() is called, the navbar doesn't show up, even avec navigationBarHidden set back to true. See between Statusbar and Movie poster in the example below.

![bad](https://cloud.githubusercontent.com/assets/55496/8683849/77effa30-2a75-11e5-9f32-9be6fa87efac.gif)

    // Not actually updating the indices yet until we get the native
    // `onNavigationComplete`.
    updatingAllIndicesAtOrBeyond: null,

https://github.com/facebook/react-native/blob/master/Libraries/Components/Navigation/NavigatorIOS.ios.js#L510-L512

The View need to be refreshed in pop method anyway.

    updatingAllIndicesAtOrBeyond: this.state.requestedTopOfStack - n,

Now, navbar appears properly.

![good](https://cloud.githubusercontent.com/assets/55496/8683907/be9d2714-2a75-11e5-8fda-653e68869076.gif)
Closes https://github.com/facebook/react-native/pull/1989

Reviewed By: svcscm

Differential Revision: D2798515

Pulled By: androidtrunkagent

fb-gh-sync-id: 9d554c9d88b87628488a8cebb7e3bbe4dd9c017d
2016-01-02 22:52:30 -08:00
Qiao Liang d8e138770f added easy tasks to README 2016-01-03 14:48:07 +08:00
Brent Vatne 2c39515557 Merge pull request #5086 from sharathprabhal/patch-1
Add 'Eat or Not' play store link
2016-01-02 21:34:34 -08:00
Sharath Prabhal 4d403efab3 Add 'Eat or Not' play store link 2016-01-03 00:13:17 -05:00
Christopher Chedeau f39d45e61c Merge pull request #5080 from janicduplessis/website-windows
Fix issues running the website locally on windows with npm3
2016-01-02 07:56:16 -08:00
Chirag 710568ef6c Merge pull request #5082 from yuanyan/yuanyan-patch-1
[Doc] Fix the 404 status url.
2016-01-02 07:16:50 -05:00
yuanyan 5fa33f3d07 Fix the 404 status url. 2016-01-02 19:33:50 +08:00
Janic Duplessis 2d50ac359c Fix issues running the website locally on windows with npm3 2016-01-02 03:56:32 -05:00
Kudo Chien 4972cabaa5 Add <Text> shadow support
Summary:
Add three new TextStylePropTypes for \<Text>
- textShadowOffset
- textShadowRadius
- textShadowColor
Closes https://github.com/facebook/react-native/pull/4975

Reviewed By: svcscm

Differential Revision: D2796278

Pulled By: nicklockwood

fb-gh-sync-id: f8c3fa210e664428b029b9fba8eca4a8eb81c08d
2016-01-01 09:33:31 -08:00
Nick Lockwood 718cd7953f Added getImageSize method
Summary:
public

This diff adds a `getSize()` method to `Image` to retrieve the width and height of an image prior to displaying it. This is useful when working with images from uncontrolled sources, and has been a much-requested feature.

In order to retrieve the image dimensions, the image may first need to be loaded or downloaded, after which it will be cached. This means that in principle you could use this method to preload images, however it is not optimized for that purpose, and may in future be implemented in a way that does not fully load/download the image data.

A fully supported way to preload images will be provided in a future diff.

The API (separate success and failure callbacks) is far from ideal, but until we agree on a unified standard, this was the most conventional way I could think of to implement it. If it returned a promise or something similar, it would be unique among all such APIS in the framework.

Please note that this has been a long time coming, in part due to much bikeshedding about what the API should look like, so while it's not unlikely that the API may change in future, I think having *some* way to do this is better than waiting until we can define the "perfect" way.

Reviewed By: vjeux

Differential Revision: D2797365

fb-gh-sync-id: 11eb1b8547773b1f8be0bc55ddf6dfedebf7fc0a
2015-12-31 18:51:30 -08:00
Brent Vatne 24b942faeb Merge pull request #5066 from sunnylqm/patch-8
remove Precomputing style
2015-12-31 18:36:39 -08:00
odino 6793128435 Allowing turning on / off DOM storage on android webviews
Summary:
Was developing on a WebView and couldnt get it to run. Turns out its JS code mostly depends on `localStorage` and I realized it wasnt turned on in RN. This PR adds a prop, similar to `javascriptEnabledAndroid` to be able to turn DOM storage on / off.

TBH I dont really know how it works on IOS, so I created an android specific thingy. I assume DOM storage is enabled by default on IOS.
Closes https://github.com/facebook/react-native/pull/5065

Reviewed By: svcscm

Differential Revision: D2797735

Pulled By: androidtrunkagent

fb-gh-sync-id: cd60cfa4d24d80fb82e4f54f387a4517a99e75ab
2015-12-31 18:04:29 -08:00
Nick Lockwood 55fe7ac9ae Fix flow errors
Reviewed By: gabelevi

Differential Revision: D2796260

fb-gh-sync-id: 8425e57a313326afb6f6ae5bb8b86a569f462b06
2015-12-31 07:48:29 -08:00
sunnylqm e09378d92d remove Precomputing style 2015-12-31 21:11:47 +08:00
James Ide e033898761 Merge pull request #5058 from odino/patch-1
Fixed typo
2015-12-31 01:23:17 -08:00