Skip to content

perf(trending): hydrate board rows past the head on view - #524

Merged
harlan-zw merged 2 commits into
mainfrom
perf/trending-hydration
Oct 7, 2026
Merged

harlan-zw merged 2 commits into
mainfrom
perf/trending-hydration

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

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

📚 Description

/skills/trending renders about 4,400 elements: thirty rows, each with every post in its carousel. That HTML is deliberate, so crawlers and touch scrolling see every post. The cost was hydration: the page hydrated all thirty rows in one long task before it responded.

  • Rows past the head hydrate on view. BoardRankedList keeps the first five rows as they were. The rest use hydrate-on-visible, so they render on the server unchanged and hydrate once they scroll into view. The element count stays the same.
  • A late row still reports a gone avatar. A row that hydrates late misses its avatar's error event, and the board would keep a broken image for an owner whose account is gone. _SkillCardIdentity.vue now reads the image on mount and reports one that already failed.

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

Metric Before After
Longest main-thread task 893 ms 431 ms
TBT 596 ms 416 ms
Score 47 54

The local board had 8 rows and no posts, so production, with 30 rows and their posts, defers more. The machine ran other builds at a load average of 69 to 107, so treat single runs as noisy; the builds alternated run by run to share that load.

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

A row that hydrates late misses its avatar's error event, so the board kept a gone owner's broken image. The mount now reads the image.
The board hydrated all thirty rows, every post included, before it responded. Rows past the first five 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.

@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 045d238 into main Oct 7, 2026
6 checks passed
@harlan-zw
harlan-zw deleted the perf/trending-hydration branch October 7, 2026 02:29
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