Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: Firefly
-
Labels:None
-
Story Points:8
-
Epic Link:
-
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
- links to
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.