Rails-Designer / rails_icons

Add SVG icons from multiple libraries, or your own custom icon set, with this one gem
https://railsdesigner.com/rails-icons/
MIT License
21 stars 2 forks source link

Library design #6

Open mattpolito opened 2 weeks ago

mattpolito commented 2 weeks ago

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?

avogel3 commented 2 weeks 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

eelcoj commented 2 weeks ago

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:

  1. separate gem per icon library (https://github.com/Rails-Designer/rails_icons/issues/6#issue-2269025553)
  2. pull icons from our source (https://github.com/Rails-Designer/rails_icons/issues/6#issuecomment-2082958123)
  3. pull icons from their source (eg. most icon libraries are hosted on GitHub)
  4. …

I personally lean mostly towards option 2. Could work pretty seamlessly with an install generator (which libraries do you want? [herocions, lucide, all])