Skip to content

Perf/cold start and lighthouse protocol#49

Merged
dancodingbr merged 2 commits into
mainfrom
perf/cold-start-and-lighthouse-protocol
May 7, 2026
Merged

Perf/cold start and lighthouse protocol#49
dancodingbr merged 2 commits into
mainfrom
perf/cold-start-and-lighthouse-protocol

Conversation

@dancodingbr
Copy link
Copy Markdown
Owner

No description provided.

dancodingbr and others added 2 commits May 7, 2026 16:16
CLS of 0.997 was caused by a 3-level sequential JS chain that left
<app-root> blank for ~300ms before Angular rendered all content at once:
  index.html → main.js → home.chunk → productList.chunk (299ms total)

Two fixes:

1. Make Home and ProductList routes non-lazy in app.routes.ts so both
   are bundled into main.js. Since Home already statically imports
   ProductList, this collapses the chain to a single main.js fetch.
   Initial bundle grows from ~12KB to ~19KB (gzipped) — still tiny.

2. Add an inline CSS skeleton inside <app-root> in index.html that
   mirrors the home page layout (header, dark hero section, 4-col
   product grid). The skeleton is visible during the JS loading gap
   and is automatically removed when Angular bootstraps, so the
   layout shift from blank→content is replaced by skeleton→content
   which causes near-zero CLS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dancodingbr dancodingbr merged commit 4e90a39 into main May 7, 2026
23 checks passed
@dancodingbr dancodingbr deleted the perf/cold-start-and-lighthouse-protocol branch May 7, 2026 19:26
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