Commit Graph

6951 Commits

Author SHA1 Message Date
Ramiro González Maciel e5b389e44c FIX CGMakeRect is really CGRectMake
Summary:
There's a typo,  CGMakeRect is really CGRectMake

https://developer.apple.com/reference/coregraphics/1455245-cgrectmake
Closes https://github.com/facebook/react-native/pull/8524

Differential Revision: D3508996

Pulled By: bestander

fbshipit-source-id: 67270ba52b97bbf4e2a5afd97cfb04647e5aad62
2016-07-01 06:28:24 -07:00
Alexey Lang 6a1324e8f6 Fix codesign and enable in Wilde again
Reviewed By: michalgr

Differential Revision: D3497518

fbshipit-source-id: 615679fdfa22f9a03535248ebaa80ff9aa2e9e71
2016-07-01 04:43:28 -07:00
JasperStam aa0efd2e64 Add cardStyle prop to NavigationCardStack.
Summary:
This allows the `NavigationCard` style to be extended, the default `backgroundColor` style of the `NavigationCard` is not applicable to all apps.
Fixes issue #8116. PR #8115 was already made for this but didn't pass CI checks.

**Test plan**

When rendering a NavigationCardStack, add

```
const { CardStack } = NavigationExperimental;
...

<CardStack cardStyle={{ backgroundColor: 'purple' }} />
```

to see that the `NavigationCard` background has changed to purple.
Closes https://github.com/facebook/react-native/pull/8471

Differential Revision: D3508849

Pulled By: javache

fbshipit-source-id: 65703cccf3d01def9f2060256f0ff564bbdc47d3
2016-07-01 04:43:28 -07:00
Franklyn Tackitt 22fbb6d46d Remove iOS platform check for running devtools
Summary:
Currently, DevTools only work under ios (although this is undocumented!),
because the JavaScriptEngine initialization process skips setupDevTools() on
android.

DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using
Nuclide's inspector.

For reference, the relevant issue on react-devtools.
Closes https://github.com/facebook/react-native/pull/8095

Reviewed By: bestander

Differential Revision: D3492788

Pulled By: andreicoman11

fbshipit-source-id: 1eda9196d7125da19a8d7baaab22b61b744ca629
2016-07-01 04:28:48 -07:00
Felix Oghina 010e1977a8 Promote ResourceDrawableIdHelper to new module
Summary:
Found a couple of places where we were copy-pasting the logic `ResourceDrawableIdHelper` had. This class was only available on the image module and it had package visibility. I moved it to its own module so that we can easily use it from others.

This diff is pretty simillar to 54ed44628d but it fixes a bug due to which we had to revert it.

Reviewed By: andreicoman11

Differential Revision: D3499062

fbshipit-source-id: f912f57e5ac21a9f30fe42067c784f49fa46ed48
2016-07-01 04:28:48 -07:00
Hugo Dozois 508cc06565 Add __DEV__ around textInput prop check
Summary:
**Motivation**

The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation.

**Test plan (required)**

There are no changes to the ui.
Closes https://github.com/facebook/react-native/pull/8499

Differential Revision: D3508805

Pulled By: javache

fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
2016-07-01 04:13:24 -07:00
Pieter De Baets 33d59137a5 Fix missing methods in !RCT_DEBUG
Reviewed By: bestander

Differential Revision: D3508704

fbshipit-source-id: 82c38819a83a50e0d5ba25480b5b4b7290c92e13
2016-07-01 03:13:18 -07:00
Konstantin Raev 88bd5e4d90 Reverted commit D3428952
Reviewed By: frantic

Differential Revision: D3428952

fbshipit-source-id: 61e5195399746d6511719971121c7c63f87ef4f4
2016-07-01 02:13:21 -07:00
James Ide a8011bbfdc Set LayoutParams in ReactTextView to fix crash
Summary:
ReactTextView occasionally crashes when `setText` is called. Doing some cursory research, it looks like this could be a bug in Android. We also suspect it might be related to removeClippedSubviews though.

