Commit Graph

3644 Commits

Author SHA1 Message Date
Pieter De Baets d9b4c57e12 Remove log level 'log' from JS
Summary: Log level 'log' from JS should be equivalent to 'info'. Also added knowledge of 'trace' log level in RCTLog.

public

Reviewed By: vjeux

Differential Revision: D2615500

fb-gh-sync-id: 7a02f49bf7953c1a075741c21e984470c44b5551
2015-11-05 12:51:41 -08:00
Pieter De Baets 824858c6b2 Add convenience function for formatting NSError for reporting
Reviewed By: nicklockwood

Differential Revision: D2620933

fb-gh-sync-id: c5c40b78b19f12c9a3b1564b1e21f1acb12309ab
2015-11-05 12:51:34 -08:00
Pieter De Baets 31b5b0ac01 Create RCTFatal for reporting fatal React events
Summary: public

Add RCTFatal for reporting fatal runtime conditions. This centralizes failure handling to one function and allows you to customize how they should be handled. RCTFatal will be logged to the console and as a redbox and will also be triggered by fatal exceptions coming from RCTExceptionsManager.

Note that there is no RCTLogFatal, since just logging the fatal condition does not allow us to handle it consistently.

Reviewed By: nicklockwood

Differential Revision: D2615490

fb-gh-sync-id: 7d8e134419e10a8fb549297054ad955db3f6bee0
2015-11-05 12:51:27 -08:00
rocman d8dd330d41 fix the memory leaks caused by RCTTabBar
Summary: The memory leaks root from the TabBarController not removing itself
when its holder view deallocs. So to fix the issue, it’s just to remove
it from its parentViewController when the holding RCTTabBar
deallocs. This should be safe, since the RCTTabBar seems the owner
of the TabBarController.
Closes https://github.com/facebook/react-native/pull/3915

Reviewed By: svcscm

Differential Revision: D2620905

Pulled By: nicklockwood

fb-gh-sync-id: ce22eb3ebf82562827f6b1bae22aea5ac7d3b51a
2015-11-05 09:39:30 -08:00
Mark Miyashita f8df38424e Use mainBundle in RCTConvert to resolve asset paths
Summary: See #3888 for why this is necessary. Essentially, `[NSBundle mainBundle]` loads the file path for the target app which is the only way to reference images.

cc javache nicklockwood
Closes https://github.com/facebook/react-native/pull/3889

Reviewed By: svcscm

Differential Revision: D2615580

Pulled By: nicklockwood

fb-gh-sync-id: d06ce0987dde666b06bb5a7edf609ed45f325d2c
2015-11-05 09:30:36 -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
Frédéric Sagnes f5670f8ab5 Set ASCII as the default bundle encoding
Reviewed By: davidaurelio

Differential Revision: D2596387

fb-gh-sync-id: deadb8e9a44bbe7b12ce9e6bb5e3c96d4f646074
2015-11-05 07:31:55 -08:00
Mike Armstrong 7431f4e182 Fix missing private on member variable
Differential Revision: D2620844

fb-gh-sync-id: b9901f46d6fe6a772a48dd091c273c581a383dda
2015-11-05 07:03:36 -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
Mike Armstrong 66f7feda4d Remove NativeRunnables from local references table.
Differential Revision: D2620026

fb-gh-sync-id: c105143d3ad932abcaff1407c6434148221753c4
2015-11-04 20:41:28 -08:00
Bhuwan Khattar a4cc0c3ffd No `NSError *` over the bridge
Summary: I was getting the following error when running `testAsyncStorageTest`
```
uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (NSError)'
```

nicklockwood pointed out that it might be because we're attempting to send a `NSError *` over the bridge at some point. So I went looking for cases where that might happen and found this instance.

public

Reviewed By: jingc

Differential Revision: D2619240

fb-gh-sync-id: dc26ec268f976fec44f2804831398d3b01ab6115
2015-11-04 20:07:31 -08:00
Mike Armstrong 575a4a71b9 Force fresco to go to network
Differential Revision: D2619848

fb-gh-sync-id: fe607dd8774c0c5f7122c362d64e4484c0bcce59
2015-11-04 19:44:35 -08:00
Christoph Pojer 7f93548489 Remove dependency on underscore
Reviewed By: davidaurelio

