You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swap UnoCSS for unplugin-icons to restore FE hot reload
- UnoCSS's dev plugin was regenerating `virtual:uno.css` on every Svelte save, trickling through the root layout and triggering SvelteKit's TDZ crash (sveltejs/kit#15287). Root-layout HMR became unreliable across the app.
- `unplugin-icons` (v23.0.1) with `@iconify-json/lucide` replaces UnoCSS. Icons are inline SVG Svelte components imported as `~icons/lucide/{name}` — tree-shaken, no runtime JS beyond the SVG itself, no virtual-CSS module in the HMR path.
- Updated the three users (`ErrorPane`, `FullList`, `SelectionInfo`), sizing via explicit `width`/`height` props and coloring via a wrapping `<span>` with a scoped class (same `currentColor` mechanic as before).
- Removed `unocss`, `@unocss/preset-icons`, `uno.config.ts`, the `virtual:uno.css` import, and the icon-class entries in `scripts/check-css-unused/allowlist.go`.
- Added `src/unplugin-icons.d.ts` for the `~icons/*` virtual module types; registered the `Icons()` plugin in `vite.config.js` and `vitest.config.ts`; added `ignoreUnresolved: ["~icons/.+"]` to `knip.json`.
- `hmr-recovery.ts` stays in place — it's defense-in-depth against any future root-layout HMR TDZ crash, not specific to UnoCSS.
- Docs refreshed: `AGENTS.md`, `docs/style-guide.md` § Icons, and the three colocated `CLAUDE.md` files.
0 commit comments