Closed mattpolito closed 4 months ago
I agree with the file bloat sentiment. I worry that splitting into multiple gems may be cumbersome for the author(s). Honestly, it would be awesome if the installation script could pull from source and vendor the icons in the parent application. This would have the added benefit of making it easier to manage changes when the icon libraries inevitably release new icons
I was about to bring this up, so thanks @mattpolito! It's been on my mind before creating this gem. 😬
(Edit: related, not sure if/when loading thousands of svg's, from multiple libraries, becomes an issue)
The options so far are:
I personally lean mostly towards option 2. Could work pretty seamlessly with an install generator (which libraries do you want? [herocions, lucide, all]
)
How about using rake tasks to install icon libraries? That gets rid of bloat in the gem itself, and lets each user decide which library or libraries they want to make use of. The rake tasks could pull the icons and install them into local assets. Unless you expressly want to keep the icons out of peoples git repos?
This is more of a discussion than an issue.
I love the idea of a common interface for the libraries but after implementing Lucide, I realized that with each new set added we'll also get bloat. I almost think the libraries should be extracted into their own gems with the icon set and config with the main gem being the interface.
That way if i want to only use heroicons, I'd add rails_icons-heroicons to my gemfile but if i wanted to have a mix i could also add rails_icons-lucide, or any additional combination.
With that design change the end user doesn't have to deal with a bunch of extra file size from items they never intend to use.
Thoughts?