-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat: Convert AppStateController to typescript #27572
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
Conversation
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. |
Builds ready [23a89c3]
Page Load Metrics (1862 ± 100 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
This PR is blocked by PreferencesController upgrade to BaseControllerV2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to remove app/script/app-state.d.ts
now
Curious: why is this dependent on PreferencesController upgrade? |
It's not a complete blocker. But good to wait. AppStateController has a preferencesStore constructor param. In the mentioned PR, this has been updated with the preferencesState. So we don't have to worry about something which will be irrelevant once another PR merges. |
Builds ready [bfe0d3f]
Page Load Metrics (2035 ± 114 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [744300f]
Page Load Metrics (1893 ± 129 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…MetaMask/metamask-extension into feat/app-state-controller-to-typescript
|
Builds ready [dff8439]
Page Load Metrics (1905 ± 97 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -70,8 +69,6 @@ export default class MMIController extends EventEmitter { | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
public keyringController: any; | |||
|
|||
public preferencesController: PreferencesController; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related to AppStateController
?
I think that this PR joins the AppStateController
typescript conversion, an initial migration to BaseControllerV2, and also some post-merge work derived from PreferencesController
If that's correct, perhaps splitting these changes in multiple specific PR would make it easier to go through all the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in mmi-controller
were a small cleanup to remove the unused PreferencesController
, which I can remove from this PR. And as you mentioned, there is also some preliminary work to prepare for the V2 upgrade. This prep work should help when we take-up the upgrade ticket.
That said, if it complicates the review, I’m happy to remove these changes from this PR and handle them separately. Let me know what works best!
Builds ready [a958732]
Page Load Metrics (1824 ± 73 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -4,7 +4,6 @@ | |||
"app/scripts/constants/contracts.js", | |||
"app/scripts/constants/on-ramp.js", | |||
"app/scripts/contentscript.js", | |||
"app/scripts/controllers/app-state.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Builds ready [2e86cfe]
Page Load Metrics (2091 ± 126 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [ebe4f3d]
Page Load Metrics (1752 ± 85 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
As a prerequisite for migrating AppStateController to BaseController v2, and to support the TypeScript migration effort for the extension, we want to convert AppStateController to TypeScript along with its tests.
Related issues
Fixes: #25922
Manual testing steps
N/A
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist