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:
+10
-5
@@ -25,11 +25,16 @@
|
||||
it and refreshes onto the new assets; "Later" dismisses until next time.
|
||||
Suppressed on the very first install (see app.js). -->
|
||||
<div id="update-banner" class="update-banner" hidden role="status" aria-live="polite">
|
||||
<span class="update-banner-msg">A new version is available</span>
|
||||
<span class="update-banner-actions">
|
||||
<button type="button" id="update-reload" class="update-banner-btn">Reload</button>
|
||||
<button type="button" id="update-later" class="update-banner-btn ghostish">Later</button>
|
||||
</span>
|
||||
<div class="update-banner-row">
|
||||
<span class="update-banner-msg">A new version is available</span>
|
||||
<span class="update-banner-actions">
|
||||
<button type="button" id="update-reload" class="update-banner-btn">Reload</button>
|
||||
<button type="button" id="update-later" class="update-banner-btn ghostish">Later</button>
|
||||
</span>
|
||||
</div>
|
||||
<!-- What the waiting build adds over the running one; filled by app.js
|
||||
from the diff between the cached and the fresh changelog.json. -->
|
||||
<ul id="update-changelog" class="update-changelog" hidden></ul>
|
||||
</div>
|
||||
|
||||
<!-- Login / register gate. Shown until the session check succeeds; the app
|
||||
|
||||
Reference in New Issue
Block a user