mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
* perf(frontend): subset the mdi icon font to the icons the app uses #5118 trimmed the icon CSS, but the font file still held every glyph (403 KB) and the build still copied the eot, ttf and woff formats. The build plugin now also cuts the woff2 down to the code points of the rules it keeps, and the stylesheet's only font source is that file. Build only: dev keeps the full font, so a newly used icon renders without a restart. Font in the build: 403,216 B -> 25,504 B, and the three unused formats are no longer emitted. Adds subset-font and @types/subset-font as dev dependencies. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * chore(frontend): lint against building mdi icon names at runtime The build keeps only the icon glyphs whose names appear in full in src/, so `mdi-${name}` or "mdi-" + name would render an empty square in production. romm/no-dynamic-mdi-name reports both forms in scripts and Vue templates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * chore(frontend): drop the mdi font subsetting, keep the lint rule The browser caches the full icon font after the first load, so subsetting it only saves about 360 KB on a cold cache. That doesn't justify two new dev dependencies and a build step that writes into node_modules. The rule that rejects runtime-built icon names still protects the existing CSS trim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(frontend): flag mdi icon names split across string literals Addresses Greptile's review: "mdi-" + "home" passed the rule, but the build only finds icon names written in full, so that icon lost its CSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(frontend): type isStringLiteral as a type guard vue-tsc rejected reading .value off the narrowed BinaryExpression side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(frontend): catch mdi names split across + chains and templates pr-ready step 2 (code-review xhigh). The rule now reads the static text at each end of a join, so `base + " mdi-" + name` and `mdi-` + name are reported, while "mdi-home" + " " + tone stays valid. The word boundary no longer treats `_` as a separator, and the test reuses a shared sfcTemplate helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(frontend): share the SFC test wrapper, inline isStringLiteral pr-ready step 3 (simplify). sfc and sfcTemplate now build their case through one vueCase helper, isStringLiteral is inlined into its only caller, and the rule points at the build's ICON_NAME so the two character classes stay in step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(frontend): fail the build on mdi names @mdi/font does not define The icon trim keeps only names written in full in src/, so a name built at runtime, or one @mdi/font never had, renders blank in production. The build now lists each mdi-* token outside tests that names no class in the stylesheet, with its file and line, and stops. That covers what the lint rule cannot see: names joined through a variable, .concat, or +=, and plain typos. The check found mdi-playstation in the RSelect story, which @mdi/font 7 does not have; it is now mdi-sony-playstation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>