Commit Graph

9910 Commits

Author SHA1 Message Date
Oleg Lokhvitsky d2796ea4ed Fix cookies not being sent with <Image> network requests
Reviewed By: pvulgaris

Differential Revision: D4669967

fbshipit-source-id: d26da8d3a60f71cf3751eb1c73974b0e57e59bed
2017-03-09 14:03:00 -08:00
Janic Duplessis 231bf7c68b Show bundle loading progress on Android
Summary:
This implements a loading banner like on iOS that shows the progress of the packager.

![](https://media.giphy.com/media/l4FGoepExkpOeXtTO/giphy.gif)

**Test plan**
- Tested that it displays similar messages as it does on iOS and also that is show the right message when waiting for the remote debugger.
- Tested that errors are still shown properly.
- Tested that it works with packagers that don't support multipart response (add && false in https://github.com/facebook/react-native/blob/master/packager/src/Server/MultipartResponse.js#L81).
- Run new unit tests.
- Tested that backgrounding / foregrounding the app hides / show the banner properly.
Closes https://github.com/facebook/react-native/pull/12674

Differential Revision: D4673638

Pulled By: mkonicek

fbshipit-source-id: b2a1163de3d0792cf481d7111231a065f80a9594
2017-03-09 10:45:35 -08:00
Martin Konicek e5ebdd8458 Showcase is now fully managed by OSS team at fb, update comment
Reviewed By: mkonicek

Differential Revision:
D4682340
Ninja: OSS only

fbshipit-source-id: ddeed5d267fd4999e16061c7b847fe163337e283
2017-03-09 10:03:33 -08:00
Jakob Kerkhove a592e5bfa0 Typo documentation ScrollView
Summary:
Typo documentation ScrollView: 'as as alternative' => 'as an alternative'
Closes https://github.com/facebook/react-native/pull/12826

Differential Revision: D4681930

Pulled By: mkonicek

fbshipit-source-id: a10574c659c949359da0be9e6e82f597e9a3eb73
2017-03-09 09:32:02 -08:00
iboxgithub b79a24637a Update Troubleshooting.md
Summary:
Following ericvicenti request on https://github.com/facebook/react-native/issues/10188#issuecomment-282448021
Hope it helps

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.**

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

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. Match the style of the rest of the codebase. See also
Closes https://github.com/facebook/react-native/pull/12578

Differential Revision: D4682076

Pulled By: mkonicek

fbshipit-source-id: 2fab5355a066eb3d8333e50f07ab3a258cbc002b
2017-03-09 09:32:02 -08:00
sunnylqm 0429b6bf8f Update 2016-12-05-easier-upgrades.md
Summary:
> The logic behind react-native-git-upgrade described above is going to power the standard react-native upgrade starting with React Native version 0.40.0.
This means that if you are upgrading from version 0.40.0 or higher, you will be able to simply run react-native upgrade in your project without having to install anything globally.

I hadn't seen any logic related to this description in either practice nor [the source code](https://github.com/facebook/react-native/blob/master/local-cli/upgrade/upgrade.js) . Did I misunderstand anything or the plan has been changed since this blog post? ncuillery
Closes https://github.com/facebook/react-native/pull/12758

Differential Revision: D4681959

Pulled By: mkonicek

fbshipit-source-id: 782d243bd92e51cbfcf83995fdcbb569fcb7bbc1
2017-03-09 09:00:39 -08:00
Dan Abramov a94d14c47c Make a section on keyboard shortcuts more prominent
Summary:
The note is currently in "Reloading JavaScript". However I was struggling with the first step ("Accessing the In-App Developer Menu") so didn't read down to that section.

I think it makes sense to make this the very first thing the reader sees when visiting the page.
Closes https://github.com/facebook/react-native/pull/12828

Differential Revision: D4681842

Pulled By: hramos

fbshipit-source-id: 1afbec7f62a2ec97febdd05987e7fc1541d3ee28
2017-03-09 08:15:45 -08:00
Lukas Wöhrl 9c6da277bc Move pointscalefactor to config
Summary:
This adds some improvements to the new ```YGConfig```, it tackles #452 and moves the scalefactor into the config.
Closes https://github.com/facebook/yoga/pull/457

Differential Revision: D4675088

Pulled By: emilsjolander

fbshipit-source-id: 99b2c734d6c5139fe1dc8bdeb014bb038f0e337d
2017-03-09 07:25:54 -08:00
Douglas Lowder f5585b3d75 ScrollView should not use RefreshControl on tvOS
Summary:
**Motivation**: On tvOS, Flatview and other components that use ScrollView with a RefreshControl will break without this change.

**Test plan**: Manual testing on tvOS simulator.
Closes https://github.com/facebook/react-native/pull/12751

Differential Revision: D4669503

fbshipit-source-id: 320036571788dc0102ec2611492d0fc97bceb53b
2017-03-09 04:45:28 -08:00
Lukas Wöhrl 751addcb73 Take margin into account on max dimension
Summary:
We need to take the margin into account if we clip on max dimension. Fixes #466.
Closes https://github.com/facebook/yoga/pull/467

Differential Revision: D4681342

Pulled By: emilsjolander

fbshipit-source-id: 56311df9864a284d553c31f1c6db382f337f1fad
2017-03-09 04:00:32 -08:00
David Aurelio 21c229119d UIExplorer e2e: fix duplicated exit trap
Summary: I accidentally introduced an exit trap, allthough a cleanup handler already existed. This moves killing of background processes into the existing trap.

Reviewed By: bestander

Differential Revision: D4681289

fbshipit-source-id: f8bcdcac7b246854e3ee024c9335b6c4eb3aacbd
2017-03-09 03:18:11 -08:00
Hector Ramos 8d6776c143 Remove unpublished blog post
Reviewed By: gfosco

Differential Revision: D4679649

fbshipit-source-id: ab363e6dc91cd855c0cd6111c64feda88ea9bba9
2017-03-08 23:31:08 -08:00
Aaron Chiu 07153dd8f2 remove dup TRACE_TAG_REACT_APPS
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.**

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

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. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/12818

Differential Revision: D4680312

Pulled By: AaaChiuuu

fbshipit-source-id: d8410e99c3ced4e2c94145186a450923029d5b22
2017-03-08 20:46:16 -08:00
Valentin Shergin 264d60b979 Setting `availableSize` for `RCTRootShadowView` on earlier stage
Summary:
Moving setting `availableSize` for `RCTRootShadowView` on earlier stage allows to prevent situations where `availableSize` is not specified yet, but Yoga layout is already happening.
Because `availableSize` equals {infinity, infinity} by default (in this case), Yoga returns a lot of nodes with infinit metrics, which confises UIKit.

Reviewed By: mmmulani

Differential Revision: D4672170

fbshipit-source-id: f9d8c84799dcbdb6b9230ddef6284d84df268833
2017-03-08 19:00:14 -08:00
Aaron Chiu 1269f1ef4e don't obfuscate CxxModule names
Reviewed By: mhorowitz

Differential Revision: D4677275

fbshipit-source-id: 990e2e6338d76e283a1bc44d4991140560d1b101
2017-03-08 17:50:25 -08:00
Hector Ramos ddc4f8aa8b Update the date for this blog post
Reviewed By: ericvicenti, gfosco

Differential Revision: D4677339

fbshipit-source-id: bc27de3ad294215f969311b51a02b080a5be52d6
2017-03-08 17:50:21 -08:00
Héctor Ramos 3b146cdac1 Add dev tools version to new issue template
Summary:
It's sometimes helpful to provide the Xcode version being used, as in the case of #12795.
Closes https://github.com/facebook/react-native/pull/12811

Differential Revision: D4677123

Pulled By: hramos

fbshipit-source-id: 28890d1ac65400d4e98ae2eb77e2d7a1a02b9d05
2017-03-08 16:15:02 -08:00
Héctor Ramos 3672b20a05 Recommend installing latest version of Xcode
Summary:
Xcode 8 is required as of 453e70d19c
Closes https://github.com/facebook/react-native/pull/12810

Differential Revision: D4677067

Pulled By: hramos

fbshipit-source-id: 6de932fe8a79b13f0bb13aba10baf2d1960f8a4f
2017-03-08 16:05:50 -08:00
James Ide f637936f77 Some more Exponent -> Expo updates
Summary:
Updates the remaining references to Exponent to Expo, similar in spirit to b698b4ad62. Left the filename of the blog post alone so that permalinks keep working.
Closes https://github.com/facebook/react-native/pull/12776

Differential Revision: D4676911

Pulled By: hramos

fbshipit-source-id: 5b8b8413f95c984df4157e4e1634dd35a78afa29
2017-03-08 15:47:40 -08:00
David Aurelio c5e2cf7678 UIExplorer test: wait for packager by polling its status
Reviewed By: ericvicenti

Differential Revision: D4674436

fbshipit-source-id: c9673f85a764207f108c6e2282503e8c3201c97e
2017-03-08 11:46:21 -08:00
Jean Lauliac 0ff379bb76 packager: node-haste: cleanup the load() function
Reviewed By: davidaurelio

Differential Revision: D4659391

fbshipit-source-id: a83e218ba89ad459fed07a4dfb61c422a6b4db5d
2017-03-08 10:45:36 -08:00
Jean Lauliac a435fbcbd1 packager: node-haste: remove use of HasteMap class
Reviewed By: davidaurelio

Differential Revision: D4658741

fbshipit-source-id: 951c96df174c79a00b3cff102b3dda75abd4ef99
2017-03-08 10:45:36 -08:00
Mohammed 0150bc76eb Updating the documentation for getSize()
Summary:
Clearly state that the `getSize()` does not work for static image resources because it is assumed the developer knows their static image resource size (the reason I got from a comment on a github issue by a react native contributor).

This missing documentation cost me about 30 minutes to figure out why it didn't work for my static image resource and so I decided to update the documentation 💃
Closes https://github.com/facebook/react-native/pull/11645

Differential Revision: D4533463

Pulled By: lacker

fbshipit-source-id: 70e175ea30a5540c8a9f2a0c040585c711d82ac3
2017-03-08 06:45:22 -08:00
Janic Duplessis abc483a653 BREAKING - Remove LayoutAnimation experimental flag on Android
Summary:
I don't remember exactly where we talked about this but LayoutAnimation on Android is pretty stable now so there's no reason to keep it behind an experimental flag anymore. The only part that is not really stable is delete animations, so what I did is remove the default delete animation that we provide in presets.

**Test plan**
Tested that layout animations work properly without any config.
Closes https://github.com/facebook/react-native/pull/12141

Differential Revision: D4494386

Pulled By: mkonicek

fbshipit-source-id: 5dd025584e35f9bff25dc299cc9ca5c5bf5f17a3
2017-03-08 06:45:22 -08:00
Prabakar Marimuthu 36eb69ecd0 Added option to set mixed content mode in android webview
Summary:
PR for option to set mixed content mode in Webview(Android) for issue #8460
Closes https://github.com/facebook/react-native/pull/12314

Differential Revision: D4663084

Pulled By: lacker

fbshipit-source-id: 0e40ea463739166311ddcb7887ff6d0289369637
2017-03-08 06:45:22 -08:00
Adam Comella 454ab8fc23 BREAKING: iOS: Support withCredentials flag in XHRs
Summary:
Corresponding Android PR: #12276

Respect the withCredentials XMLHttpRequest flag for sending cookies with requests. This can reduce payload sizes where large cookies are set for domains.

This should fix #5347.

This is a breaking change because it alters the default behavior of XHR. Prior to this change, XHR would send cookies by default. After this change, by default, XHR does not send cookies which is consistent with the default behavior of XHR on web for cross-site requests. Developers can restore the previous behavior by passing `true` for XHR's `withCredentials` argument.

**Test plan (required)**

Verified in a test app that XHR works properly when specifying `withCredentials` as `true`, `false`, and `undefined`. Also, my team uses this change in our app.

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

Differential Revision: D4673644

Pulled By: mkonicek

fbshipit-source-id: 2fd8f536d02fb39d872eb849584c5c4f7e7698c5
2017-03-08 06:15:15 -08:00
Adam Comella 22b3faf1ad iOS: Expose fontScale to JavaScript
Summary:
A related Android PR is #11008.

Font scale was exposed through:
  - The `getContentSizeMultiplier` method
  - The `didUpdateContentSizeMultiplier` event

These are now deprecated. The reason is that there was already an API that exposed font scale. However, it was Android only. We now expose font scale through that API on iOS as well. Specifically:
  - Font scale is now available as `PixelRatio.getFontScale()`.
  - The `change` event on the `Dimensions` object now fires when font scale changes.

This change also adds support for `Dimensions.get('screen')` on iOS. Previously, only `Dimensions.get('window')` was available on iOS. The motivation is that, [according to this comment](https://github.com/facebook/react-native/pull/11008#issuecomment-275123609), we'd like to deprecate `window` dimensions in favor of `screen` dimensions in the future.

**Test plan (required)**

Verified that `PixelRatio.getFontScale()` and the `change` event work properly in a test app.

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

Differential Revision: D4673642

Pulled By: mkonicek

fbshipit-source-id: 2602204da6998a96216e06f5321f28f6603e4972
2017-03-08 05:59:41 -08:00
Adam Comella 36f09dc252 Add onabort to XHR classes
Summary:
04d870b added support for onabort in XHRs. The other on* events are declared on XMLHttpRequest and XMLHttpRequestEventTarget. This adds onabort there as well.

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

Differential Revision: D4673648

Pulled By: mkonicek

fbshipit-source-id: 0c5255da77537103c5ad91d9b2826d064140708d
2017-03-08 05:59:41 -08:00
Adam Comella 4c7576e485 Android: Fix clipping of text which contains unicode emoticons on Android 4.4.2
Summary:
Fixes #11592

This bug was seen on a Galaxy S4 running Android 4.4.2. On this device, Android's `Layout.getDesiredWidth` method doesn't correctly measure text that contains unicode emoticons. It appears to think the emoticons take up 0 space.

Setting ANTI_ALIAS_FLAG in the TextPaint's constructor instead of setting it later with setFlags works around the Android bug.

**Test plan (required)**

My team uses this fix in our app.

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

Differential Revision: D4673649

Pulled By: mkonicek

fbshipit-source-id: 535f371281927bfff5d8b42966496bc8daf30045
2017-03-08 05:45:17 -08:00
Martin Konicek 48f30eca7e Move iOS Maps out of the GitHub repo to internal fb codebase
Summary:
MapView has been deprecated in open source for a while: http://facebook.github.io/react-native/docs/mapview.html
We still want to use it internally. Moving it away from the GitHub folder.

Reviewed By: mmmulani

Differential Revision: D4646199

fbshipit-source-id: f469971e448dbca12afe141b43fa8a2518c7d467
2017-03-08 05:01:36 -08:00
Martin Konicek adf650debc Use different function syntax that the JS parser used to build the website can understand
Summary:
For some reason the parser doesn't support that syntax. It fails with:

```
Cannot parse file ../Libraries/Animated/src/AnimatedImplementation.js Error: parseSource returned falsy
    at parseAPIInferred (/home/ubuntu/react-native/website/server/extractDocs.js:343:13)
```

Reviewed By: sahrens

Differential Revision: D4669961

fbshipit-source-id: 3536c94b8f385f5810c47544c4a72c8c785bf0e5
2017-03-08 04:47:05 -08:00
Aaron Chiu 7978f7a27b enable Systracing is JS before JSBundle finishes loading
Reviewed By: alexeylang

Differential Revision: D4671771

fbshipit-source-id: 5cd12bf84f25d4c3b188cf32907415b5a695b360
2017-03-08 03:34:54 -08:00
Eric Vicenti a8474c25fd Fix license headers
Reviewed By: hramos

Differential Revision: D4670890

fbshipit-source-id: e8429aa88a1d4f3cc80034dd087739410c0761f2
2017-03-08 00:52:17 -08:00
Hector Ramos f65a3c4a4b Replace defaultLink with infoLink in Showcase
Reviewed By: ericvicenti

Differential Revision: D4671154

fbshipit-source-id: ee9df269b91ec140afc8dace9bbf960f9a47f0b0
2017-03-08 00:52:16 -08:00
Kevin Gozali 1a8d216458 added RCTLog.logToConsole() to force log regardless of debugger connection
Summary: This adds an alternative logging method that can be called from native side. `logIfNoLoggingHook()` will pass the message to console only if there's Chrome debugger attached. This new method sends the message to console regardless to notify the developers better.

Reviewed By: yungsters

Differential Revision: D4669663

fbshipit-source-id: 3940816dadd08d450f066b7223f6d26a38a70921
2017-03-07 19:45:49 -08:00
Spencer Ahrens 7eded2d8ed preserve inline components in prop type doc gen
Summary:
Some of the operations, like `oneOf` and `arrayOf`, were doing joins on arrays of potential
tags, like `<span>` or `<a>`, which would stringify them to `[object Object]`.

This introduces a new `spanJoinMapper` which suppresses the trailing separator like `join` but wraps
elements in `<span>` rather than `concat`ing into a string.

Latest master is pretty broken:
{F66059444}

Nested `color` and some other props were broken even before https://github.com/facebook/react-native/commit/a7a3922b89d821b9a34d26bdcc7676e747a2716
{F66059446}

All fixed in this diff:
{F66059445}

Reviewed By: mkonicek

Differential Revision: D4670441

fbshipit-source-id: ddc10f13b3bdc6a1e799fa06a4e206f8dbd08769
2017-03-07 18:04:05 -08:00
Martin Konicek b8e8b723d4 Website: Fix aspect ratio of icons in the showcase on homepage
Summary:
I ran the website locally and noticed the icons in the showcase on the homepage look squashed:

![screenshot 2017-03-07 22 28 23](https://cloud.githubusercontent.com/assets/346214/23681227/18fbec6e-0386-11e7-9658-93907cbb3337.png)

Made the icons consistent with /showcase.html:

d54c7f8282/website/styles/_showcase.scss (L74)
Closes https://github.com/facebook/react-native/pull/12773

Differential Revision: D4669767

Pulled By: hramos

fbshipit-source-id: be5a758dd912083fc02c8e0b56c30c8617dcf3df
2017-03-07 15:45:16 -08:00
Marc Horowitz cb3a439d17 Upgrade double-conversion to 1.1.5
Reviewed By: ericvicenti

Differential Revision: D4662924

fbshipit-source-id: ecf4a3d8aee8a3def1d8308456ca2551b4669f63
2017-03-07 12:08:40 -08:00
Mehdi Mulani 0a06250d24 Add build-time check that module methods are exported correctly
Summary:
This prevents someone from only putting `RCT_EXPORT_METHOD(...)` around some of the arguments to a method and generally causing confusion. Yes, before this diff it would still compile correctly if you did something like:

```
RCT_EXPORT_METHOD(lol:(NSNumber *)lol)
blah:(id)blah
{
  NSLog(@"%@ %@", lol, blah);
}
```

Reviewed By: fkgozali

Differential Revision: D4660019

fbshipit-source-id: 1829a47e5c8d5e8ce93edca2ac7efd7e2bfdf840
2017-03-07 10:45:36 -08:00
Martin Konicek 53c7f1d07f When building open source React Native, make Buck use the same version of Support Library as Gradle uses, and as we use internally
Reviewed By: bestander

Differential Revision: D4666693

fbshipit-source-id: a9a15164498353759a14630e2ce78a4a00e9c855
2017-03-07 09:45:48 -08:00
Héctor Ramos b698b4ad62 Expo
Summary: Closes https://github.com/facebook/react-native/pull/12766

Differential Revision: D4666410

Pulled By: hramos

fbshipit-source-id: 6eef74352414f2c138670f58ac1cb2c39787f3a3
2017-03-07 07:45:34 -08:00
Spencer Ahrens 5257c35d05 Add new `forkEvent`/`unforkEvent` API
Reviewed By: vjeux

Differential Revision: D4648427

fbshipit-source-id: 9bbbd81f49a9363ac271b3906d73f937f0d1f500
2017-03-06 21:51:40 -08:00
Douglas Lowder b7e9374c64 Move BackAndroid -> BackHandler, add Apple TV support for back nav
Summary:
Enable back navigation on Apple TV (with the remote's menu button) in code making use of BackAndroid.  The module is renamed to BackHandler.  BackAndroid is still exported to ReactNative for now, until external projects switch to using the new name for the module.  The navigation in https://github.com/react-community/react-navigation makes use of this module.

**Test plan**: Manual testing with an example app (https://github.com/dlowder-salesforce/react-nav-example).
Closes https://github.com/facebook/react-native/pull/12571

Differential Revision: D4665152

Pulled By: ericvicenti

fbshipit-source-id: 925400ce216379267e014457be6f5eedbe4453ec
2017-03-06 21:51:40 -08:00
Spencer Ahrens 9325496d46 Simplify scroll interaction stuff
Reviewed By: angelahess

Differential Revision: D4662787

fbshipit-source-id: 6e28f8cacd08601254e70f30ab98ee27bd08cc5a
2017-03-06 21:51:40 -08:00
Spencer Ahrens 28b43aa05c Fix crash with empty section headers
Summary: It's ok for them to be empty, so we should check!

Reviewed By: yungsters

Differential Revision: D4664411

fbshipit-source-id: c66e98458708eee59757fa665b3a05972f1c1b70
2017-03-06 21:31:05 -08:00
Spencer Ahrens 7005f54ab5 Fix unmount crash when using sticky headers
Reviewed By: bvaughn

Differential Revision: D4659436

fbshipit-source-id: c04394681a4f07599f16bae195313e6617419404
2017-03-06 21:16:00 -08:00
Aaron Chiu b085215237 move NativeModule initialization off UI thread
Summary: Initializing natives modules on the UI thread blocks the JS thread if the UI thread is busy.

Reviewed By: yungsters

Differential Revision: D4611211

fbshipit-source-id: cd4fb9cb5e52a478b6692b784cfd9e3bf34c0d34
2017-03-06 21:15:54 -08:00
Spencer Ahrens e32e4d9711 Blog post
Reviewed By: hramos

Differential Revision: D4635928

fbshipit-source-id: 751cfbb8ce50be4ae7248069e9f4c04384c3eced
2017-03-06 19:45:04 -08:00
Spencer Ahrens 293bb36c0e warn about PureComponent in docs
Reviewed By: hramos

Differential Revision: D4663872

fbshipit-source-id: cb2bd2a2d588a9419da7517304d0612e259151e3
2017-03-06 19:31:08 -08:00
Hector Ramos 3f6476fc5e Tweak presentation of Colors guide.
Summary:
Explain a bit more how these are used.
Closes https://github.com/facebook/react-native/pull/12753

Differential Revision: D4663972

Pulled By: hramos

fbshipit-source-id: acbda6593e3f2a01776d2208f6ef3bc69bca0eef
2017-03-06 18:01:06 -08:00