Skip to content

Remove unused components #4776

Description

@VariableVince

Purpose

  • Remove unused components, fix one code smell which looks like an unused component because of it

Objectives

Less unused code lines.

Description

Remove 3 unused components and their now-unused imports, fix 1 code smell

google-ad (GoogleAdElement.ts) — deleted

Direct Google AdSense integration that predated the Playwire RAMP migration. No code in the current codebase references adsbygoogle, <google-ad>, or GoogleAdElement — zero traces of AdSense remain. All ad serving goes through Playwire's window.ramp API (spaAddAds, addUnits).

matchmaking-button (Matchmaking.ts) — deleted

An unused Lit component sitting alongside the active matchmaking-modal in the same file. The actual ranked flow is:

  • "Ranked" button rendered in GameModeSelector.ts:228-232 (desktop) and :147-151 (mobile)
  • Click calls openRankedMenu() (:248) → window.showPage("page-ranked") → opens <ranked-modal>
  • Clicking 1v1/2v2 dispatches open-matchmaking → opens <matchmaking-modal> directly

MatchmakingButton was never imported or instantiated anywhere.

news-button (NewsModal.ts) — deleted

An unused Lit component alongside the active news-modal. The actual News button is in DesktopNavBar.ts:78-84 and MobileNavBar.ts:101, both with data-page="page-news" which routes to <news-modal> via the modal router. NewsButton was never imported, instantiated, or placed in the DOM.

main-radial-menu (MainRadialMenu.ts) — fixed code smell

Extended LitElement with @customElement("main-radial-menu") but had no render() method — all rendering was delegated to a separate RadialMenu Controller. Never used as a DOM custom element (no template usage, never dynamically appended). Only ever instantiated via new MainRadialMenu(...) in GameRenderer.ts:301 and used through the Controller interface. Removed the LitElement/@customElement baggage since they were misleading dead weight.

Removals from LangSelector.ts

Both "matchmaking-button" and "news-button" were listed in the components array used for i18n re-rendering (:287-293). Since these elements never exist in the DOM, querySelectorAll returned empty for them — harmless but misleading. Removed.

Assignment

  • I'd like to be assigned to this issue and work on it myself

tryout33

Metadata

Metadata

Assignees

Labels

approvedApproved for a PR, if you assigned to the issue.

Type

Projects

Status
Triage

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions