Граф коммитов

15880 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kim c02f278d8f xplat// -> fbsource//xplat/ for xplat/js
Reviewed By: scottrice

Differential Revision: D14076351

fbshipit-source-id: f803d2af438a5eb3f18c981793e17b6293d8ef1c
2019-02-14 23:53:32 -08:00
Valentin Shergin b3961aff2a Fabric: Fixed small perf problem in RCTImageManager
Summary:
This changes fix small perf problem in RCTImageManager (and layout!) saving (in my completly non-scientific tests) up to 2 ms.
Maybe that's not much, but it fires during layout (and ShadowNodeTree reconsiliation processes), so it has to be very performant.

Reviewed By: JoshuaGross

Differential Revision: D14072077

fbshipit-source-id: 0baa54584dc3ae6a5f43be13fd152b84801c8539
2019-02-14 20:09:16 -08:00
Valentin Shergin 5e0b5ff7cc Fabric: Introducing SharedFunction
Summary:
`SharedFunction` implements a pattern of a shared callable object that contains the same executable inside. It's similar to  `std::function` with one important difference: when the object is copied, the stored function (and captured values) are shared between instances (not copied).
`SharedFunction` can be stored inside `std::function` because it's callable.
It useful in some scenarios, such as:
 * When captured by `std::function` arguments are not copyable;
 * When we need to replace the content of the callable later on the go.

We will use it in the coming diffs.

Reviewed By: mdvacca

Differential Revision: D14072078

fbshipit-source-id: 9df4ad2d1b92394e2dfef5c283f35c7c0bd4b500
2019-02-14 20:09:16 -08:00
Amir Sharif 50fc666aad Add support for regex in YellowBox warnings
Summary: We want to use a Regex for potentially more complicated string warnings. This will allow ignoring dynamic rules that include ID fields for example.

Differential Revision: D14079118

fbshipit-source-id: aff01c6b6eedc77cd91638988700c093dcda0488
2019-02-14 16:39:34 -08:00
Joshua Gross 51b868728a Attempt to fix T40449334 by adding DoNotStrip to interface
Summary: Java symbols are likely being stripped at compile-time, preventing Reflection from working properly in C++. Should fix T40449334.

Reviewed By: mdvacca

Differential Revision: D14070629

fbshipit-source-id: f180fa3294b66f660ab1568250c47432cbf0c774
2019-02-14 15:38:43 -08:00
Takeru Chuganji 6082431c5d Leak mutex to avoid a crashing issue (#22607)
Summary:
Try to solve https://github.com/facebook/react-native/issues/13588
ref: https://github.com/facebook/componentkit/pull/906
Pull Request resolved: https://github.com/facebook/react-native/pull/22607

Differential Revision: D14084056

Pulled By: shergin

fbshipit-source-id: 585aef758e1a215e825ae12914c5011d790a69b0
2019-02-14 14:53:20 -08:00
Quentin Valmori 8b59ef6818 Upgrade BouncyCastle [CVE] (#19074)
Summary:
This PR fixes no existing issue. BouncyCastle library is used inside React-Native but the current version is not updated anymore and this version is subject to `CVE-2013-0169`

Current maven link : http://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk16/1.46 . The descrption says that this jar is for SDK 1.6 but no updated since 2011.

Proposed maven link : http://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on The description says that that jar is for SDK 1.5 to SDK 1.8 and latest release was done in January 2018.

Nop.

But there was a discussion about bouncy castle few years ago https://github.com/facebook/react-native/issues/2793

[GENERAL] [Changes] robolectric - Upgrade bouncycastle lib to fix CSV vulnerabilities

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

Reviewed By: mmmulani

Differential Revision: D14068062

Pulled By: hramos

fbshipit-source-id: 24e63cab33c3e8b5a088b9a8843afdc23b43553d
2019-02-14 14:53:20 -08:00
Dawid 0fe26db679 Add deprecation warning for ImageEditor (#23452)
Summary:
Add a deprecation warning for the [ImageEditor](https://facebook.github.io/react-native/docs/imageeditor) module as part of #23313.

[General] [Deprecated] - Deprecated [ImageEditor](https://facebook.github.io/react-native/docs/imageeditor) as it has now been moved to [react-native-community/image-editor](https://github.com/react-native-community/react-native-image-editor)
Pull Request resolved: https://github.com/facebook/react-native/pull/23452

Differential Revision: D14082792

Pulled By: cpojer

fbshipit-source-id: 2315b4518ce20a0ec4e97f421960e4ab923ba21d
2019-02-14 06:18:29 -08:00
Kacper Wiszczuk ac979465b8 fix: add local-cli to react-native package (#23449)
Summary:
Make `local-cli` part of `react-native` package to prevent breaking changes.
Pull Request resolved: https://github.com/facebook/react-native/pull/23449

Differential Revision: D14080767

Pulled By: cpojer

fbshipit-source-id: 9f9467e561caca3d91f17b0afae4efbf308bc246
2019-02-14 06:08:55 -08:00
Christoph Nakazawa caf85d403a Remove VibrationIOS
Summary: This module has been deprecated for two years. There is `Vibration`, backed by the same native module, with cross platform support.

Reviewed By: rickhanlonii

Differential Revision: D14080979

fbshipit-source-id: 7bf60cfdca9517c6858b3c7f8a2b16eab0ce8e80
2019-02-14 05:41:53 -08:00
Christoph Nakazawa a5ae7f57f1 Remove deprecation messages.
Summary: These modules have been deprecated for at least one release or more. By landing this diff now, they will be fully removed from 0.60 (to be released in ~April).

Reviewed By: rickhanlonii

Differential Revision: D14080869

fbshipit-source-id: cf39cc1782eec1dd09750d20b55c76f580320f4d
2019-02-14 05:41:53 -08:00
Nimish a0634353f7 chore: remove the unused packages from package.json (#23428)
Summary:
There are couple of packages which are installed as dependency but are not directly used in the project. In this PR I have remove those packages from dependency from the package.json.

[General] [Removed] - Remove the unused packages from package.json
Pull Request resolved: https://github.com/facebook/react-native/pull/23428

Differential Revision: D14065342

Pulled By: cpojer

fbshipit-source-id: 48a423e51d47742dcf0c8a8b2ec43e6a0f2e94fd
2019-02-14 05:03:11 -08:00
gengjiawen 539ca06d0f refactor nodejs image in analyze_pr task (#23433)
Summary:
move all node image to official one, and remove redundant path.
Pull Request resolved: https://github.com/facebook/react-native/pull/23433

Differential Revision: D14080808

Pulled By: cpojer

fbshipit-source-id: c8f7ec90a8c59129a0d8c5667f3c648dd7865be3
2019-02-14 02:33:49 -08:00
gengjiawen 410d583951 lock docker image version in ci (#23424)
Summary:
Lock the version will help us to test new dependency version like ndk or buck.
Pull Request resolved: https://github.com/facebook/react-native/pull/23424

Differential Revision: D14065171

Pulled By: cpojer

fbshipit-source-id: 954297ca7c69ff829a4522f34274ae8ab162b36b
2019-02-14 02:21:08 -08:00
Valentin Shergin 13d87e9ad2 Fabric: Fixed object ownership problem in ImageManager
Summary:
Sometimes, when we deal with ImageRequest and ImageResponseObserverCoordinator we subscribe for status (or access the coordinator) without owning an ImageRequest. In those cases, we have to retain the coordinator explicitly.
For those cases, ImageRequest now exposes `ImageResponseObserverCoordinator` as a `std::shared_ptr`.

Eg, concretely in the code, `completionBlock` and `progressBlock` copied a raw pointer to the observer inside which can lead to a crash when ImageRequest is being deallocated before we received an image data.

Reviewed By: JoshuaGross

Differential Revision: D14072079

fbshipit-source-id: e10120bc05bf685e288f7b3d69092714dcd91d43
2019-02-14 00:43:03 -08:00
David Vacca 27a0fc58f7 Apply clang format to Fabric C++ android code
Summary: run clang-format into Fabric C++ android code

Reviewed By: JoshuaGross

Differential Revision: D14078185

fbshipit-source-id: 07c77044dc7ca437c9dc4417a886f0d8f81ef788
2019-02-14 00:07:41 -08:00
David Vacca 959fdf6049 ReadableNativeMap -> ReadableMap
Summary:
This diff refactors JNI methods used by the Binding.cpp class in order to use ReadableMap instead of ReadableNativeMap
This will be helpful to provide a different implementation of ReadableMap from C++

Reviewed By: shergin

Differential Revision: D14077762

fbshipit-source-id: 595b0c2d3a2d6070112257b65c1141a8af36f0e1
2019-02-14 00:07:40 -08:00
empyrical 1ec9325bae Fabric: Change naming scheme of `ShadowNodeFragment` placeholders (#23437)
Summary:
This pull request implements some suggestions made in #23414, namely:

* Rename `ShadowNodeFragment::nullSharedProps()` (and family) to `ShadowNodeFragment::propsPlaceholder()`;
* Introduce similar functions for the rest of members (tag and rootTag);

Later pull requests to remove designated initializers from Fabric (for MSVC support) will use these

I'd like to do the rename of `rootTag` to `surfaceId` as well, but would make sense to do in a separate diff as that would result in a great deal of changes.

[General] [Changed] - Changed naming scheme of `ShadowNodeFragment` placeholders, and added placeholders for remaining members
Pull Request resolved: https://github.com/facebook/react-native/pull/23437

Reviewed By: mdvacca

Differential Revision: D14072007

Pulled By: shergin

fbshipit-source-id: d5bb10a82c16d45955f417a49b503f215c4bc521
2019-02-13 22:03:01 -08:00
Héctor Ramos 7c9805ce16 Fix buildType issue introduced in rebase (#23444)
Summary:
While rebasing https://github.com/facebook/react-native/pull/18892, I missed that buildTypeName no longer existed.

[ANDROID] [Fixed] - Fix issue in react.gradle
Pull Request resolved: https://github.com/facebook/react-native/pull/23444

Differential Revision: D14078281

Pulled By: hramos

fbshipit-source-id: c2b3a1dccb890392f47ed93a3e1ac6e62e50999a
2019-02-13 19:08:27 -08:00
empyrical 1cb34cb761 Fabric/DebugStringConvertibleItem.h: Fix for MSVC (#23436)
Summary:
This pull request removes a constructor in `DebugStringConvertibleItem.h` that was causing this issue in MSVC:

```
DebugStringConvertibleItem.cpp(20): error C2600: 'facebook::react::DebugStringConvertibleItem::DebugStringConvertibleItem': cannot define a compiler-generated special member function (must be declared in the class first)
```

It was likely conflicting with the constructor that has default values for all of its arguments.

[General] [Fixed] - Fixed `DebugStringConvertibleItem` compilation on MSVC
Pull Request resolved: https://github.com/facebook/react-native/pull/23436

Reviewed By: shergin

Differential Revision: D14067760

Pulled By: mdvacca

fbshipit-source-id: 303cf9b3559932c3d06514a1f3a8739d0f6f9dc2
2019-02-13 18:59:33 -08:00
Hoa Dinh b655e7555b Fixed build on Xcode 10.2 - availability guard
Summary:
https://our.intern.facebook.com/intern/sandcastle/job/18014398585083744

```
xplat/js/react-native-github/React/Views/ScrollView/RCTScrollViewManager.m:38:20: warning: 'UIScrollViewContentInsetAdjustmentBehavior' is only available on iOS 11.0 or newer [-Wunguarded-availability-new]
```

Reviewed By: mattrobmattrob

Differential Revision: D14076127

fbshipit-source-id: 4050131c4f5211757383069567a2cf5382979735
2019-02-13 17:19:42 -08:00
Håvard Fossli cf5f25472d Add support for needsOffscreenAlphaCompositing on iOS (#19052)
Summary:
Currently on iOS in UIKit and in RN all views are by default set to `allowsGroupOpacity=true`. Any view that has all of the following
- `allowsGroupOpacity` set to true
- opacity greater than 0.0 and less than 1.0
- have any subviews

will be rendered off screen (on CPU). [See this link for more details](https://stackoverflow.com/questions/13158796/what-triggers-offscreen-rendering-blending-and-layoutsubviews-in-ios/13649143#13649143).  Which means performance will be decreased and may affect the user experience. Therefore it makes sense to allow the developers to override this property.

This pull request allows for changing `allowsGroupOpacity` via `needsOffscreenAlphaCompositing`. Android already supports this. This is not a new name or variable. See https://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing.
Pull Request resolved: https://github.com/facebook/react-native/pull/19052

Differential Revision: D14071300

Pulled By: hramos

fbshipit-source-id: 004278801a19463ebf9da6f8855f02ed27926025
2019-02-13 16:43:20 -08:00
Valentin Shergin 9101ebdfbb Fabric: More clang-format
Summary: Apparently, I haven't modify all files in D14018903. Here is the last (I hope) chunk.

Reviewed By: JoshuaGross

Differential Revision: D14058288

fbshipit-source-id: b21950cdd1aa9aa55b0c72fac0f8b44e4a7d131c
2019-02-13 15:25:00 -08:00
David Buchan-Swanson 6b21109d3d Allow bundle task to be disabled for release (#18892)
Summary:
The current system would always end up falling back to `true` for release builds
Pull Request resolved: https://github.com/facebook/react-native/pull/18892

Differential Revision: D14069444

Pulled By: hramos

fbshipit-source-id: 16e32a366b3b2e252a98a967da827ba1ebaeff85
2019-02-13 14:40:37 -08:00
Josh Carver 4c400a10c2 Make ImagePickerIOS.openCameraDialog work with video (fixes #17989) (#19170)
Summary:
Fixes #17989

Previously, `ImagePickerIOS.openCameraDialog` would not render a `Video` option when the camera screen opened. If you passed `ImagePickerIOS.openCameraDialog({ videoMode: true }, ...)` the app would crash with an error complaining about the proper mediaType(s) not being set (see issue: #17989  for full details).

This is a 2 line change that sets the mediaTypes properly, so now users can capture videos in addition to photos.
Pull Request resolved: https://github.com/facebook/react-native/pull/19170

Differential Revision: D14068078

Pulled By: hramos

fbshipit-source-id: d04a3d267ca83ea58e88c880a85ac34ddd4744c8
2019-02-13 13:27:18 -08:00
Héctor Ramos 937c79e2f2 Suggest running yarn lint --fix (#23413)
Summary:
This PR expands the code analysis script to allow for customizing the GitHub Review left by analysis-bot whenever it finds code-level issues.

Some, but not all, `eslint` errors are fixable by running `yarn lint --fix`. When the `eslint` converter finds warnings or errors, the bot will suggest running the command as part of the review.

The script could be adjusted to only suggest this when `eslint` returns a non-zero `fixableErrorCount` or `fixableWarningCount`, but I think this is a good first step to get people to unblock themselves when they see this type of review from the bot.

I've also excluded `bots/` and `scripts/` from eslint as these have several `eslint` errors that need to be addressed. These directories do not contain core RN code, so they can be excluded for now.

[GENERAL] [Changed] - analysis-bot will suggest fixing eslint warnings on code reviews
Pull Request resolved: https://github.com/facebook/react-native/pull/23413

Differential Revision: D14065757

Pulled By: cpojer

fbshipit-source-id: cc588643f7ddb3c4631d89c26b799f7a7244e616
2019-02-13 08:46:03 -08:00
Alejandro Ruperez 00392ac46b Resolves #23390: cxxreact, jsi and jsiexecutor depends on DoubleConversion and glog. (#23430)
Summary:
Resolves #23390: **cxxreact**, **jsi** and **jsiexecutor** depends on **DoubleConversion** and **glog**.

This cause:
```
Undefined symbols for architecture x86_64:
  "google::LogMessage::LogMessage(char const*, int, int)", referenced from:
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
  "double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const in JSIDynamic.o
      double_conversion::DoubleToStringConverter::ToShortestSingle(float, double_conversion::StringBuilder*) const in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o
      ...
  "double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
  "google::LogMessage::stream()", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      ...
  "google::LogMessage::~LogMessage()", referenced from:
      std::__1::__function::__func<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1, std::__1::allocator<facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1>, void ()>::operator()() in CxxNativeModule.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
      std::__1::__function::__func<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2, std::__1::allocator<facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o
  "google::LogMessageFatal::~LogMessageFatal()", referenced from:
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
      facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
      folly::detail::ScopeGuardImpl<facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o
      facebook::react::JSBigFileString::c_str() const in JSBigString.o
      facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o
      std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o
      facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

[iOS] [Fixed] - Added `DoubleConversion` and `glog` to `cxxreact`, `jsi` and `jsiexecutor` subspecs in `React.podspec` file.

The goal of this PR is to have no need to fix #23390 by manually adding **DoubleConversion** and **glog** to _Link Binary With Libraries_ of **React** framework target in cocoapods project.

![captura de pantalla 2019-02-12 a las 17 12 05](https://user-images.githubusercontent.com/297950/52650102-deb25e80-2ee9-11e9-9595-f7fbd4730671.png)
Pull Request resolved: https://github.com/facebook/react-native/pull/23430

Differential Revision: D14065309

Pulled By: cpojer

fbshipit-source-id: 4318c3770c54087f198856c983f7cb73ff30000f
2019-02-13 08:39:56 -08:00
Dulmandakh 57f444bd8a bump targetSdkVersion to 28 (#23431)
Summary:
Bump targetSdkVersion to 28

[Android] [Changed] - Bump targetSdkVersion to 28
Pull Request resolved: https://github.com/facebook/react-native/pull/23431

Differential Revision: D14065177

Pulled By: cpojer

fbshipit-source-id: a161d1d385b7b40ec93d70851e5a41baeb58f830
2019-02-13 07:13:19 -08:00
Dulmandakh 5747094532 improve Android Network Security config (#23429)
Summary:
This PR is trying to improve Android Network Security configuration introduced in 84572c4051. I found that Android merges all manifest files into a single manifest file when building an app, so this PR provides AndroidManifest.xml with network security config in debug folder, that will be used only for debug builds. Also the network security configuration will be applied to only app that target API 28. Moved security config file to xml-v28, so that it'll only visible to API 28 and above.

See https://developer.android.com/studio/build/manifest-merge

[Android] [Changed] -  Android Network Security configuration.
Pull Request resolved: https://github.com/facebook/react-native/pull/23429

Differential Revision: D14065124

Pulled By: cpojer

fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
2019-02-13 06:38:29 -08:00
gengjiawen e4fac61d57 switch node 8 image to official one (#23425)
Summary:
node 8 image has yarn too. Also the official one has the latest yarn.
Pull Request resolved: https://github.com/facebook/react-native/pull/23425

Differential Revision: D14065105

Pulled By: cpojer

fbshipit-source-id: 4eb3347fc191d928091e984fe3e5887861ec8aa9
2019-02-13 06:32:43 -08:00
Dulmandakh 84f40da990 @Nonnull annotation for ReactPackage (#23415)
Summary:
Here are some leftovers from nullable annotations for native modules, discovered while developing native module in Kotlin. This will help improve Kotlin developer experience

[Android] [Changed] - Add Nonnull annotations to ReactPackage
Pull Request resolved: https://github.com/facebook/react-native/pull/23415

Differential Revision: D14064607

Pulled By: cpojer

fbshipit-source-id: af2ce1fc1911ee03c54b20a4fc3a6d1aba9267da
2019-02-13 05:29:18 -08:00
gengjiawen e6320c6e75 switch to official node image in ci (#23423)
Summary:
The official node image bundled with yarn by default, and it has maintained by the official group so we can always get the latest version.
Pull Request resolved: https://github.com/facebook/react-native/pull/23423

Differential Revision: D14064773

Pulled By: cpojer

fbshipit-source-id: c24a2bc2d0dda7ae852b25c340ca0d149f4c196c
2019-02-13 05:11:17 -08:00
Jonathan Kim 79d9595b97 Turn off translation for fbandroid
Summary:
Turn off translations in fbandroid to mitigate the parse time regression. Translate the remaining `xplat//` to `fbsource//xplat/` to do so

run_all_tests

Reviewed By: scottrice

Differential Revision: D14041085

fbshipit-source-id: 9d3bc493c6662c03c4028aaebfbec58d145e8c6b
2019-02-13 04:36:00 -08:00
Christoph Nakazawa c6d8f6048a Properly gate platform specific code in Alert
Summary:
In the past, Alert and AlertIOS were separate modules and both were shipped on Android even though only Alert can be used there. We unified the two modules but it meant that the code for both was still shipped on both platforms.

This diff changes it so that platform specific code is gated in a `Platform.OS` block, which means that the unnecessary code per platform is being stripped out. I'm not looking to win a beauty contest with the code in this module - we have barely touched it in years and I don't think we will touch it anytime soon, so I just merged the sub-classes (which only had static methods anyway) directly into the main class. I'm aware I could make two separate files with platform extensions but that ends up being more code here and it seems straightforward enough to me.

Reviewed By: TheSavior

Differential Revision: D14057404

fbshipit-source-id: 1ae1d227a39d76de9779b3db62960cca46e9b75c
2019-02-13 04:24:12 -08:00
Luna Wei c974b5e966 Remove SizeMonitoringFrameLayout
Summary: SizeMonitoringFrameLayout was used to set layout contraints on the root shadow node when the native view's size changes. Since then, we introduced ways for the root node to use proper layout contraints using the root view's measure specs, which provides more accurate constraints for the root node, so SizeMonitoringFrameLayout is no longer needed. This ends up making a lot of UIManagerModule's method signatures cleaner

Reviewed By: mdvacca

Differential Revision: D9565720

fbshipit-source-id: c569cd15991a09987cc01e89612dc9193ad99b45
2019-02-12 18:23:09 -08:00
Brent Erickson 08a6b573f7 Add scrollEnabled example to RNTester (#23409)
Summary:
RNTester is missing a test for the scrollEnabled prop

[General] [Added] - Added RNTester ScrollView scrollEnabled prop test
Pull Request resolved: https://github.com/facebook/react-native/pull/23409

Differential Revision: D14059824

Pulled By: hramos

fbshipit-source-id: 0287277b64aeac69c4aeba83dbb3f73be646ede7
2019-02-12 17:31:30 -08:00
zhongwuzw 7a6fe0cda0 Fix triangle views on iOS (#23402)
Summary:
Fixes #22824 #21945 , the bug comes from #21208 , it was to fix #11897. Now Let's constrain edge adjust only when view has corners.

[iOS] [Fixed] - Fix triangle views on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/23402

Differential Revision: D14059192

Pulled By: hramos

fbshipit-source-id: be613bf056d3cc484f281f7ea3d08f251971700a
2019-02-12 16:54:20 -08:00
Héctor Ramos 05c56edf41 Remove flaky Switch e2e test (#23410)
Summary:
'Switch that starts on should switch' appears to be flaky, as it has failed on seemingly unrelated commits, only to succeed on the next CI run. `Switch` is scheduled to be removed from the core repository anyway, so I'm removing this test to ensure we get a clear signal for the rest of the repository.

[GENERAL] [Changed] - Tests: Removed flaky Switch e2e test.
Pull Request resolved: https://github.com/facebook/react-native/pull/23410

Differential Revision: D14057068

Pulled By: cpojer

fbshipit-source-id: dc7bc74c3d23ec3856107fec4ee9fa388adce2e5
2019-02-12 14:53:22 -08:00
Brent Erickson da6a26548b Fix crash in RNTester when removing/developing tests (#23406)
Summary:
Ensure that the current openExample (stored in AsyncStorage) exists in the module list.

It's possible for the example to be missing if a test was removed & previously open in RNTester OR when actively developing RNTester tests & switching between branches

[General] [Fixed] - Potential crash in RNTester when removing/developing test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/23406

Differential Revision: D14055695

Pulled By: cpojer

fbshipit-source-id: 6cf00e097e934f7a342e7d210b6319e1cba142ca
2019-02-12 13:53:18 -08:00
Rafael Lincoln 36e026ee89 Add a deprecation warning when importing PushNotificationIOS (#23396)
Summary:
Added a deprecation warning for the `PushNotificationIOS`, module as part of #23313.

[General] [Deprecated] - PushNotificationIOS [was moved to community repo](https://github.com/react-native-community/react-native-push-notification-ios)
Pull Request resolved: https://github.com/facebook/react-native/pull/23396

Differential Revision: D14055656

Pulled By: cpojer

fbshipit-source-id: fc371340aa4d8ac82fee2a3dc6f6c796ae98dde4
2019-02-12 13:47:25 -08:00
Sergei Dryganets 9df892cfcb DialogModule crash fixes. (#19332)
Summary:
I'm trying to fix DialogModule crashes we have in production: #6228

In this PR I'm fixing the following problem:

The fragment manager methods should be called only from the foreground. Now dismissExisting is protected by the mIsForeground variable as well as showNewAlert method.

[ANDROID] [Fixed] DialogModule - Race condition in dialog module fixed.

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

Reviewed By: mdvacca

Differential Revision: D13804542

Pulled By: hramos

fbshipit-source-id: 9d59c8eaad49e2d3f141e255467627d411ae8797
2019-02-12 12:59:28 -08:00
Dulmandakh 0a07161084 bump Fresco to 1.11 (#21935)
Summary:
This PR bumps Fresco to 1.11
Pull Request resolved: https://github.com/facebook/react-native/pull/21935

Reviewed By: mdvacca

Differential Revision: D12908390

Pulled By: hramos

fbshipit-source-id: 11059b30ab0f20dacb7e7def38c53012e9dfdf10
2019-02-12 12:20:36 -08:00
Emily Janzer 7652e31d8c Pass through track color values for true/false to native component
Summary:
There's a bug in the OSS Switch component where the track color value is reset to the default value when the switch is toggled. It looks like the Java class resets the track color value in `setOn` (which fires in a press event): https://fburl.com/vmugfzja but these values aren't actually initialized from JS - in Switch.js we only pass through the current track color: https://fburl.com/vytekd0o.

The React component already has an API for defining both true/false track colors. However, we should also make sure not to reset these values for people using the old API of `tintColor`/`onTintColor`, so I'm changing it to only reset the value when both of those props are null.

Reviewed By: mdvacca

Differential Revision: D14035007

fbshipit-source-id: 12d968076bd47d54deedbfc15b12ff3cd77e2fd0
2019-02-12 10:47:58 -08:00
Peter Argany 2d86d38e75 Make AnimatedMock instantly complete spring and timing animations
Summary:
Some MP E2E tests started failing when I introduced AnimatedMock (D13811035) with this error:

> message: Timeout exception: Message: element located by locator {"id":"mp_your_items_tab_button"} is not visible

The test relied on the button to animate in, which AnimatedMock disabled. The fix is to complete animations instantly in AnimatedMock. This diff implements that for spring and timing.

Reviewed By: cpojer

Differential Revision: D14036172

fbshipit-source-id: 18a422ce8ef6de05ff9224c94214524511a76949
2019-02-12 10:40:23 -08:00
Wellinton Monge e2bd7db732 Merge AlertIOS with Alert (#23318)
Summary:
Itwas merged AlertIOS into Alert and removed type parameter from Alert.alert line 60 at Alert.js

[AlertIOS] [Change and Replace] - Merge AlertIOS into Alert.
Pull Request resolved: https://github.com/facebook/react-native/pull/23318

Reviewed By: mjesun

Differential Revision: D14031421

Pulled By: cpojer

fbshipit-source-id: 98db173adeb65aa90d309f8a583993bc0cddb6e1
2019-02-12 07:38:42 -08:00
Mike Nedosekin 4ac65f5413 Add deprecation warning for MaskedViewIOS (#23398)
Summary:
Add a deprecation warning for the [MaskedViewIOS](https://facebook.github.io/react-native/docs/maskedviewios) module as part of #23313.
[General] [Deprecated] - Deprecated [MaskedViewIOS](https://facebook.github.io/react-native/docs/maskedviewios) as it has now been moved to [react-native-community/masked-view](https://github.com/react-native-community/react-native-masked-view)
Pull Request resolved: https://github.com/facebook/react-native/pull/23398

Differential Revision: D14045290

Pulled By: cpojer

fbshipit-source-id: e97230f6861cf35ee0b49376d0a5c9c47d4e99f8
2019-02-12 07:14:02 -08:00
Dulmandakh 7b33d6b0b9 fix WritableArray, WritableMap nullable annotations (#23397)
Summary:
Recently, I added nullable annotations to ReadableArray, ReadableMap, WritableArray, WritableMap and subclasses to improve Kotlin developer experience. But found that I made mistake with pushArray, pushMap, pushString method of WritableArray, and putArray, putMap, putString methods of WritableMap. This PR fixes previous mistake.

Excerpt from WritableNativeArray.cpp.
```cpp
void WritableNativeArray::pushString(jstring value) {
  if (value == NULL) {
    pushNull();
    return;
  }
  throwIfConsumed();
  array_.push_back(wrap_alias(value)->toStdString());
}

void WritableNativeArray::pushNativeArray(WritableNativeArray* otherArray) {
  if (otherArray == NULL) {
    pushNull();
    return;
  }
  throwIfConsumed();
  array_.push_back(otherArray->consume());
}

void WritableNativeArray::pushNativeMap(WritableNativeMap* map) {
  if (map == NULL) {
    pushNull();
    return;
  }
  throwIfConsumed();
  array_.push_back(map->consume());
}
```

Excerpt from WritableNativeMap.cpp
```cpp
void WritableNativeMap::putString(std::string key, alias_ref<jstring> val) {
  if (!val) {
    putNull(std::move(key));
    return;
  }
  throwIfConsumed();
  map_.insert(std::move(key), val->toString());
}

void WritableNativeMap::putNativeArray(std::string key, WritableNativeArray* otherArray) {
  if (!otherArray) {
    putNull(std::move(key));
    return;
  }
  throwIfConsumed();
  map_.insert(key, otherArray->consume());
}

void WritableNativeMap::putNativeMap(std::string key, WritableNativeMap *otherMap) {
  if (!otherMap) {
    putNull(std::move(key));
    return;
  }
  throwIfConsumed();
  map_.insert(std::move(key), otherMap->consume());
}
```

[Android] [Changed] - fix nullable annotations in WritableArray, WritableMap
Pull Request resolved: https://github.com/facebook/react-native/pull/23397

Differential Revision: D14044014

Pulled By: cpojer

fbshipit-source-id: c44ea2e097e7b1156223b516aa640a181f0d4a9b
2019-02-12 06:26:34 -08:00
ferrannp 77300ca91c Add deprecation warning for ViewPagerAndroid (#23395)
Summary:
Add a deprecation warning for the [ViewPagerAndroid](https://facebook.github.io/react-native/docs/viewpagerandroid) module as part of #23313.

[General] [Deprecated] - Deprecated [ViewPagerAndroid](https://facebook.github.io/react-native/docs/viewpagerandroid) as it has now been moved to [react-native-community/viewpager](https://github.com/react-native-community/react-native-viewpager)
Pull Request resolved: https://github.com/facebook/react-native/pull/23395

Differential Revision: D14043025

Pulled By: cpojer

fbshipit-source-id: 2f7988fe69dbeff0f3add9babcb15d7eb974863e
2019-02-12 05:26:11 -08:00
Alex Dvornikov 3c74b6ea34 Bring back the unit tests for the Cxx implementation
Reviewed By: jeanlauliac

Differential Revision: D14026623

fbshipit-source-id: 76a4089bb09b7e5152e992a91eae0427877767c0
2019-02-12 04:50:52 -08:00
Evan Bacon daa79b0f97 Add Platform module for web target (#23387)
Summary:
Added a Platform file for module for instances where internal modules need Platform.
ex: 78be6efda9/Libraries/Utilities/Dimensions.js (L14)

* Added `Libraries/Utilities/Platform.web.js`
[CATEGORY] [TYPE] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/23387

Differential Revision: D14041834

Pulled By: cpojer

fbshipit-source-id: 9be7ad647d6a644956efa622b936fcecee7c1a1f
2019-02-12 03:32:29 -08:00