The LayoutParams don't actually matter because RN controls layout, but on occasion (haven't narrowed down what this is...) `mLayout` is non-null and triggers relayout during `setText`, which fails because the LayoutParams are null. jesseruder came up with this fix and it appears to be working well.

Stack trace: http://pastebin.com/P8VbxvPz
Closes https://github.com/facebook/react-native/pull/7011

Differential Revision: D3508097

fbshipit-source-id: 12b4aa11e42112c8ba19a1af325e3ee9a232d08f
2016-06-30 20:50:09 -07:00
Marc Horowitz d1d9045eb4 Display JS exceptions and stacks in a red box.
Reviewed By: javache

Differential Revision: D3429031

fbshipit-source-id: a7ffd71151d8d78ccf8f0cc45807762b601cd112
2016-06-30 19:43:28 -07:00
Andrew Y. Chen 2b88482701 Implement JavaOnlyArray#getType
Reviewed By: AaaChiuuu

Differential Revision: D3504601

fbshipit-source-id: 37dbbcdd8cc0523cb8f1673047995c4410e8f7be
2016-06-30 19:43:28 -07:00
Marc Horowitz ff31128200 Display JS exceptions and stacks in a red box
Reviewed By: frantic

Differential Revision: D3428952

fbshipit-source-id: e2b77487d54a3d89039661943061a0137f8410c0
2016-06-30 19:13:26 -07:00
Sunny Gurnani 730619dabf BugFix: Title should be from scene.route.title
Summary:
Its a minor Bug fix for rendering Title in NavigationHeader
Closes https://github.com/facebook/react-native/pull/8437

Differential Revision: D3507319

Pulled By: ericvicenti

fbshipit-source-id: ff4aa36be3c4991be11aabecbaad952c015a60e2
2016-06-30 17:58:25 -07:00
Héctor Ramos 7d3fbbdb68 Introduce navigators in the tutorial
Summary:
Adds a new section to the tutorial. Covers the basics of scenes and navigators.

The navigator comparison doc has been moved to docs/navigation.html in this PR.

![navigators](https://cloud.githubusercontent.com/assets/165856/16505919/37459e3a-3ed4-11e6-87e9-5fa7e6f792d3.png)
Closes https://github.com/facebook/react-native/pull/8515

Differential Revision: D3507325

Pulled By: caabernathy

fbshipit-source-id: e9ee5b2572868189af198cdf461b2728dfa84f9e
2016-06-30 17:58:25 -07:00
Marc Horowitz ccd608a4b6 Update nul termination handling to avoid copies on iOS
Reviewed By: javache

Differential Revision: D3495998

fbshipit-source-id: 8d69ecc4777402a5d6b0e814af9f1862b47ecaa1
2016-06-30 16:43:56 -07:00
Chris Hopman e19225aa64 assert that ShadowNodeRegistry is only accessed from one thread
Reviewed By: astreet

Differential Revision: D3461859

fbshipit-source-id: 790e831d2ca239110e00a5723be40e870ceab020
2016-06-30 15:13:39 -07:00
Chris Hopman c1f7aa3824 Change gradle ndk build inputs back to what they were
Reviewed By: bestander

Differential Revision: D3442666

fbshipit-source-id: 735cb7e908670fa9b1ec58a533a2c59008ccc154
2016-06-30 14:28:23 -07:00
Jimmy Mayoukou 31f30aa4b3 Return empty bundle when passing an empty map to toBundle
Summary:
(I swear this was working before...)

Right now, when passing an empty map to `toBundle` it returns null:
- It feels counter-intuitive to have the data modified without any good reason;
- It is different from what iOS does

This PR fixes this behavior by returning an empty `Bundle` instead of `null`.

It is a breaking change though, and I'm not sure where it goes with the new bridge.
Closes https://github.com/facebook/react-native/pull/7847

Differential Revision: D3504024

fbshipit-source-id: 97ca19259fdf3219e8237e44a313645503a695fd
2016-06-30 10:43:58 -07:00
Mahdi Yusuf 08b7cb7963 Adding Gyroscope to Showcase.
Summary: Closes https://github.com/facebook/react-native/pull/8448

Differential Revision: D3504004

Pulled By: lacker

fbshipit-source-id: 2472ad64a6f0e26bb63c43f353ea92a350661753
2016-06-30 10:43:58 -07:00
Konstantin Raev 034b64509f Fixes Fetch error when debugging in Chrome
Summary:
Fixes https://github.com/facebook/react-native/issues/6679
Closes https://github.com/facebook/react-native/pull/8512

Differential Revision: D3503958

Pulled By: davidaurelio

fbshipit-source-id: 204eaa40832c9acb455f736d0cae40385c67a82f
2016-06-30 10:43:57 -07:00
Nathan Azaria 98f06c8876 Allow RCTPhotoLibraryImageLoader to handle assets-library request
Reviewed By: javache

Differential Revision: D3503380

fbshipit-source-id: 8f8eb545343738906e44ee01aa4ba23755a209c7
2016-06-30 08:43:25 -07:00
Siqi Liu dc3fce06ea Add Copy and Dismiss Button in RN Android Red Box
Summary:
Add "Copy" and "Dismiss" button when the RN Android redbox is shown, consistent with that in RN iOS.
  - "Copy" button copies all the messages shown in the redbox to the host system clipboard, the solution is posting redbox messages to packager and the the packager copies the messages onto the host clipboard.
  - "Dismiss" button always exits the redbox dialog.
  - Add shortcut as "Dismiss (ESC)" and "Reload (R, R).

Notice: Copy button is only supported on Mac OS by now (warning in packager on other platforms), because it's not easy for us to test on Windows or Linux. Will put the codes for other platforms on Github issues, hoping anyone could help test and add this feature, then send us a pull request.

Redbox Dialog in RN Android before:
{F61310489}
Redbox Dialog in RN Android now:
{F61659189}

Follow-up:
- We can adjust the button styles in redboxes.
- We can consider to add shortcut for "Copy" button.

Reviewed By: foghina

Differential Revision: D3392155

fbshipit-source-id: fc5dc2186718cac8706fb3c17d336160e61e3f4e
2016-06-30 08:13:22 -07:00
Dave Miller ca0c6dbe36 Enable zoom on WebViews on Android
Summary: Make the behavior on a WebView allow pinch to zoom.  This matches what iOS has by default.  We may want to at some point put this behind a property but right now just make it work on Android.

Reviewed By: andreicoman11

Differential Revision: D3503429

fbshipit-source-id: adb2bb2c3de099aca08700786be7a132557a5e2a
2016-06-30 07:43:22 -07:00
Konstantin Raev bb0fda7d54 Revert PR-7825 snapshot changes
Summary:
Tests got broken after https://github.com/facebook/react-native/pull/7825, reverting changes
Closes https://github.com/facebook/react-native/pull/8508

Differential Revision: D3503439

Pulled By: bestander

fbshipit-source-id: 95b9283371654265234d975e1b0df540f4ef55fa
2016-06-30 07:28:21 -07:00
Joel Arvidsson d7672d80fc Fix frame calculation for natively driven animations
Summary:
Currently the algorithm for calculating frames will not always have an correct value for the endframe making some natively driven animations stuck almost at the end. This PR ensures the animation ends at `1`.

**Test plan**

Tested with the code in `NativeAnimationsExample.js`.
Closes https://github.com/facebook/react-native/pull/8489

Differential Revision: D3502973

fbshipit-source-id: b9b114d3982341571ac6ff315620d3d2292d9266
2016-06-30 05:28:24 -07:00
Christoph Pojer 89a9ca6688 Update some JS in preparation for some Jest updates.
Summary:
* Next version of Jest doesn't allow non test files in __tests__ folders.
* I'm trying to switch all tests off of jsdom on react-native. This should save 500ms of time when running a single test because jsdom is slow to load and react-native is also not supposed to run in a DOM environment, so let's not pretend we are providing the DOM in tests.
* Make the bridge config configurable so that when we disable automocking and we reset the registry we can redefine the value.

Oh also, stop using lodash in Server.js. First off, lodash 3 doesn't work in Jest's node env because it does some crazy stuff, second because we don't need to load all of lodash for debounce.

Reviewed By: davidaurelio

Differential Revision: D3502886

fbshipit-source-id: 1da1cfba9ed12264d81945b702e7a429d5f84424
2016-06-30 01:58:40 -07:00
Joel Arvidsson 4a15dc814e Add RCTAnimation to Podspec
Summary:
**Motivation**

This PR adds a subspec for the `NativeAnimation` iOS library which so one can use it with CocoaPods.

**Test plan (required)**

Tested with the code in `NativeAnimationsExample.js` and this:
```
pod 'React', :subspecs => ['Core', 'RCTAnimation'], :path => 'node_modules/react-native'
```
Closes https://github.com/facebook/react-native/pull/8487

Differential Revision: D3502970

fbshipit-source-id: 0958acdbe088da8b50a1e5e3661f27b64db329c1
2016-06-30 01:43:22 -07:00
osungjin f5f86113bd Adding Bdsdiet to Showcase
Summary: Closes https://github.com/facebook/react-native/pull/8468

Differential Revision: D3502425

Pulled By: lacker

fbshipit-source-id: dfb8802909b7c9d6552894c7397c1ed36ed829d1
2016-06-29 22:13:29 -07:00
Christoph Pojer 7c53addcd5 First snapshot test, rendering "native" React component.
Reviewed By: frantic

Differential Revision: D3449781

fbshipit-source-id: 7abf9280f98cee06d04d7e222b884de1744afb8d
2016-06-29 21:58:17 -07:00
Christoph Pojer 52d5450ced Update Jest and add Jest-REPL/Jest-Runtime
Reviewed By: elynde

Differential Revision: D3496544

fbshipit-source-id: a19ae23bff88e99ef15ecc800378899c79cdee18
2016-06-29 19:58:31 -07:00
Hedger Wang d72f844530 Pass TransitionProps to `configureTransition` for <NavigationTransitioner />
Summary:
This follows up the PR https://github.com/facebook/react-native/pull/8306

= Changes

1. Provides the TransitionProps (current and previous) to the function
`configureTransition`.

2. Adds a new member `timing` to `NavigationTransitionSpec`.

= Why

1. Helps people to customize the animation between transitions
2. Helps people to migrate from the deprecated `applyAnimation` prop.

Reviewed By: ericvicenti

Differential Revision: D3470802

fbshipit-source-id: be49becccd53aed7bc57093da1c7dae20153febd
2016-06-29 18:43:47 -07:00
Hedger Wang e19fa82dd2 Add an example for Pager built with NavigationTransitioner & Animated.View
Summary:
Add an example for Pager built with NavigationTransitioner & Animated.View

This example demostrates how to apply pre-defined gesture handling and
animation styles to the <Animated.View /> to build a Pager navigator.

Reviewed By: ericvicenti

Differential Revision: D3495807

fbshipit-source-id: 08e275010888925bc9fd1840e7052f975c95ad63
2016-06-29 18:43:47 -07:00
Tim Yung de6ab1c6f4 RN: Implement `defineLazyObjectProperty`
Reviewed By: sahrens

Differential Revision: D3500318

fbshipit-source-id: 275c5b9a2b747174fb23b80896e2270eb2131e4b
2016-06-29 16:43:17 -07:00
Nivetha Singara Vadivelu 8b57f078de Making the navigation transition page style
Reviewed By: hedgerwang

Differential Revision: D3499189

fbshipit-source-id: 809096e7f0f51c241b88d642704d09da259da4b3
2016-06-29 14:58:28 -07:00
Andy Street cf7b4e74f0 Use DISPLAY thread priority for main thread in React Native
Summary: In older versions of android, the main thread is given the same priority as all other threads (default). Instead, it should have a higher priority (DISPLAY) which will make sure it's scheduled instead of the background JS/native modules threads.

Reviewed By: majak

Differential Revision: D3497244

fbshipit-source-id: 15ab09f4ebcad2692ae1261f15aa2c6c39f72ee9
2016-06-29 14:13:26 -07:00
Joel Marcey bcb7cc4956 Change method name color for API/Component methods
Summary: Closes https://github.com/facebook/react-native/pull/8481

Differential Revision: D3497267

Pulled By: JoelMarcey

fbshipit-source-id: 82ffb17a9ec3110481ad64d5065fc9fee6a31808
2016-06-29 07:58:28 -07:00
Tucker Connelly 3d3b067f6f Add zIndex support
Summary:
Adds zIndex support :)

