Commit Graph

12066 Commits

Author SHA1 Message Date
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
Marc Horowitz 1cc7ae2ae1 FBASSERT -> FBJNI_ASSERT, ALOGE -> FBJNI_LOGE, ALOGF -> FBJNI_LOGF
Reviewed By: BurntBrunch

Differential Revision: D5609686

fbshipit-source-id: 3ac863abe8555e768df1625e414f09b35d49853d
2017-08-16 17:57:51 -07:00
Jaych Su 9e71b6065f Make prospective syntax compatible
Summary:
Can't run `RNTester` app and got the error below:

![image](https://user-images.githubusercontent.com/6890034/29361000-1ae6cfce-82b8-11e7-9522-b827de2712f7.png)

Make prospective syntax(trailing commas in function parameter lists and calls, supported in ES8) compatible.

If correct, the `RNTester` can be started.
Closes https://github.com/facebook/react-native/pull/15510

Differential Revision: D5644673

Pulled By: TheSavior

fbshipit-source-id: df34638f37b81f04cea5cf7a25fc7405d4321ea6
2017-08-16 16:42:16 -07:00
Nicolas Charpentier f69638b56f Fix Unexpected token ) in babel-preset-react-native
Summary:
Fixes #15513

cc jeanlauliac
Closes https://github.com/facebook/react-native/pull/15517

Differential Revision: D5644626

Pulled By: TheSavior

fbshipit-source-id: f90b35c29a1e7cd5a829ae44237deb050f9a29e2
2017-08-16 16:42:16 -07:00
Sriram Ramasubramanian dc61f10e8b Make ResourceDrawableIdHelper work with resource id
Reviewed By: fkgozali

Differential Revision: D5636657

fbshipit-source-id: 251b8b495655abf83618922b86f710fa38b08317
2017-08-16 15:46:06 -07:00
Phạm Huy Hoàng 9c2a5cdbc3 Update documentation for PermissionsAndroid
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!

