Book Image

ASP.NET Core and Vue.js

By : Devlin Basilan Duldulao
Book Image

ASP.NET Core and Vue.js

By: Devlin Basilan Duldulao

Overview of this book

Vue.js 3 is faster and smaller than the previous version, and TypeScript’s full support out of the box makes it a more maintainable and easier-to-use version of Vue.js. Then, there's ASP.NET Core 5, which is the fastest .NET web framework today. Together, Vue.js for the frontend and ASP.NET Core 5 for the backend make a powerful combination. This book follows a hands-on approach to implementing practical methodologies for building robust applications using ASP.NET Core 5 and Vue.js 3. The topics here are not deep dive and the book is intended for busy .NET developers who have limited time and want a quick implementation of a clean architecture with popular libraries. You’ll start by setting up your web app’s backend, guided by clean architecture, command query responsibility segregation (CQRS), mediator pattern, and Entity Framework Core 5. The book then shows you how to build the frontend application using best practices, state management with Vuex, Vuetify UI component libraries, Vuelidate for input validations, lazy loading with Vue Router, and JWT authentication. Later, you’ll focus on testing and deployment. All the tutorials in this book support Windows 10, macOS, and Linux users. By the end of this book, you’ll be able to build an enterprise full-stack web app, use the most common npm packages for Vue.js and NuGet packages for ASP.NET Core, and deploy Vue.js and ASP.NET Core to Azure App Service using GitHub Actions.
Table of Contents (25 chapters)
1
Section 1: Getting Started
4
Section 2: Backend Development
13
Section 3: Frontend Development
20
Section 4: Testing and Deployment

Introducing Vue.js

Vue.js is a JavaScript framework for building user interfaces. In a nutshell, Vue.js gives frontend developers everything that they would want. Vue.js has the characteristics of being performant, size-efficient, progressive, developer-friendly, and has one of the slimmest barriers to entry if you are new to frontend development.

Today, Vue.js has more than 1.3 million weekly active users (based on the statistics of Vue.js Devtool extensions) and more than 8 million npm downloads per month.

Today, Vue.js is being used by some of the most iconic and influential organizations around the world, such as Apple, IBM, Microsoft, Google, Nike, Wikimedia, NASA, Pixar, Louis Vuitton, L'Oréal, and tens of thousands of businesses of all sizes.

In the next couple of sections of this chapter, we will check out what the Vue.js core team has added in the new Vue.js 3, and whether learning Vue.js a good investment of your time.

Let's find out.

What's new in Vue.js?

After 2 years of development, the Vue.js core team has finally released the latest Vue.js, version 3, codenamed One Piece. The changes are listed here:

  • More maintainable: The Vue.js code base has been re-written in TypeScript for maintainability, and the internals are more modular.
  • Faster: Vue.js 3 is faster and has better performance than Vue.js 2. The new version has a new proxy-based reactivity system.
  • Smaller: Vue.js has tree shaking; tree shaking is a method to remove unused libraries from the project automatically. This capability is essential to make the file size smaller than the previous version. Vue.js 3 also has some compile-time flags that allow you to drop things that cannot automatically be tree-shaken.
  • Scales better: Vue.js now provides the Composition API, an easier way to reuse a segment of Vue.js component logic. The Composition API is an exciting new feature that solves complex use cases such as sharing business logic between components.
  • A better developer experience: For me, Vue.js already provided unparalleled developer experience, but Vue.js has improved it in Vue.js 3 (by introducing the new single-file component improvements, type checking for template expressions, and props of sub-components).

Why is learning Vue.js the right choice?

Along with Angular and React, Vue.js makes up one of the big three JavaScript tools for building modern web applications. Vue.js is not backed by a tech company such as Microsoft or any of the Facebook, Amazon, Apple, Netflix, and Alphabet (FAANG) companies. However, through the years of excellent tooling and the great documentation Vue.js provides, it has acquired numerous sponsors worldwide (you can see the list of sponsors at https://github.com/vuejs/vue). Having several sponsorships is good because there will be constant maintenance and improvements in Vue.js.

Third-party libraries such as UI libraries, routing libraries, forms, state management, static site generators, are getting better. Hence, making Vue.js a dependable, trustworthy, solid, stable, reliable, and developer-friendly framework for building enterprise applications. Not to mention that Vue.js has 100+ contributors right now, adding new features, improvements, and fixing all issues that appear on GitHub Vue.js.

This ends our quick overview of Vue.js and what is new in Vue.js 3. You have learned the current state of Vue.js and why considering Vue.js 3 as your frontend application best fits developing modern web applications nowadays.