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.01k stars 505 forks source link

Update svelte package to Svelte v5 #2565

Open perryd01 opened 6 days ago

perryd01 commented 6 days 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 1 day 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.