Frontend Architecture
Monorepo: multiple-choice review
Six questions that cut across the whole unit. Each mirrors a call you make on a real CI pipeline — not a definition to recite, but a tradeoff to weigh when the merge queue is backing up.
Confirm you can connect the dependency graph, affected detection, remote caching, and module boundaries into one decision: build what changed and its dependents, cache the rest, and never let a hub package make every PR rebuild the world.
A one-line copy fix to a marketing page sits in CI for 41 minutes; all 38 projects rebuilt. The import resolved through @acme/utils, which every app and library depends on. What is the actual cause?
What does affected (Nx) / filtered (Turborepo) actually compute for a PR, before caching is considered?
A PR served a stale build from the remote cache and shipped a bug, even though hit rate was high. Most likely cause?
Why does a concurrent dev forgetting to add a glob to a task's inputs cause CI to silently slow down rather than break?
A team enforces Nx tags so feature → ui → util is the only allowed direction. A dev adds an import from a util library into a feature library and CI fails at lint. Why is this the intended behaviour, not friction?
A team of four independent product squads shares almost no code and communicates only over HTTP APIs. They are weighing monorepo vs polyrepo. Which framing is correct?
The through-line across the unit is one pipeline: the dependency graph sets ordering and blast radius, affected detection narrows each PR to the changed projects plus their dependents, remote caching turns most of those into instant hits — and the cache key is the whole game, where a missing input is a dangerous false hit and a volatile one is a wasteful false miss. None of it survives a bad graph, so enforced module boundaries (Nx tags, the enforce-module-boundaries rule, package exports) keep a hub from forming. And the monorepo-vs-polyrepo call is about coupling: shared code that changes together favours the monorepo; truly independent teams favour polyrepo.