Book Image

ASP.NET Core 2 and Vue.js

By : Stuart Ratcliffe
5 (1)
Book Image

ASP.NET Core 2 and Vue.js

5 (1)
By: Stuart Ratcliffe

Overview of this book

This book will walk you through the process of developing an e-commerce application from start to finish, utilizing an ASP.NET Core web API and Vue.js Single-Page Application (SPA) frontend. We will build the application using a featureslice approach, whereby in each chapter we will add the required frontend and backend changes to complete an entire feature. In the early chapters, we’ll keep things fairly simple to get you started, but by the end of the book, you’ll be utilizing some advanced concepts, such as server-side rendering and continuous integration and deployment. You will learn how to set up and configure a modern development environment for building ASP.NET Core web APIs and Vue.js SPA frontends.You will also learn about how ASP.NET Core differs from its predecessors, and how we can utilize those changes to our benefit. Finally, you will learn the fundamentals of building modern frontend applications using Vue.js, as well as some of the more advanced concepts, which can help make you more productive in your own applications in the future.
Table of Contents (15 chapters)

Understanding the Fundamentals

Many modern web applications are now built as client-rendered Single-Page Applications (SPAs) rather than traditional server-rendered multipage applications. An SPA is a web application that only contains a single physical HTML page. This single page then uses JavaScript within a web browser to dynamically rewrite parts of the HTML, usually based on JSON data that's retrieved from API calls to the server. By doing so, after the initial page load, the application has no need to request full HTML pages from the server, which helps make it as fast and responsive as a native desktop application.

When it comes to building SPAs in 2018, we are absolutely spoiled for choice in frameworks and technologies that we could potentially use to help us build our apps. Regardless of their chosen technology stack, most web developers will probably have extensively used jQuery for their client-side JavaScript needs, and there is no reason why it couldn't be used to build SPAs as well. However, there are far better frameworks that are specifically designed to help us build modern SPAs.

Vue.js is a JavaScript framework for building the view layer of your applications. However, it differs from other large frameworks because it's designed to be incrementally adoptable. That is, with a single CDN script reference, you can plug Vue into a small portion of an existing application in much the same way as you would with jQuery. On the other hand, you could opt to use the modern tooling and supporting libraries in Vue's ecosystem to build a fully-fledged SPA from scratch. Vue really is one of the most simple yet powerful frameworks, with very little compromise in return.

ASP.NET Core is the latest version of Microsoft's ASP.NET web development framework. It has been completely rewritten to be more lightweight and modular, as well as to offer official cross-platform support for the first time. If you are reading this book, it is reasonably safe to assume that you are most likely already an experienced ASP.NET developer, with minimal experience of frontend frameworks and technologies. However, if you already have a basic understanding of Vue.js, then you may be able to skip this chapter, as it will be aimed primarily at those with no experience at all. Regardless of your level of experience with Vue, if you are already familiar with ASP.NET Core, then at the very least you can skip the ASP.NET Core sections near the end of this chapter. That being said, I'll only be focusing on areas where ASP.NET Core differs from previous versions of ASP.NET.

In summary, we'll cover the following topics:

  • What are components?
  • How do we compose a UI using components?
  • Client-side application state
  • Fundamental Vue concepts such as props, methods, computed properties, and directives
  • What's new in ASP.NET Core?
  • What's new in EF Core?