Commit Graph

2366 Commits

Author SHA1 Message Date
Agastya Darma b1cdb7d553 Implementing space-evenly
Summary:
So in v0.52.0 space-evenly is introduced but not yet implemented (1050e0b by woehrl01). This pull request implements the space-evenly.

Manual Testing.
![notes marker](https://i.imgur.com/IXmezVY.png)

[IOS] [FEATURE] [Yoga] Adding space-evenly on justify-content in iOS
[ANDROID] [FEATURE] [Yoga] - Adding space-evenly on justify-content in Android
Closes https://github.com/facebook/react-native/pull/17805

Differential Revision: D6858294

Pulled By: shergin

fbshipit-source-id: 7a705ca05f58603ef4588e1bfd16c16a78f8a390
2018-01-31 10:17:22 -08:00
Dan Caspi 3fbf7856d9 Better handling exception in loadScript()
Differential Revision: D6856807

fbshipit-source-id: 36c527ee00eef56a5912ad6e4233d6cd61cb5170
2018-01-31 05:31:12 -08:00
David Aurelio e756251413 Synchronize map access
Summary:
We want applying deltas to be an atomic operation, from incrementing the delta message ID to updating the relevant maps.
This is a simple approach to synchronize the corrsponding method.

We will probably need to go with a more sophisticated approach, that makes sure that deltas are applied in order. That would also allow us to lock only on writes.

Reviewed By: kathryngray

Differential Revision: D6846560

fbshipit-source-id: 175a80b4e39223883e397d75e20109fc12a2a878
2018-01-31 03:04:13 -08:00
Chris Lewis 22efd95be1 Add back ability to customise OkHttp client
Summary:
Prior to 0a71f48b13, users could customise the OkHttp client used by React Native on Android by calling replaceOkHttpClient in OkHttpClientProvider.

This functionality has a variety of legitimate applications from changing connection timeouts or pool size to Stetho integration. The challenge is to add back support for replacing the client without causing a breaking change or reintroducing the problems olegbl sought to address in his original commit.

Introducing a client factory archives these aims, it adds a new, backwards compatible interface and is called each time a client is requested rather than re-using the same instance (unless you explicitly want this behaviour, in which case you could replicate it using a static class property inside your custom factory).

A number of PRs have been opened to add this functionality: https://github.com/facebook/react-native/pull/14675, https://github.com/facebook/react-native/pull/14068.

I don't have a lot of Java experience so I'm open to better/more idiomatic ways to achieve this :)

Create React Native application and set a custom factory in the constructor, e.g.  `OkHttpClientProvider.setOkHttpClientFactory(new CustomNetworkModule());`

Where a custom factory would look like:

```
class CustomNetworkModule implements OkHttpClientFactory {
    public OkHttpClient createNewNetworkModuleClient() {
        return new OkHttpClient.Builder().build();
    }
}
```

Remove the existing replace client method to prevent accident use and alert existing users that its functionality has changed: https://github.com/facebook/react-native/pull/16972

[Android] [Minor] [Networking] - | Provide interface for customising the OkHttp client used by React Native |
Closes https://github.com/facebook/react-native/pull/17237

Differential Revision: D6837734

Pulled By: hramos

fbshipit-source-id: 81e63df7716e6f9039ea12e99233f6336c6dd7ef
2018-01-30 11:58:45 -08:00
Héctor Ramos 964320447d Add support annotations dependency
Summary:
Should fix current test-android error in Circle CI.
Closes https://github.com/facebook/react-native/pull/17774

Differential Revision: D6837326

Pulled By: hramos

fbshipit-source-id: a53464d3abb52248c6565dee68e7e7f9be9a313f
2018-01-30 11:03:52 -08:00
Semen Zhydenko 8ffc16c6e7 Typos in code
Summary:
To fix typos

No testing required, changed only internal things names

No

addtionalStyles -> additionalStyles
occured -> occurred
recomendedType -> recommendedType
markDirtyAndPropogate -> markDirtyAndPropagate
targetting -> targeting
RCTApplyTranformationAccordingLayoutDirection -> RCTApplyTransformationAccordingLayoutDirection (tranform -> transform)
Closes https://github.com/facebook/react-native/pull/17587

Differential Revision: D6832696

Pulled By: shergin

fbshipit-source-id: 452287e5ce82df5c6b87126cb21889b7bd9d73c1
2018-01-29 19:17:33 -08:00
Alexey Lang 6224ef5301 Measure time to create ReactInstanceManager
Reviewed By: fkgozali

Differential Revision: D6591797

fbshipit-source-id: 7345b7c772eb4ae35ad570082090fbdf704102d3
2018-01-29 11:07:39 -08:00
Satyajit Sahoo be56a3efee Implement Blob support for XMLHttpRequest
Summary:
This PR is a followup to https://github.com/facebook/react-native/pull/11417 and should be merged after that one is merged.

  1. Add support for creating blobs from strings, not just other blobs
  1. Add the `File` constructor which is a superset of `Blob`
  1. Add the `FileReader` API which can be used to read blobs as strings or data url (base64)
  1. Add support for uploading and downloading blobs via `XMLHttpRequest` and `fetch`
  1. Add ability to download local files on Android so you can do `fetch(uri).then(res => res.blob())` to get a blob for a local file (iOS already supported this)

  1. Clone the repo https://github.com/expo/react-native-blob-test
  1. Change the `package.json` and update `react-native` dependency to point to this branch, then run `npm install`
  1. Run the `server.js` file with `node server.js`
  1. Open the `index.common.js` file and replace `localhost` with your computer's IP address
  1. Start the packager with `yarn start` and run the app on your device

If everything went well, all tests should pass, and you should see a screen like this:

