Welcome, everyone. In this talk, we'll go over some ideas on how to unlock the power of the dependency graph, along with some examples of how to leverage it using the Vault client. I'm Rui Adorno, I'm a founder engineer at Vault, where we're building the future of JavaScript packages. Before that, I worked at NPM Inc. and eventually moved to the NPM CLI team at GitHub. Before joining Vault, I spent two years at Google working with the JavaScript SDK, which gave me another round of experience as an end user before jumping back again to the JavaScript supply chain world. I've been working in the Node.js package management space for years, and what I want to share today comes from that experience.
Well, dependencies are the building blocks of JavaScript projects, but the resulting data structure, a graph they form, has been historically underutilized by the tooling ecosystem. Understanding how these dependencies relate and why they even exist remains surprisingly difficult. Every project has dependencies. Anytime you run an install, the package manager will resolve the dependency, creating a graph data structure that has to be resolved, deduplicated, before eventually writing all the files to disk. But after all, the graph data structure is ignored for almost all other commands. And this graph data structure should be treated as a first-class citizen.
What tooling that treats the graph data structure as a first-class citizen looks like? Well, you should expose that graph structure, then make use of a syntax to allow querying the contents of the structure, and finally, use the understanding of the graph structure across all sorts of project operations. This is what the dependency graph actually looks like. Not a flat list of folders in Node modules, but likely a cyclical graph. In this case, my app depends on Express, React, and TypeScript. Express depends on BodyParser, XSAP, and so on and so on. And when we zoom in, we realize that every node carries its full metadata, security, relationships, everything should be queryable. And here's what lives inside each node. Not just the name of the version, but also integrity hashes, published dates, author information, security details. When you keep the graph, all of this metadata is queryable. You can ask, show me all packages published before a certain date or show me everything by a specific author, because it's all right there in the graph. Here, I wanted to introduce this concept of the dependency selector syntax, which is something that we've been using for a long time. Here, I wanted to introduce this concept of the dependency selector syntax. We call it DSS for short. It's based on CSS selectors, and it helps us answer complex questions about dependencies, their relationship, and metadata. You can see how it fits very well with the CSS model. Let's start with some concrete examples. It's easier to visualize. Starting here with the star operator is just selecting all the nodes in the graph.
Comments