Browsing my various online sites for tech news, I came across an update for Yarn, a 2.2 release for the ill-fated Yarn 2 package manager which many will attest, has been a trainwreck of biblical proportions.
I know a couple of people who have attempted to migrate from Yarn v1 to Yarn v2 and given up in the process, opting to go back to Npm. Even though Npm might not be as cool, Npm has caught up on several fronts and really, the only reason developers chose Yarn in the first place was because of the performance improvements.
Firstly, I just want to point out I am not taking a dump on the Yarn team nor am I saying that the people who have been working on Yarn 2 want it to fail or intentionally meant to make it so difficult to move to v2: it is what it is.
I did get a good chuckle at the end of the update where the author states:
We’ll try to make more regular minor releases from now on, shipping exactly one minor per month (eventually leading up to the release of Yarn 3 in January 2021).
Considering people have struggled to update to Yarn 2, the fact another major version is coming in what, four months? It does seem a little silly when you put that into context. But, it is good to have a release schedule and incrementally update your software.
In defence of Yarn, they had the right idea, but the changes were so fundamentally different it echoes the mistakes the Angular team made when they announced Angular 2 and didn’t have a solid migration plan in place. People were not prepared and even though people have tried to upgrade, the failure rate seems high.
There is a migration guide here, but it’s not a light read akin to someone shining a bright light in your face and screaming at you. There is also a plugin for enabling old style node_modules
support detailed here.
Interestingly, Jest has migrated over to Yarn v2, but they had to enable the legacy node_modules
support, because, clearly if they didn’t the migration would be a lot of pain for them. Maybe it is worth migrating and switching legacy support on, I’m not sure if a lot of developers even know you can do that.
After the launch of Yarn v2, I gave up on it almost instantly. Now that v2.2 is out, I might see if I can upgrade an old Aurelia project I have lying around to Yarn v2 and switching on legacy mode to see if that clears any potential roadblocks.