1 of 11

The DRY Principle and Micro-Frontends

2 of 11

It is all about Reuse

“One of the most common misconceptions about Micro-Frontends is that they are all about reuse”

- Cam Jackson.

3 of 11

The DRY Principle

What if we apply the ”Don’t Repeat Yourself” Principle to Distributed Frontends?

4 of 11

A Common Scenario

5 of 11

Reuse is a nice idea in theory

In practice, Reuse is really hard to achieve and sometimes causes more work than duplicating the same feature.

6 of 11

Ownership Friction

When a reused feature that wasn’t designed with the third-party use cases in mind, it leads to conflict and at the end the effort is duplicated anyway.

7 of 11

So, do we reinvent the wheel again and again?

It depends...

Adding abstractions of top of Micro-Frontends could lead to tightly coupled components and removing the benefits of independent deployments.

8 of 11

It is all about the simple things

How do you reuse Micro-Frontends effectively?

Reuse is easier when you apply it to things that are:

- Small

- Atomic

  • Static

9 of 11

Reuse is a nice side effect of Micro-Frontends, not the target.

  • Do not to force the reuse, just let it naturally occur.
  • Setup teams in charge of the reused modules having a clear contract between the features and the consumers.
  • Preserve the ability to deploy independently to avoid blockers.
  • Watch out for scope creep.

10 of 11

Examples of effective Reuse

11 of 11

Conclusion and Recommendations

Does the feature change a lot?

Is the feature in active development?

Can you deploy independently?

Is the feature owned by a team?

Is there a clear roadmap for the feature and reuse has been accounted for?