Summary: Moves type definitions for uglify and babel from React Native to Metro Bundler. We need it there.
Reviewed By: cpojer
Differential Revision: D5217795
fbshipit-source-id: 9ec349cd8caf077eaa3c6fa3d090ffd47893e967
Summary:
In <= 0.44, the default implementation of getProjectRoots() came from `local-cli/core/default.config.js`. With changes happening in the CLI and the packager over the course of the last two months, various pieces of this logic (specifically `local-cli/utils/Config.js`) were rewritten, and though default.config.js was still being imported and used in `local-cli/core/index.js`, the default `getProjectRoots()` was being overriden by the defaults specified in `local-cli/utils/Config.js`.
This PR moves the logic from default.config.js into Config.js and index.js, as appropriate. Specifically:
- The `getProjectCommands()`, `getProjectConfig()`, and `getDependencyConfig()` methods, which have traditionally not been part of the rn-cli.config.js spec, are now defined in `local-cli/core/index.js`.
- The `getProjectRoots()` method, which contained logic for properly resolving the _actual_ project root as well as resolving symlinks within that root, has been moved to `local-cli/utils/Config.js`, to match the fact that other default rn-cli.config.js definitions live there.
Closes https://github.com/facebook/react-native/pull/14412
Differential Revision: D5216887
Pulled By: hramos
fbshipit-source-id: 7a3840ecf0ad8ea3f6d7bbd3d54e4f02950c6a32
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