konstaui / konsta

Mobile UI components made with Tailwind CSS
https://konstaui.com
MIT License
3.52k stars 131 forks source link

Svelte 5 types support #207

Closed khromov closed 2 months ago

khromov commented 5 months ago

Check that this is really a bug

Reproduction link

-

Bug description

Overall Konsta works fine with Svelte 5 as it's backwards compatible with 4 but there seems to be a small issues with Svelte 5 support:

Types have changed, leading to TypeScript errors in each component.

Screenshot 2024-05-11 at 15 48 34

Argument of type 'typeof Actions' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.

Possible causes:
- You use the instance type of a component where you should use the constructor type
- Type definitions are missing for this Svelte Component. If you are using Svelte 3.31+, use SvelteComponentTyped to add a definition:
  import type { SvelteComponentTyped } from "svelte";
  class ComponentName extends SvelteComponentTyped<{propertyName: string;}> {}ts(2345)
(alias) class Actions

In addition, there are some small changes in Svelte 5 that now trigger a notice warning:

/Users/k/Documents/GitHub/x/node_modules/konsta/svelte/components/Actions.svelte:25:2 Self-closing HTML tags for non-void elements are ambiguous — use `<div ...></div>` rather than `<div ... />`

There's some background for this change here: https://github.com/sveltejs/svelte/issues/11052

To reproduce

Expected Behavior

No errors when importing components

Actual Behavior

Errors in VSCoe

Konsta UI version

konsta@3.1.3

Platform/Target and Browser Versions

macOS

Validations

Would you like to open a PR for this bug?

nolimits4web commented 2 months ago

t0ggles-create konsta

t0ggles[bot] commented 2 months ago

Task nolimits4web/KONSTA-89 was created

t0ggles task KONSTA-89

Bewinxed commented 2 months ago

I currently ported Konsta svelte to svelte 5 including all components, but stepping on one minor issue wrt config.js not providing a default export?

https://github.com/konstaui

t0ggles[bot] commented 2 months ago

Task nolimits4web/KONSTA-89 status changed to Done