Code Monkey home page Code Monkey logo

blog-monorepo-deps-sad-app's Introduction

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 ๐Ÿ˜ข

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".

This repository exists as a supporting demo for my blog post "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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.