MetaMask / MetaMask/core

Non-controller classes with empty state should not inherit from `BaseController`

Open
#4,432 0 comments 0 reactions 0 assignees View on GitHub
Epic team-wallet-framework wf-non-controller-cleanup
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

## Current controller classes with empty state

- [x] #4072
- [x] #4433
- [ ] #4434
- [ ] #4435

## Requirements

- Should not inherit from `BaseControllerV1` or `BaseController`.
- Should not use the `Controller` suffix in its name.
- Types for `ControllerState`, `ControllerGetStateAction`, `ControllerStateChangeEvent` should not be defined or exported.
- Should accept `messenger` as a constructor option.
- `messenger` should be defined with allowlists that enable the class to make all communications with other controller classes that were previously supported.
- Should not accept any class method callbacks as constructor options. Messenger actions/events should be used to communicate instead.
- In some cases, methods that implement API interactions should be extracted into a dedicated `service` class.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the related controller work in #4072, #4433, #4434, and #4435 to identify which class this issue covers and how existing communication works. The refactor is done when the class meets the listed inheritance, naming, state-type, messenger, callback, and service-extraction requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.