1.6 KiB
1.6 KiB
homey/work-history/recent
2026-07-31 Fri
- Restored EmulatorJS offline mode (previously removed because a cache-first Service Worker broke game loading). Rewrote
modules/services/emulatorjs-server.pyas a network-first PWA: SW only reads cache when offline, so it cannot break online play. - Added installable PWA (
/manifest.json, stdlib-generated/icon-256.png), build-scopedemujs-shell-<BUILD_ID>cache with auto-invalidation on redeploy, and an opt-in per-game ⬇ download button caching ROMs into a persistentemujs-romscache. - Kept IndexedDB offline save queue with sync-on-reconnect; player loads
loader.jsdirectly (removed the preflight gate). - Verified via module import + live HTTP smoke test (all routes 200;
/sw.jshasService-Worker-Allowed: /). - Decided against Background Sync and timestamp-merge for saves (owner said not relevant). Decided against PS1/disc hosting for now (scoped it: needs psx core + BIOS + streamed ROM serving).
- Recorded design in new org-roam subnode homey/emulatorjs.
- Fixed offline "Error downloading core (mgba-legacy-wasm.data)": the SW isn't controlling the page on first visit, so the core fetched during first online play was never cached. Added page-side
cacheLoadedStatic()that readsperformance.getEntriesByType('resource')and writes the actually-loaded/static/files into the shell cache directly (runs on game start + delayed + on reconnect). Download button now also caches the/play/<name>document.