Show a changelog in the update banner
changelog.json is a hand-maintained, newest-first list of user-visible changes; it is part of the SW asset cache and the build hash, so even a changelog-only edit rolls a new version. When the update banner appears, the app fetches changelog.json twice: the plain URL is answered cache-first by the old controlling worker (the running build's copy) while a cache-busting query bypasses every SW cache and hits the network (the waiting build's copy). Entries the fresh copy has that the cached one lacks are exactly what the update brings, and are listed under the banner message.
This commit is contained in:
+1
-1
@@ -517,7 +517,7 @@ func newSWVersion(dir string) *swVersion {
|
||||
// circular and it never changes except when we edit it here.
|
||||
return &swVersion{
|
||||
dir: dir,
|
||||
files: []string{"index.html", "style.css", "app.js", "manifest.json", "icon.svg"},
|
||||
files: []string{"index.html", "style.css", "app.js", "manifest.json", "icon.svg", "changelog.json"},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user