Permalink
Switch branches/tags
Commits on Nov 20, 2018
  1. iOS TM: RCTEnableJSINativeModule => RCTEnableTurboModule

    fkgozali authored and facebook-github-bot committed Nov 20, 2018
    Summary: Leftover name change from previous codemod.
    
    Reviewed By: shergin
    
    Differential Revision: D13117615
    
    fbshipit-source-id: 2584a2a90d3db6ed9a9e9cb8727c51da34f0927c
  2. iOS: Support inline view truncation (#21456)

    rigdern authored and facebook-github-bot committed Nov 20, 2018
    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: https://github.com/facebook/react-native/blob/1e2a924ba60001c6f0587c7561536f00b2922cbf/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: #21456
    
    Differential Revision: D10182991
    
    Pulled By: shergin
    
    fbshipit-source-id: a5bddddb1bb8672b61d4feaa04013a92c8224155
  3. Remove useless additionnal blur call (#22156)

    gazoudoudou authored and facebook-github-bot committed Nov 20, 2018
    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: #22156
    
    Reviewed By: TheSavior
    
    Differential Revision: D13105396
    
    Pulled By: RSNara
    
    fbshipit-source-id: 8e83461d8b288d8ee4047bc4a33c4480e193c349
  4. Replace global.alert use to fix eslint warnings (#22184)

    vcalvello authored and facebook-github-bot committed Nov 20, 2018
    Summary:
    Replaces `alert` with `Alert.alert` to fix eslint warnings.
    Pull Request resolved: #22184
    
    Reviewed By: TheSavior
    
    Differential Revision: D13105636
    
    Pulled By: RSNara
    
    fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
Commits on Nov 18, 2018
  1. Rename requiresMainThreadSetup -> requiresMainQueueSetup in code comm…

    karanjthakkar authored and facebook-github-bot committed Nov 18, 2018
    …ent (#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: #22328
    
    Differential Revision: D13115352
    
    Pulled By: shergin
    
    fbshipit-source-id: 511d627388b51029821c4b1ddf4caac30e573040
Commits on Nov 17, 2018
  1. Surface: Using screen size as a default maximum size of Fabric Surface

    shergin authored and facebook-github-bot committed Nov 17, 2018
    Summary: That's a temporary change that useful only while we don't have deeper/proper intergration with UIKit's navigation infra.
    
    Reviewed By: mdvacca
    
    Differential Revision: D13104172
    
    fbshipit-source-id: 024e71e04470d56d2c5e9b3f6c3392555ce50b63
  2. DrawerLayoutAndroid: Convert to ES6 class (#21980)

    empyrical authored and facebook-github-bot committed Nov 17, 2018
    Summary:
    This pull requests converts `DrawerLayoutAndroid` from a `createReactClass`-based component to an ES6 class component, removing its use of `NativeMethodsMixin` and `prop-types` in the process.
    
    Unfortunately this couldn't be moved over to a full `forwardRef` to the native component, because it has the methods `openDrawer` and `closeDrawer` as part of its API, and they can't be called directly on the native component. A `createRef`-based ref to the native component can be accessed from the `nativeRef` property of a `DrawerLayoutAndroid` instance if a native ref is needed.
    
    The Flow types for callbacks have also been filled out.
    Pull Request resolved: #21980
    
    Reviewed By: TheSavior
    
    Differential Revision: D12901951
    
    Pulled By: RSNara
    
    fbshipit-source-id: d35fa5f11b1059f49b466b52abeec902db1d22f7
  3. Fix padding for Text Views in Fabric

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: This diff extends Text View to support not only paddingLeft, paddingRight, etc but also padding props.
    
    Reviewed By: shergin
    
    Differential Revision: D13111433
    
    fbshipit-source-id: 3b0efe8468f20a5ffaf31e3f1f180e96a5409865
  4. Implement layout constraint when measuring text

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: This diff adds support for layout constraint when measuring text
    
    Reviewed By: shergin
    
    Differential Revision: D13111434
    
    fbshipit-source-id: 0c8689e9ac8ce2281b03386f275d2a8e034f88d8
  5. NIT remove unnecessary cast in measure

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: Trivial clean up of unnecessary cast in measure methods
    
    Reviewed By: shergin
    
    Differential Revision: D13108542
    
    fbshipit-source-id: 93661f2f5322a790f2d578e6897b89cd1e205c3d
  6. Change font size default from 12 to 14

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: trivial change of the default font size from 12 to 14 to make it backward compatible with current version of RN
    
    Reviewed By: shergin
    
    Differential Revision: D13108543
    
    fbshipit-source-id: e5e384c4459f2c87ee9589c4e00a0ab5d0c8a06a
  7. Fix scrolling with multiple fingers in RN Fabric scrollView

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: Scrolling with multiple fingers produced a redbox in Fabric
    
    Reviewed By: shergin
    
    Differential Revision: D13108544
    
    fbshipit-source-id: 7b70b3f55f325448191adc48c782f2014b502ad6
  8. Cleanup old Fabric methods from ReactShadowNodeImpl

    mdvacca authored and facebook-github-bot committed Nov 17, 2018
    Summary: These methods and variables were used by Android implementation of Fabric, these are not used anymore.
    
    Reviewed By: shergin
    
    Differential Revision: D13108547
    
    fbshipit-source-id: d169eb58ba20f3bfe117a124f0494ff3a4fb5dce
  9. Fabric: Proper implementation `-[RCTSurfaceTouchHandler reset]`

    shergin authored and facebook-github-bot committed Nov 17, 2018
    Summary:
    Apparently, if a gesture recognizer got 'reset', OS does not call `touchesCancelled:` method, so we have to do it manually.
    To implement this we have to split `_dispatchTouches:eventType:` into two methods: the first converts Objective-C touches to C++ touches, the second consumes that. We have to do this because during reset we don't have a collection of UIKit touches.
    
    Reviewed By: mdvacca
    
    Differential Revision: D13072807
    
    fbshipit-source-id: 677e2febf9f96dcdfaadfadf5b9ab3893f93e796
  10. Fabric: Using non-mutating `at` instead of `[]` for `-[RCTSurfaceTouc…

    shergin authored and facebook-github-bot committed Nov 17, 2018
    …hHandler _activeTouches]`
    
    Summary: Every C++ engineer (except me several months ago) knows that `operator []` can mutate the collection (Yeah! Don't ask), so this is especially dangerous if your hash function is broken (see the previous diff).
    
    Reviewed By: mdvacca
    
    Differential Revision: D13072805
    
    fbshipit-source-id: 4436a8ff12fb27a57bfb6ee0ff986d7a9a825549
  11. Fabric: Fixed bug in RCTSurfaceTouchHandler::PointerHasher

    shergin authored and facebook-github-bot committed Nov 17, 2018
    Summary:
    Without this fix the PointerHasher hashed not a pointer, but an address where the pointer is stored, which is obviously incorrect.
    The incorrect hash function compromised the whole `_activeTouches` caused many issues with logically invalid invariants (e.g. removing element from the collection silently didn't work).
    
    Reviewed By: mdvacca
    
    Differential Revision: D13072804
    
    fbshipit-source-id: d68289e940fe21e2df08a31439619b7e2fe0fa13
  12. create api to allow clients to present a client credential for authen…

    mjhu authored and facebook-github-bot committed Nov 17, 2018
    …tication (#22316)
    
    Summary:
    Pull Request resolved: #22316
    
    Pull Request resolved: #22315
    
    In order for TLS Mutual Auth to work for webviews, the caller must present a credential. Expose a setter that can be called to set a credential.
    
    Reviewed By: RSNara
    
    Differential Revision: D13095969
    
    fbshipit-source-id: d136556a0030f799651d574b6e47ce38295b108e
  13. Add test for WritableNativeMap

    ayc1 authored and facebook-github-bot committed Nov 17, 2018
    Summary: A simple test for WritableNativeMap. Also includes a test to verify that the key name exists in the error message if a dynamic cast exception occurs (this will be implemented in the future)
    
    Reviewed By: mdvacca
    
    Differential Revision: D12914375
    
    fbshipit-source-id: 654674b1b32e7b3f38cc1364a2302d1ce08ec33e
Commits on Nov 16, 2018
  1. Back out "reapply TextInput es6 conversion with fixes, attemps to fix"

    sahrens authored and facebook-github-bot committed Nov 16, 2018
    Summary:
    Back it out again. This time really not sure why this is breaking, but it seems to be production only. The error seems to be "RCTSinglelineTextInputView" was not found in the UIManager" but the relavent logic is not changed in this diff, just moved around, so unclear why it would trigger a failure.
    
    Reverting to be safe. When we re-apply the diff, we'll need to test a full OTA to prod to verify the fix.
    
    Reviewed By: blairvanderhoof
    
    Differential Revision: D13108463
    
    fbshipit-source-id: 5f877a0c1a08dc114ce45921d6d92bf619575977
  2. Add bounce method to TouchableBounce

    Jonathan Lee authored and facebook-github-bot committed Nov 16, 2018
    Summary: Adds a `bounce` method that just bounces the element without invoking any callbacks.
    
    Differential Revision: D13085800
    
    fbshipit-source-id: 310b273b260c924fbde32bfad1de7226d068bd57
  3. Flow v0.86.0 in xplat/js

    panagosg7 authored and facebook-github-bot committed Nov 16, 2018
    Summary:
    allow-large-files
    bypass-lint
    ignore-conflict-markers
    ignore-signed-source
    ignore-nocommit
    
    drop-conflicts
    
    Reviewed By: yungsters
    
    Differential Revision: D13081129
    
    fbshipit-source-id: fbb0ccaf3c0a2f224a56f6f6ac6c26811ebba583
  4. CxxReact: Silence 'unused lambda capture' warnings in open-source (#2…

    empyrical authored and facebook-github-bot committed Nov 16, 2018
    …2240)
    
    Summary:
    This pull request silences build warnings like this in open-source:
    
    ```
    {snip}/ReactCommon/cxxreact/CxxNativeModule.cpp:134:85: warning: lambda capture 'callId' is not used [-Wunused-lambda-capture]
      messageQueueThread_->runOnQueue([method, params=std::move(params), first, second, callId] () {
    ```
    
    These are variables used by "fbsystrace", which is not open-sourced.
    
    An  unused statement has been added to the affected files in the `#else` for the `#ifdef WITH_FBSYSTRACE` conditionals
    Pull Request resolved: #22240
    
    Differential Revision: D13031358
    
    Pulled By: shergin
    
    fbshipit-source-id: 8ccfc226b65e32abda6abb573f77a6589bd19dcd
  5. reapply TextInput es6 conversion with fixes, attemps to fix

    sahrens authored and facebook-github-bot committed Nov 16, 2018
    Summary: D10515754 reapplied by backing out D12989604 and then fixed by manually forwarding the instance methods to the host function instead of using `forwardRef`. This also removes the need for the $flowFixMe.
    
    Reviewed By: TheSavior
    
    Differential Revision: D13048482
    
    fbshipit-source-id: ff2447aff123e0960eddaef645f7dc976a426e14
  6. New TextInput-test that would have prevented S168585

    sahrens authored and facebook-github-bot committed Nov 16, 2018
    Summary: Adds a basic test that would have prevented S168585. We should expand coverage of this and other components as well.
    
    Reviewed By: TheSavior
    
    Differential Revision: D13038064
    
    fbshipit-source-id: 14cf4742efd53d7bca2a3f8d1c5c34ebc6227674
  7. resizeMode applies to Image.defaultSource (#22216)

    dulmandakh authored and facebook-github-bot committed Nov 16, 2018
    Summary:
    resizeMode applies to Image.defaultSource, because depending on screen resolution sometimes we see padding around defaultSource image while source loading. Now we can control scale of both source and defaultSource.
    
    Changelog:
    ----------
    [Android] [Fixed] - Image.resizeMode will apply to defaultSource, enhanced user experience. Previously, resizeMode didn't applied to defaultSource, therefore depending on screen resolution sometimes we see padding around defaultSource image while source loading.
    Pull Request resolved: #22216
    
    Differential Revision: D13088220
    
    Pulled By: mdvacca
    
    fbshipit-source-id: 92c66cf6228f3b7666b9ef2404d034f0005b5234
  8. Defining explicit clang-format for Objective-C part of React Native

    shergin authored and facebook-github-bot committed Nov 16, 2018
    Summary:
    Now, Objective-C part of RN is in `xplat` directory, so global Objective-C clang-format does not affect that.
    Explicit clang-format is also useful for external contributors who don't have access to the rest of monorepo.
    The actual rules are copy-paste from ReactCommon folder with small changes (like 120 characters max line length) that conform to regular Facebook code style and which make sense only for Objective-C.
    
    Reviewed By: fkgozali
    
    Differential Revision: D13093150
    
    fbshipit-source-id: 79d64b4fba6eeb94e9b8d87ef9c3f86b3a5ed94e
  9. Changed front-facing camera so that it shows consistent image during …

    Enrico Bern Hardy Tanuwidjaja authored and facebook-github-bot committed Nov 15, 2018
    …capture and preview
    
    Summary: Changed front-facing camera so that it shows consistent image during capture and preview
    
    Reviewed By: mmmulani
    
    Differential Revision: D13012715
    
    fbshipit-source-id: 043cd9178fc49ef9e8e628a866dd8e52434f7306
Commits on Nov 15, 2018
  1. JS: Switch from `new Buffer` to `Buffer.from`

    yungsters authored and facebook-github-bot committed Nov 15, 2018
    Summary:
    Constructing `Buffer` using the constructor [[https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/ | has been deprecated in Node 10 due to security considerations]].
    
    This is a simple and straightforward conversion.
    
    Reviewed By: mjesun
    
    Differential Revision: D13080655
    
    fbshipit-source-id: 100d8f28c3b255422b26e820aaadcc4f32f41e0d
  2. Fix compatibility issue for android 16 device.Fixes #22294 (#22295)

    gengjiawen authored and facebook-github-bot committed Nov 15, 2018
    Summary:
    Fix compatibility issue for android 16 device. Related issue #22295.
    pass all current ci.
    none
     [GENERAL] [ANDROID] [Fixed] - Fix compatibility issue for android 16 device
    Pull Request resolved: #22295
    
    Differential Revision: D13084152
    
    Pulled By: hramos
    
    fbshipit-source-id: 42459ddc6f84f870affdda5ba19bcd8bb27b56d7
  3. Fix React Native AsyncMode and DevTools

    bvaughn authored and facebook-github-bot committed Nov 15, 2018
    Summary:
    Fixes two problems I uncovered with React Native:
    1. `FBCore/Prelude` points to `React.unstable_AsyncMode` which is not defined. (This type was renamed to `React.unstable_ConcurrentMode` in React v16.6.0. **As a result** people in the "react_native:async_rendering" GK will no longer get runtime errors on app start.
    2. Updates `react-devtools` and (more importantly) `react-devtools-core` to 3.4.2 to handle the React-internal tag/type refactoring that happened prior to the release of 16.6.0. **As a result** DevTools will no longer cause a runtime error when connected to React Native.
    
    For the second change, I ran `js1 upgrade react-devtools -v ^3.4.2`
    
    Reviewed By: sebmarkbage
    
    Differential Revision: D13030590
    
    fbshipit-source-id: 603f7f6259f282839039820bcdba4310064a7965
  4. Back to yearless format for MIT license

    davidaurelio authored and facebook-github-bot committed Nov 15, 2018
    Summary:
    @public
    
    Restores the yearless format of the MIT license.
    
    Reviewed By: SidharthGuglani
    
    Differential Revision: D13082510
    
    fbshipit-source-id: f5a849b06652cedf68547d4a7963398b2627915f
  5. Workaround a wrong fling direction for inverted ScrollViews on Androi…

    mandrigin authored and facebook-github-bot committed Nov 15, 2018
    …d P (#21117)
    
    Summary:
    This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925
    
    It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction.
    
    Fixes #19434
    Pull Request resolved: #21117
    
    Differential Revision: D13082740
    
    Pulled By: hramos
    
    fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
  6. Revert D12994045: Flow v0.86.0 in xplat/js [3/n]

    Stephy Ma authored and facebook-github-bot committed Nov 15, 2018
    Differential Revision:
    D12994045
    
    Original commit changeset: 04552bf081ba
    
    fbshipit-source-id: 062b367b88a966a6efc895c99e9911f0ec0fe8ff
  7. Flow v0.86.0 in xplat/js [3/n]

    panagosg7 authored and facebook-github-bot committed Nov 15, 2018
    Summary:
    allow-large-files
    bypass-lint
    ignore-conflict-markers
    ignore-signed-source
    ignore-nocommit
    
    drop-conflicts
    
    Reviewed By: avikchaudhuri
    
    Differential Revision: D12994045
    
    fbshipit-source-id: 04552bf081ba742de58e80fba08f8280cb86b1c3
  8. Remove dynamic exception specification in RN MethodCall.h/cpp

    yiding authored and facebook-github-bot committed Nov 15, 2018
    Summary: Dynamic exception specifications are removed in C++17.
    
    Reviewed By: mhorowitz
    
    Differential Revision: D13078933
    
    fbshipit-source-id: b1a1d7aed3f634c6bc699ab05a8c218bdddf5993