tobimori / kirby-icon-field

🏷️ A simple Icon field plugin for Kirby CMS.
https://getkirby.com/plugins/tobimori/icon-field
MIT License
37 stars 3 forks source link

Lazy-loading icons #14

Open nilshoerrmann opened 9 months ago

nilshoerrmann commented 9 months ago

Last one (sorry for filling your issues here!):

We have a large collection of icons which will always be loaded in full on page load (3.5 MB in our case). It would be great if icons would only be fetched when opening the picklist and if there was server side filtering applied.

I know this is an issue of the core as well, see https://github.com/getkirby/kirby/issues/6043, but I think with icon sets this will become an issue for this plugin quicky.

tobimori commented 9 months ago

I'll probably not implement this until its either addressed in core or there's some other easy way to do this that doesn't involve moving away from the Core Multiselect/Tags field structure, as I don't really have a use case for this in my own projects and this would add a lot of extra complexity to the plugin (I mostly only allow a selection of icons if using a pack, or icons are designed by us anyway). I'm willing to work on a funded feature request if this is a blocker for your project.

tobimori commented 9 months ago

You could try using a SVG sprite which should minimize the initial payload.

nilshoerrmann commented 9 months ago

I totally understand that :+1: It's not a problem for us right now because we can reduce the provided icons in this particular project.