vue.jsvuejs2dependenciesupdatesvcalendar

Best practice to update dependency v-calendar from beta to v2


what is the best practice to upgrade the dependency v-calendar from beta to the latest version v2.3.0?

I know the question is opinion based, but I am new to the field, what are the pros and cons of the way to do the upgrade.

We use "v-calendar": "~1.0.0-beta.14" in production. The latest version is currently v.2.3.0

I can think of two ways:

  1. update to the latest version with yarn add v-calendar@latest?
  2. upgrade incrementally until the latest version is reached with yarn upgrade "v-calendar"?

What should I do to reach the latest version? thank you

ps. we are using vue: ~2.6.10


Solution

  • Unless the package you are using has an upgrade guide (99.99% of them don't), there is absolutely no point in doing an incremental upgrade. If it has an upgrade guide, read and follow its instructions.

    The easiest way to upgrade is to change the package version to latest (in most IDE's if you press Ctrl/Cmd and hover the package number shown in package.json a tooltip will show you currently installed version, latest wanted version and latest available version). After you changed it (by typing the latest version in), run yarn install.

    In the vast majority of cases, that's all you need to do, because most packages are built with backwards compatibility (existing features remain and new features are being added). If that's not true in your case, you'll have to reimplement it following their documentation. Typically it's no big deal.

    Also, note there is no risk in attempting to change to a newer version. If things break, you just go back to package.json, change version back to lower, run yarn install again and everything is back to square one.