**Test Plan**

Tested the following components by adding two of each, overlapping them, and setting a high zIndex on the first of the two:

ActivityIndicator
Image
MapView
Picker
ScrollView
Slider
Switch
Text
TextInput
View
WebView

Tested on Android 4.1 and iOS 8.4. Also tested updating zIndexes on Views in my own app.

<img width="359" alt="ios activityindicator" src="https://cloud.githubusercontent.com/assets/4349082/15633473/88f842cc-257b-11e6-8539-c41c0b179f80.png">
<img width="330" alt="android activityindicator" src="https://cloud.githubusercontent.com/assets/4349082/15633475/88f95784-257b-11e6-80c0-2bf3ed836503.png">
<img width="357" alt="ios image" src="https://cloud.githubusercontent.com/assets/4349082/15633474/88f93d80-257b-11e6-9e54-4ff8e4d25f71.png">
<img width="340" alt="android image" src="https://cloud.githubusercontent.com/assets/4349082/15633478/88fd2788-257b-11e6-8c80-29078e65e808.png">
<img width="342" alt="android picker" src="ht
Closes https://github.com/facebook/react-native/pull/7825

Differential Revision: D3469374

Pulled By: lexs

fbshipit-source-id: b2b74b71d968ebf73ecfd457ace3f35f8f7c7658
2016-06-29 07:43:23 -07:00
Héctor Ramos 3085b35e63 Initial stab at NavigationExperimental tutorial
Summary:
Add a NavigationExperimental section to the Navigation guide.

