Skip to content

fix(pwa): Lighthouse pass — accessibility 100, deduped fetches (#28) - #95

Merged
devudilip merged 2 commits into
mainfrom
fix/lighthouse-pass
Sep 16, 2026
Merged

devudilip merged 2 commits into
mainfrom
fix/lighthouse-pass

Conversation

@devudilip

@devudilip devudilip commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Linked issue

Refs #28 (accepted). Partial: the installability and accessibility targets are met; performance ≥ 90 is not reached in a local run and needs a measurement against the deployed site (Cloudflare, HTTP/2) before deciding on further work.

What changed and why

Mobile Lighthouse on the static export, before → after:

Page Performance Accessibility
/ 0.56 → 0.83 0.96 → 1.00
/library 0.62 → 0.64 0.96 → 1.00
  • Concurrent fetch() calls for the books manifest, picture-book manifest and proverbs file loaded the same JSON two or three times on first paint; each loader now shares one in-flight promise.
  • Contrast: the active tab label and the active library filter chip used coral on ivory at 3.0:1; they now use the existing accent-strong token (about 5.9:1). Wordmark links lose a redundant aria-label so their accessible name matches the visible text.
  • Static PWA checks all pass: manifest link, theme-color, apple-touch-icon, maskable icon, start_url in scope, production service worker, fonts with display swap.

Remaining, for an owner decision: the same coral-on-ivory pattern in shared Button/LinkButton and about a dozen components (a separate audit), and whether to defer the analytics tag, which is the largest third-party cost on first paint. The largest remaining opportunity Lighthouse reports is unused JavaScript from route prefetching.

Checklist

  • npm run typecheck clean
  • npm test green (662)
  • next build green; Lighthouse run against the export
  • No new dependencies; no runtime fetch to third parties added
  • Tokens only; DCO sign-off

Update (owner decision)

Owner agreed to defer the analytics tag: the GA4 script now loads with lazyOnload (after load and idle) instead of afterInteractive. On the deployed v0.3.0 it was the largest download on every page (171 KB) and finished before the fonts. Cloudflare Web Analytics still counts very short visits.

Deployed-site Lighthouse (mobile, v0.3.0, before these PRs): home perf 0.74 / LCP 5.3 s, library perf 0.73 / LCP 8.7 s. Library LCP is the first picture-book cover, which only starts after the client-side manifest fetch; that is the next step for #28 (render first covers from build-time data) and will be a separate PR.

…tches (#28)

Mobile Lighthouse on the static export: accessibility 0.96 → 1.00 on /
and /library (active tab label and active filter chip now use the
accent-strong token for AA contrast; wordmark links no longer carry a
redundant aria-label), performance 0.56 → 0.83 on / after deduplicating
concurrent manifest and proverb fetches that loaded the same JSON two or
three times on first paint. Installability checks all pass. Performance
on /library stays at 0.64 locally, dominated by LCP render delay under a
single-threaded HTTP/1.1 test server plus the analytics round trip; a
true reading needs a run against the deployed site.

Signed-off-by: Devu Dilip <devu.dilip@gmail.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deploying sirigannada with  Cloudflare Pages  Cloudflare Pages

Latest commit: 902c27a
Status: ✅  Deploy successful!
Preview URL: https://60c88343.sirigannada.pages.dev
Branch Preview URL: https://fix-lighthouse-pass.sirigannada.pages.dev

View logs

On the deployed site the 171 KB gtag script was the largest download on
every page and finished before the fonts. lazyOnload defers it until after
load and idle, keeping first paint free of third-party work. Very short
visits may go uncounted; Cloudflare Web Analytics still sees them.

Signed-off-by: Devu Dilip <devu.dilip@gmail.com>
@devudilip
devudilip merged commit b720330 into main Sep 16, 2026
6 checks passed
@devudilip
devudilip deleted the fix/lighthouse-pass branch September 16, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant