carbon-icons-svelte
carbon-icons-svelte copied to clipboard
Package optimizations
From: https://github.com/carbon-design-system/carbon-components-svelte/issues/1613#issuecomment-1374991547
Looking at packaging options, I looked into unplugin-icons for Iconify. I see the full Carbon icon set is provided by Iconify and there's a Svelte implementation: https://icon-sets.iconify.design/carbon/4k/. Perhaps consumers of carbon-components-svelte can have the privilege of choice; they may:
- Consume the forthcoming carbon-icons-svelte featuring the full Carbon icon set in node_modules
- Use unplugin-icons, giving you options to use Iconify-hosted icons or have Vite process them and be bundled in shipped code via the ?raw suffix
- Use Iconify's Svelte implementation to use their CDN-hosted icons that includes the Carbon icon set
Folks with certain enterprise restrictions should be able to determine which would work best for them, and we can help document the pros and cons of each option.
And: https://github.com/carbon-design-system/carbon-components-svelte/issues/1561#issuecomment-1324287340
It may be worth thinking about how carbon-icons-svelte is setup. I've been using svelte-awesome for icons and it is very fast as it only has ~5 .svelte files. That could possibly be a better approach than generating lots of .svelte files
Ideally, we want to ship a single Icon.svelte component that can return inlined SVGs via @html. This should improve vite dev performance.