简体   繁体   English

将依赖项 v-calendar 从 beta 更新到 v2 的最佳实践

[英]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?将依赖项 v-calendar 从beta升级到最新版本 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.我们在生产中使用"v-calendar": "~1.0.0-beta.14" The latest version is currently v.2.3.0目前最新版本为v.2.3.0

I can think of two ways:我可以想到两种方法:

  1. update to the latest version with yarn add v-calendar@latest ?使用yarn add v-calendar@latest更新到最新版本?
  2. upgrade incrementally until the latest version is reached with yarn upgrade "v-calendar" ?增量升级,直到使用yarn upgrade "v-calendar"达到最新版本?

What should I do to reach the latest version?我应该怎么做才能达到最新版本? thank you谢谢你

ps.附言。 we are using vue: ~2.6.10我们正在使用vue: ~2.6.10

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.除非您使用的 package 有升级指南(其中 99.99% 没有),否则进行增量升级绝对没有意义 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). 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 .更改后(通过输入最新版本),运行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.如果出现问题,您只需 go 回到package.json ,将版本更改回更低,再次运行yarn install一切都恢复原状。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM