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

refactor: remove circular dependencies in ui/components/app/snaps folder #30022

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidmurdoch
Copy link
Contributor

@davidmurdoch davidmurdoch commented Jan 30, 2025

In snaps, COMPONENT_MAPPING imports all (most?) components, and these components then import a file with a function named mapToTemplate, which in turn imports COMPONENT_MAPPING. And round and round it goes.

This PR solved this:

First, we stop importing COMPONENT_MAPPING in mapToTemplate, and instead, pass COMPONENT_MAPPING to the component as a prop.

Then, whenever mapToTemplate is called, a COMPONENT_MAPPING must be given.

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 metamaskbot added the team-extension-platform Extension Platform team label Jan 30, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [2427690]
Page Load Metrics (1578 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29619611520305146
domContentLoaded13881949155711756
load14011960157811756
domInteractive15113432713
backgroundConnect95728178
firstReactRender1592382613
getState45513147
initialActions01000
loadScripts995141011298943
setupStore85213136
uiStartup16162154181414369
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 28 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [b9a429e]
Page Load Metrics (1769 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint39320021682311150
domContentLoaded15872161174513364
load15982167176913766
domInteractive266737115
backgroundConnect1086272110
firstReactRender1799432914
getState55821199
initialActions00000
loadScripts11031566127311254
setupStore85817178
uiStartup17972456206318086
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 28 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@davidmurdoch davidmurdoch marked this pull request as ready for review February 3, 2025 21:59
@davidmurdoch davidmurdoch requested a review from a team as a code owner February 3, 2025 21:59
@davidmurdoch davidmurdoch marked this pull request as draft February 3, 2025 22:16
@metamaskbot
Copy link
Collaborator

Builds ready [bff7bfe]
Page Load Metrics (1806 ± 67 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16252090181015173
domContentLoaded16092058176812962
load16232087180614067
domInteractive2592402010
backgroundConnect9183404019
firstReactRender16100352713
getState591222411
initialActions01000
loadScripts11081598128012962
setupStore776302512
uiStartup187428072133238114
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 28 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@davidmurdoch davidmurdoch changed the base branch from main to circles-metrics February 5, 2025 22:58
@metamaskbot
Copy link
Collaborator

Builds ready [f4cf334]
Page Load Metrics (1767 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26623001550528253
domContentLoaded14862225173218890
load14902305176720799
domInteractive24111422713
backgroundConnect8112353014
firstReactRender1597372512
getState48714178
initialActions01000
loadScripts10751729126116378
setupStore763242210
uiStartup173728002015263126

@metamaskbot
Copy link
Collaborator

Builds ready [8e3a1bb]
Page Load Metrics (1828 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24621031683454218
domContentLoaded15762088180213062
load15942102182812660
domInteractive24176413115
backgroundConnect115630168
firstReactRender1777352311
getState562252311
initialActions01000
loadScripts11031550132211455
setupStore85413105
uiStartup18152533211117685

@davidmurdoch davidmurdoch marked this pull request as ready for review February 6, 2025 22:57
@davidmurdoch davidmurdoch requested review from HowardBraham, dbrans and a team as code owners February 6, 2025 22:57
@davidmurdoch davidmurdoch changed the base branch from circles-metrics to main February 7, 2025 00:07
@davidmurdoch davidmurdoch requested review from a team as code owners February 7, 2025 00:07
@metamaskbot
Copy link
Collaborator

Builds ready [7f5a706]
Page Load Metrics (1988 ± 93 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26723061894418200
domContentLoaded15812225195018991
load16172287198819393
domInteractive278641157
backgroundConnect1069352010
firstReactRender17101482814
getState567242211
initialActions01000
loadScripts11341711143616680
setupStore86817178
uiStartup186930722318296142
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 28 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

HowardBraham
HowardBraham previously approved these changes Feb 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [0c4d93d]
Page Load Metrics (1867 ± 158 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26826211738552265
domContentLoaded146525221834323155
load147325471867329158
domInteractive2484482010
backgroundConnect1083382512
firstReactRender15100472914
getState585232512
initialActions00000
loadScripts104719221349272130
setupStore764222010
uiStartup172234902197474227
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 28 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-extension-platform Extension Platform team
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

3 participants