metonym / svelte-bootstrap-icons

Bootstrap SVG icons as Svelte components
https://metonym.github.io/svelte-bootstrap-icons/
MIT License
30 stars 2 forks source link

Support for Svelte 5 #38

Open MathiasWP opened 1 month ago

MathiasWP commented 1 month ago

Svelte 5 is out, and it would be really nice if this library supported Svelte 5

metonym commented 1 month ago

What is the error when using with Svelte 5? IIRC, existing libraries should (mostly) be interop with Svelte 5.

MathiasWP commented 1 month ago

The component type is different in Svelte 5, so if i have a prop like prefixIcon and set the type to Component then TS will error because the types does not match anymore.

metonym commented 1 month ago

Could you provide a quick code snippet that I can repro with? Happy to take a look.

MathiasWP commented 1 month ago

Thanks for the quick response. Rather than providing a repro, I think it would be more practical to go ahead and create a v4 branch of the library that supports Svelte 5. The Svelte maintainers have advised library authors to start migrating to Svelte 5, and it makes sense to follow that recommendation. The issue here is primarily due to the change in component types, which is causing TypeScript type mismatches. A dedicated Svelte 5 version would help avoid these issues and align with the community's push for compatibility.