R047 · Infrastructure for agents at scale › Developer infrastructure under agent load

Robinhood's Bazel bet: a fine-grained build graph for a JavaScript monorepo

Read the original

dev-inframonorepo

Sources: Robinhood's LinkedIn post; The Bazel Bet Behind Robinhood Legend: Infrastructure from First Principles by David Aghassi and Max Rabiciuc, Robinhood Tech Blog, 2026-11-10.

In one paragraph

Robinhood's legacy web trading app lived in a Bazel monorepo but was built with Webpack as one Bazel target, and its tests ran as one Jest suite. Any change invalidated the whole cache, a one-line edit meant a roughly 40-minute rebuild, and CI was slow and flaky. Years of Webpack tuning didn't help, because the bottleneck was the shape of the build: one target meant one unit of cache invalidation. For the new desktop product, Legend, the team rebuilt the JavaScript build on pnpm and the rules_js family of Bazel rulesets. They used one BUILD.bazel file per folder, generated by Gazelle, with RSPack doing only the final bundling. Reported results: P95 CI about 50% faster (about 25 minutes), P50 about 80% faster (about 10 minutes), installs about 75% faster, and an isolatedDeclarations rollout that cut type-check time by about 80% and monorepo-wide build time by about 25%.

Goals they set first

Options weighed

How the build works

Tradeoffs and failure modes

Review checklist for a monorepo build

Connections

See R047 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.