Yarn 2介绍!

原文信息: 查看原文查看原文

Introducing Yarn 2 !

- Maël Nison

经过365天集中的开发,迎来了Yarn 2的第一个稳定发行版。作者在文中详细介绍了这件事对社区来说意味着什么。




  • The output got redesigned for improved readability
  • designed for improved readability
  • Our CLI commands (yarn add, …) are now aware of workspaces
  • Running yarn install can be made optional on per-repo basis
  • A safer npx counterpart called yarn dlx to run one-shot tools
  • Run commands on all workspaces with yarn workspaces foreach
  • Packages can be modified in-place through the patch: protocol
  • Local packages can be referenced through the new portal: protocol
  • A new workflow has been designed to efficiently release workspaces
  • Workspaces can now be declaratively linted and autofixed


  • Package builds are now only triggered when absolutely needed
  • Package builds can now be enabled or disabled on a per-package basis
  • Scripts now execute within a normalized shell
  • Peer dependencies now work even through yarn link
  • The lockfile is now proper YAML
  • The codebase is now full TypeScript
  • Yarn can now be extended through plugins


  • Configuration settings have been normalized
  • Packages must respect their boundaries
  • Bundle dependencies aren't supported anymore
  • Packages are stored in read-only archives



  • Who should we thank for this release?
  • How easy will it be to migrate to Yarn 2?
  • What will happen to the legacy codebase?


除了上述内容,还有一些Yarn 2相关的CLI工具、协议、package等内容。

分享于 2020-02-06

访问量 2220