Skip to content

fix(kdebek): split home page into per-section islands instead of one client:load blob - #8

Open
polubis wants to merge 1 commit into
mainfrom
claude/kdebek-home-react-optimization-ho8a7o
Open

fix(kdebek): split home page into per-section islands instead of one client:load blob#8
polubis wants to merge 1 commit into
mainfrom
claude/kdebek-home-react-optimization-ho8a7o

Conversation

@polubis

@polubis polubis commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • pages/index.astro used to hydrate the entire kdebek home page (Navbar + Hero + Testimonials + About + Offer + OnlineBookingCta + Footer) as a single client:load React island, shipping the full React/Astro runtime for sections that never use any client-side JS. This was flagged in apps/kdebek/TODO.md as the main driver of a 4.2s LCP (PageSpeed Insights audit).
  • Rewrote About, Offer, and OfferPanel as plain .astro components (zero shipped JS) and introduced a new home.astro composition root that replaces main.tsx.
  • Only the genuinely interactive pieces now hydrate as isolated islands:
    • Navbarclient:load (above the fold — mobile menu needs to be usable immediately)
    • AboutGallery, Counter (×6 in the stats grid), OfferWidgetclient:visible (below the fold)
  • Everything else (Hero, Testimonials, ServicesGrid, BookingWidget, OpeningHours, OnlineBookingCta, Footer) now renders as static SSR markup with no client JS at all.
  • Verified in the built output that only navbar, about-gallery, counter, and offer-widget chunks are hydrated (plus the shared React runtime) — no static leaf component's JS ships to the client anymore.
  • Updated apps/kdebek/TODO.md to check off the resolved item.

Test plan

  • astro build succeeds; inspected dist/client/index.html and confirmed only the 4 intended components hydrate as islands
  • astro check (type-check) — 0 errors
  • eslint — clean
  • vitest run — passing
  • Manual smoke test via astro dev + Playwright screenshots of Hero, About, Offer, and Footer sections — visual output matches prior behavior, no console errors
  • Playwright e2e specs (accessibility.spec.ts, visual.spec.ts) could not be run in this sandbox due to a Chromium chrome-headless-shell version mismatch unrelated to this change — recommend running pnpm test:e2e in CI to confirm

Generated by Claude Code

…client:load blob

pages/index.astro hydrated the entire home page (Navbar + Hero + Testimonials
+ About + Offer + OnlineBookingCta + Footer) as a single client:load React
island, shipping ~83KB of React/Astro runtime JS even for sections that never
use hooks or handlers. This was the main driver of a 4.2s LCP.

Rewrite About, Offer, and OfferPanel as plain .astro components (zero JS) and
compose the home page directly in a new home.astro entry point. Only the
genuinely interactive pieces now hydrate as islands: Navbar (client:load,
above the fold) and AboutGallery/Counter/OfferWidget (client:visible, below
the fold). Hero, Testimonials, ServicesGrid, BookingWidget, OpeningHours,
OnlineBookingCta, and Footer render as static markup with no client JS.
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.

2 participants