Builders of Yarn, who want it to become a “development-first” tool in 2019, are emphasizing a “plug ’n’ play” concept that has Yarn telling developers where to find dependent packages instead of relying on Node. Yarn builders refer to the list of planned changes as “Berry,” with a stable release featuring improvements arriving this summer.
Yarn turns to TypeScript
The roadmap also cites plug-in support as a major change. Yarn plug-ins will be able to alter capabilities ranging from the addition of new commands to adding support for new packages sources or install targets. Plug-in support also will impact resolution, fetching, and linking steps.
In a move related to the plug-in system, Yarn will become an API as much as a CLI, with internal components split into modular entities—a goal also slated for 2019. There will no longer be a need to parse
package.json as Yarn will abstract away this task.
Another goal is for Yarn to support different targets than Node. Developers interested in implementing PHP, Python, or Ruby package installers without leaving Yarn are encouraged to open an issue on this.
Also on the drawing board is to make the lockfile and configuration format for Yarn a strict subset of the YAML data serialization standard. Lockfile information will be altered to account for long-awaited changes such as the removal of hostnames, enabling easier switching of the default registry.
Yarn roadmap details
Other major changes and new features on the Yarn roadmap:
- An overhauling of the log system, including leveraging diagnostic error codes from TypeScript. Errors and warnings will be assigned a unique code.
- Core features such as
autocleanwill be moved into contrib plug-ins.
- The cache file format will be switched from Tar to Zip, offering better characteristics for random access.
- Out-of-the-box support for nested workspaces, in which a workspace defines additional workspaces. This will expand usages, particularly when used together with Git submodules.
- A resolution protocol,
workspaces:, to force the package manager to link a package against a workspace, preventing accidental use of a version of a package acquired from the remote registry.
constraintscommand to enforce constraints across packages.
- The yarn
linkcommand will persist changes into
package.jsonfiles. Linked packages will resolve peer dependencies.
- Writing Posix commands inside the scripts field will work regardless of the underlying OS.
- Scripts will be able to put arguments anywhere in the command line.
- The cache will be fully atomic, with multiple Yarn instances able to run concurrently on the same cache without the risk of corrupting the data.
Support for Node 4 and Node 6 will be dropped. Also, a large volume of bugs are expected to disappear as the codebase is modernized.
You can download Yarn from the project website.