MetaMask / MetaMask/metamask-extension
[P2] selectors: extract passkey selectors
- 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
4 selectors (`getIsPasskeyRegistered`, `getPasskeyDerivationMethod`, `getIsEnrolledPasskeyIncompatibleWithSidepanel`, `getIsPasskeyFeatureAvailable`) — external `shared/lib/passkey` + `getIsSocialLoginFlow` only. `passkey.test.ts` already exists.
## Solution
Create `ui/selectors/passkey.ts`.
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
- [ ] `passkey.ts`; imports repointed directly to the module (no barrel); pairs with existing test. Tests green.
Contributor guide
Research direction
Start with ui/selectors/selectors.js and the four passkey selectors listed in the issue, then inspect the existing passkey.test.ts. Create ui/selectors/passkey.ts, repoint importing sites directly to that module without a barrel, and remove the selectors from selectors.js. Run the passkey test and the relevant test suite to confirm all tests are green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100