lucide-icons / lucide

Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.
https://lucide.dev
ISC License
10.42k stars 469 forks source link

Add a Svelte/Vite preprocessor #2295

Open WarningImHack3r opened 2 months ago

WarningImHack3r commented 2 months ago

Package

Description

Since #1707, granular imports are now supported. This is great, but it can become tedious to browse all the existing components, check the imports, and rewrite them manually. It also clutters the imports, and IDEs tend to auto-import the unoptimized version instead of the right one. Moreover, in larger projects, it is easy for an inexperienced contributor to accidentally use the old global import. You only need one such mistake to slow down your entire project again.

I just stumbled upon a solution that solves that: preprocessors. The phosphor-svelte community package offers one because this library suffers from the same problem Lucide does. This solution is the best of both worlds: it's transparent to the user, does nothing if the right syntax is already used, and brings the performance gains to codebases of every size for relatively no cost.

It's even potentially expandable to every single Vite-based framework, though for the moment I'd focus on Svelte.

My request is: are you okay with me submitting this subpackage (lucide-svelte/preprocessor) in a PR?

Use cases

Every single Svelte project, especially the largest ones. Potentially expandable to every Vite-based framework.

Checklist

WarningImHack3r commented 1 month ago

Update: I made it (I still think having it built-in would be better)