Commit Graph

8420 Commits

Author SHA1 Message Date
Emil Sjolander a2cafb062e rename CSSWrapType to shorter CSSWrap matching java and csharp
Reviewed By: gkassabli

Differential Revision: D4174257

fbshipit-source-id: ba0bfab996ba158b07863d8c72cf2a41262c9592
2016-11-14 03:28:38 -08:00
Emil Sjolander e2e3a27571 BREAKING - Fix sizing of container with child overflowing parent
Reviewed By: gkassabli

Differential Revision: D4157971

fbshipit-source-id: 3cfae15ac8b65b70f01789444099ee684e1b099a
2016-11-14 02:13:51 -08:00
Sandro Machado 2a2d3c6e5a Add the configuration option to the run-android command
Summary:
Currently, to generate a `Release` build in `Android` it is required to get into the `android` directory and run the `react native bundle`with a lot of options and after that run the `gradle` to assemble or install the application with the build type `Release`.

This PR improves the process adding that feature to the `React Native CLI`.

To generate a release build is only required to use the parameter `--configuration` with the value `Release`.

**Examples**

To generate a release build:
```sh
react-native run-android --configuration release
```

To generate a release build for the product flavors staging:
```sh
react-native run-android --configuration release --flavor staging
```

To generate a debug build:
```sh
react-native run-android
```

To generate a debug build for the product flavors staging:
```sh
react-native run-android --flavor staging
```

This PR also removes the option `--install-debug` from the `react-native run-android` because that is always the default value,
Closes https://github.com/facebook/react-native/pull/10867

Differential Revision: D4167203

Pulled By: cpojer

fbshipit-source-id: c5ac07f81feeeea00ee0e8b059b46ef0d258a1a6
2016-11-13 18:58:29 -08:00
Andres Suarez 39cf29c0f7 Decruft flowconfig
Summary:
* Use `;` instead of `#` for comments because IDEs treat these files are `ini` syntax, and thus by default use `;` for comments. Flow supports both `;` and `#`.
* Fix line lengths and remove trailing comment periods.
* When possible, prefer `<PROJECT_ROOT>`  over `*./`.
* Be more specific with certain ignores.
* Remove ignores to modules that don't exist anymore or no longer have issues.
* `class_static_fields` and `class_instance_fields` are enabled by default starting with flow 0.33.0.

Reviewed By: gabelevi

Differential Revision: D4164031

fbshipit-source-id: 7e4b1b91837a675fa7c5a0bb75ec869c5b23f8bb
2016-11-13 06:28:40 -08:00
Michał Gregorczyk c612c61544 Make UnpackingJSBundleLoader.prepare a public API.
Reviewed By: brosenfeld

Differential Revision: D4161585

fbshipit-source-id: b3b835610d11e043d2406cccff2da27f07878acc
2016-11-12 14:43:48 -08:00
Andres Suarez 927dcc689a Denest .flowconfig
Reviewed By: bestander

Differential Revision: D4168607

fbshipit-source-id: 1658307e1c9b08fcb9cc14b9855cc0c40ed8cdf5
2016-11-12 13:29:02 -08:00
Fahrradflucht 9c667f2968 Add help option to react-native-cli
Summary:
This PR fixes #10784 by adding a `--help` and a `-h` option to `react-native-cli`.

**Test plan:**
Publish to sinopia and then outside of `react-native` project:
```
$ react-native --help          #same goes for -h

  Usage: react-native [command] [options]

  Commands:

    init <ProjectName> [options]  generates a new project and installs its dependencies

  Options:

    -h, --help    output usage information
    -v, --version output the version number

```
```
$ react-native
You did not pass any commands, run `react-native --help` to see a list of all available commands.
```

**Notes:**
- There is no real consistency in the UX for `react-native-cli` and `local-cli` and even is no real consistency between the UI of `react-native [command] --help` and `react-native --help` in `local-cli` either. I tried to resemble the UX of `react-native --help` as close as possible since it's kind of the nearest neighbour.
- This *doesn't* add support for `react-native init --help` in `react-na
Closes https://github.com/facebook/react-native/pull/10828

Differential Revision: D4168266

Pulled By: hramos

