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

11434 Коммитов

Автор SHA1 Сообщение Дата
Vojtech Novak 23236952b3 fix typo
Summary:
properties that has been set before -> properties that have been set before
Closes https://github.com/facebook/react-native/pull/15370

Differential Revision: D5563802

Pulled By: hramos

fbshipit-source-id: 288032555308a7e89ac365ff091b01ca381d4c80
2017-08-04 11:05:02 -07:00
Martin Raedlinger fb371af32d troubleshooting docs (clone #14885)
Summary:
I added troubleshooting docs for connection to the development server from device, otherwise it's maybe hard to find out why it's not working.

Due to a disparity in what GitHub's API return the original PR (https://github.com/facebook/react-native/pull/14885) couldn't get imported, so I created a new PR as hramos suggested.
Closes https://github.com/facebook/react-native/pull/15304

Differential Revision: D5537615

Pulled By: hramos

fbshipit-source-id: b94e887b1b771be9e93854124bd0a56b27fd0097
2017-08-04 09:50:02 -07:00
Maxime Goovaerts 546a43bda0 Expose offset parameters for ToastAndroid
Reviewed By: brosenfeld

Differential Revision: D5560628

fbshipit-source-id: b1457493e8429958fbd7bc9c490cffaa33b4a95a
2017-08-04 09:07:21 -07:00
Pieter De Baets f3feca91fc Add deprecation warning to RCTBatchedBridge
Reviewed By: fkgozali

Differential Revision: D5553607

fbshipit-source-id: 94a69264231c4adc1648e34ad64833f042e0d4db
2017-08-04 07:56:14 -07:00
Pieter De Baets e697ed75d1 Report native warnings to YellowBox
Reviewed By: fkgozali

Differential Revision: D5553601

fbshipit-source-id: b80f019b11d02865a17a25cbff61edf65173cd84
2017-08-04 07:56:14 -07:00
Aaron Chiu 43ff9b4252 run onReactContextInitialized() on the UIThread
Reviewed By: furdei

Differential Revision: D5560722

fbshipit-source-id: 9871761dc5b314776c27128cfc51e0a414f9a736
2017-08-04 02:00:28 -07:00
Ville Immonen 6e99e314b2 Move HelloWorld template to a single index.js entry point
Summary:
This change (initially discussed in https://github.com/react-community/create-react-native-app/issues/26) moves the HelloWorld project template from two nearly identical entry points (`index.android.js` and `index.ios.js`) to a single, minimal `index.js` entry point. The root component is created in `App.js`. This unifies the project structure between `react-native init` and Create React Native App and allows CRNA's eject to use the entry point from the HelloWorld template without any hacks to customize it. Also examples in the docs can be just copy-pasted to `App.js` the same way in both HelloWorld and CRNA apps without having to first learn about  `AppRegistry.registerComponent`.

* Created a new project from the template using `./scripts/test-manual-e2e.sh` and verified that:
  * The app builds, starts and runs both on Android and iOS.
  * Editing and reloading changes works.
  * The new files (`index.js`, `App.js`, `__tests__/App.js`) get created in the project folder.

<img width="559" alt="screen shot 2017-08-01 at 19 10 51" src="https://user-images.githubusercontent.com/497214/28835171-300a12b6-76ed-11e7-81b2-623639c3b8f6.png">
<img width="467" alt="screen shot 2017-08-01 at 19 09 12" src="https://user-images.githubusercontent.com/497214/28835180-33d285e0-76ed-11e7-8d68-2b3bc44bf585.png">

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15312

Differential Revision: D5556276

Pulled By: hramos

fbshipit-source-id: 068fdf7e51381c2bc50321522f2be0db47296c5e
2017-08-03 14:02:43 -07:00
Ben Nham f5f5ed5ba6 add way for JS to query process-wide perf stats
Reviewed By: alexeylang

Differential Revision: D5555533

fbshipit-source-id: a4c16e004552b8f655ede08548c5242486b5ebb8
2017-08-03 13:13:25 -07:00
Vojtech Novak 1de9a35f14 document how to export consts from a swift native module
Summary:
I documented how to export consts from a swift native module.
Closes https://github.com/facebook/react-native/pull/15340

Differential Revision: D5556264

Pulled By: hramos

fbshipit-source-id: 0374f1c291e3c15424c8e53fef7ab30c60643165
2017-08-03 13:13:25 -07:00
Ville Immonen 6f4025e322 Make the CLI recognize CRNA projects
Summary:
1. Make running `react-native run-ios` or `react-native run-android`
inside a project created with Create React Native App run the
corresponding react-native-scripts command instead of failing.

    **Before**:
    <img width="762" alt="screen shot 2017-07-21 at 16 55 32" src="https://user-images.githubusercontent.com/497214/28467425-86b309c8-6e38-11e7-8946-139bda927d93.png"><img width="762" alt="screen shot 2017-07-21 at 16 55 52" src="https://user-images.githubusercontent.com/497214/28467436-8df02482-6e38-11e7-8a03-3fa664944cac.png">
    **After**:
    <img width="762" alt="screen shot 2017-07-21 at 16 52 15" src="https://user-images.githubusercontent.com/497214/28467522-e4bb6cae-6e38-11e7-97bb-9cfa9cb4dc67.png">

2. Make running `react-native link` inside a CRNA project display a
helpful error message.

    **Before**:
    <img width="762" alt="screen shot 2017-07-21 at 16 55 10" src="https://user-images.githubusercontent.com/497214/28467608-1d1781fa-6e39-11e7-9620-cc16c8b1b40f.png">
    **After**:
    <img width="762" alt="screen shot 2017-07-21 at 16 53 10" src="https://user-images.githubusercontent.com/497214/28467637-2cd6ed1a-6e39-11e7-8947-6df69b3f321e.png">

Fixes #14828.

* Run `react-native run-ios`, `react-native run-android` and `react-native link` in:
  * A CRNA project (screenshot above)
  * A traditional RN project (existing behaviour)
  * A folder that contains neither (existing behaviour)
Closes https://github.com/facebook/react-native/pull/15139

Differential Revision: D5498914

Pulled By: hramos

fbshipit-source-id: 94b6196e3451857bbaa45335a01643c89bed19a0
2017-08-03 12:10:47 -07:00
James Ide 6e2e53f49b Remove more unused jest-related devDependencies
Summary:
Several of the jest-related devDependencies are not directly used -- removing them from package.json.
Closes https://github.com/facebook/react-native/pull/15345

Differential Revision: D5553879

Pulled By: mjesun

fbshipit-source-id: 5ceacaa29bb7e80746a97345fb105ff19ccbf716
2017-08-03 09:16:23 -07:00
glevi@fb.com f0f1b12d9e @allow-large-files [Flow] Deploy v0.52.0 to xplat
Reviewed By: samwgoldman

Differential Revision: D5548893

fbshipit-source-id: b772423f11ff53f85a29b002226c5581c073f9ff
2017-08-03 08:06:58 -07:00
Ats Jenk c9aeaf675d Separate window dimensions change from orientation
Summary:
**Summary:**
There was a bug with RN.Dimensions returning incorrect window dimensions. In certain cases when device was in portrait, window dimensions reported landscape dimensions and vice versa.

This happened because in certain scenarios, after device orientation changed, dimensions update event from ReactRootView had incorrect dimensions.
Was able to reproduce this when device was rotated during app launch. After rotation global layout listener callback gets invoked. Inside the callback current and previous orientations are compared. When a change is detected, orientation and dimension change events are sent to JS. It is assumed, when orientation changes, new dimensions are available immediately. This is not the case for window dimensions as they are retrieved from resources object which gets updated asynchronously after orientation change. In cases when app is doing a lot of work on the main thread, like app startup, it takes more time to update the resources object. And when orientation change is detected in global layout, resources object is not updated with new dimensions yet. This causes dimensions update to be sent to JS with old window dimensions.
Global layout listener callback does get invoked a second time when resources object is finally updated with new dimensions, but since orientation no longer changes, no event is sent to JS.

Fixed this by separating dimensions update from orientation update. Now RN keeps track of previous window and screen dimension values. When a change is detected, an event is sent to JS with updated dimensions. This ensures that whenever dimensions change, JS gets the updated values.

This has a side effect of sending dimension update twice in some cases.
One example is the case above where window dimensions take time to update, but screen dimensions are updated immediately. This will cause two events to be sent to JS. One for window dimensions and one for screen dimensions update.
Other change is that initial value for both window and screen fields is empty. Which results in first change to trigger an event. Previously initial orientation value was 0 which meant when app started in normal portrait orientation, first layout did not trigger a dimension update event. Now even first layout sends the event. This should not be an issue as it is to make sure dimensions in JS side are correct.

**Testing:**
Verified with a sample app that correct dimensions are available when app launches.
Verified that after orientation dimensions are updated.
Verified that in the scenario described above where window dimensions are updated later, we get correct dimension values in JS.
We have incorporated this fix into our app and have been testing it internally.

Ats Jenk
Microsoft Corp.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15181

Differential Revision: D5552195

Pulled By: shergin

fbshipit-source-id: d1f190cb960090468886ff56cda58cac296745db
2017-08-02 21:07:35 -07:00
Nivetha Singara Vadivelu 1748922c15 Retrieve correct content uri for videos
Reviewed By: furdei

Differential Revision: D5547060

fbshipit-source-id: 6d3a6273ffbaa179081254e46204211b31faacf2
2017-08-02 20:07:26 -07:00
Luy Tran ccb0899658 add setNativeProps to SectionList
Summary:
```js
componentDidMount() {
  this._list.setNativeProps({scrollEnabled: false})
}

render() {
  const sections = [
    {key: 'foo', data: [{name: 'Jone Doe', key: 'a'}, {name: 'Susan Briz', key: 'b'}],
    {key: 'bar', data: [{name: 'David Mark', key: 'c'}, {name: 'Daniel Campbell', key: 'd'}]
  ]

  return (
    <SectionList
      ref={c => (this._list = c)}
      sections={sections}
      renderItem={({item}) => <Text>{item.name}<Text>}
    />
  )
}
```
Closes https://github.com/facebook/react-native/pull/15328

Differential Revision: D5546636

Pulled By: javache

fbshipit-source-id: 25aec067879be1571db5c3a09b5f0952826220ac
2017-08-02 17:43:40 -07:00
Paco Estevez Garcia 36c694364f Assure the Inspector socket runs through the lifecycle of ReactNative
Reviewed By: AaaChiuuu

Differential Revision: D5538894

fbshipit-source-id: f48d7a1df344bd3a16f5c170b0955b7d2ef35913
2017-08-02 17:43:39 -07:00
James Ide 6a3128457f Remove unused npm packages and move CI dependency to devDependencies
Summary:
There are several npm packages that are no longer used and do not show up when grepping the code base. Also the "async" dependency is used only in CI and should be moved to devDependencies.
Closes https://github.com/facebook/react-native/pull/13517

Differential Revision: D4963775

Pulled By: hramos

fbshipit-source-id: 8b6d2d67e65c8ba19c7f91ecfdd70ef731c7c46b
2017-08-02 11:07:22 -07:00
Dmitry Patsura 30d5b9dbf5 RCTNavigatorManager - drop unneeded error callback
Summary:
Hey!

So, I was interested to contibure, and started from todo

Thank
Closes https://github.com/facebook/react-native/pull/14823

Differential Revision: D5546610

Pulled By: javache

fbshipit-source-id: 58e1b67786cbafa20399ac12dde9fcc3920abe94
2017-08-02 10:23:42 -07:00
Finian 4a8ad10b4d Docs: fix typo
Summary:
Fix typo in NativeModulesIOS.md doc
Closes https://github.com/facebook/react-native/pull/15306

Differential Revision: D5536657

Pulled By: javache

fbshipit-source-id: da8d183ef97995baa3b44595ff63ca3b1ced6b4e
2017-08-02 03:12:44 -07:00
Ville Immonen ac293fc38b Fix a broken link in CONTRIBUTING.md
Summary:
<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15309

Differential Revision: D5536296

Pulled By: javache

fbshipit-source-id: 372da897b93fc0b4e5b0de343966932314f4f3fb
2017-08-02 03:12:43 -07:00
Luke Rhodes cb1b1e58b3 Fixes unintended side effects caused by #14684
Summary:
I had fixed this locally but hadn't updated the original pull request, sorry. This commit is working for us in production.
Closes https://github.com/facebook/react-native/pull/14900

Differential Revision: D5539787

Pulled By: hramos

fbshipit-source-id: 6c826ada4a7f36607c65508ced6c9dce32002f74
2017-08-01 14:10:31 -07:00
Hector Ramos 471c9da4d6 Fix navigation menu regression on mobile
Summary:
Regression introduced in 75eb55096e and identified by Conor O'Donnell (https://twitter.com/ronocod/status/892400271980146689).

Verify mobile layout on iPhone 6, iPhone 7 Plus, Galaxy S5, Nexus 5.
<img width="269" alt="screen shot 2017-08-01 at 9 13 42 am" src="https://user-images.githubusercontent.com/165856/28835318-cdd20cc8-7699-11e7-9232-a657a93cfb1c.png">

Verify desktop layout at widths ranging from 400px to 1400px.

<img width="1303" alt="screen shot 2017-08-01 at 9 14 44 am" src="https://user-images.githubusercontent.com/165856/28835352-e33a97e2-7699-11e7-969e-db607e9a0162.png">
Closes https://github.com/facebook/react-native/pull/15314

Differential Revision: D5537209

Pulled By: hramos

fbshipit-source-id: 3ccf71a90dda4b9b1a059178a400bea9f253bf14
2017-08-01 09:50:10 -07:00
Adlai Holler 24df099835 RCTProfile: Use C atomics instead of OSAtomic
Summary:
This will save us precious microseconds and it's prettier to look at.
Closes https://github.com/facebook/react-native/pull/15276

Differential Revision: D5531823

Pulled By: javache

fbshipit-source-id: f8a97ec2a03e3cfdf1801457a481ec62a9371eeb
2017-08-01 04:00:32 -07:00
Pieter De Baets c1c791fb59 Provide default implementation of getConstants
Reviewed By: kathryngray

Differential Revision: D5453963

fbshipit-source-id: cf3d42a86c3262991697e9c1a23ab90b7f742afe
2017-08-01 03:33:41 -07:00
Adlai Holler 114b0801ce RCTImage: Use C atomics instead of OSAtomic
Summary:
The next in my series of :atom: migrations.
Closes https://github.com/facebook/react-native/pull/15278

Differential Revision: D5526468

Pulled By: javache

fbshipit-source-id: 91511c69bc37a6f1382bcf0b0dd847adf10fd43a
2017-08-01 02:51:03 -07:00
Ville Immonen e248980980 Fix broken Buck installation link
Summary:
Running `./scripts/run-android-local-unit-tests.sh` without having
installed Buck displays this link. Make it point to a URL that exists.
Closes https://github.com/facebook/react-native/pull/15292

Differential Revision: D5529392

Pulled By: hramos

fbshipit-source-id: e100823d04fef79a8ecce0e9626fa05864e0aaf8
2017-07-31 13:03:20 -07:00
Adam Miskiewicz 1954438533 Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView
Summary:
In iOS11, Apple added a new layout feature called "Safe Areas" (this blog post talks a bit about it: https://www.bignerdranch.com/blog/wwdc-2017-large-titles-and-safe-area-layout-guides/).

UIScrollView is one component that is affected by this change in Apple's API. When the `contentInsetAdjustmentBehavior` is set to `automatic`, for example, it will adjust the insets (and override any manually set insets) automatically based on whether or not there's a UINavigationBar, a UITabBar, a visible status bar, etc on the screen. Frustratingly, Apple decided to default to `Automatic` for this behavior, which will cause any apps that set contentInset/contentContainerStyle padding to have their values offset by, at the very least, the size of the status bar, when they compile their app for iOS 11. Here's more information about this behavior: https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior?language=objc

Mostly, this is a really straightforward change -- it simply adds a new iOS-only prop to ScrollView that allows setting `contentInsetAdjustmentBehavior`. But I did decide to default the behavior to `never`, so that it mimics the behavior we've seen in iOS < 11. I think it's good to keep something as crucial as scrollview content insets non-magical, and also keep it behaving similarly between platforms.
Closes https://github.com/facebook/react-native/pull/15023

Reviewed By: javache

Differential Revision: D5517552

Pulled By: hramos

fbshipit-source-id: c9ce4bf331b3d243228268d826fdd4dcee99981d
2017-07-31 12:23:34 -07:00
tenodi 73f8352e92 Blog post for React Native monthly meeting #2
Summary:
A blog post with notes from the second React Native monthly meeting. I've gathered notes after the meeting in this blog post.

No test plan, submitting just a documentation file.

cc hramos
Closes https://github.com/facebook/react-native/pull/15257

Differential Revision: D5528121

Pulled By: hramos

fbshipit-source-id: c9688596d0f4b13600f3f1f18d7c122665de1fc2
2017-07-31 11:21:53 -07:00
Pieter De Baets cb313569e5 Increase information logged to MessageQueue.spy
Reviewed By: dulinriley

Differential Revision: D5517734

fbshipit-source-id: de7ba08130d229882256bcb1496d6efc708bdce7
2017-07-31 06:16:41 -07:00
Adlai Holler 0f440130b6 Standardize project indentation settings on 2 spaces
Summary:
Hi React Native folks! Love your work!

To make contributing easier, this sets the indentation settings of all the Xcode projects to 2 spaces to match their contents.
Closes https://github.com/facebook/react-native/pull/15275

Differential Revision: D5526462

Pulled By: javache

fbshipit-source-id: cbf0a8a87a1dbe31fceed2f0fffc53839cc06e59
2017-07-31 05:20:03 -07:00
Douglas Lowder 75284d3cd4 Apple TV: Enable long presses on TV remote; dev menu on TV device; example code
Summary:
**Motivation**

Properly support long presses on the Apple TV remote, and also enable dev menu functionality on a real Apple TV device (shaking an Apple TV doesn't work 😄 )

**Test plan**

New example added to `RNTester`.
Closes https://github.com/facebook/react-native/pull/15221

Differential Revision: D5526463

Pulled By: javache

fbshipit-source-id: a61051e86bc82a9561eefc1704bed6b1f2617e05
2017-07-31 04:06:32 -07:00
Niranjan Bhaskar e61257cd0a changed param of setSrc() method
Summary:
setSource() method of ReactImageView class accepts a ReadableArray and not a plain String.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15280

Differential Revision: D5526483

Pulled By: javache

fbshipit-source-id: 5bc8ca8e7e030f5a4968cccf8fcb7431612e1836
2017-07-31 03:35:29 -07:00
Adlai Holler 52d546caa2 CameraRoll: Use C atomic instead of OSAtomic
Summary:
The last in my series of :atom: migrations. More to come!
Closes https://github.com/facebook/react-native/pull/15279

Differential Revision: D5526467

Pulled By: javache

fbshipit-source-id: 02b37387c8c47af9ffe42b938ddcf17eb15b916f
2017-07-31 03:35:28 -07:00
Adlai Holler 7c528cd569 RCTCxxBridge: Use C++ atomic
Summary:
The next in my series of :atom: migrations.
Closes https://github.com/facebook/react-native/pull/15277

Differential Revision: D5526460

Pulled By: javache

fbshipit-source-id: e4ba54a5911c4a76280edf8aa164ac5aa935a945
2017-07-31 03:35:18 -07:00
Alexis Jacquelin 688c74693b Fix misspelling UIKit
Summary: Closes https://github.com/facebook/react-native/pull/15240

Differential Revision: D5524387

Pulled By: shergin

fbshipit-source-id: a35f40d24fd59c7a07b10504f1f64825da864b5d
2017-07-29 08:04:52 -07:00
Theo Yaung a6ad4a059a Reduce log level for connection errors
Reviewed By: bnham

Differential Revision: D5523206

fbshipit-source-id: ccc3d0862444c5ff4dc42c4fd00e418e15b2a31e
2017-07-28 18:31:22 -07:00
Jean Lauliac be0f2288fe metro-bundler: upgrade all jest refs to delta.4
Reviewed By: mjesun

Differential Revision: D5503722

fbshipit-source-id: ca5d1e684e6b909804ae2be8c2055439dda611f5
2017-07-28 13:06:50 -07:00
Garrett McCullough 404d74bd1e update docs for Transforms
Summary:
Documentation change only.

Filled out the Transforms docs a little more to indicate which props are now deprecated and to provide some guidance on the transform array since some values are expected to be strings and some are numbers

http://facebook.github.io/react-native/docs/transforms.html
Closes https://github.com/facebook/react-native/pull/15261

Differential Revision: D5518925

Pulled By: hramos

fbshipit-source-id: 9aacf2c23e85573e150feb8c34e8bed54ad565d5
2017-07-28 12:49:01 -07:00
David Reiss 278cd5747f Mark React Native annotation processors as non-ABI-affecting
Reviewed By: AaaChiuuu

Differential Revision: D5518898

fbshipit-source-id: 652e5a70d27a0e598b2b6ae8f73d9d4fe19dfd36
2017-07-28 12:49:01 -07:00
Tim Wang 0e93f4fa29 Fix SectionList examples in documentation
Summary:
Document to change http://facebook.github.io/react-native/releases/next/docs/sectionlist.html

This example is not documented incorrectly.

According to Flow-type in the [source code](https://github.com/facebook/react-native/blob/master/Libraries/Lists/SectionList.js#L25-L52) the `title` is not required and the `renderItem` method takes wrong `item.title` for rendering in example. See https://github.com/facebook/react-native/pull/15234#issuecomment-318555336

![screen shot 2017-07-28 at 12 24 03 pm](https://user-images.githubusercontent.com/8013313/28702472-b72d160a-738f-11e7-96ba-dcd7e8ce4ff2.png)
Closes https://github.com/facebook/react-native/pull/15234

Differential Revision: D5518721

Pulled By: hramos

fbshipit-source-id: 4effe3778aac09a0807acc8a002e588ea2d723f9
2017-07-28 12:49:01 -07:00
Simon Ayzman bf7cf189b8 Added documentation for iOS app extensions
Summary:
Work in progress.
Closes https://github.com/facebook/react-native/pull/15194

Differential Revision: D5518704

Pulled By: hramos

fbshipit-source-id: 995a6a9a88e48e8988074b81a95c8aed0e0c3cdf
2017-07-28 12:36:14 -07:00
Raj Suvariya a31a0122d9 Update IntegrationWithExistingApps.md
Summary:
The name should be "MyReactNativeApp" otherwise it gives error that the HelloWorld Application is not found

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15251

Differential Revision: D5518727

Pulled By: hramos

fbshipit-source-id: d9a2eac4698927f17f25a2316bd5674bb227821e
2017-07-28 12:02:12 -07:00
Nurzhan Bakibayev 99414e9af6 Fix typo in RCTDevSettings.mm
Reviewed By: javache

Differential Revision: D5517560

fbshipit-source-id: c679ab8b209b37053574a235110d3f4de87c8868
2017-07-28 11:49:42 -07:00
Tom Clarkson 42f7b9e717 Improved window.postMessage implementation
Summary:
Adds a queue to postMessage so that messages sent close together are not lost.

Setting location="a";location="b" results in only "b" reaching shouldStartLoadWithRequest. Making the second update asynchronous with setTimeout does not fix the issue unless a delay is added.

With this update, postMessage queues "b" until it gets a "message:received" event that confirms "a" has already been processed.

The included test sends two messages from a webview and checks that both are received. It fails against the preexisting code with the first message being dropped.
Closes https://github.com/facebook/react-native/pull/11304

Differential Revision: D5481385

Pulled By: hramos

fbshipit-source-id: 9b6af195eeff8f20c820e2fcdac997c90763e840
2017-07-28 11:35:25 -07:00
Jiajie Zhu bca825ee50 deprecate some usage of NetInfo
Reviewed By: wwjholmes

Differential Revision: D5493891

fbshipit-source-id: f86f034294f3fd07a535d2856ca6c7d4e2eb7824
2017-07-28 09:38:58 -07:00
Hector Ramos aadeff032f What to Expect from Maintainers
Summary:
Adds a new maintainers guide, and updates the contributor's guide to be consistent with regards to this new guide.

Some additional style changes made in order to support the display of bot commands. Changed the wording for the "Edit this page on GitHub" link.

Finally, the contributor's guide is now synced to `CONTRIBUTING.md` on the repo.

```
cd website && npm start
```

Verify that `CONTRIBUTING.md` is updated whenever the website is regenerated.

Verify everything rendered correctly. Expand the details below to see screenshots.

<details>

![screencapture-localhost-8079-react-native-docs-contributing-html-1501016495792](https://user-images.githubusercontent.com/165856/28593706-33d1e03c-7142-11e7-9878-04ead7561abc.png)

![screencapture-localhost-8079-react-native-docs-maintainers-html-1501016508744](https://user-images.githubusercontent.com/165856/28593719-3812d7fa-7142-11e7-9db2-f9599057d726.png)
</details>
Closes https://github.com/facebook/react-native/pull/15202

Differential Revision: D5494246

Pulled By: hramos

fbshipit-source-id: e28d5624d1e4795e212f10e8d5713d91a0eae15f
2017-07-28 08:18:53 -07:00
chadbay f193c3f2b1 Rename ToastAndroid to ToastExample
Summary:
The `ToastAndroid` module already exists in react native. In its current form, the tutorial will cause an error, as then there would be two `ToastAndroid`s. This PR addresses that by naming the new module `ToastExample`.

Tested this by running the doc website with my changes, here's a clip
![image](https://user-images.githubusercontent.com/3833164/28682102-563409fe-72c1-11e7-8316-a8a39e32b539.png)

The production site with the old doc has 14 `ToastAndroid`s, with one referring to the real module doc
![image](https://user-images.githubusercontent.com/3833164/28682204-a3520e02-72c1-11e7-93eb-332f84f38f57.png)

This PR now as 13 `ToastExample` references, one less because the `ToastAndroid` module is still on the left-side doc, as it should be.
![image](https://user-images.githubusercontent.com/3833164/28682272-da3cafbc-72c1-11e7-8c19-25b035c0a6eb.png)
Closes https://github.com/facebook/react-native/pull/15238

Differential Revision: D5509726

Pulled By: hramos

fbshipit-source-id: 33231529d1d83813960e8237ce75910b32024396
2017-07-28 07:51:09 -07:00
Andrew Jack 7ac6fa7a10 Check if fresco is initialised before clearing memory caches
Summary:
Fixes the following crash:
```
Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.example/com.example.MainActivity}: java.lang.NullPointerException: ImagePipelineFactory was not initialized!
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3831)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849)
       at android.app.ActivityThread.access$1500(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
Caused by java.lang.NullPointerException: ImagePipelineFactory was not initialized!
       at com.facebook.common.internal.Preconditions.checkNotNull(Preconditions.java:226)
       at com.facebook.imagepipeline.core.ImagePipelineFactory.getInstance(ImagePipelineFactory.java:74)
       at com.facebook.drawee.backends.pipeline.Fresco.getImagePipelineFactory(Fresco.java:92)
       at com.facebook.drawee.backends.pipeline.Fresco.getImagePipeline(Fresco.java:97)
       at com.facebook.react.modules.fresco.FrescoModule.onHostDestroy(FrescoModule.java:186)
       at com.facebook.react.bridge.ReactContext.onHostDestroy(ReactContext.java:240)
       at com.facebook.react.ReactInstanceManager.moveToBeforeCreateLifecycleState(ReactInstanceManager.java:667)
       at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:586)
       at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:599)
       at com.facebook.react.ReactActivityDelegate.onDestroy(ReactActivityDelegate.java:142)
       at com.facebook.react.ReactActivity.onDestroy(ReactActivity.java:72)
       at android.app.Activity.performDestroy(Activity.java:6456)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1143)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849)
       at android.app.ActivityThread.access$1500(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
```

This was introduced by d9ae27ba89

1. Create app with an image to be loaded
2. Background app before fresco has been initialised. (Very tight window to do this)
3. Should not crash

cc foghina
Closes https://github.com/facebook/react-native/pull/14359

Differential Revision: D5508505

Pulled By: hramos

fbshipit-source-id: 5a66d594625783f1c30180fe78c5baddb4f835aa
2017-07-28 07:51:09 -07:00
Abi Raja 3fadd74003 Update performance.md to reflect existence of `useNativeDriver` in An…
Summary:
…imated API

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15215

Differential Revision: D5501206

Pulled By: hramos

fbshipit-source-id: 827494688f405de3e84401460bddf5df17aa497b
2017-07-28 07:51:09 -07:00
Janic Duplessis 292f801c1c Cleanup settings.gradle
Summary:
Those projects do not exist anymore.
Closes https://github.com/facebook/react-native/pull/15201

Differential Revision: D5492456

Pulled By: hramos

fbshipit-source-id: 09889d6f8b9b2af9c21e13cca504c38f165857e8
2017-07-28 07:51:09 -07:00