I'm Kent C. Dodds. I help people make the world better through quality software. Ask me anything!

View other answers to this thread
Blaine Garrett's photo

What are you opinions on monolith repos vs having concise separate repos? For example: component libraries consumed by multiple isolated front end apps that need to maintain versioning, etc?

I've been a long time fan of the later, but local front-end development feels harder now after React Hooks where the same instance of React needs to be npm linked to avoid errors. Related, what are your opinions on yarn workspaces and learna?

Kent C. Dodds's photo

Hi Blaine,

It's been a little over a year since I used a monorepo (via yarn and lerna) for a component library at PayPal. It was a little complicated, but it worked well. If I were to do it again, I probably wouldn't have bothered. Most people using the PayPal component library internally would need several of the packages so they all probably would've just installed the one package that installed everything anyway, so there's no benefit to splitting them up for that reason. One drawback to this is that a breaking change in any of those components results in a major version bump of the collective package which is annoying, but since almost everyone would be using the one collective package, it doesn't really bring any benefit to splitting them up and really just makes things more complex.

I definitely wouldn't build something like that as concise repos. That would be really hard to manage after just a dozen components or so.

So putting them all in a single repo in a way that's well structured and organized in individual folders for each exported "module" would be the way I would go if I did that again today.

Blaine Garrett's photo

Kent C. Dodds Thank you for your insight and professional experience on the topic.