How a developer decided what to share between Next.js and Expo in a monorepo
A developer building SquadNote, a product with both a Next.js web app and an Expo mobile app, used a pnpm workspace and Turborepo monorepo to manage shared code. They found that tRPC types, design tokens, and pure business logic functions were strong candidates for sharing, as they have no platform-specific dependencies. However, UI components, authentication storage, and routing were kept separate because web and mobile environments impose different constraints and have different reasons to change. The developer recommends a checklist before extracting code into shared packages, asking whether the code depends on platform APIs and whether both apps would change it for the same reason. Their key takeaway is that the real value of a monorepo lies in the flexibility to shift sharing boundaries over time, not in maximising shared code from the start.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in