Differential Revision: D2614853

fb-gh-sync-id: 706fb0db6852f599a1b3dd022dbc22aabb76539a
2015-11-04 19:02:47 -08:00
Mike Armstrong 97135ee575 Metrics for grey box time
Differential Revision: D2619368

fb-gh-sync-id: 4c8105ecff3f4bd0df57042b49ae8b8e722d6b3e
2015-11-04 18:49:29 -08:00
Christoph Pojer d3599d0a88 Start pulling DependencyResolver apart
Summary: I'm planning to split up `DependencyResolver` into the react-native specific implementation of it and a new, generic resolver that is going to replace `node-haste` for jest and other places where we might need JS dependency resolution.

The plan is to split the two folders up so that:

* `Resolver` is the folder for all the react-native specific resolver code
* `DependencyResolver` will become a standalone library, eventually moving into a package called `node-haste`.

There is still a lot to be figured out. This is just the first diff of likely many. The current goal is to make `DependencyResolver` standalone to be able to create an instance of a resolver and resolve all dependencies for a file. This is when I can start integrating it more seriously with jest.

This diff simply moves a bunch of things around and turns `HasteModuleResolver` into an ES2015 class ( :) ).

bypass-lint
public

Reviewed By: davidaurelio

Differential Revision: D2614151

fb-gh-sync-id: ff4e434c4747d2fb032d34dc19fb85e0b0c553ac
2015-11-04 16:59:30 -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
Peter Lai 59ed90dd5f Fix build break: add java file changes to fbobjc
Reviewed By: jingc

Differential Revision: D2617489

fb-gh-sync-id: 3fa37dc52c526c79e3510754606e542b171b3a18
2015-11-04 14:16:26 -08:00
James Ide 471449b368 Merge pull request #3872 from mccambridge/master
Added media queries for Showcase page in docs
2015-11-04 12:27:02 -08:00
Pieter De Baets 05996963c9 Cleanup RedBox display of native errors
Reviewed By: nicklockwood

Differential Revision: D2615507

fb-gh-sync-id: 94f8013b418a3b95508cc55b9302fde4325bfcbf
2015-11-04 12:12:33 -08:00
James Ide 7fec60e6c4 Merge pull request #3891 from mgmcdermott/patch-1
Added Harmonizome
2015-11-04 11:57:48 -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
Satyajit Sahoo 6c11d18360 Prevent destroying activity on runtime changes
Summary: From http://developer.android.com/guide/topics/resources/runtime-changes.html

> Some device configurations can change during runtime (such as screen orientation, keyboard availability, and language). When such a change occurs, Android restarts the running Activity (onDestroy() is called, followed by onCreate()). The restart behavior is designed to help your application adapt to new configurations by automatically reloading your application with alternative resources that match the new device configuration.

However, in a React Native app, there is only a single activity for the entire app, unlike a single activity per screen in Android, and resources are not specific to orientation etc. Destroying activity means reloading the entire app. Most of the time, this is not the intended behaviour, and can cause data loss for the user if the developer doesn't disable it explicitly. I'm proposing to disable it by default.
Closes https://github.com/facebook/react-native/pull/3813

Reviewed By: svcscm

Differential Revision: D2616083

Pulled By: foghina

fb-gh-sync-id: 8794e436f61581ff0bf569b1b112845cae77b688
2015-11-04 10:47:30 -08:00
Tadeu Zagallo 0c74804427 Use dispatch_async instead of lock
Summary: public

The initial implementation used a lock to manage the stored profile information,
blocking the caller thread for longer than it should. Replace it with a private
queue, since the only thing we need to from the caller is to record the immediate
call time and the caller thread/queue, all the rest has absolutely no priority.

Use macros to also defer work done when generate the name of the events.

Reviewed By: nicklockwood

Differential Revision: D2603120

fb-gh-sync-id: e3e36160c893e7ae9ed3558f07c854ea76396661
2015-11-04 09:03:01 -08:00
Josh Berdine 02a8c38361 Update UIExplorer TextExample test snapshot
Summary: public

