Make Scratch an installable PWA #13
Loading…
Reference in a new issue
No description provided.
Delete branch "pwa-installable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Scratch is now an installable progressive web app: a home-screen icon, standalone (no browser chrome) display, and a cached app shell for instant loads.
Changes
packages/client/public/manifest.webmanifest): standalone display, portrait orientation, app name/description, theme + background colors, and icon entries. Linked fromindex.html.icons/icon.svgand rendered toicon-192.png/icon-512.png. The 512 also serves as the maskable icon — the card stays inside the maskable safe zone, so the same artwork works for bothanyandmaskablepurposes.apple-touch-icon.png(180) for iOS.apple-touch-icon,apple-mobile-web-app-capable,apple-mobile-web-app-title, plus adescription.packages/client/public/sw.js, registered inmain.tsxin production only):/, manifest, icons);vitedev mode so it doesn't fight live reload..webmanifestwithapplication/manifest+json.packages/client/src/pwa.test.ts): manifest is valid JSON with the installability fields and only references icons that exist; the service worker parses as a valid script and precaches the shell; the app shell links the manifest and apple touch icon.Why this is the right scope
The game is real-time over WebSockets, so true offline play isn't possible. What a PWA genuinely gives us here is installability (home-screen icon, standalone mode — which also permanently avoids the short-viewport problem the browser chrome causes), plus an app shell that opens instantly and still loads when the network is down (the app shows its reconnect state rather than a blank page).
Verified
/, manifest, and both icons.application/manifest+json; icons served with correct MIME.Note: the
bot pacingtest insession.test.tsis timing-sensitive and flakes occasionally under load; it is unrelated to this change (no game/session code touched).