Skip to content

fix(icons): draw everything from one Iconify set - #290

Closed
pathscale wants to merge 1 commit into
masterfrom
fix/one-icon-set
Closed

fix(icons): draw everything from one Iconify set#290
pathscale wants to merge 1 commit into
masterfrom
fix/one-icon-set

Conversation

@pathscale

Copy link
Copy Markdown
Owner

A consumer installs icon sets itself, so every set this library reaches for is a set the consumer has to know to install. Nothing stated that requirement, and nothing failed loudly when it was unmet — the build printed Cannot load icon set for "mdi" among its warnings and the icon rendered as empty space.

Where it showed up

crates.vip installs @iconify-json/lucide, which is what the fleet uses. Five icons in this library were mdi, across LanguageSwitcher, ThemeColorPicker, MobileListView and the Firefox PWA banner. All five were blank, and the only signal was five identical warnings in a build log that also prints unrelated ones.

The library develops against @iconify/json — the whole collection — so it can never see this for itself. That is why the fix comes with a test rather than a correction.

The change

Four had direct lucide equivalents:

was now
mdi--palette lucide--palette
mdi--loading lucide--loader-circle
mdi--inbox-outline lucide--inbox
mdi--close lucide--x

The fifth is the Firefox brand mark, and lucide has no brand glyphs. Rather than oblige every consumer to install all of @iconify-json/mdi for one banner in one optional component, it becomes FirefoxPWABanner.icon with no default: supply it and pay for the set, or omit it and the banner renders without a mark. It accepts what Icon accepts, so an inline SVG works too.

The verifier

tests/components/single-icon-set.test.ts walks the source for icon-[set--name] and fails on any set but lucide. It skips comment lines, so the doc comment that names mdi in prose does not trip it, and it asserts a floor on the number of references it found so a broken walk cannot pass silently — that guard immediately caught my own wrong count.

Reintroducing one mdi icon fails it by file name:

"mdi: src/components/table/MobileListView.layout.tsx"

Verification

Check Result
bun run test 188 pass, 0 fail (2 new)
The new test with one mdi icon restored fails, naming the file
bunx tsc --noEmit clean
bun run check:api clean, after documenting the new prop

Release

Third fix wanted in 3.1.1, with #288 and #289. All three are independent.

A consumer installs icon sets itself, so every set this library reaches for is
a set the consumer has to know to install. Nothing stated the requirement and
nothing failed loudly when it was unmet: the build printed
`Cannot load icon set for "mdi"` among its warnings and the icon rendered as
empty space.

crates.vip installed `@iconify-json/lucide`, which is what the fleet uses.
Five icons were `mdi` -- in `LanguageSwitcher`, `ThemeColorPicker`,
`MobileListView` and the Firefox banner -- and all five were blank. This
library develops against `@iconify/json`, the whole collection, so it could
never see that.

Four had direct lucide equivalents and were converted. The fifth is the Firefox
brand mark, and lucide has no brand glyphs, so it becomes a prop on
`FirefoxPWABanner` with no default: a consumer who wants it supplies it and
installs the set it needs, and everyone else pays nothing for a banner they
never render.

The verifier walks the source for `icon-[set--name]` and fails on any set but
`lucide`, skipping comment lines so the one that names `mdi` in prose does not
trip it. Reintroducing a single `mdi` icon fails it by file name.
@pathscale

Copy link
Copy Markdown
Owner Author

Rolled into #289 so the four fixes ship as one release. The commit is unchanged.

@pathscale pathscale closed this Sep 8, 2026
@pathscale
pathscale deleted the fix/one-icon-set branch September 12, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant