Skip to content

perf(home): hydrate the sections under the hero on view - #523

Merged
harlan-zw merged 1 commit into
mainfrom
perf/home-hydration
Oct 7, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
perf/home-hydration

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The homepage's first frame waited for the whole page to hydrate. In a Lighthouse trace of the mobile run, the first paint came right after the hydration task, about 650 ms after the HTML had parsed. Lighthouse then charged every preloaded script to the hero heading, the page's LCP.

The demos, the trending board and the agents band now use Nuxt's hydrate-on-visible. They still render on the server with every link and text, and their code loads and hydrates once they scroll into view. The hero, the lifecycle band and the sections that fetch their own data hydrate as before.

Five alternating Lighthouse 13.5 mobile runs of each build, cold cache, local pnpm build served by wrangler dev, medians:

Metric Before After
Observed first paint 2,353 ms 746 ms
LCP, simulated 7.2 s 3.9 s
FCP, simulated 5.3 s 3.5 s
TBT 440 ms 241 ms
Score 51 76
modulepreload links in the HTML 43 38

The machine ran other builds at the time, with a load average of 44 to 73, so single runs vary. The builds alternated run by run to share that load.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The homepage preloaded and hydrated every section before the first frame. Demos, the trending board and the agents band now render on the server and hydrate once they scroll into view.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 7, 2026
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

Agent check (Claude Code, Harlan Agent Kit), since CI cannot cover it:

  • Compared each element's box and computed style between main and this branch on the six launch pages, at 412 and 1350 pixels, with scripts off and on: 0 rows differ.
  • On the local build, a demo pick on the homepage still switches the stage after the section scrolls into view, at both widths, with no console errors or warnings.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 7, 2026
@harlan-zw
harlan-zw merged commit b9b213b into main Oct 7, 2026
6 checks passed
@harlan-zw
harlan-zw deleted the perf/home-hydration branch October 7, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant