Commit Graph

11083 Commits

Author SHA1 Message Date
Adam Miskiewicz f847fbe021 Fix broken default getProjectRoots
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
2017-06-09 01:16:45 -07:00
Aaron Chiu c639a1f802 fix dev reloading
Reviewed By: achen1

Differential Revision: D5187906

fbshipit-source-id: 8c35ee0747bdc0f6748ecdca54e223eafe37e105
2017-06-08 19:31:21 -07:00
Brian Vaughn a4947d1778 React Native sync
Reviewed By: sebmarkbage

Differential Revision: D5214576

fbshipit-source-id: 41f350ce8961851c7404257df8295d505471d9f4
2017-06-08 19:15:59 -07:00
Dan Abramov 32a0ee0975 Implement Systrace integration for Fiber
Reviewed By: bvaughn

Differential Revision: D5210738

fbshipit-source-id: db7df5ca7a1b4944f86719361d22ec3cc2ce8f22
2017-06-08 14:31:52 -07:00
Alex Dvornikov e38641cd73 Fixed error in _getCallableModule method in MessageQueue
Reviewed By: javache

Differential Revision: D5208462

fbshipit-source-id: 13f71e2b7988305eccfa91c349ff120fad9129f0
2017-06-08 12:49:37 -07:00
Kexi Long a0a7d97c7b Exposed progressViewOffset to VirtualizedList and FlatList
Reviewed By: sahrens

Differential Revision: D5204107

fbshipit-source-id: df2928830f84ea012d532f24c776dee8d2b96989
2017-06-08 12:32:14 -07:00
Mike Lambert 5840a9051d Fix deltatime calculation.
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
2017-06-08 12:17:01 -07:00
John O'Leary 62b20ce582 Scrollview updatedChildFrames data controlled by prop
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
2017-06-08 12:03:02 -07:00
Alex Kotliarskyi d062cc252e Promise support for C++ bridge
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
2017-06-08 11:47:26 -07:00
Christoph Pojer cbb8d6f628 Remove worker from local-cli
Reviewed By: davidaurelio

Differential Revision: D5208910

fbshipit-source-id: 245436276185fff1a516a00d4c631e885f463e53
2017-06-08 10:33:09 -07:00
Jean Lauliac 4a7ebdf757 packager: fix arc lint
Reviewed By: cpojer

Differential Revision: D5209393

fbshipit-source-id: 2efcb4cb7a556690778248a640398c9739ce9a50
2017-06-08 10:22:50 -07:00
James Burnett 3360999431 disable automock by default in as many places as possible @bypass-lint
Reviewed By: cpojer

Differential Revision: D5190858

fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
2017-06-08 07:45:54 -07:00
Theo Yaung ba2e486b33 Connection management
Reviewed By: javache

Differential Revision: D5171773

fbshipit-source-id: 6421739736f732e021e85474253ab0ddb3804b0a
2017-06-08 07:45:53 -07:00
Pieter De Baets a9e8b7bca5 Remove unused package_js.py
Reviewed By: AaaChiuuu

Differential Revision: D5200573

fbshipit-source-id: 5bc5cc66d3ce979a6ca2db9241e1de4eab45f234
2017-06-08 03:45:41 -07:00
Aaron Chiu f978109281 Ingore two other test of similar nature (and failure)
Reviewed By: javache

Differential Revision: D5208387

fbshipit-source-id: b32412c1591b2e3e461a3c2a3f99beb9ca7cd552
2017-06-08 02:30:03 -07:00
Hector Ramos 71c812ae0e Restore proper ordering of docs in the sidebar
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
2017-06-07 15:00:39 -07:00
Hector Ramos f42f2dff37 New Handling Touches Tutorial
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
2017-06-07 11:51:21 -07:00
Pieter De Baets 81c2f3b189 Cleanup Platform
Reviewed By: dcaspi

Differential Revision: D5185504

fbshipit-source-id: 4f7e9f9068598418b346a7370f6be241a0784b60
2017-06-07 10:19:01 -07:00
Xavier Villelégier f7c89b4187 Update default blue on iOS
Summary:
Hey,

The `defaultBlue` variable is currently `#0C42FD`. We can see that it's not the same as iOS. According to the official Apple website it's supposed to be `#007AFF`.
See the `Blue` color on [this page](https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/)

No code added.
Closes https://github.com/facebook/react-native/pull/14339

Differential Revision: D5199906

Pulled By: hramos

fbshipit-source-id: c06b0081556dddbfe7fecd255eff941cbbfb95ee
2017-06-07 08:47:36 -07:00
Hector Ramos 4f3da46146 Add Components and APIs Overview Guide
Summary:
Essential components such as View, Text, and Button are easily overlooked amongst the long list of components and APIs due to a lack of categorization. The basic components are already introduced as part of the tutorial, but they may be missed by people who prefer scanning over the docs.

Built website on localhost. Preview of the website as seem on Chrome on macOS:

![screencapture-localhost-8079-react-native-docs-components-and-apis-html-1496357491473](https://cloud.githubusercontent.com/assets/165856/26704237/902d0986-46e2-11e7-9624-17db692ae11e.png)

Preview as seen on an iPhone Plus (via Chrome console):
![screen shot 2017-06-01 at 3 57 00 pm](https://cloud.githubusercontent.com/assets/165856/26704309/05c8ff7e-46e3-11e7-99ff-b7402f5265d4.png)
Closes https://github.com/facebook/react-native/pull/14265

Differential Revision: D5192597

Pulled By: hramos

fbshipit-source-id: f281a14230468458f3da674a82df263fb9f064f4
2017-06-07 08:20:27 -07:00
Christoph Pojer 236e9e4d01 Remove react-native/packager folder.
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
2017-06-07 07:30:32 -07:00
Brian Vaughn 0bc3bb06ed Updated react sync script
Reviewed By: yungsters

Differential Revision: D5194769

fbshipit-source-id: c475d44616144ea354785b981b1f6068be49f848
2017-06-06 22:53:10 -07:00
Jordan Papaleo fea56da1b1 Added comment to the docs that saveImageWithTag is deprecated
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
2017-06-06 22:30:44 -07:00
Aaron Chiu ce52f404f2 remove some markers
Reviewed By: fkgozali

Differential Revision: D5196382

fbshipit-source-id: b12b56a7f7d1c4309ebcb61e840cc570d87acf3b
2017-06-06 20:45:33 -07:00
sunnylqm 152dbcbb71 Add note for devsupport in Podfile
Summary:
see https://github.com/facebook/react-native/issues/13799
Closes https://github.com/facebook/react-native/pull/14352

Differential Revision: D5198266

Pulled By: shergin

fbshipit-source-id: 308f7e3b1a8e09e61a87d25b05e6c065e1bb88f8
2017-06-06 20:18:42 -07:00
Andrew Y. Chen 37d4fd3ab6 Remove DialogWhenLarge style from devsupport
Reviewed By: AaaChiuuu

Differential Revision: D5176953

fbshipit-source-id: 52f426a0fbcdb07e1d250215342dceaeb6040261
2017-06-06 14:46:22 -07:00
Daniel Friesen 1ad08aa659 Fix `react-native link` issue when using multiple manifests
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
2017-06-06 14:20:06 -07:00
Aaron Chiu 2dfcde4c7b Ignore CatalystNativeJSToJavaParametersTestCase for now
Reviewed By: javache

Differential Revision: D5189336

fbshipit-source-id: a9d9e6ff17bf85af5e0e6146b13e2f96022435ba
2017-06-06 13:17:32 -07:00
Jean Regisser 5114b61b5e Add support for flashScrollIndicators on iOS
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
2017-06-06 13:06:48 -07:00
Jakob Kerkhove 7ee8dd788f Expand documentation scroll to offset
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
2017-06-06 12:32:13 -07:00
Dan Caspi 63ffa7c2f6 Fixing a race condition that may be caused by the reloadable executor.
Reviewed By: javache

Differential Revision: D5139379

fbshipit-source-id: 24aa820caacfe3780d0e5a2f5868cdc46cefc3fb
2017-06-06 11:35:38 -07:00
Rob Hogan 699a0bef3b Fail gracefully for node<4 in react-native-cli (const->var)
Summary:
`const` declarations were recently introduced into https://github.com/facebook/react-native/blob/master/react-native-cli/index.js, which runs before any transpilation so needs to be old-school. Replace them with `var`.

Fixes https://github.com/facebook/react-native/issues/11603
Closes https://github.com/facebook/react-native/pull/11615

Differential Revision: D5148448

Pulled By: shergin

fbshipit-source-id: ea23cdd26c0c1d0ac7f108aa9bf185abecfe399c
2017-06-06 11:20:47 -07:00
Michał Gregorczyk 46b3a89a70 Stop SystraceMessage markers with SystraceMessage.endSection
Reviewed By: javache

Differential Revision: D5182628

fbshipit-source-id: f5112a434cb7564410b0e2e69840e45a0777a184
2017-06-06 11:20:47 -07:00
Pieter De Baets 964c3a1b7a Don't include JNI dep in OSS build
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
2017-06-06 10:34:23 -07:00
Spencer Ahrens 23e2771719 Make UnimplementedView invisible in prod
Reviewed By: yungsters

Differential Revision: D5188697

fbshipit-source-id: 13bae1c99876d81204a89d72227bed4774be1664
2017-06-06 09:45:15 -07:00
Dan Abramov d78fb45f43 Update React DevTools to 2.3.1
Reviewed By: zertosh

Differential Revision: D5191009

fbshipit-source-id: a349244a13b5b642979547ab05d960cee57bde76
2017-06-06 09:16:26 -07:00
Kathy Gray 3c89bafad5 Reducing lock contention in module creation
Reviewed By: javache

Differential Revision: D5147499

fbshipit-source-id: b420cc67ee97fd8cf4bb390098465f968478509f
2017-06-06 09:02:12 -07:00
Michał Gregorczyk e55583e59f Fix oss build
Reviewed By: javache

Differential Revision: D5189534

fbshipit-source-id: 6096754e3caaa88a3283b3773723fac154cf989d
2017-06-06 08:30:50 -07:00
Alex Dvornikov 485bb70691 Allow lazy modules registration with the BatchedBridge
Reviewed By: javache

Differential Revision: D5181849

fbshipit-source-id: f63562c360488a9818605b25c1338214daac7411
2017-06-06 07:07:19 -07:00
Jean Lauliac a939109183 metro-bundler: upgrade
Reviewed By: cpojer

Differential Revision: D5190525

fbshipit-source-id: f92da16733f95475650db2395c76495cce862d32
2017-06-06 05:30:19 -07:00
Jean Lauliac 328d8ddb47 metro-bundler: make internal tool to use the new source of thruth for packager/metro-bundler
Reviewed By: davidaurelio

Differential Revision: D5182904

fbshipit-source-id: df5de3a9eb85560a09789d0a94eccb5c48ecba7b
2017-06-06 05:15:51 -07:00
Ognjen Dragoljevic e0bdb7cbcf Remove useless code from ReactImageView.RoundedCornerPostprocessor
Reviewed By: achen1

Differential Revision: D5172643

fbshipit-source-id: c2d89bdfde2c4f4ef51bf3f529fa58112fb65a2d
2017-06-06 05:15:51 -07:00
Dan Caspi e284a9db8c Create JS executor and context on main thread w/ custom JSC
Reviewed By: javache

Differential Revision: D5165405

fbshipit-source-id: 35e5cfdf0518968c095ba54ec980d2fe376fa20e
2017-06-06 04:45:51 -07:00
Koen Punt e5e3591009 replace lineBreakMode with ellipsizeMode
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
2017-06-06 04:16:00 -07:00
G. Kay Lee ba17a80aeb Update LayoutPropTypes.js
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [ ] 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.

Copyediting documentaion

N/A

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/14320

Differential Revision: D5184852

Pulled By: shergin

fbshipit-source-id: e47d69d9d4b3db64c496b6080d22ac38b9957055
2017-06-06 04:04:44 -07:00
Pieter De Baets 2c85490aa2 Update and synchronize preloaded modules config
Reviewed By: davidaurelio

Differential Revision: D5154657

fbshipit-source-id: cdf752d4a358ee6d4ff06aee74a71052a615c33e
2017-06-06 04:04:44 -07:00
Christoph Pojer 48edba9e53 Update README
Reviewed By: jeanlauliac

Differential Revision: D5183348

fbshipit-source-id: d71bd7a6c5f20cd8954072814918adf4194abc57
2017-06-06 03:30:56 -07:00
Pieter De Baets 7081391c3d Simplify Value.fromJSON API
Reviewed By: mhorowitz

Differential Revision: D5154478

fbshipit-source-id: 3f9528a6401d89df7e170d55da9c0327db5f4f3e
2017-06-06 03:20:14 -07:00
Alex Kring 407b8b4d1f Fixing compiler warning
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
2017-06-05 23:30:34 -07:00
Tomasz Szajna a3249650d6 Fixed ListViewMock unique key error when many sections
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
2017-06-05 22:37:45 -07:00