-
Book Overview & Buying
-
Table Of Contents
React Application Architecture for Production - Second Edition
By :
As projects grow, it's common to end up with multiple related codebases: the main web app, the dashboard app, a mobile app, a component library, shared TypeScript types, and utility functions. When these live in separate repositories, keeping them in sync becomes painful. A change to the component library requires updating, versioning, publishing, and installing a new version across every consumer. A breaking change in shared types requires coordinating across multiple teams.
A monorepo is a single repository that contains multiple applications and packages. Code changes happen together, so a breaking change and all the consumers that need updating can be in the same pull request. The following diagram shows what this looks like in practice:

Figure 13.3 – A monorepo with multiple applications
Here, each app is its own package, but they all share code from the common packages in the same repository. A change to a shared package is immediately available to every app...