console icon indicating copy to clipboard operation
console copied to clipboard

feat(frontend): Migrate to react-router-dom v6 (WIP)

Open malinskibeniamin opened this issue 3 years ago • 2 comments

In short: v6.3.0 is a pain in the butt, but v6.4.0 is even worse (!), because they are hiding the history object completely! That means you rely on abstractions and they handle everything internally within the library. Read more here if you are curious... or save yourself the headache and stay away (for now).

Changes

  1. Removed HistorySetter in favour of history.provider.ts like we do in the Cloud UI
  2. Used unstable_HistoryRouter to match Cloud UI
  3. Used new hooks wherever possible
  4. Used history provider for non-functional components
  5. Fixed props problems for components (see below) where possible
  6. Removed Switch in favour of Routes
  7. Removed exact prop (this is no longer needed in v6, but nested routes should have route/* * wildcard)

WIP <Route> component which accepts props needs to receive them either via query params with useQueryParams (only in hooks) or useRouteMatch (for any matching route, also only for functional components). Did not fix any tests

See links: https://reactrouter.com/en/6.4.0/upgrading/v5 https://reactrouter.com/en/v6.3.0/getting-started/concepts

malinskibeniamin avatar Sep 20 '22 11:09 malinskibeniamin

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 20 '22 11:09 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 20 '22 11:09 CLAassistant

@malinskibeniamin Hey Ben, is this still WIP or can I close this PR?

weeco avatar Dec 11 '22 11:12 weeco