Skip to content

chore(shared): remove unused shared lib exports - #47610

Merged
georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-shared-lib-20261104
Nov 5, 2026
Merged

georgewrmarshall merged 1 commit into
mainfrom
cursor/remove-dead-code-shared-lib-20261104

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes five exported helpers and constants in shared/lib that nothing in the repo imports. shared/lib/translate.ts keeps updateCurrentLocale and t; only its unused getCurrentLocale getter goes (the Redux selector of the same name in ui/ducks/locale/locale.ts is a separate, live function). The other REDEEM_DELEGATIONS_SELECTOR hits in the repo are separate local constants in ui/pages/confirmations/utils/confirm.ts and an e2e spec; they are untouched.

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

path removed (file / symbol / class) why dead
shared/lib/translate.ts getCurrentLocale unused export
shared/lib/conversion.utils.ts getEthConversionFromWeiHex unused export
shared/lib/delegation/utils.ts isHexEqual unused export
shared/lib/delegation/delegation.ts REDEEM_DELEGATIONS_SELECTOR unused export
shared/lib/shield/constants.ts SHIELD_CAROUSEL_ID unused export

Every removed item was proven with a whole-repo whole-word search (only the definition matched), checked against the diffs of all open PRs (none reference these names or edit these files), and is older than the 60-day waiting window. No user-facing behavior change.

Checks passed: yarn lint:tsc, eslint on the touched files, yarn test:unit for the touched directories with no snapshot updates, and tsc --noUnusedLocals shows no remaining unused locals in the touched files.

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
Deletes unreachable code only; no runtime paths or public API consumers are affected.

Overview
Removes five unused exports from shared/lib after repo-wide verification that nothing imports them. No call sites or behavior change.

Deleted symbols: getEthConversionFromWeiHex (conversion.utils.ts), isHexEqual (delegation/utils.ts), REDEEM_DELEGATIONS_SELECTOR (delegation/delegation.ts — separate local constants elsewhere stay), SHIELD_CAROUSEL_ID (shield/constants.ts), and getCurrentLocale from translate.ts (UI still uses the Redux selector in ui/ducks/locale/locale.ts).

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

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions github-actions Bot added the size-S label Nov 4, 2026
@metamask-ci metamask-ci Bot added the team-design-system All issues relating to design system in Extension label Nov 4, 2026
@metamask-ci

metamask-ci Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor
Builds ready [ac5fcc5]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)

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

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingNewWallet
[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: +178%
  • ↑ loadNewAccount/total: +178%
  • ↓ loadNewAccount/inp: -33%
  • ↓ loadNewAccount/fcp: -31%
  • ↓ loadNewAccount/lcp: -15%
  • ↑ loadNewAccount/cls: +278%
  • ↓ confirmTx/tbt: -11%
  • ↓ confirmTx/inp: -44%
  • ↓ confirmTx/fcp: -31%
  • ↓ confirmTx/lcp: -18%
  • ↓ bridgeUserActions/longTaskTotalDuration: -30%
  • ↓ bridgeUserActions/longTaskMaxDuration: -36%
  • ↓ bridgeUserActions/tbt: -61%
  • ↓ bridgeUserActions/inp: -19%
  • ↓ bridgeUserActions/fcp: -27%
  • ↓ bridgeUserActions/lcp: -17%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +184%
  • ↑ loadNewAccount/total: +184%
  • ↓ loadNewAccount/inp: -25%
  • ↑ loadNewAccount/fcp: +24%
  • ↑ loadNewAccount/lcp: +1250%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/fcp: +26%
  • ↑ confirmTx/lcp: +1349%
  • ↑ bridgeUserActions/bridge_load_page: +204%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +141%
  • ↑ bridgeUserActions/bridge_search_token: +26%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +61%
  • ↑ bridgeUserActions/inp: +62%
  • ↓ bridgeUserActions/fcp: -37%
  • ↑ bridgeUserActions/lcp: +1244%

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

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

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/domInteractive: +12%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/setupStore: +127%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↑ startupStandardHome/cls: +400%
  • ↓ startupStandardHome/domInteractive: -29%
  • ↑ startupStandardHome/backgroundConnect: +12%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +143%
  • ↓ startupStandardHome/fcp: -26%
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]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +46%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +58%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +38%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +19%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -11%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -78%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -74%
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: -48%
  • ↓ dappPageLoad/firstPaint: -28%
  • ↓ dappPageLoad/firstContentfulPaint: -28%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB +128 Bytes 0.00%
✅ ui 19.33 MiB +63 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.64 MiB +196 Bytes 0.00%
✅ zip 23.81 MiB +57 Bytes 0.00%

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@georgewrmarshall georgewrmarshall removed the size-S label Nov 4, 2026 — with Cursor
@georgewrmarshall georgewrmarshall self-assigned this Nov 4, 2026
@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit d30ae5a Nov 5, 2026
268 of 270 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/remove-dead-code-shared-lib-20261104 branch November 5, 2026 04:22
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
@metamaskbot metamaskbot added the release-13.57.0 Issue or pull request that will be included in release 13.57.0 label Nov 9, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.57.0 on PR, as PR was added to branch 13.57.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.57.0 Issue or pull request that will be included in release 13.57.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