Commit Graph

6621 Commits

Author SHA1 Message Date
James a966c85fce Added ReactCommon to package.json to allow for building locally
Summary:
This pull request solves an error building from source as noted in https://github.com/facebook/react-native/issues/7911 and https://github.com/facebook/react-native/pull/7118. The error says BUILD FAILED due to cxxreact module not found. Previously the ReactCommon folder was excluded when installed from npm. There may be a better way to include this folder, but I'm unfamiliar with FB's build process.

**Test plan (required)**

Create a new sample project by npm init, npm install --save https://github.com/opensports/react-native.git. Then run react-native run-android and the project should build successfully.
Closes https://github.com/facebook/react-native/pull/7929

Differential Revision: D3391332

fbshipit-source-id: 710cb741cea2e212767b21d606e3a459347b0fb9
2016-06-05 14:13:20 -07:00
David Aurelio 8c3db9782e inline `Platform.select`
Summary: We are already inlining `Platform.OS`. This diff adds support to inline calls to `Platform.select` with an object literal as first argument. The transform will replace the call with the property value corresponding to the platform, or `undefined` if it does not exist.

Reviewed By: frantic

Differential Revision: D3385391

fbshipit-source-id: bb068d17948ed84e381707faeaa0450399c2f306
2016-06-05 05:58:20 -07:00
James 1facfb77da Fix for "Unable to resolve module nullthrows"
Summary:
Recreated due to mistake with https://github.com/facebook/react-native/pull/7594.
Closes https://github.com/facebook/react-native/pull/7934

Differential Revision: D3391010

fbshipit-source-id: 7aad253d29f2272cfdaace1c1bb4f54a63faa353
2016-06-05 03:13:25 -07:00
Kasim Tan f49f28ce15 Fix typo (shoud -> should)
Summary: Closes https://github.com/facebook/react-native/pull/7928

Differential Revision: D3390537

fbshipit-source-id: 97ce2331d0942ffe21078b3aec27daed20cd8af5
2016-06-04 16:43:41 -07:00
Pieter De Baets b91bf8eeac Update RCTActionSheetManager.m
Summary:
We use [self bridge] in this class but weren't synthesizing the bridge getters/setters.

Fixes https://github.com/facebook/react-native/issues/7890
Closes https://github.com/facebook/react-native/pull/7909

Differential Revision: D3390538

fbshipit-source-id: d75a1976af01b21887ddad5060ce635cf84abadd
2016-06-04 16:28:19 -07:00
Philipp von Weitershausen 58fb91e62b Android: allow app/build.gradle to specify how node gets invoked for the packager
Summary:
**Test plan:** With the given patch applied to `react.gradle`, I specified the following in my `android/app/build.gradle`:
```
project.ext.react = [
  nodeExecutableAndArgs: ["node", "--max_old_space_size=4096"]
]
```
and ensured in a `./gradlew installDebug --debug` run that the packager gets indeed invoked with these parameters.
Closes https://github.com/facebook/react-native/pull/7903

Differential Revision: D3390543

fbshipit-source-id: cf440b36633420b8f67070f47dfabf4c84cb28a7
2016-06-04 15:58:24 -07:00
Mohit Natoo 28b16dd294 use 'a uri' instead of 'an uri' as uri is pronounced as 'You R I'
Summary: Closes https://github.com/facebook/react-native/pull/7912

Differential Revision: D3390536

fbshipit-source-id: b0ca315b1e8b4b5ab0c7933cf995c9982a074afc
2016-06-04 15:58:24 -07:00
Marco Bonaldo 3f92e09787 Fix header elevation of NavigationExperimental
Summary:
Updated according to the documentation:  http://www.google.com/design/spec/what-is-material/elevation-shadows.html#elevation-shadows-elevation-android-
Closes https://github.com/facebook/react-native/pull/7289

Differential Revision: D3390296

Pulled By: ericvicenti

fbshipit-source-id: 4c475a6c4b6cd1c40b4d995ed18d31d9e179a69a
2016-06-04 12:43:22 -07:00
tantan e63ea3acc4 add progressListener for android when using FormData to upload files
Summary:
When using FormData upload images or files, in Android version, network module cannot send an event for showing progress.
This PR will solve this issue.
I changed example in XHRExample for Android, you can see uploading progress in warning yellow bar.
Closes https://github.com/facebook/react-native/pull/7256

Differential Revision: D3390087