fbshipit-source-id: 079917622bf5b22a3cd6414f13865c1b9c01da01
2016-11-11 23:58:32 -08:00
Jared Forsyth 9910d8301b FIx docs for list view: "sticky" header not sticky on android
Summary:
:( this confused me, I thought I was missing some configuration or something. But the UIExplorer app has sticky headers on iOS, and non-sticky headers on Android, so I guess that's that.
Closes https://github.com/facebook/react-native/pull/10335

Differential Revision: D4039482

Pulled By: hramos

fbshipit-source-id: 34be2db4b15dec2f28a808a9bbc2eb00b0e35525
2016-11-11 22:43:46 -08:00
Daniel Nagy b7889e028b Expose NavigatorIOS::replaceAtIndex
Summary:
The React Native docs list `replaceAtIndex` as a public method of the **NavigatorIOS** component but it is never exposed.
Closes https://github.com/facebook/react-native/pull/10577

Differential Revision: D4168180

Pulled By: hramos

fbshipit-source-id: 6d91d9de8404bb229930d804f8b01b324ec16f24
2016-11-11 12:58:35 -08:00
benjaminhughes c83fc07973 Making babel to use the babelrc file if we find it
Summary:
This PR tells babel where the babelrc file is if it has been found in the project root. I know you guys are relying on babel to find it when you tell babel the filename and sourceFilename, this works fine in normal js/node projects, here is an example where this will not work.

We have a big repo that can contain a few react-native / js projects. Our build system is similar to BUCK and we keep our third party dependencies in a separate folder (having a global package.json at the project route is not feasible as everyone will have to install every apps dependencies even when they don't need them), the structure looks a bit like this:

`third_party/js/.` packages from node_modules
`common/js/` common code used by numerous apps, common components, services etc.
`my_app/native` the app

What's happening is something from `my_app/native` (where the .babelrc file is) is requiring something from `common/js` which is then requiring something from `third_party/js` and so babel has no idea what .babelrc file to use and
Closes https://github.com/facebook/react-native/pull/8131

Differential Revision: D4167844

Pulled By: hramos

fbshipit-source-id: 3569981e26ff8f8c632d8ae365a1f43a3483b13b
2016-11-11 11:28:48 -08:00
Sveta-K13 5daf1cfa6d add lost params for including Stetho
Summary:
Method onCreate must be called with parameter -  Bundle savedInstanceState. 'savedInstanceState' needed for call super class's implementation of this method. Also, you need to import android.os.Bundle package
Closes https://github.com/facebook/react-native/pull/10045

Differential Revision: D4167919

Pulled By: hramos

fbshipit-source-id: d34d081d08c6615c1ca97ec67a619cf273839c3e
2016-11-11 11:14:12 -08:00
Andy Street 974eec8264 Add CSSLayout to ReactCommon
Summary: First step to sharing CSSLayout code between iOS and Android.

Reviewed By: emilsjolander

Differential Revision: D4160286

fbshipit-source-id: 976f5820b19a7011e0a14317c858465f932e1f59
2016-11-11 10:58:55 -08:00
Sandro Machado 100b27cc7a Add the overlay permission information
Summary:
If your current android application is targeting the android `api level 23` or greater, displaying the error view will cause a crash in the application. The crash only shows that the system cannot display the view.
Closes https://github.com/facebook/react-native/pull/10479

Differential Revision: D4167801

Pulled By: hramos

fbshipit-source-id: 5f7315038a8a4c36d1513173139d5c4cf50ea868
2016-11-11 10:58:55 -08:00
David Aurelio 77401b15e0 Add flow declarations for `babel-core`
Reviewed By: zertosh

Differential Revision: D4166844

fbshipit-source-id: 5ee67b6629179c195dcdeacf87121a3fcd75a738
2016-11-11 10:13:30 -08:00
Jean Lauliac 00b688b0d3 packager ModuleTransport.js: @flow
Reviewed By: cpojer

Differential Revision: D4166900

fbshipit-source-id: 0b8c1730f00f9a9d4a17586967edae8cbd4f296b
2016-11-11 09:43:48 -08:00
Linmic 35e517562c Fixed the issue that _onTransitionEnd might try to setState at unmoun…
Summary:
This is to fix the issue that if `Animated.parallel`'s callback - `_onTransitionEnd` being triggered twice in a really short period(say quickly double-click the Android's hardware back button),  it might try to `setState` at unmounted stage, hence cause app crash.

This will make sure `_onTransitionEnd` only fired after mounted.
Closes https://github.com/facebook/react-native/pull/10878

Differential Revision: D4167266

Pulled By: ericvicenti

fbshipit-source-id: 7361e0ea4e8481b2da3fa39f78cdc0461693631f
2016-11-11 09:43:48 -08:00
Héctor Ramos 07b975248b Ask for solutions in new issue template.
Summary: Closes https://github.com/facebook/react-native/pull/10884

Differential Revision: D4167391

Pulled By: hramos

fbshipit-source-id: 278b153e9a7bf6975e4d0f23909601f78c8ab3fe
2016-11-11 09:43:48 -08:00
Emil Sjolander 867ea1bfaf Expose CSSLayoutSetLogger to java
Reviewed By: astreet

Differential Revision: D4153502

fbshipit-source-id: 630909d9d0d36d94d7cd3027476ddb52668b8cc0
2016-11-11 08:13:34 -08:00
Emil Sjolander bd1f22c4bd Fix flex within max size if max size is not constraint to
Reviewed By: gkassabli

Differential Revision: D4162104

fbshipit-source-id: 08feba6cb4e789c9aa12179e2cdeadc66b011841
2016-11-11 08:13:34 -08:00
Martin Kralik d5e067f244 don't clip if ui and react view hierarchies are different
Reviewed By: mmmulani

Differential Revision: D4088498

fbshipit-source-id: ec08e4e68d327fc770c944c274bb9f367daba6d2
2016-11-11 05:29:31 -08:00
Martin Kralik 625c8cb83c new `removeClippedSubviews` implementation (take 2 - recursive)
Reviewed By: mmmulani

Differential Revision: D4081700

fbshipit-source-id: d4079138dc070565e475831e82651c9b2d5b8d59
2016-11-11 05:29:30 -08:00
Martin Kralik a3ad34c34f remove outdated code in RCTNavigator
Reviewed By: mmmulani

Differential Revision: D4095285

fbshipit-source-id: 1e2111b6647e14562675e4474cd56acb91d22ec2
2016-11-11 05:29:30 -08:00
Martin Kralik 47839307f3 proper `reactSuperview` implementation
Summary:
React view hierarchy doesn't have to always match uiview hierarchy. Plus if we clip view we loose knowledge about view's react superview if we just use `self.superview` as react superview.
This diff fixes it by storing a strong ref to reactSuperview in an associated object.

This is needed for new view clipping implementation (see the dependent diff).

Reviewed By: mmmulani

Differential Revision: D4081844

fbshipit-source-id: 9317d9db46fbd474382c5469b7922f88e5ee7568
2016-11-11 05:29:30 -08:00
Jean Lauliac bc9bbb5533 packager worker: enable possibility to add Flow annotations
Reviewed By: matryoshcow

Differential Revision: D4160456

fbshipit-source-id: bbc2420126d8e8b725c0b7b359b35f09dfe8c8d6
2016-11-11 05:29:30 -08:00
Jean Lauliac b6b9d37225 packager: fix lint
Reviewed By: matryoshcow

Differential Revision: D4160163

fbshipit-source-id: 8eeb7dd83c0d80c1c62b760039615ce97782bd3e
2016-11-11 05:29:30 -08:00
Ashok Menon 58aa9afaed BC Kill-switch
Reviewed By: javache

Differential Revision: D4159923

fbshipit-source-id: 9814c76d04f7230fda7693efac3f6623cc882ccf
2016-11-11 05:29:30 -08:00
Ashok Menon 8288bc2006 BC Soft Errors
Reviewed By: javache

Differential Revision: D4131340

fbshipit-source-id: b0827fc99d94985fbbb2a1b03ddc4d6feab10bff
2016-11-11 05:29:25 -08:00
Jean Lauliac 7a073d3b13 packager TransformCache.js: use directory specific to project
Reviewed By: davidaurelio

Differential Revision: D4159761

fbshipit-source-id: 1f4b1bbcf4c4fbb834a672e38cb2cf55f425b28b
2016-11-11 05:13:42 -08:00
Andres Suarez 95c818d430 Revert D4161526: Rename nested .flowconfig to .github.flowconfig
Differential Revision: D4161526

fbshipit-source-id: a1fa96de61801da5016726bc1283191df2cf16e7
2016-11-11 01:29:24 -08:00
Ryan Gomba 6f5433febe Proper NativeAnimated node invalidation on Android
Summary:
This diff attempts to fix a number of Android native animation bugs related to incomplete node invalidation, e.g. https://github.com/facebook/react-native/pull/10657#issuecomment-258297467.

For full correctness, we should mark any node as needing update when it is:

- created
- updated (value nodes)
- attached to new parents
- detached from old parents
- attached to a view (prop nodes)

cc/ janicduplessis
Closes https://github.com/facebook/react-native/pull/10837

Differential Revision: D4166446

fbshipit-source-id: dbf6b9aa34439e286234627791bb7fef647c8396
2016-11-11 01:13:36 -08:00
Andres Suarez 617432c8c3 Rename nested .flowconfig to .github.flowconfig
Reviewed By: kassens

Differential Revision: D4161526

fbshipit-source-id: 82a8630934ab03e28d580a1e0fd4edef996ce200
2016-11-11 00:58:45 -08:00
Kevin Han b4283ed844 FIX: Call all android back key handlers before invoking default
Summary:
Fixes issue #9736
Closes https://github.com/facebook/react-native/pull/9757

Differential Revision: D4164796

Pulled By: hramos

fbshipit-source-id: c5d966a9bbaa91f9929ea20a775f96c15aa9f482
2016-11-11 00:28:40 -08:00
Héctor Ramos 98c620c6da include information about https for images in documentation
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 the ["Pull Reques
Closes https://github.com/facebook/react-native/pull/10436

Differential Revision: D4141792

Pulled By: hramos

fbshipit-source-id: b3b460fa2e22a6133865005326b09dddd1c05e29
2016-11-10 18:43:55 -08:00
Dustin Ingram 07dc35e4ad Add .gitattributes file, treat .pbxproj as binary
Summary:
By default, the `.pbxproj` file generated by React Native should be treated as binary data to prevent Git from possibly automatically converting or fixing CRLF issues with this file, which would break it.

See https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#identifying-binary-files-znTLIVhvhG (where it specifically mentions `.pbxproj` files) for more information.
Closes https://github.com/facebook/react-native/pull/10864

Differential Revision: D4162492

fbshipit-source-id: 2c8f2f0ab2bb41c23b1460ef6cba672ef38f6310
2016-11-10 17:58:41 -08:00
Emil Sjolander 454c33884a Revert D4133643: [react-native] Fix incorrect pixel-rounding in RCTShadowView.
Differential Revision: D4133643

fbshipit-source-id: bb17e0c84ba9d85c5d03129c602d1d432ee0aa56
2016-11-10 15:13:43 -08:00
Sandro Machado ca7cbdee85 Add the scheme configuration option to the run-ios command
Summary:
With the current `run-ios` script it is not possible to create/run iOS release builds or any other kind of scheme configuration from the terminal (we need to use `Xcode`). The reason for this is that the `run-ios` script does not expose the scheme configuration option for the `xcodebuild` command. This PR exposes that property and allows the developers to directly create/run release builds from the terminal.

This PR also closes [this](https://productpains.com/post/react-native/create-ios-release-builds-from-terminal) request at `productpains`.

And answers to [this](http://stackoverflow.com/questions/40303229/run-a-react-native-ios-release-build-from-terminal) question at the `stackoverflow`.

**Test plan (required)**

To generate a release build just run:

``` sh
react-native run-ios --configuration Release
```

The output

``` sh
Found Xcode project App.xcodeproj
Launching iPhone 6 (iOS 9.3)...
Building using "xcodebuild -project App.xcodeproj -scheme App -destination id=B0738993-CE4A-4D
Closes https://github.com/facebook/react-native/pull/10637

Differential Revision: D4151793

Pulled By: cpojer

fbshipit-source-id: 5a0fcdd59589977f3e251ec9bb3ba85e8919cffc
2016-11-10 09:58:42 -08:00
Jean Lauliac 4785a60115 packager worker/index.js: do not write to cache directly
Reviewed By: davidaurelio

Differential Revision: D4159970

fbshipit-source-id: 133ce5797e94a39fe60cbb9983edd561ce7d818e
2016-11-10 09:13:54 -08:00
Jean Lauliac b2653ed36c packager Module.js: make transformCode function required
Reviewed By: davidaurelio

Differential Revision: D4147343

fbshipit-source-id: 4c00a5905e698a9d257a632f3b02b63587b4644a
2016-11-10 09:13:54 -08:00
Jean Lauliac f40aafac8a packager Module.js: remove extractRequires
Reviewed By: davidaurelio

Differential Revision: D4147275

fbshipit-source-id: 7c1d7d16f6b8164d7031963618aeab2857f5d497
2016-11-10 09:13:54 -08:00
Pieter De Baets 9e61473172 Remove FlowFixMe from TextStylePropTypes
Reviewed By: zertosh

Differential Revision: D4160025

fbshipit-source-id: 330f731548bca830d4e3213f43608d2f3495ca57
2016-11-10 08:58:41 -08:00
Pieter De Baets 5aad13b691 Remove useless store in CSSLayout.c
Reviewed By: emilsjolander

Differential Revision: D4159938

fbshipit-source-id: 8b9ff3896c0e222e8e89546881129214bc6ba566
2016-11-10 08:58:41 -08:00
Andres Suarez c9c8e5ca32 Dedupe babel-* deps
Reviewed By: davidaurelio

Differential Revision: D4154815

fbshipit-source-id: bbccdaadbdd4e8a5528cb28211fa8f22546794db
2016-11-10 08:29:01 -08:00
Naisheel Verdhan 1888a0af16 Add a new Navigator SceneConfig swipeFromLeft
Summary:
Add a new `SwipeFromLeft` Navigator SceneConfig.

The animation is the opposite of `HorizontalSwipeJump`, however there's no `Jump` while animating as `HorizontalSwipeJump`.  Should `HorizontalSwipeJump` be renamed to `SwipeFromRight`?

![swipe-left-anim-2](https://cloud.githubusercontent.com/assets/8182981/18466947/8ca4dd24-79bb-11e6-8cae-8ffa34c0c7da.gif)
Closes https://github.com/facebook/react-native/pull/9877

Differential Revision: D4160059

Pulled By: hramos

fbshipit-source-id: 7426ec72adea80af2d5612aae1dd9d2e6dc090f3
2016-11-10 08:13:57 -08:00
David Aurelio 08950700fe Various cleanups around polyfill transformation
Summary:
- Put `isPolyfill` parameter into `options` object
- Save information whether a file is a polyfill
- Sort properties alphabetically
- Rename parameters

Reviewed By: cpojer

Differential Revision: D4153203

fbshipit-source-id: 67da97546a15c899112b74da6072acdea18d10e8
2016-11-10 08:13:57 -08:00
Christoph Pojer 2382ffe9bc Update Jest + jest-haste-map
Reviewed By: matryoshcow

Differential Revision: D4149694

fbshipit-source-id: 4f8378c419ddc7978e05dfcf2112e833775391be
2016-11-10 06:28:38 -08:00
Jean Lauliac edf975d903 packager Module.js: fix concurrency issues
Reviewed By: matryoshcow

Differential Revision: D4159743

fbshipit-source-id: 41515f2a29344b648c4c52100056d2054e3edff7
2016-11-10 05:58:41 -08:00
sunnylqm 70f40ce52b FbHeadlessJsTaskService -> HeadlessJsTaskService
Summary: Closes https://github.com/facebook/react-native/pull/10849

Differential Revision: D4159555

Pulled By: foghina

fbshipit-source-id: 075c3744d5c13d7b0656733973974aaa3e6cc7d6
2016-11-10 02:43:40 -08:00
Sreejith R 8965f11769 Included NativeAnimation module on iOS in the starter project
Summary:
Fixes #10638.

Added NativeAnimation library to the starter project iOS generator. Passing `useNativeDriver: true` to `Animated` config will enable the app to tap into the native code for animations.

**Test plan**

Init a RN project and animate an element. Enable native driver as follows:

```
Animated.timing(
      this.state.value,
      {
        toValue: 300,  // some value
        useNativeDriver: true
      }
    ).start();
```
Earlier, this used to crash.
Closes https://github.com/facebook/react-native/pull/10783

Differential Revision: D4159386

Pulled By: mkonicek

fbshipit-source-id: 993481a31b4446eab24ef4ee35ae1941d7a7aae9
2016-11-10 00:58:33 -08:00
Wojciech Ogrodowczyk f25e422417 Disallow object assign explanation
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

Provides better documentation for a confusing (and common) error message. Solves https://github.com/facebook/react-native/issues/3634

> **Test plan (required)**

This is just an error message shown in dev environment. I ran the tests and they pass.
Closes https://github.com/facebook/react-native/pull/10472

Differential Revision: D4053818

Pulled By: hramos

fbshipit-source-id: e80dc6ab787a8d8cabbcb442c438c07269401ff7
2016-11-10 00:28:31 -08:00
Tim Yung ad95aea51d RN: Fix Broken Symbolication
Reviewed By: fkgozali

Differential Revision: D4159009

fbshipit-source-id: 6f91428a769db820c49d7300138a06350f52e63e
2016-11-09 22:58:45 -08:00