MetaMask / MetaMask/metamask-extension

[P2] selectors: extract MetaMetrics id + data-deletion selectors

Open
#44,570 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

exalate-duplicate INVALID-ISSUE-TEMPLATE mig-epic-71-child team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Parent Epic:** [#44566 — `selectors.js` decomposition](https://github.com/MetaMask/metamask-extension/issues/44566)
**Source:** `ui/selectors/selectors.js`
**Size:** S

---

## Problem

~6 selectors (`getAnalyticsId`, `getMetaMetricsDataDeletion{Id,Timestamp,Status}`, `getShowDeleteMetaMetricsDataModal`, `getShowDataDeletionErrorModal`) — plain state reads, no intra-file coupling.

## Solution

Fold into the existing `ui/selectors/metametrics.js` (extend, do not create a new module).

Migration seam (no barrel): repoint every site importing the moved selectors to `ui/selectors/` directly (a `ts-morph` codemod that splits any `../selectors` barrel imports into per-module imports) and delete them from `selectors.js` in the same PR — no re-export facade, per the no-barrel-files convention.

## Acceptance Criteria

- [ ] Selectors moved into `metametrics.js`; imports repointed directly to the module (no barrel). Tests green.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ui/selectors/selectors.js and ui/selectors/metametrics.js, then locate imports of the six selectors across the repository. Review the proposed ts-morph codemod approach for splitting barrel imports into direct module imports. Done means the selectors are in metametrics.js, all imports are direct, selectors.js no longer defines them, and tests are green.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.