Skip to main content

好处

虽然 Yarn Classic 系列 (1.x) 仍然是 JavaScript 生态系统的支柱,但我们建议尽可能升级。为什么?

¥While the Yarn Classic line (1.x) remains a pillar of the JavaScript ecosystem, we recommend upgrading if possible. Why's that?

  • 稳定性:Yarn Modern 是在多年维护 Classic 的经验之后诞生的;它的设计是根据我们看到的缺点得出的,因此软件比以前更加稳定。

    ¥Stability: Yarn Modern came after years of experience with maintaining Classic; its design was informed by the shortcomings we saw, and as a result the software is much more stable than it ever was.

  • 新功能:Yarn Modern 提供了许多 Yarn 1.x 中不存在的新功能 - 或任何其他包管理器。例如,约束 是 Yarn Modern 独有的。

    ¥New features: Yarn Modern provides many new features that didn't exist in Yarn 1.x - or any other package managers for that matter. As an example, Constraints are exclusive to Yarn Modern.

  • 灵活性:Yarn Modern 支持所有三种安装策略:Yarn PnP、node_modules,以及通过类似 pnpm 的内容寻址缓存。无论你喜欢哪一个,你都可以随意使用。

    ¥Flexibility: Yarn Modern supports all three installation strategies: Yarn PnP, node_modules, and via a pnpm-like content-addressed cache. No matter which one you prefer, you have it at your disposal.

  • 可扩展性:Yarn Modern 的架构允许你根据需要构建自己的功能。无需等待我们实现你希望的此功能 - 你现在可以根据自己的规范自己实现它,并立即使用它!重点工作区、自定义安装、项目验证……

    ¥Extensibility: Yarn Modern's architecture allows you to build your own features as you need it. No need to wait for us to implement this feature you hope for - you can now implement it yourself, according to your own specs, and use it straight away! Focused workspaces, custom installs, project validation, ...

  • 面向未来:在我们开始看到在 Yarn Classic 上构建新功能有多么困难之后,我们构建了 Yarn Modern,大多数更改都会产生不可预测的后果。这个瓶颈已经得到解决,我们在过去几个主要版本中发布的一系列功能就是明证。

    ¥Future proof: Yarn Modern was built after we started to see how difficult it was to build new features on Yarn Classic, with most changes having unpredictable consequences. This plateau has been solved, as evidenced by the slate of features that we released in the past few major releases.