📎 Webclip
How to easily turn your website to a Progressive Web App(PWA)
The tutorial shows how to turn a normal website into a Progressive Web App by adding a web manifest, a service worker, and icons. It says PWAs should be reliable, fast, and engaging, and that the app must run on HTTPS.
Reading notes#
- A PWA is presented as a web app built with HTML, CSS, and JavaScript that can work on any standards-compliant browser and support offline use, push notifications, and hardware access.
- The article says the main parts of a PWA are the web manifest, the service worker, and the static website.
- The example rebuilds a random quote app with
index.html,css/style.css, andjs/app.js. - The JavaScript loads random quotes, updates the quote and author in the page, and changes the share link.
- The service worker is registered on page load when the browser supports service workers.
- Workbox is used in
sw.jsto precache assets, cache images, keep CSS and JavaScript fresh with stale-while-revalidate, and cache Google Fonts. - The
manifest.jsonfile defines the app name, short name, icons, start URL, display mode, background color, and theme color. - The page links the manifest and theme color in
index.htmlso the app can be added to the home screen. - The article says the icon set should include sizes from 72x72 up to 512x512.
- It closes by saying PWAs improve user experience and support offline mode, and that HTTPS is required for local testing.
