svelte-dnd-action icon indicating copy to clipboard operation
svelte-dnd-action copied to clipboard

update for svelte 4.2

Open ryoppippi opened this issue 8 months ago • 5 comments

Scince 4.2, we can declare 'svelte/elements' for custom attributes. I use this and this is so good!

https://svelte.jp/docs/typescript#enhancing-built-in-dom-types

ryoppippi avatar Oct 29 '23 17:10 ryoppippi

@ryoppippi does this mean that modifying the global types for HTMLAttributes is no longer necessary? If so, there should be an indication in the typescript support section of the README that the modification is not necessary if svelte 4.2+ is used.

fnimick avatar Oct 29 '23 20:10 fnimick

does this work for versions >=4.0 && < 4.2, based on the title I assume no but the README just says Svelte 4 so it might not work for some. Also since most people simply copy paste it and move on I wonder if it is worth keeping it as is just to save the mental overhead of "wait do I need to copy this or that?" and "wait, I am going to upgrade to 4.2 later, will I need to change this?"

isaacHagoel avatar Oct 29 '23 21:10 isaacHagoel

So the reason would be that if the signature of the events from this library changes, or a new event is added in the future, users won't have to manually update their vendored type definitions to keep them in sync.

fnimick avatar Oct 29 '23 22:10 fnimick

Ok, we need to add like require 4.2

ryoppippi avatar Oct 29 '23 22:10 ryoppippi

If the HTMLAttribute type could be defined in the library and automatically loaded at import, it would eliminate the need for the user to copy and paste the type.

ryoppippi avatar Oct 29 '23 22:10 ryoppippi