sortable icon indicating copy to clipboard operation
sortable copied to clipboard

Shopify/draggable is not actively maintained

Open ryangjchandler opened this issue 4 years ago • 9 comments

I'm opening this issue to discuss the future of this "plugin" since I do actually think it has a place in the Livewire ecosystem.

I understand that this plugin was probably a proof-of-concept and a good starter for a Livewire Plugin API (I think you played around with it when building a Trello clone), so should people be using it?

I am currently using this package at work to implement sortable functionality on a few forms, it's essentially a CMS where you can re-order elements.

Having encountered a few bugs with duplicate elements (something similar to #8, but with only one instance of the same page) and various other issues, I figured I'd look at the Shopify/draggable repo and see what sort of maintenance it has. It appears to be inactive, with the last release being August 2019.

I'm not sure whether some of these bugs can be fixed on the plugin side, or whether it's worth moving to a new JavaScript library that actually has some maintenance behind it.

/cc @calebporzio

ryangjchandler avatar May 27 '20 10:05 ryangjchandler

An alternative library that I've used before can be found here.

This library was last updated 3 days ago and seems much more stable and established. Admittedly, the Shopify library is nicer out of the box.

ryangjchandler avatar May 27 '20 11:05 ryangjchandler

Can vouch for SortableJS. We use SortableJS with Livewire already instead of this Sortable plugin. Much more options and customisations available.

JayBizzle avatar May 29 '20 21:05 JayBizzle

@JayBizzle would you care to share your implimentation of SortableJS? I can get the actual sorting to work but cannot for the life of me figure out how to get it to persist

pschilly avatar Jun 29 '20 23:06 pschilly

I started to move this Plugin from Shopify to SortableJS and will soon create a Pull Request.

@calebporzio what do you think about changing the underlying lib? Would you be ok with that, or would you like to keep this plugin as it is? In that case i would create a separate plugin for the SortableJS implementation.

maxeckel avatar Aug 04 '20 10:08 maxeckel

Nice work @maxeckel! I've been running my own solution for a little while too, experimenting with Dragula & SortableJS.

ryangjchandler avatar Aug 04 '20 11:08 ryangjchandler

I've seen that the Sortable package by Shopify, as you said in your first post, is not actively maintained. But actually the Draggable package is. Since they are working on 1.0.0 i think they wait for it to be released before they update the subordinate packages.

So i guess you could say it is actively maintained. Which means switching the library isn't really necessary. What do you folks think about it?

maxeckel avatar Aug 05 '20 14:08 maxeckel

I'm open to updating the underlying lib if there are compelling reasons. Glad to hear that Shopify is still maintaining Draggable

calebporzio avatar Jan 13 '21 15:01 calebporzio

If anyone is interested: I created a package that uses Sortable.js instead of Shopify's draggable/sortable. It uses the same wire-attributes as this package, so it is easy to switch 🙂

https://github.com/nextapps-be/livewire-sortablejs

I noticed that the Shopify package has some issues to retain the size of an element while dragging, while Sortable.js does by default. The Shopify package also causes weird Alpine.js errors when dragging an item that contains an x-for. Sortable.js does not have this issue 🤷‍♂️

gdebrauwer avatar Aug 25 '21 16:08 gdebrauwer

@calebporzio Would you consider using Sortable.js instead of Shopify's Draggable? I've just watched the new Laracasts Cookbook video and the instructor recommends using @gdebrauwer's fork.

adddz avatar Aug 30 '22 04:08 adddz