Skip to content

perf: Fix LCP delay and remove hardcoded polyfill bundle#109

Merged
vibemarketerpromax merged 1 commit intomainfrom
perf/lighthouse-prometheus-v3
Feb 19, 2026
Merged

perf: Fix LCP delay and remove hardcoded polyfill bundle#109
vibemarketerpromax merged 1 commit intomainfrom
perf/lighthouse-prometheus-v3

Conversation

@vibemarketerpromax
Copy link
Collaborator

Summary

  • Fix LCP 2.9s → ~1.2s: Hero CSS animations had opacity: 0 as initial state, which prevented the browser from counting hero elements as LCP until animation completed (~1.7s delay). Switched to animation-fill-mode: both which lets keyframes handle the opacity transition without an explicit invisible initial state.
  • Remove 68 KiB polyfill bundle: Next.js hardcodes a polyfill-nomodule chunk via CopyFilePlugin regardless of browserslist targets. Our previous alias only removed the smaller polyfill-module (1.4 KiB). This filters out the CopyFilePlugin entirely, eliminating 13 KiB of legacy JS warnings and ~26 KiB of unused JS.

Expected impact

Metric Before Expected After
LCP 2.9s ~1.2s (same as FCP)
Legacy JS 13 KiB wasted 0
Unused JS 60 KiB ~27 KiB (33.6 KiB chunk remains — separate optimization)

Test plan

  • Verify hero section still animates (fade-in on tagline, description, CTAs)
  • Verify no visual regression — animations look identical
  • Verify build passes in CI
  • Run Lighthouse on /services/prometheus-monitoring — LCP should drop to ~1.2s
  • Verify no polyfill chunk in network waterfall

- Remove opacity:0 initial state from hero CSS animations. The browser
  won't count invisible elements as LCP, so setting opacity:0 in CSS
  delayed LCP from 1.2s (FCP) to 2.9s (animation completion). Using
  animation-fill-mode: both lets keyframes handle the 0→1 transition
  without an explicit initial invisible state.

- Filter out Next.js hardcoded polyfill-nomodule CopyFilePlugin. Next.js
  unconditionally bundles a 68 KiB polyfill chunk (Array.at, flat,
  Object.fromEntries, etc.) via CopyFilePlugin regardless of browserslist.
  Our targets (Chrome 109+, Safari 17+, Firefox 115+) don't need these.
  The previous polyfill-module alias only removed the smaller 1.4 KiB file.
@cloudflare-workers-and-pages
Copy link

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 670eeb4
Status: ✅  Deploy successful!
Preview URL: https://9342ea88.website-yiq.pages.dev
Branch Preview URL: https://perf-lighthouse-prometheus-v.website-yiq.pages.dev

View logs

@vibemarketerpromax vibemarketerpromax merged commit 61b3cb1 into main Feb 19, 2026
4 of 5 checks passed
@vibemarketerpromax vibemarketerpromax deleted the perf/lighthouse-prometheus-v3 branch February 19, 2026 11:54
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

Comments