Re-recorded UIExplorerIntegrationTests::testTextExample snapshot to include
new opaque nested text example.

Reviewed By: nicklockwood

Differential Revision: D2610584

fb-gh-sync-id: 119dbf381f0b412ed8705597b03b367c5098b80d
2015-11-04 08:55:49 -08:00
Josh Berdine a670ed1d3c Simplify opaque nested Text UIExplorer example
Summary: public

Add simpler example and remove clutter used to test rendering.

Reviewed By: nicklockwood

Differential Revision: D2605648

fb-gh-sync-id: 84900c290c7af9439f5ce726dd84565bb006ff37
2015-11-04 08:55:42 -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
Michael McDermott cbeb6aabaf Added Harmonizome
I've added the Harmonizome application to the showcase. It is also available for Android, however, I'll wait until we can add multiple links to one app before I include it.
2015-11-04 11:53:51 -05:00
Tadeu Zagallo 70c9ee8b1b Convert System.import transform to babel 6
Reviewed By: martinbigio

Differential Revision: D2615286

fb-gh-sync-id: 4f0e8e3359413d972ab4d0da291870768a77e361
2015-11-04 08:53:26 -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
Kai Wood 635edd9ccc Support line number arguments for RubyMine
Summary: RubyMine's command line launcher `mine` supports the same syntax as `mate` for jumping to line numbers. This patch adds it to the list.
Closes https://github.com/facebook/react-native/pull/3883

Reviewed By: svcscm

Differential Revision: D2615422

Pulled By: pcottle

fb-gh-sync-id: 79a70f524f852ba8eb4803e6abc6970abbf02b61
2015-11-04 07:56:27 -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
Martín Bigio eed38e9163 Retry landing D2590327
Reviewed By: swarr

Differential Revision: D2613446

fb-gh-sync-id: d38ad4e7cf66d25c69f92b330dd0feed0eeb23df
2015-11-03 17:45:28 -08:00
Bhuwan Khattar db229aab87 Make component registration in UIExplorerApp explicit
Summary: Currently, the components get registered by `UIExplorerApp.ios.js` as a side effect of requiring `UIExplorerList.ios.js`. This removes the side effect and makes the registration explicit so that it works well with inline requires.

public

Reviewed By: jingc

Differential Revision: D2613174

fb-gh-sync-id: 799dd8b11985708b05fc4c03f367487b47f46bc6
2015-11-03 17:20:30 -08:00
Jan Kassens 2519d25992 Fix undefined var exception
Summary: This check to see if `require` exists was bad as it throws an error for an
undefined reference in case it doesn't exist.
Closes https://github.com/facebook/react-native/pull/3845

Reviewed By: svcscm

Differential Revision: D2613368

Pulled By: martinbigio

fb-gh-sync-id: 7b1d0f38e4af9bce81356a613d6105f2c00c7ed7
2015-11-03 17:11:29 -08:00
Andrei Coman 5ed8c6732e Set spans on empty strings
Differential Revision: D2612574

fb-gh-sync-id: 17b93f42a773ea6239990c6b0bd9bf4f32f8b455
2015-11-03 15:06:26 -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
Sean McCambridge c7b46a13f9 Added media queries for .showcase in docs, creating a single-column layout on small screens and a two-column layout on tablet-sized screens when viewing showcase of RN apps. 2015-11-03 15:55:14 -05:00
James Ide 31565781f2 Merge pull request #3867 from ma94264/patch-1
Include my app done by React Native
2015-11-03 10:34:08 -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
Martin Konicek 2797bc2069 Update RunningOnDeviceAndroid.md 2015-11-03 18:54:11 +01:00
Pawel Sienkowski 1efb9dc063 Remove invalid assertion from RCTUIManager
Reviewed By: javache

Differential Revision: D2606613

fb-gh-sync-id: e8d9bcf5d23b720230de4904cab577f097010150
2015-11-03 09:07:30 -08:00
Pawel Sienkowski d0371165c3 Fix the way the Storyline native module is updated
Reviewed By: javache

Differential Revision: D2609706

fb-gh-sync-id: dcacd9085243d04f4e0dfa8d4a4c5df594ef31ec
2015-11-03 08:58:28 -08:00