Skip to content

chore(selectors): remove unused selector imports - #47637

Merged
georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-selectors-imports-20261105
Nov 6, 2026
Merged

georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-selectors-imports-20261105

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes two unused imports reported by tsc --noUnusedLocals. infuraProjectId remains the live constant in shared/constants/network.ts; only the unused import in the multichain network selectors is removed. ProductType remains used by subscription hooks; only the unused import in ui/selectors/subscription/subscription.ts is removed.

Owner set: none (no CODEOWNERS match for any touched file).

path removed (file / symbol / class) why dead
ui/selectors/multichain/networks.ts infuraProjectId import unused local
ui/selectors/subscription/subscription.ts ProductType import unused local

Whole-repo whole-word search: remaining infuraProjectId hits are the live constant, its callers, and docs/fixtures. Remaining ProductType hits are other files that import the type themselves. Open PRs mention infuraProjectId in unrelated diffs; none edit these two files, and none mention ProductType. infuraProjectId import blame is 2026-03-02 (file last changed 2026-08-17). ProductType import blame is 2025-09-24 (file last changed 2026-06-12). No user-facing behavior change.

Checks passed: yarn lint:tsc, eslint on the touched files, and yarn test:unit --coverage=false for ui/selectors/multichain/networks.test.ts and ui/selectors/subscription/subscription.test.ts with no snapshot updates.

Docs/comments updated: none

Changelog

CHANGELOG entry: null

Related issues

Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948)

Manual testing steps

N/A — deletes unreachable code. There is no user-facing behavior to click through.

Screenshots/Recordings

N/A — no UI change

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Import-only cleanup with no runtime or type surface changes beyond satisfying the compiler.

Overview
Removes unused imports flagged by tsc --noUnusedLocals in two selector modules, with no logic or export changes.

In ui/selectors/multichain/networks.ts, the infuraProjectId import from shared network constants is dropped; the file still uses CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP, and infuraProjectId remains defined and used elsewhere in the repo.

In ui/selectors/subscription/subscription.ts, the unused ProductType import from @metamask/subscription-controller is removed; subscription selectors still rely on PRODUCT_TYPES, Subscription, and related types.

Reviewed by Cursor Bugbot for commit 46b2290. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@georgewrmarshall georgewrmarshall added team-design-system All issues relating to design system in Extension and removed size-XS labels Nov 5, 2026 — with Cursor
@georgewrmarshall georgewrmarshall self-assigned this Nov 5, 2026
@metamask-ci

metamask-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor
Builds ready [46b2290]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42002570545 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↓ loadNewAccount/inp: -10%
  • ↑ loadNewAccount/fcp: +12%
  • ↑ loadNewAccount/cls: +282%
  • ↑ confirmTx/longTaskTotalDuration: +55%
  • ↑ confirmTx/longTaskMaxDuration: +79%
  • ↑ confirmTx/tbt: +93%
  • ↑ confirmTx/fcp: +13%
  • ↑ bridgeUserActions/bridge_load_page: +58%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +99%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +86%
  • ↑ bridgeUserActions/tbt: +96%
  • ↑ bridgeUserActions/total: +13%
  • ↑ bridgeUserActions/fcp: +11%
  • ↑ bridgeUserActions/lcp: +11%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↓ loadNewAccount/inp: -18%
  • ↑ loadNewAccount/fcp: +22%
  • ↑ loadNewAccount/lcp: +1252%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -21%
  • ↑ confirmTx/fcp: +22%
  • ↑ confirmTx/lcp: +1329%
  • ↑ bridgeUserActions/bridge_load_page: +210%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +100%
  • ↓ bridgeUserActions/bridge_search_token: -10%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +35%
  • ↑ bridgeUserActions/inp: +62%
  • ↑ bridgeUserActions/fcp: +14%
  • ↑ bridgeUserActions/lcp: +1327%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
  • 🟡 loadNewAccount/FCP: p75 2.1s
  • 🟡 confirmTx/FCP: p75 2.1s
  • 🟡 bridgeUserActions/FCP: p75 2.0s
  • 🟡 bridgeUserActions/LCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -32%
  • ↓ startupStandardHome/load: -34%
  • ↓ startupStandardHome/domContentLoaded: -34%
  • ↓ startupStandardHome/domInteractive: -25%
  • ↓ startupStandardHome/firstPaint: -22%
  • ↓ startupStandardHome/backgroundConnect: -36%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -64%
  • ↓ startupStandardHome/loadScripts: -35%
  • ↑ startupStandardHome/setupStore: +30%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↓ startupStandardHome/longTaskTotalDuration: -40%
  • ↓ startupStandardHome/longTaskMaxDuration: -38%
  • ↓ startupStandardHome/tbt: -43%
  • ↓ startupStandardHome/inp: -24%
  • ↓ startupStandardHome/fcp: -34%
  • ↓ startupStandardHome/lcp: -22%
  • ↑ startupStandardHome/cls: +400%
  • ↓ startupStandardHome/uiStartup: -39%
  • ↓ startupStandardHome/load: -36%
  • ↓ startupStandardHome/domContentLoaded: -38%
  • ↓ startupStandardHome/domInteractive: -55%
  • ↓ startupStandardHome/backgroundConnect: -28%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -37%
  • ↑ startupStandardHome/setupStore: +41%
  • ↓ startupStandardHome/fcp: -51%
  • ↓ startupStandardHome/lcp: -34%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +33%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +36%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +36%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +23%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -91%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -73%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/srpButtonToPwForm: -18%
  • ↓ onboardingNewWallet/createPwToRecoveryScreen: -21%
  • ↓ onboardingNewWallet/skipBackupToMetricsScreen: -13%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -38%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -76%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -73%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -61%
  • ↓ dappPageLoad/domContentLoaded: -19%
  • ↓ dappPageLoad/firstPaint: -42%
  • ↓ dappPageLoad/firstContentfulPaint: -42%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.24 MiB +131 Bytes 0.00%
✅ ui 19.34 MiB +68 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +1 Bytes 0.00%
✅ content scripts 3.22 MiB +2 Bytes 0.00%
✅ unzipped 79.65 MiB +207 Bytes 0.00%
✅ zip 23.81 MiB -9 Bytes 0.00%

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 093b11a Nov 6, 2026
266 of 269 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/remove-dead-code-selectors-imports-20261105 branch November 6, 2026 07:32
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
@metamaskbot metamaskbot added the release-13.58.0 Issue or pull request that will be included in release 13.58.0 label Nov 16, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.58.0 on PR, as PR was added to branch 13.58.0 when release was cut.

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.58.0 Issue or pull request that will be included in release 13.58.0 team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants