Skip to content

feat: Convert mmi controller to a non-controller #27983

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

Merged
merged 10 commits into from
Nov 7, 2024

Conversation

kanthesha
Copy link
Contributor

@kanthesha kanthesha commented Oct 21, 2024

Description

We want to bring MMIController up to date with our latest controller patterns.

After review, it turns out that MMIController does not have any state and therefore should not inherit from BaseController (or anything, for that matter).

Open in GitHub Codespaces

Related issues

Fixes: #25926

Manual testing steps

N/A

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.

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.

@kanthesha kanthesha requested a review from a team October 21, 2024 10:48
@kanthesha kanthesha changed the title convert mmi controller to a non-controller feat: Convert mmi controller to a non-controller Oct 21, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [ce40ec1]
Page Load Metrics (2172 ± 161 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint37330182075515247
domContentLoaded172129492127313150
load173230102172335161
domInteractive2610047178
backgroundConnect9118353316
firstReactRender511611122412
getState6107262613
initialActions01000
loadScripts126623971596282135
setupStore13102302412
uiStartup193832532442409196
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@kanthesha kanthesha marked this pull request as ready for review October 21, 2024 11:59
@kanthesha kanthesha requested a review from a team as a code owner October 21, 2024 11:59
@kanthesha
Copy link
Contributor Author

The below part of the ticket is not covered at the moment because MetaMetricsController:getState doesn't exist yet!

MMIController no longer takes metaMetricsController as a constructor option.
It no longer reads the state directly from this controller, but uses the MetaMetricsController:getState action through the messenger to do so instead.

@metamaskbot
Copy link
Collaborator

Builds ready [78451b7]
Page Load Metrics (1861 ± 97 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint34023231612550264
domContentLoaded16002432183520599
load16102443186120297
domInteractive23195553718
backgroundConnect76731199
firstReactRender462921096632
getState44913136
initialActions01000
loadScripts11611877136218087
setupStore1167342411
uiStartup179627062103227109
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@cryptodev-2s
Copy link
Contributor

Can we add the missing types, even if they would have a value of never, to accurately reflect the original issue requirements? Alternatively, should we update the requirements to exclude those types?

The MMIControllerActions and MMIControllerEvents types exist.
The AllowedActions and AllowedEvents types exist.

@kanthesha
Copy link
Contributor Author

Can we add the missing types, even if they would have a value of never, to accurately reflect the original issue requirements? Alternatively, should we update the requirements to exclude those types?

The MMIControllerActions and MMIControllerEvents types exist.
The AllowedActions and AllowedEvents types exist.

Yeah, I think it'll make sense to update the requirements to exclude these types which are irrelevant here. I'll update it now.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Nice PR. Just had some comments on improved ways we could accomplish certain things.

@metamaskbot
Copy link
Collaborator

Builds ready [57c8a45]
Page Load Metrics (1670 ± 98 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint149524291673213102
domContentLoaded14852354164320598
load14972386167020598
domInteractive22167523316
backgroundConnect96030199
firstReactRender46283975125
getState47114199
initialActions01000
loadScripts106519731230211101
setupStore107318168
uiStartup164725581865245118
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [843328c]
Page Load Metrics (1977 ± 97 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint36726171892405194
domContentLoaded17392537194619694
load17892621197720397
domInteractive26148522713
backgroundConnect883342411
firstReactRender51212953416
getState666212110
initialActions01000
loadScripts12471934143618790
setupStore1381392612
uiStartup195428802200223107
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Noticed one more thing but after that this should be good!

@metamaskbot
Copy link
Collaborator

Builds ready [7f0ff01]
Page Load Metrics (1952 ± 109 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint158623491954232111
domContentLoaded157723001923213103
load158723511952228109
domInteractive287951178
backgroundConnect10120242612
firstReactRender46160913015
getState5117343215
initialActions01000
loadScripts11661737142216680
setupStore1182352512
uiStartup177828072191279134
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@kanthesha kanthesha added this pull request to the merge queue Nov 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2024
@DDDDDanica
Copy link
Contributor

LGTM, Thanks @kanthesha !

@kanthesha kanthesha added this pull request to the merge queue Nov 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 6, 2024
@kanthesha kanthesha added this pull request to the merge queue Nov 7, 2024
Merged via the queue into develop with commit 765c62e Nov 7, 2024
76 checks passed
@kanthesha kanthesha deleted the feat/convert-mmi-controller-to-non-controller branch November 7, 2024 15:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-wallet-framework
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Convert MMIController to a non-controller (without renaming it)
6 participants