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:
- Damjan Vujnovic's Angular Workshop (in London on 3rd - 5th July 2019)
- London TensorFlow.js (in London on 20th June 2019)
- Keynote by Bruce Lawson on How To Make Loveliness: an HTML Treasure Hunt (in London on 24th June 2019)
- Frontend Series (SkillsCast recorded in June 2019)
- Lightning Talk: Don't Rebuild your Monolith! (SkillsCast recorded in May 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.