Skip to content
Permalink
Branch: master
Commits on Mar 20, 2019
  1. allow HTTP in debug builds (#24066)

    dulmandakh authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    It allows HTTP connections in debug builds, and requires no configuration compared to previous/current solution where you need to edit config file to test on device.
    
    Consulted with Salakar about this.
    
    [Android] [Changed] - Allow HTTP in debug builds
    Pull Request resolved: #24066
    
    Differential Revision: D14540255
    
    Pulled By: cpojer
    
    fbshipit-source-id: f1239154c27c36c21c9b080a826f8b1d0eb0fc7d
  2. JNI: Simplify node context

    davidaurelio authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    @public
    Contexts of nodes only hold a bit mask after we got rid of weak JNI refs.
    We can simply store that data in a pointer-sized unsigned int.
    
    Here, we replace all context heap allocations with usage of the node context (`void *`) as bitmask. We also add a couple of utility operators in order to keep the code comprehensible.
    
    Reviewed By: fabiomassimo
    
    Differential Revision: D14425742
    
    fbshipit-source-id: f32c2184a1f09268c39dbb8cd09ac96517339674
  3. Null check on Picker Items (#24057)

    Rahulkishanm authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    when conditional rendering is used then picker breaks when the child is null in iOS
    
    This conditional rendering inside Picker fails when "someBooleanValue" variable is false
    
    ```
    {
       this.state.someBooleanValue && <Picker.Item label="value" value="value" />
    }
    ```
    
    [iOS] [Fixed] - null check on children by using filter
    Pull Request resolved: #24057
    
    Differential Revision: D14538337
    
    Pulled By: cpojer
    
    fbshipit-source-id: d9324671931b5f1dac65d8058d9aa957b650af25
  4. renamed YogaNodeJNI to YogaNodeJNIBase

    SidharthGuglani authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    Renamed class from YogaNodeJNI to YogaNodeJNIBase.
    This change set is for adding experiment for layout outputs batching using a float array where we will have two separate classes which will override how layout outputs are transferred to java YogaNode object.
    
    We needed two separate classes because having everything in one class was causing memory issues as both the individual fields for width, height etc. and float array for batching needs to be present in code.
    
    Reviewed By: davidaurelio
    
    Differential Revision: D14368069
    
    fbshipit-source-id: 0e98e28c8c7a9788345ccb92b2cd0f2cd4a53525
  5. Remove AlertIOS

    cpojer authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    This module was merged with `Alert`. Landing the removal now will mean that it is gone from 0.61 which means the deprecation warning will have been there for two full versions.
    
    It will also make it easier to ship D14538298.
    
    Reviewed By: rubennorte
    
    Differential Revision: D14539026
    
    fbshipit-source-id: fb36482324866c277811756cc7461451a1482b23
  6. chore: update Jest preset to align with Jest 24 (#24062)

    thymikee authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    Jest 24 includes [`testMatch` and `moduleFileExtensions`](https://github.com/facebook/jest/blob/c5fd7aae93764c13c259ae9a73846c10e84ae2a3/packages/jest-config/src/Defaults.ts#L70) that align with the ones that are currently there on master, because it added default handling for TypeScript as well. I think it's time for us to move to Jest 24. Is there a way we can tell users to upgrade Jest to certain version?
    
    Fixes #24060
    
    [General] [Changed] - update Jest preset to align with Jest 24
    Pull Request resolved: #24062
    
    Differential Revision: D14538988
    
    Pulled By: cpojer
    
    fbshipit-source-id: d8d152b8e8517b34144970f1cc1ed0b49f8b4e54
  7. Fix RCTJavaScriptLoader loadBundleAtURL error case (#23837)

    hcn1519 authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    Change the function called when an error is returned from the completionHandler of the `RCTJavaScriptLoader(loadBundleAtURL:onProgress:onComplete:)`.
    
    * AS-IS
        - `RCTLogError()`
        - This error method does not post any notification for users. So users cannot receive notification when `RCTJavaScriptLoader(loadBundleAtURL:onProgress:onComplete:)` complete with error.(i.e. bundleURL is is invalid but not nil, `http://1`, `http://localho:8081/index.bundle`)
    
    * TO-BE
        - `handleError(error:)`
        -  Call this method will post notification for users when `completionHandler` fails with error.
    
    [iOS] [Fixed] - Change the function called when an error is returned from the completionHandler of the `RCTJavaScriptLoader(loadBundleAtURL:onProgress:onComplete:)`.
    Pull Request resolved: #23837
    
    Differential Revision: D14538790
    
    Pulled By: cpojer
    
    fbshipit-source-id: da3306904c0d8113d204edfaa0f9e2a23793981a
  8. Fix #24053 prevent division by zero error in VirtualizedList debug ov…

    Bartol Karuza authored and facebook-github-bot committed Mar 20, 2019
    …erlay (#24058)
    
    Summary:
    This PR fixes the case where the content a VirtualizedList loads with a contentLength of 0,  causing a crash in the `renderDebugOverlay` function. The result of that crash is a red screen when turning on debug on FlatList and other VirtualizedList components as described in #24053.
    
    [LIST] [FIX] - Fix VirtualizedList debug mode crash
    Pull Request resolved: #24058
    
    Differential Revision: D14538317
    
    Pulled By: cpojer
    
    fbshipit-source-id: 7b17bf51c388561c517bab1f775a31200abdc5a9
  9. Fixed surface presenter observer (#24048)

    zhongwuzw authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    We missed create observer array, let's add it.
    cc. shergin .
    
    [iOS] [Fixed] - Fixed surface presenter observer
    Pull Request resolved: #24048
    
    Differential Revision: D14537159
    
    Pulled By: shergin
    
    fbshipit-source-id: f57f685a09aa7c9692245d178b68e94d666ae2fb
  10. Reorder prepareForRecycle before adding recycle pool (#24025)

    zhongwuzw authored and facebook-github-bot committed Mar 20, 2019
    Summary:
    Put `prepareForRecycle` to last before enqueue to recycle pool, ensure only call it when count lower than RCTComponentViewRegistryRecyclePoolMaxSize.
    
    cc. shergin .
    
    [General] [Changed] - Reorder prepareForRecycle before adding recycle pool
    Pull Request resolved: #24025
    
    Differential Revision: D14536843
    
    Pulled By: shergin
    
    fbshipit-source-id: 82a816e2c0afb5a6bb72637d7d55d6a4fda708af
Commits on Mar 19, 2019
  1. Eliminate eslint npm version mismatch warnings and bump some to latest (

    matthargett authored and facebook-github-bot committed Mar 19, 2019
    #23969)
    
    Summary:
    I was annoyed by warnings from yarn/npm about eslint peer dependencies not being met, so I dived in to try and get rid of some of them. Sometimes it meant bumping a plugin, but then that plugin needed a newer babel-eslint, so it was a dance.
    
    Some we can't easily update to latest (eslint-plugin-prettier) because the rule format has changed a bit. Happy to do that in this PR if folks think its a good idea. eslint-config-fbjs itself needs to be updated and republished to eliminate the last few warnings.
    
    There are a few new warnings (the repo wasn't linting cleanly for me from the start). I can fix those in this PR, or a separate one, based on people's preferences.
    
    [internal] [chore] - Eliminate some peer dependency warnings and bump some eslint packages to latest.
    Pull Request resolved: #23969
    
    Differential Revision: D14519076
    
    Pulled By: cpojer
    
    fbshipit-source-id: aa44cfd05814d7b79069414aa78d089e448c2235
  2. Add removeExtra()

    alexeylang authored and facebook-github-bot committed Mar 19, 2019
    Reviewed By: bestander
    
    Differential Revision: D14386282
    
    fbshipit-source-id: 045dd0f12cc462da694d20da52f3a591b538dc57
  3. Update the license for RCTWrapperExample (#24037)

    orta authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    The copyright headers in the Wrapper example referenced a license file that doesn't exist anymore. This PR updates the copyright header to match other example files in the repo
    
    Fixes #23215
    
    [General] [Changed] Updated the license of RCTWrapperExample to match the rest of the Examples
    Pull Request resolved: #24037
    
    Differential Revision: D14521327
    
    Pulled By: cpojer
    
    fbshipit-source-id: 983741d4d93178cd90b532ad5f8ff0717670aff4
  4. Remove `-p` calls from `shasum`. (#24036)

    cpojer authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    Fixes #22873. Given that this code is meant to only work on macOS, we should be fine not using a portable hash. In the packages for which this matters at the bottom of this file, it produces the same hashes so it should be fine.
    
    [General] [Fixed] - Don't use `-p` when invoking shasum.
    Pull Request resolved: #24036
    
    Differential Revision: D14521134
    
    Pulled By: cpojer
    
    fbshipit-source-id: 882e762b7817d9d46bdd405c9e2e9e8b4d7cfaf4
  5. add react_native_config to RNTester (#24033)

    ferrannp authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    It was not possible to run RNTester in Android P and connect to the packager.
    
    [Android][RNTester] add react_native_config to RNTester for the packager to be able to connect with Android P devices
    Pull Request resolved: #24033
    
    Differential Revision: D14520803
    
    Pulled By: cpojer
    
    fbshipit-source-id: 567a0461d14d880cd78e9fa551ba25fe60af798d
  6. Proxy statics for the wrapped component

    alexeylang authored and facebook-github-bot committed Mar 19, 2019
    Summary: Currently we can't access navigationOptions  from measureAppRequire and that breaks fetchRelayQuery logs.
    
    Reviewed By: fkgozali
    
    Differential Revision: D14505525
    
    fbshipit-source-id: 97ae4461ebb0e703633f782323b13b4e4f7c5cb7
  7. Fixed regression in SectionList caused by #21577 not being able to sc…

    danilobuerger authored and facebook-github-bot committed Mar 19, 2019
    …roll to top on android (#24034)
    
    Summary:
    ```
    let index = params.itemIndex + 1;
    ```
    to
    ```
    let index = Platform.OS === 'ios' ? params.itemIndex : params.itemIndex - 1;
    ```
    to fix an issue on iOS. Note however, how the sign for non iOS changed from `+` to `-` causing a crash on Android when trying to scroll to index 0 as that will be evaluated to -1 instead of 1 and thus be out of bounds.
    
    [Android] [Fixed] - Fixed regression in SectionList caused by #21577 not being able to scroll to top on android
    Pull Request resolved: #24034
    
    Differential Revision: D14520796
    
    Pulled By: cpojer
    
    fbshipit-source-id: bb49619f49752fd3f343ef3b7bf1b86ac48af7f8
  8. Add PointPrimitive

    rickhanlonii authored and facebook-github-bot committed Mar 19, 2019
    Summary: Adds support for the native type Point to the rn codegen
    
    Reviewed By: TheSavior
    
    Differential Revision: D14462164
    
    fbshipit-source-id: 942b5697d616c6aa6289d01bb56382fd7adac203
  9. Add ArrayTypeAnnotation

    rickhanlonii authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    Adds support for `ArrayTypeAnnotation`, usage is as:
    
    ```
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'BooleanTypeAnnotation',
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'StringTypeAnnotation',
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'FloatTypeAnnotation',
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'Int32TypeAnnotation',
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'NativePrimitiveTypeAnnotation',
        name: 'ImageSourcePrimitive'
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'NativePrimitiveTypeAnnotation',
        name: 'ColorPrimitive'
    }
    
    {
      type: 'ArrayTypeAnnotation',
      items: {
        type: 'NativePrimitiveTypeAnnotation',
        name: 'PointPrimitive' // added in the next dfif
    }
    ```
    
    Reviewed By: TheSavior
    
    Differential Revision: D14462086
    
    fbshipit-source-id: f0c25f8fe969efc01e5838f3966d910fbbd9c86c
  10. ShadowNode: Using state value for computing ShadowView hash

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: Trivial.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14472906
    
    fbshipit-source-id: 014a3115c24d155a93ff24404d4f748880d53b2b
  11. Fabric: Using new shiny ShadowNode::getAncestors in LayoutableShadowNode

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: Same algorithm using a new API.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14423509
    
    fbshipit-source-id: c40f61fdd001f68785512c304941f523585d641c
  12. Fabric: Using ShadowNode::getAncestors in RootShadowNode::clone

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: The basic idea of the implementation is the same, but it uses the new method for finding parenting chain and it does not use `shared_from_this()` anymore.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14416949
    
    fbshipit-source-id: 13ef928505a60280e2a6c30c76ac87d91cee326e
  13. Fabric: a new efficient implementation of ShadowNode::getAncestors()

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    The algorithm is quite simply:
    1. Get family objects of the two nodes (inner and outer).
    2. Traverse the list of family objects starting from the inner one and form a reversed list of them.
    3. tarting from the inner node, traverse the tree layer-by-layer choosing a next element of the path by comparing the family object of each node on the level and an object from the list.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14416950
    
    fbshipit-source-id: 23c659a9e01690f90174193650a2b0ef09eadb4d
  14. Fabric: ShadowNodeFamily, maintaining a pointer to a parent family

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    One of the core feature of ShadowNodeFamily is having a pointer to a parent family. This diff implements it.
    I don't think there is a hard retain cycle there, but for more lean memory usage we use weak_ptr here.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14416948
    
    fbshipit-source-id: 05fd2c4833146f007228363b1d958776b4a2a9cf
  15. Fabric: ShadowNodeFamily, the first steps

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    ShadowNodeFamily is a new concept that allows us to implement an efficient way to solve the problem of finding a path to some ancestor node (practically reimplement ShadowNode::constructAncestorPath() in some efficient way).
    
    This diff is the first one in the series. It introduces a new class and moves some data into it.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14416947
    
    fbshipit-source-id: c93865a8929a2128498e34d3589487696aac6283
  16. Fabric: Removed declaration of ShadowNode::clearSourceNode()

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: This is a leftover from the ealy days of Fabric. The mehtod does not have implementation counterpart and any usage.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14402636
    
    fbshipit-source-id: aa2e919084ae7382d3a62af761e1f6eac334fc75
  17. Fabric: Removed unnecessary call in `RootShadowNode::clone`

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: The removed code does nothing because we are replacing the oldChild with newChild several lines above.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14402637
    
    fbshipit-source-id: 731a950f373e20f7d5bae3cbf6470335d3694ccc
  18. Fabric: Tightening up some ShadowNode cloning semantics

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: In React, things like changing `tag`, `eventTarget` or reparenting are impossible by design. Which seems like a strange limitation actually allows us to do tremendous performance optimizations (stay tuned!).
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14402638
    
    fbshipit-source-id: 3b7b7edaff0d55a3ca94e2ac4c753d630d07101d
  19. Remove explicitly add png file extension when load local image (#23864)

    zhongwuzw authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    We need to remove adding png file extension when path has not extension. Two reasons:
    1. `imageWithContentsOfFile` or other `UIKit` methods can load png image correctly, even if path has not `png` file extension.
    2. Sometimes, people may have file that actually not have file extension, it's the designated behavior for user. Like #23844 .
    
    CC. sahrens cpojer .
    
    [iOS] [Fixed] - Remove explicitly add png file extension when load local image
    Pull Request resolved: #23864
    
    Reviewed By: shergin
    
    Differential Revision: D14425373
    
    Pulled By: hramos
    
    fbshipit-source-id: 3cc06c9a3d68cadf652c1de742f3cce26258c874
  20. Refactor autofillHints API 26+ runtime check

    hramos authored and facebook-github-bot committed Mar 19, 2019
    Summary: Refactor the fix from d4aa1e7 into something that follows the same convention used in 36957dc
    
    Reviewed By: mdvacca
    
    Differential Revision: D14485427
    
    fbshipit-source-id: e6118284fcffa4b43c8392c94991764a07094403
  21. Fabric: Explicit dirtying Yoga nodes for Text component (and co.)

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary:
    With recent changes, simple cloning a component does not mean that underlying Yoga node will be dirtied. Autodirtying is only performed if the child nodes were dirtied and/or if the YGStyles were changed.
    That's not the case for Text component which does not have direct layotable children, so we have to call `dirtyLayout` explicitly.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14508277
    
    fbshipit-source-id: 2c52d7d40da963a976c7d28a13781cc1755ef591
  22. Fabric: Correct checking for `sealable` flag with move semantic methods

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: In methods which implement move semantic we have to check the source object because it's (also) being mutated.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14496937
    
    fbshipit-source-id: f3f2299d14e41c8b269f1647336dbd5b45c235f4
  23. Fabric: More asserts/invariant-checking in YogaLayoutableShadowNode

    shergin authored and facebook-github-bot committed Mar 19, 2019
    Summary: More `assert`s and `ensureUnsealed` calls were added to YogaLayoutableShadowNode for simpler debugging and early failing.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14496936
    
    fbshipit-source-id: 898c6a0665aeac5d0b1995bd53046f58cec37007
  24. Fabric: Checking for `HasNewLayout` before applying layout metrics to…

    shergin authored and facebook-github-bot committed Mar 19, 2019
    … ShadowNode
    
    Summary:
    If the `HasNewLayout` flag is `false`, we should not copy the data from YGStyle/YGLayout to ShadowNode because the node can be already sealed and because it's unnecessary. Previously we workaround this case with a special check in `setLayoutMetrics` method, but that can be unreliable because of some side-effects related to pixel rounding and comparing floats.
    The new approach is much more robust and explicit.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14496939
    
    fbshipit-source-id: deddb14d2206c5bd3f22154d0ea682e3c5888901
  25. Fabric: Removing default implementation of some methods of Layoutable…

    shergin authored and facebook-github-bot committed Mar 19, 2019
    …ShadowNode
    
    Summary: These default implementations are never being used. Removing them allowing to ensure that flags inside YGNode have same values as flags in YogaLayoutableShadowNode. That also saves a couple of bytes in size of ShadowNode.
    
    Reviewed By: JoshuaGross
    
    Differential Revision: D14496938
    
    fbshipit-source-id: c43f9c8a2eec054f728ff54a6573668eccda55fb
Older
You can’t perform that action at this time.