Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade some packages in the front-end #325

Merged
merged 34 commits into from
Aug 16, 2022
Merged

Upgrade some packages in the front-end #325

merged 34 commits into from
Aug 16, 2022

Conversation

nafiz1001
Copy link
Contributor

@nafiz1001 nafiz1001 commented Jun 29, 2022

Migrations

react-redux

https://github.com/reduxjs/react-redux/releases/tag/v8.0.0

In most cases, it's very likely that the only change you will need to make is bumping the package version to "react-redux": "^8.0".

  • bumping the package version to "react-redux": "^8.0"

react-router-dom

remix-run/react-router#8753

  • Upgrade your app to React 16.8+
  • Read from v6 useParams() instead of v5 props.match
  • Read from v6 useLocation() instead of v5 props.location
  • Use navigate instead of history
  • Update links to use relative to values
  • [ ] Update nav links (optional)
  • Convert <Switch> to <Routes>
  • Add splat paths to any with a descendant
  • Convert route paths from absolute to relative paths

webpack-cli

  • update package.json
    • npm start is missing --mode=development

webpack-dev-server

https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md

  • webpack-dev-server v3 and webpack-dev-server v4 automatically apply HotModuleReplacementPlugin plugin when you set hot: true, so please check you don't have HotModuleReplacementPlugin in your plugins if you have hot: true/hot: "only"
  • [ ] webpack-dev-server v3 and webpack-dev-server v4 automatically inject webpack/hot/dev-server in your entry option when you set hot: true (except when you use injectHot for webpack-dev-server v3), please check you don't have webpack/hot/dev-server in your entry option
  • [ ] webpack-dev-server v3 and webpack-dev-server v4 automatically inject webpack-dev-server/client/index.js in your entry option (except when you use injectClient for webpack-dev-server v3), please check you don't have webpack-dev-server/client/index.js in your entry option
  • The hotOnly option was removed, if you need hot only mode, use { hot: 'only' } value.
  • contentBase/contentBasePublicPath/serveIndex/watchContentBase/watchOptions/staticOptions options were moved to static option
  • The rest are clearly not relevant to our code

React/ReactDOM

  • Make necessary upgrades to the dependencies of react-d3-graph (fork). Or maybe don't use react-d3-graph 😨.

16 -> 17

https://reactjs.org/blog/2020/10/20/react-v17.html

  • [ ] Changes to Event Delegation (hopefully this is not a problem, chris might be more qualified to judge this)
  • [ ] The onScroll event no longer bubbles to prevent common confusion.
  • [ ] React onFocus and onBlur events have switched to using the native focusin and focusout events under the hood, which more closely match React’s existing behavior and sometimes provide extra information
  • [ ] Capture phase events (e.g. onClickCapture) now use real browser capture phase listeners
  • [ ] timing of the useEffect cleanup function more consistent (hopefully useEffect is being used properly 😒)

17 -> 18

https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html

  • ReactDOM.render is no longer supported in React 18. Use createRoot instead.
  • unmountComponentAtNode to root.unmount

Cypress

@nafiz1001 nafiz1001 force-pushed the future-frontend branch 2 times, most recently from 4675300 to 8b19f5b Compare July 2, 2022 21:43
@nafiz1001 nafiz1001 changed the title Upgrade packages in the front-end Upgrade some packages in the front-end Jul 5, 2022
@nafiz1001
Copy link
Contributor Author

nafiz1001 commented Jul 5, 2022

My fork of react-d3-graph: https://github.com/nafiz1001/react-d3-graph

@nafiz1001 nafiz1001 marked this pull request as ready for review July 6, 2022 13:09
@nafiz1001 nafiz1001 marked this pull request as draft July 6, 2022 13:10
@nafiz1001 nafiz1001 marked this pull request as ready for review July 11, 2022 15:51
@nafiz1001 nafiz1001 marked this pull request as draft July 11, 2022 15:53
@nafiz1001 nafiz1001 marked this pull request as draft July 11, 2022 15:53
@nafiz1001 nafiz1001 marked this pull request as ready for review July 16, 2022 14:36
@nafiz1001 nafiz1001 marked this pull request as draft July 16, 2022 15:14
@nafiz1001 nafiz1001 marked this pull request as ready for review July 16, 2022 15:22
@nafiz1001 nafiz1001 added the enhancement New feature or request label Jul 22, 2022
@sebastianballesteros
Copy link
Contributor

sebastianballesteros commented Aug 1, 2022

There's a problem when accessing the actions routes, i.e. http://localhost:9000/samples/actions/0/ maybe related to path? Let me know if you have the same problem @UlysseFG @ckostiw, maybe it is my local setup.

@ckostiw
Copy link
Contributor

ckostiw commented Aug 2, 2022

As reported in Slack, there is a routing issue wit the user details page. Whenever we route to the page the page immediately routes back to wherever we routed from. For example, in the Users table, clicking on a user will route to the user details but then immediately route back to the Users table.

@ckostiw
Copy link
Contributor

ckostiw commented Aug 3, 2022

I pushed a fix for the "expected static flag was missing" react error in a ContainerDetails component, based on this issue: facebook/react#24391
The problem is that we were checking for an undefined container value and bailing before useEffect() was called. The fix is to first call useEffect() and then bail if necessary. Otherwise, when React renders the component, sometimes useEffect is called and sometimes it isn't, and that is not allowed in React.

@ckostiw
Copy link
Contributor

ckostiw commented Aug 3, 2022

Now we have this error in Container Details
Screen Shot 2022-08-03 at 4 44 55 PM

@ckostiw
Copy link
Contributor

ckostiw commented Aug 3, 2022

Also in Container Details

Screen Shot 2022-08-03 at 4 50 16 PM

@nafiz1001 nafiz1001 marked this pull request as draft August 4, 2022 15:04
@nafiz1001 nafiz1001 marked this pull request as ready for review August 4, 2022 15:34
@nafiz1001 nafiz1001 merged commit 35f694f into master Aug 16, 2022
@nafiz1001 nafiz1001 deleted the future-frontend branch April 23, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants