isaacHagoel / svelte-dnd-action

An action based drag and drop container for Svelte
MIT License
1.67k stars 100 forks source link

Allow svelte ^5.0.0-next.0 as peer dependency #567

Closed alexbehl closed 3 weeks ago

alexbehl commented 1 month ago

When using svelte 5.0.0-next, svelte-dnd-action causes a peer dependency issue. Since svelte-dnd-action appears to be compatible with svelte 5, it would be helpful to allow svelte 5.0.0-next as peer dependency.

isaacHagoel commented 1 month ago

Hi, I haven't actually tested it with Svelte 5. Does it work well? Can you pls update the version in package.json as well as the release notes?

On Mon, Apr 29, 2024 at 11:47 PM Alex Behl @.***> wrote:

When using svelte 5.0.0-next, svelte-dnd-action causes a peer dependency issue. Since svelte-dnd-action appears to be compatible with svelte 5, it would be helpful to allow svelte 5.0.0-next as peer dependency.

You can view, comment on, or merge this pull request online at:

https://github.com/isaacHagoel/svelte-dnd-action/pull/567 Commit Summary

File Changes

(1 file https://github.com/isaacHagoel/svelte-dnd-action/pull/567/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/pull/567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZC4RC5VLUDMFAUK4JG3Y7ZFPNAVCNFSM6AAAAABG6L4BLWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DSMJQGE2DEOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

alexbehl commented 1 month ago

I haven't encountered any issues so far

EricSSartorius commented 3 weeks ago

I haven't encountered any issues so far

Trying to update now and I noticed that all my pages that have overrideItemIdKeyNameBeforeInitialisingDndZones at the top of the +page file when DnD is used inside a child of the page are now get an error saying Uncaught Error: can only override the id key before initialising any dndzone

It worked in 4 but doesn't work after moving to 5. This is stoping me from being able to update my project to Svelte v5

benkuper commented 3 weeks ago

hello any update on that ?

isaacHagoel commented 3 weeks ago

Sorry. Blocked some time to look into this tonight (Sydney time zone)

On Mon, May 6, 2024, 06:34 Ben Kuper @.***> wrote:

hello any update on that ?

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/pull/567#issuecomment-2094939616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZC2TDN2ZYGTTCRKANVDZA2JVZAVCNFSM6AAAAABG6L4BLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUHEZTSNRRGY . You are receiving this because you commented.Message ID: @.***>

EricSSartorius commented 3 weeks ago

Is this ok being merged even though overrideItemIdKeyNameBeforeInitialisingDndZones no longer works properly in v5?

isaacHagoel commented 3 weeks ago

@EricSSartorius sorry. I missed your original comment somehow. I didn't test this option. ideally please create an issue. When are you calling the override? Can you try importing and calling it at the top level before creating any components with dnd zones inside? it is possible that svelte 5 calls the action (which creates the first zone) before running your override

EricSSartorius commented 3 weeks ago

@EricSSartorius sorry. I missed your original comment somehow. I didn't test this option. ideally please create an issue. When are you calling the override? Can you try importing and calling it at the top level before creating any components with dnd zones inside? it is possible that svelte 5 calls the action (which creates the first zone) before running your override

In v4 I am calling it at the top of my component like the example in the readme. In v5 it no longer works that way. I tried throwing it in different things like $effect.pre with no luck either. It only works after page refresh. I can make an issue 👍