Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewbrey/blog-monorepo-deps-sad-app
Demonstration of a "Sad App" for the blog post "Your Monorepo Dependencies Are Asking for Trouble"
https://github.com/andrewbrey/blog-monorepo-deps-sad-app
blog demo dependencies monorepo
Last synced: 1 day ago
JSON representation
Demonstration of a "Sad App" for the blog post "Your Monorepo Dependencies Are Asking for Trouble"
- Host: GitHub
- URL: https://github.com/andrewbrey/blog-monorepo-deps-sad-app
- Owner: andrewbrey
- Created: 2022-10-13T21:41:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-15T01:44:08.000Z (about 2 years ago)
- Last Synced: 2024-05-09T16:03:03.996Z (6 months ago)
- Topics: blog, demo, dependencies, monorepo
- Language: JavaScript
- Homepage: https://blog.andrewbrey.com/2022-10-12-your-monorepo-dependencies-are-asking-for-trouble
- Size: 36.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sad App Monorepo
This repository is a monorepo which contains 2 workspaces, one a `React` UI
library and the other a `React` App which _consumes_ the UI library.
Unfortunately, because the UI library depends on `react@^18` and the App depends
on `react@^16`, these two projects in their current state are incompatible with
each other — even worse, we don't find this out until runtime when a call to
`useId()` explodes in the `Button` [component](./packages/ui/src/Button.jsx) 😢The only reason this incompatibility is possible is because we allow each of
these workspaces to declare their own dependencies in their respective
`package.json`, which is why this is the **Sad App Monorepo**.There are a few ways to address this issue, each with its own tradeoffs, but the
way that I prefer is to only have **one** version of a given dependency for the
_entire_ monorepo.To see my preferred method of resolving this issue in action, see
[the companion repository for the "Happy App Monorepo"](https://github.com/andrewbrey/blog-monorepo-deps-happy-app).> This repository exists as a supporting demo for my blog post
> "[Your Monorepo Dependencies Are Asking for Trouble](https://blog.andrewbrey.com/2022-10-12-your-monorepo-dependencies-are-asking-for-trouble/)"
> on the topic of managing dependencies in monorepos. In the blog post, you will
> find a more thorough discussion of the issue as well as discussion of the
> tradeoffs involved with solving the issue in this way.