For packages we have, we just, for each package we have, we just need to keep one single archive. As a result, anyone that flows the repository will be able to instantly start working with Yarn. More importantly, it means that our contributors are able to switch from one branch to another at almost no cost in terms of context switch, which is extremely valuable for us because we are, as I mentioned, we really want contributors to be able to submit a lot of different pull requests to feel confident working on different parts of the code. So being able to switch from one to the other is really important to the contribution workflow.
I still feel the need to mention one last thing about this, which is that this is our trade-off and not necessarily yours. So you don't have to store your dependencies in your repository if you don't want to, we just felt like it worked well for us. So I would certainly recommend it, but it's not something that really is forced on you.
One problem when you have a lot of workspaces and we have a lot, I think we have something like 44 at the moment, is that it becomes difficult to make sure that all the workspaces in your project are aligned in their configuration. For example, how can you ensure that all the workspaces have the exact same version of all your dependencies? It's far too easy to have one workspace suddenly upgraded without upgrading the other, so we have released a feature called the constraints, which you might have preferred because it uses a fairly novel programming language in its configuration, it uses product, and thanks to the constraint feature, we are able to enforce particular patterns across all workspaces in very few lines. And better yet, YARN can often apply the fixes itself. So for example, in the YARN repository, we use this feature in order to enforce the same version of dependencies in the cross all workspaces, but we also use it in order to make sure that all our packets on JSON list the right build scripts to make sure that they whole list the right repository field to make sure that none of them are marked as private, this kind of stuff.
So those three examples give you a good idea of what value open source projects can vary from YARN. In general, it means that they no longer need to like learner or chance sets, because those workers have directly received first party support. That said, even internal projects can benefit from YARN as well. And to talk about this, I'm going to discuss about Datalog. So I work at Datalog and Datalog is a huge web application along with a sizable JavaScript infrastructure which supports everything going from linting to deployments. YARN holds a really central place in this mechanism and we go over three examples.
The first one is the telemetry integration. If you don't know what Datalog is, we are making some really good cloud monitoring, extracting signals out of arbitrary metrics. So given this DNA, I guess it won't surprise you to know that we also monitor the way our developers interact with our infrastructure and in particular in terms of response time. So to achieve this, we wrote a plugin for YARN that watches all scripts that get executed, how much time they take and set it all on the dashboard. All this data then helps us, the front-end platform team, identify potential bottlenecks before they become a problem and generally prioritizes our work.
As we saw with the YARN repository itself, checking independencies has powerful effects on one's ability to efficiently continue to a project. But even in corporate environments, this pattern has its uses. From our data, the remote registry goes down approximately once a month. And by keeping our own copy of the packages, we're never blocked during our deployments. Additionally, despite a very high volume of comments on our main repository, our CI doesn't waste much time running installs because all the packages are already inside the repository. So once you call it, everything is there. And since the clone is usually cached between each CI ROM, everything is already installed in practice. All in all, instead of having to spend minutes installing projects in every single CI, it's really now just a matter of seconds.
Comments