fbshipit-source-id: 7f3e53c80072fff397afd6f5fe17bf0f2ecd83b2
2016-06-04 08:43:21 -07:00
Sean Kozer 0f35f7c6d5 Link React library to Tests target
Summary:
Fixes https://github.com/facebook/react-native/issues/2685
Closes https://github.com/facebook/react-native/pull/7918

Differential Revision: D3389814

fbshipit-source-id: d5054dae386d66e8055c883581f142ec24e60e18
2016-06-03 21:43:22 -07:00
Paul Shen e62a6a71c9 Typo fix in Touchable example
Summary:
**Test plan**

Run UIExplorer example and see that enabled TouchableHighlight example has correct text.

![image](https://cloud.githubusercontent.com/assets/2266187/15682555/2117ec9a-2713-11e6-9272-b868a8d8d705.png)
Closes https://github.com/facebook/react-native/pull/7853

Differential Revision: D3387862

fbshipit-source-id: c37bd1e5b01b778371978ac69a7cef43effb149f
2016-06-03 17:58:23 -07:00
Siqi Liu 5aa0e098b4 Intercepting all redboxes in Android Ads Manager
Summary:
Implement a handler to allow intercepting all RN redboxes in Android, including exceptions in both JS and Java.

The handler is not open sourced, so there is only an open-source interface called **RedBoxHandler** in //fbandroid/java/com/facebook/catalyst/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/devsupport//, meantime there is an internal class called **FBRedBoxHandler**, which implements **RedBoxHandler** and is located in //fbandroid/java/com/facebook/fbreact/redboxhandler//, actually handles the exception information.

The code structure is as follows:
  - **AdsManagerActivity** has a member variable of **FBRedBoxHandler**.
  - **AdsManagerActivity** passes this handler all the way down to the **DevSupportManagerImpl**, through** ReactInstanceManager**, **ReactInstanceManagerImpl**, **DevSupportManagerFactory**.
  - **DevSupportManagerImpl** intercepts the exceptions just before showing the redboxes, like this:

              mRedBoxDialog.setExceptionDetails(message, stack);
              mRedBoxDialog.setErrorCookie(errorCookie);
              if (mRedBoxHandler != null) {
                mRedBoxHandler.handleRedbox(message, stack);
              }
              mRedBoxDialog.show();

By now, the internal class just prints information for each redbox to logcat, including exception message and stack trace.

Reviewed By: mkonicek

Differential Revision: D3369064

fbshipit-source-id: 199012c4b6ecf4b3d3aff51a26c9c9901847b6fc
2016-06-03 17:13:23 -07:00
Gerald Monaco 5961764668 Recenter RCTScrollView when width or height are equal
Reviewed By: sahrens

Differential Revision: D3375944

fbshipit-source-id: 74f1c1f98364604a9be786ff233f230799d9b75d
2016-06-03 16:58:26 -07:00
Jonathan Stanton f4dbf37ba8 PushNotificationIOS requestPermission promisified
Summary:
**Motivation**
Today it's hard to build a good flow around requesting permissions if we don't know when the user rejects the push notification permission.

With this PR I wrap `PushNotificationIOS#requestPermission` in a promise. The promise will return with the updated permissions when the user accepts, rejects or has previously rejected the permission.

An example flow of how an app should handle push notifications with the change proposed:
1) Show user an explanation of push notification permissions with a button to enable,
2) User presses the enable push notifications button,
3) If the user accepts -> take them into the app,
4) if the user rejects -> explain how to enable permission in the settings app.
5) My app will now store some state about how it has asked permissions for push notifications so that the next time the user is taken through this flow they will go straight to step 4.

Without this change we could listen to the `register` event that PushNotificationIOS fires on the success sc
Closes https://github.com/facebook/react-native/pull/7900

Differential Revision: D3387424

Pulled By: nicklockwood

fbshipit-source-id: e27df41e83216e4e2a14d1e42c6b26e72236f48c
2016-06-03 16:28:30 -07:00
Nathan Azaria 724134746b Changed RCTTextView to check for failed focus
Reviewed By: nicklockwood

Differential Revision: D3378236

fbshipit-source-id: b4a33f7808ffe116b51631cde35f5cd0042caee9
2016-06-03 16:13:19 -07:00
Ewan Mellor 03512fb721 Fix the Origin: header used in WebSocket requests.
Summary:
RFC 6454 section 7 defines the Origin: header syntax, and it's a
scheme, host, and optional port, not a URL.