![screen shot 2017-06-08 at 7 53 08 pm](https://user-images.githubusercontent.com/1174278/26936407-435bbce2-4c8c-11e7-9ae3-eb104e46961e.png)!

Pull to rerun all tests or tap on specific test to re-run it

  [GENERAL] [FEATURE] [Blob] - Implement blob support for XMLHttpRequest
Closes https://github.com/facebook/react-native/pull/11573

Reviewed By: shergin

Differential Revision: D6082054

Pulled By: hramos

fbshipit-source-id: cc9c174fdefdfaf6e5d9fd7b300120a01a50e8c1
2018-01-26 09:17:11 -08:00
4ndroidev 7b1915e74d Fix NPE in Android Switch during measure
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!

-->

Fixes #16000

see [Issue #16000](https://github.com/facebook/react-native/issues/16000)
fix a null pointer exception while using higher version 'com.android.support:appcompat-v7'

N/A

[ANDROID][BUGFIX][Switch] - Fix NPE in Android Switch during measure
Closes https://github.com/facebook/react-native/pull/16064

Differential Revision: D6816122

Pulled By: hramos

fbshipit-source-id: ba9a6febad4884b8ab142d8c7142085367006904
2018-01-25 18:00:09 -08:00
Michael Lee 869866cc5c Continue wrapping functions as we prepare for skylark
Differential Revision: D6808010

fbshipit-source-id: f24e71558baed2c2da319e20e0faf66858eb27d5
2018-01-25 09:30:00 -08:00
Sergei Dryganets 0c18ec5b9c Popups calling error callback instead of crashing if view with passed tagId not found
Summary:
The showPopup method has an error callback. For some reason, it is asserting in case the wrong tagId is passed instead of calling the error callback on Android.

Pass not existing tagId to showPopup method and make sure it is receiving an error in js instead of crashing in native on Android.

[ANDROID] [MINOR] showPopup method calls error callback instead of crashing on errors.
Closes https://github.com/facebook/react-native/pull/17550

Differential Revision: D6776014

Pulled By: hramos

fbshipit-source-id: 1d97b762818d1591018fd43556eb41c3fb491eb9
2018-01-23 14:07:25 -08:00
Jonathan Kim 4f6c157250 Fix open source build load error
Reviewed By: hramos

Differential Revision: D6785610

fbshipit-source-id: d50aab72aa51f8aa063f23fc1e328caf9c02de0c
2018-01-23 09:51:40 -08:00
Pritesh Nandgaonkar be8e7c6e65 Made logging logic dynamic to log string length
Reviewed By: emilsjolander

Differential Revision: D6784491

fbshipit-source-id: 26e4520a84be355ff992b808297ce7a95b3d09e3
2018-01-23 06:46:08 -08:00
Sergei Dryganets 46cc4907e3 ClassCastException fix: getText() returns CharSequence not Spanned.
Summary:
ClassCastException fix: getText() returns CharSequence not Spanned.
From the other hand, EditTexts getText method returns Editable which extends Spanned.
This commit fixes two similar bugs one in flat TextView and another in standard TextView.
Also, it removes redundant checks in the ReactEditText.

Application without this change sporadically crashes with the following stack trace:
```
java.lang.ClassCastException: java.lang.String cannot be cast to android.text.Spanned
	at com.facebook.react.views.text.ReactTextView.reactTagForTouch(ReactTextView.java:195)
	at com.facebook.react.uimanager.TouchTargetHelper.getTouchTargetForView(TouchTargetHelper.java:269)
	at com.facebook.react.uimanager.TouchTargetHelper.findTargetTagAndCoordinatesForTouch$58866680(TouchTargetHelper.java:101)
	at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:77)
	at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:151)
	at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:127)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)

```
Closes https://github.com/facebook/react-native/pull/15452

Differential Revision: D6775986

Pulled By: hramos

fbshipit-source-id: 6de929937cbbb3e7bd98a708a40700f883cbaef0
2018-01-22 15:15:23 -08:00
Pascal Hartig ff2658c3de Mark model fields final
Reviewed By: emilsjolander

Differential Revision: D6759564

fbshipit-source-id: 810dc8a9730fb330760d2aedecafcea81cf25cb1
2018-01-22 03:05:17 -08:00
Build Service f49f7932d5 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: ec880908d30772bf2047963013d184e01405de03
2018-01-22 02:16:31 -08:00
Build Service faa9519021 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: c7382ae9de4fb1697190bbc9fe385bd552973fdd
2018-01-22 02:16:31 -08:00
Build Service 8bd00a2361 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: 42904e404f11a205af8af486e9535a8dc52da81e
2018-01-22 02:16:31 -08:00
Build Service bb6fceac27 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: 9ae5884ac23492feed039da32433cd8c08e2cc0e
2018-01-22 02:16:31 -08:00
Build Service c7846c4bfb @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: a0ba2333de9b635234aa56ccd080252fa400d534
2018-01-22 02:16:31 -08:00
Jonathan Kim 4f2cc42a2d Make xplat react native files buildable
Reviewed By: mzlee

Differential Revision: D6605611

fbshipit-source-id: baa33947319a27b95020924d177a9398a276dabe
2018-01-21 22:05:05 -08:00
David Vacca 4d3519cc6a Adding JS hierarchy information when a StackOverflowException is thrown in Dev mode
Reviewed By: achen1

Differential Revision: D6716309

fbshipit-source-id: 23458cd126d13fec3aa9c09420f7cdd230ec8dd0
2018-01-19 13:02:41 -08:00
David Vacca 1aac962378 Capture StackOverflowExceptions triggered when drawing a ReactViewGroup or ReactRootView
Reviewed By: achen1

Differential Revision: D6653395

fbshipit-source-id: 849b1a2ed6ab9bc057414d451e97a673178c30dd
2018-01-18 18:48:59 -08:00
David Vacca 877f1cde2e Fix and re-enable "view flattening" optimizations for Marketplace
Reviewed By: achen1

Differential Revision: D6751078

fbshipit-source-id: 32bfb9ac64f183fabbba85755be372016722afc6
2018-01-18 17:55:08 -08:00
Ram N f5efc460ad Add support for finding multiple views with NativeIds using a single listener
Reviewed By: mdvacca

Differential Revision: D6735460

fbshipit-source-id: e038a68637a00fda7058fc82e253ae68cdf67c6e
2018-01-18 11:33:34 -08:00
David Vacca 71ec85f24c Cleanup ReactHorizontalScrollView
Reviewed By: achen1

Differential Revision: D6693605

fbshipit-source-id: e58425b2a5b0bf75ffb41ef3ab6fa7ad46222531
2018-01-18 10:46:47 -08:00
Tim Yung df2f33537a RN: Revert D6701597
Reviewed By: mdvacca

Differential Revision: D6735812

fbshipit-source-id: 8144b72883150f9d7e2614ee0f238c1b8e44c6ab
2018-01-17 15:11:14 -08:00
Kathy Gray 7891805d22 move native accesses of map into two accesses instead of per-element
Differential Revision: D6650192

fbshipit-source-id: 0eb0719fd3b7813add33a3d4fe3fb70e6f375fd7
2018-01-17 10:51:49 -08:00
Kathy Gray 5649aed6d3 Move native accesses of array into one access instead of per-element
Differential Revision: D6578349

fbshipit-source-id: 84ebd66ed791a845e9cc0fbc7e12a377534aa903
2018-01-17 10:51:49 -08:00
Felix Oghina fc6dd78935 Remove SoLoaderShim, use SoLoader
Summary:
SoLoader is more stable on older versions of Android. Switching to it should fix recurring issues that we get such as `UnsatisfiedLinkError` and so on.

CI + run showcase app.
Closes https://github.com/facebook/fresco/pull/1989

Reviewed By: erikandre

Differential Revision: D6556420

Pulled By: foghina

fbshipit-source-id: ffc3faef6452294b4d781258c64ef57e08d107b5
2018-01-16 09:16:01 -08:00
David Vacca 1f5bb374cd Revert D6704701: Refactor ReactViewGroup to reuse ReactViewBackgroundManager
Differential Revision: D6704701

fbshipit-source-id: 01feb61a9c2c263f88cca4fea5978957c5e4767f
2018-01-16 08:15:47 -08:00
Semen Zhydenko d2c569795c Typos in comments and log messages
Summary:
No code changes, no testing required.

alligned -> aligned
allignment -> alignment
completly -> completely
conseptually -> conceptually
decendents -> descendants
indefinetly -> indefinitely
dimention -> dimension
doesnt -> doesn't
safegaurd -> safeguard
intialization -> initialization
hierachy -> hierarchy
happend -> happened
gaurd -> guard
programatically -> programmatically
initalized -> initialized
immidiately -> immediately
occured -> occurred
unkown -> unknown
neccessary -> necessary
neccesarily -> necessarily
occuring -> occurring
comoponent -> component
propogate -> propagate
recieved -> received
referece -> reference
perfomance -> performance
recieving -> receiving
subsquently -> subsequently
scoll -> scroll
suprisingly -> surprisingly
targetting -> targeting
tranform -> transform
symetrical -> symmetrical
wtih -> with
Closes https://github.com/facebook/react-native/pull/17578

Differential Revision: D6718791

Pulled By: shergin

fbshipit-source-id: 4ab79c1131ec5971d35a0c7199eba7ec0a0918ad
2018-01-12 22:18:45 -08:00
David Vacca e8aa60430c Refactor ReactViewGroup to reuse ReactViewBackgroundManager
Reviewed By: achen1

Differential Revision: D6704701

fbshipit-source-id: 14bb155f2eb0951307674e257e729a1c72b08d8b
2018-01-12 17:08:00 -08:00
Brandon Williams 164f6b6afd Unset phone and visible-password keyboardType flags on Android
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!

-->

Attempted fix for issue #17248

Added unit tests that cover the affected function and manually repeated the reproduction steps found in the issue.

Note: I had to apply the attached patch file to actually *run* the tests because they were not enabled. I didn't include this in the PR because it seemed like a secondary problem with possible ramifications (see comment near patched line) beyond this issue. For example, other, unrelated tests break when that line is uncommented.
[textInputTestEnable.patch.txt](https://github.com/facebook/react-native/files/1565807/textInputTestEnable.patch.txt)

If I should apply the patch to this PR or re-enable the tests in some other fashion, please let me know and I can do so.

(none)

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[ANDROID] [BUGFIX] [TextInput] - Fix an issue when swapping to and from the `'visible-password'` or `'phone-pad'` keyboard types.
Closes https://github.com/facebook/react-native/pull/17249

Differential Revision: D6713008

Pulled By: hramos

fbshipit-source-id: 85eeb5398748d48e59d33eb86d851fd02d587a31
2018-01-12 11:32:52 -08:00
Sergei Dryganets 9024f56bda Fix crash due to mishandling of UTF-8 in progressive download.
Summary:
Fixes:
```
Fatal Exception: java.lang.RuntimeException: Failed to create String from JSON
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:234)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:193)
       at java.lang.Thread.run(Thread.java:818)
```
JavaScriptCore is very strict about invalid UTF symbols.
So if you pass an invalid UTF-8 string to it the string will be decoded as an empty string.

The current implementation of progressive downloading for Android blindly cuts the response in 8KB chunks.
That could cause a problem in case the last symbol in the chunk is multi-byte.

To prevent it I added a class which determines if this is the case and cut the string in the appropriate place.
A remainder is prepended to the next chunk of data.

This should fix the root cause of this issue:
https://github.com/facebook/react-native/issues/10756
Closes https://github.com/facebook/react-native/pull/15295

Differential Revision: D6712570

Pulled By: hramos

fbshipit-source-id: f07fcf0f011c2133c8e860ceb0588a29d36d07fb
2018-01-12 11:10:04 -08:00
Sergei Dryganets c8e98bbaf5 CI for Android fixed
Summary:
Fix for android github CI.

Github CI doesn't work without this change.

CI passes.

[INTERNAL] Android CI fix.
Closes https://github.com/facebook/react-native/pull/17551

Differential Revision: D6707477

Pulled By: hramos

fbshipit-source-id: f98515234da3b90ee3233523bcd7cc67ed82c1b4
2018-01-12 08:01:00 -08:00
Igor Ganapolsky 7abffc3f8c punctuation and grammar
Summary:
Use a comma for clear punctuation, and use 'wants' verb.

<!--
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!

-->

Use clear grammar for README file

(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!)

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/17545

Differential Revision: D6711711

Pulled By: hramos

fbshipit-source-id: 315f66e5b36c4a3ffdc5407876cc0fc2ed596a56
2018-01-12 08:01:00 -08:00
Attila Jakabfi 2a22d998f8 Spacing
Differential Revision: D6683074

fbshipit-source-id: a76bc5028962d738bb931a997752f6ba194bd8ed
2018-01-12 05:13:21 -08:00
Sergei Dryganets d5e3f081c6 Fix #6228: Crash in Android dialog module.
Summary:
Android dialog module has a race condition as a result of which it crashes.
See this issue:
https://github.com/facebook/react-native/issues/6228.

The mIsInForeground flag is set on UI thread but was used from the ReactMethod thread.
Now all public methods of FragmentManagerHelper called from UI thread only.
Asserts are added in appropriate places to prevent future regressions.

Make sure that dialogs work after this change.
It will be nearly impossible to reproduce the issue manually but automatic regression tests should be able to catch this. At least our tests were crashing on some dialog scenarios from time to time.

[ANDROID] [MINOR] [BUGFIX] - Race condition fix in Android Dialogs module.
Closes https://github.com/facebook/react-native/pull/17392

Reviewed By: achen1

Differential Revision: D6708787

Pulled By: mdvacca

fbshipit-source-id: 99beb3ea3046286cc973f7677e98ff36f162b09b
2018-01-11 18:57:31 -08:00
Andrew Chen (Eng) f363dfe766 Fix redbox style
Differential Revision: D6689447

fbshipit-source-id: de6b1295e53c46bdf99f0f4a26130f516763ee66
2018-01-11 15:42:17 -08:00
Andrew Chen (Eng) e3c27f585a Add Context to Redbox report api
Differential Revision: D6700021

fbshipit-source-id: b8ba8242a68c02e608900c93a7645d61158cc0cb
2018-01-11 15:17:46 -08:00
Emil Sjölander 1c3f6acfe5 Expose more android device infos
Reviewed By: fkgozali

Differential Revision: D6692907

fbshipit-source-id: ecbcf763aae2035c9526e891d0cc14a987b6d4c1
2018-01-11 04:16:39 -08:00
Tim Yung 7e9242bd1a RN: Fix `borderRadius` for Image Background (Android)
Differential Revision: D6701597

fbshipit-source-id: 462b578c3b988c5fa7e3d25e4a6425d170ab4b62
2018-01-11 00:41:52 -08:00
David Vacca c249e52096 Fix BadTokenException when redbox was dismissed and re-displayed
Reviewed By: achen1

Differential Revision: D6690662

fbshipit-source-id: d3e3fa4108d832da0a6d9e290263121ba86afbf4
2018-01-10 16:46:35 -08:00
Steven Cable 22735f6903 Fix DeviceInfoModule LifecycleEventListener
Summary:
Fixes one of the two parts of [issue posted here](https://github.com/facebook/react-native/issues/17209).  Motivation is that we wanted our app to be able to handle user changing font size while the app is running.  Yes, we know that changing font size doesn't inherently trigger a re-render, but at the minimum it should cause `PixelRatio.getFontScale()` to return an updated value.

1. Render an interface and invoke `PixelRatio.getFontScale()`
2. Change the font scale in Settings > Accessibility > Font Size
3. Return to the React Native app (without reloading Javascript) and invoke `PixelRatio.getFontScale()` again.
4. Verify that the result of `PixelRatio.getFontScale()` has changed to reflect the new font size.

For a video of the problem, see the linked issue under the Motivation heading.  In this fixed version, the number actually does update as expected.

None.  This should require no documentation change, as it is behavior that the docs seem to indicate should be happening already.
In fact, [the documentation at the bottom of this page](https://facebook.github.io/react-native/docs/native-modules-android.html) appears to already indicate that this should be done for anything implementing LifecycleEventListener.

[ANDROID] [BUGFIX] [DeviceInfo] - Fix the DeviceInfoModule to properly respond to LifecycleEvents
Closes https://github.com/facebook/react-native/pull/17227

Differential Revision: D6692358

Pulled By: hramos

fbshipit-source-id: 3db212fe8103c7aa29a29ead6c772abb7ae4cd85
2018-01-10 05:32:09 -08:00
James Ide 7f58189605 Change inlined `okhttp3.Headers` references to a Java import
Summary:
In BundleDownloader.java, there were references to `okhttp3.Headers` instead of importing the class at the top of the file. This PR is a simple change to use an import instead.

Compile the Android app

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

[ANDROID][MINOR][BundleDownloader] - Use Java import instead of fully qualified class name
Closes https://github.com/facebook/react-native/pull/17507

Differential Revision: D6691593

Pulled By: hramos

fbshipit-source-id: 81b366db608b7be8a903d2f25b36ca5642d9eec3
2018-01-09 23:54:57 -08:00
Andrew Chen (Eng) b0319f3293 Fix ReactScrollView lints
Differential Revision: D6689492

fbshipit-source-id: c55f98f3ed25757ec192a023d2dd60c73aae8df2
2018-01-09 18:52:38 -08:00
David Vacca b2848a54b0 Adding support to float values for Android snapToInterval
Reviewed By: fkgozali

Differential Revision: D6684529

fbshipit-source-id: 51efa0a2d38acf4134bb824c462973e5c6bdf17a
2018-01-09 12:32:53 -08:00
David Vacca e5c2a66897 Fix Modal not disappearing when navigating from inside a Modal to another activity
Reviewed By: achen1

Differential Revision: D6668368

fbshipit-source-id: 809e9c978032e731478bcc8e290eb030e4ee6eca
2018-01-08 10:00:49 -08:00
David Vacca 0356cbd13b Fix BadTokenException when displaying warning messages
Reviewed By: achen1

Differential Revision: D6651871

fbshipit-source-id: fc7fc118999f0e752636a3142764bd3496e5dc81
2018-01-05 16:08:17 -08:00
Wesley Walser c49d249fd7 Send scroll velocity data to Javascript on momentum scroll events.
Reviewed By: sahrens

Differential Revision: D6643379

fbshipit-source-id: 70550274975ed7c2b43a3d668422102d0c115ba7
2018-01-05 10:46:03 -08:00
David Vacca e57a43b97a Revert D6531148: Fix BadTokenException and IllegalArgmentException thrown when showing or dismissing Modal
Differential Revision: D6531148

fbshipit-source-id: a90cc38f98d6b86151539abd2a07bfcf1c253a5f
2018-01-04 17:31:17 -08:00
Josh Hargreaves c9ff0bc212 Implement onKeyPress Android
Summary:
This implements onKeyPress for Android on TextInputs and addresses https://github.com/facebook/react-native/issues/1882.
**N.B. that this PR has not yet addressed hardware keyboard inputs**, but doing will be fairly trivial. The main challenge was doing this for soft keyboard inputs.

I've tried to match the style as much as I could. Will happily make any suggested edits be they architectural or stylistic design (edit: and of course implementation), but hopefully this is a good first pass :).
I think important to test this on the most popular keyboard types; maybe different languages too.
I have not yet added tests to test implementation, but will be happy to do that also.

- Build & run RNTester project for Android and open TextInput.
- Enter keys into 'event handling' TextInput.
- Verify that keys you enter appear in onKeyPress below the text input
- Test with autocorrect off, on same input and validate that results are the same.

Below is a gif of PR in action.
![onkeypressandroid](https://user-images.githubusercontent.com/1807207/27512892-3f95c098-5949-11e7-9364-3ce9437f7bb9.gif)
Closes https://github.com/facebook/react-native/pull/14720

Differential Revision: D6661592

Pulled By: hramos

fbshipit-source-id: 5d53772dc2d127b002ea5fb84fa992934eb65a42
2018-01-04 12:51:38 -08:00
Jimmy Zhuang ddd65f1ba9 Support snapToInterval for horizontal scrollview on Android
Summary:
`snapToInterval` is available on iOS but on android yet. This PR is to add support for `snapToInterval` on android.

Example:

![android_snap](https://cloud.githubusercontent.com/assets/1699429/19086983/39d3ee1c-8a25-11e6-9c84-20f25a751f32.gif)

TO: lelandrichardson spikebrehm
Closes https://github.com/facebook/react-native/pull/10242

Differential Revision: D4168527

fbshipit-source-id: de3dd9ac5d9e0fddfce5e5bc0aa6a4f33f1e30b3
2018-01-03 10:33:07 -08:00
Héctor Ramos f9e742aadf Fix buck failure
Summary:
Buck is failing due to missing args: https://circleci.com/gh/facebook/react-native/29268
Closes https://github.com/facebook/react-native/pull/17346

Differential Revision: D6642181

Pulled By: hramos

fbshipit-source-id: 399d3c5f197ae0de9748a592def945c14ac1d348
2017-12-28 08:31:28 -08:00
Alex Dvornikov 80f9e1f7de remove "prepareReact" call from the Android bridge
Reviewed By: alexeylang

Differential Revision: D6596304

fbshipit-source-id: 0285611cfdd66ce5bdfa503c9fe8f1963a0c583f
2017-12-26 14:47:30 -08:00
Taras Tsugrii a6a66c5b39 Remove last usages of cxx_library.
Reviewed By: mzlee

Differential Revision: D6632262

fbshipit-source-id: 1ec3ba232e573b9cbc892f23827f9a7c5df34106
2017-12-23 19:41:31 -08:00
Taras Tsugrii 077c3ab349 Define internal FB macro for OSS builds.
Reviewed By: hramos

Differential Revision: D6626785

fbshipit-source-id: bb7c89499bc7c72e24dabd82899c3d9c49874101
2017-12-22 08:47:50 -08:00
Héctor Ramos c547f783c4 Update Docker images to latest Android SDK, Buck
Summary:
Test Plan

Rebuilt Docker images locally, confirmed successful image build.

Can later be reproed with

```
npm run test-android-setup
npm run test-android-build
npm run test-android-run-unit-tests
```

Note that unit tests are failing in master, but in this PR we can repro the same failure.
Closes https://github.com/facebook/react-native/pull/17313

Differential Revision: D6624899

Pulled By: hramos

fbshipit-source-id: 42b8cd708ec2a02399bb6ef30fd73faba2646f79
2017-12-21 17:31:32 -08:00
Krzysztof Magiera 7ff6657985 Add top offset for react loading view on Kitkat
Summary:
This PR fixes the problem with dev loading view on KitKat and older Android devices after #16596

Install RNTester app on Android API 19 or lower device. See green loading view show up under status bar. Do the same with full screen theme set and see it show up correctly at the top of the screen.
Verify the green loading bar displays correctly on devices with API > 19 too.

This fixes an issue introduced in #16596

[ANDROID][MINOR][DevSupport] - Fix green dev loading bar on Android Kitkat and below
Closes https://github.com/facebook/react-native/pull/17305

Differential Revision: D6621077

Pulled By: achen1

fbshipit-source-id: 3b4216af535d7db5c96d137f20004fe2651b1dc9
2017-12-21 12:36:15 -08:00
Taras Tsugrii ba31d29dc9 Replace native cxx_library with fb-specific macros.
Reviewed By: adamjernst

Differential Revision: D6618153

fbshipit-source-id: 188e2ca3cc78efad6e71f0a22547e26abf2f62e1
2017-12-21 08:58:50 -08:00
Ram N 4996b9aeb4 On Android, seperate logic to initialize JS from starting the app
Reviewed By: achen1

Differential Revision: D6606265

fbshipit-source-id: d432661b5f8aa2b7600b1140e1617aab852f343e
2017-12-19 20:31:15 -08:00
Pritesh Nandgaonkar f1055bcac8 Make YGNode as c++ struct with properties exposed through accessors
Reviewed By: emilsjolander

Differential Revision: D6592257

fbshipit-source-id: 641e8b9462ad00731a094511f9f5608b23a6bb21
2017-12-19 11:32:49 -08:00
Ben Nham bef7967f9a move page registration logic in to jsinspector
Reviewed By: pakoito

Differential Revision: D6531199

fbshipit-source-id: ed1ae9e2f0c19e7656cd022e438693798320e55a
2017-12-15 09:20:13 -08:00
Max Sherman b952365ba6 std::string to const char*
Reviewed By: danzimm

Differential Revision: D6570194

fbshipit-source-id: 84dae925b9269393b6925e0977598e3872acb14e
2017-12-14 13:36:51 -08:00
Shin-Kai Chen 29f3f55298 Do not overwrite the same text in ReactEditText
Differential Revision: D6516674

fbshipit-source-id: 246b8efeff7963912bf6b1c8a004c3103be03246
2017-12-11 21:45:37 -08:00
Ramanpreet Nara cb49877a25 Backed out changeset 4fe617216293
Reviewed By: fred2028

Differential Revision: D6539205

fbshipit-source-id: c97d4f3dbd457f59968991b043d7106e551effad
2017-12-11 18:02:02 -08:00
David Vacca c465599a27 Fix BadTokenException and IllegalArgmentException thrown when showing or dismissing Modal
Reviewed By: achen1

Differential Revision: D6531148

fbshipit-source-id: 1d3f6e041ac68ad13120c56ea5223557fca34f0d
2017-12-11 09:46:30 -08:00
Krzysztof Magiera d19afc73f5 Use currentActivity to display redbox, loading view and dev menu
Summary:
This change aims at replacing SYSTEM_ALERT_WINDOW/OVERLAY API being used for rendering dev support related views on Android (redbox, dev menu, green loading view) with API that does not require any special permission. The permission is still used for displaying perf monitor, although it is no longer requested at app startup but only when perf monitor gets enabled.

This change should not affect the way react native apps work in production environment as in release mode all dev support functionality is disabled.

There are two main reasons why requiring SYSTEM_ALERT/OVERLAY permission for displaying basic dev related windows is problematic:
 1) On Android >=6 devices it is required that overlay permission is granted in device settings for apps being side loaded (not installed via play store which is usually the case for apps being developed). Although this setting is not available on some Android devices including Google's stock Android TV version. On such devices App cannot be granted rights to draw in system alert window which cases the app to crash (instead of showing a redbox or dev menu dialog)
 2) Some Android device vendors have issues with implementation of `Settings.canDrawOverlays` that always return false (I've seen it on Xiaomi Redmi 4A with Android 6.1). This issue because of the following code in [ReactActivityDelegate.java#L90](1e8f3b1102/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java (L90)), results in the overlay permission settings screen popping up every time the app is launched even though the permission has been perviously granted which is extremely annoying. Since this change only require overlay permission for displaying perf monitor we no longer ask for it on startup but only when user switches perf monitor ON.

Test need to be performed on pre Android 6 and post Android 6 devices.

1. Run app with devserver off -> should result in redbox
2. Start packager with --reset-cache flag for the loading bar to be visible for some longer period of time. Then restart the app and see the loading bar show up
3. While the app is running, open dev menu, navigate to "dev settings", test "reload"
4. Modify JS app such that the app crashes, see it display redbox properly. Check if "reload" button works well from the redbox
5. Verify that "Show Perf Monitor" option works as expected. On Android >=6 re-install the app to see it ask for overlay permission at the moment when perf monitor option gets selected.

 - SYSTEM_ALERT_WINDOW permission will no longer be required on Android to display Redbox

 This change can break things for framework users who provide custom implementation of DevSupportManager interface on Android:

- **Who does this affect**: Owners of apps that use custom implementation of DevSupportManager interface on Android.

- **How to migrate**: Update `create` method of your `DevSupportManager`'s factory to take `ReactInstanceManagerDevHelper` type as a second argument instead of `ReactInstanceDevCommandsHandler`. The interface `ReactInstanceDevCommandsHandler` has been renamed to `ReactInstanceManagerDevHelper` but kept all the methods the same (new method got added). If you were calling one of three methods from `ReactInstanceDevCommandsHandler` interface (`onReloadWithJSDebugger`, `onJSBundleLoadedFromServer` and `toggleElementInspector`) you can call exact same methods directly on `ReactInstanceManagerDevHelper` instance that is being provided in exchange for `ReactInstanceManagerDevHelper `.

- **Why make this breaking change**:
This PR adds a new method to `ReactInstanceManagerDevHelper` called `getCurrentActivity`. In which case the prev name can no longer be justified. The activity is required for some of the DevSupportManager methods in order to start new dialogs and popups so that overlay permission isn't necessary.

- **Severity (number of people affected x effort)**:
Relatively small (perhaps Fb internally is using DevSupportManager abstraction to provide an alternative implementation but since it isn't documented I doubt anyone else uses it). Effort it very low as it boils down to updating uses of interface `ReactInstanceDevCommandsHandler` with `ReactInstanceManagerDevHelper` (all the methods in `ReactInstanceDevCommandsHandler` stays the same)
Closes https://github.com/facebook/react-native/pull/16596

Differential Revision: D6256999

Pulled By: achen1

fbshipit-source-id: 551d449e831da3de466726ead172608527fcfbb4
2017-12-07 18:39:46 -08:00
Paco Estevez Garcia 3d5dc872a4 Add callback for Connection/Disconnection to Metro
Reviewed By: bnham

Differential Revision: D6447126

fbshipit-source-id: d4c8a4dfb65c2a378f7fe696c8617ff5f3c6cb68
2017-12-07 09:52:08 -08:00
Jonathan Keljo 71006f74cd Fixes for migrating to Buck's source-only ABI feature
Reviewed By: dreiss

Differential Revision: D6475725

fbshipit-source-id: ac6725bbaaf2dbd78512a67497fbfcc044f59f60
2017-12-05 10:34:12 -08:00
Paco Estevez Garcia 7c7108a1e8 Add inspector attach to RN Dev Menu (Android)
Reviewed By: Hypuk

Differential Revision: D6405828

fbshipit-source-id: 9274c3e8748e6ce259357836dde7d53c4fce9fbf
2017-12-05 07:03:48 -08:00
Petter Hesselberg 5b83dbe25a Update stale JavaDoc reference
Summary:
I don't like JavaDoc errors

N/A; Change does not touch executable code
Closes https://github.com/facebook/react-native/pull/17023

Differential Revision: D6472273

Pulled By: shergin

fbshipit-source-id: 3131e17ca9925c42def02047082378fb3169c82b
2017-12-03 21:01:15 -08:00
Cory Reed d2f0abdf4e Fix Android comment and docblock typos
Summary:
👋 Hello! Thanks for react-native, it’s a great project.

I was digging into the Android implementation in _ReactAndroid_ and noticed a couple typos in the documentation. I went through and tried to fix all the typos I could find using [aspell](http://aspell.net).

Not applicable: these changes are only to comments, and CI should be skipped.

[ANDROID][ENHANCEMENT][*] - Correct comment and docblock typos
Closes https://github.com/facebook/react-native/pull/17049

Differential Revision: D6472182

Pulled By: shergin

fbshipit-source-id: 7e62cab118609596b483d1cf16c3abf651d6753b
2017-12-03 20:16:36 -08:00
Jonathan Keljo 801cbdb047 Autofixes for migrating to Buck's source-only ABI feature
Reviewed By: asp2insp

Differential Revision: D6441284

fbshipit-source-id: cfc96c5eb93a7260705fabc361763405c9fb38c6
2017-12-01 21:03:07 -08:00
Andres Suarez d674d48a7b Run buildifier over all BUCK files
Reviewed By: mzlee, dinhviethoa

Differential Revision: D6439498

fbshipit-source-id: ec847595afdd79434e48652d237d2533bbd2cad2
2017-11-29 20:30:43 -08:00
Ramanpreet Nara ca7fe72c31 Fix border-rendering in APIs < 18 cont.
Reviewed By: achen1

Differential Revision: D6418192

fbshipit-source-id: 2186a6103d6542f5ced332d5cb083b1f58bfd43d
2017-11-27 17:51:15 -08:00
Valentin Shergin 0bef872f3f TextInput: Fixed autoscroll to cursor on Android
Summary:
This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason.
The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases.
I also add a contentSize tracking in the example app to make sure that it is unaffected by this change.

https://pxl.cl/9RHP

https://github.com/facebook/react-native/issues/12799
https://github.com/facebook/react-native/issues/15778

Special thanks to konradkierus!

Reviewed By: sahrens

Differential Revision: D6405985

fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
2017-11-27 16:46:43 -08:00
Alexey Lang 028b64bcd3 Fix logging unpacking time when it happens concurrently with eager unpacking
Reviewed By: dcaspi

Differential Revision: D6413546

fbshipit-source-id: 9ae167ea2f816b070da29cf81f653af568aed01a
2017-11-27 12:32:32 -08:00
Ben Nham 70c359000a move inspector out of jschelpers
Differential Revision: D6385924

fbshipit-source-id: 1913d903077494cc0d86d5a8c8839620f1ecab0c
2017-11-27 07:23:37 -08:00
Lukas Wöhrl 1050e0b476 Add justify-content: space-evenly
Summary:
Adds new ```space-evenly``` for ```justify-content```.

Also adds a typofix in one of the other justify-content tests.

Fixes #657
Closes https://github.com/facebook/yoga/pull/658

Differential Revision: D6407996

Pulled By: emilsjolander

fbshipit-source-id: cc837409e1345624b4bd72c31e25fe68dcb0f6a3
2017-11-27 04:01:02 -08:00
Dmitry Zakharov dd888d3346 Fix boolean conversion in sync RN method calls.
Reviewed By: fromcelticpark

Differential Revision: D6408182

fbshipit-source-id: 251ab0cfe3197e59de0cb86816d5f0b908433b43
2017-11-24 12:31:41 -08:00
David Detlefs 05e862d48d Add Systrace-based telemetry to Hermes GC.
Reviewed By: amnn

Differential Revision: D6393879

fbshipit-source-id: d35a4647d000356dc99bce3187acc50d3a69ddeb
2017-11-23 15:15:54 -08:00
Rafael Oleza 968c88d141 Enable end to end deltas by default on Android
Reviewed By: mjesun

Differential Revision: D6406466

fbshipit-source-id: ab776d9ea89ed2ab83b8ede78be4e5d5f3074e34
2017-11-23 13:04:48 -08:00
James Reggio dc01eff72d Fix crash with non-zero blurRadius less than 1
Summary:
There's a crash-inducing bug with `Image.blurRadius` on Android.

`blurRadius` is specified in JavaScript as a `float`, but it's cast to `int` before being passed to the `IterativeBoxBlurPostProcessor`. However, in `IterativeBoxBlurPostProcessor`, there is an argument precondition requiring the integer `blurRadius` to be non-zero.

Because the `== 0` condition is evaluated on the `float`, it's possible for a `blurRadius` in the range of `(0, 1)` (non-inclusive) to pass the conditional, and then be truncated to `0` and passed as an argument to `IterativeBoxBlurPostProcessor`, which will fail its precondition and crash the app.

This change works in our app, which was previously crashing.

[ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1)
Closes https://github.com/facebook/react-native/pull/16845

Differential Revision: D6387416

Pulled By: shergin

fbshipit-source-id: d5191aa97e949ffd41e6d68c96b3c7bcbc82a52e
2017-11-21 12:30:49 -08:00
Ramanpreet Nara 5aa1fb3ff3 Fix border-rendering in APIs < 18
Summary:
`Canvas.clipPath` isn't supported with hardware acceleration in APIs below 18. The rounded border rendering logic for Android relies on this method. Therefore, rounded borders do not render correctly on such devices.

**Screenshot of Nexus 5 running API 17 (Before these changes):**
https://pxl.cl/9rsf

**The fix**: If the API version is less than 18 and we're rendering rounded borders, I disable hardware acceleration. Otherwise, I enable it. I'm going to check to see if this has perf regressions by running a CT-Scan.

With this change, rounded borders render correctly on Android devices running versions of Android between Honeycomb to JellyBean MR2.

**Screenshot of Nexus 5 running API 17 (After these changes):**
https://pxl.cl/9rrk

Reviewed By: xiphirx

Differential Revision: D6153087

fbshipit-source-id: 16e35be096051ac817c8b8bcdd132ecff3b4b167
2017-11-21 11:17:03 -08:00
Gabriel Peal 1e18d907bf Prevent a crash when no cursor drawable is set
Summary:
React Native 0.43 added additional functionality to setSelectionColor that also tints the cursor drawable of the View. However, some views may not have a cursor drawable set in which case, the code will crash when attempting to load a drawable with resource id 0.

We encountered this in our RN 0.45 upgrade in the Airbnb app.

lelandrichardson
Closes https://github.com/facebook/react-native/pull/14789

Differential Revision: D6386076

Pulled By: shergin

fbshipit-source-id: faa5a1edb3be8d08988f46205c0f22d17b63b5bc
2017-11-21 10:36:10 -08:00
Rafael Oleza f587f8d51d Enable end to end deltas by default on Android
Reviewed By: mjesun

Differential Revision: D6374111

fbshipit-source-id: f372242ddbb8a278041d1ebb2aace227a571c2e0
2017-11-20 13:16:11 -08:00
Dmitry Zakharov f1015664e9 Fix crash when destroying catalyst
Reviewed By: fromcelticpark

Differential Revision: D6373275

fbshipit-source-id: c36b53f023800097b301d530250b05e5b2a4dfca
2017-11-20 07:38:53 -08:00
Alexander Komissarov ad89ea7b50 check if listener is still in the set before calling onHostResume
Reviewed By: achen1

Differential Revision: D6341419

fbshipit-source-id: e49188803bbf3641bad6a9cc8c497d453798bbce
2017-11-17 11:20:45 -08:00
Rafael Oleza 231c7a0304 Add end to end Delta support to Android devices
Reviewed By: davidaurelio

Differential Revision: D6338677

fbshipit-source-id: 8fa8f618bf8d6cb2291ce4405093cad23bd47fc3
2017-11-17 07:47:38 -08:00
allengleyzer 3e4cf0e8d2 Added progress updates for all XMLHttpRequest upload types
Summary:
Previously, only form-data request bodies emitted upload progress updates. Now,
other request body types will also emit updates.

Addresses issues:
https://github.com/facebook/react-native/issues/15724
https://github.com/facebook/react-native/issues/11853

This is a bug fix for functionality that's missing on Android. These events are already working correctly on iOS.

Run the following code on Android, and ensure that events are being sent:
```
const fileUri = 'file:///my_file.dat';
const url = 'http://my_post_url.com/';
const xhr = new XMLHttpRequest();

xhr.upload.onprogress = (event) => {
    console.log('progress: ' + event.loaded + ' / ' + event.total);
}

xhr.onreadystatechange = () => {if (xhr.readyState === 4) console.log('done');}

console.log('start');

xhr.open('POST', url);

xhr.send({ uri: fileUri }); // sending a file (wasn't sending progress)
xhr.send("some big string"); // sending a string (wasn't sending progress)

const formData = new FormData(); formData.set('test', 'data');
xhr.send(formData); // sending form data (was already working)
```

[ANDROID] [BUGFIX] [XMLHttpRequest] - Added progress updates for all XMLHttpRequest upload types

Previously, only form-data request bodies emitted upload progress updates. Now,
other request body types will also emit updates.

Addresses issues:
https://github.com/facebook/react-native/issues/15724
https://github.com/facebook/react-native/issues/11853
Closes https://github.com/facebook/react-native/pull/16541

Differential Revision: D6325252

Pulled By: hramos

fbshipit-source-id: 4fe617216293e6f451e2a1af4fa872e8f56d4f93
2017-11-14 11:01:17 -08:00
Dmitry Zakharov cfa2bbf2f6 Remove minNumShakes from ReactInstaneManager
Reviewed By: kathryngray

Differential Revision: D6313521

fbshipit-source-id: ffef1f96fbec88cdcc7597fa81505aee59e10bb8
2017-11-14 09:38:03 -08:00
Dmitry Zakharov 4f886a29a1 Remove android_react_native_perf.use_separate_ui_bg_thread experiment.
Reviewed By: AaaChiuuu

Differential Revision: D6313250

fbshipit-source-id: 583a729a157a2053827631a43e38917753e78477
2017-11-14 06:58:46 -08:00
Dmitry Zakharov 053776338e Cleanup ReactInstanceManager
Reviewed By: kathryngray

Differential Revision: D6296922

fbshipit-source-id: 2fbf11f09a3c25ff3e7c222edc2e01b81e687943
2017-11-14 05:46:08 -08:00
Dmitry Zakharov 4894ac430d Remove splitting to BridgeCorePackage and ReactNativePackage.
Reviewed By: kathryngray

Differential Revision: D6286129

fbshipit-source-id: 8d75e610291402ccbffb137ce46e64d11826b950
2017-11-14 04:56:43 -08:00
Alex Dvornikov a47431ed74 Adopt split segments registration approach on Android
Differential Revision: D6284863

fbshipit-source-id: 0df6b90eb0cbeab4c8a2b11f1e4dcbd5d5dfab72
2017-11-09 12:23:51 -08:00
Alex Dvornikov cff0d8e0e5 Register split segment paths with RAMBundleRegistry
Differential Revision: D6284466

fbshipit-source-id: c80cf929af38f92f06cca5b366c58785ae992d83
2017-11-09 12:23:46 -08:00
Dmitry Zakharov 260e6d2355 Remove shared bridge experiment
Reviewed By: kathryngray

Differential Revision: D6284437

fbshipit-source-id: 14e0516f22dde04c0bbc4eb8fac603590d32d66a
2017-11-09 09:55:05 -08:00
Ramanpreet Nara 7170543e80 Make direction-aware borders work with APIs >= 17
Reviewed By: achen1

Differential Revision: D6189497

fbshipit-source-id: 848ca35540c5a4eb1581e0b7c39f8fa880540317
2017-11-08 10:31:21 -08:00