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

15438 Коммитов

Автор SHA1 Сообщение Дата
Josh Justice 1fdfed51c3 Detox debug build (#22572)
Summary:
Adds a Detox configuration and instructions for running the app in development mode in Detox. This speeds up developing tests, because changes to production code don't require a full rebuild.
Pull Request resolved: https://github.com/facebook/react-native/pull/22572

Differential Revision: D13396883

Pulled By: cpojer

fbshipit-source-id: 186cc8d75eccae411b602cb0f68f0e11856e0743
2018-12-17 19:46:43 +01:00
Josh Justice 0189ea2c2b Add Touchable E2E tests (#22570)
Summary:
Adds some initial tests for Touchable*. It only tests the first screen worth of examples; in a separate PR I'll work on an alternate way to "scroll" to individual examples in tests, before I add tests for the rest of the Touchable examples.

On the live stream where I began writing these tests, I reorganized the "Touchable feedback examples" to the top of the list so it would be on-screen for testing. I didn't include this reorganization or test in this PR; that can be added in once the "alternative to scrolling" is added in, to avoid having to reorganize.

Changelog:
----------
[General] [Added] - Add E2E tests for Touchable
Pull Request resolved: https://github.com/facebook/react-native/pull/22570

Differential Revision: D13400348

Pulled By: TheSavior

fbshipit-source-id: 821af135296049090427a16472cc14dabeb10ab4
2018-12-17 19:46:18 +01:00
gengjiawen 860d01a2c4 Enable ci for windows (#22028)
Summary:
Enable ci for windows
appveyor pass.
https://github.com/facebook/react-native/pull/21835
 [GENERAL] [INTERNAL] [CI] - Enable ci for windows
Pull Request resolved: https://github.com/facebook/react-native/pull/22028

Differential Revision: D13318242

Pulled By: cpojer

fbshipit-source-id: be4b9b9fe6a4e21572f3d6c38b15a2acf8bb2662
2018-12-17 19:45:59 +01:00
Dulmandakh 8e39451512 Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632)
Summary:
This PR is bumping compileSdkVersion to 28, buildToolsVersion to 28.0.2, Gradle to 4.7, Android Gradle plugin to 3.2.0.

Gradle 4.7 added support for Java 10 and 11.

allow-large-files

Release Notes:
--------------
[ANDROID] [ENHANCEMENT] [SDK] - bump to 28

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

Reviewed By: mdvacca

Differential Revision: D13084836

Pulled By: hramos

fbshipit-source-id: e0f493881e80e87faf8c3ef1ac77044495966a49
2018-12-17 19:44:58 +01:00
Mike Grabowski c0bf7a128c [0.58.0-rc.1] Bump version numbers 2018-12-06 09:39:36 +01:00
Tim Yung e54d1e27ea React sync for revisions 3ff2c7c...6bf5e85
Summary:
@public
This sync includes the following changes:
- **[6bf5e8598](https://github.com/facebook/react/commit/6bf5e8598)**: Fix scheduler setTimeout() re-entrancy check (#14384) //<Brian Vaughn>//
- **[7a48c900b](https://github.com/facebook/react/commit/7a48c900b)**: Prevent a v8 deopt when profiling (#14383) //<Brian Vaughn>//
- **[f00c2755b](https://github.com/facebook/react/commit/f00c2755b)**: Removed unnecessary externals from Jest bundles (#14372) //<Brian Vaughn>//
- **[52bea95cf](https://github.com/facebook/react/commit/52bea95cf)**: Fixed scheduler setTimeout fallback (#14358) //<Brian Vaughn>//
- **[1d25aa578](https://github.com/facebook/react/commit/1d25aa578)**: [Fizz] New Server Rendering Infra (#14144) //<Sebastian Markbåge>//
- **[f1bf28160](https://github.com/facebook/react/commit/f1bf28160)**: Fix bug in cloneHook (#14364) //<Imre Osswald>//
- **[16e120438](https://github.com/facebook/react/commit/16e120438)**: [Fire] Add initial build infrastructure (#14359) //<Dan Abramov>//
- **[d14ba87b1](https://github.com/facebook/react/commit/d14ba87b1)**: Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298) //<Dan Abramov>//
- **[4f964f09c](https://github.com/facebook/react/commit/4f964f09c)**: Adding isMemo check to react-is package (#14313) //<Jinto Jose>//
- **[c2a2d8a53](https://github.com/facebook/react/commit/c2a2d8a53)**: Remove useMutationEffect (#14336) //<Sophie Alpert>//
- **[48f1e5b3c](https://github.com/facebook/react/commit/48f1e5b3c)**: Add a null type test for memo (#14325) //<chun shang>//
- **[f93f3402f](https://github.com/facebook/react/commit/f93f3402f)**: Make useEffect(async) warning more verbose (#14327) //<Dan Abramov>//
- **[ee3ef3a07](https://github.com/facebook/react/commit/ee3ef3a07)**: Fix regression: Errors not emitted in streams (#14314) //<Pelle Wessman>//
- **[33f6f5e53](https://github.com/facebook/react/commit/33f6f5e53)**: Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) //<Christoph Nakazawa>//
- **[686f1060a](https://github.com/facebook/react/commit/686f1060a)**: Publish a local release (canary or stable) to NPM (#14260) //<Brian Vaughn>//
- **[7475120ce](https://github.com/facebook/react/commit/7475120ce)**: Prevent deopts from modifying exports object in stable builds (#14309) //<Dan Abramov>//
- **[0c7189d92](https://github.com/facebook/react/commit/0c7189d92)**: Fix resolution of outer props with React.memo() (#14312) //<Dan Abramov>//
- **[14be29b2b](https://github.com/facebook/react/commit/14be29b2b)**: Add more test coverage for nested memo() (#14311) //<Dan Abramov>//
- **[dc0dd4bbf](https://github.com/facebook/react/commit/dc0dd4bbf)**: Use |0 to coerce to number (#14297) //<Dan Abramov>//
- **[dd8205cef](https://github.com/facebook/react/commit/dd8205cef)**: List ignored types instead of included types in the stack (#14308) //<Dan Abramov>//
- **[a9fdf8a32](https://github.com/facebook/react/commit/a9fdf8a32)**: Warn about reassigning this.props (#14277) //<Dan Abramov>//
- **[327cf0ee3](https://github.com/facebook/react/commit/327cf0ee3)**: Fix support for mixing react-dom/server@16.6 and react@<16.6 (#14291) //<Dan Abramov>//
- **[c954efa70](https://github.com/facebook/react/commit/c954efa70)**: Remove `import * as` pattern from the codebase (#14282) //<Sebastian Markbåge>//
- **[ccb14e270](https://github.com/facebook/react/commit/ccb14e270)**: Fix SSR useCallback in render phase (#14279) //<Dan Abramov>//
- **[0e9cb3f5d](https://github.com/facebook/react/commit/0e9cb3f5d)**: Clear fields on unmount of fiber to avoid memory leak (#14276) //<Dominic Gannaway>//
- **[592676503](https://github.com/facebook/react/commit/592676503)**: Revert "Clear memoizedState on unmount of fiber to avoid memory leak (#14218)" (#14275) //<Dominic Gannaway>//
- **[9b2fb24f9](https://github.com/facebook/react/commit/9b2fb24f9)**: Clear memoizedState on unmount of fiber to avoid memory leak (#14218) //<Dominic Gannaway>//
- **[a22fabc2a](https://github.com/facebook/react/commit/a22fabc2a)**: Reduce scheduler serialization overhead (#14249) //<Jason Miller>//
- **[21d5f7d32](https://github.com/facebook/react/commit/21d5f7d32)**: Wrap shorthand CSS property collision warning in feature flag (#14245) //<Andrew Clark>//
- **[8feeed10d](https://github.com/facebook/react/commit/8feeed10d)**: [scheduler] Remove window.postMessage fallback //<Andrew Clark>//
- **[5bce0ef10](https://github.com/facebook/react/commit/5bce0ef10)**: [scheduler] Post to MessageChannel instead of window (#14234) //<Andrew Clark>//
- **[f55795c8e](https://github.com/facebook/react/commit/f55795c8e)**: Add regression test for #14188 (#14197) //<Dan Abramov>//
- **[b98adb648](https://github.com/facebook/react/commit/b98adb648)**: Simplify CSS shorthand property warning (#14183) //<Sophie Alpert>//
- **[f8bfd5868](https://github.com/facebook/react/commit/f8bfd5868)**: fix typo //<Sebastian Markbage>//
- **[961eb65b4](https://github.com/facebook/react/commit/961eb65b4)**: Use unique thread ID for each partial render to access Context (#14182) //<Sebastian Markbåge>//
- **[1a6ab1e9b](https://github.com/facebook/react/commit/1a6ab1e9b)**: SimpleMemoComponent should warn if a ref is given (#14178) //<Sophie Alpert>//
- **[8ae867e6b](https://github.com/facebook/react/commit/8ae867e6b)**: Warn about conflicting style values during updates (#14181) //<Sophie Alpert>//
- **[d5e1bf07d](https://github.com/facebook/react/commit/d5e1bf07d)**: Renamed outdated schedule/tracing referecnes (#14177) //<Brian Vaughn>//
- **[2dd4ba11e](https://github.com/facebook/react/commit/2dd4ba11e)**: ESlint -> ESLint //<Andrew Clark>//
- **[9cc631a53](https://github.com/facebook/react/commit/9cc631a53)**: Don't run danger on bad build (#14143) //<Sophie Alpert>//
- **[1034e26fe](https://github.com/facebook/react/commit/1034e26fe)**: Fix typos (#14124) //<Heaven>//
- **[5618da49d](https://github.com/facebook/react/commit/5618da49d)**: Fix comment typo (#14156) //<Bartosz Gordon>//
- **[9fb919945](https://github.com/facebook/react/commit/9fb919945)**: Add global to ESLint plugin bundle config //<Andrew Clark>//
- **[c174f8592](https://github.com/facebook/react/commit/c174f8592)**: Add fb build of ESLint plugin (#14165) //<Andrew Clark>//
- **[02e4848e3](https://github.com/facebook/react/commit/02e4848e3)**: Improved suspense support in ReactDOMServer (#14161) //<Alex Taylor>//
- **[4b163fee1](https://github.com/facebook/react/commit/4b163fee1)**: Remove errant return assignment (#14164) //<Andrew Clark>//
- **[e58ecda9a](https://github.com/facebook/react/commit/e58ecda9a)**: Suspense fuzz tester (#14147) //<Andrew Clark>//
- **[7fd1661f8](https://github.com/facebook/react/commit/7fd1661f8)**:  Don't warn if an unmounted component is pinged (#14158) //<Andrew Clark>//
- **[f9e9913f0](https://github.com/facebook/react/commit/f9e9913f0)**: [Synchronous Suspense] Don't delete children of suspended component (#14157) //<Andrew Clark>//
- **[7c560131b](https://github.com/facebook/react/commit/7c560131b)**: Adding logger pri (#14155) //<Nathan Schloss>//
- **[3d8bda70e](https://github.com/facebook/react/commit/3d8bda70e)**: Refactor ESLint configuration to enable better IDE integration (#13914) //<Minh Nguyen>//
- **[051272f20](https://github.com/facebook/react/commit/051272f20)**: Use Entry in `yarn build ...` Instead of Label (#14148) //<Sebastian Markbåge>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions 3ff2c7c...6bf5e85

Reviewed By: bvaughn

Differential Revision: D13288288

fbshipit-source-id: 89a4837a9198c53fc79306933f589ef25d8bb4b6
2018-12-04 15:38:21 +01:00
Valentin Shergin f6566c77b1 Summary:
Calling -[UIScrollView setContentOffset] with NaN values can cause a crash. That's not clear why exactly the computation returns NaN sometime, but the implemented sanitizing should help to detect this problem during development (and this also prevents the app from crashing).

See attached task for more details.

Reviewed By: fkgozali

Differential Revision: D13242729

fbshipit-source-id: 747bf1b42e02597e9f1300eee24547563ab29b27
2018-12-04 15:37:25 +01:00
Nicolas Gallagher 747b5e47ef Fix text alpha bug
Summary: Set the default text radius to 0 so that text shadows aren't applied to every text node

Reviewed By: mdvacca

Differential Revision: D13027589

fbshipit-source-id: 4f7386059ac1654b8f77dddf9eb1b772f6049e23
2018-12-04 15:35:54 +01:00
Michael Blanchard 0b32a65bbd Fix: Add displayName to ActivityIndicator (#22417)
Summary:
Similar to #21950, this adds displayName to `ActivityIndicator`, so it displays the correct component name in snapshots instead of `Component`.

Fixes #21937 (a little bit more than it was already fixed).
Pull Request resolved: https://github.com/facebook/react-native/pull/22417

Differential Revision: D13205376

Pulled By: TheSavior

fbshipit-source-id: 21e71d4980d159a1f33d32d83346b48257ec21d4
2018-12-04 15:35:35 +01:00
Ramanpreet Nara 3fbefa8664 Revert D13105396
Summary: D13105396 broke a few things, so I'm reverting it. See: https://fburl.com/toehyir8

Reviewed By: sahrens, mmmulani

Differential Revision: D13220491

fbshipit-source-id: 35594099eea7f40d2fb948ae2010db4babb7093d
2018-12-04 15:35:21 +01:00
Radek Czemerys 19a7ecc837 Fix Xcode 10 builds (broken by folly upgrade) (#22394)
Summary:
[Folly upgrade](a70625abd7) introduced changes that have to be applied to `Install Third Party` script in order to use `New build system` from Xcode 10. Unfortunately, this might happen again if someone changes folly. Also removes non-existent files from folly podspec.
Pull Request resolved: https://github.com/facebook/react-native/pull/22394

Differential Revision: D13192463

Pulled By: hramos

fbshipit-source-id: ea0eeb6e1e7f6d7dfcdb6d1dee28b1a640ee7097
2018-11-27 12:25:12 +01:00
Mike Grabowski 0c1c66e719 [0.58.0-rc.0] Bump version numbers 2018-11-22 18:30:52 +01:00
Mike Grabowski e71fb64ecd Apply same config for Android 2018-11-22 18:29:16 +01:00
Mike Grabowski 26bdd5ba4e Make Metro untyped instead of ignored to let Metro-config resolve type annotations 2018-11-22 18:25:47 +01:00
Mike Grabowski e0ea58ecbd Add missing Metro Config 2018-11-22 18:18:37 +01:00
Kudo Chien 64dd60fb7d Fix ReactAndroid build break. (#22377)
Summary:
During C++ build, we need the libjsc.so.
  But arm64-v8a and x86_64 libjsc.so are in different path and this error raised:

    Android NDK: ERROR:/home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/Android.mk:jsc: LOCAL_SRC_FILES points to a missing file
    /opt/ndk/android-ndk-r17c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
    Android NDK: Check that /home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/arm64-v8a/libjsc.so exists  or that its path is correct

  The commit moves prebuilt libjsc.so into
  ReactAndroid/src/main/jni/third-party/jsc/jni and let ndkbuild script find the prebuilt libjsc.so.
  For AAR packaging, modify the jniLibs so that gradle android library plugin could find the prebuilt libjsc.so as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/22377

Differential Revision: D13166556

Pulled By: hramos

fbshipit-source-id: 61daaede7defbc66491a3e2f20058e7d248ba13e
2018-11-22 17:55:40 +01:00
gengjiawen d4d457b4eb Fix jsc regression.Fixes #22274 (#22293)
Summary:
My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295.
Kudo plz review.

![image](https://user-images.githubusercontent.com/3759816/48561684-758f6f00-e92b-11e8-905b-e394f72349f7.png)
Pull Request resolved: https://github.com/facebook/react-native/pull/22293

Differential Revision: D13153931

Pulled By: hramos

fbshipit-source-id: 8a6efa0cd8abbff359f082d5ea7713933b6e7ac6
2018-11-22 17:55:31 +01:00
Mike Grabowski b864e7e63e Revert "Merge branch 'master' into 0.58-stable"
This reverts commit 696bd89013, reversing
changes made to a525941ab6.
2018-11-22 17:53:44 +01:00
Mike Grabowski 696bd89013 Merge branch 'master' into 0.58-stable 2018-11-22 17:33:25 +01:00
David Aurelio 8f283b93ea `YGNodeComputeFlexBasisForChildren`: remove output param
Summary:
@public

`YGNodeComputeFlexBasisForChildren` was using an output parameter (`float&`) that is always initialised to `0.0f`.
Here, we move the initialisation inside `YGNodeComputeFlexBasisForChildren`, and simply return the result.

Reviewed By: astreet

Differential Revision: D13167509

fbshipit-source-id: cbea20e2deb82ec75a1c158b16c94f4a3e5e4c99
2018-11-22 08:08:47 -08:00
David Aurelio c34ad17c94 Pass enums by value
Summary:
@public

passes all enum values by value, not by reference.

Reviewed By: astreet

Differential Revision: D13156390

fbshipit-source-id: 56aea66c16ab3325594f67b9017afa18a678d281
2018-11-22 08:08:47 -08:00
David Aurelio 64d162e7c6 Dealloc JNI implementation experiment
Summary:
@public

Remove ability to configure Yoga to run with/without JNI fast calls on dalvik / art.
This switches to always run with fast calls.

Reviewed By: astreet

Differential Revision: D13144652

fbshipit-source-id: 091aab0cd1290d46346323d3e26a11dd0bb17187
2018-11-22 04:01:21 -08:00
David Aurelio f8ff6bd4e8 Pass primitives by value
Summary:
@public

Passes all `float`, `bool`, etc. by value, not by reference.

Reviewed By: astreet

Differential Revision: D13153500

fbshipit-source-id: 95529bc2efcff144044e2c25087915b2b7ede179
2018-11-22 03:50:30 -08:00
Amir Shalem 3337a1db55 Add getUndefined() method to obtain the undefined value
Summary:
Add getUndefined() method to obtain the undefined value.
This would allow to obtain the Yoga undefined value in runtime, and not just in compile time

Reviewed By: davidaurelio

Differential Revision: D13136972

fbshipit-source-id: aa198aa1ea65bb6b7302abeba6f9f5d483a45ff3
2018-11-22 02:35:36 -08:00
Valentin Shergin ecc7012179 Fabric: Fixed `AttributedString::operator==`
Summary: Trivial and shameful erratum.

Reviewed By: mdvacca

Differential Revision: D13166689

fbshipit-source-id: 75128299502bbc9ff5458c4381e7833aa451dd04
2018-11-22 00:54:03 -08:00
Radovan Šmitala 02a3517d0b Fix allocating Buffer in early commit (#22379)
Summary:
Commit d9c2cdae41 brings compatibility with Node 10, but replaced allocating buffer incorrectly.
dulmandakh made two comments and shows how to do it based on NodeJS documentation https://nodejs.org/api/buffer.html#buffer_new_buffer_size

This PR just fixes that commit.
Pull Request resolved: https://github.com/facebook/react-native/pull/22379

Differential Revision: D13166867

Pulled By: hramos

fbshipit-source-id: 207528739889c044021a4b97ef94c33d56de3e89
2018-11-22 00:50:03 -08:00
Kudo Chien 0a293a014b Fix ReactAndroid build break. (#22377)
Summary:
During C++ build, we need the libjsc.so.
  But arm64-v8a and x86_64 libjsc.so are in different path and this error raised:

    Android NDK: ERROR:/home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/Android.mk:jsc: LOCAL_SRC_FILES points to a missing file
    /opt/ndk/android-ndk-r17c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
    Android NDK: Check that /home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/arm64-v8a/libjsc.so exists  or that its path is correct

  The commit moves prebuilt libjsc.so into
  ReactAndroid/src/main/jni/third-party/jsc/jni and let ndkbuild script find the prebuilt libjsc.so.
  For AAR packaging, modify the jniLibs so that gradle android library plugin could find the prebuilt libjsc.so as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/22377

Differential Revision: D13166556

Pulled By: hramos

fbshipit-source-id: 61daaede7defbc66491a3e2f20058e7d248ba13e
2018-11-21 21:34:36 -08:00
Valentin Shergin 9c961331dd Fabric: `ParagraphShadowNode::updateLocalDataIfNeeded()`
Summary: Now we don't update `LocalData` for `ParagraphShadowNode` if the attributed string hasn't changed.

Reviewed By: mdvacca

Differential Revision: D13160128

fbshipit-source-id: 6ffe76ad187452fa37ba36a132b885cbcedfd1d3
2018-11-21 17:16:49 -08:00
Valentin Shergin 7e57755cea Fabric: `UIManager::getRelativeLayoutMetrics`
Summary: This method is underlying infra for all `measure`-like methods exposed to JavaScript.

Reviewed By: mdvacca

Differential Revision: D13036553

fbshipit-source-id: cb5135f1db97ec8144b31a24ee4fb9f5d61f0df1
2018-11-21 17:16:48 -08:00
Valentin Shergin f8be867cd8 Fabric: Sharing a pointer to ShadowTreeRegister with UIManager
Summary: The diff adds a pointer to ShadowTreeRegistry to UIManager which enables the possibility of implementing ShadowTree mutating and inspecting methods like `setNativeProps` and `getRelativeLayoutMetrics`.

Reviewed By: mdvacca

Differential Revision: D13036549

fbshipit-source-id: 5ed1252d84c8dd895fe0e6e8cc71afbaa9dab4b7
2018-11-21 17:16:48 -08:00
Valentin Shergin b4fa1fa0c6 Fabric: Introducing ShadowTreeRegistry
Summary:
Why do we need a dedicated registry class?
* We need to simplify registry-related logic in Scheduler.
* We need to couple threading aspect of the registry with the registry itself, otherwise it's not clear why exactly we acquire the mutex. We also should not acquire the mutex in a per-method way (as we did before), because it's incorrect and misleading (only lines that access the registry should by protected).
* We need to have a way to share the registry with other classes (e.g. UIManager) without passing a reference to the whole Scheduler.

Reviewed By: mdvacca

Differential Revision: D13036550

fbshipit-source-id: 644da910e823666c586834a3da2b4cdcb90eebb2
2018-11-21 17:16:48 -08:00
Valentin Shergin 71208f05f4 Fabric: Getting rid of leftovers in Scheduler
Summary: Trivial. Those are not used.

Reviewed By: fkgozali

Differential Revision: D13017883

fbshipit-source-id: cf285e537eb85c8fca6852f7c03a5ef661b85757
2018-11-21 17:16:48 -08:00
Valentin Shergin 9eec2c33e6 Fabric: LayoutableShadowNode::getRelativeLayoutMetrics()
Summary:
The generic method that returns relative (to some specified node) layout metrics.
We need this as a building block to implement `UIManager.measure*()` methods family.

Reviewed By: mdvacca

Differential Revision: D12932549

fbshipit-source-id: 79064551d32b0cd40e72dc87d0ed194e3779ba29
2018-11-21 17:16:48 -08:00
Valentin Shergin 3ecf4eaccb Fabric: ShadowNode::backtrackAncestors(...)
Summary:
We have to have a way to backtrack a pointer to a parent node and this is generalized version of that.
This is the first naive implementations of the algorithm. We will invest in optimizing this later.

Reviewed By: mdvacca

Differential Revision: D12920856

fbshipit-source-id: 9facb4e16a0b5608feb6747df3804952025ef093
2018-11-21 17:16:48 -08:00
Lee Howes 1f32b5d1da then to thenValue changes to allow deletion of value-taking continuation form of then
Summary: Future::then taking a value-taking function is deprecated and being deleted. This cleans up a few more callsites.

Reviewed By: yfeldblum, shergin

Differential Revision: D13163277

fbshipit-source-id: 98d1f78c5b34ca34603cc24d79157a4718573576
2018-11-21 17:12:19 -08:00
mottox2 3649a503cf Flow TouchableNativeFeedback.android.js (#22176)
Summary:
Related to #22100

Turn Flow strict mode on for Libraries/Components/Touchable/TouchableNativeFeedback.android.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/22176

Reviewed By: TheSavior

Differential Revision: D13033239

Pulled By: RSNara

fbshipit-source-id: 57e89ce16040e6238e01e0437327db943a5f2581
2018-11-21 14:45:15 -08:00
Yu Watanabe 6fa997dd63 Flow strict StatusBar (#22282)
Summary:
Related to #22100

`Libraries/Components/StatusBar/StatusBar.js`
Enhance StatusBar with mergePropsStack and _defaultProps.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][StatusBar.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22282

Reviewed By: TheSavior

Differential Revision: D13103971

Pulled By: RSNara

fbshipit-source-id: 27f69c6df3a8a7792fcd595c0ff362943ccab8ca
2018-11-21 14:42:09 -08:00
Tnarita0000 c127000a7d Flow strict-local in TimePickerAndroid.android.js (#22188)
Summary:
Related to #22100 . I had this issue before(#22154 & #22172).

Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js.

- [x] npm run prettier
- [x] npm run flow
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
- [x] npm run lint
- [x] npm run test
- [x] ./scripts/run-android-local-unit-tests.sh

[GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local
Pull Request resolved: https://github.com/facebook/react-native/pull/22188

Reviewed By: TheSavior

Differential Revision: D12972356

Pulled By: RSNara

fbshipit-source-id: 838604a791dfdc86bacf8b49f6c399920a3f57bc
2018-11-21 14:42:09 -08:00
Yosuke Saito fb4825a2c6 Flow strict ScrollResponder (#22181)
Summary:
Related to #22100

Enhance Flow types for Libraries/Components/ScrollResponder.js
Pull Request resolved: https://github.com/facebook/react-native/pull/22181

Reviewed By: TheSavior

Differential Revision: D13032699

Pulled By: RSNara

fbshipit-source-id: ca0ce178a96008a71016d033ee1154ad807d6599
2018-11-21 14:42:09 -08:00
Thomas BARRAS a97d104b44 Flow strict TouchableHighlight (#22173)
Summary:
Related to #22100

Enhance Flow types for TouchableOpacity specifying underlay functions and TvParallaxPropertiesType.
I had to export and enhance TvParallaxPropertiesType from TVViewPropTypes file. This does not break this other PR also using this exported type. #22146

There is still some work to do in order to turn flow to strict mode.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableHighlight.js] - Flow types
[GENERAL] [ENHANCEMENT] [TVViewPropTypes.js] - Export and enhance type
Pull Request resolved: https://github.com/facebook/react-native/pull/22173

Differential Revision: D13033441

Pulled By: RSNara

fbshipit-source-id: 26a38970923dc7e6c02c03da5d08483a3f1fbd36
2018-11-21 14:36:33 -08:00
gengjiawen f22473e9e9 Fix jsc regression.Fixes #22274 (#22293)
Summary:
My silly mistake when tinkering with the jsc lib. Also you have this patch first https://github.com/facebook/react-native/pull/22295.
Kudo plz review.

![image](https://user-images.githubusercontent.com/3759816/48561684-758f6f00-e92b-11e8-905b-e394f72349f7.png)
Pull Request resolved: https://github.com/facebook/react-native/pull/22293

Differential Revision: D13153931

Pulled By: hramos

fbshipit-source-id: 8a6efa0cd8abbff359f082d5ea7713933b6e7ac6
2018-11-21 14:36:33 -08:00
Ramanpreet Nara da0b139b56 Improve Flow types
Summary:
Some of the flow types were incomplete. So, I referenced the code in  `~/fbsource/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/textinput/` and in `~/fbsource/xplat/js/react-native-github/Libraries/Text/TextInput/` to make the flow types more specific.

I also fixed internal breakages. To avoid having to sprinkle `$FlowFixMe`s everywhere, I had to refactor some types, and some code.

Reviewed By: TheSavior

Differential Revision: D13121871

fbshipit-source-id: 9796aafc861544baf52d7ade823ab1be2d3f12d1
2018-11-21 14:33:48 -08:00
Thomas BARRAS 35a65cd704 Flow strict TextInput (#22250)
Summary:
Related to #22100

Enhance TextInput with callback event types.
This is a first draft and I will need more help on this one. Flow checks are successful now but I am not sure types are accurate though.
Moreover I find my separation approach kind of dirty for callback event types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextInput.js] - Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.android.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [TextInputExample.ios.js] - Fixing Flow types
[GENERAL] [ENHANCEMENT] [XHRExampleFetch.js] - Fixing Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22250

Reviewed By: TheSavior

Differential Revision: D13104820

Pulled By: RSNara

fbshipit-source-id: 3fbb98d0ec2b62be676f71ae1053933d9c78485e
2018-11-21 14:33:48 -08:00
Thomas BARRAS 79274979b7 Flow strict TextProps (#22122)
Summary:
Related to #22100

Turn on Flow strict mode for TextProps.
I used ResponseHandlers type definition defined in Text.js.

I wanted to move ResponseHandlers type to TextProps and reuse it inside the file.
I know I could use $Shape<> to maybe keys but how do I elegantly maybe every values ?
Unless having a straightforward solution, I found it clearer to copy paste these types.

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TextProps.js] - Flow strict mode
Pull Request resolved: https://github.com/facebook/react-native/pull/22122

Reviewed By: TheSavior

Differential Revision: D13055759

Pulled By: RSNara

fbshipit-source-id: 230b43c7c94d7f82f5727ad11541b0cb98bc5e3a
2018-11-21 14:27:25 -08:00
Thomas BARRAS 45c51835d6 Flow strict TouchableBounce (#22197)
Summary:
Related to #22100

Enhance TouchableBounce with press event types, callback and hitslop types.

There is still some work to do in order to turn flow to strict mode. (requireNativeComponent and render function)

- All flow tests succeed.

[GENERAL] [ENHANCEMENT] [TouchableBounce.js] - Flow types
Pull Request resolved: https://github.com/facebook/react-native/pull/22197

Reviewed By: TheSavior

Differential Revision: D13032452

Pulled By: RSNara

fbshipit-source-id: b21140722ce924698aa15323602e2e3fc663dbb6
2018-11-21 14:24:55 -08:00
Kevin Gozali aad83cc238 iOS TM: RCTEnableJSINativeModule => RCTEnableTurboModule
Summary: Leftover name change from previous codemod.

Reviewed By: shergin

Differential Revision: D13117615

fbshipit-source-id: 2584a2a90d3db6ed9a9e9cb8727c51da34f0927c
2018-11-20 01:20:59 -08:00
Adam Comella 70826dbafc iOS: Support inline view truncation (#21456)
Summary:
If text is truncated and an inline view appears after the truncation point, the user should not see the inline view. Instead, we have a bug such that the inline view is always visible at the end of the visible text.

This commit fixes this by marking the inline view as hidden if it appears after the truncation point.

This appears to be a regression. React Native used to have logic similar to what this commit is adding: 1e2a924ba6/Libraries/Text/RCTShadowText.m (L186-L192)

**Before fix**

Inline view (blue square) is visible even though it appears after the truncation point:

![image](https://user-images.githubusercontent.com/199935/46382038-d3a71200-c65d-11e8-8179-2ce4aad8d010.png)

The full text being rendered was:

```
<Text numberOfLines={1}>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna
  <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</Text>
```

**After fix**

Inline view is properly truncated:

![image](https://user-images.githubusercontent.com/199935/46382067-fdf8cf80-c65d-11e8-84ea-e2b71c229dae.png)

**Test Plan**

Tested that the inline view is hidden if it appears after the truncation point when `numberOfLines` is 1 and 2. Similarly, verified that the inline view is visible if it appears before the truncation point.

**Release Notes**

[IOS] [BUGFIX] [Text] - Fix case where inline view is visible even though it should have been truncated

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21456

Differential Revision: D10182991

Pulled By: shergin

fbshipit-source-id: a5bddddb1bb8672b61d4feaa04013a92c8224155
2018-11-20 00:11:56 -08:00
gazoudoudou 27cfba2882 Remove useless additionnal blur call (#22156)
Summary:
I noticed that the _onBlur method was not exactly similar to the _onFocus one in the TextInput component.

After digging, I found that the blurTextInput method in the TextInputState.js file was call twice in a raw instead of once when the textinput component should blur.

By removing this line, I fix this unecessary multiple call.
Pull Request resolved: https://github.com/facebook/react-native/pull/22156

Reviewed By: TheSavior

Differential Revision: D13105396

Pulled By: RSNara

fbshipit-source-id: 8e83461d8b288d8ee4047bc4a33c4480e193c349
2018-11-19 18:53:56 -08:00
Victor Calvello 55994f5900 Replace global.alert use to fix eslint warnings (#22184)
Summary:
Replaces `alert` with `Alert.alert` to fix eslint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22184

Reviewed By: TheSavior

Differential Revision: D13105636

Pulled By: RSNara

fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
2018-11-19 18:10:33 -08:00
Karan Thakkar 1fa56a0ac4 Rename requiresMainThreadSetup -> requiresMainQueueSetup in code comment (#22328)
Summary:
Update reference to property in code comment in `RCTBridgeModule`. There is no such thing as `requiresMainThreadSetup` in the codebase. Its called `requiresMainQueueSetup` now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22328

Differential Revision: D13115352

Pulled By: shergin

fbshipit-source-id: 511d627388b51029821c4b1ddf4caac30e573040
2018-11-17 21:43:07 -08:00