Stress testing a WIP ts-svg feature: "only process used icons." I've got 5995 icons and don't want the dev server to pull everything into the browser, or builds to transform unused SVGs before tree-shaking.
Latest progress: dev stays fast, build is ~2s with 8/5995 icons used
Posts by Chun Nam Wong
But yeah, admittedly it adds side effects to the test case, so it needs some caution. For now I’ve disabled parallel runs and made sure it cleans up before the next run.
Just wrote tests for svg-ts. It was my first time setting up visual regression manually. One “wild” test even does `fs.writeFile` during the run to observe HMR. If I comment out my HMR handling logic, it hot reloads into a 500 error page and the snapshots fail. It's satisfying.
@ts-svg/svelte v0.0.1 is out 🎉
Type-safe SVG bundling #Vite Plugin — scans a folder and generates typed virtual modules, so you can import SVGs as #Svelte components with autocomplete:
import * as Icon from 'virtual:ts-svg/icons' → type <Icon. ✅
github.com/chunnamwong/...
Testing the reworked version of my SVG #Vite plugin with #SvelteKit. It focuses on simpler setup and better DX. Now, whenever I add a new icon to the folder, I just type `<Icon.` and boom, the ready-to-use component shows up in autocomplete.