fluxy-bot 0.10.11 → 0.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
4
4
  "releaseNotes": [
5
5
  "Adding a way for users to claim their fluxies on the fluxy.bot dashboard",
6
6
  "2. ",
@@ -1,14 +1,19 @@
1
1
  // Service worker — app-shell caching + push notifications
2
2
  // Caching strategy:
3
3
  // Hashed assets (/assets/*-AbCd12.js) → cache-first (immutable)
4
- // Navigation (HTML) → network-first, cache fallback
4
+ // Navigation (HTML) → stale-while-revalidate (precached on install)
5
5
  // Static assets (img/video/fonts) → stale-while-revalidate
6
6
  // JS/CSS modules → stale-while-revalidate
7
7
  // API, WebSocket, Vite internals → network-only (no cache)
8
8
 
9
- const CACHE = 'fluxy-v3';
9
+ const CACHE = 'fluxy-v4';
10
10
 
11
- self.addEventListener('install', () => self.skipWaiting());
11
+ // Precache the HTML shell on install so the cache is never empty.
12
+ // Without this, the first navigation isn't intercepted (SW wasn't
13
+ // controlling yet), so refresh would find an empty cache → white screen.
14
+ self.addEventListener('install', (e) => e.waitUntil(
15
+ caches.open(CACHE).then(c => c.add('/')).then(() => self.skipWaiting())
16
+ ));
12
17
 
13
18
  self.addEventListener('activate', (e) => e.waitUntil(
14
19
  caches.keys()