Thanks to visit codestin.com
Credit goes to developer.mozilla.org

此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

漸進式網路應用程式

漸進式網路應用程式(Progressive web app)使用當代 web API,並以漸進增強策略,建立跨平台 web 應用程式。 這些程式提供了能讓用戶體驗,逼近於原生程式的功能。這套文件將講述你需要知道的一切。

PWA 優勢

PWA 應該要可探索、可安裝、可連結、可獨立於網路、可漸進、可接合、響應式、以及安全(discoverable, installable, linkable, network independent, progressive, re-engageable, responsive, safe)。需要有關這方面的理解,請參閱漸進式網路應用程式的優勢。如果需要實作細節,請參考以下章節表列的教學。

PWA 核心教學

以下教學將以簡單例子告訴你,在實作 PWA 時所需要的東西,並講述一切如何運行。

  1. 漸進式網路應用程式簡介
  2. 漸進式網路應用程式架構
  3. 使用 Service worker 讓 PWA 能離線工作
  4. 如何令 PWA 可安裝
  5. 如何使用 Notifications 與 Push 令 PWA 可重連線
  6. 漸進式載入

技術教學

工具

  • localForage:讓用戶端儲存變簡單的輕量化 JavaScript 函式庫。預設上使用 IndexedDB,必要時則改用 SQL/Web 儲存。
  • ServiceWorkerWare — an Express-like microframework for easy Service Worker development.
  • oghliner — not only a template but a tool for deploying Offline Web Apps to GitHub Pages.
  • sw-precache — a node module to generate service worker code that will precache specific resources.
  • workbox — spiritual successor to sw-precache with more advanced caching strategies and easy precaching.
  • upup — a tiny script that makes sure your site is always there for your users.
  • The service worker cookbook — A series of excellent service worker/push recipes, showing how to implement an offline app, but also much more.

參見