Граф коммитов

11586 Коммитов

Автор SHA1 Сообщение Дата
Ivan Ha e6ff0dacd5 fix and enrich Vibration docs
Summary:
The docs for [Vibration](https://facebook.github.io/react-native/docs/vibration.html) is broken and not informative now. Making people difficult to understand the usage without digging into the source code.

![screen shot 2017-08-23 at 12 44 50](https://user-images.githubusercontent.com/20895743/29599382-da4976b6-8801-11e7-96d2-b342f0bf36fb.jpg)

Tested the page locally.

![fireshot capture 4 - vibration - http___localhost_8079_react-native_docs_vibration html vibrate](https://user-images.githubusercontent.com/20895743/29599338-976816e0-8801-11e7-8f53-a228363353f3.png)
Closes https://github.com/facebook/react-native/pull/15614

Differential Revision: D5691254

Pulled By: hramos

fbshipit-source-id: b84f0d0f9c69bd0983fbc32424c521108640fdd4
2017-08-23 20:45:45 -07:00
Alin Panaitiu 28c1c88ef7 Adjust row height by font size in PickerIOS
Summary:
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

There is a problem where setting a bigger fontSize in PickerItem style
clips the top and bottom of the text.
This solves that problem by computing the row height using the font
size.

Create a PickerIOS component and set a larger font size (e.g. 50). The row height will grow accordingly.

Example with `fontSize=50`: [Screenshot](http://i.imgur.com/YwK5fOc.png)
Closes https://github.com/facebook/react-native/pull/13513

Differential Revision: D5692124

Pulled By: shergin

fbshipit-source-id: 4629403e37ad68cdbc0b17b48ba924a77e133078
2017-08-23 20:30:10 -07:00
Peter Ruibal 22d283b3c5 Update flow-bin in package.json to ^0.53.0 (to match .flowconfig)
Reviewed By: calebmer

Differential Revision: D5692975

fbshipit-source-id: 6a6fdf9d499e0baaab47aea2d3b435698ec80d5c
2017-08-23 16:15:04 -07:00
Spencer Ahrens 68664ac106 Fix stylesheet registery
Reviewed By: fkgozali

Differential Revision: D5685564

fbshipit-source-id: 0946223108041575b16f05abff4a90867c6323f2
2017-08-23 08:54:39 -07:00
Matt Oakes 2172bb4acb Revert "Add a new babel transformer for inlining regenerator-runtime per file"
Summary:
This reverts commit e7c1cf5b7d.

Fixes #14838.

Test using the steps in #14838.
Closes https://github.com/facebook/react-native/pull/15584

Reviewed By: jeanlauliac

Differential Revision: D5670640

Pulled By: mjesun

fbshipit-source-id: e7c4c4cfdd0d3142561847aefb35b8a8b33e5ffa
2017-08-23 08:06:11 -07:00
Rafael Oleza dc792690bd Add @providesModule annotation to Animated files
Reviewed By: mjesun

Differential Revision: D5687435

fbshipit-source-id: 515512167bc9f579a944b45de9e6427da39c9f0d
2017-08-23 03:55:19 -07:00
Lukas Wöhrl 95faccb13c Fix const declaration mismatch and double/float mix
Summary:
This PR fixes a declaration mismatch for `YGNodeCanUseCachedMeasurement` where the last argument is declared non `const` in `.h` and `const` in `.c`.

Additionally it uses explicit `float` for fraction calculation do avoid usage of `double` assignment.
Closes https://github.com/facebook/yoga/pull/607

Differential Revision: D5677931

Pulled By: emilsjolander

fbshipit-source-id: 502da957089e4439ed956987ff8dec10bd033ba3
2017-08-23 02:45:30 -07:00
Sreejith Krishnan R 9c2caaac3e Expose method to set custom baseline function
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I was trying to typeset mathematical equations in react native. When typesetting fractions, baseline of the fraction must be aligned with the baseline of others. The baseline of fraction will vary based on size of numerator and denominator.

![image](https://user-images.githubusercontent.com/31202232/29577330-a22b45ee-8788-11e7-9cc5-04a72bcc1180.png)

 In yoga, we can set custom baseline function using `YogaNode.setBaselineFunction` method. If this method is exposed in `ReactShadowNode` class, it will be easy to create custom native UI modules which requires setting custom baseline.
Closes https://github.com/facebook/react-native/pull/15605

Differential Revision: D5686876

Pulled By: shergin

fbshipit-source-id: 34d797a7ea27d5c1b9f6b9c36e469cdca3883aec
2017-08-23 02:36:17 -07:00
Vladimir Kotikov ad4aee7519 Return meaningful error when no devices available
Summary:
`react-native run-ios --device` should report 'No iOS devices connected.' in case when no devices attached. However due to logic bug when empty array is being treatened as a boolean value, cli reports odd message, saying `Could not find device with the name: "true".`

Disconnect all iOS devices from developer machine and run `react-native run-ios --device` in any project - console message should state that there are no devices available.
Closes https://github.com/facebook/react-native/pull/15603

Differential Revision: D5686891

Pulled By: shergin

fbshipit-source-id: 289461b6f920691ad39e940ecca6d85cf2a3573b
2017-08-22 23:50:55 -07:00
Gabriel Bull 743dc20aac Fixed issue with path containing spaces
Summary:
If the project is in a folder with a path containing a space, the project won't build. This fixes this issue.
Closes https://github.com/facebook/react-native/pull/15608

Differential Revision: D5686861

Pulled By: shergin

fbshipit-source-id: 74ce5b4f0261c18070c1a48966aae24f1ca75492
2017-08-22 23:30:06 -07:00
Janic Duplessis 5590b1b5ad Split up AnimatedImplementation.js
Summary:
AnimatedImplementation.js is getting pretty hard to navigate and reason about so I split it up into different modules. Also took the opportunity to run prettier on that code and do some minor const/let refactorings. This doesn't change any logic, mostly just moves code around and add proper imports / exports.

This opens the door for further cleanup and flow type improvements but want to keep this already big PR as small as possible.

Discussion points:
- Should I use haste for this? Animated is pretty much a standalone module, it still uses a few haste imports but for new modules I used commonjs imports to avoid polluting the haste global namespace too much. The new modules are all internal to Animated and should not be imported externally.
- We're using `requestAnimationFrame` from fbjs instead of the one available globally in RN and browsers is there a reason for that?
- Should we even support web in this implementation? There is a standalone repo that exist for Animated web. Is this implementation of Animated web used internally at facebook?
- Probably still related to web, we used some weird Set polyfill is that still needed?

Notes:
There is a small regression for docs where the type of some classes that are exported like AnimatedValue show up as CallExpression instead if Class.

<img width="655" alt="screen shot 2017-08-14 at 3 19 18 am" src="https://user-images.githubusercontent.com/2677334/29261820-8f243036-809f-11e7-8bf0-0fe9f93939ca.png">

**Test plan**
Tested that all Animated related examples still work in RNTester on iOS and Android.
Tested that the doc is still working
Ran unit tests
Closes https://github.com/facebook/react-native/pull/15485

Differential Revision: D5679886

Pulled By: sahrens

fbshipit-source-id: d3e9b6987ab5ff2cd20108c3b9d860c7536be8a0
2017-08-22 18:01:20 -07:00
Valentin Shergin 950c2b2a73 ScrollView: `contentOffset` validatation now respects `contentInset`
Summary:
> The property contentInset can change the maximum and minimum values of the content offset to allow scrolling outside of the scrollable area. Its type is UIEdgeInsets, which consists of 4 numbers: {top, left, bottom, right}. When you introduce an inset, you change the range of the content offset. For example, setting the content inset to have a value of 10 for its top value allows the content offset’s y value to reach -10. This introduces padding around the scrollable area.
( https://www.objc.io/issues/3-views/scroll-view/ )

See also: https://github.com/facebook/react-native/pull/15395

Reviewed By: mmmulani

Differential Revision: D5607192

fbshipit-source-id: 1acd6a84e2bcfefc6e82861cfbdfe6247d0e4264
2017-08-22 16:41:55 -07:00
Scott Wolchok f0f25c57ca Make gYGNodeDefaults const
Reviewed By: emilsjolander

Differential Revision: D5675518

fbshipit-source-id: 72a6e208263dde0b6bb46a78fedb2796d0e0a600
2017-08-22 12:00:42 -07:00
Jean Lauliac 0a4085b77c RN local-cli: format and @flow filterPlatformAssetScales
Summary: Preparation before using that from elsewhere that's already typed.

Reviewed By: cpojer

Differential Revision: D5678616

fbshipit-source-id: 01ef6e688241e07ae9ce6aba27c6d4980f6a688b
2017-08-22 09:29:14 -07:00
Alexey Lang 4aae843ebb Report perf counters always when we call flushPendingBatches()
Reviewed By: AaaChiuuu

Differential Revision: D5678088

fbshipit-source-id: 35d909a432ece9539bd48e0bf4ddb14d5953a096
2017-08-22 08:44:45 -07:00
Jean Lauliac e0634531d8 react-native: release new babel-preset version
Summary:
The `3.0.0` contained syntax errors for older versions of Node.

See also https://github.com/facebook/react-native/issues/15496

Reviewed By: cpojer

Differential Revision: D5677965

fbshipit-source-id: cae07fdce7e887c6fb1d6087791db8307f6f72f3
2017-08-22 06:47:49 -07:00
Kathy Gray f0d98104ae Reduce possible race condition on gc of catalyst instance
Reviewed By: cwdick

Differential Revision: D5669579

fbshipit-source-id: 165e19b68199e89bb99f7f93f2b1ec70729b2848
2017-08-22 03:30:22 -07:00
Naman Goel 5cdf5f3910 Use proper script way to clone Emoji files from www
Differential Revision: D5615872

fbshipit-source-id: 7f2c19f1a65f42b78136be7e6a608d0415c1a49f
2017-08-21 16:29:39 -07:00
Andrew Y. Chen c3b47e5523 Remove appcompat dep from react/views/toolbar
Reviewed By: AaaChiuuu

Differential Revision: D5651764

fbshipit-source-id: c8cf730bf2086d205a43a535f3f12ae2af0caa5f
2017-08-21 15:15:10 -07:00
Michał Gregorczyk 73f17908e6 Make JavaScriptExecutor.Factory a configurable property of ReactInstanceManager
Reviewed By: mhorowitz

Differential Revision: D5662431

fbshipit-source-id: 17dca2744de645740cef252efbf83902acde5046
2017-08-21 13:42:34 -07:00
Michał Gregorczyk 606a876df7 Kill JSCConfig
Reviewed By: mhorowitz

Differential Revision: D5662181

fbshipit-source-id: 71a4d6cf4eb34030d4f86e96e8bc6f8e8efe5fdd
2017-08-21 13:42:34 -07:00
Emil Sjolander 67c160cc6c BREAKING: Change aspect ratio behavior
Summary:
== Before ==
- Aspect ratio would do its best to fit within it's parent constraints
- Aspect ratio would prioritize `alignItems: stretch` over other sizing properties.

== After ==
- Aspect ratio is allowed to make a node grow past its parent constraints. This matches many other aspects of flexbox where parent constraints are not treated as hard constraints but rather as suggestions.
- Aspect ratio only takes `alignItems: stretch` into account if no other size definition is defined. This matches the interaction of other properties with `alignItems: stretch`.

== Updating your code ==

**You probably don't need to do anything** but in case something does break in your product it should be as easy as  adding `{width: '100%', height: '100%', flexShrink: 1}` to the style declaring the `aspectRatio`.

Reviewed By: gkassabli

Differential Revision: D5639187

fbshipit-source-id: 603e8fcc3373f0b7f2461da2dad1625ab59dcb19
2017-08-21 03:14:42 -07:00
Alexey Lang 992777b765 Pass minTimeLeftInFrameForNonBatchedOperationMs from above
Reviewed By: AaaChiuuu

Differential Revision: D5658066

fbshipit-source-id: f89a8bcfc180210f7361b03f718f65b1d59cbf85
2017-08-20 17:30:38 -07:00
S.M.A. Javadi a777517651 Update GettingStarted.md
Summary:
fix a typo on linux keyboark ( Use `ctrl` instead of `command` )
Closes https://github.com/facebook/react-native/pull/15565

Differential Revision: D5666988

Pulled By: TheSavior

fbshipit-source-id: 3e796f4e155c6c76ce1b7c0f2b473a8f64e1d0bd
2017-08-19 15:17:43 -07:00
Alexander Mykolaichuk db225c1e39 Fix button spacing and layout on small screens
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Fix buttons issue in small screens

Before:

![image](https://user-images.githubusercontent.com/3904240/29141530-3b5697a0-7d57-11e7-964a-049fb3568bf2.png)

After:

![image](https://user-images.githubusercontent.com/3904240/29141557-67c2780e-7d57-11e7-8e25-c3a8a3f39bc6.png)
Closes https://github.com/facebook/react-native/pull/15437

Differential Revision: D5666978

Pulled By: TheSavior

fbshipit-source-id: 8f2521f4aa5b788f1e6d2743beadb4ac7c2b37cf
2017-08-19 14:59:41 -07:00
Adam Comella ffbd3db61b Android WebView: Only fire onLoadStart for toplevel page loads
Summary:
Currently, `onLoadStart` fires for a couple of cases:
  1. toplevel page loads (e.g. initial page load, clicking links)
  2. loading of pages within an iframe

The fact that `onLoadStart` fires for case (2) causes some problems. For example, it makes it difficult for the code that uses the WebView to know what URL the WebView is currently rendering. This is because the listener can't distinguish between the toplevel URL and the URL of an iframe. Additionally, this behavior is inconsistent with the behavior on iOS. On iOS, `onLoadStart` only fires for toplevel page loads.

To fix these issues, this change deletes the `doUpdateVisitedHistory` handler so that `onLoadStart` only fires for case (1).

**Test Plan**

Created a test page that has an iframe and loaded it in the WebView. Verified that `onLoadStart` only fires for toplevel page loads.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/15554

Differential Revision: D5665979

Pulled By: hramos

fbshipit-source-id: a52e473bc5691a6e180f45f0728e4ad89a7d354f
2017-08-19 00:59:51 -07:00
Héctor Ramos 62a4912076 Add Skype to showcase
Summary:
Adds Skype to pinned list of apps.
Moved QQ out of pinned apps to ensure only 8 apps are displayed in the homepage.
Alphabetized unpinned entries.

cd website && npm start
open localhost, verify showcase renders as expected

![screencapture-localhost-8079-react-native-1503089259093](https://user-images.githubusercontent.com/165856/29477236-6f3a235e-841c-11e7-9a68-80772676062b.png)
Closes https://github.com/facebook/react-native/pull/15557

Differential Revision: D5665000

Pulled By: hramos

fbshipit-source-id: 03583fbf775b050b57bc75bf08e9dc335c882873
2017-08-18 18:45:29 -07:00
Misha Greenberg 9f5bdd7b49 Size height of Android Text component based on includeFontPadding style
Summary:
Overview -

This PR resolves the issue described in #14606. This PR makes Text components take into account the includeFontPadding property when calculating their size.

Background -

Currently, on Android, when includeFontPadding is set to false, the React Text component does not adjust its height. This makes it difficult to lay out other components at a precise spacing relative to a Text component.

iOS calculates the height of a UILabel based on the font's descent + ascent.

Android lets you choose whether to calculate the height of a TextView based on the font's top + bottom (includeFontPadding=true) or ascent + descent (includeFontPadding=false).

In order for a text component to be the same size on iOS and Android (relative to the rest of the layout in points and dips), one should set includeFontPadding=false on Android - but the React Text component needs to take this property into account when sizing itself for this to work.

Please see this stack overflow post for a visual explanation of the difference between a font's ascent/descent and top/bottom - https://stackoverflow.com/questions/27631736/meaning-of-top-ascent-baseline-descent-bottom-and-leading-in-androids-font

Testing -

Please see the attached screenshots to see the height difference of a Text component with this PR when includeFontPadding is true vs false.

The font I am using has an ascent + descent = em-size so that the height of the Text component will be equal to the font-size for a single line of text. This is to clearly show the additional height that includeFontPadding=true adds to the Text component.

For Text components that are styled in the same way,

When includeFontPadding=true, height = ~29.714 dips
When includeFontPadding=false, height= 24 dips

<img width="342" alt="includefontpaddingtrue" src="https://user-images.githubusercontent.com/1437344/27299391-3eec9de0-54fa-11e7-81d5-d0aeb40e8e27.png">

<img width="346" alt="includefontpaddingfalse" src="https://user-images.githubusercontent.com/1437344/27299401-45c95248-54fa-11e7-98d7-17dd152d3cb8.png">
Closes https://github.com/facebook/react-native/pull/14609

Reviewed By: AaaChiuuu

Differential Revision: D5587602

Pulled By: achen1

fbshipit-source-id: 6d2f12ba72ec7462676645519cd27820279278eb
2017-08-18 15:31:01 -07:00
Marc Horowitz f6de2e4a9b Don't assume JS integers are dynamic Ints
Reviewed By: kathryngray

Differential Revision: D5643016

fbshipit-source-id: 2e4e1bce013e16c286745dc2a9aa5ff251f7afdd
2017-08-18 14:45:06 -07:00
Radek Czemerys 2292023a1b Link to main Android NDK website
Summary:
It's probably better to link to main NDK page than downloads section.
Closes https://github.com/facebook/react-native/pull/13764

Differential Revision: D5661133

Pulled By: hramos

fbshipit-source-id: 18a54cada38bb894f2535e26b218818a854d699f
2017-08-18 13:29:31 -07:00
Eric Rozell 809f1e97de Avoid race condition for AppState.currentState
Summary:
When the AppState module is initialized, it subscribes to the `appStateDidChange` event and sends an async native method call to the AppState native module. There is a small race condition window where the native module can read the current app state as `uninitialized` before calling the JavaScript callback, and then be interrupted by the underlying mechanism to trigger the `appStateDidChange` event. If the `appStateDidChange` event is processed before the JavaScript callback, the resulting value of `AppState.currentState` will be invalid.

Fixes Microsoft/react-native-windows#1300

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

I simulated (over-exaggerated) the race condition by injecting "thread sleep" calls in the native method call and the native mechanism for updating the app state.

I then ran the AppStateExample in the RNTester and found that the current app state was set to `uninitialized`, as opposed to the expected value of `active`.

Once I made this JavaScript change, the over-exaggerated race condition no longer resulted in an invalid app state.
Closes https://github.com/facebook/react-native/pull/15499

Differential Revision: D5660620

Pulled By: hramos

fbshipit-source-id: 47c0dca75d37f677191c48f2148a72edd9cdd0e2
2017-08-18 13:14:59 -07:00
Andres Suarez 04c2f55c21 Update to eslint-plugin-react@7.2.1
Reviewed By: davidaurelio

Differential Revision: D5657026

fbshipit-source-id: 2e3f6bc21495e3af45f0e9ee1745cb2809b0fa7c
2017-08-18 09:33:39 -07:00
Adam Comella 2b7cb46ddb iOS: Fix registration for UIContentSizeCategoryDidChangeNotification
Summary:
On an iPhone running iOS 10.3.3, I'm not seeing the UIContentSizeCategoryDidChangeNotification fire when changing the system's font scale setting. Registering for the event on `nil` instead of on the application object fixes the issue.

**Test Plan**

Verified that text in an RN app changes size when you change the system's font scale setting (Settings -> General -> Accessibility -> Larger Text). By default, RN text is supposed to scale with the system setting.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/15522

Differential Revision: D5657449

Pulled By: shergin

fbshipit-source-id: d7a6a730c5cd6eb3833274a1f2029663ad3a7ad2
2017-08-17 23:47:19 -07:00
Ethan Davis 609ee651d6 Remove request dependency from core directory
Summary:
request is an unnecessary dependency of the core package as it is only used in the /website directory as a required primary dependency.

request is only used in the /website directory. Searched entire package with regex.

`/require\(('|")request+\('|"))/gi`

All applicable local tests passed!

![image](https://user-images.githubusercontent.com/14060354/29438186-dade7ba4-8369-11e7-923b-efef0d208e53.png)
Closes https://github.com/facebook/react-native/pull/15539

Differential Revision: D5656298

Pulled By: ericnakagawa

fbshipit-source-id: 4210db7de189ff6aff99a52b5aa92253af4e1c77
2017-08-17 20:00:41 -07:00
Caleb Meredith 90eaeb019b Upgrade fbsource/xplat/js to Flow v0.53.0
Reviewed By: avikchaudhuri

Differential Revision:
D5648819
Ninja: T20988071

fbshipit-source-id: 66e5b6747c79ae66b6eb69d40ede5e982c26174f
2017-08-17 18:45:01 -07:00
Ben Nham 1ce7e4c1e5 add notifications for dev reload
Reviewed By: alexeylang

Differential Revision: D5630472

fbshipit-source-id: 1c44a52fddead361b43551384bbfc73e2d89438f
2017-08-17 17:16:19 -07:00
Eli White 36f2d18b10 Disallow trailing commas in react-native-github
Reviewed By: cpojer

Differential Revision: D5645043

fbshipit-source-id: 7378cc96ce39d3d18da7fba51d48db84cfdfa08f
2017-08-17 16:20:04 -07:00
DracoBlue f95153ed52 Loading-State when reloading Android WebView
Summary:
This commit enables state WebViewState before triggering reload on WebView. This will (if defined) trigger the loading screen again.

On iOS the LoadingIndicator will be called whenever you reload the WebView. On Android this feature is missing (see #11013). This PR adds this behaviour.

Important: One might think that "onLoadStart" is the right area to add this code, but on Android onLoadStart will also trigger for sub-resources -> the loading screen will also appear when loading iframes on the same page. I expect thats why this was not added in first place.

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes https://github.com/facebook/react-native/pull/15538

Differential Revision: D5653257

Pulled By: hramos

fbshipit-source-id: 908b82ddaf2c34048bcb833bc07e03ab68d09467
2017-08-17 15:48:07 -07:00
Douglas Lowder 0d3039f1a0 Fix for Modal behavior when menu button pressed on Apple TV (Issue #15313)
Summary:
**Motivation**

On Apple TV, pressing the menu button destroys the native view that backs the `Modal` component, causing an app using this component to get into a broken state.  This fix implements `onRequestClose` for tvOS to have the same behavior as it does for the Android back button.

**Test plan**

Manually tested this with the `ModalExample` in the `RNTester` app.  See also the test code in issue #15313.
Closes https://github.com/facebook/react-native/pull/15341

Differential Revision: D5651035

Pulled By: shergin

fbshipit-source-id: 54bf66887bbe85940567e63e90b437ac4a8daf9a
2017-08-17 15:22:12 -07:00
Paco Estevez Garcia 14e67a379b Fix dev support calls made without an ifdef guard
Reviewed By: danzimm

Differential Revision: D5650480

fbshipit-source-id: d21e76f2bf5bb239a7f21d9d507f054b276568e8
2017-08-17 12:32:06 -07:00
Ben Nham 904e77a753 fix content appeared logging pt2
Reviewed By: AaaChiuuu

Differential Revision: D5639795

fbshipit-source-id: 8febaf7586df629f1a197896a2b8d0ebdf850444
2017-08-17 10:07:18 -07:00
Alexey Lang caaf7fd417 Add more perf counters
Reviewed By: AaaChiuuu

Differential Revision: D5624307

fbshipit-source-id: a7fd744b7a1989f35efe99d7471337a411870934
2017-08-17 08:00:28 -07:00
Kathy Gray 3c12faf01c Restore correct placement of PRE_RUN_JS_BUNDLE_START
Reviewed By: alexeylang

Differential Revision: D5640104

fbshipit-source-id: f0709f16874cca5147fdfc539727ec4225ca539b
2017-08-17 06:16:12 -07:00
Ben Nham c080fe54d6 add perf markers for reload and download
Reviewed By: alexeylang

Differential Revision: D5633613

fbshipit-source-id: 1fe39669cf4ba4e1475bb57de59c696771ebf8c7
2017-08-17 05:44:27 -07:00
Caleb Meredith 30d9c3d279 Add suppressions for Flow v0.53.0 before React changes
Reviewed By: avikchaudhuri

Differential Revision: D5648801

fbshipit-source-id: c4eb1bee198a177b69b6e9414111ce957b4d27ff
2017-08-17 05:18:33 -07:00
Tomas Reimers bb98fddbec Add documentation on .focus and .blur
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

(Write your motivation here.)

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes https://github.com/facebook/react-native/pull/15515

Differential Revision: D5648285

Pulled By: hramos

fbshipit-source-id: fc1e50ffd18cc234771c5f40f92549e7e87cd28e
2017-08-17 00:16:43 -07:00
Petr Bela cdf1b0e5d5 Note about flex
Summary:
Hopefully, this will save an hour of WTFs for the next reader.
Closes https://github.com/facebook/react-native/pull/14876

Differential Revision: D5385881

Pulled By: hramos

fbshipit-source-id: 56961e8a5eb3b6fae4f92c7fb9fea1e1147a3521
2017-08-16 23:44:50 -07:00
Héctor Ramos 2c076cdbdf Flag large pull requests, add large-pr command
Summary:
We sometimes get large PRs that sit for a long time without being reviewed. In some cases, the PR touches too many files or lines, and the author would benefit from splitting the PR into smaller easier-to-review PRs. In this PR, we automatically flag such PRs using the existing Danger PR automation functionality.

This PR achieves the objective by doing the following:

* Add facebook-open-source-bot to `IssueCommands.txt`, allowing it to add labels and close issues/PRs via facebook-github-bot commands.
* Adds a `large-pr` command to facebook-github-bot. This command will add a short blurb, apply a new "Large PR" label, and close the PR.
* Updates the Dangerfile to check for PRs that touch over 600 lines and/or files. In such cases it will warn and then issue the large-pr command.

Additional changes:

* Tag core contributor PRs with the "Core Team" label. This is a slight change in policy, in that the label used to be applied after the fact (after the PR was escalated for review). It's more convenient to monitor labels, so we'll start checking for PRs tagged as such and ensure they get escalated as needed. cc skevy

Thanks to TheSavior for suggesting this change.

Testing against PR #10084 which touches over 600 lines:

```
$ cd danger
$ DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger pr https://github.com/facebook/react-native/pull/10084

> @ danger /Users/hramos/git/react-native/danger
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/10084"

{
  fails: [],
  warnings: [
    {
      message: "📋 Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
    },
    {
      message: " Big PR - <i>This PR is extremely unlikely to get reviewed because it touches 613 lines.</i>"
    }
  ],
  messages: [],
  markdowns: ["facebook-github-bot label Needs more information", "facebook-github-bot large-pr"]
}
```

Result: successfully flagged as being a large PR.
Closes https://github.com/facebook/react-native/pull/15519

Differential Revision: D5647085

Pulled By: hramos

fbshipit-source-id: dfa0f6580b9373085eba856de257a8d2452efbdc
2017-08-16 21:00:44 -07:00
George Jose 381f738107 Updated troubleshooting - changing port section
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x ] Explain the **motivation** for making this change.
- [x ] Provide a **test plan** demonstrating that the code is solid.
- [x ] Match the **code formatting** of the rest of the codebase.
- [x ] Target the `master` branch, NOT a "stable" branch.

The section on changing ports is missing a key step for folks wishing to run on device

What existing problem does the pull request solve?

Changing packager port to something other than 8081 also requires the react native xcode project file to be updated in order to be able to build and run on device. The section on changing ports currently does not address this. See https://github.com/facebook/react-native/issues/10715#issuecomment-258082512.

Documentation update, no tests required.

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

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

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14293

Differential Revision: D5647393

Pulled By: hramos

fbshipit-source-id: 040c3edea7d25c0efe560d5df30e86e1f26355bc
2017-08-16 19:47:20 -07:00
Kevin Gozali 40a2885847 android: allow whitelisting urls to bypass default webview loading
Summary:
This is a workaround for missing PDF url support in Android WebView, which is a general known issue: when tapping a PDF url within WebView, instead of doing nothing, we just let android default intent handle it (e.g. it will open Chrome to load it).

This is basically to trick `shouldOverrideUrlLoading()` to return true for the specific url. The drawback is that product code needs to provide the whitelist.

The proper fix would be to use PdfRenderer in that method, but it seems like it's only for API >= 21...

Differential Revision: D5619383

fbshipit-source-id: f86b930f970dab9a5f57999df69ce94b9508edc9
2017-08-16 19:29:13 -07:00