Summary:
This is necessary to fix an extraneous warning when a VirtualizedList is constructed on the first frame.
On the first frame, the dt is huge (ie, time since epoch).
On the second frame (which may legitimately be slow as a result of a lot to render), it will then assume there were two consecutive slow frames, and print a warning:
"VirtualizedList: You have a large list that is slow to update..."
Closes https://github.com/facebook/react-native/pull/14393
Differential Revision: D5210467
Pulled By: sahrens
fbshipit-source-id: 2e79218c3d66a4a9df4884f328a125047ef264ed
Summary: Optimize ScrollView by adding flag "DEPRECATED_sendUpdatedChildFrames" to gate whether updatedChildFrames data is computed and propagated on scroll events. The frame data is used in ListView by the onChangeVisibleRows prop. When this prop is not defined, unnecessary computation in ScrollView should not be performed.
Reviewed By: sahrens
Differential Revision: D5174898
fbshipit-source-id: e3eaed8760b76becf14dfeb00122bdebdaeae4ef
Summary: Looks like `CxxModule::Method` already supports 0..2 callbacks. Based on Obj-C implementation (RCTModuleMethod.m:492) and JS bridge code (NativeModules.js:76), 2 callbacks native method is transformed to JS promise by JS part of the bridge.
Reviewed By: javache
Differential Revision: D5207852
fbshipit-source-id: 5aad86d45b97397f2bc3a4dbc648a60d96a4689e
Summary:
Quickfix: The ordering here was lost when a previous PR was merged.
Closes https://github.com/facebook/react-native/pull/14378
Differential Revision: D5203833
Pulled By: hramos
fbshipit-source-id: 9282a5a5c9aa81ae5e1f5fe6692192ac1db57c08
Summary:
Finally, a place where `Button` is properly introduced. This is based on the old Handling Touches guide, which has been simplified (with some content moved over to the scroll views tutorial).
I've also updated the ordering of the guides into something that makes more sense to someone just getting started with React Native.
Closes https://github.com/facebook/react-native/pull/14371
Differential Revision: D5201127
Pulled By: hramos
fbshipit-source-id: 819192e2db9febb8a315f51693dae557752b6002
Summary: This folder is not necessary any longer. All the code now lives in https://github.com/facebook/metro-bundler
Reviewed By: davidaurelio, jeanlauliac
Differential Revision: D5199196
fbshipit-source-id: 35bf0f10a9163f53426db9a76f8f853dceb69167
Summary:
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.
The CameraRoll docs have a method for `saveImageWithTag`. I wanted to know how to use it and how it differs from the other methods. So I open the react-native repo and used the source.
I discovered this method is deprecated. It does use a console warning to notify upon use. A developer should not have to use a deprecated method to know it's no longer supported. The docs should state this until it is removed from the library.
```bash
git clone https://github.com/facebook/react-native.git
cd react-native
npm install
cd website
npm install
npm start
open http://localhost:8079/react-native/docs/cameraroll.html
```
Verify there are comments for `saveImageWithTag` method notifying developers that it is deprecated.
Closes https://github.com/facebook/react-native/pull/14345
Differential Revision: D5198453
Pulled By: shergin
fbshipit-source-id: 2b74120a1ee450b903cdcff3812a83747dac5bb8
Summary:
`react-native link` often fails due to the wrong manifest being used when you use a debug manifest. `findManifest` returns `debug/AndroidManifest.xml` instead of `main/AndroidManifest.xml`. And the debug manifest usually does not have the package name defined so `projectConfigAndroid` throws a cryptic "Cannot read property 'replace' of undefined" error.
This fixes the issue by throwing a more user friendly error and providing a `manifestPath` userConfig.
This is mostly based on comments to #10050.
Closes https://github.com/facebook/react-native/pull/13373
Differential Revision: D4945690
Pulled By: shergin
fbshipit-source-id: b177f916fd4799c873d2515c18cbb87bef3203f0
Summary:
Flashing scroll indicators is a standard behavior on iOS to show the user there's more content.
Launch RNTester on iOS, go to the ScrollView section, tap the "Flash scroll indicators" button.
You'll see this:
![Flash scroll indicators](https://cloud.githubusercontent.com/assets/57791/26250919/ebea607a-3cab-11e7-96c6-27579cc809ab.gif)
I've exposed the method `flashScrollIndicators` on all scrolling components that were already exposing a `scrollToXXX` method so it's usable from those components using a ref.
Let me know what you think.
Closes https://github.com/facebook/react-native/pull/14058
Differential Revision: D5103239
Pulled By: shergin
fbshipit-source-id: caad8474fbe475065418d771b17e4ea9766ffcdc
Summary:
I expanded the documentation of the scrollToOffset method a bit in FlatList
Thanks for submitting a PR! Please read these instructions carefully:
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.
The documentation of the scrollToOffset method in FlatList was a bit confusing. Also, there was no documentation for this method on VirtualizedList. I added the doc block there and linked to it from the FlatList doc block.
Please check if the link on the FlatList scrollToOffset method links to the scrollToOffset method of the VirtualizedList docs page.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14317
Differential Revision: D5192378
Pulled By: hramos
fbshipit-source-id: 6131a8e5adb2a2f7cb84344541f4f8b999a232d2
Summary:
When circle is using Buck, it uses prebuilt native libraries. I added this dependency internally to avoid callers having to depend on it explicitly but it looks like that broken open-source.
Closes https://github.com/facebook/react-native/pull/14343
Differential Revision: D5191531
Pulled By: javache
fbshipit-source-id: 5397026daac085694b3320bf6d3e7b3f5d680691
Summary:
lineBreakMode is a non-existing property (or maybe legacy?)
While reading the docs I encountered this prop being used in the example, but it doesn't exist in the codebase anymore.
Closes https://github.com/facebook/react-native/pull/13820
Differential Revision: D5189652
Pulled By: javache
fbshipit-source-id: 70e620fc094ae5e1628ab13ee9e410044e4f5291
Summary:
Compiler is giving a warning about an unused variable.
Tested by compiling the source code and verifying the warning is removed.
Closes https://github.com/facebook/react-native/pull/13819
Differential Revision: D5189680
Pulled By: shergin
fbshipit-source-id: 89848fcd3e988d1c256b315cfa2ef60a62c2ad56
Summary:
When ListViews has multiple sections, then rowIDs are required to be unique per section.
However the ListViewMock required rowIDs to be unique per whole list.
This change fixes the limitation of ListViewMock.
Closes https://github.com/facebook/react-native/pull/13642
Differential Revision: D5189675
Pulled By: shergin
fbshipit-source-id: 8a4fb68feb74af3307407d6d70f3f6642f50452a
Summary: If you use a ShakeDetector, you can specify the minimum number of shakes required to trigger a shake handler. Otherwise, the minimum number of required shakes is set to 1 by default.
Reviewed By: achen1
Differential Revision: D5155604
fbshipit-source-id: 5073fa37d4c223eb18e85b5e850b95d37136e3d2