lucide-icons/lucide

Add a Svelte/Vite preprocessor

Closed this issue · 2 comments

Package

  • lucide
  • lucide-angular
  • lucide-flutter
  • lucide-preact
  • lucide-react
  • lucide-react-native
  • lucide-solid
  • lucide-svelte
  • lucide-vue
  • lucide-vue-next
  • Figma plugin
  • all JS packages
  • site

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

  • I have searched the existing issues to make sure this bug has not already been reported.

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

Closing in favor of #1944