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

fix: Perf: Prevent MultipleNotifications rerenders #30288

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

darkwing
Copy link
Contributor

@darkwing darkwing commented Feb 13, 2025

Description

The MultipleNotifications component rerenders on a non-matching array of null values. This prevents that issue.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

@darkwing darkwing requested a review from a team as a code owner February 13, 2025 03:53
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.

@metamaskbot
Copy link
Collaborator

Builds ready [52da8c7]
Page Load Metrics (1795 ± 93 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29221381630479230
domContentLoaded15012118176419392
load15102136179519393
domInteractive25108452411
backgroundConnect973342512
firstReactRender1574372411
getState45821199
initialActions00000
loadScripts10901544129315876
setupStore7281142
uiStartup164524742041234113
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 42 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

{t('newNetworkAdded', [newNetworkAddedName])}
const items = [
newNftAddedMessage === 'success' ? (
<ActionableMessage
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya Feb 13, 2025

Choose a reason for hiding this comment

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

Hmmm I need to do some reading, but now that this is an array of JSX elements, shouldn't we give these a key field to ensure that React effectively manages (reconciles) items in this list?

salimtb
salimtb previously approved these changes Feb 13, 2025
NidhiKJha
NidhiKJha previously approved these changes Feb 18, 2025
@darkwing
Copy link
Contributor Author

@Prithpal-Sooriya Added keys! Good shout!

@metamaskbot
Copy link
Collaborator

Builds ready [7b12df4]
Page Load Metrics (1694 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14872150169314570
domContentLoaded14682127166614770
load14872147169414469
domInteractive157232105
backgroundConnect1168342010
firstReactRender1571372311
getState55816168
initialActions01000
loadScripts10831536122711053
setupStore86217189
uiStartup17262406192015374
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 164 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@darkwing darkwing added this pull request to the merge queue Mar 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 6, 2025
@darkwing darkwing added this pull request to the merge queue Mar 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 6, 2025
@darkwing darkwing added this pull request to the merge queue Mar 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 7, 2025
@darkwing darkwing added this pull request to the merge queue Mar 7, 2025
Merged via the queue into main with commit 0271117 Mar 7, 2025
75 checks passed
@darkwing darkwing deleted the MultipleNotificationsPerf branch March 7, 2025 18:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2025
@metamaskbot metamaskbot added the release-12.15.0 Issue or pull request that will be included in release 12.15.0 label Mar 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.15.0 Issue or pull request that will be included in release 12.15.0 team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants