Commit Graph

8322 Commits

Author SHA1 Message Date
Héctor Ramos 72369ee4d2 Consolidate Running on Device (Android|iOS) Guides into one
Summary:
The RunningOnDeviceAndroid doc had some Linux-specific instructions that are not relevant to macOS/Windows users.
Closes https://github.com/facebook/react-native/pull/10726

Differential Revision: D4139089

Pulled By: JoelMarcey

fbshipit-source-id: cc57c1d7e3c9dec94e123c3597ac78b3efb15dd0
2016-11-06 21:13:32 -08:00
Kevin Gozali fb7fe2d4e8 modernize AppContainer and add rootTag in the child context
Summary:
This does 2 things:
- modernize the component to use ES6 + flow
- assign `rootTag` to the child context

Each view in RN has its own `reactTag`. The reactTag for a root view is called `rootTag`. When there are multiple react root views active within the app (e.g. in a hybrid environment), rootTag is the only reliable "label" to differentiate them. This is especially useful when we want to limit an event/activity on a particular root view, instead of affecting all active root views. This allows components to do:

```
class Foo extends React.Component {
  static contextTypes = {
    rootTag: React.PropTypes.number,
  };

  componentDidMount() {
    // Get the root tag of this component, which is static for all components under the same root view
    console.log(this.context.rootTag);
  }
}
```

In a pure JS RN app environment, there will always be exactly 1 root view, so `rootTag` may usually be ignored.

Reviewed By: yungsters

Differential Revision: D4130376

fbshipit-source-id: 559b67615f487bad754b5832ad4a02bcef05be2a
2016-11-06 20:58:34 -08:00
Chuck Dishmon 6c04b3597d Update HandlingTextInput.md
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/10763

Differential Revision: D4139069

Pulled By: JoelMarcey

fbshipit-source-id: ecc36f4e0ff4a44c95d63a256e0cdf67a4d386b3
2016-11-06 20:28:30 -08:00
Andres Suarez 237ab33ff4 Upgrade to lodash@^4.16.6
Summary:
This diff updates `lodash` so that it's optimally deduped, resulting in:

* reducing the packager's load time by ~300-400ms.
* reduces the size of `node_modules` from ~225MB to ~148MB.
* reduces the time to do a clean `yarn install` from 35s to 18s.

Lots of dependencies (including every `babel-*`) use `lodash@4`, by having `lodash@3` as a root dependency, each package had to have it's own copy of `lodash@4`. Now, there's only one.

The uses of `lodash` in RN are restricted to the CLI/packager, and the uses are pretty basic. The breaking APIs don't really seem to affect us https://github.com/lodash/lodash/wiki/Changelog#v400.

Reviewed By: bestander

Differential Revision: D4124836

fbshipit-source-id: 0849c385fcafe10b463e684fea47be6775982386
2016-11-06 02:43:32 -08:00
Ben Griffith a609d1c2b7 Add currentHeight constant to status bar docs
Summary:
This PR is to fix #10561 by adding `currentHeight` to a list of constants for the `StatusBar` component. It also makes it clear that this constant is Android only by also adding a further note to the example use.

Closes #10561

![screen shot 2016-11-01 at 12 37 06](https://cloud.githubusercontent.com/assets/2854338/19889978/f453d43a-a02f-11e6-859e-5a9ebeba9d44.png)
Closes https://github.com/facebook/react-native/pull/10675

Differential Revision: D4137353

fbshipit-source-id: 717494fe78f8eb55c55447d6567ec8bcd0be86d3
2016-11-05 17:13:29 -07:00
Martin Konicek 1605276801 Remove open source deprecation warning from MapView
Summary: The warning is only relevant to open source RN but shown to employees too.

Reviewed By: fkgozali

Differential Revision: D4137216

fbshipit-source-id: 21d5c3051c7964231eeb3f555681a83eacb4c972
2016-11-05 14:13:36 -07:00
Héctor Ramos 1ceb2f7519 Swap locations for Prev/Next links.
Summary:
This reverts a change in #10660 that swapped the locations of the prev/next links across the entire site. It made sense in the blog, but not so much in the docs.
Closes https://github.com/facebook/react-native/pull/10753

Differential Revision: D4133501

Pulled By: lacker

fbshipit-source-id: 92ee35b1bd5575401e548f8290db3fb7cf0f56a1
2016-11-04 23:43:33 -07:00
Janic Duplessis ac19276534 Fix NavigationCardStackPanResponder to work with native animations
Summary:
`NavigationCardStackPanResponder` uses `__getValue` and the `stopAnimation` callback value which both doesn't work with native driven animation. The workaround here is to add a value listener so the JS value of the AnimatedValue gets updated too so `__getValue` has a relatively up to date value. This value should be good unless JS lags behind native a lot but that should not happen during a navigation gesture. Also added a comment that explains the hack.

**Test plan**
Tested in an app that uses native driven animations with a back gesture. This also needs #10643 and #10641 for everything to work properly.
Closes https://github.com/facebook/react-native/pull/10642

Differential Revision: D4135496

Pulled By: ericvicenti

fbshipit-source-id: 395aff78b16a37ad9407207a05504fdd6311f733
2016-11-04 20:43:43 -07:00
kentaromiura 97d90a1d71 Add `React` name mapping to the preset
Summary:
Fixes breakage on https://circleci.com/gh/facebook/react-native/12763 after the upgrade of React

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Jest preset has been upgraded so that requiring `React` capitalized can be possible

**Test plan (required)**

Couldn't reproduce it locally, we need to see if Circle passes.
Closes https://github.com/facebook/react-native/pull/10749

Differential Revision: D4132150

Pulled By: bestander

fbshipit-source-id: e41fb95b6677113fc6a3bf8bbce9247f59aa81dd
2016-11-04 20:43:43 -07:00
Janic Duplessis e173f14b52 Use native animations if the animated value is native in NavigationCardStackPanResponder
Summary:
Since native and non-native animations do not work together check if the animated value is native and set useNativeDriver accordingly. So untill we move to always using the native driver this is needed. This and another fix in NativeAnimations module will allow using native animations to transitions with gestures.

**Test plan**
Tested in an app that uses native driven animations with a back gesture. This also needs #10643 and #10642 for everything to work properly.
Closes https://github.com/facebook/react-native/pull/10641

Differential Revision: D4135972

Pulled By: ericvicenti

fbshipit-source-id: 8e65574ebb296da044f4d03bf1eedee4a37ebdac
2016-11-04 20:28:30 -07:00
David Aurelio f29e3bc277 Fix website generation after React upgrade
Summary:
care to merge, dear bestander?
Closes https://github.com/facebook/react-native/pull/10750

Differential Revision: D4131594

Pulled By: lacker

fbshipit-source-id: 39c2a31c774405529cc57ee1d0e10a9bef89f5f5
2016-11-04 18:43:42 -07:00
Neo 6a83ac3af6 update Modal.js to fix #10662
Summary:
further discussion: should there be a `onClose` or `onClosed` to pair with `onShow`? which would make a workaround for #10471 much easier
Closes https://github.com/facebook/react-native/pull/10669

Differential Revision: D4133832

Pulled By: hramos

fbshipit-source-id: 644a5bb6b9da697c81fc96ae4da196ba5b4050cb
2016-11-04 18:43:42 -07:00
Fred Liu 6ed49341f3 Remove underline colour in Android text inputs
Summary: `require('something.jpg')` returns a `number` type.

Reviewed By: ejanzer

Differential Revision: D4132544

fbshipit-source-id: cf47baa377258195fe0155b3ea34208325d7c462
2016-11-04 14:58:46 -07:00
Matthew Dapena-Tretter a643784144 Allow arguments in the editor env var
Reviewed By: frantic

Differential Revision: D4129207

fbshipit-source-id: a92fbbbe917db9c9afc0d970e3ac546e2a14bced
2016-11-04 12:59:17 -07:00
Martin Konicek c02c7f3024 CLI: Only use yarn if global CLI uses it
Summary:
Check that 'react-native init' itself used yarn to install React Native.
When using an old global react-native-cli@1.0.0 (or older), we don't want to install React Native with npm, and React + Jest with yarn. Let's be safe and not mix yarn and npm in a single project.

**Test plan**

Publish the code in this PR to Sinopia, use that when creating a new project.

Using old CLI:

    npm install -g react-native-cli@1.0.0
    react-native init AwesomeApp

The generated project doesn't contain `yarn.lock` (everything was installed with the npm client).

 ---

Using new CLI:

    npm install -g react-native-cli@1.2.0
    react-native init AwesomeApp

The generated project contains `yarn.lock`, output shows that yarn is used to install React Native, React, Jest.

 ---

In both cases the project runs and Reload JS works:

![screenshot 2016-11-04 17 20 50](https://cloud.githubusercontent.com/assets/346214/20015719/719effb0-a2b4-11e6-84a0-43474314009b.png)
Closes https://github.com/facebook/react-native/pull/10752

Differential Revision: D4131812

Pulled By: bestander

fbshipit-source-id: efaaf97a27005e2c2d10cae5d07afe108d5c0dee
2016-11-04 11:28:40 -07:00
Jean Lauliac b54fd91f77 RM node-haste DependencyGraph: @flow
Summary: In addition to adding flow in that file, I also had to fix `Module.js` and others to make everything compatible together.

Reviewed By: davidaurelio

Differential Revision: D4118829

fbshipit-source-id: 4f6dbc515741c38817cc4c9757e981fabb03915a
2016-11-04 10:43:39 -07:00
Jan Kassens 0bbf9db832 Add graphql@0.6.2
Reviewed By: cpojer

Differential Revision: D4129981

fbshipit-source-id: bc45ffa6b4f0eb49a607f0e645ad9b582a274ab8
2016-11-04 09:58:43 -07:00
Phillip Johnsen cb67d16aee StatusBar: fix incorrect setHidden(hidden) docs description
Summary:
Hi!

Just noticed an incorrect description for the `hidden` argument for `StatusBar.setHidden()` on the website, this trivial change fixes that.

FYI I followed the start procedure for the website mentioned in [CONTRIBUTING.md](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests), and noticed one needs to run `npm install` in the project root directory as well before starting the website. Do you want me to add that instruction as part of this PR, or as a separate PR entirely?
Closes https://github.com/facebook/react-native/pull/10735

Differential Revision: D4131223

fbshipit-source-id: b70c5ef12e72807445c51f13811537b9fa3b6b3e
2016-11-04 09:43:33 -07:00
leeight b67c0c964e Breaking: Ignore StatusBarManager rejected state
Summary:
See #10236
Closes https://github.com/facebook/react-native/pull/10421

Differential Revision: D4045455

fbshipit-source-id: a4fd969b1ade5e1a44715c6aeebb12b58bbf8d0c
2016-11-04 07:58:37 -07:00
David Aurelio 3683beb88a RN: Update React (2/2)
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
2016-11-04 05:43:44 -07:00
David Aurelio b76ab8e3a1 RN: Update React (1/2)
Reviewed By: kentaromiura

Differential Revision: D4026052

fbshipit-source-id: 5ad128be6a1fafb0c2bf831219c1f54234944eed
2016-11-04 05:43:43 -07:00
David Aurelio 27af120ed4 Prepare `__d` fn for Buck integration
Summary:
The new Packager/Buck integration passes module factory functions as first argument, so that the complete call can be amended at the end safely at a later point in time.
The call expression as a whole is covered perfectly by the created source map. Appending to that code later won’t break mappings.

`__d` now also accepts an additional `dependencyMap` parameter, which so far is only used by the new Packager/Buck integration. It enables module-local dependency IDs, thus eliminating the need to insert `correct` module IDs when building a bundle. Advantages are that source maps are no longer affected, and that builds can be quicker.

Reviewed By: cpojer

Differential Revision: D4124333

fbshipit-source-id: 12eba15d0b9d8c6624280a2ba1e7e4bc654bc83d
2016-11-04 05:13:44 -07:00
Matt Revell 99c75f1942 Minor grammatical change with respect to camel casing.
Summary: Closes https://github.com/facebook/react-native/pull/10736

Differential Revision: D4130609

fbshipit-source-id: 0ddbd86ed55a4f2ea588ceab686e5afa317e4a0c
2016-11-04 02:43:38 -07:00
Jing Chen 24418677ef Silently fail for requires on Android again until we can fix loading image assets from both repos
Reviewed By: blairvanderhoof

Differential Revision: D4128218

fbshipit-source-id: d743cdb7a73efc2f46c42217a49c6094fcd3808a
2016-11-04 00:58:48 -07:00
mike qin 0221b27489 increase MAX_WAIT_TIME
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes https://github.com/facebook/react-native/issues/8784 https://github.com/facebook/react-native/issues/7257
Closes https://github.com/facebook/react-native/pull/10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
2016-11-03 18:13:41 -07:00
Martin Konicek dca53feb4f Deprecate MapView in favor of airbnb/react-native-maps
Summary:
Compared to the `<MapView>` that comes with React Native, [react-native-maps](https://github.com/airbnb/react-native-maps) work on Android and is more feature complete. It is actively maintained and used extensively (9.2k installs / month, see [JS.Coach](https://js.coach/react-native/react-native-maps?search=react-native-maps)).

We think now is a good time to switch to react-native-maps in your applications and make `react-native-maps` the official `<MapView>` implementation for React Native.

We are going to release the deprecated `<MapView>` as a separate npm module so you can migrate to `react-native-maps` at your own pace.

**Test Plan**

Checked the docs render correctly on the website:

```
cd website
npm install
npm start
```

<img width="696" alt="screenshot 2016-11-01 20 17 31" src="https://cloud.githubusercontent.com/assets/346214/19905831/480074b8-a070-11e6-8779-8e12343c2883.png">

Warning is shown:

<img width="423" alt="screenshot 2016-11-01 20 39 21" src="https://cloud.githu
Closes https://github.com/facebook/react-native/pull/10500

Differential Revision: D4119602

Pulled By: mkonicek

fbshipit-source-id: 86780a98bf999e6047565ab66a5ebbd15e499a46
2016-11-03 16:58:49 -07:00
Dustin Shahidehpour 07fb9040d9 Only mark Nodes dirty if an actual node is removed.
Reviewed By: gkassabli

Differential Revision: D4125453

fbshipit-source-id: 745cfc55269415fea106a80c72401eb3074f2d31
2016-11-03 13:43:57 -07:00
David Aurelio 0e078d16ae Make sure that write streams are closed
Reviewed By: jeanlauliac

Differential Revision: D4117716

fbshipit-source-id: c12f07c6a0e016ac14543878491a8b4160099e21
2016-11-03 13:29:10 -07:00
Felix Oghina 0907ef6689 Call SoLoader.init in MainApplication#onCreate
Summary:
Fixes #10352.
Closes https://github.com/facebook/react-native/pull/10724

Differential Revision: D4126371

fbshipit-source-id: e1765e2d2a3ff80a962f1db6bdc9e90d797d3ab6
2016-11-03 13:29:09 -07:00
Ashok Menon 227f1b0ea8 Decoupling initialisation and synchronous execution.
Reviewed By: javache

Differential Revision: D4117471

fbshipit-source-id: b00de532c99f041ebba8b9d74972a36827a1a3f4
2016-11-03 10:58:43 -07:00
Georgiy Kassabli e7dc71ba84 Exposing layout cache check publicly
Reviewed By: emilsjolander

Differential Revision: D4124705

fbshipit-source-id: 23284967900585fa20dcb51c9cc1bee829b32975
2016-11-03 10:43:53 -07:00
Pieter De Baets 761e06bf02 Don't receive touches in RCTRootView
Reviewed By: mmmulani, majak

Differential Revision: D4104319

fbshipit-source-id: 70731b72e087710ccbc32024a596583640b94d04
2016-11-03 09:58:48 -07:00
Andy Street 68aeffe01f Queue JS calls that come in before JS bundle has started loading instead of crashing
Summary: This mimics (some of) the behavior we have on iOS where if you call a JS module method before the JS bundle has started loading, we just queue up those calls and execute them after the bundle has started loading.

Reviewed By: javache

Differential Revision: D4117581

fbshipit-source-id: 58c5a6f87aeeb86083385334d92f2716a0574ba1
2016-11-03 09:44:58 -07:00
Jitae Kim 52d90da75e Modify image url from http to https on examples
Summary:
Modify image url from http to https on examples

> App Transport Security (ATS) is enabled by default for apps linked against the iOS 9.0 or OS X v10.11 SDKs or later, as indicated by the default Boolean value of NO for the NSAllowsArbitraryLoads key. This key is at the root level of the NSAppTransportSecurity dictionary.
With ATS enabled, HTTP connections must use HTTPS (RFC 2818). Attempts to connect using insecure HTTP fail. ATS employs the Transport Layer Security (TLS) protocol version 1.2 (RFC 5246). For background on secure Internet connections, read HTTPS Server Trust Evaluation.
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35
Closes https://github.com/facebook/react-native/pull/10714

Differential Revision: D4124471

Pulled By: hramos

fbshipit-source-id: a7cc9d0267906747b00a1d88245af52c967c7b11
2016-11-03 08:13:37 -07:00
Ovidiu Viorel Iepure 2ac6c754c1 File transform events
Summary: Correctly generate log entries for file transforms and ping telemetry using the new Logger API.

Reviewed By: bestander, cpojer

Differential Revision: D4081325

fbshipit-source-id: 7d50d54eb673a0276512db6ad5ff21c344495612
2016-11-03 07:44:10 -07:00
Ovidiu Viorel Iepure 14ada406b7 Instrumentation API
Reviewed By: cpojer

Differential Revision: D4074413

fbshipit-source-id: fd2dff17168f426680fd9dc8456f8b1ae3f55318
2016-11-03 07:44:10 -07:00
Héctor Ramos 4c284e2159 Update Getting Started instructions for Android
Summary:
Addresses a ton of feedback from #10372. React Native does require Marshmallow to be installed.

![screencapture-localhost-8079-react-native-docs-getting-started-html-1478125642639](https://cloud.githubusercontent.com/assets/165856/19949794/1629d974-a111-11e6-8f7b-abbb5730b1b3.png)

![screencapture-localhost-8079-react-native-docs-getting-started-html-1478125630469](https://cloud.githubusercontent.com/assets/165856/19949795/162cd7a0-a111-11e6-8a90-50de3c260e66.png)

![screencapture-localhost-8079-react-native-docs-getting-started-html-1478125615552](https://cloud.githubusercontent.com/assets/165856/19949797/1630093e-a111-11e6-9424-e630691df2fc.png)

![screencapture-localhost-8079-react-native-docs-getting-started-html-1478125604686](https://cloud.githubusercontent.com/assets/165856/19949796/162fb268-a111-11e6-9bc6-e89ebb9bdd20.png)

![screencapture-localhost-8079-react-native-docs-getting-started-htm
Closes https://github.com/facebook/react-native/pull/10710

Differential Revision: D4122776

Pulled By: mkonicek

fbshipit-source-id: 81a5afc55d17302cb9a1dafc61a1e21206436f38
2016-11-03 07:44:10 -07:00
David Aurelio c0c80d7ace Add flow to require implementation, always warn when modules are accepted by name
Reviewed By: matryoshcow

Differential Revision: D4124228

fbshipit-source-id: 461087caf4add07db376bb71ae5ba42bf3536cd3
2016-11-03 05:58:30 -07:00
Jean Lauliac ea536dd4bf RM Polyfill.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4118256

fbshipit-source-id: b9d906cd94c0548c28a62fa636c6da7bcf894ba9
2016-11-03 04:58:46 -07:00
Jean Lauliac 35614db349 RM fastfs.js: @flow
Reviewed By: cpojer

Differential Revision: D4118175

fbshipit-source-id: ad9d1f98bcde0c1be17d36c74c3662e6e55165f8
2016-11-03 04:58:46 -07:00
Drew Volz 16b0de72c0 Fix broken showcase guidelines link
Summary:
Corrected the link to route to the showcase guidelines
Closes https://github.com/facebook/react-native/pull/10708

Differential Revision: D4121425

Pulled By: hramos

fbshipit-source-id: 175c2cde53df0e0703b6aaecc05ced4484b5a64b
2016-11-02 20:58:46 -07:00
Tim Yung b5a71fe2b1 RN: Simplify Animated-test.js
Reviewed By: cpojer

Differential Revision: D4118935

fbshipit-source-id: 1f80f22235edbbf8bcb4d51b0110cbfa30a3f917
2016-11-02 14:58:52 -07:00
Ryan Gomba 9b4927c9c4 Implement NativeAnimated modulus node on Android
Summary:
This diff implements ModulusAnimatedNode on Android, bringing Android up to date with JS and iOS native animation APIs.
Closes https://github.com/facebook/react-native/pull/10681

Differential Revision: D4120162

fbshipit-source-id: 4e58e1b6309c1c7a12ef835547a3f3d321c20714
2016-11-02 14:58:52 -07:00
Pieter De Baets 96cf9bb0c0 Support null messageQueueThread in JSCExecutor
Reviewed By: michalgr

Differential Revision: D4119253

fbshipit-source-id: 2956434451bf4e649cfe4c0ee0a9b7339a5422a3
2016-11-02 14:28:36 -07:00
Ryan Gomba 8e81644f64 Implement NativeAnimated offsets on Android
Summary:
This diff implements NativeAnimation offsets on Android. Running the examples should show no change; however, calling `setOffset()` should offset the final value for any value node by that amount. This brings Android up to date with JS and iOS animation APIs.
Closes https://github.com/facebook/react-native/pull/10680

Differential Revision: D4119609

fbshipit-source-id: 96dccdf25f67c64c6787fd9ac762ec841cefc46a
2016-11-02 13:58:53 -07:00
aybb 68c61203ac Texinput documentation improvement
Summary:
To my mind this feature should be documented as here lots of issues can happen potentially.
Closes https://github.com/facebook/react-native/pull/10706

Differential Revision: D4119506

fbshipit-source-id: 54f9738ea2308144a05678fd1897f529f260966c
2016-11-02 13:58:53 -07:00
Jean Lauliac 7f56907d8f RN Package.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4118006

fbshipit-source-id: ad8fdcb67351a9e53af0a7acbf16f269daf31f50
2016-11-02 13:43:43 -07:00
Jean Lauliac 23f0238805 RN ModuleCache.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4117759

fbshipit-source-id: 158f6e50cb9211f87acce17047ed3e959e6c271f
2016-11-02 13:43:43 -07:00
Alexander Blom 788e2775f6 Add Java JNI bindings
Reviewed By: mhorowitz

Differential Revision: D4021520

fbshipit-source-id: dbaf2ebb7fa48f4efe6cf47a97c39bb079dda8d0
2016-11-02 12:29:15 -07:00
Alexander Blom fbc8410d86 Add some documentation
Summary: Adds documentation about the Inspector.

Reviewed By: passy, foghina

Differential Revision: D4114673

fbshipit-source-id: fb1182c89c94f10a74d4589b6a24a06b376db92e
2016-11-02 12:29:15 -07:00