Skip to content

Upgrade @lhci/cli to 0.15.1 and restore insight audits - #2034

Merged
benbalter merged 1 commit into
mainfrom
audit-lhci-upgrade
Sep 27, 2026
Merged

benbalter merged 1 commit into
mainfrom
audit-lhci-upgrade

Conversation

@benbalter

Copy link
Copy Markdown
Owner

Version change

@lhci/cli 0.14.0 to 0.15.1 (latest). It bundles Lighthouse 12.6.1, up from 12.1.0. Lighthouse itself is at 13.5.0, but no @lhci/cli release ships 13 yet, so the 12-to-13 audit removals and merges don't apply. I checked every assertion key and every lighthouse:no-pwa preset key against 12.6.1's default config, and none are stale.

The one pin is in .github/workflows/astro-e2e.yml.

Why the config had to change

The 0.15.x no-pwa preset grew from 147 to 167 assertions and puts the new insight audits at error. With the old config, 0.15.1 failed all three pages. Each audit now has an explicit level:

Audit Decision Reason
image-delivery-insight Re-enabled (warn) Removed in d134acb only because 12.1.0 didn't have it. 12.6.1 has it. It flagged the BookCta cover on / and /about: 440w served into a 176px slot, 14 KiB wasted. Fixed in the component (below), and it now passes.
network-dependency-tree-insight Re-enabled (warn) Also removed in d134acb for being missing from 12.1.0. The trace engine fails it for any chain of 2+ requests, so it scores 0 on every page. Warn matches what it was set to before removal.
cls-culprits-insight New, warn Fails on /about (headshot shift, 0.138). The same shift already shows up under cumulative-layout-shift (0.79), which is warn, so this matches it.
robots-txt Kept off 12.6.1's DIRECTIVE_SAFELIST still doesn't include Content-Signal, so robots.txt still scores 0 with "Unknown directive". Still a false positive.

Site fix

BookCta.astro: the full-size cover now uses widths={[176, 224, 352, 448]} and sizes="(min-width: 768px) 224px, 176px" in place of densities={[1, 2]}. The generated sizes used to claim 220px at every breakpoint, so mobile at DPR 1.75 picked the 440w file. It now picks 352w.

Results

Local runs used lhci autorun against staticDistDir: ./dist-astro, one page at a time with --collect.url, the same way CI does. Each page had 3 runs. Upload went to the filesystem, not public storage.

Page 0.14.0 (LH 12.1.0) 0.15.1, old config 0.15.1, this PR
/ Pass. Perf 99, A11y 100, BP 100, SEO 92 Fail: image-delivery 0.5, network-tree 0 Pass. 99/100/100/92, warns: network-tree
/about/ Pass. 92/100/100/92, warns: CLS 0.79, FCP 0.83 Fail: cls-culprits 0, image-delivery 0.5, network-tree 0 Pass. 92/100/100/92, warns: cls-culprits, CLS, FCP, network-tree
/2014/11/06/rules-of-communicating-at-github/ Pass. 94/100/100/92, warns: FCP 0.68, LCP 0.88 Fail: network-tree 0 Pass. 93/100/100/92, warns: FCP, LCP, network-tree

SEO sits at 92 on every page and version because of robots-txt. npm run check is clean.

🤖 Generated with Claude Code

@lhci/cli 0.15.1 bundles Lighthouse 12.6.1 (was 12.1.0 in 0.14.0). Its
no-pwa preset now asserts the 12.6 insight audits at error, so the bump
alone fails CI on all three pages. Set explicit levels:

- image-delivery-insight: restored at warn (removed in d134acb only
  because 12.1.0 lacked it). It flagged the BookCta cover serving 440w
  for a 176px slot; switch it to explicit widths with a matching sizes
  attribute so the browser picks 352w, which clears the audit.
- network-dependency-tree-insight: restored at warn. The trace engine
  fails it for any chain of 2+ requests, so every page scores 0.
- cls-culprits-insight: warn, matching cumulative-layout-shift, which
  already warns on the /about headshot shift.
- robots-txt: still off. 12.6.1's directive safelist still lacks
  Content-Signal and scores robots.txt 0.

No assertion or preset keys are stale in 12.6.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@benbalter
benbalter merged commit df804da into main Sep 27, 2026
17 checks passed
@benbalter
benbalter deleted the audit-lhci-upgrade branch September 27, 2026 14:18
benbalter added a commit that referenced this pull request Sep 27, 2026
After the lhci 0.15 upgrade (#2034), the no-pwa preset asserts
forced-reflow-insight at error, and main's Lighthouse jobs fail:
- Post pages: 64ms of forced reflow attributed to ReadingProgress, which
  read getBoundingClientRect/offsetHeight synchronously at startup. It now
  measures from a ResizeObserver (runs after layout, and re-fires as images
  and fonts settle, replacing the load listener).
- /about: ~30ms of reflow Lighthouse can't attribute to any script, so the
  pass/fail insight goes to warn like the other insights.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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