Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vue.js 3 Design Patterns and Best Practices

You're reading from   Vue.js 3 Design Patterns and Best Practices Develop scalable and robust applications with Vite, Pinia, and Vue Router

Arrow left icon
Product type Paperback
Published in May 2023
Publisher Packt
ISBN-13 9781803238074
Length 296 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Pablo David Garaguso Pablo David Garaguso
Author Profile Icon Pablo David Garaguso
Pablo David Garaguso
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Chapter 1: The Vue 3 Framework 2. Chapter 2: Software Design Principles and Patterns FREE CHAPTER 3. Chapter 3: Setting Up a Working Project 4. Chapter 4: User Interface Composition with Components 5. Chapter 5: Single-Page Applications 6. Chapter 6: Progressive Web Applications 7. Chapter 7: Data Flow Management 8. Chapter 8: Multithreading with Web Workers 9. Chapter 9: Testing and Source Control 10. Chapter 10: Deploying Your Application 11. Chapter 11: Bonus Chapter - UX Patterns 12. Final words 13. Index 14. Other Books You May Enjoy Appendix: Migrating from Vue 2

What is a software design pattern?

In software development, it is common for certain processes and tasks to appear in multiple projects, in one way or another, or with some degree of variation. A design pattern is a proven solution for such similar problems. It does not prescribe code but acts like a reasoning template, an approach that has been abstracted independent of the implementation to be reused and adapted to particular circumstances. In practice, there is plenty of room for creativity to apply a pattern. Entire books have been dedicated to this subject and provide more detail than the scope of this book allows. In the following pages, we will take a look at what I consider to be the most recurrent patterns to keep in mind for Vue 3 applications. Even though we see them in isolation for the purposes of studying them, the reality is that often the implementation overlaps, mixes, and encapsulates multiple patterns in a single piece of code. For example, you can use a singleton to act as a decorator and a proxy to simplify or alter the communication between services in your application (we will do this quite often, actually, and the full code can be seen in Chapter 8, Multithreading with Web Workers).

Design patterns can also be understood as software engineering and development best practices. And the opposite of that, bad practice, is often referred to as an anti-pattern. Anti-patterns are “solutions” that, even though they fix an issue in the short term, create problems and bad consequences along the line. They generate the need to work around the problem and destabilize the whole structure and implementation.

Let’s now view a list of patterns that should be part of your toolbox for Vue 3 projects.

You have been reading a chapter from
Vue.js 3 Design Patterns and Best Practices
Published in: May 2023
Publisher: Packt
ISBN-13: 9781803238074
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image