Yarn 0.17 is out. Time to ditch npm.

Defenestrating npm. Original: http://trappedinvacancy.deviantart.com/art/Defenestration-115846260

Original by TrappedInVacancy on DeviantArt.

If you were avoiding Yarn because of its tendencies to delete your bower folder, it’s time to install the latest.

Among the many changes, it removes support for bower. So yarn is truly a drop in replacement for npm now.

To upgrade:

1
npm install -g yarn

Ensure that yarn --version returns 0.17. Then run it against your code base by simply typing this:

1
yarn

Only thing you should see is a yarn.lock file.

Wait… why should I care about yarn?

First, yarn freezes your dependency when you first install them. This allows you to avoid upgrading sub-sub-sub-sub-sub-sub-sub-sub dependency that could break your build because someone down the chain didn’t get semver.

The lock file is alphabetically ordered YAML and automatically generated when running yarn. Every time this file change, you know your dependencies changed. As simple as that. Not only that, it also freezes all child dependencies as well. That makes build process repeatable and non-breaking even if someone decides that semver is stupid.

Second, yarn allows for interactive dependency upgrade. Just look at this beauty.

Interactive Upgrade!

Cherry picking your upgrade has never been easier. If include yarn why <PACKAGE NAME> which gives you the reason for a package’s existence, yarn truly allows you to see and manage your dependencies with ease.

Finally, yarn will checksum and cache every packages it downloads. Even better for build servers that always re-install the same packages. Yarn also install/download everything in parallel. Everything to get you fast and secure builds for this special Single Page Application you’ve been building.

If you want the whole sales pitch, you can head read so on Facebook’s announcement’s page.

What about you?

What is your favorite Yarn feature? Have you upgraded yet? Leave me a comment!