Commit Graph

14262 Commits

Author SHA1 Message Date
Tom Atterton 5219585ef9 Ignore DevDependencies when generating template. (#20542)
Summary:
Regarding [Add devDependenices support for templates](c4ab03a18e).

Once a project is created using the custom template command with devDependencies inside, the devDependenices.json file is also copied to the new projects directory.

By adding this to the ignore paths we stop the devDependenices being copied into the new projects directory.
Pull Request resolved: https://github.com/facebook/react-native/pull/20542

Differential Revision: D9182795

Pulled By: hramos

fbshipit-source-id: 543c8ca67612a981c22fc83c8d54a25ddc0ca5fc
2018-08-06 12:32:24 -07:00
David Aurelio 151ec411aa Back to JNI storage
Summary:
@public

This reverts the Yoga/Java storage experiment. I will follow up with any learnings.

Reviewed By: pasqualeanatriello

Differential Revision: D9168405

fbshipit-source-id: fb227fb9353bd4c4e3bebbe9b04eec1132e532e8
2018-08-06 02:16:22 -07:00
David Aurelio 73d5746122 Add `Unsafe` based storage backend
Summary:
@public

Adds another version of property storage for `YogaNode`, using `sun.misc.Unsafe`.

Adopts the stub concept from Litho for `Unsafe`, as it is hidden by the Android SDK.

Reviewed By: pasqualeanatriello

Differential Revision: D9140103

fbshipit-source-id: a4b376eca341b724a00f873467ae8bf8eaac69f4
2018-08-05 16:46:26 -07:00
Valentin Shergin 1d93d70af4 Fabric: `ShadowNodeCloneFunction` signature was unified with ShadowNode copy constructor
Summary:
@public
Now it accepts `const ShadowNode &` instead of `std::shared_ptr<const ShadowNode>` which is more reasonable (and more performant) becasue the function must not retain ownershipt.

Reviewed By: mdvacca

Differential Revision: D9073921

fbshipit-source-id: c24c475615e0f81b3e004e118dea7565d8e757b4
2018-08-04 09:47:31 -07:00
Valentin Shergin 6230147e73 Fabric: Removed unnecessary `YGValue::operator==`
Summary:
@public
We backported that into Yoga recently, so we don't need it here anymore.

Reviewed By: mdvacca

Differential Revision: D8988439

fbshipit-source-id: 01a538ff291e25d92eeb01b1fdee3a6868b2448b
2018-08-04 09:47:31 -07:00
Valentin Shergin 3770d4df45 Fabric: Using `const &` type for `ShadowNodeFragment`'s fields
Summary:
@public
To avoid unnecessary copying of `shared_ptr`s inside ShadowNodeFragment, now we store them as `const &` references.

Reviewed By: mdvacca

Differential Revision: D8988388

fbshipit-source-id: 0b3582e57ce7577b8fa819392bf33f34e1a60b59
2018-08-04 09:47:31 -07:00
Valentin Shergin 06e62440d3 Fabric: Using `ShadowNodeFragment` in `ComponentDescriptor`
Summary:
@public
Now we use same data structure to specify a shape of shadow node as we use in ShadowNode (sub)clases.

Reviewed By: mdvacca

Differential Revision: D8988387

fbshipit-source-id: 475298b2c71ee7ee2b197db009f7b8313b54f5df
2018-08-04 09:47:30 -07:00
Valentin Shergin 52ed882332 Fabric: Using `const ShadowNode &` as a parameter in ShadowNode copy constructor
Summary:
@public
When we copy-construct ShadowNode, we don't need to retain a source shadow node, so there is no need to pass it as a `shared_ptr`. Passing an argument to constructor as `const &` is also more idiomatic in C++.

Reviewed By: mdvacca

Differential Revision: D8988384

fbshipit-source-id: 1279d9185fa1b4b82fd26e3040bd62fa9495b4d3
2018-08-04 09:47:30 -07:00
Valentin Shergin 938e1d51c4 Fabric: ShadowNode::children_ is now managed in copy-on-write manner
Summary:
@public
ShadowNode class is designed to share `props` and `children` objects between instances. Given that all *Props classes are immutable, it's very easy to share them and we do this from the day one. The `children_` collection is more tricky though because ShadowNode class has a couple of mutation methods. Previously, we dealt with it very simply by copying the whole vector in constructors, and that was far from optimal. Now we store a special flag that indicates that the children list is shared among nodes, and we clone this before the first mutation.
Sharing a `shared_ptr` should be much more efficient (cost of atomic refcount increment) than instantiating whole new collection (an allocation).

Reviewed By: mdvacca

Differential Revision: D8988386

fbshipit-source-id: cb2f6b2fccac70a35e070a1aa108d135f77cd041
2018-08-04 09:47:30 -07:00
Valentin Shergin d74346b616 Fabric: `ShadowNode::getChildren()` now returns `vector`, not `shared_ptr`
Summary: TBD

Reviewed By: mdvacca

Differential Revision: D8988385

fbshipit-source-id: 1d1c7e0b87b32b242c69bbce44cf70fb0899cf93
2018-08-04 09:47:30 -07:00
Valentin Shergin ca6d263d6d Fabric: ConcreteViewShadowNode::BaseShadowNode type alias
Summary:
@public
Just a type alias to make the code prettier, nothing more.

Reviewed By: mdvacca

Differential Revision: D8988383

fbshipit-source-id: 3f21de0ec0cb9a2270eccfc4a67a3d1108535e42
2018-08-04 09:47:30 -07:00
Valentin Shergin 95074e6c12 Fabric: ShadowNode::Fragment
Summary:
@public
This diff changes a way how we specify a shape of newly created and/or cloned of ShadowNode. Previously we pass those values as a list of arguments, now those values are coupled into a new data structure called ShadowNodeFragment. All that makes suppose to make code much more easy to read and maintain, this is especially important because we want to add a couple of new entities in this set.

Reviewed By: mdvacca

Differential Revision: D8988389

fbshipit-source-id: 1835f646e1ecc6a1f413feaf1900f3d3ad0ebc05
2018-08-04 09:47:30 -07:00
Valentin Shergin 682fd43f3b Fabric: Removed ConcreteShadowNode specialized constructors
Summary:
@public
Apparently we don't need them.

Reviewed By: mdvacca

Differential Revision: D8944766

fbshipit-source-id: e3b78f98d3d805ab0aaf5a167efeb7e058c0394e
2018-08-04 09:47:30 -07:00
Valentin Shergin 67a79010ca Fabric: Simplified way to specialize ComponentName in ConcreteShadowNode class template
Summary:
@public
Previously, all ConcreteShadowNode subclasses had to override `getComponentName()` function to specialize a name of the component. And often it was all that those subclasses do. Now, it's a template argument; and many ShadowNode classes can be created as oneliners via *just* specializing  ConcreteShadowNode template.

Unfortunately, C++ does not allow to use `std::string`s or string literals as template arguments, but it allows to use pointers. Moreover, those pointers must point to some linked data, hence, those values must be declared in .cpp (not .h) files. For simplicity, we put those constants in Props classes, (but this is not a strong requirement).

Reviewed By: mdvacca

Differential Revision: D8942826

fbshipit-source-id: 4fd517e2485eb8f8c20a51df9b3496941856d8a5
2018-08-04 09:47:30 -07:00
Valentin Shergin 88293d391a Fabric: Using `const &` pattern everywhere in RCTConversions
Summary:
@public
Trivial.

Reviewed By: mdvacca

Differential Revision: D8923599

fbshipit-source-id: 06f760ad7940af247ca81396fd48b08fbcd562c6
2018-08-04 09:47:30 -07:00
Valentin Shergin 5d0b51b107 Fabric: Making Sealable debug-only thing
Summary:
@public
Now, Sealable is already error-preventing-only mechanism, no business logic relies on that.
So, it makes sense to make it debug-only to illuminate possible performance impact.

Reviewed By: mdvacca

Differential Revision: D8923597

fbshipit-source-id: 80aa9097c4b719e91de73ac59f38d3a4751f0b06
2018-08-04 09:47:29 -07:00
CFKevinRef da6a5e0439 Better Android Gradle Plugin 3.x integration (#20526)
Summary:
Mirrors #17967 which was imported and reverted

Original:

Better integration with the Android Gradle-based build process, especially the changes introduced by the [Android Gradle Plugin 3.x and AAPT2](https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html).

Fixes #16906, the `android.enableAapt2=false` workaround is no longer required.

Bases the task generation process on the actual application variants present in the project. The current manual process of iterating build types and product flavors could break down when more than one dimension type is present (see https://developer.android.com/studio/build/build-variants.html#flavor-dimensions).

This also exposes a very basic set of properties in the build tasks, so that other tasks can more reliably access them:

```groovy
android.applicationVariants.all { variant ->
    // This is the generated task itself:
    def reactBundleTask = variant.bundleJsAndAssets
    // These are the outputs by type:
    def resFileCollection = reactBundleTask.generatedResFolders
    def assetsFileCollection = reactBundleTask.generatedAssetsFolders
}
```

I've tested various combinations of product flavors and build types ([Build Variants](https://developer.android.com/studio/build/build-variants.html)) to make sure this is consistent. This is a port of what we're currently deploying to our CI process.

[ ANDROID ] [ BUGFIX ] [ react.gradle ] - Support Android Gradle Plugin 3.x and AAPT2
[ ANDROID ] [ FEATURE ] [ react.gradle ] - Expose the bundling task and its outputs via ext properties

Pull Request resolved: https://github.com/facebook/react-native/pull/20526

Differential Revision: D9164762

Pulled By: hramos

fbshipit-source-id: 544798a912df11c7d93070ddad5a535191cc3284
2018-08-03 17:02:12 -07:00
Janic Duplessis 7a0af55674 Enable nullish coalescing in flow config (#20516)
Summary:
Follow up to a9792ac4c8. I assume it's enabled for fb flow config so we can avoid future breakages if someone decide to use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20516

Differential Revision: D9169244

Pulled By: TheSavior

fbshipit-source-id: 3736d2aed65a0cb4392c175f7d652594cf6a1518
2018-08-03 16:47:01 -07:00
Janic Duplessis 44c1012cca Enable optional chaining and nullish coalescing in flowconfig template (#20517)
Summary:
Follow up to a9792ac4c8 and #20516

This makes sure new projects typecheck properly since RN can use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20517

Differential Revision: D9169268

Pulled By: TheSavior

fbshipit-source-id: f2b08598bdc6979931e987c9a275d75f08751754
2018-08-03 16:32:11 -07:00
gengjiawen a286c0e753 Fix RNTester on Windows (#19974)
Summary:
Currrent, RNTester can not work on windows.
* Fixes https://github.com/facebook/react-native/issues/19654.
Pull Request resolved: https://github.com/facebook/react-native/pull/19974

Differential Revision: D9150453

Pulled By: rafeca

fbshipit-source-id: 1bd2046fbe0e8eaadf249604357c2e6acd80455e
2018-08-03 13:32:49 -07:00
Trish Saylor f17047e230 Add flow strict-local annotation to the dismissKeyboard module
Summary: The `dismissKeyboard` module is widely used but did not have flow typing on it, preventing other js modules that use it from annotating themselves as flow strict-local. This diff adds a flow annotation to the `dismissKeyboard` module of the strictest type supported for this module, which is flow strict-local.

Reviewed By: gkz

Differential Revision: D9143671

fbshipit-source-id: af2367e6c59276402dcbcb9cf0f64b44ff42f531
2018-08-03 11:47:19 -07:00
Ives van Hoorne 72b0238242 Bump metro to 0.43.4
Summary: New version for metro.

Reviewed By: rafeca

Differential Revision: D9148300

fbshipit-source-id: 77a520aba8be7111da0bf71898684cd6922ff556
2018-08-03 11:17:35 -07:00
Kevin Gozali ee42606a0b ios: disable assertion for bridge deallocation during SST/redbox test
Summary: There's still a mysterious issue where the bridge wasn't deallocated properly, but there's already a test for it separately. Let's disable the assertion for SST/redbox.

Reviewed By: PeteTheHeat

Differential Revision: D9138634

fbshipit-source-id: 9cfa0f970e079774428caccaede1150292cccba6
2018-08-03 09:01:38 -07:00
Valentin Shergin 96238e03b6 Fabric: Support for Yoga's `overflow` property on iOS
Summary:
@public
Quite trivial.

Reviewed By: mdvacca

Differential Revision: D9146963

fbshipit-source-id: 3cdace99c172a3aea3c0af07ecb82488437d0311
2018-08-03 08:32:56 -07:00
Valentin Shergin 50b80a9ef8 Fabric: Fixed image URLs parsing
Summary:
@public
It's a basically reimplementation of `+[RCTConvert NSURL:]`.

Reviewed By: mdvacca

Differential Revision: D9146850

fbshipit-source-id: 57ecac1eb35b57b0d417b599371bd0c4a3988116
2018-08-03 08:32:56 -07:00
Héctor Ramos a9792ac4c8 Enable optional_chaining in open source Flow config
Summary:
There's a couple of Flow errors in open source, following D9081343:

```
yarn run v1.6.0
$ flow check
Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:139:31

Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.

   139|     let _trackColorForFalse = trackColor?.false;
                                      ^^^^^^^^^^^^^^^^^

Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:140:30

Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.

   140|     let _trackColorForTrue = trackColor?.true;
                                     ^^^^^^^^^^^^^^^^
```

See https://circleci.com/gh/facebook/react-native/48701

We have a different Flow config for open source, .github.flowconfig, that needs to be updated to ensure Flow passes in oss.

Reviewed By: TheSavior

Differential Revision: D9141134

fbshipit-source-id: 7b546ef4c9a91bdd66472242f38a6fc8bcf86364
2018-08-02 16:17:04 -07:00
Ram N 407e033b34 Remove the flag about Lazy native modules
Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now

Reviewed By: achen1

Differential Revision: D9012312

fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f
2018-08-02 16:02:36 -07:00
Ram N 42146a7a4a Fix LazyReactPackage in OSS
Summary:
In OSS, during gradle build, the ReactModuleSpecProcess annotation-processor does not run. As a result, the `ReactModuleInfo` that we need for CoreReactPackage is not generated, resulting in a runtime error.

The fix is to make LazyReactPackage revert to what it was doing earlier. In `NativeModuleRegistryBuilder`, if we dont find `ReactModuleInfo` for any `ModuleSpec`, we eagerly instantiate the module and get all the `ReactModuleInfo` from it. By returning an emoy collection if the class is not available, we force the modules in `CoreReactPackage` to use this codepath instead.

The alternate fix would be to ensure that the annotation processor runs in gradle/OSS. However, the annotation processor will be removed eventually in the future, and we will also be move to generating them for JS, so that work will soon be irrelevant.

Reviewed By: fkgozali, achen1

Differential Revision: D9130517

fbshipit-source-id: 469cf0e32a2f3650f098547667b3cd09a63eb1a0
2018-08-02 12:16:38 -07:00
Oleksandr Sokolov 3f89dd2db6 Setup /RKJSModules/Marketplace directory structure + extracting MarketplaceRelayQueryConstants and dependencies
Reviewed By: fkgozali

Differential Revision: D9110647

fbshipit-source-id: e04d523a2dc26f923f083533b9aeabc12d18f23d
2018-08-02 08:32:34 -07:00
Leo Nikkilä 1f88a7111d Fix view indices with Android LayoutAnimation (attempt 2) (#19775)
Summary:
/cc janicduplessis mdvacca

This addresses the same issue as #18830 which was reverted since it didn’t handle `removeClippedSubviews` properly.

When subview clipping is on, ReactViewGroup keeps track of its own children directly and accounts for the offset introduced by clipped views when calling ViewGroup methods that modify children.

Instead of accounting for just clipped children (views with no parent), it should account for any children that aren’t in the ViewGroup which also includes children that are being transitioned. If you look at the ViewGroup source code, [it explicitly retains the view parent until the transition finishes](https://github.com/aosp-mirror/platform_frameworks_base/blob/oreo-release/core/java/android/view/ViewGroup.java#L5034-L5036) which caused the `getParent()` checks to pass, even though those views should be ignored. I added a new `isChildInViewGroup` method that handles both clipped and transitioning views to fix this.

I reproduced the [earlier crash](https://github.com/facebook/react-native/pull/18830#issuecomment-382798628) by enabling clipping in [this test app](https://github.com/facebook/react-native/pull/18830#pullrequestreview-111758886) and adding a “clear views” button that resets the state to an empty items array with an animation.

- #18830

[ANDROID] [BUGFIX] [LayoutAnimation] - Removal LayoutAnimations no longer remove adjacent views as well in certain cases.
Pull Request resolved: https://github.com/facebook/react-native/pull/19775

Differential Revision: D9105838

Pulled By: hramos

fbshipit-source-id: 5ccb0957d1f46c36add960c0e4ef2a545cb03cbe
2018-08-02 07:01:42 -07:00
Rafael Oleza cbfe159d44 Bump metro@0.43.3
Summary:
This new release is going to contain 3 things:

- Builtin TypeScript support
- A fix on the traversal of dependencies
- A fix on the way that RN loads the config file (@[100000044482482:ives] is working on the diff atm)

Lots of things added in just 1 day! 😅

Reviewed By: CompuIves

Differential Revision: D9131710

fbshipit-source-id: 6a5ec3b35f420d1a400611ce8e094a07807e3e44
2018-08-02 06:46:53 -07:00
Ives van Hoorne 140b230e84 Change react-native config loading to provide an override for the default config.
Summary:
Instead of overriding the config at the end we now do it right after applying default
config and before the user config is applied.

Reviewed By: rafeca

Differential Revision: D9131758

fbshipit-source-id: 15e575fc11a781187f3ee2fa7cf81c227cf6a088
2018-08-02 05:31:48 -07:00
David Aurelio b91184885f Fix behaviour of `freeNatives()`
Summary:
@public

Prevents repeated deallocation of weak references.

Reviewed By: pasqualeanatriello

Differential Revision: D9131551

fbshipit-source-id: bc79596e056ae0657a55146ad786422fd0f5badc
2018-08-02 04:02:09 -07:00
David Aurelio cdf9b84dd0 Adapt micro benchmark
Summary:
- adds more property assignments
- reduces the number of layout roots that exist simultanously

Reviewed By: pasqualeanatriello

Differential Revision: D8989389

fbshipit-source-id: 6a0ac800a4caad61a2f4bf98caa314855b70875f
2018-08-02 04:02:08 -07:00
Nurzhan Bakibayev 1b65c6d73a Show warning instead of error on duplicate connection
Summary: Show warning instead of error on duplicate connection

Reviewed By: alexeylang

Differential Revision: D9117286

fbshipit-source-id: 81b135584bb3f44e37388de6df9d6386e5fb758a
2018-08-02 03:16:33 -07:00
Harry Tormey 1fb7a25f7b Add iOS Validate Environment Script (#19750)
Summary:
Fixes #19694 this diff adds an iOS environment validation script as requested by hramos.

 A similar script for Android exists: scripts/validate-android-test-env.sh.

This script:

- Validates that the minimum required Xcode version is installed (people using Xcode 8 with a recent release may encounter cryptic build errors).

- Validates the correct Node version is installed (Node 10 is not fully supported at the time, Node 6 is no longer supported).

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Run ./scripts/validate-ios-test-env.sh on a properly setup OSX machine and verify it works, change the version comparison and make sure it fails.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[INTERNAL] [ENHANCEMENT] [scripts] - Add iOS validate environment script

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19750

Differential Revision: D9005151

Pulled By: hramos

fbshipit-source-id: a69ef2a6e513e580089c791fd44a0e70c2a3f240
2018-08-01 20:46:58 -07:00
Tim Yung 0bfbf307c8 RN: Fix `testID` on Switch
Summary: My recent refactor of `Switch` broke `testID` from being passed down to the underlying component. This fixes that.

Reviewed By: TheSavior

Differential Revision: D9127216

fbshipit-source-id: 6d442b1cc19cf9f44cb48faac58e5abe9f36064b
2018-08-01 19:16:20 -07:00
gengjiawen 4d0a194da3 add appveyor cache (#20490)
Summary:
add appveyor cache for better build speed.
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - add appveyor cache
Pull Request resolved: https://github.com/facebook/react-native/pull/20490

Differential Revision: D9128396

Pulled By: hramos

fbshipit-source-id: a973f73455b28b8eec002cc28f7eb2f6d8302b9c
2018-08-01 18:46:27 -07:00
Valentin Shergin 9042438975 Fabric: `bridge` prop was removed from RCTSurface interface
Summary:
@public
We are moving away from using `RCTBridge` instance in public APIs to enable us using more performance solutions in the future.
This change also fixes "SwipeBack issue" caused by RCTSurfaceHostingProxyRootView returning nil bridge.

Reviewed By: mdvacca

Differential Revision: D9094625

fbshipit-source-id: 6bde3c54773e75ca4c0b6fd908da9d7235b5c3be
2018-08-01 15:32:01 -07:00
ChngYekKhai ed6a5ff4b4 Fix typo in Releases.md (#20487)
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Pull Request resolved: https://github.com/facebook/react-native/pull/20487

Differential Revision: D9117645

Pulled By: hramos

fbshipit-source-id: f1fc725b28ed606175baba19fa165a7add12da43
2018-08-01 07:16:56 -07:00
Rafael Oleza 4ddd8a8b65 Bump metro@0.43.2
Summary: shiptoasting

Reviewed By: mjesun

Differential Revision: D9116560

fbshipit-source-id: 2688e8ea895199d3b2100fe69979afe37cbfecf3
2018-08-01 03:46:34 -07:00
Will Wilson d0917ed4f7 Fixes react native beta 5 break
Summary: This fixes an error that shows up when building with Xcode 10 beta 5.

Reviewed By: fkgozali, dinhviethoa

Differential Revision: D9086574

fbshipit-source-id: 1d70049eafd20a85d482dca101980c71935d838e
2018-07-31 21:53:56 -07:00
Tim Yung 9a4fd6b78d Switch: Warn for Deprecated Color Props
Summary:
Introduces warnings to `Switch` when the deprecated props are being used.

See D9081343 for more details on the specific prop changes.

Reviewed By: blairvanderhoof

Differential Revision: D9081451

fbshipit-source-id: 7f997fc97d316038f0917d2540b982bd9cf34d03
2018-07-31 21:01:41 -07:00
Tim Yung 965adee109 RN: Revamp Switch Component
Summary:
Revamps the Switch API with the goal of increasing the pit of success:

- Introduce `trackColor` which encourages callers configuring the color to set colors for both cases.
- Introduce `ios_backgroundColor` which allows customizing the iOS-only background fill color.
- Deprecate `tintColor` because it is not obvious that this is for the `false` case.
- Deprecate `onTintColor` because the prop is named unconventionally like a callback.
- Renamed `thumbTintColor` to `thumbColor`.

This revision also cleans up the `Switch` component in the following ways:

- More precise Flow types for native components.
- Inline iOS-specific style (so that the code gets stripped on Android).
- Minor documentaiton cleanup.

After this commit, all deprecated props will continue working.

Next, I plan to introduce warnings.

Eventually (e.g. in a couple releases), we can drop support for the deprecated props.

Reviewed By: TheSavior

Differential Revision: D9081343

fbshipit-source-id: c5eb949047dd7a0ffa72621839999d38e58cada8
2018-07-31 21:01:41 -07:00
Himabindu Gadupudi 9f8b5a9ed5 If source is null , source uri is null or source is not an array should respect style
Summary: If source is null , source uri is null or source is not an array should respect style like in iOS

Reviewed By: yungsters

Differential Revision: D9018005

fbshipit-source-id: 5f695e8e3007c96e6004973e7fcbc6b57cc15249
2018-07-31 12:02:10 -07:00
Lorenzo Sciandra a6e27c3f55 Update Discussion template (#20469)
Summary:
Quick PR to point the users to the new dedicated repo.
Pull Request resolved: https://github.com/facebook/react-native/pull/20469

Differential Revision: D9082493

Pulled By: hramos

fbshipit-source-id: b1e0a2a38adcc3920596ded251e95545f88502f7
2018-07-31 08:01:29 -07:00
slorber 30b9d81087 Add .nvmrc + fix node version for eslint 5 compat (#20109)
Summary:
A .nvmrc file is practical when working on many node projects with different version requirements.

Also, the current required node engine is incompatible with eslint5 requirements:

```js
  "engines": {
    "node": ">=8"
  },
```

It produces the following warning on install:

> error eslint@5.0.1: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0".
> error Found incompatible module

I made the requirement compatible with eslint5 requirements
Pull Request resolved: https://github.com/facebook/react-native/pull/20109

Differential Revision: D9071440

Pulled By: hramos

fbshipit-source-id: 0d3728d03cad20d22c67a731a6d283cea48b8da8
2018-07-31 02:34:16 -07:00
gengjiawen b6f2aad9c0 Upgrade to soloader 0.5.1 (#20325)
Summary:
Upgrade to soloader 0.5.1. Fixes #20323.

pass all current ci.

none

 [GENERAL] [BUGFIX] [ANDROID] - Upgrade to soloader 0.5.1
Pull Request resolved: https://github.com/facebook/react-native/pull/20325

Differential Revision: D9060688

Pulled By: hramos

fbshipit-source-id: 614c0c1e3cd3981a0acb2effab7ddd4e4508cbcd
2018-07-31 01:32:30 -07:00
gengjiawen 847261be8e fix windows gradle bug (#20293)
Summary:
fix windows gradle bug, you can also see full log in https://ci.appveyor.com/project/gengjiawen/react-native/build/1.0.11/job/ic0nml8s4qbmni4e.
```
FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture snapshot of input files for task ':RNTester:android:app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file content.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
```
Build success log: https://ci.appveyor.com/project/gengjiawen/react-native/build/1.0.12/job/xuaj8tm3p1piovbt.

pass all current ci.
https://github.com/facebook/react-native/pull/20281
 [GENERAL] [INTERNAL] [RNTester] - fix windows gradle bug
Pull Request resolved: https://github.com/facebook/react-native/pull/20293

Differential Revision: D9071261

Pulled By: hramos

fbshipit-source-id: 87fab94d15d78dac1db51f15ca5f4ea9e3a6ad04
2018-07-30 20:16:19 -07:00
Onur Ersel 1f1ddd0261 Added necessary headers and sources to fix compilation errors for tvOS target (#20406)
Summary:
With version 0.56.0, XCode doesn't compile and run the scheme for tvOS. This commit adds missing headers and sources to build phases in React project.
Fixes #20087
Pull Request resolved: https://github.com/facebook/react-native/pull/20406

Differential Revision: D9071205

Pulled By: hramos

fbshipit-source-id: d66f1294d12cfda9c41b8867a578922f3c2a51f7
2018-07-30 20:16:19 -07:00