konsta icon indicating copy to clipboard operation
konsta copied to clipboard

Svelte 5 types support

Open khromov opened this issue 1 year ago • 0 comments

Check that this is really a bug

  • [X] I confirm

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

  • Start a new project with npm create svelte@latest my-app
  • Select Svelte 5 alpha/beta during the installation process
  • Install Konsta UI and use any component in the SvelteKit project.

Expected Behavior

No errors when importing components

Actual Behavior

Errors in VSCoe

Konsta UI version

[email protected]

Platform/Target and Browser Versions

macOS

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] Make sure this is a Konsta UI issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • [ ] I'm willing to open a PR

khromov avatar May 11 '24 13:05 khromov