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

访问量 2240

预览图片