Section 6 defines serialization of the header, including omission of the
port.

Therefore, we need to omit the trailing slash in all cases, and omit
the port if it matches the default port for the protocol.
Closes https://github.com/facebook/react-native/pull/7920

Differential Revision: D3387619

fbshipit-source-id: 552756e63ad41463af357a5073fae56c96e58958
2016-06-03 15:13:41 -07:00
Martin Konicek 7028929d8f react-native link calls into rnpm
Summary:
An initial integration of rnpm into 'react-native link'.

**Test plan (required)**

    react-native init MyApp
    cd MyApp
    # copied local-cli into MyApp's node_modules
    npm install --save react-native-vector-icons
    react-native link react-native-vector-icons

The link code ran, Android build files were modified.
Closes https://github.com/facebook/react-native/pull/7895

Reviewed By: bestander

Differential Revision: D3379197

Pulled By: mkonicek

fbshipit-source-id: 597158623ed072d7a7fc55a01624233a0f79de23
2016-06-03 09:13:20 -07:00
sheparddw d16c6e926c Fix typo in ListViewDataSource documentation.
Summary: Closes https://github.com/facebook/react-native/pull/7860

Differential Revision: D3384941

Pulled By: javache

fbshipit-source-id: 8a9a9c3dbf8f921ee3f6597154347ec102783415
2016-06-03 06:28:23 -07:00
Igor Avramovic 7c3364196a Reverted commit D3369528
Differential Revision: D3369528

fbshipit-source-id: 4400411f43bc8396b3692d80b797eceed8899452
2016-06-03 05:43:26 -07:00
Jake Murzy 3ed00f140d Fix typo in NavigationTransitioner
Summary:
Typo.

🍺
Closes https://github.com/facebook/react-native/pull/7809

Differential Revision: D3384782

Pulled By: javache

fbshipit-source-id: edfd2c561dc19ac8ec8c526860b934bc19429c6a
2016-06-03 04:28:23 -07:00
Konstantin Raev f22e9353a7 Made react installed via reac-native init strict to unbreak 15.1.0
Summary:
React@15.1.0 is incompatible with React-Native@0.26.
This PR was cherry-picked to 0.26-stable branch now.

What this change does:
- react-native-cli (major release bump) saves exact versions of react-native and react (only in npm2) dependencies into package.json
- local-cli saves exact version of react (only npm3) dependency into package.json
Closes https://github.com/facebook/react-native/pull/7879

Differential Revision: D3384705

Pulled By: davidaurelio

fbshipit-source-id: d4dff418f9659bd083ae8826433a4e7c0355d03b
2016-06-03 03:43:31 -07:00
Andrei Coman 5de1151bdd Fix NPE in cancelling network calls
Summary:
Issue reported here
https://github.com/facebook/react-native/issues/7755#issuecomment-222950463

Converting int to Integer explicitly and not cancelling the call more than once
should fix it.

Reviewed By: bestander

Differential Revision: D3371238

