Facebook Announces Yarn 1.0
Facebook Announces Yarn 1.0
Written by Kay Ewbank   
Tuesday, 12 September 2017

There's a new version of the Yarn open source JavaScript Package Manager launched last year by Facebook, Google, Expononet and Tilde. 

 

yarnbanner

Yarn is intended as a replacement for the npm package manager which is automatically included with Node.js. Facebook developers working on big projects like React found the npm client didn't scale to the number of programmers and the number of packages, so got together with Google, Exponent and Tilde and build a new npm client - which is what Yarn is.

Yarn was initially released 11 months ago, and there are now more than 175,000 projects on GitHub using it. Yarn is also now responsible for nearly 3 billion package downloads per month. At Facebook, Yarn has been adopted across many codebases including the main Facebook app and website, Instagram, Oculus, and WhatsApp. 

Yarn's advantages of shorter install times, better performance and stability has seen companies including Twitter, Microsoft, Kenzan, and Sentry using the product.

Writing on the Facebook code blog, Burak Yiğit Kaya, Christoph Nakazawa and Maël Nison of the Yarn team said:

"We're thrilled with the adoption and community engagement. Yarn's main focus when we launched almost a year ago was stability, resiliency, and performance. Building on the core principles of what made yarn successful in the first place, the 1.0 release comes with many new features that we hope will help the Yarn community move faster and build great projects."

The new version of Yarn adds Workspaces, support for the auto-merging of LockFiles, and selective version resolutions.

Yarn Workspaces let you manage code using a mono-repository approach for source control. The developers say this makes it easier to share code across all projects while avoiding dependency synchronization issues. Workspaces let you automatically aggregate all the dependencies from multiple package.json files and install them all in one go. Yarn will also create symlinks between all Workspaces that depend on one another.

Workspaces are already used by some teams at Facebook and projects like Babel in the open source community.

Auto-merging overcomes the problem where a merge conflict has occurred on the yarn.lock file because dependencies have been updated in separate pull requests one after another. If this happens, Yarn will now automatically handle the conflict resolution for you.

 

yarnanimation

(click in GIF to enlarge) 

Selective version resolutions makes it easier to ensure your code uses the most recent package with bug fixes or critical security updates where your project is not the direct consumer of those dependencies. Until now, you'd either be forced to either wait until your direct dependency is updated, or fork it and update the dependencies manually until a new release.

Yarn now allows defining a resolutions field in a project's package.json file that instructs Yarn to use specific versions of certain sub-dependencies, regardless of the original patterns its dependents set.


 yarnicon

 

More Information

Yarn On GitHub

Yarn Website

Related Articles

Yarn The New JavaScript Package  

Node.js 8 Includes npm 5

Rewritten Search For NPM 4.0

Node.js v6 Released 

Node.js Foundation Releases First Joint Code 

Getting Started with Node.js   

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

Banner


Babel Fish Is Real, But Who Pays?
05/10/2017

Google's most noteworthy announcement at its recent launch event is arguably the new Pixel Buds - earpieces to you and me. What is noteworthy is that these are billed as providing real time translatio [ ... ]



Open Jam For Open Source Games
03/10/2017

A three-day games jam with an emphasis on using open source game development tools and a requirement to open source the resulting games starts on October 6th.


More News

 

 
 

 

blog comments powered by Disqus

Last Updated ( Tuesday, 12 September 2017 )
 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.