Building Progressive Web Applications with Vue.js: Reliable, Fast, and Engaging Apps with Vue.js
By Carlos Rojas
()
About this ebook
Building Progressive Web Applications with Vue.js starts by explaining the basic concepts and structure of PWAs, and moves on to designing the app shell and other features that distinguish a PWA from simple web pages. In the following chapters, the book talks about the improved web technologies, such as service workers, caching strategies, background sync, and push notifications, that make PWAs powerful.
What You Will Learn
- Harness the power of Vue.js to build PWAs
- Understand the function and relevance of a manifest file
- Discover service workers and why they are revolutionary
- Work with the Cache API and caching strategies
- Use IndexedDB, background sync, and push notifications
- Enhance your apps with Firebase
- Implement the Workbox library in your apps
Who This Book Is ForWeb developers who want to venture into building PWAs would find the book useful.
Related to Building Progressive Web Applications with Vue.js
Related ebooks
Creating iOS apps with Xcode: Learn how to develop your own app (English Edition) Rating: 0 out of 5 stars0 ratingsBeginning Backbone.js Rating: 3 out of 5 stars3/5Introducing Bootstrap 4: Create Powerful Web Applications Using Bootstrap 4.5 Rating: 0 out of 5 stars0 ratingsInnovation: Awesome Inventions Rating: 0 out of 5 stars0 ratingsAutodesk 3ds Max 2024: A Comprehensive Guide, 24th Edition Rating: 0 out of 5 stars0 ratingsLittle Book of Scooters Rating: 0 out of 5 stars0 ratingsHello World: Student to Software Professional - a Transformation Guide Rating: 0 out of 5 stars0 ratingsHow Do Telescopes, Binoculars, and Microscopes Work? Rating: 0 out of 5 stars0 ratingsSous Vide Cookbook: the Effortless Technique for Perfectly Cooked Meals Rating: 0 out of 5 stars0 ratingsMeteor in Action Rating: 0 out of 5 stars0 ratingsBuilding B2B Applications with XML: A Resource Guide Rating: 5 out of 5 stars5/5Building Games with Ethereum Smart Contracts: Intermediate Projects for Solidity Developers Rating: 0 out of 5 stars0 ratingsWho Is the Real Hog? Rating: 0 out of 5 stars0 ratingsPractical Django 2 and Channels 2: Building Projects and Applications with Real-Time Capabilities Rating: 0 out of 5 stars0 ratingsRegex Quick Syntax Reference: Understanding and Using Regular Expressions Rating: 0 out of 5 stars0 ratingsAutoCAD Electrical 2020: A Tutorial Approach Rating: 0 out of 5 stars0 ratingsThe Definitive Guide to How Computers Do Math: Featuring the Virtual DIY Calculator Rating: 0 out of 5 stars0 ratingsASP.NET Core in Action, Third Edition Rating: 0 out of 5 stars0 ratingsLearning Highcharts 4 Rating: 0 out of 5 stars0 ratingsMastering Elasticsearch 5.x - Third Edition Rating: 0 out of 5 stars0 ratingsDemystifying Smart Cities: Practical Perspectives on How Cities Can Leverage the Potential of New Technologies Rating: 0 out of 5 stars0 ratingsMobile Robots: Navigation, Control and Remote Sensing Rating: 0 out of 5 stars0 ratingsSchematron: A language for validating XML Rating: 0 out of 5 stars0 ratingsBlazor WebAssembly by Example: A project-based guide to building web apps with .NET, Blazor WebAssembly, and C# Rating: 0 out of 5 stars0 ratingsObjective-C Fundamentals Rating: 0 out of 5 stars0 ratingsAutoCAD Electrical 2024 for Electrical Control Designers, 15th Edition Rating: 0 out of 5 stars0 ratingsCSS Mastery: Styling Web Pages Like a Pro Rating: 0 out of 5 stars0 ratingsSan Francisco Secrets: Sam Slater Mysteries Rating: 4 out of 5 stars4/5Satellite Systems for Personal Applications: Concepts and Technology Rating: 0 out of 5 stars0 ratingsPractical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools Rating: 0 out of 5 stars0 ratings
Internet & Web For You
Coding For Dummies Rating: 5 out of 5 stars5/5Wireless Hacking 101 Rating: 5 out of 5 stars5/5No Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5The Gothic Novel Collection Rating: 5 out of 5 stars5/5How to Be Invisible: Protect Your Home, Your Children, Your Assets, and Your Life Rating: 4 out of 5 stars4/5Podcasting For Dummies Rating: 4 out of 5 stars4/5The $1,000,000 Web Designer Guide: A Practical Guide for Wealth and Freedom as an Online Freelancer Rating: 5 out of 5 stars5/5How to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsSocial Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5How To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Tor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5Remote/WebCam Notarization : Basic Understanding Rating: 3 out of 5 stars3/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5Get Rich or Lie Trying: Ambition and Deceit in the New Influencer Economy Rating: 0 out of 5 stars0 ratingsHow To Start A Podcast Rating: 4 out of 5 stars4/5Cybersecurity For Dummies Rating: 5 out of 5 stars5/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5HTML in 30 Pages Rating: 5 out of 5 stars5/5Print On Demand Profits Rating: 4 out of 5 stars4/5How To Make Money Blogging: How I Replaced My Day-Job With My Blog and How You Can Start A Blog Today Rating: 4 out of 5 stars4/5Stop Asking Questions: How to Lead High-Impact Interviews and Learn Anything from Anyone Rating: 5 out of 5 stars5/5WordPress For Dummies Rating: 0 out of 5 stars0 ratingsWordpress for Beginners: The Easy Step-by-Step Guide to Creating a Website with WordPress Rating: 5 out of 5 stars5/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsHacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5
Reviews for Building Progressive Web Applications with Vue.js
0 ratings0 reviews
Book preview
Building Progressive Web Applications with Vue.js - Carlos Rojas
© Carlos Rojas 2020
C. RojasBuilding Progressive Web Applications with Vue.js https://doi.org/10.1007/978-1-4842-5334-2_1
1. Making Your First Progressive Web App
Carlos Rojas¹
(1)
Medellin, Colombia
Welcome to this journey of building your first progressive web app (PWA). In this chapter, we build VueNoteApp, which is a simple notebook app, and then convert it to a PWA, all while discovering some critical concepts along the way.
What Is a PWA?
PWAs are a trend that points to where web development is evolving. Therefore, it is essential to be exposed to this technology and spend some time studying it.
PWAs are the intersection between a web interaction and a mobile app user experience. Some of the features you’ll find in PWAs are as follows¹:
Progressive: They work for every user.
Adaptable: Their functionality adapts to the device regardless of whether it is a mobile, desktop, tablet, and so on.
Connectivity independent: They support offline functions, in addition to low-quality connections or LiFi.
App style: For users, PWAs are similar to a downloadable app from a store.
Fresh: Thanks to their caching strategies, they are updated every time a connection is available.
Secure: They work with HTTPS.
Discoverable: Search engines are capable of indexing PWAs and detecting them as apps.
Able to be reengaged: They allow push notifications after users install them, similar to apps you download from a store.
Installable: They allow users to have the app available on their device with an access icon, just like apps that download from a store.
Linkable: They can be shared easily with a URL.
To become familiar with the power of PWAs, check out https://pwa.rocks/.
Why Build a PWA?
PWAs open a new universe of possibilities to extend capabilities in web apps and provide users with a familiar experience. Some advantages in choosing to build PWAs instead of using other technologies are as follows:
Web platform: Web capabilities are robust and extended in the major mobile and desktop operating systems.
Web developers: Start in web developing is accessible and inclusive. All web technologies are open; you don’t have software restrictions.
Distribution: Web browsers are distribution channels. PWAs are shared easily with URLs.
Easy deployment: You don’t need to wait for approval of fixes or new features; just push your code to your server and, instantly, you have a new version.
Low friction: App stores are a stressful experience for beginning users. With PWAs, you only need a link to install them.
What Is the Structure of a PWA?
Progressive applications are, in general terms, a regular Single Page Aplication. That is, they have the regular structure of a web app or single-page application (SPA), with an index (index.html) and HTML, Cascading Style Sheets (CSS), and JavaScript (JS) files. But, in addition to these items, three other things are required to be considered a PWA:
1.
A manifest file: A file that describes the information in the PWA
2.
An app icon: An image used as an icon on mobile devices when installed
3.
Service workers: A JS file registered in the browser that allows tasks such caching and pushing notifications, among other things
So, this is what we are going to create next, after we go over some prerequisites.
Getting Started
To start to build our first PWA, we need to examine and install some technologies.
Node.js
Node.js is a JS runtime environment. Most of the projects using JS use Node to install dependencies and create scripts to automate the development workflow.
You install Node on your machine by downloading it from https://nodejs.org/en/.
After you download the installer, run it (Figure 1-1).
../images/483082_1_En_1_Chapter/483082_1_En_1_Fig1_HTML.jpgFigure 1-1
Node.js installer package
Follow the instructions. Figure 1-2 shows the welcome page.
../images/483082_1_En_1_Chapter/483082_1_En_1_Fig2_HTML.jpgFigure 1-2
Installer step 1
When this is complete, open your terminal and run
$node -v
If everything is okay, you’ll see the Node version in your terminal (Figure 1-3).
../images/483082_1_En_1_Chapter/483082_1_En_1_Fig3_HTML.jpgFigure 1-3
Terminal node version command
npm
When you install Node.js, you install npm, which is a package manager for JS. It is the default package manager for Node and it consists of a command-line client, called npm, and an online database of packages called the npm registry.
Check the version of npm you are running (Figure 1-4):
$npm -v
../images/483082_1_En_1_Chapter/483082_1_En_1_Fig4_HTML.jpgFigure 1-4
Terminal npm version command
Google Chrome
Chrome is a web browser that provides excellent support to PWAs and includes Chrome DevTools, which is a handy feature for developers. You can download and install from
https://www.google.com/chrome/
To install, just run the installer and follow the steps. The result is shown in Figure 1-5.
../images/483082_1_En_1_Chapter/483082_1_En_1_Fig5_HTML.jpgFigure 1-5
Google Chrome installed
Chrome DevTools
As mentioned, Chrome DevTools (Figure 1-6) is a set of web developer tools included in the Google Chrome browser. DevTools helps developers diagnose problems in their apps and makes their apps faster.