So, every couple of hours, I think it's every six hours, something like that, we are running a set of tests on both installing NestJS and Gatsby and we see how much time it takes for all package managers, depending on multiple parameters. For instance, when there is a full code installed, when there is already a log file, but no cache, when there is a cache but no log file, when there is everything at once. And it lets us see trends. Nowadays, all package managers are fairly equal in speed, especially YARN 4 and PMPM are very similar in install time. However, it's interesting for us to see whether either we ship something that contains a performance regression or one of the competitors managed to find a way to significantly increase their speed, in which case we investigate as well so we can implement that. That's quite interesting to do that automatically.
Still in the domain of automation, we are also tracking compatibility with many projects in the open source ecosystem. So, for instance, every four hours, we are running tests on ESBuild to make sure that we can run YARN at ESBuild and that the project that we thus install can be used just fine. So, we not only run YARN tests, but we also run ESBuild, Ocusaurus, ESLint tests on an hourly basis. Each time one of those builds becomes a RAIL, it sometimes happens, for instance, let's say that one project starts relying on a dependency that they forgot to declare in their package.json, it puts the test red and we start working with maintainers to let them know about the potential issue that is inside their software. We figure out whether it's a problem with their package or with YARN. It sometimes happens, although it's rare, and we work together in order to address it.
The YARN cache contains zip archives and not TGZ. The reason for that is that TGZ archives must be completely decompressed in order to access a single file, whereas ZIPs can allow you to access one file inside the whole archives without having to uncompress everything. The YARN allows you to directly run your scripts by dynamically requiring files from the cache, and in order to do that, we need to be able to pinpoint the file that we access inside the cache, hence why we are using ZIPs and not TGZ. We considered using a custom format. However, zip archives are natively supported by most OSes and third-party tools, so it's quite handy to be able to just use ZIPs. We also implemented a ZIPFS VS Code extension in order to add ZIP support to VS Code.
There are bits of YARN in pnpm. If you are a pnpm user here, you might be interested in knowing that if you are using the node-linker flag in your npm IRC without the hoisted value, it will tell pnpm to install the project using a regular non-modules folder, which can be handy for compatibility purposes, and that's powered by the YARN linker. I mentioned before that we have a non-modules linker, a pnpm linker, and a pnp-linker. Both the pnp-linker and the non-modules linker are reused by pnpm so that their users can also benefit from those type of instants. If you are using those settings, you are using YARN. We also have a shell interpreter that is used by pnpm. If you have the shell emulator true setting that is toggled true, pnpm will treat it to mean that you want to run all the scripts in your packet.json through a special interpreter that is working on both Linux and Windows without having to configure special shells in your system. That's something that is implemented by YARN in JavaScript. We implemented this portable shell that works across all systems, and we published it as a package so it can be reused by other package managers. YARN also contributes to Node.js.
So, for instance, the Core Pack initiative, which aims to easily use your preferred package manager regardless of the project that you are working on, that's something that we started ourselves. We are working with Node.js in order to make it stable and enable it by default. We are working in working groups where we are attempting to tackle large issues that also affect other projects. For instance, the loader working group, which intends to define what is a loader in the context of Node.js. You might be familiar with the concept of loaders, for instance, for Webpack. What does it mean for Node.js? That's something that we are working on, along with a couple of other folks on the Node.js project.
Thanks for your time. This talk was short, so I'm sure you have a lot of questions. Feel free to ask them on Discord, and you can also find me on Twitter on GitHub using the Arcanist handle. I hope you enjoyed this talk. Have a good day.
Comments