In this chapter, we'll look at a variety of anti-patterns within Vue.js and review concepts at a high level that we've learned throughout the book. We'll look at various patterns and anti-patterns and how we can write code that is consistent across teams and your own projects.
Before defining anything as a pattern or anti-pattern, it's important to accurately define both for the reader. If something is to be considered a pattern, this means that this is a recommended practice in the vast majority of cases. On the contrary, if I've defined it as an anti-pattern, then it's most likely not a recommended practice in a vast majority of cases. For further information on this, a good source of patterns and guidelines can be found at https://github.com/pablohpsilva/vuejs-component-style-guide.
Software development is an opinionated field with a variety of ways to solve the same problem, so there may be ideologies that are classified as something you don't agree with, and that's okay. At the end of the day, each team has their own style, but developers should seek to stick to patterns that reduce friction and speed up development where possible.
In this chapter, we'll learn about the following topics:
- Common patterns and anti-patterns within Vue projects
- Container/presentational components
- How to write testable Vue.js components