-->
Current documentation: [https://facebook.github.io/react-native/docs/permissionsandroid.html](https://facebook.github.io/react-native/docs/permissionsandroid.html)

PermissionsAndroid must be imported for the example to work, otherwise the error "Reference Error: can't find variable PermissionsAndroid" will be shown.
https://stackoverflow.com/questions/42434124/why-permissionandroid-doesnt-work

None - Just documentation changes.
Closes https://github.com/facebook/react-native/pull/15505

Differential Revision: D5643004

Pulled By: TheSavior

fbshipit-source-id: 5ed81fd0120270da9ab180dd3f1cb569544e0520
2017-08-16 15:01:51 -07:00
Jodi Warren da9e51c92d Docs component grid laid out with CSS Grid
Summary:
The component grid on Components and APIs
https://facebook.github.io/react-native/docs/components-and-apis.html
has a set height for each item. This causes content to overflow their
containers.

Before:
![image](https://user-images.githubusercontent.com/1337003/29373309-b67c0dea-82a5-11e7-9850-003d66571df2.png)

After:
![image](https://user-images.githubusercontent.com/1337003/29373337-d32b7214-82a5-11e7-8d12-958be9ff81aa.png)

I've quickly fixed this with CSS Grid. There is much more room for
improvement, but this prevents it being visually broken.

Tested by locally rendering. Jest passes OK.

Run docs website locally. Visually confirm correct rendering.
Closes https://github.com/facebook/react-native/pull/15514

Reviewed By: ericvicenti

Differential Revision: D5641555

Pulled By: TheSavior

fbshipit-source-id: 3b4002e06066c3c052a75ba15a74521e6e1e7d40
2017-08-16 13:02:19 -07:00
Rafael Oleza 6ad7e8281b Do not send 'hot' parameter when requesting a bundle from iOS
Reviewed By: fromcelticpark

Differential Revision: D5631050

fbshipit-source-id: 1f587f3af68da4d94b5d24afabf7659abb697747
2017-08-16 11:10:32 -07:00
Jean Lauliac aaae99e7cd metro-bundler: transform import() to basic require()
Reviewed By: mjesun

Differential Revision: D5631078

fbshipit-source-id: a8d4955a723c1846b9406e734c3e3fa2c0df3fb7
2017-08-16 04:38:16 -07:00
Eric Rozell fedc002c21 Use offset adjusted value in ModulusAnimatedNode
Summary:
Modulus animation computation should use the value adjusted for offset, not the raw value.

See the JS implementation here:
https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/AnimatedImplementation.js#L1338

cc ryangomba
Closes https://github.com/facebook/react-native/pull/15502

Differential Revision: D5638901

Pulled By: shergin

fbshipit-source-id: cbf47bd4082897a969e2e561ec090366884a8349
2017-08-16 00:48:12 -07:00
Eric Rozell d0669fc922 `onAnimatedValueUpdate` should also include offset
Summary:
Native Android implementation of animation listeners reports value only, and does not include offset. For non-native animation, the JavaScript listeners receive the animated node value + the animated node offset. Here's where the JavaScript node calls the listeners:
046f600cc2/Libraries/Animated/src/AnimatedImplementation.js (L942)
 and here's how `__getValue()` is calculated:
 046f600cc2/Libraries/Animated/src/AnimatedImplementation.js (L741-L743)

cc janicduplessis kmagiera
Closes https://github.com/facebook/react-native/pull/15500

Differential Revision: D5638336

Pulled By: shergin

fbshipit-source-id: d2104fdb483d9db3b856d625d021cceaa9232787
2017-08-15 22:05:15 -07:00
Rafael Oleza c2b3ee789c Do not send 'hot' parameter when requesting a bundle from Android
Summary:
Since the `hot` parameter is not used anymore in metro-bundler (we are always applying the HMR transforms for bundlers requested through the HTTP server), we can remove it from the client request URL.

This allows us to reduce the metro-bundler memory by half when switching between HMR and not-HMR, since metro caches the bundles based on the requested URL path.

Reviewed By: davidaurelio

Differential Revision: D5630051

fbshipit-source-id: fb5dce4c31bbb38b1c0c93c97a525a992b2f6d8d
2017-08-15 18:50:29 -07:00
Valentin Shergin eb01f8fe59 Revert D4449255: [react-native][PR] Fixed ART Surface initialization: do not cancel updates to the surfce, make them pen…
Differential Revision: D4449255

fbshipit-source-id: e210cebfde25c6cd68a1fb7e1dceeefad890cf93
2017-08-15 17:11:46 -07:00
Valentin Shergin a7468a4acf Introducing smart `RCTUnsafeExecuteOnMainQueueOnceSync()` and fixed `RCTScreenScale()`
Summary:
(This diff was decoupled from D4983054 which landing was quite delayed.)

`RCTUnsafeExecuteOnMainQueueOnceSync()` synchronously executes a block once, on main queue.
I found that our old implementation of `RCTScreenScale()` causes deadlock when it is called from main and background thread simultaneously.
After I implemented my own solution I googled this issue and found an article by Ben Alpert with this awesome helper:
https://benalpert.com/2014/04/02/dispatch-once-initialization-on-the-main-thread.html
So, I found it super useful and borrowed it.

Hey spicyj! :)

Reviewed By: fkgozali

Differential Revision: D5632592

fbshipit-source-id: dff43a5780b7404a3cc109c66c131cef4f4df429
2017-08-15 14:25:23 -07:00
Slava Kim 274f10feb4 Expose "register devtools plugin" interface globally in React-Native
Reviewed By: fkgozali

Differential Revision: D5627664

fbshipit-source-id: 3ed165762ed179005a48b2bf6dc67013dda47f47
2017-08-15 12:03:40 -07:00
Adam Comella 7e11bad86f Android: Improve getCurrentPosition API
Summary:
We ran into a couple of problems with the implementation of `getCurrentPosition` on Android:
  - It sometimes returns an inaccurate location
  - It times out when `enableHighAccuracy` is `true` (#7495)

This change improves `getCurrentPosition` for both of the above problems. Instead of calling `requestSingleUpdate` it now calls `requestLocationUpdates` so it can receive multiple locations giving it an opportunity to pick a better one. Unlike `requestSingleUpdate`, this approach doesn't seem to timeout when `enableHighAccuracy` is `true`.

**Test plan (required)**

Verified in a test app that `getCurrentPosition` returns a good location and doesn't timeout when `enableHighAccuracy` is `true`. Also, my team has been using this change in our app in production.

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

Differential Revision: D5632100

Pulled By: hramos

fbshipit-source-id: 86e40b01d941a13820cb775bccad7e19dba3d692
2017-08-15 12:03:40 -07:00
Nivetha Singara Vadivelu 400020215f Fetching video length
Reviewed By: furdei

Differential Revision: D5596545

fbshipit-source-id: ae29bc27579f2d06b1281e677c1aa820d50d9ee2
2017-08-15 11:41:27 -07:00
Nivetha Singara Vadivelu 25f2938344 Getting correct video width and height metrics
Reviewed By: furdei

Differential Revision: D5594591

fbshipit-source-id: 73c3df227763bed3fc85f6aee60af5332cd09c55
2017-08-15 11:41:24 -07:00
David Vacca 6f60f2bf67 Expose StatusBar height and fix StatusBar example - T13591448
Reviewed By: achen1

Differential Revision: D5624514

fbshipit-source-id: edc1ebe9758bd6a67e79a60128553414fb1424d3
2017-08-15 11:11:39 -07:00
Kevin Gozali 66da0d27da move the ReactNativeFeatureFlags outside of sync dir
Reviewed By: bvaughn

Differential Revision: D5627037

fbshipit-source-id: 0544b822ba03090a74695911b6951e91262478a0
2017-08-15 10:48:43 -07:00
Ben Nham 091878a61a fix content appeared logging
Reviewed By: AaaChiuuu

Differential Revision: D5630723

fbshipit-source-id: 3791537afdb7ca4992c2562577466c2ef5baafce
2017-08-15 10:48:43 -07:00