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

chore: start upgrade to React Router v6 #27185

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Sep 17, 2024

Description

Following the Incremental Migration guide for React Router v6: remix-run/react-router#8753

All code changes are to fix lint:tsc errors.

Open in GitHub Codespaces

Related issues

Part of: https://github.com/MetaMask/MetaMask-planning/issues/2898
Part of: https://github.com/MetaMask/MetaMask-planning/issues/3302

Manual testing steps

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 HowardBraham added the team-tiger Tiger team (for tech debt reduction + performance improvements) label Sep 17, 2024
@HowardBraham HowardBraham self-assigned this Sep 17, 2024
@HowardBraham HowardBraham requested review from a team as code owners September 17, 2024 03:23
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions bot added the team-contributor-experience MetaMask Contributor Experience Group label Sep 17, 2024
Copy link

socket-security bot commented Sep 17, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Network access npm/@remix-run/[email protected] 🚫

View full report↗︎

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@HowardBraham HowardBraham removed the team-contributor-experience MetaMask Contributor Experience Group label Sep 17, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [532f6c1]
Page Load Metrics (1714 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint23521211582470226
domContentLoaded15202114169317182
load15292123171417383
domInteractive15213534321
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 150.75 KiB (2.10%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham force-pushed the start-upgrade-to-react-router-v6 branch 2 times, most recently from de7cd6a to c477a4d Compare September 17, 2024 04:45
Copy link

sonarcloud bot commented Sep 17, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [c477a4d]
Page Load Metrics (1833 ± 112 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27224551527616296
domContentLoaded154224471816229110
load157124581833232112
domInteractive15208535426
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 150.75 KiB (2.10%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.

Project coverage is 70.00%. Comparing base (33f430a) to head (c477a4d).

Files with missing lines Patch % Lines
ui/pages/asset/asset.tsx 0.00% 5 Missing ⚠️
...nts/app/assets/nfts/nft-details/nft-full-image.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #27185      +/-   ##
===========================================
- Coverage    70.00%   70.00%   -0.01%     
===========================================
  Files         1445     1445              
  Lines        50195    50199       +4     
  Branches     14041    14048       +7     
===========================================
- Hits         35139    35138       -1     
- Misses       15056    15061       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [058ecc7]
Page Load Metrics (1811 ± 97 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14992309180619995
domContentLoaded14902298178719594
load14972321181120297
domInteractive147936199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 150.72 KiB (2.07%)
  • common: 0 Bytes (0.00%)

matthewwalsh0
matthewwalsh0 previously approved these changes Sep 27, 2024
isEqualCaseInsensitive(address, asset) && id === tokenId.toString(),
address &&
asset &&
isEqualCaseInsensitive(address, asset) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is our util, could we update it to accept optional arguments and check both internally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The route problem was basically that the newer version of useParams started returning string | undefined

I did some research and found a better solution that removes the undefined

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few unnecessary type casts

ui/components/multichain/pages/connections/connections.tsx Outdated Show resolved Hide resolved
ui/pages/asset/asset.tsx Outdated Show resolved Hide resolved
@HowardBraham HowardBraham force-pushed the start-upgrade-to-react-router-v6 branch from 3013805 to 80ac2ea Compare October 1, 2024 07:52
@metamaskbot
Copy link
Collaborator

Builds ready [80ac2ea]
Page Load Metrics (1840 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15912091183615675
domContentLoaded15782037179914972
load15912075184015373
domInteractive19151513215
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 150.7 KiB (2.06%)
  • common: 0 Bytes (0.00%)

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@HowardBraham HowardBraham force-pushed the start-upgrade-to-react-router-v6 branch from 80ac2ea to e5b062e Compare October 1, 2024 20:17
Copy link

sonarcloud bot commented Oct 1, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [e5b062e]
Page Load Metrics (1774 ± 114 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint153424531773225108
domContentLoaded152523231739208100
load153224631774237114
domInteractive236839178
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 150.7 KiB (2.05%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything appears to be working as expected! Thank you!

@HowardBraham HowardBraham added this pull request to the merge queue Oct 2, 2024
Merged via the queue into develop with commit 9e4c648 Oct 2, 2024
79 of 80 checks passed
@HowardBraham HowardBraham deleted the start-upgrade-to-react-router-v6 branch October 2, 2024 16:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-tiger Tiger team (for tech debt reduction + performance improvements)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants