Skip to content

Comments

perf: Fix non-composited animations and reduce critical-path waste#122

Merged
vibemarketerpromax merged 1 commit intomainfrom
fix/pagespeed-diagnostics
Feb 23, 2026
Merged

perf: Fix non-composited animations and reduce critical-path waste#122
vibemarketerpromax merged 1 commit intomainfrom
fix/pagespeed-diagnostics

Conversation

@vibemarketerpromax
Copy link
Collaborator

Summary

  • 4 non-composited animations → compositor-friendly transforms: PageSpeed flagged 4 animations forcing layout recalculation. Replaced height, width animations with scaleY/scaleX transforms that run on the GPU compositor thread.
  • Removed wasted preconnect: Cal.com preconnect on /contact-us wastes a TCP+TLS handshake during the critical rendering window — downgraded to dns-prefetch.
  • Added missing "use client" directive to card-hover-effect.tsx (uses useState and event handlers).

Changes

File What changed
components/sections/FAQ.tsx Replaced framer-motion AnimatePresence height animation with CSS grid-template-rows transition
components/ui/timeline.tsx Replaced scroll-driven height animation with scaleY transform
components/sections/Testimonials.tsx Replaced dot width transition with scaleX transform
components/sections/Services.tsx Replaced decorative line width transition with scaleX transform
components/ui/card-hover-effect.tsx Added missing "use client" directive
app/contact-us/layout.tsx Downgraded Cal.com preconnect to dns-prefetch

Why these matter

Non-composited animations (height, width) trigger layout recalculation on every frame, blocking the main thread. Transform-based alternatives (scaleY, scaleX) run entirely on the GPU compositor, eliminating jank and reducing main-thread work — directly addressing PageSpeed's "Avoid non-composited animations" diagnostic.

Test plan

  • TypeScript: clean (npx tsc --noEmit)
  • Lint: 0 errors (3 pre-existing warnings)
  • Playwright: FAQ accordion open/close, testimonial dot navigation, service card hover — all functional
  • Build compilation: successful (runtime blog page failure is pre-existing NOTION_TOKEN dependency)

- Replace FAQ height animation (AnimatePresence) with CSS grid-template-rows transition
- Replace Timeline scroll-driven height with scaleY transform
- Replace Testimonials dot width transition with scaleX transform
- Replace Services decorative line width transition with scaleX transform
- Add missing "use client" directive to card-hover-effect.tsx
- Downgrade Cal.com preconnect to dns-prefetch on contact page
@cloudflare-workers-and-pages
Copy link

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 751d489
Status: ✅  Deploy successful!
Preview URL: https://1a748f4e.website-yiq.pages.dev
Branch Preview URL: https://fix-pagespeed-diagnostics.website-yiq.pages.dev

View logs

@vibemarketerpromax vibemarketerpromax merged commit f7ac95d into main Feb 23, 2026
5 checks passed
@vibemarketerpromax vibemarketerpromax deleted the fix/pagespeed-diagnostics branch February 23, 2026 14:07
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