Commit Graph

7325 Commits

Author SHA1 Message Date
David Aurelio 667aaa4621 Bring back node-haste to fbsource
Summary:
Since jest stopped using node-haste a while ago, we are the only client left.
This brings back node-haste back to fbsource to allow us to iterate faster.

Reviewed By: bestander

Differential Revision: D3641341

fbshipit-source-id: a859f8834765723a3515e2cf265581b9dd83997c
2016-07-29 11:15:02 -07:00
Mengjue Wang 70dc98dea4 Provide RTL support for RCTShadowView according to new csslayout
Summary:
The make current RCTShadowView support RTL layout.
1 Change all left/right to start/end for margin, padding, boarder and position
2 Calculate position in the same way as margin, padding and boarder

Reviewed By: fkgozali

Differential Revision: D3619292

fbshipit-source-id: eaaa6faeee93c964d59bb6f498d89effc09ed567
2016-07-29 10:43:23 -07:00
David Aurelio 654a36018c Don't collect warnings if yellow box is disabled
Reviewed By: vjeux

Differential Revision: D3641566

fbshipit-source-id: 1e2279be1656a305af8b4c5eaf32789a5ba6577d
2016-07-29 09:28:28 -07:00
Gant cc05a710f9 Docs update - Direct user to changelog for manual steps of version
Summary:
For some reason the last PR targeted 0.30-stable as pointed out by charpeni - here:  https://github.com/facebook/react-native/pull/9010

Fixed here in a second PR, due to the fact that initial PR would not allow a change.
Closes https://github.com/facebook/react-native/pull/9013

Differential Revision: D3641602

fbshipit-source-id: e874dbd24d214f6c88310bb4be7cc334528cc014
2016-07-29 08:43:34 -07:00
Maria Mateescu 3561dbb74d Unbreak compiling error - sorry
Reviewed By: bestander

Differential Revision: D3641418

fbshipit-source-id: fa131761b65a19ed0fc821dd52852480f2ed0c2d
2016-07-29 07:13:43 -07:00
Andy Street 65fdd70d45 Use non-breaking space for Reload button
Summary: Stops the text in 'Reload (R, R)' from wrapping after the comma.

Reviewed By: foghina

Differential Revision: D3641409

fbshipit-source-id: ecbc8ea2935f613559f26e8ace1e9b609ea2ad18
2016-07-29 07:13:43 -07:00
Marc Shilling 7606564611 Make getCurrentActivity public on ReactContext
Summary:
Addresses #8661
Closes https://github.com/facebook/react-native/pull/9071

Differential Revision: D3641285

Pulled By: foghina

fbshipit-source-id: dede86743efddc33b6ead053e805770fc213685c
2016-07-29 04:28:27 -07:00
Mengjue Wang a06e4b75e4 bottom styling isn't applied when a View is not absolute-positioned
Summary: The new CSSLayout have a wrong calculate for the getRelativePosition. So use the getLeadingPosition will get 0 instead of return undefined. Fix it with using isLeadingPosDefined.

Reviewed By: fkgozali

Differential Revision: D3640799

fbshipit-source-id: 50d3bd2ea4c0d8bf96ba34297425ba269b0535cd
2016-07-28 23:43:27 -07:00
Mengjue Wang 66514869aa Provide RTL support for RCTShadowView
Summary:
The make current RCTShadowView support RTL layout.
Two changes I made:
1 Change all left/right to start/end for margin, padding, boarder and position
2 Change the paddingAsInsets to support RTL

Reviewed By: majak

Differential Revision: D3548002

fbshipit-source-id: 15cc5228d2d28d0e12a7147daf57967e5b87ee63
2016-07-28 17:28:32 -07:00
Seth Kirby e87a02c520 Delay dropping root views until the drop views step of StateBuilder.
Summary: Make UIOperation public so that custom implementations can expose instances of it.

Reviewed By: ahmedre

Differential Revision: D3618197

