Vue.Draggable icon indicating copy to clipboard operation
Vue.Draggable copied to clipboard

How to update sortable.js library?

Open animeshsarkar-bct opened this issue 4 years ago • 7 comments

I used this plugin and found that it used sortable js old version. Sortable js fixed some Safari issue in their latest version. How to update?

animeshsarkar-bct avatar Jun 16 '21 17:06 animeshsarkar-bct

You have two options:

  1. Wait for the author(s) to update this project.
  2. Create a pull request with your required change, then wait some more unit the author(s) merge your pull request.

Heartnett avatar Jun 17 '21 12:06 Heartnett

Thanks. I updated the library using selective dependency resolution.

animeshsarkar-bct avatar Jun 22 '21 03:06 animeshsarkar-bct

@animeshsa Could you share your solution?

apodacaduron avatar Jun 29 '21 16:06 apodacaduron

I used yarn for package management. Use this link https://classic.yarnpkg.com/en/docs/selective-version-resolutions/ in package,json write

"resolutions": {
   "sortablejs": "^1.13.0"
 },

and in yarn.lock looks like this

[email protected], sortablejs@^1.13.0:
  version "1.13.0"
  resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.13.0.tgz#3ab2473f8c69ca63569e80b1cd1b5669b51269e9"
  integrity sha512-RBJirPY0spWCrU5yCmWM1eFs/XgX2J5c6b275/YyxFRgnzPhKl/TDeU2hNR8Dt7ITq66NRPM4UlOt+e5O4CFHg==

so now all libraries that usage sortable js use this version 1.13.0. There is another dirty solution that is to update the lock file manually.

animeshsarkar-bct avatar Jun 29 '21 17:06 animeshsarkar-bct

Just a heads up, I think resolutions will disregard version locks, so if there's any incompatibilities you won't be warned / won't know until it breaks.

joshbuker avatar Jul 06 '21 21:07 joshbuker

I ended up using a branch from a fork npm install git+https://github.com/apodacaduron/vue.draggable.next.git\#update-sortablejs-version

apodacaduron avatar Jul 08 '21 18:07 apodacaduron

NPM v8+ https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

{
  "overrides": {
    "sortablejs": "~1.15"
  }
}

Mihailoff avatar Jun 06 '24 23:06 Mihailoff