chore(pwa): offline shell bundle budget check (#50) - #94
Merged
Merged
Conversation
Deploying sirigannada with
|
| Latest commit: |
efa9aae
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2e21b676.sirigannada.pages.dev |
| Branch Preview URL: | https://chore-bundle-budget.sirigannada.pages.dev |
scripts/check-bundle.ts sums the precached shell (routes, their /_next/static assets, manifest, icons) from the static export and prints a table; CI runs it after the build. The shell measures 2.16 MB today, about 5 % over, so the check warns rather than fails until the owner picks a budget or trims fonts and JS. Signed-off-by: Devu Dilip <devu.dilip@gmail.com>
… budget (#50) The install shell had grown to 2,159 KB. Precaching now covers the core routes only (home, dictionary, library, proverbs, collections, practice, games, the stories and picture-book hubs, More, offline manager); about, credits, contact, tools and learn pages are cached on first visit by the navigation handler, so recently opened pages keep working offline and the rest need the network once. Shell is 1,757 KB; the check now fails CI. Signed-off-by: Devu Dilip <devu.dilip@gmail.com>
devudilip
force-pushed
the
chore/bundle-budget
branch
from
September 16, 2026 17:00
efa9aae to
1914bce
Compare
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.
Linked issue
Closes #50 (
accepted).What changed and why
npm run check:bundlemeasures what the service worker precaches as the app shell — everyPRECACHE_SHELLroute's HTML, the/_next/staticscripts, styles and fonts those pages reference, the manifest and its icons — from the static export, prints a table by group, and compares the total with a budget (default 2 MB,--budget <bytes>). Pure parsing and summing live inscripts/lib/bundle.tswith 9 unit tests. CI runs the check after the build.Measured today: JS chunks 977 KB, HTML 743 KB, fonts 338 KB, CSS 55 KB, icons 43 KB — 2,159 KB against a 2,048 KB budget, about 5 % over. The check therefore warns (exit 0) rather than fails until the owner decides whether to raise the budget or trim: the two ~128 KB font subsets and the shared JS chunks are the first candidates.
Checklist
npm run typecheckcleannpm testgreen (671)next buildgreen; check run against the real exportUpdate (owner decision)
Owner asked that not everything be precached: only core routes are installed offline, and every other page is cached the first time it is opened (the navigation handler already does this). Shell dropped from 2,159 KB to 1,757 KB, so the check now fails CI when over the 2 MB budget. Tests 671 green, typecheck clean.