Perf/cold start and lighthouse protocol#49
Merged
Conversation
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>
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.
No description provided.