MetaMask / MetaMask/metamask-extension
[State Sync Redesign 3.5] Annotate high-frequency selectors with `controllerDeps`
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Add `controllerDeps` to the ~308 selectors. No logic changes. One-line annotation per selector.
## Priority (by dispatch frequency)
1. Network-related: `getCurrentChainId`, `getProviderConfig`, `getNetworkConfigurationsByChainId`
2. Account-related: `getSelectedInternalAccount`, `getInternalAccounts`, `getMetaMaskAccounts`
3. Preferences: `getPreferences`, `getTokenSortConfig`
4. Tokens: `getTokens`, `getAllTokens`, `getTokenList`
5. Transactions: `getUnapprovedTransactions`, `getCurrentNetworkTransactions`
## Steps
1. Identify all selectors by `useSelector` call count
2. Add `controllerDeps` annotation to each
3. Validate annotations against actual state property reads
## Files
- `ui/selectors/selectors.js`
- `ui/selectors/*.ts`
## Dependencies
Issue 3.4
## Context
Part of [State Sync Redesign — Epic 3: UI-controller subscriptions].
Contributor guide
Research direction
Start with ui/selectors/selectors.js and the selectors in ui/selectors/*.ts, then identify selectors by useSelector call count, prioritizing the listed high-frequency selectors. Check each annotation against its actual state property reads; the work is done when the targeted selectors have controllerDeps annotations without logic changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100