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

15880 Коммитов

Автор SHA1 Сообщение Дата
Eric Lewis 9ca7565563 Enable js e2e tests (#23571)
Summary:
Part of #23561. Small refactor to use 1 marker for the different tests, as it doesn't matter where it is- so long as we can detect it.

[General] [Fixed] - turn on JS e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/23571

Differential Revision: D14172069

Pulled By: hramos

fbshipit-source-id: cdde369a09d3528d05fec01d015613b3397714e6
2019-02-21 13:16:42 -08:00
Mikael Sand d9489c4e9c Don't reconnect inspector if connection refused (#22625)
Summary:
(Together with a pr to react-devtools) Fixes https://github.com/facebook/react-native/issues/21030

[iOS] [Fixed] - Fix infinite retry loop of inspector
Pull Request resolved: https://github.com/facebook/react-native/pull/22625

Differential Revision: D14169392

Pulled By: hramos

fbshipit-source-id: 2e301fd9d458598b62399fc61a9859ad29928483
2019-02-21 12:52:39 -08:00
Ville Immonen 0cffdaae30 Fix implicit conversion warning in RCTInspector.mm (#23577)
Summary:
Fixes Xcode warning: `Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'`.

[iOS] [Fixed] - Fix implicit conversion warning in RCTInspector.mm
Pull Request resolved: https://github.com/facebook/react-native/pull/23577

Differential Revision: D14169498

Pulled By: hramos

fbshipit-source-id: c877a46b2b583c96bc977308ed28bdc0b0f2b517
2019-02-21 12:46:41 -08:00
Joshua Gross 286abc5d08 Enable profile builds by adding ObjC annotations
Summary: Currently xcode fails profile builds since these variables are unused when asserts are disabled.

Reviewed By: PeteTheHeat

Differential Revision: D14160565

fbshipit-source-id: 997352dd148d23c28fa92d4171071c1abbb742f5
2019-02-21 12:40:38 -08:00
Valentin Shergin 7b62dca921 Fabric: Removed unnecessary const_cast leftovers
Summary: Trivial. If it compiles, it works.

Reviewed By: JoshuaGross

Differential Revision: D14146579

fbshipit-source-id: 6f6895d1634709a5bde012850c5df756171320ab
2019-02-21 10:46:52 -08:00
David Aurelio 25566ef28b `setBaseLine` -> `setBaseline`
Summary:
@public

`setBaseLine` was the only place where we used a capitalised *L.* Fixed here.

Reviewed By: SidharthGuglani

Differential Revision: D14152320

fbshipit-source-id: abf54fe7d6088e03775968baa8421c4bf43d6a6e
2019-02-21 05:38:51 -08:00
David Aurelio dc7dce130b Allow to use JNI without global refs
Summary:
@public

Adds the ability to opt into avoiding global weak JNI refs via `YogaConfig`.

Note that only homogeneous trees are supported, i.e. **mixing weak-ref and non-weak-ref nodes will break!**

Not using JNI refs hopefully will help with avoiding JNI reference table overflows, and will help creating trees on multiple threads, as no lock has to be acquired at any time.

Reviewed By: SidharthGuglani

Differential Revision: D14151037

fbshipit-source-id: 56d94713d39aee080d54be4cb4cdf5e3eccb473a
2019-02-21 05:38:51 -08:00
Mike Lambert f32dc63546 Fix two bugs with Location when not using ACCESS_FINE_LOCATION (#10291)
Summary:
Fix two bugs with Location when not using ACCESS_FINE_LOCATION:
- If we request highAccuracy=false, because we don't have ACCESS_FINE_LOCATION, but we don't have access to the NETWORK_PROVIDER...then the code should not trigger a SecurityException because it fell-back to using GPS_PROVIDER (which we don't have permission for)
- If the device is pre-lollipop, and doesn't have a provider, we should detect this properly instead of letting the pre-lollipop code raise a SecurityException.

Unfortunately, SecurityExceptions cannot be caught by the calling JS code. But I am not fixing that one here, instead choosing to fix/obviate the SecurityExceptions altogether.
Pull Request resolved: https://github.com/facebook/react-native/pull/10291

Differential Revision: D4163659

Pulled By: cpojer

fbshipit-source-id: 18bb4ee7401bc4eac4fcc97341fc2b3a2a0957c9
2019-02-21 02:25:18 -08:00
Grégoire Rit c416b40542 Add setNextFocus support (#22082)
Summary:
Add properties to be able to set the nextFocus. It can be very useful with Android TV.

New android View properties :

* nextFocusDown binded to [setNextFocusDownId](https://developer.android.com/reference/android/view/View.html#setNextFocusDownId(int))
* nextFocusForward binded to [setNextFocusForwardId](https://developer.android.com/reference/android/view/View.html#setNextFocusForwardId(int))
* nextFocusLeft binded to [setNextFocusLeftId](https://developer.android.com/reference/android/view/View.html#setNextFocusLeftId(int))
* nextFocusRight binded to [setNextFocusRightId](https://developer.android.com/reference/android/view/View.html#setNextFocusRightId(int))
* nextFocusUp binded to [setNextFocusUpId](https://developer.android.com/reference/android/view/View.html#setNextFocusUpId(int))

Can be used to fix :

* Fixes #20593
* Fixes #20100

Same PR as #22080 but accorded to changes on master
Pull Request resolved: https://github.com/facebook/react-native/pull/22082

Differential Revision: D14162740

Pulled By: cpojer

fbshipit-source-id: 9a13a185d4e8307ce67014fb076c62d135c487c3
2019-02-20 23:37:35 -08:00
Rizwaan Bhikha f8a4d281e2 Do not bring app out of immersive mode when a modal is presented (#21078)
Summary:
This does fix the issue, however, another, perhaps related issue persists, the dialog/modal occasionally uses what would be the height of the app in non-immersive mode, in immersive mode. Meaning that the background, what ever it is set as, does not use the full available height.

See https://stackoverflow.com/a/23207365 for more info.

Known Problems:
---------
* [Date/time picker](https://facebook.github.io/react-native/docs/datepickerandroid) still brings app out of immersive mode - The date/time picker dialog needs the same treatment (this MR) as `RN Modal` using a wrapper.
* Focusing on text input, which brings up keyboard, also brings app out of immersive mode. Sometimes temporarily, sometimes permanently - Needs investigating. I have tried [this](https://stackoverflow.com/a/25129542), unfortunately it doesn't work. **Workaround I'm using for this, is to call a native module method to re-apply immersive mode flags after `keyboardDidHide` on JS side.**

Changelog:
----------

[Android] [Fixed] - Dialog (RN Modal) brings app permanently out of immersive mode
Pull Request resolved: https://github.com/facebook/react-native/pull/21078

Differential Revision: D14163127

Pulled By: cpojer

fbshipit-source-id: e0b67c91fa81880b19438a939bca26c128309799
2019-02-20 23:20:51 -08:00
Dulmandakh ba0c3ffd5b ReactTextView extends AppCompatTextView (#23321)
Summary:
Google recommends to use AppCompat widgets, and this PR changes ReactTextView to extend AppCompatTextView.

[Android] [Changed] - ReactTextView extends AppCompatTextView
Pull Request resolved: https://github.com/facebook/react-native/pull/23321

Differential Revision: D13986149

Pulled By: cpojer

fbshipit-source-id: 878849fff12dc5478bb0d0952b2c22695391e81a
2019-02-20 23:07:07 -08:00
Albert Martin bca85101cd fix: prevent exception when imageName is null (#20120)
Summary:
When an image source is parsed via `RCTImageFromLocalAssetURL` there seem to be certain situations in which `imageName` is empty from `RCTBundlePathForURL`. Any call to `UIImage imageNamed` with a an empty parameter will throw an exception:

```
CUICatalog: Invalid asset name supplied: '(null)'
```

In my case, the asset URL was pointing to an image in the application sandbox rather than the `NSBundle`. In this case `UIImage imageNamed` was throwing before the call to `NSData dataWithContentsOfURL` below could correctly resolve the image.

This change simply skips the call to `UIImage imageNamed` if no `imageName` value is set.
Pull Request resolved: https://github.com/facebook/react-native/pull/20120

Differential Revision: D14163101

Pulled By: cpojer

fbshipit-source-id: ceec95c02bf21b739962ef5618947a5726ba0473
2019-02-20 22:57:40 -08:00
Jacob Parker 30f13812ad Make JS loading progress use tabular numbers
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20076

Differential Revision: D14162853

Pulled By: cpojer

fbshipit-source-id: a07b80319e23f8969887522b8761a560e8a3a98e
2019-02-20 22:14:23 -08:00
Luis Rivera fd96e2cb2c Feature: dev menu option to change packager location during runtime (#21970)
Summary:
Add an option to dev menu to change packager location on the fly on iOS (similar to Dev Settings in Android)
Pull Request resolved: https://github.com/facebook/react-native/pull/21970

Differential Revision: D14162776

Pulled By: cpojer

fbshipit-source-id: 3cca4f4fbd8c599bd5342ba1ae64905a03270d48
2019-02-20 22:07:11 -08:00
Eric Lewis 4a01be47cd Fix iOS e2e test (#23566)
Summary:
As part of #23561 this is an attempt at fixing iOS.

[iOS] [Fixed] - e2e test
Pull Request resolved: https://github.com/facebook/react-native/pull/23566

Differential Revision: D14162780

Pulled By: cpojer

fbshipit-source-id: b55d32e30f88370100f7fbddf9dfb208280844f4
2019-02-20 22:01:12 -08:00
alanfoster c06473ab46 Update network inspector to have smarter scroll stickiness (#21952)
Summary:
When making use of the network inspector on a react-native app, it can be quite annoying that as new requests come in the network inspector instantly sticks to the bottom.

This PR makes this logic smarter by allowing the user to be scrolled away from the bottom by two rows to override this automatic scrolling to the bottom logic.
Pull Request resolved: https://github.com/facebook/react-native/pull/21952

Differential Revision: D14162762

Pulled By: cpojer

fbshipit-source-id: ad49858509dd74a817ebabab54fdacc99773bf22
2019-02-20 21:51:29 -08:00
Murilo Araujo 28f1648989 - Fixed line not breaking when multiline set to true and keyboard type set to numeric (or other numeric type) (#21884)
Summary:
Native Android sets the EditText widget to multiline only if the InputType flags are set to Text (or its variants like textEmailAddress) and Multiline, which causes the React Native TextInput to not break the line when set to multiline={true} and keyboardType={'numeric'} as it only have the flags Multiline and Number set.

This fix forces the widget to enable multiline, by calling setSingleLine(false) everytime a state change needs to be commited and the multiline prop is set to true.
Pull Request resolved: https://github.com/facebook/react-native/pull/21884

Differential Revision: D14162701

Pulled By: cpojer

fbshipit-source-id: b7d3fc8c5a4444dcfd29ad74d515a8ae486c7ede
2019-02-20 21:44:22 -08:00
zhongwuzw 9c1c5a7455 Fix scrollview over bounds of content size (#23427)
Summary:
Fix scrollview `offset` out of content size in iOS, Android uses `scrollTo` and `smoothScrollTo` which not have this issue.

Fixes like #13594 #22768 #19970 .

[iOS] [Fixed] - Fixed scrollView offset out of content size.
Pull Request resolved: https://github.com/facebook/react-native/pull/23427

Differential Revision: D14162663

Pulled By: cpojer

fbshipit-source-id: a95371c8d703b6d5f604af0072f86c01c2018f4a
2019-02-20 21:32:51 -08:00
zhongwuzw 2ea4bcd001 Fixed ScrollView adjust inset behavior (#23555)
Summary:
Fixes #23500 , if user set prop `contentInsetAdjustmentBehavior="automatic"` of ScrollView, it not works when initial on the screen. We fixes it by filter valid offset, if offset is valid, just return.

[iOS] [Fixed] - Fixed ScrollView adjust inset behavior
Pull Request resolved: https://github.com/facebook/react-native/pull/23555

Differential Revision: D14161593

Pulled By: cpojer

fbshipit-source-id: 01434e55106ffde7f8e39f66dd5b0f02df9b38b1
2019-02-20 20:32:28 -08:00
Agustin Collazo 536045276c iOS downgrade invalid bridge warning (#23557)
Summary:
I downgrade the invalid bridge warning because I believe that it is a pain that every time that the JS gets refreshed this warnings are being thrown. If the project increase size and more and more NativeModules are added this warnings just spam the emulator or the device.

I understand the reason of validating if the bridge is valid. However in case of invalidness nothing is done, just the warning is thrown. Hence, the reason of downgrading it to improve the development process.

The error message still exist and it will be in the logs. But it will not spam the development screen

[iOS] [Changed] - Downgrade the Invalid bridge warning message to a log
Pull Request resolved: https://github.com/facebook/react-native/pull/23557

Differential Revision: D14161290

Pulled By: cpojer

fbshipit-source-id: e5608a9b2db5625309fd18d133fe69a9013043f3
2019-02-20 19:07:36 -08:00
Eric Lewis 468ae234a6 Fix xcode warnings (#23565)
Summary:
As part of #22609, this fixes yet more warnings.
- Adding more __unused to params.
- Refactors `isPackagerRunning` to use NSURLSession.
- Turns off suspicious comma warnings

[iOS] [Fixed] - Xcode Warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23565

Differential Revision: D14161151

Pulled By: cpojer

fbshipit-source-id: 339874711eca718fc6151e84737ccc975225d736
2019-02-20 18:46:23 -08:00
Héctor Ramos 9820c88877 No longer run disabled tests on Héctor's PRs (#23562)
Summary:
Do not run disabled tests, even when the commit / PR is pushed by hramos. See the existing functionality at https://circleci.com/gh/facebook/react-native/73844?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link:

![screen shot 2019-02-20 at 8 21 39 am](https://user-images.githubusercontent.com/165856/53106776-90ecb600-34e8-11e9-9b02-a7f3990407b2.png)

There are a handful of tests that are known to be broken in Circle CI. This has been the case since at least Fall 2017, when we migrated to Circle 2.0. These tests haven't been fixed for several reasons, one of them being that once they were removed from the Circle CI config, the pressure to fix them has been lowered.

Last year, I added these disabled tests back to Circle CI, but used a script to prevent them from running unless the job was initiated by myself. This would allow us to get good signal from Circle CI without polluting results with known failing tests, while still showing me which tests needed some work before getting re-enabled again.

In practice, this functionality is introducing more friction as I work on fixing new CI failures: my own fixup PRs are marked as failing due to these "disabled tests" (see test_android on https://github.com/facebook/react-native/pull/23558). To ensure we don't lose track of these failures, I've created an umbrella issue at https://github.com/facebook/react-native/issues/23561.
Pull Request resolved: https://github.com/facebook/react-native/pull/23562

Differential Revision: D14161172

Pulled By: cpojer

fbshipit-source-id: 040500dcb433d3127c64a42b31f94af6bbaa6ed1
2019-02-20 18:46:22 -08:00
zhongwuzw 96de12ab48 Remove __fbRequireBatchedBridge call when not get batchedBridge (#23547)
Summary:
From the git log, we added `__fbRequireBatchedBridge` in this commit  6dc3a83e88, I don't ensure wether I missed something, we actually don't define `__fbRequireBatchedBridge` on `JS` or `Native` side, so `__fbRequireBatchedBridge` getter operation itself would throw exception.

[General] [Fixed] - Remove __fbRequireBatchedBridge call when not get batchedBridge
Pull Request resolved: https://github.com/facebook/react-native/pull/23547

Differential Revision: D14160706

Pulled By: cpojer

fbshipit-source-id: df9180a9a16716a91369249333752316fb6648c5
2019-02-20 18:41:24 -08:00
Evan Bacon 104b1f9367 Add HMRLoadingView module for web target (#23389)
Summary:
* Added a default value for HMRLoadingView this will prevent errors from being thrown when `HMRClient` attempts to include it in a `web` context.

* [Web] [Added] - HMRLoadingView
Pull Request resolved: https://github.com/facebook/react-native/pull/23389

Differential Revision: D14045475

Pulled By: cpojer

fbshipit-source-id: df5c3cf3536af3b37eaf82342b6346bc25054319
2019-02-20 18:22:44 -08:00
Eric Lewis b0c69aba1d Allow compiler optimization (#23536)
Summary:
Fixes a warning thrown by Xcode & allow RVO to be performed.

[iOS] [Fixed] - Fix Xcode warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23536

Reviewed By: JoshuaGross

Differential Revision: D14142973

Pulled By: hramos

fbshipit-source-id: e23050aed811127a3b4f73aa8a74472e4cc8e98c
2019-02-20 17:29:35 -08:00
Kevin Gozali 45288a0f63 TM iOS C++: don't throw if a method is not found
Summary: Let JS decide if a missing method should be treated as an error, or whether it allows optional methods (e.g. methods that are only for android or for ios).

Reviewed By: JoshuaGross

Differential Revision: D14155799

fbshipit-source-id: 1e298b46a59761cf09e98147da885b1e9a9a675a
2019-02-20 14:55:08 -08:00
David Aurelio d53bfed9bb Add config for avoiding JNI refs
Summary:
@public

Adds `YogaConfig#avoidGlobalJNIRefs` to control whether nodes created with a config will use weak global JNI refs. Used for experimentation.

Reviewed By: SidharthGuglani

Differential Revision: D14149982

fbshipit-source-id: c777c8b3af2167d96154db5aa6afec1476dac35b
2019-02-20 11:59:21 -08:00
David Aurelio 17a27facc5 Add support for context-aware cloning functions
Summary:
@public

Context-aware cloning functions are an internal Yoga feature that will be used for Yoga’s JNI code.

It will be possible to specify a context when calculating layout, which will be passed on to cloning functions. This will be a private feature.

Reviewed By: SidharthGuglani

Differential Revision: D14149470

fbshipit-source-id: 1d11106e65f9d872d10f191763da001f8d158a61
2019-02-20 11:59:21 -08:00
David Aurelio 57fce665fb Clone children only during layout, allow mixing shared + owned children
Summary:
@public

Limit child cloning to layout calculation. This also allows for mixing shared and owned children.

Rationale:
We do allow for shared children if the caller manages themselves. The single known use case is React Native.

So far, we have cloned children eagerly whenever child lists are mutated, or layout is run. This was to allow for a quick check of the owner of any first child, assuming that either *all* or *no* child of a node are shared.

For Yoga/Java, we want to get rid of global weak JNI refs, and these are also used to invoke clone callbacks. We can achieve that goal by switching to an alternative approach, passing additional data to the layout pass. This additional data has to be passed to any configured cloning callback. Therefore, it is desirable to **only call cloning functions during the layout pass.**

The obvious solution seems to be to not uphold the invariant of the first child determining shared/owned state of all siblings, and allow for a mix of shared and own children.

Reviewed By: shergin

Differential Revision: D14136223

fbshipit-source-id: 34490cfeeb2170c99d6ed1b9bdcbcedb316813af
2019-02-20 11:59:21 -08:00
David Aurelio 9b6bbe69d6 Move node cloning to `YGConfig`
Summary:
@public

Encapsulates node cloning within `YGConfig`.
This is necessary for allowing for context-aware cloning functions, which will ultimately allow for removal of weak global JNI references.

Reviewed By: shergin

Differential Revision: D14132608

fbshipit-source-id: 0dec114c8e172b1e34a4b7fd146c43f13c151ade
2019-02-20 11:59:21 -08:00
Dulmandakh b4017a9923 bump gradle to 5.0, android gradle plugin to 3.3.1 (#23324)
Summary:
This PR bumps gradle to 5.0, which includes Kotlin DSL 1.0, and android gradle plugin to 3.3.1, which includes includes various bug fixes and performance improvements. Also Gradle 5.x requires Java 8.

This is preparation for Kotlin DSL migration.

[Android] [Changed] - Bump Gradle to 5.0

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

Reviewed By: mdvacca

Differential Revision: D14028563

Pulled By: hramos

fbshipit-source-id: 61fe1a2d4ea5707d6f07945acbd950f852420e13
2019-02-20 11:42:54 -08:00
Eric Lewis 19866aee3d Fix 50 xcode warnings (#23553)
Summary:
This PR reduces the number of warnings in React from 68 to 18. Mostly by marking unused variables. RNTester's warnings are more than halved.

[iOS] [Fixed] - Xcode warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23553

Differential Revision: D14151339

Pulled By: hramos

fbshipit-source-id: 8255330bf910a69a4c03051d91d7b0de3fadf2d1
2019-02-20 10:17:26 -08:00
empyrical ff588b5087 JSI: Minor tweaks for building on MSVC (#23492)
Summary:
This is a re-submit of #23367, which was accidentally over-written in this commit:

0d7faf6f73

This pull request makes this change to `jsi.h`:

 * Tweak the call to constructor `Pointer(Runtime::PointerValue* ptr)` in the constructor for `PropNameID`. I am not sure why MSVC wasn't working with the original version, but it compiles after I tweak that.

[General] [Fixed] - Tweaked `jsi.h` to build on MSVC
Pull Request resolved: https://github.com/facebook/react-native/pull/23492

Differential Revision: D14151511

Pulled By: hramos

fbshipit-source-id: 52d726d7b978d321a0343566ee527f2ec25e93f8
2019-02-20 10:12:12 -08:00
Eric Lewis 38e91e6a9d fix getPhotos params on RNTester XHR example. (#23548)
Summary:
Fixes redscreen on RNTester's XHR page. CameraRoll getPhotos was missing params.

ss: https://i.imgur.com/JLThyrF.png

[iOS] [Fixed] - RNTester XHR Example crash
Pull Request resolved: https://github.com/facebook/react-native/pull/23548

Differential Revision: D14151304

Pulled By: hramos

fbshipit-source-id: 7ff02c7fe32f09aecd50bc7df9f37b7cd2851b1c
2019-02-20 09:57:26 -08:00
Christoph Nakazawa 59377830b4 JavaScript tests for symbolication
Summary:
People in open source are now contributing to our symbolication code. They cannot figure out how to run buck for their tests so I instead converted them to Jest tests. See https://github.com/facebook/react-native/pull/23514 for an example contribution where people are struggling.

This PR:
* Changes the stdin reading mechanism to also work inside of a forked child process
* I manually verified that the previous BUCK tests were all passing after my modifications to the main script
* I rewrote each test using Jest
* I then switched the passing tests over to use snapshots

As a result, there are now a few fewer files and they all run inside of Jest. The code being tested is identical and keeps working.

Reviewed By: davidaurelio

Differential Revision: D14147615

fbshipit-source-id: 699044a579278f6451bb9d26a05712f00e4b7c04
2019-02-20 05:08:53 -08:00
Joshua Gross ab6ea9c938 Enable NativeAnimationDriver in Fabric
Summary:
Enables NativeAnimationDriver in Fabric.

Fabric animations:
{F151048224}

Pre-Fabric animations:

{F151048344}

Reviewed By: mdvacca

Differential Revision: D14114388

fbshipit-source-id: 1f64db168ae037535a31def7da28b9e0474b7198
2019-02-20 00:15:04 -08:00
Levi Buzolic a89fe4165c Map TextInput textContentType strings to Objective-C constants (#22611)
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
2019-02-19 23:52:40 -08:00
Eric Lewis 35b6f866f1 helpful error on canOpenURL for missing scheme (#23535)
Summary:
iOS 9 introduced a whitelist for schemes that apps are allowed to open / check against, the current behavior of React Native is to simple return `NO` when a scheme is missing from that whitelist. It would be more helpful to throw an error with a suggested fix for the problem:
```
Unable to open URL: asos://checkout, add asos to LSApplicationQueriesSchemes in Info.plist.
```

[iOS] [Changed] - canOpenURL throws when custom scheme isn't in LSApplicationQueriesSchemes.
Pull Request resolved: https://github.com/facebook/react-native/pull/23535

Differential Revision: D14143005

Pulled By: cpojer

fbshipit-source-id: 4ead5f073690e627b4a4bbe3fa5a6cb5af46b589
2019-02-19 22:16:01 -08:00
Héctor Ramos eb414b7f8d Update iOS Snapshots (#23538)
Summary:
The iOS snapshots needed to be updated after cf5f25472d updated `ViewExample.js`.

[iOS] [Fixed] - Updated snapshots on iOS.
Pull Request resolved: https://github.com/facebook/react-native/pull/23538

Differential Revision: D14146723

Pulled By: cpojer

fbshipit-source-id: f949d4c7925ab53ef42f42689bc2ed7b254dea48
2019-02-19 22:07:32 -08:00
zhongwuzw f8b52151eb Fixed textInput appearance not update when text attributes changed (#23533)
Summary:
If we change the text attributes dynamically, for example, change the textColor, it not works in iOS, Android works fine.

[iOS] [fixed] - Fixed textInput appearance not update when text attributes changed
Pull Request resolved: https://github.com/facebook/react-native/pull/23533

Differential Revision: D14146700

Pulled By: cpojer

fbshipit-source-id: 4a7c84d6e7f818acb712242bea6484b177a775c6
2019-02-19 22:02:20 -08:00
Eric Lewis c3df673f12 Fabric: Fix dangling brace (#23540)
Summary:
This pull request fixes a dangling brace, causing Xcode to be unable to build RCTFabricSample.

[General] [Fixed] - Fabric: Xcode build issue
Pull Request resolved: https://github.com/facebook/react-native/pull/23540

Differential Revision: D14142990

Pulled By: hramos

fbshipit-source-id: d6c2313d831e2ea5d22c77543814b86bfe8a1d53
2019-02-19 21:55:18 -08:00
jsfu f08c94bd36 fix the TextInput can't control input length when value's length > maxLength (#23545)
Summary:
I found the TextInput can't control input length when default value's length > maxLength.
for example:
1.Set the value in special cases
```
<TextInput value={'12345678'} maxLength={6}/>
```
2.Quickly press the keyboard with multiple fingers

```
// RCTBaseTextInputView.m
……
if (_maxLength) {
    NSUInteger allowedLength = _maxLength.integerValue - backedTextInputView.attributedText.string.length + range.length;
    if (text.length > allowedLength) {
……
```
when value's length > maxLength,the allowedLength not a negative number.it was transformed into a big number,because it is type NSUInteger.so the `text.length > allowedLength` always false.

[iOS][Fixed] - fix the TextInput can't control input length when value's length > maxLength
Pull Request resolved: https://github.com/facebook/react-native/pull/23545

Differential Revision: D14146581

Pulled By: cpojer

fbshipit-source-id: f53b1312ae55fad9fc10430ab94784c1a9ad4723
2019-02-19 21:41:07 -08:00
zhongwuzw 9375a12620 Fixed RNTester tvOS build error on Xcode10 (#23543)
Summary:
We add info.plist into `Copy Bundle Resources`, it leads to build error on new Xcode10 compile system.

[iOS] [fixed] - Fixed RNTester tvOS build error on Xcode10
Pull Request resolved: https://github.com/facebook/react-native/pull/23543

Differential Revision: D14146488

Pulled By: cpojer

fbshipit-source-id: 10d9973fadb7e79e76e6a2a4945c9108184e4708
2019-02-19 21:28:09 -08:00
zhongwuzw f8276805ca Add ImageIO nullable check in Image module (#23544)
Summary:
Add ImageIO nullable check in Image module to prevent crash.

[iOS] [Fixed] - Add ImageIO nullable check in Image module
Pull Request resolved: https://github.com/facebook/react-native/pull/23544

Differential Revision: D14146483

Pulled By: cpojer

fbshipit-source-id: 813caebea1e24d5e282b21cc50240ec1886339d5
2019-02-19 21:22:37 -08:00
zhongwuzw be36aa89c5 Remove fake OCMock group (#23546)
Summary:
We created a fake OCMock group like below which text color is red, actually we have another OCMock group in `RNTesterUnitTests`, so we can remove this.
![image](https://user-images.githubusercontent.com/5061845/53064665-9dcad300-3503-11e9-93c0-fd63b4395ba3.png)

[iOS] [Fixed] - Remove fake OCMock group in RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23546

Differential Revision: D14146477

Pulled By: cpojer

fbshipit-source-id: 4878c8d40eab451f20bd7e223d93d212e514f26d
2019-02-19 21:17:02 -08:00
Eric Lewis d419f0787c Fix testScrollViewExample flakiness (#23541)
Summary:
Sometimes images are slow to load, and they are quite heavy. This converts the ScrollViewExample to a list of simple text items, similar to the append example inside of it.

What it looks like: https://i.imgur.com/jt083Iv.png

[iOS] [Fixed] - Fix testScrollViewExample flakiness
Pull Request resolved: https://github.com/facebook/react-native/pull/23541

Differential Revision: D14142947

Pulled By: hramos

fbshipit-source-id: c897a4caa5374ef67e3d67306e3124c29b969565
2019-02-19 16:24:08 -08:00
Skylar Peterson 5ff6b97d33 React scroll views should group accessibility children
Summary: If we don't group accessibility children, we can get into a state where the accessibility frame for our content lines up in such a way that VoiceOver doesn't know to scroll the scroll view, and instead jumps to the next piece of content (like the tab bar at the bottom)

Reviewed By: ikenwoo

Differential Revision: D14141532

fbshipit-source-id: 53b0971f494a39f0eba827e441a4cd9e08317663
2019-02-19 15:37:02 -08:00
David Vacca 6aa297a7f3 Fabric: Fixed crash when LayoutMetrics contained NaN values
Summary:
CALayer will crash if we pass NaN or Inf values.

It's unclear how to detect this case on cross-platform manner holistically, so we have to do it on the mounting layer as well.
NaN/Inf is a kinda valid result of some math operations. Even if we can (and should) detect (and report early) incorrect (NaN and Inf) values which come from JavaScript side, we sometimes cannot backtrace the sources of a calculation that produced an incorrect/useless result.

Besides that, I will investigate why the crash is actually happening, so we might need to fix something in layout engine. But, it general, we cannot capture all errors like that, so we need to have it here anyway.

Reviewed By: JoshuaGross, mmmulani

Differential Revision: D14126058

fbshipit-source-id: 807e5a223bdef48af9a3b7210803863431e8c507
2019-02-19 13:03:15 -08:00
David Vacca 22d776f5c2 Fix AssertionError in EventDispatcher
Summary: This task fixes an AssertionError in EventDispatcher class, this is produced by a race condition.

Reviewed By: JoshuaGross

Differential Revision: D14134907

fbshipit-source-id: 7b670ee35e47c0d8a9f7f7b68a3b8f7193b7de54
2019-02-19 12:11:39 -08:00
David Aurelio 49d91456fd Extract abstract class `YogaNode`
Summary:
@public

Here, we extract an abstract class from `YogaNode`, in order to allow for experimentation with different implementations.

The reason for not choosing an interface is to keep ABI compatibility for `YogaNode.create()`.

Reviewed By: pasqualeanatriello

Differential Revision: D14044990

fbshipit-source-id: f8eb246338b55f34f0401198c0655abfcb7c9f37
2019-02-19 11:19:31 -08:00