1.1.0 • Published 1 year ago

@ducanh2912/next-sw v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NOTE: This package is not ready at the moment. Please use @ducanh2912/next-pwa instead.

Zero-config PWA plugin for Next.js

This plugin is powered by Service Worker and other good stuff.

Build Size Version

Features

  • 0️⃣ Zero-config for registering and generating service worker out of the box
  • ✨ Optimized precaching and runtime caching (in progress)
  • 💯 Maximal Lighthouse score (not guaranteed for now)
  • 🎈 Easy-to-understand examples
  • 📦 Uses Service Worker
  • 🛠 Configurable (more in future!)
  • 🚀 Spin up a GitPod and try out examples in rocket speed (or use create-next-app to create a brand new Next.js app with them (for example, run pnpm create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/workboxless to create a new Next.js app using the basic example))

NOTE 1 - next-pwa version 2.0.0+ should only work with Next.js 9.1+, and static files should only be served through the public directory.

NOTE 2 - @ducanh2912/next-sw currently doesn't support Turbopack, but I will start working on it as soon as we get our hands on Turbopack.


Open in Gitpod

How is it different from @ducanh2912/next-pwa?

It directly makes use of the ServiceWorker API instead of workbox. Both are supported, so just make a pick! If you are not sure, you may want to use @ducanh2912/next-pwa instead as it allows you to customize your service worker further.

Reference

  1. ServiceWorker, MessageChannel, & postMessage by Nicolás Bevacqua
  2. The service worker lifecycle
  3. 6 Tips to make your iOS PWA feel like a native app
  4. Make your PWA available on Google Play Store