Is Yarn still a thing?

Does Yarn still a good product? Let's figure it out
10 August

When npm@5 was just released this question was the first one I have googled. No doubts it comes to mind since new npm version introduced a lot of yarn’s features. In other words: should I still use yarn after installing npm@5?

Yarn features

Why do people use yarn in the first place? npm had some known issues. Well, we all have been there: downloading and installing packages for hours, resolution hell, not using essential --save and --save-dev by default, and many others.

When yarn was first released it solved many of these issues completely. It offered multiple improvements:

  1. yarn add saves a package not only to node_modules but also adds it to the list of dependencies in package.json. Think of it like yarn does not install a package into node_modules directory, it adds a package to your project
  2. yarn install worked in average from 2 to 3 times faster than npm installyarn changes how packages are downloaded and installed, that’s why it is so blazingly fast
  3. yarn install also checks for yarn.lock (or creates it), a special file where every single version is locked into a known state, what makes dependency resolution process deterministic
  4. yarn utilizes cache to make the installation process even faster. It is even possible to reinstall everything without internet connection when the cache is alive (saved me once)

This set of advantages at some point predetermined how the js package manager should look like. npm had to take the pace.

npm@5 breaks in

Keeping all that in mind the npm core team made a huge step towards the competitor. When the 5th major release was out a lot of people asked this question: should we still use yarn? The changelog for this release is inspiring indeed.

What are the key features that npm@5 brings to us?

Speed up: it is now competing with yarn and other package managers. Here’s a nice gif of the speed up, brought to you by one of the npm ‘s core members:

Determinismnpm now enforces the same workflow as yarn (and many other package managers). It generates package-lock.json to know what exact versions your project uses. It is worth mentioning that algorithms in yarn and npm differ. And npm has a solid advantage since it has better hoisting position across npm versions than yarn has across different version of yarn.

Sane defaults--save is now enabled by default. No more problems with that.

Cache: it was completely rewrittencacache and pacote living inside the new realization are fast and reliable. You can run this command to see it yourself:

git clone https://github.com/zkat/cacache && cd cacache && npm i && npm run benchmarks

Default toolnpm is the default. Everyone uses it. Earlier it was like IE: a browser to download another browser. Jokes aside, this point is strong. You don’t need to have this one extra custom package manager.

But, really, is yarn still a thing?

The answer is: it depends.

My first attempt to install something with npm@5 was with my the most favorite vue-starter which has around 850 packages to download. npm’s time was not bad at all with 42 seconds at the fresh run. When the cache is ready, it takes only 30 seconds to install everything.

Compared to yarn: 35 seconds without cache and 20 seconds with the cache in place. For me, this time gap was important enough to still use yarnas a primary tool.

But. Do not use both tools inside one team. It will lead to a disaster with package resolution and pollute your repository with extra files. Stick to something and use it.

Finale

npm is moving in a right direction (say hi to pip). It is pretty great already, but soon it will be even cooler. 

Provided by Elixir club.

Elixir Club 9 in Kharkiv

18 November, 11:30, Spalah, Divocha str. 9, Kharkiv
14 November

Elixir Club is a regular event for Elixir community. Elixir developers are gathered and given  an opportunity to share their experience, cases, and mistakes and ways to avoid them. Events usually take place in Kyiv, but also they were held in Ternopil, Lviv, and Dnipro this year to share with developers from all of the Ukraine. Next Elixir Club 9 will be held in Kharkiv. It will be the one-day event, and agenda will be mostly about Elixir language basics. Organizers welcome professionals with different technology backgrounds to become acquainted with Elixir. The lineup consists of talks about Elixir language, its ecosystem, appropriate solutions, cases of using Elixir in real project.

Speakers

There will be interesting talks of skilled coders at Elixir Club.

Alex Rozumii

Topic: "Elixir: Getting started with language and ecosystem"

Alex Rozumnii
Alex Rozumii

Elixir is a dynamic, functional language designed for building scalable and maintainable applications. It’s snowballing nowadays due to its battle-tested ecosystem and useful features. This talk will be interesting mostly for nonexperienced Elixir developers, as it will cover Elixir and OTP ecosystem basics and will include the list of essential materials to improve your onboarding speed.
 

Alex Rozumnii

Yurii Bodarev

Topic: "Ecto and Phoenix: Doing Web With Elixir"

Yurii Bodarev
Yurii Bodarev

Phoenix is an MVC web framework providing all tools that You can expect to be productive: generators, templates, and channels as WebSockets abstraction. Ecto is a domain specific language for composing queries and interacting with databases. This talk will introduce You to building a fast and reliable web applications with Elixir using Phoenix and Ecto as a solid foundation.
 

Yurii Bodarev 

Alexander Khokhlov

Topic: "Pattern matching in Elixir by example"

Alexander Khokhlov
Alexander Khokhlov

Elixir alongside with it's Erlang host platform gives a really simple yet powerful language feature called "pattern matching". In his talk, Alexander gonna walk you through the main concepts of pattern matching mechanism with examples from real Phoenix web app.
 

Alexander Khokhlov

Founder, Nots.io

Alex Troush 

Topic: "Elixir in a service of government"

Alex Troush
Alex Troush

How we build a biggest open-source project that uses Elixir. A deep dive to Ukraine EHealth System and problems of big elixir codebase.
 

Alex Troush

Event agenta

  • 11:30 Registration and Welcome coffee
  • 12:00 Elixir: Getting started with language and ecosystem - Alex Rozumii
  • 12:50 Coffee break 13:00 Ecto and Phoenix: Doing web with Elixir - Yurii Bodarev
  • 14:00 Lunch 15:00 Pattern matching in Elixir by example - Alexander Khokhlov
  • 15:45 Coffee break 16:00 Elixir in a service of government - Alex Troush
  • 16:45 Coffee break
  • 17:00 Lightning Talks

Students are welcomed for their willingness to learn, and organizers give 50% discount via the promo code “student”. Also, parents of small babies (0-3 years) on maternity leave, who want to grow their skills while nursing the kid are welcomed too. You can get a special discount on the ticket with promo code “GrowWithYourKid “. Get you ticket here.