metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

refactor: routes.component.js and creation of ToastMaster

Open HowardBraham opened this issue 4 months ago • 13 comments

Description

This PR is part of the larger effort to add React.lazy to routes.

I would be very surprised if I did not break functionality somewhere, as this was a large and tough refactor. It needs some good QA, and Harika has been doing some testing that has passed.

Summary of what I did:

  • Pulled all Toast-related logic out of routes.component.js and into the new ToastMaster
  • Pulled everything else I could pull out into routes-helpers.js
  • Moved things out of the general selectors.js and actions.ts into toast-master-selectors.ts
  • Simplification of some Pointless Thunks™

For later PRs:

  • Convert routes.component.js to TypeScript
  • Convert routes.component.js to Hooks
  • Convert routes.component.js to react-router v6
  • Eliminate routes.container.js

Open in GitHub Codespaces

Related issues

Progresses: MetaMask/MetaMask-planning#2898

Manual testing steps

Test all the Routes and all the Toasts

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

HowardBraham avatar Oct 09 '24 17:10 HowardBraham