Commit Graph

4880 Commits

Author SHA1 Message Date
Alex Kotliarskyi 9490c2c759 Added `react-native run-ios`
Summary:
Works the same way as `react-native run-android`, but targets iOS simulator instead. Under the hood, it uses `xcodebuild` to compile the app and store it in `ios/build` folder, then triggers `instruments` and `simctl` to install and launch the app on simulator.

Since Facebook relies on BUCK to build and run iOS app, we probably won't use `run-ios` internally. That's why I'm putting this as public PR instead of internal diff.

To test this, I hacked global `react-native` script to install react native from my local checkout instead of from npm, cd into the folder and ran `react-native run-ios`.
Closes https://github.com/facebook/react-native/pull/5119

Reviewed By: svcscm

Differential Revision: D2805199

Pulled By: frantic

fb-gh-sync-id: 423a45ba885cb5e48a16ac22095d757d8cca7e37
2016-01-05 17:18:49 -08:00
Pieter De Baets 8772a6a542 Wait for JSExecutor to tear down in RCTBridgeTests
Reviewed By: tadeuzagallo

Differential Revision: D2803092

fb-gh-sync-id: 71ccac2c13221bfbcb2f09a14d48ac2d2901d04e
2016-01-05 15:30:33 -08:00
Alex Kotliarskyi ec76271715 Return non-zero exit code from wrong-react-native
Summary:
When used in automation, `wrong-react-native` can cause problems because it does not
report the issue via exit code.
Closes https://github.com/facebook/react-native/pull/5114

Reviewed By: svcscm

Differential Revision: D2799995

Pulled By: frantic

fb-gh-sync-id: 23c32dac9b0fcdbeaf48b94e9cb220c6c1b344aa
2016-01-05 15:22:59 -08:00
Nick Lockwood 180fc06b7a Fixed iOS 7 support for URL query functions
Summary:
public
Unfortunately, it turns out that NSURLComponents.queryItems only works on iOS 8 and above. This diff re-implements the RCTGetURLQueryParam and RCTURLByReplacingQueryParam functions using functionality available in iOS 7.

Reviewed By: javache

Differential Revision: D2803679

fb-gh-sync-id: 56f10bef4894d16197975b6023b7aa5ab106d8cb
2016-01-05 12:57:44 -08:00
odino 2462c8f87d Enables webview debugging
Summary:
2 things that I want to clarify / ask for feedback:

* do we really need to make sure we're running on the UI thread? I guess `onPageStarted` maybe already runs there? Couldnt find anything [here](http://developer.android.com/reference/android/webkit/WebView.html) though
* everytime a page starts we re-enable debugging -- it's a bit useless but I also don't think it's a huge problem, as debugging should only be enabled in dev

Relates to issue #4857, where we switched debugging off as, in some circumstances, it would crash the application as debugging was invoked outside the UI thread.
Closes https://github.com/facebook/react-native/pull/5071

Reviewed By: svcscm

Differential Revision: D2803649

Pulled By: astreet

fb-gh-sync-id: 523d3b442b196d6c54b14ba0c2b29601095c3363
2016-01-05 11:40:32 -08:00
Konstantin Raev 6663726b6e small hack to have circle.yml in gh-pages generated branch 2016-01-05 19:24:48 +00:00
Martin Konicek a5d6e46fa8 Tweak the release script 2016-01-05 18:52:04 +00:00
Christoph Pojer 0cb63bb971 Fix lint warnings in the resolver
Reviewed By: martinbigio

Differential Revision: D2803192

fb-gh-sync-id: 721821ed9ce8dd846f90ec09e7e1f36abf322b5a
2016-01-05 10:45:34 -08:00
odino 6edcebef9c Stop using platform-specific names for props
Summary:
Follows up on [this comment](https://github.com/facebook/react-native/pull/5065#issuecomment-168353782) by nicklockwood in #5065.

Rely on using the platform annotation and keep the API / naming less redundant.
Closes https://github.com/facebook/react-native/pull/5081

Reviewed By: svcscm

Differential Revision: D2803143

Pulled By: nicklockwood

fb-gh-sync-id: 9bdf028f5022ef46fcb63aa6c3fc931fdcc46f2b
2016-01-05 10:32:43 -08:00
Nick Lockwood af24619592 Increased RCTInlineValueThreshold for asynclocalstorage
Reviewed By: tadeuzagallo

Differential Revision: D2641694

fb-gh-sync-id: e35df5408730ce9ec267cbeeb556f8eba154df1f
2016-01-05 10:01:32 -08:00
Satyajit Sahoo 80bf431f98 Add warnings while upgrading RN with `react-native upgrade`
Summary: Closes https://github.com/facebook/react-native/pull/4854

Reviewed By: svcscm

Differential Revision: D2803252

Pulled By: foghina

fb-gh-sync-id: e6b05b19cf45773d7683ae8ae35643f400e51692
2016-01-05 09:58:28 -08:00
Alexander Blom 6d9096fb3f Fix deadlock when recreating websocket connection
Summary:
When you reload code while using the Chrome debugger we used to create a new websocket connection before closing
the old one. This sometimes would cause a in-flight call to not get a response. This in turn would deadlock the JS thread
because we try to shut it down before killing the websocket connection.

This change instead makes sure to close the old connection before creating a new one. This is done by using a factory for
creating the JavascriptExecutor so we can defer the creation until after the old Bridge has been torn down.

public

Reviewed By: astreet

Differential Revision: D2735011

fb-gh-sync-id: 0ce0f35abaeef5457bad8d6b8d10122281192af4
2016-01-05 09:27:42 -08:00
Nick Lockwood fc98956b65 Fix race conditions in RCTModuleData
Summary:
public
The logic inside RCTBatchedBridge contained some race conditions that would occasionally cause an error if modules were loaded in the wrong order. This improves that logic and makes it safer by adding a lock to prevent concurrency.

Reviewed By: jspahrsummers

Differential Revision: D2802930

fb-gh-sync-id: d1ad25fa578649363dcaac029cb24dc3a453ae67
2016-01-05 09:04:31 -08:00
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