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:
Alexander Heldt
2026-07-12 17:29:32 +00:00
parent 2b4731185c
commit 094af3906d
6 changed files with 68 additions and 11 deletions
+1 -1
View File
@@ -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"},
}
}