Open joshuadavidthomas opened 6 months ago
Alternatively, as also discussed in #29, we could write a template loader that can load templates from a zip file and use https://github.com/adamchainz/heroicons for the icons, since that's how that package provides the icons. Obviously this would be a bit more complex, and would require the user to add the template loader to their settings, but it's something to think about.
Though looking at django-template-partials
source, it doesn't seem too difficult -- https://github.com/carltongibson/django-template-partials/blob/main/src/template_partials/loader.py
IMO, this package is a bit heavy for what it does -- provide an easy way to use Heroicons throughout your Wagtail admin. Odds are, someone doesn't need ALL the heroicons at their disposal, just a handful of either specific icons or just a specific style. Right now this package includes all of the heroicons for every style which adds roughly 2 MB to the package.
This will be further exacerbated when we start using Heroicons v2 (#48) as it has not two, but four different styles of icons. So it could go to up as much as 4 or 5 MB just for the SVG templates alone.
We could either go the route described in #29 and have a different namespace package for each icon style and have them installable via extras --
python -m pip install wagtail-heroicons[solid]
OR we could provide a way to opt in somehow to selecting individual icons. Perhaps a management command that allows someone to specifically select an icon to download and have it put in the templates directory of the user's project (or wherever they want it).