Skip to content

perf(web): fix Lighthouse Speed Index — replace spinner with SVG PE-grid skeleton#15

Merged
deaneeth merged 1 commit into
devfrom
perf/lighthouse-speed-index
Jun 5, 2026
Merged

perf(web): fix Lighthouse Speed Index — replace spinner with SVG PE-grid skeleton#15
deaneeth merged 1 commit into
devfrom
perf/lighthouse-speed-index

Conversation

@deaneeth

@deaneeth deaneeth commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaced the blank spinner skeleton in LandingEmbed with a static SVG that mirrors the exact PEGrid layout (4×4 cells, same CELL/GAP/offset constants, same CSS color vars) — page is visually complete at FCP (~0.8 s) instead of after WASM loads (~7–8 s)
  • Added opt-in preloadWasm prop to Layout.astro that emits <link rel="preload" as="fetch" href="/tiny_tpu.wasm"> to start the binary download during HTML parse rather than after React hydration
  • Added web/.gitignore to exclude the .vercel local-link directory

Why

Lighthouse Speed Index scored 0 (7.8 s) on the first deploy because the skeleton left the hero section visually empty while WASM downloaded. All other metrics (FCP, LCP, TBT, CLS, TTI) were already excellent. This change makes the page appear complete immediately at FCP, targeting Speed Index ≤ 1.5 s and overall Performance ≥ 90.

Test plan

  • Visit https://tiny-tpu.vercel.app — hero section shows a pulsing 4×4 grid immediately on load, then transitions to the live WASM animation
  • No layout shift when WASM loads (CLS = 0)
  • Run Lighthouse on / — Performance ≥ 90, Speed Index ≤ 2 s
  • pnpm lint && pnpm typecheck && pnpm build — all clean

The landing page skeleton was an empty spinner, causing Lighthouse
Speed Index to score 0 (7.8 s) while WASM downloaded. Replaced it with
a static SVG that mirrors the exact PEGrid layout (4×4 cells at the same
CELL/GAP/offsets and CSS color vars) so the page is visually complete at
FCP (~0.8 s). Also added opt-in preloadWasm prop to Layout.astro to emit
<link rel="preload" as="fetch"> for tiny_tpu.wasm on WASM-using pages,
starting the binary download earlier during HTML parse.

Affected: LandingEmbed.tsx, Layout.astro, index.astro, app.astro
@deaneeth deaneeth self-assigned this Jun 5, 2026
Repository owner deleted a comment from vercel Bot Jun 5, 2026
@deaneeth deaneeth merged commit afe1df5 into dev Jun 5, 2026
3 of 4 checks passed
@deaneeth deaneeth deleted the perf/lighthouse-speed-index branch June 5, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant