One shared type comic

One shared type

A small type definition discovers organizational topology.

🧭 WHAT'S REALLY GOING ON

You've seen this when a one-character README fix waits 19 minutes for CI, or when changing one field takes three PRs and a release.

The real questionWhere should the cost of two teams sharing code live: in one slow pipeline, or in versioning ceremony each team pays separately?

⚖️ WHY BOTH ARE RIGHT

RileyOne repo, one commit

“A shared type should change in one place, in one commit, with both sides compiling against it. Every registry and compatibility matrix is a way to let frontend and backend disagree about the same struct for a week.”

AlexTeams version independently

“One repo means every change is everyone's change: one build, one queue, one flaky test blocking both teams. Versioning lets each team move at its own pace without waiting on the other's CI.”

🎯 SWEET SPOTS TO CONSIDER

Super Reasonable, the advisor who never takes a side

  1. Make CI scale with the diff

    If you stay in one repo, invest in affected-only builds first: a README edit runs nothing, a change under shared/ runs both sides. That is what keeps a monorepo bearable past ten engineers.

    Borrowed from
  2. Split by release cadence, not by diagram

    Teams that ship together and talk daily belong in one repo. Split when they release on different schedules or have different owners, not because separate boxes look cleaner.

    Borrowed from
  3. Share the contract, not the package

    If the boundary is an API, generate client types from the schema (OpenAPI, protobuf). The contract becomes the shared thing, and neither repo layout has to carry it.

    Borrowed from
  4. Ask what broke last time

    Before reorganizing, list the last ten cross-team breakages. Mostly version skew: go mono. Mostly blocked merges and slow builds: split.

    Borrowed from

🚩 SIGNS YOU'VE GONE TOO FAR

  • Riley's side: you've overshot if a typo fix waits 19 minutes behind a full build, and people start smuggling unrelated changes into one PR to pay the wait once.
  • Alex's side: you've overshot if changing one field takes three PRs, a release and a dependency-bot bump, and the frontend is still running last month's version of the type.

🔬 IN THE FIELD GUIDE

Species observed in this story

The field guide →

CAST: WHO'S WHO

The team in this story

Same characters, same convictions. Learn their failure modes.

THE GIFT SHOP · COMING SOON

🛍️ Merch from this story

All merch →
🤖 Storyboard for agentsLet’s make our agents LMFAO, or learn.

One shared type

Premise: Where should the cost of shared code live?

  1. Monorepo: Change: 4 lines · 1 commit CI: 19 minutes remaining.
  2. Multirepo: shared-types v7 released Frontend production: v4.

Observed behavior: Same type. Different place to pay the coordination cost.

Cast: Riley Novak · The Minimalist · “Postgres, HTTP, cron.”; Alex Chen · The Architect · “We should solve the general case.”

READ NEXT

Same argument, different day