Effective React Development with NxNx_Medium


What's in this book?

In this book you will learn about Nx and monorepo-style development for React applications. Many large companies, such as Google, Facebook, and Microsoft all use the monorepo approach to software development. This approach provides many benefits, such as:

  • Increased collaboration between teams.
  • Increased visibility across teams.
  • Increased developer mobility between different projects.
  • More consistency in the development experience (e.g. tooling, process).

Nx is a tool that helps teams work with monorepos. We’ll explore how it enables us to build React applications more effectively. We’ll do this by looking at concrete code examples that mimic real-world applications.

You will learn:
  • How to create a React workspace and generate code using Nx.
  • How to run lint, unit tests, and end-to-end tests with Nx.
  • How Nx helps us understand and enforce workspace structure.
  • How Nx helps us understand and verify code changes.
  • How Nx helps us scale out our monorepo and CI/CD pipelines


Book Excerpt

If you’ve ever worked at a company with more than one team, chances are you’ve had to deal with some challenges when it comes to change management.

In a typical work setting, development teams are divided by domain or technology. For example, one team building the UI in React, and another one building the API in Express. These teams usually have their own code repositories, so changes to the software as a whole requires juggling multiple repositories.

A few problems that arise from a multi-repository setup include:

  • Lack of collaboration because sharing code is hard and expensive.
  • Lack of consistency in linting, testing, and release processes.
  • Lack of developer mobility between projects because access may be un- available or the development experience vary too greatly.
  • Difficulty in coordinating changes across repositories.
  • Late discovery of bugs because they can only occur at the point of integra- tion rather than when code is changed.