lucide-icons / lucide

Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.
https://lucide.dev
ISC License
11.43k stars 523 forks source link

Update svelte package to Svelte v5 #2565

Open perryd01 opened 3 weeks ago

perryd01 commented 3 weeks ago

Package

Version

0.454.0

Can you reproduce this in the latest version?

Browser

Operating system

Description

types are not completely compatible with Svelte 5

Steps to reproduce

  1. create a project with svelte5
  2. try out the Lucide Svelte Typescript Example
  3. ComponentType<Icon> is no longer supported

Checklist

youknowedo commented 2 weeks ago

idk... If I understand correctly, the changes made to the Svelte components are in the "compiler." This means that the current lucide-svelte components are still compatible with svelte 5 and the real issue is with the types.

In my very amateur opinion, I think a better option would instead be to make the new Component type in the svelte repo backward-compatible with the ComponentType type (i.e. type Component = { /* type stuff */ } | ComponentType). This makes sure that the lib still is compatible with Svelte 3/4 while getting to use the type Component for everything.

But yeah I might be objectively wrong with this. I don't know how this stuff works really.

EDIT: nvm, @sveltejs/package already figured that stuff out. I think we'll lose Svelte 3 support though. Also, it seems like the components arent compatible with the Component<IconProps> type.

phenomen commented 3 days ago

It would be great if it also was compatible with runes. Right now it throws errors due to $$props deprecation, and it's the only library in my stack that prevents using full rune mode in the Svelte compiler.