fbshipit-source-id: 89f764818cc2e8e94cf9678814e56e7074eb9067
2016-07-28 17:13:36 -07:00
Fadil Sutomo 63d15af18d Activity indicator: add size prop
Summary:
**motivation**

Previously, size can only accept either 'small' or 'large'. And to obtain a custom size, scale transformation is used. This is to let users to possibly pass number value directly to define ActivityIndicator's size.

**Test plan**

I have also modified the current example to reflect the new size prop in action.
Closes https://github.com/facebook/react-native/pull/8935

Differential Revision: D3637910

fbshipit-source-id: 6b8e1d4504964916df327b2d3eaaef1bb8cd5112
2016-07-28 15:28:43 -07:00
Mengjue Wang 873c6ff5b9 Fix CSSLayout to Support RTL
Summary:
The current CSSLayout can't support RTL because wrong calculation for absolute position.
This change is mainly to fix the issue: https://github.com/facebook/css-layout/issues/197
Three main problems I fixed:
1. Calculate the position in the same way as margin, boarder, and padding. So that to fix the absolute problem.
2. Fix one wrong calculation for leading value when we only know the trailing value. It was hard code for the LTR situation. Now I changed it to depends on the main Axis.
3. Expose getter and setter function for RN to read layout direction and start/end position value.

Reviewed By: fkgozali

Differential Revision: D3616949

fbshipit-source-id: ae7a47cc0a5d02b42b95f87232be51ab144056d9
2016-07-28 14:58:35 -07:00
Siqi Liu b5abb87a6f Fix the potential bug for network inspector when receiving xhr objects without an "_index" property
Summary: It sometimes happens that there are already some existing `XMLHttpRequest` objects before we turn on the network inspector. So it is a must to check whether a `XMLHttpRequest` object has a property `_index` to determine if it should be tracked.

Reviewed By: davidaurelio

Differential Revision: D3635184

fbshipit-source-id: a5552d7244c994b0fe782ac35baae39ec7488494
2016-07-28 14:13:46 -07:00
David Goldman fd48bc3cff Implement multi-source Images on iOS
Summary: Mirrors Android's support for multiple sources for Image, allowing us to fetch new images as the size of the view changes.

Reviewed By: mmmulani

Differential Revision: D3615134

fbshipit-source-id: 3d0bf2b75f63a4379e0e49f2dab9aea351b31d5f
2016-07-28 14:13:46 -07:00
Simon Ayzman 7e2e0deeb0 Updated ScrollView's keyboardShouldPersistTaps doc
Summary:
I noticed that even when a ScrollView's `keyboardShouldPersistTaps` prop is set to true, the ScrollView's children can still respond to tap events (even if the scroll view itself will not respond to tap events and the keyboard does not dismiss automatically). This is a point of ambiguity in the React Native docs; it implies that no touch events can be handled if `keyboardShouldPersistTaps` is set to true.
Closes https://github.com/facebook/react-native/pull/9053

Differential Revision: D3636711

Pulled By: hramos

fbshipit-source-id: 2f0aea86202ab66d5a9174ce8611509dff67e15f
2016-07-28 12:43:34 -07:00
Maria Mateescu ddc70ffd85 Plug in the Cache to the ImageLoader
Reviewed By: donyu

Differential Revision: D3586563

fbshipit-source-id: 03f457df97066a522dc923b5f432314da40f7d71
2016-07-28 08:58:35 -07:00
Maria Mateescu 54244e15bf Define the Image Cache delegate to be used in the ImageLoader
Reviewed By: javache

Differential Revision: D3583472

fbshipit-source-id: d1f30f3f96aea7739b9f91093fbb6c92c8b9567e
2016-07-28 08:58:34 -07:00
Maria Mateescu f12d0a220b Create protocol for delegate for image cacheing
Reviewed By: donyu

Differential Revision: D3581390

fbshipit-source-id: 869437dd05db614f8191eab69723c4742df0637b
2016-07-28 08:58:34 -07:00
Christoph Pojer 75ecaf4190 Update to 14.0
Reviewed By: kassens

Differential Revision: D3627753

