Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-17722

Upgrade react to 16.8

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Firefly
    • Labels:
      None
    • Story Points:
      8
    • Sprint:
      SUIT Sprint 2019-02, SUIT Sprint 2019-03
    • Team:
      Science User Interface

      Description

      Upgrade react and related components from 16.2 to 16.8 

      • don't upgrade redux
      • upgrade any other react components.
      • only do webpack and babel

       

      Implemented:

      • upgraded React.js to version 16.8
      • converted AdvancedADQL to use react hooks which is a big feature of this release

      The converted file make use of the new useState and useRef hooks, as well as demonstrate how updated props can be compared directly in the render function.
      It serves as a test for the upgrade as well as demonstration of how new features are used.

      Here is a complete changelog for react:
      https://github.com/facebook/react/blob/master/CHANGELOG.md#1680-february-6-2019

      This blog highlight some of the changes in v16, up to v16.7.
      https://hackernoon.com/react-16-0-16-3-new-features-for-every-day-use-f397da374acf

      Summary of the blog:

      • Returning multiple elements from components with fragments (16.2)
        <React.Fragment>

        </React.Fragment>
        or
        <>

        </>
      • Returning strings and numbers from components
      • Cancelling setState() to avoid rerendering
      • Avoiding prop drilling with the official context API (16.3)
      • Updating state based on props with getDerivedStateFromProps() (16.3)
      • Re-rendering function components on props change with React.memo() (16.6)
      • Easier access to context in class components with contextType (16.6)

        Attachments

          Issue Links

            Activity

            Hide
            loi Loi Ly added a comment -

            Although ticket said to not upgrade to 16.8, Trey Roby privately suggested we should go ahead with the latest version.  It's backward compatible.  PR with test link seem to support that claim.  No code change were needed for the upgrade.  One file where modified to demonstrate usage of new features in this version.

            Show
            loi Loi Ly added a comment - Although ticket said to not upgrade to 16.8, Trey Roby  privately suggested we should go ahead with the latest version.  It's backward compatible.  PR with test link seem to support that claim.  No code change were needed for the upgrade.  One file where modified to demonstrate usage of new features in this version.
            Hide
            loi Loi Ly added a comment -

            done.

            Show
            loi Loi Ly added a comment - done.

              People

              Assignee:
              loi Loi Ly
              Reporter:
              roby Trey Roby
              Watchers:
              Emmanuel Joliet, Gregory Dubois-Felsmann, Loi Ly, Tatiana Goldina, Trey Roby, Xiuqin Wu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.