![navexp](https://cloud.githubusercontent.com/assets/165856/16355280/120e7d38-3a67-11e6-9567-51c19c249fdf.png)
Closes https://github.com/facebook/react-native/pull/8431

Differential Revision: D3493158

Pulled By: JoelMarcey

fbshipit-source-id: 5e9646c3abf97f5cce6f5ba5b3d10853aa84ee8e
2016-06-29 05:28:24 -07:00
sunnylqm 6b2a49e73e Specify width and height for Image(remote source)
Summary: Closes https://github.com/facebook/react-native/pull/8486

Differential Revision: D3496850

Pulled By: javache

fbshipit-source-id: f2456b914c420089558484fb87e3d92ed2c923af
2016-06-29 05:13:29 -07:00
Andrei Coman f0f2645ec7 Backed out changeset 708058c5f244
Reviewed By: dmmiller

Differential Revision: D3496881

fbshipit-source-id: 0f2e0d5769d09e0c70feceda7ff7d959e3a9ef2e
2016-06-29 04:13:23 -07:00
Andrei Coman cbd8214b43 Reverted commit D3494715
Reviewed By: donyu

Differential Revision: D3494715

fbshipit-source-id: a96e12ddbf266804b1bb8ec169d3c01e8a029eb7
2016-06-29 02:43:19 -07:00
Eric Kreutzer 73bea8f7e6 Fixes EventEmitter#once arguments not getting passed to the listener
Summary:
Arrow functions do not have their own arguments. Fix EventEmitter#once to pass the correct arguments to the listener callback.
Closes https://github.com/facebook/react-native/pull/8479

Differential Revision: D3495086

Pulled By: javache

fbshipit-source-id: 4492d13bfb2cc255afdc41d39fbf2f35da6b7094
2016-06-28 16:13:21 -07:00
Martín Bigio 1762426e9c Revert change on ResourceDrawableIdHelper
Reviewed By: donyu

Differential Revision: D3494715

fbshipit-source-id: 807f3ea3db42a17e6f2eed63a72e0bccfc371a58
2016-06-28 15:58:19 -07:00
Sam Pepose 8b803c6143 Updated babylon/babel-* packages to latest version
Reviewed By: yungsters

Differential Revision: D3493809

fbshipit-source-id: aa2a8c804d6e2aae8afc9af8c1a577be28e998b8
2016-06-28 15:28:24 -07:00
Joel Marcey 5c31ba5098 Fix TextInput API update nits
Summary:
Ref: 7e7c2b5d57 (r68444537)

Ref: 7e7c2b5d57 (r68444442)
Closes https://github.com/facebook/react-native/pull/8476

Differential Revision: D3494641

Pulled By: JoelMarcey

fbshipit-source-id: 9a75ff66ccb895deb2f5027bdffe5d5bfe898e41
2016-06-28 14:58:17 -07:00
Martín Bigio eafc5dac62 Add support for `drawableLeft` and `drawablePadding` props
Summary: Add support inlining images into text inputs. For now this is only available on Android.

Reviewed By: andreicoman11

Differential Revision: D3470805

fbshipit-source-id: 14db05ec4d5af549bf314b903654314f39bf73ea
2016-06-28 14:13:48 -07:00
Martín Bigio 54ed44628d Promote ResourceDrawableIdHelper to new module
Summary: Found a couple of places where we were copy-pasting the logic `ResourceDrawableIdHelper` had. This class was only available on the image module and it had package visibility. I moved it to its own module so that we can easily use it from others.

Reviewed By: andreicoman11

Differential Revision: D3463697

fbshipit-source-id: 708058c5f2445e27b151d8a6f3b47fd23485bc88
2016-06-28 14:13:48 -07:00
Shayne Sweeney edbe0dc019 Added offline mirror for kpm
Reviewed By: bestander

Differential Revision: D3489542

fbshipit-source-id: 17d22db5e8c0f952a92f575c98b6402f457f6ddc
2016-06-28 12:58:33 -07:00
Siqi Liu 6fb110e776 Add nullcheck in ExceptionsManager.js to Never Update JS Exception with a Null Stack
Summary:
JS codes sometimes report exceptions with `null` details about stack traces, resulting in native `NullPointerException` crashes when parsing the stack traces.
Added null checking for the stack traces in `ExceptionsManager.js`, ensuring that we never call `updateExceptionMessage` with a null stack

Reviewed By: foghina

Differential Revision: D3455783

fbshipit-source-id: 027969afd8a5d6015e97fce0a26626730cfc83a4
2016-06-28 09:43:23 -07:00
Joel Marcey 30376aef13 Update Text Component
Summary:
This updates the documentation for the `Text` component itself and the embedded `Text.md` that goes with it.

- React Native Web Player
- Document all props
  - NOTE: I actually added a new prop to `Text` called `accessible` since it was set by default and thus shown in the Props list
    in the original documentation (but with an empty description).
- Stylistic fixes
Closes https://github.com/facebook/react-native/pull/8445

Differential Revision: D3493112

Pulled By: JoelMarcey

fbshipit-source-id: b428d4eb09065db5c6cb1ae5524ad22084fd2a82
2016-06-28 07:43:21 -07:00