fbshipit-source-id: 35b8246c8cb61e60908d8c233a6e72063bf67096
2016-07-27 22:13:26 -07:00
sam 7971cca4f0 add UIExplorer example of SwipeableListView
Summary:
Q: Explain the **motivation** for making this change. What existing problem does the pull request solve?

A: There is no example for [`SwipeableListView`](https://github.com/facebook/react-native/tree/master/Libraries/Experimental/SwipeableRow) component, it would be helpful to add one.

**Test plan (required)**

Some screenshots here:

<img width="377" alt="screen shot 2016-07-14 at 21 47 50" src="https://cloud.githubusercontent.com/assets/1091472/16841629/af8392c4-4a0c-11e6-9f92-208aba514f36.png">

Tested on:

1. Simulators

    iPhone 4s, 5, 5s, 6, 6 Plus
Closes https://github.com/facebook/react-native/pull/8782

Differential Revision: D3624365

fbshipit-source-id: 76598ac69bca1dca6ae928d2d19c9f1384d8e161
2016-07-27 17:58:36 -07:00
Daniel Braun 1bb1385c7d Webview: Fix broken fullscreen modals due to zero body height.
Summary:
Supersedes PR #8536
Fixes #5211

JavaScript plugins such as Fotorama are broken when attempting use its fullscreen feature.

If there's an absolute HTML element with 100% height under <body>, its height is 0 when rendered in the Android WebView.

This commit fixes it.
Closes https://github.com/facebook/react-native/pull/8830

Reviewed By: bestander

Differential Revision: D3632821

Pulled By: jamesgpearce

fbshipit-source-id: c185bcd30d1d214a357d0d8552d61d0ddfa5e6c6
2016-07-27 16:58:57 -07:00
Andrew Y. Chen aa32fd64a5 Add Airplane mode as a potential reason for debug server exceptions
Reviewed By: jingc

Differential Revision: D3632310

fbshipit-source-id: e6ccbfaaccf6853c615956842ea657eaba76cbe2
2016-07-27 16:28:27 -07:00
Siqi Liu d12d075977 Add detail view for network inspector
Summary:
This diff adds a detail view for the network inspector. When pressing one item in the network flow list, a popup scrollView with detailed information about the network request will be shown. More interesting, the detail information is shown in real time, which means the detail information will be updated dynamically as soon as the network request is updated (maybe receiving a response after waiting).

Also have made sure this works on both Android and iOS.

Reviewed By: davidaurelio

Differential Revision: D3627566

fbshipit-source-id: e868d0c0287d392018b9fa64fce53b4c4b3d76d9
2016-07-27 12:28:32 -07:00
Siqi Liu ecea0cef74 Add UI to show intercepted network information in the inspector
Summary:
This diff adds a UI to display network information flows in the inspector tool (Android and iOS both supported):
- uses a ListView to show network flows, always scrolling to the latest item when a new network request occurs.
- displays the network requests as soon as they were created.
- highlights the selection row and toggles events to log the detailed intercepted information. (Next diff will draw UIs for this).

Follow-up:
- Will add one detail view to show all valuable information about a network request, after user clicks on one item in the ListView.
- Add more tabs in the detail view, ideally looking like the chrome network panel.

Reviewed By: davidaurelio

Differential Revision: D3598900

fbshipit-source-id: 5ec9ade6d13e3a9110db105fafbc7ba52adc515d
2016-07-27 12:28:32 -07:00
Siqi Liu f20d5ed67f Intercept XMLHttpRequest network operations and gather their information in inspector tool
Summary:
This diff
- creates `XHRInterceptor` to intercept all XMLHttpRequest network operations in React Native by monkey-patching.
- enables `XHRInterceptor` in RN development tool "inspector".

This interception and inspector tool work well on both Android and iOS. And this supports interception on any network API based on XMLHttpRequest, especially the Fetch API.

By now, we can intercept 12 information fields of a XMLHttpRequest including method, url, data sent, status, response type, response size, requestHeaders, responseHeaders, response, responseURL, responseType and timeout.

Follow-up:
- Will add UIs in the inspector on top of this diff, to display all the network operation information. (Not in this diff just to make this shorter)
- Will extend this to gather other valuable information towards one XMLHttpRequest.
- Should support other network request APIs like WebSocket.

Reviewed By: davidaurelio

Differential Revision: D3598873

fbshipit-source-id: 3221050ab2ebd876a718fc326646c344d0944a5f
2016-07-27 12:28:32 -07:00
Neo 28cf179171 fix broken link
Summary:
The link to `'ShadowPropTypesIOS'` in `View` and `Image` docs is broken since RN0.29
Closes https://github.com/facebook/react-native/pull/8814

Differential Revision: D3628978

Pulled By: lacker

fbshipit-source-id: b233e191d1e1e0731cd5b2fe33287d68aa12e041
2016-07-27 11:28:27 -07:00
Mengjue Wang 5b4fb89e4c Fix UNSET problem for text alignment change
Summary: Use UNSET(-1) as default will lead wrong calculation for text alignment. Change it to Gravity.NO_GRAVITY to fix this problem.

Reviewed By: fkgozali

Differential Revision: D3624417

fbshipit-source-id: c116560e64600be60b2fe719f575701b00f20a97
2016-07-27 10:28:37 -07:00
Nathan Azaria ffb690f072 Fix RCTImageLoader's priority
Summary:
There is a conflict between RCTImageLoader and RCTAssetsLibraryRequestHandler on handling images, which was caused by making RCTPhotoLibraryImageLoader able to handle assets library requests as well. This gives more priority to RCTImageLoader instead.
Fixes #9031.

Reviewed By: mmmulani

Differential Revision: D3627451

fbshipit-source-id: 7ffd2c66f43ce1479c9a117768fb2d29f9d0dc08
2016-07-27 06:13:20 -07:00
Rob Hogan c3e8c825af Open to correct line on Webstorm, IntelliJ and AppCode
Summary:
A tiny PR to add support for launching IDEA editors with the cursor at the correct line. The argument syntax is the same as sublime.

The base names `wstorm`, `idea` and `appcode` are the default names when CLI launchers are created through 'Tools'->'Create Command-Line launcher' in the respective editor's gui.

Tested through a fork of RN on Webstorm, IntelliJ and AppCode for OSX and by manual invocation from CLI on IntelliJ for windows.
Closes https://github.com/facebook/react-native/pull/9042

Differential Revision: D3627680

fbshipit-source-id: dfb0db92f9ca8b464471c3dc9e92196d87d2e244
2016-07-27 04:43:47 -07:00
cpojer d374ce76b9 Update test guide to refer to the Jest React-Native tutorial
Summary:
[Jest 14.0](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html) is out and compatibility with react-native has greatly improved. Let's update the docs to reflect this :)
Closes https://github.com/facebook/react-native/pull/9041

Differential Revision: D3627580

Pulled By: davidaurelio

fbshipit-source-id: 427c424b55e6bf14ebb8c2a119a92d13d79a532e
2016-07-27 03:43:32 -07:00
sunnylqm b5ecc8da18 fix broken link
Summary: Closes https://github.com/facebook/react-native/pull/9033

Differential Revision: D3626602

fbshipit-source-id: 2a452fb36910f960e992d32bda58c40dad309b6a
2016-07-26 21:43:46 -07:00
Mengjue Wang 8c0a045c0d Connect the OS setting with isRTL
Summary: Provide two function in I18nUtil to get the device and app current using language. And Set isRTL with both allowRTL and current app using language.

Reviewed By: fkgozali

Differential Revision: D3603412

fbshipit-source-id: 6bb280d56af9a12901148df9fab368366073680f
2016-07-26 14:43:49 -07:00
Mengjue Wang 54a4450309 Change the textalign setter to support RTL
Summary: Change the textalign setter to support RTL. In order to support text alignment according to layout style, move the textalign setter bridge function from ReactTextViewManager.java to ReactTextShadowNode.java and calculate it correctly on RCTTextUpdate.

Reviewed By: dmmiller

Differential Revision: D3597494

fbshipit-source-id: e5ca17b99b4233cc49a447a34175473e339ff53d
2016-07-26 12:13:33 -07:00
James Ide ee89ffcb17 Create a CSSLayout subspec that preserves the header directories
Summary:
RN imports CSSLayout files like so: `#import <CSSLayout/CSSLayout.h>`, so we need to tell CocoaPods to preserve the directory structure for CSSLayout files. This is done with the header_mappings_dir, but we want it to apply just to CSSLayout's files, hence the subspec.
Closes https://github.com/facebook/react-native/pull/9015

Differential Revision: D3621727

fbshipit-source-id: fb3603a0820ca3d6502813204ff215cf160b1955
2016-07-26 11:58:52 -07:00
Chris Nager 481e1c77a0 Update keyboard input element from `span` to `kbd`
Summary:
Updated the keyboard input element on the browser debugger page that contains "⌘⌥J" from a `span` to the more semantic `kbd`.
Closes https://github.com/facebook/react-native/pull/8998

Differential Revision: D3620668

fbshipit-source-id: ab3081688202c85978f6f400a42eb1aa1abb77c6
2016-07-26 10:13:45 -07:00
Michał Gregorczyk 73a64ed2eb Do not set forceProfilerBytecodeGeneration option
Reviewed By: bnham

Differential Revision: D3598103

fbshipit-source-id: 3bd7069379cd38bd86c13a87487f546044f66902
2016-07-26 07:28:41 -07:00
David Aurelio fe8eca43ac Debounce progress updates
Summary: This shows at max 5 progress updates per second on the terminal, which results in a minor speedup of reloads.

Reviewed By: bestander

Differential Revision: D3620164

fbshipit-source-id: d1a30f2f29f7088602d276b8ad3fc8ff1b74c79d
2016-07-26 07:28:41 -07:00
Ben Alpert a2fb703bbb Convert from React.createClass to ES6 classes
Reviewed By: cpojer

Differential Revision: D3619143

fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
2016-07-26 01:13:31 -07:00
Sokovikov 857d2b8eae change lineBreakMode to ellipsizeMode
Summary:
lineBreakMode only in rc so I think we can replace property without any deprecation warnings. satya164
Closes https://github.com/facebook/react-native/pull/9008

Differential Revision: D3614901

fbshipit-source-id: 724227c0a89192825a24850b930b80884571a51f
2016-07-25 13:13:35 -07:00
Chris Hopman d67258eb91 Move some really old tests to the cxx bridge
Reviewed By: mhorowitz

Differential Revision: D3507905

fbshipit-source-id: cbe55495a991bf6eef961319ba8b219e660dce05
2016-07-25 12:29:25 -07:00
ahanriat c658cc545f Fix navigation card stack pan responder
Summary:
Hi folks !
🔧 Fix the navigation card stack pan responder when the `vertical` direction is enabled.

**Issue:**
When using a `ScrollView` with the `vertical` direction enabled, the pan handler catch the gesture before the `ScrollView`.

I don't know why there was no default value here for `RESPOND_POSITION_MAX_VERTICAL` 5162eb3254
ericvicenti could you tell me what you think about setting a default value for `RESPOND_POSITION_MAX_VERTICAL` ? 😃

Thanks !!

**EDIT June 15, 2016**
I'll update this PR this week end to provide a way to give custom values as there is no magic value for `RESPOND_POSITION_MAX_VERTICAL`

**EDIT June 24, 2016**
I've added a props `gestureResponseDistance` to control both the `RESPOND_POSITION_MAX_VERTICAL` and `RESPOND_POSITION_MAX_HORIZONTAL`
Closes https://github.com/facebook/react-native/pull/8076

Differential Revision: D3605973

Pulled By: ericvicenti

fbshipit-source-id: 158d88cf8ebbab742bf0b38c217ae502e9dd1963
2016-07-25 11:58:44 -07:00
Yann Pringault 1234d27478 Uniformize links in LayoutPropTypes docs
Summary:
The links was a mix of W3Schools, CSS-Tricks and MDN.

Everything is now a MDN link now. [Why?](http://www.w3fools.com/)
Closes https://github.com/facebook/react-native/pull/9005

Differential Revision: D3613520

fbshipit-source-id: 86585613a822a9027f42b61ac5d0abb7c351fa80
2016-07-25 09:43:34 -07:00
SangYeob Bono Yu d06bea4962 Add dep for android local unit tests
Summary:
`./scripts/run-android-local-unit-tests.sh` raise error
```
05: error: cannot access com.facebook.react.bridge.CatalystInstance
    verify(mCatalystInstanceImpl).loadScriptFromOptimizedBundle(
                                 ^
  class file for com.facebook.react.bridge.CatalystInstance not found
```
and this PR fix it.
Closes https://github.com/facebook/react-native/pull/8957

Differential Revision: D3613491

Pulled By: bestander

fbshipit-source-id: 53b52fca13482e6474d7ffec9c19c0e7d6e4d100
2016-07-25 09:13:38 -07:00
StevenChung d15d6d7ce0 Update NavigatorIOS.ios.js
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

(You can skip this if you're fixing a typo or adding an app to the Showcase.)

Explain the **motivation** for making this change. What existing problem does the pull request solve?

I'm new to React-Native and noticed a broken link in the documentation.  It's just a quick fix.

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Mat
Closes https://github.com/facebook/react-native/pull/8982

Differential Revision: D3612982

fbshipit-source-id: 2996730e51ae7a243697f305cd2ed2eb0d2985a8
2016-07-25 04:43:37 -07:00
Emil Sjolander 471eefcb74 Move dirty layout into css-layout
Reviewed By: majak

Differential Revision: D3610634

fbshipit-source-id: 1dc9017c0a34ced231b5bebe334591f3d0b89bf3
2016-07-25 03:58:41 -07:00
SangYeob Bono Yu 3b35732800 Add Share module
Summary:
revision of https://github.com/facebook/react-native/pull/5476

It has only one method `shareTextContent` and next will be`shareBinaryContent`.

In Android, Promise can't receive a result, because `startActivityForResult` is not working with `Intent.ACTION_SEND`. Maybe we can use `createChooser(Intent target, CharSequence title, IntentSender sender)` which requires API level 22.
Closes https://github.com/facebook/react-native/pull/5904

Differential Revision: D3612889

fbshipit-source-id: 0e7aaf34b076a99089cc76bd649e6da067d9a760
2016-07-25 03:43:29 -07:00
ASCE1885 c21d3a1029 fix NullPointerException Caused by manageChildren
Summary: Closes https://github.com/facebook/react-native/pull/8991

Differential Revision: D3612777

Pulled By: dmmiller

fbshipit-source-id: d8da5ef8354cdaf55d8a3efbc2bfbc2aef74a044
2016-07-25 02:28:32 -07:00
GevaZeichner feb2825757 A fix for npmlog error
Summary:
Added a fix to the GettingStarted guide, for when npmlog module isn't found.
Solution copied from: https://github.com/tj/n/issues/101#issuecomment-40827196
Closes https://github.com/facebook/react-native/pull/8994

Differential Revision: D3612345

Pulled By: JoelMarcey

fbshipit-source-id: 10e7381adc530bb97c795cae022da3525745122a
2016-07-24 18:43:27 -07:00
Grey Vugrin 143b6493b0 Add AppRegistry to imports in example
Summary:
Missing import throws variable error
Closes https://github.com/facebook/react-native/pull/8988

Differential Revision: D3611142

fbshipit-source-id: b50edf52cdf6c723abaa7bd021cf11ee5b4d874d
2016-07-23 16:43:27 -07:00
Wenjing Wang 15dfa5b224 Reverted commit D3598946
Reviewed By: majak

Differential Revision: D3598946

fbshipit-source-id: fb70f5b031a85f30a6207eb95b7fd0ccd7d78039
2016-07-23 01:28:31 -07:00