Please log in to watch this conference skillscast.
Modularity is almost a buzzword in the JS community, and considering the amount of packages now hosted on NPM, developers are taking it to an extreme.
Consider starting a new project when modularity is at the forefront of your architectural mind; you might think you'll have 5 packages, and each will have a corresponding git repository. While this may sound like a modular dream, I can speak from experience that it isn't! These are some things that you can expect to face when you have separate git repositories that are highly dependent on each other:
Friction around pull requests that cut across multiple packages
Broken builds due to bad changes in separate repositories
Time spent around pull request coordination
Code out of sync across the different repos
Lerna to the rescue! If you are not aware of what a monorepo is, this is a good starting place, for what, why, and how; with some good previous discussion. These are some of the things that we have happily embraced as a result of using lerna:
Code will always be in sync, one pull request will complete one feature
Master will never be broken
Code reviews happen in one place
No code in dependent repos/packages
Faster CI cycle time
YOU MAY ALSO LIKE:
- WebAssembly Deep Dive with Brian Sletten (in London on 21st - 22nd November 2019)
- Solandra Hands-On Tutorial & Emergent Behaviour In Insects (in London on 28th October 2019)
- Free Code Camp - October (in London on 29th October 2019)
- Monolithic Transformation - Changing the Culture of Large Organizations, or, What To Do When Your Meatware Stinks (SkillsCast recorded in September 2019)
Lightning Talk: Breaking the Monolith a Monorepo - Intermediate
Will is a developer with experience in lots of parts of the stack, and a keen interest in functional programming, and developer experience. For the last 5 years he's been helping big organisations re-platform onto modern frontend and node based stacks. Most recently Will has helped The Trainline on their move to a full react/node based desktop website.