fbshipit-source-id: cb00663b4ca19a788bd27b971b6447cc0788a818
2016-06-03 03:13:30 -07:00
Christian Ost 8fe58849a5 Update the documenation of ActionSheetIOS to include all possible options
Summary:
As it is shown in the examples, `subject` and `excludedActivityTypes` should be part of the documentation. `excludedActivityTypes` could be completed by a list of all possible options (see [UIActivity](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/#//apple_ref/doc/constant_group/Built_in_Activity_Types) documentation of Apple).

Screenshots of updated documentation:
![actionsheetios](https://cloud.githubusercontent.com/assets/12033337/15772879/0e54ca98-2974-11e6-9af5-df76c093ec5a.png)
Closes https://github.com/facebook/react-native/pull/7908

Differential Revision: D3384642

Pulled By: javache

fbshipit-source-id: 837e50eeabbcd532baf5ea1d4f8a64267c93c6ce
2016-06-03 02:58:31 -07:00
Basil Hosmer fe5c2615dd react-native-github: turn on strict type args in Flow, codemod stragglers
Reviewed By: frantic

Differential Revision: D3374980

fbshipit-source-id: 6dbefeffa588f676c8e162ba7ac7912b61a7711a
2016-06-03 02:43:57 -07:00
Kasim Tan a7f1428d4a Fix comment typos
Summary: Closes https://github.com/facebook/react-native/pull/7901

Differential Revision: D3384624

Pulled By: javache

fbshipit-source-id: 741343dec5406af1855624069dd8dc426a93bdb3
2016-06-03 02:43:57 -07:00
Philipp von Weitershausen e29350214a Correct semantics for XMLHttpRequest.responseText
Summary:
Accessing the `responseText` property when `responseType` is not `''` or `'text'` should throw. Also, the property is read-only.

**Test Plan:** UIExplorer example, unit tests
Closes https://github.com/facebook/react-native/pull/7284

Differential Revision: D3366893

fbshipit-source-id: a4cf5ebabcd1e03d6e2dc9d51230982922746c11
2016-06-02 18:13:23 -07:00
Kevin Lacker 16a97c8027 Update error message on unrecognized commands
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

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

Kevin: This isn't quite a typo, but it's a change to an error message.

In my experience, frequently when this error message is displayed, the command is unrecognized because I haven't run npm install, I just checked out a repo of someone else's. We could just update this error message a bit, and I think it would improve the developer experience.
Closes https://github.com/facebook/react-native/pull/7859

Differential Revision: D3379234

fbshipit-source-id: 4fb6e5bae20904871c9c4f7504013dc18b1fe707
2016-06-02 17:58:28 -07:00
Igor Avramovic c55e3649dd Lazy load platform specific code
Differential Revision: D3369528

fbshipit-source-id: 0fbc63fbac5e96468598fb3d0a86c6b20f96f39d
2016-06-02 17:43:25 -07:00
Philipp von Weitershausen 1f2027a1fe Android: allow app/build.gradle to specify additional packager arguments
Summary:
If for instance you're using a custom transformer, having this hook will let you specify it without forking all of react.gradle

**Test plan:** Specified some additional packager args in my app's `android/app/build.gradle`:
```groovy
project.ext.react = [
  bundleInDebug: true,
  extraPackagerArgs: ["--transformer", "path/to/my/transformer.js"]
]
```
and ensured they show up when gradle invokes the bundler.
Closes https://github.com/facebook/react-native/pull/7858

Differential Revision: D3382996

Pulled By: mkonicek

fbshipit-source-id: 437b2e6c902931d45b9d2f7ec97c833ba0cd3217
2016-06-02 17:28:39 -07:00
Chris Hopman db3adb4445 Cancel pending bridge work during shutdown
Reviewed By: mhorowitz

Differential Revision: D3381541

fbshipit-source-id: 51a3f766509ec78262792817dee3d5e6969ff05f
2016-06-02 17:13:27 -07:00
Ahmed El-Helw 68c11e55ee Promote grandchildren of certain views are Views
Reviewed By: astreet

Differential Revision: D3161232

fbshipit-source-id: ea313d513bd7567e32f18765d479ba0538f2efbf
2016-06-02 14:13:28 -07:00
Chris Hopman 9a6e61426d Fixes to NativeMap/Array
Reviewed By: mhorowitz

Differential Revision: D3376409

fbshipit-source-id: 4efd1a8567358baf2634008af77f7e743ace849e
2016-06-02 13:43:47 -07:00
Steven Luscher 1b2d4266b9 Update `fbjs-scripts` to ^0.7.0
Summary:
`fbjs-scripts` 0.4.0 has Babel 5 as a dependency, which causes some amount of havoc when you're trying to use `react-native` in a project that's otherwise dependent on Babel 6 and using the flat-installing npm >=3.
Closes https://github.com/facebook/react-native/pull/7855

Reviewed By: frantic

Differential Revision: D3371679

Pulled By: steveluscher

fbshipit-source-id: 9f7643171d89da0de0492e7e97875f472725e990
2016-06-02 11:43:19 -07:00
Konstantin Raev 9172597019 Returned flow checks to CI
Summary: Closes https://github.com/facebook/react-native/pull/7894

Differential Revision: D3379513

fbshipit-source-id: 49290b3582ae66ea99d19ec3f490bdb4436536dd
2016-06-02 10:58:36 -07:00
Konstantin Raev 75c6bf5723 Open sourced more instrumentation tests
Reviewed By: avaly

Differential Revision: D3373926

fbshipit-source-id: da520b61c5e74d515b853cf1d9548ed3e671aa50
2016-06-02 07:13:38 -07:00
Christine Abernathy aaf557da52 Fix instructions so react-native packages are installed first
Summary:
Post React 15.x one of the files pulled in for documentation reside in that repo: NativeMethodsMixin.js

This ensures that developers install react-native packages first (which includes React) so the file can be found when it's referenced in server/extractDocs.js

**Test plan (required)**

1. Ran through the instructions.
2. Made sure http://localhost:8079/react-native/docs/nativemethodsmixin.html exists in the nav and is shows correctly.
Closes https://github.com/facebook/react-native/pull/7882

Differential Revision: D3376395

Pulled By: caabernathy

fbshipit-source-id: bfcef271516ed2b21f04d86114dfceb2ff35138c
2016-06-01 17:58:22 -07:00
Chris Hopman 886a558f75 Extract all NativeArray/NativeMap from OnLoad.cpp
Summary: These will, eventually, need to be moved to the new bridge and so must become standalone things. For *NativeArray, this is almost just moving them out into their own .h/.cpp files. The *NativeMaps are updated to be hybrids instead of countables (in addition to getting their own .h/.cpp).

Reviewed By: mhorowitz

Differential Revision: D3325169

fbshipit-source-id: 40cfcab92b3fb2310bcd4de8f39e82f85d404abd
2016-06-01 16:28:32 -07:00
Alex Kotliarskyi 0d1d7ba2b7 Remove dead SourceMap code
Summary:
In several pervious diffs we have moved symbolication of JS stack traces
to the packeger. This lets us save a bunch of memory (~80MB) and CPU on device,
reduces dependency on JS after exception occured.

This diff cleans up a bunch of code that was used to do symbolication on client side.

Reviewed By: javache

Differential Revision: D3348676

fbshipit-source-id: 88baa5c502836c9ca892896e1ee5d83db37486d3
2016-06-01 13:59:16 -07:00
Alex Kotliarskyi 2ef533352f Extract symbolicateStackTrace into its own module
Summary:
Having a function that symbolicates any given stack trace
is convenient, e.g. in #7459

More cleanup to follow.

Reviewed By: davidaurelio

Differential Revision: D3348616

fbshipit-source-id: 6313ec837869c6080829c811345a06aa1b2dcd21
2016-06-01 13:59:16 -07:00
Alex Kotliarskyi 7e100ac7a2 Extract getDevServerURL into reusable module
Summary:
Many RN devtools (inspector, source maps, etc.) rely on packager.
This refactors individual SourceCode.scriptURL parsing into one function
that will be easier to change in the future.

Reviewed By: javache

Differential Revision: D3348465

fbshipit-source-id: 5a55939ea59e1517cb63bcbe4963f57f02ab15f3
2016-06-01 13:59:16 -07:00
Martín Bigio bbc6139baf Reverted commit D3348218
Summary:
The TextInput when configured with `multiline=true` has a minor issue due to which if the initial text doesn't fit in one line, the input won't span multiple lines. The root cause of the problem is that the `onChange` event is not fired for the initial render. This issue has been reported on open-source: 481f560f64

This is an attempt to fix this problem by moving the logic to fire the event to the method that updates the content size. This way we can guarantee that anytime the content size changes we'll trigger the JS event.

The downside of this approach is that it's possible that multiple events get fired for a single character change. As per the comment that was removed, this was already happening when adding a character that when rendered, would increase the content size. By moving the code to the new place, this can happen more often (twice per character tapped). Let me know if you think this is an issue.

I don't know this code much, so please be careful reviewing. I'm happy to add more test cases I may have missed to the test plan :).

Reviewed By: nicklockwood

Differential Revision: D3348218

fbshipit-source-id: 6b457624c9126e771c326eac61cd1cdd6496671d
2016-06-01 13:38:33 -07:00
Adam Comella ee8496f364 iOS: Support HTTP headers for source prop on <Image> components
Summary:
Allows developers to specify headers to include in the HTTP request
when fetching a remote image. For example, one might leverage this
when fetching an image from an endpoint that requires authentication:

```
<Image
  style={styles.logo}
  source={{
    uri: 'http://facebook.github.io/react/img/logo_og.png',
    headers: {
      Authorization: 'someAuthToken'
    }
  }}
/>
```

Note that the header values must be strings.

Works on iOS and Android.

**Test plan (required)**

- Ran a small example like the one above on iOS and Android and ensured the headers were sent to the server.
- Ran a small example to ensure that \<Image\> components without headers still work.
- Currently using this code in our app.

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

Reviewed By: javache

Differential Revision: D3371458

Pulled By: nicklockwood

fbshipit-source-id: cdb24fe2572c3ae3ba82c86ad383af6d85157e20
2016-06-01 10:43:28 -07:00
Jakob Kerkhove cec913e7ce Native propTypes RCTDatePickerIOS !== propTypes DatePickerIOS
Summary:
The propTypes of RCTDatePickerIOS do not fit with the propTypes of DatePickerIOS.
All dates (date, minimumDate, maximumDate) are a timestamp (check line 126), so they should have propType number.
OnDateChange function should not be required since it is called onChange in the iOS implementation.

The problem currently causes warnings that the given types are wrong, while they were added correctly.
Closes https://github.com/facebook/react-native/pull/7833

Differential Revision: D3371324

Pulled By: nicklockwood

fbshipit-source-id: bca5b2bbe7e9dd2e045288bfbd268578848c7bff
2016-06-01 08:58:22 -07:00
Siqi Liu 0cc0aaecbb Followup for Add Shortcut "Double R" to Reload JS in iOS
Summary: Change nit codes in comments.

Reviewed By: mkonicek

Differential Revision: D3371536

fbshipit-source-id: 4133af88568f15410ff90c945695f82ffd94eb95
2016-06-01 08:43:29 -07:00
Martín Bigio 572a85fa24 Fix multiline TextField initial render
Summary:
The TextInput when configured with `multiline=true` has a minor issue due to which if the initial text doesn't fit in one line, the input won't span multiple lines. The root cause of the problem is that the `onChange` event is not fired for the initial render. This issue has been reported on open-source: 481f560f64

This is an attempt to fix this problem by moving the logic to fire the event to the method that updates the content size. This way we can guarantee that anytime the content size changes we'll trigger the JS event.

The downside of this approach is that it's possible that multiple events get fired for a single character change. As per the comment that was removed, this was already happening when adding a character that when rendered, would increase the content size. By moving the code to the new place, this can happen more often (twice per character tapped). Let me know if you think this is an issue.

I don't know this code much, so please be careful reviewing. I'm happy to add more test cases I may have missed to the test plan :).

Reviewed By: nicklockwood

Differential Revision: D3348218

fbshipit-source-id: d3da3c0da1a0da9b9960625441191497e91d322e
2016-06-01 08:13:27 -07:00
Konstantin Raev 88190f7e9d A few instrumentation tests were fixed and are supposed to be more stable
Reviewed By: avaly

Differential Revision: D3354433

fbshipit-source-id: 4e3f00fae94e5cb910e188b0e3fbe204361a4d01
2016-06-01 08:13:27 -07:00
Emilio Rodriguez e87bea464b Replaced old password prop with secureTextEntry
Summary: Closes https://github.com/facebook/react-native/pull/7783

Differential Revision: D3371521

Pulled By: javache

fbshipit-source-id: f442b549e6fc8c2c8e5ec12f32185bfabafbdd81
2016-06-01 06:58:24 -07:00
Nick Lockwood 002024cc45 Removed hard-coded DatePicker width
Summary: The DatePicker had a hard-coded width of 320 for no reason I can think of. Removing it allows the DatePicker to naturally scale to fit the width of the container, which is how the regular Picker works already.

Reviewed By: lexs

Differential Revision: D3371355

fbshipit-source-id: e06d31f7275de41bb00226232cf47ad022d25b4d
2016-06-01 06:58:23 -07:00
Nick Lockwood bdcdfb03d4 Fixed "Sending `didSendNetworkData` with no listeners registered" warning
Summary:
XMLHttpRequest was sending the request before registering any listeners, resulting in a warning from the native event emitter.

Since we weren't seeing widespread problems with XHR missing data, this was probably working OK in practice because the queuing of events meant that the listener would have been registered before the message was actually delivered.

Still, this was working more through luck than design. This diff fixes it by registering the listeners *before* sending the request.

Reviewed By: lexs

Differential Revision: D3371320

fbshipit-source-id: c688d4053a61f856eaacccd0106905edbefcc86a
2016-06-01 06:28:22 -07:00
Konstantin Raev aa53770c25 removed unused code: _numPrependedModules
Summary:
cc davidaurelio
Closes https://github.com/facebook/react-native/pull/7873

Differential Revision: D3371406

Pulled By: javache

fbshipit-source-id: 72ed3838a88022ae5c0832dcca5abda75f18dbe1
2016-06-01 06:28:22 -07:00