Book description
Start or migrate to the new Vue 3 ecosystem, and learn to use Vite, Pinia, Web Workers, and other techniques to develop Single and Progressive Page Applications on solid ground
Key Features
- Learn software engineering best practices and design patterns and apply them effectively to your Vue applications
- Build both SPAs and PWAs using Web Workers and IndexedDB
- Develop, test, build, and deploy your Vue 3 applications to a real production server
Book Description
If you’re familiar with the progressive Vue framework for creating responsive user interfaces, you’ll be impressed with its latest iteration, Vue 3, which introduces new concepts and approaches design patterns that are uncommon in other libraries or frameworks. By building on your foundational knowledge of Vue 3 and software engineering principles, this book will enable you to evaluate the trade-offs of different approaches to building robust applications.
This book covers Vue 3 from the basics, including components and directives, and progressively moves on to more advanced topics such as routing, state management, web workers, and offline storage. Starting with a simple page, you’ll gradually build a fully functional multithreaded, offline, and installable progressive web application.
By the time you finish reading this Vue book, not only will you have learned how to build applications, but you’ll also understand how to solve common problems efficiently by applying existing design patterns. With this knowledge, you’ll avoid reinventing the wheel for every project, saving time and creating software that’s adaptable to future changes.
What you will learn
- What is the Vue 3 progressive framework
- What are software principles and design patterns, how and when to implement them, and the trade-offs to consider
- Setup your development environment using the new Vite bundler
- Integrate in your applications state management, routing, multithreading, offline storage, and other resources provided to you by the browser, seldom taken advantage
- Apply and identify design patterns to solve common problems in the architecture of your web application
- Best practices for your code, organization, architecture, and user experience implementation
- Incrementally expand an application with new functionalities without re-writing the whole application each time
Who this book is for
This book is for Vue.js developers who are passionate about framework design principles and seek to apply commonly found design patterns to their web development projects. This book assumes prior knowledge of JavaScript and a basic understanding of Vue.js, making it an ideal resource for developers looking to expand their existing skillset.
Table of contents
- Vue.js 3 Design Patterns and Best Practices
- Foreword
- Contributors
- About the author
- About the reviewers
- Preface
- Chapter 1: The Vue 3 Framework
- Chapter 2: Software Design Principles and Patterns
- Chapter 3: Setting Up a Working Project
- Chapter 4: User Interface Composition with Components
- Chapter 5: Single-Page Applications
- Chapter 6: Progressive Web Applications
-
Chapter 7: Data Flow Management
- Technical requirements
- Components’ basic communication
- Implementing an event bus with the Singleton and Observer patterns
- Implementing a basic reactive state
- Implementing a powerful reactive store with Pinia
- Browser data stores – session, local, and IndexedDB
- Experimenting with reactivity and Proxies patterns
- Summary
- Review questions
-
Chapter 8: Multithreading with Web Workers
- Technical requirements
- An introduction to web workers
- The business delegate pattern
- The dispatcher pattern
- Establishing a communication pipeline with the web worker
- Accessing IndexedDB with DexieJS in the web worker
- Consuming a RESTful API with the web worker
- A simple NodeJS server for testing
- Summary
- Review questions
-
Chapter 9: Testing and Source Control
- Technical requirements
- What are testing and TDD
- What to test
- Our base example application
- Installation and use of Vitest
- Installation of Vue Test Utils
- In-source testing
- Coverage
- The Vitest UI
- What is source control... and why?
- Source control with Git
- Continuous Integration and Delivery
- Summary
- Review questions
- Chapter 10: Deploying Your Application
- Chapter 11: Bonus Chapter - UX Patterns
-
Appendix: Migrating from Vue 2
- A different way to bootstrap and start the application
- Register global components, plugins, and so on
- The data property is now always a function
- There are more reactive options to choose from
- Changes to v-model, props, and events
- Removed old browser compatibility
- Changes in directory and file organization
- Changes in the router and state management
- New components and other changes
- Other breaking changes
- Summary
- Final words
- Index
- Other Books You May Enjoy
Product information
- Title: Vue.js 3 Design Patterns and Best Practices
- Author(s):
- Release date: May 2023
- Publisher(s): Packt Publishing
- ISBN: 9781803238074
You might also like
book
React 18 Design Patterns and Best Practices, 4e - Fourth Edition
Dive in and discover how to build awesome React web apps that you can scale and …
book
API Design Patterns
A collection of best practices and design standards for web and internal APIs. In API Design …
book
Node.js Design Patterns - Third Edition
Learn proven patterns, techniques, and tricks to take full advantage of the Node.js platform. Master well-known …
book
Refactoring: Improving the Design of Existing Code
Fully Revised and Updated–Includes New Refactorings and Code Examples “Any fool can write code that a …