Skip to content

perf(mobile): drop 87 unused harmony icon exports from the bundle - #14713

Merged
dylanjeffers merged 1 commit into
mainfrom
perf/mobile-harmony-icons
Oct 26, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
perf/mobile-harmony-icons

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

Metro doesn't tree-shake, so every icon re-exported from packages/mobile/src/harmony-native/icons.tsx (pulled in by export * from './icons' in harmony-native/index.ts) ships in the JS bundle whether mobile renders it or not.

I grepped packages/mobile/src and packages/mobile/examples for each exported name. 87 of the 234 exports are never referenced, and nothing looks icons up dynamically (no icons[name] or template-string lookups). This PR deletes those 87 export lines. The removed exports are:

  • all 37 IconFile* type icons
  • 8 extra CC license icons (IconCcNC_EU, IconCcPD, IconCcRemix, IconCcSampling*, …)
  • IconAudiusLogoHorizontalColor and IconAudiusLogoHorizontalColorNew: 61 KB of source, with embedded base64
  • IconAudiusLogoVertical, IconMetamask, IconFacebook, IconTelegram, IconLogoCircleUSD/USDC/STR, IconCoinGatedLabel, the Soundwave animation, IconPlaybackRate0_9x (not a PlaybackRate value), and assorted others

Harmony itself is unchanged. Web still gets every icon.

Numbers (iOS, react-native bundle --dev false --minify true)

before after Δ
main.jsbundle 13,272,559 B 12,910,037 B −362 KB (−2.7%)
gzip -9 3,138,026 B 3,050,045 B −88 KB
harmony/src/assets/icons (source-map-explorer) 700,522 B / 241 files 368,742 B / 155 files −332 KB

The icons left in the bundle are all small: the largest is JupiterLogo.svg at 6.5 KB. Running svgo on them wouldn't save much, so this PR doesn't.

Test plan

  • tsc in packages/mobile passes. Any import of a removed name would fail it.
  • eslint passes on icons.tsx
  • Built before/after iOS release bundles
  • Smoke test on the sim (now playing / playback rate, edit track → license, wallet / coin screens)

🤖 Generated with Claude Code

Metro doesn't tree-shake, so every icon re-exported from
harmony-native/icons.tsx ships in the JS bundle whether or not mobile
renders it. 87 of the 234 exports (file-type icons, extra CC license
icons, both color horizontal Audius logos, Metamask, Soundwave, etc.)
have no references in packages/mobile.

iOS release bundle: 13.27 MB -> 12.91 MB (-362 KB), gzip -88 KB.
Harmony icon bytes: 700 KB -> 369 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2cc86dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers merged commit 0fe88c5 into main Oct 26, 2026
3 checks passed
@dylanjeffers
dylanjeffers deleted the perf/mobile-harmony-icons branch October 26, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant