DEV Community

Discussion on: I'm the former tech lead for the NPM CLI, and I've been doing FOSS for 10+ years, Ask Me Anything!

Collapse
 
zkat profile image
Kat Marchán

Sorry if this is a bit long, but I guess it's story time?

npm@5 was simultaneously one of the most satisfying and one of the most destructive things I've done in my career...

So, flash back to late 2016, and Yarn comes out, putting an IMMENSE amount of pressure on my team. The main reason the CLI had seemed to stagnate was because our team had decided that stability and reliability and making sure what was there worked well were the primary goals for our project, so we'd spent the better part of that entire year fixing bugs, improving Windows support, and just generally making sure that the CLI was a nice, reliable tool.

Yarn came in and kind of flipped our table (and included a lot of FUD about it that I felt at the time, and still do, was very unfair), and our priorities had suddenly shifted: we were bleeding users, and we didn't have a plan to improve the CLI as much as it needed, on the timeline it needed to improve. The only clue we had that might do it was the so-called "cache rewrite" that had been in our backlog for literally years, but we didn't even have data on how much it would help. It was just clear that whatever it is we were doing was not actually what the community wanted from us, and we needed a new plan.

And then, my boss gets fired. Abruptly.

And my new boss tells me to go whole-hog on the cache rewrite.

Now, you have to keep in mind that working on the CLI was my day job, and I worked at a startup, so the emotional subjective experience of seeing Yarn take market share felt like these big Facebook bullies were putting my job and livelihood at risk. I was kinda panicking. I was genuinely scared and was ready to do whatever I needed to do to keep my job. My manager getting summarily executed (figuratively, I promise) heightened that sense of survival, I thought "I'm next", and such.

What followed was one of the most productive periods I've had in my entire career. I was working 12-14 hour days on npm@5, mostly on my own (while Rebecca took care of the stability of npm@4 and generally supported me in my work). I didn't really tell people this was what I was doing. I just did it because I needed to seem useful and that seemed like the most important thing. I needed to try to save the project that paid my bills.

Out of that, frankly, herculean effort came libraries like cacache, and then ssri, and then make-fetch-happen and pacote for the network bits, which I worked on in complete isolation from the main CLI project, benchmarking and testing them thoroughly along the way to make sure they were the fastest and most stable things I could write. I essentially rewrote the entire networking and caching layer of the CLI, from scratch, mostly on my own, in about 6 months.

We weren't expecting to release as early as we did, but the Node Core project threw us a curve ball towards the end, saying that we needed to have a semver-major version of NPM ready by early May in order to get it into the new Node release, or we'd be SOL, and we really couldn't risk missing that deadline.

So, I integrated everything in a couple of weeks, and we threw together package-lock.json in only a day or two, in a super-rush. We really didn't have time to test out the new semantics, the new format (which was largely based on npm-shrinkwrap.json, or most of the integration (remember, the ENTIRE networking layer had been replaced, down to the low-level http client).

So yeah, the npm@5 release was bumpy, but I was mostly numb by then from all the work I'd been doing the past several months, and I was relieved to get it out the door. I'm pretty proud of it, honestly! It turned out pretty damn good considering the constraints!

Collapse
 
othiym23 profile image
Forrest L Norvell

You can barely see the guillotine scars anymore!

Also big <3 for all the work you put into npm@5. I really wish you hadn't had to do it under the gun. I can't help but feel that casts a pall over what is really and truly an impressive achievement by pretty much any standards, and regardless of the material conditions of its creation.

Collapse
 
sirseanofloxley profile image
Sean Allin Newell

You did so great! I loved npm@5 and was so impressed by how much work and love you poured into the project, and your story here just confirms a lot of my suspicion as a casual user of npm.

Keep doing awesome stuff; and take care of yourself and do cool things at a sustainable pace.

You are an inspiration <3 👍