Repository navigation
Conversation
The five install icons leave the Workbox precache; the browser fetches them from the manifest at install time. theme-init.js is minified in dist at build, so the precache revision hashes the minified bytes. Precache: 1,677.86 KiB on main, 1,644.33 KiB on this branch. The ceiling drops from 1,680 KiB to 1,659 KiB. Refs #1322
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1322
The service worker precache drops from 1,677.86 KiB to 1,644.33 KiB (33.53 KiB less).
PRECACHE_CEILING_KIBgoes down from 1,680 to 1,659, which leaves 14.67 KiB of headroom.What changed
Both changes are in
web/vite.config.ts.web/scripts/verify-sw.mjsonly gets the new ceiling and a history entry.icon-*.png,apple-touch-icon.png) are added toglobIgnores, which saves 30.73 KiB. The browser downloads them from the manifest when someone installs the app, and that happens online. They are still indistand are still served.includeManifestIcons: falsestays, because the plugin would otherwise add them back. Its old comment said Workbox precaches the icons anyway, so I rewrote it.minifyThemeInit()plugin minifiesdist/theme-init.jsat build time, from 3,754 to 895 bytes.public/theme-init.jsstays readable. The plugin useswriteBundle, which runs before the PWA plugin'scloseBundle, so the precache revision is the hash of the minified file. The script is minified as a classic script, not a module, so its top-levelvars are still globals, exactly as before. The URL (/theme-init.js) and the CSP do not change.Verification
theme-init.jsrevision indist/sw.jsequals the MD5 ofdist/theme-init.js.node scripts/verify-sw.mjs distpasses, reporting 1,644.33 KiB against the 1,659 KiB ceiling. I measured main (884b971) at 1,677.86 KiB on the same machine.node --test scripts/*.test.mjspasses 19/19. TheopticalSize,themeInitandthemeVitest files pass 42/42, andnpm run typecheckis clean.themeInit.test.tsonce against the minifieddistfile. All 19 behavior tests passed. Only the slug-pattern parity test failed, which is expected because it compares source text.Not in this PR
No screenshots: nothing a user sees changes.